Thanks for using Compiler Explorer
Sponsors
Jakt
C++
Ada
Algol68
Analysis
Android Java
Android Kotlin
Assembly
C
C3
Carbon
C with Coccinelle
C++ with Coccinelle
C++ (Circle)
CIRCT
Clean
CMake
CMakeScript
COBOL
C++ for OpenCL
MLIR
Cppx
Cppx-Blue
Cppx-Gold
Cpp2-cppfront
Crystal
C#
CUDA C++
D
Dart
Elixir
Erlang
Fortran
F#
GLSL
Go
Haskell
HLSL
Hook
Hylo
IL
ispc
Java
Julia
Kotlin
LLVM IR
LLVM MIR
Modula-2
Mojo
Nim
Numba
Nix
Objective-C
Objective-C++
OCaml
Odin
OpenCL C
Pascal
Pony
PTX
Python
Racket
Raku
Ruby
Rust
Sail
Snowball
Scala
Slang
Solidity
Spice
SPIR-V
Swift
LLVM TableGen
Toit
Triton
TypeScript Native
V
Vala
Visual Basic
Vyper
WASM
Yul (Solidity IR)
Zig
Javascript
GIMPLE
Ygen
sway
llvm source #1
Output
Compile to binary object
Link to binary
Execute the code
Intel asm syntax
Demangle identifiers
Verbose demangling
Filters
Unused labels
Library functions
Directives
Comments
Horizontal whitespace
Debug intrinsics
Compiler
clang (assertions trunk)
clang (trunk)
clang 10.0.0
clang 10.0.1
clang 11.0.0
clang 11.0.1
clang 12.0.0
clang 12.0.1
clang 13.0.0
clang 14.0.0
clang 15.0.0
clang 16.0.0
clang 17.0.1
clang 18.1.0
clang 19.1.0
clang 20.1.0
clang 21.1.0
clang 4.0.1
clang 5.0.0
clang 6.0.0
clang 7.0.0
clang 8.0.0
clang 9.0.0
hexagon-clang 16.0.5
llc (assertions trunk)
llc (trunk)
llc 10.0.0
llc 10.0.1
llc 11.0.0
llc 11.0.1
llc 12.0.0
llc 12.0.1
llc 13.0.0
llc 14.0.0
llc 15.0.0
llc 16.0.0
llc 17.0.1
llc 18.1.0
llc 19.1.0
llc 20.1.0
llc 21.1.0
llc 3.2
llc 3.3
llc 3.9.1
llc 4.0.0
llc 4.0.1
llc 5.0.0
llc 6.0.0
llc 7.0.0
llc 8.0.0
llc 9.0.0
opt (assertions trunk)
opt (trunk)
opt 10.0.0
opt 10.0.1
opt 11.0.0
opt 11.0.1
opt 12.0.0
opt 12.0.1
opt 13.0.0
opt 14.0.0
opt 15.0.0
opt 16.0.0
opt 17.0.1
opt 18.1.0
opt 19.1.0
opt 20.1.0
opt 21.1.0
opt 3.2
opt 3.3
opt 3.9.1
opt 4.0.0
opt 4.0.1
opt 5.0.0
opt 6.0.0
opt 7.0.0
opt 8.0.0
opt 9.0.0
Options
Source code
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-unknown-linux-gnu" @var_32 = external global i16 @var_35 = external global i64 @var_39 = external global i64 @var_46 = external global i64 @var_50 = external global i32 define void @_Z4testbtxasbiisjaytyajxiPA23_iPA24_aPtPA24_S1_PA24_A24_sPA24_A24_bS5_PA24_A24_xPjPsS8_PA24_A24_hS8_S8_PA24_A24_tS8_SM_SE_SJ_SE_(i1 %var_0, i16 %var_1, i64 %var_2, i8 %var_3, i16 %var_4, i1 %var_5, i32 %var_6, i32 %var_7, i8 %var_10, i64 %var_11, i8 %var_14, i32 %var_15, i64 %var_16, ptr %arr_3, ptr %arr_4, ptr %arr_6, ptr %arr_7, ptr %arr_12, ptr %arr_13, ptr %arr_19, i64 %mul, i64 %conv35, i64 %idxprom138.us16, i8 %0, i8 %1, ptr %invariant.gep875.us) #0 { entry: br i1 %var_5, label %for.body41.lr.ph, label %for.cond563.preheader for.body41.lr.ph: ; preds = %entry %arrayidx147 = getelementptr i8, ptr %arr_3, i64 120 %tobool326.not = icmp eq i64 %var_2, 0 %not353 = xor i64 0, -1 %add538 = select i1 %var_0, i16 0, i16 1 br i1 %var_0, label %for.body41.us, label %for.body41 for.body41.us: ; preds = %for.cond.cleanup93.us, %for.body41.lr.ph %var_24.promoted9271009.us = phi i64 [ 0, %for.body41.lr.ph ], [ %6, %for.cond.cleanup93.us ] %var_37.promoted9301008.us = phi i64 [ 1, %for.body41.lr.ph ], [ 0, %for.cond.cleanup93.us ] %2 = phi i8 [ 0, %for.body41.lr.ph ], [ 1, %for.cond.cleanup93.us ] %add4139751001.us = phi i16 [ 0, %for.body41.lr.ph ], [ 1, %for.cond.cleanup93.us ] %3 = phi i8 [ 0, %for.body41.lr.ph ], [ %var_10, %for.cond.cleanup93.us ] store i32 %var_6, ptr %arr_3, align 4 store i8 %var_10, ptr %arr_3, align 1 br label %for.body67.us for.body67.us: ; preds = %for.cond.cleanup93.us, %for.body41.us %4 = phi i8 [ %3, %for.body41.us ], [ 0, %for.cond.cleanup93.us ] %add413977.us = phi i16 [ %add4139751001.us, %for.body41.us ], [ %add413.us17, %for.cond.cleanup93.us ] %5 = phi i8 [ %2, %for.body41.us ], [ %.sroa.speculated829.us, %for.cond.cleanup93.us ] %conv64922.us = phi i32 [ 1, %for.body41.us ], [ 0, %for.cond.cleanup93.us ] %6 = phi i64 [ %var_24.promoted9271009.us, %for.body41.us ], [ %.sroa.speculated832.us, %for.cond.cleanup93.us ] %mul354903918.us = phi i64 [ %var_37.promoted9301008.us, %for.body41.us ], [ 0, %for.cond.cleanup93.us ] %i_2.0921.us = zext i32 %var_15 to i64 %.sroa.speculated832.us = tail call i64 @llvm.umin.i64(i64 %var_24.promoted9271009.us, i64 -30) %sext1023 = shl i64 %i_2.0921.us, 1 %idxprom138.us162 = ashr i64 %sext1023, 1 %gep889.us = getelementptr [24 x i16], ptr %arr_19, i64 %idxprom138.us16 %arrayidx149.us = getelementptr i8, ptr %arrayidx147, i64 %idxprom138.us162 %arrayidx319.us = getelementptr [24 x i8], ptr null, i64 %idxprom138.us162 %7 = sext i32 %conv64922.us to i64 %8 = getelementptr i32, ptr %arr_12, i64 %7 %arrayidx226.us = getelementptr i8, ptr %8, i64 -12 br label %for.cond95.preheader.us for.cond.cleanup93.us: ; preds = %for.cond.cleanup98.us br i1 %var_5, label %for.body67.us, label %for.body41.us for.cond.cleanup98.us: ; preds = %for.cond510.preheader.us br i1 %var_0, label %for.cond.cleanup93.us, label %for.cond95.preheader.us for.body99.us: ; preds = %for.cond95.preheader.us, %for.cond510.preheader.us %mul287985.us = phi i16 [ 0, %for.cond95.preheader.us ], [ %mul287.us, %for.cond510.preheader.us ] %9 = phi i8 [ %29, %for.cond95.preheader.us ], [ %var_14, %for.cond510.preheader.us ] %add413979.us = phi i16 [ %add413978.us, %for.cond95.preheader.us ], [ %add413.us17, %for.cond510.preheader.us ] %10 = phi i32 [ 0, %for.cond95.preheader.us ], [ %26, %for.cond510.preheader.us ] %mul354905.us = phi i64 [ %mul354904.us, %for.cond95.preheader.us ], [ %mul354907.us, %for.cond510.preheader.us ] %sub283896.us = phi i64 [ 1, %for.cond95.preheader.us ], [ %sub283.us, %for.cond510.preheader.us ] %conv96880.us = phi i64 [ 1, %for.cond95.preheader.us ], [ 0, %for.cond510.preheader.us ] %.sroa.speculated829.us = tail call i8 @llvm.smin.i8(i8 %30, i8 0) br label %for.body113.us for.body380.us: ; preds = %for.cond376.preheader.us, %for.inc505.us %indvars.iv1018 = phi i64 [ 0, %for.cond376.preheader.us ], [ %indvars.iv.next1019, %for.inc505.us ] %11 = phi i8 [ 0, %for.cond376.preheader.us ], [ %13, %for.inc505.us ] %add413980.us = phi i16 [ %add413979.us, %for.cond376.preheader.us ], [ 0, %for.inc505.us ] %12 = load i16, ptr %arrayidx384.us, align 2 store i16 %12, ptr %invariant.gep875.us, align 2 %add413.us17 = or i16 %add413980.us, 0 %arrayidx416.us = getelementptr i16, ptr %arr_13, i64 %indvars.iv1018 %conv419.us = select i1 %var_0, i32 36006, i32 -7680 store i32 %conv419.us, ptr @var_50, align 4 %tobool435.not.us = icmp eq i64 %mul, 0 br i1 %tobool435.not.us, label %for.inc505.us, label %if.then436.us if.then436.us: ; preds = %for.body380.us %.sroa.speculated817.us = tail call i8 @llvm.smax.i8(i8 %11, i8 0) %cond464.in.us = load i16, ptr %gep876.us, align 2 %tobool465.not.us = icmp eq i16 %cond464.in.us, 0 br i1 %tobool465.not.us, label %for.inc505.us, label %if.then466.us if.then466.us: ; preds = %if.then436.us store i64 %conv35, ptr %arr_3, align 8 br label %for.inc505.us for.inc505.us: ; preds = %if.then466.us, %if.then436.us, %for.body380.us %13 = phi i8 [ %11, %for.body380.us ], [ %.sroa.speculated817.us, %if.then466.us ], [ 0, %if.then436.us ] %indvars.iv.next1019 = add i64 %indvars.iv1018, 1 %cmp378.us = icmp ult i64 %indvars.iv1018, 0 br i1 %cmp378.us, label %for.body380.us, label %for.cond510.preheader.us for.body194.us: ; preds = %if.end.us.7, %for.inc371.us %indvars.iv = phi i64 [ 0, %if.end.us.7 ], [ %indvars.iv.next, %for.inc371.us ] %mul287986.us = phi i16 [ %mul287985.us, %if.end.us.7 ], [ %mul287.us, %for.inc371.us ] %14 = phi i8 [ %9, %if.end.us.7 ], [ %16, %for.inc371.us ] %mul354906.us = phi i64 [ %mul354905.us, %if.end.us.7 ], [ %var_11, %for.inc371.us ] %sub283897.us = phi i64 [ %sub283896.us, %if.end.us.7 ], [ 0, %for.inc371.us ] %tobool221.not.us = icmp eq i32 1, 0 br i1 %tobool221.not.us, label %if.end239.us, label %if.then222.us if.then222.us: ; preds = %for.body194.us %15 = load i32, ptr %arrayidx226.us, align 4 %conv227.us = trunc i32 %15 to i16 store i16 %conv227.us, ptr @var_32, align 2 %.sroa.speculated820.us = tail call i8 @llvm.smax.i8(i8 %14, i8 0) br label %if.end239.us if.end239.us: ; preds = %if.then222.us, %for.body194.us %16 = phi i8 [ %.sroa.speculated820.us, %if.then222.us ], [ 0, %for.body194.us ] store i8 -107, ptr %arr_7, align 1 %tobool253.not.us = icmp eq i8 %0, 0 br i1 %tobool253.not.us, label %if.end282.us, label %if.then254.us if.then254.us: ; preds = %if.end239.us %17 = load i16, ptr %arrayidx259.us, align 2 %tobool261.not.us = icmp eq i16 %17, 0 %conv268.us = select i1 %tobool261.not.us, i64 0, i64 %var_16 store i64 %conv268.us, ptr @var_35, align 8 %gep867.us = getelementptr [24 x [24 x i64]], ptr null, i64 %indvars.iv store i16 %var_1, ptr %arr_6, align 2 br label %if.end282.us if.end282.us: ; preds = %if.then254.us, %if.end239.us %sub283.us = or i64 %sub283897.us, -434259939 store i64 %sub283.us, ptr %arr_4, align 8 %mul287.us = mul i16 %mul287986.us, -18978 store i64 0, ptr @var_39, align 8 %18 = load i8, ptr %arrayidx321.us, align 1 %conv322.us = zext i8 %18 to i64 store i64 %conv322.us, ptr %arr_4, align 8 br i1 %tobool326.not, label %if.then327.us, label %for.inc371.us if.then327.us: ; preds = %if.end282.us %tobool330.not.us = icmp eq i32 0, 0 br i1 %tobool330.not.us, label %cond.end345.us, label %cond.true331.us cond.true331.us: ; preds = %if.then327.us %19 = load i8, ptr null, align 1 %20 = sext i8 %19 to i16 br label %cond.end345.us cond.end345.us: ; preds = %cond.true331.us, %if.then327.us %cond346.us = phi i16 [ %20, %cond.true331.us ], [ 0, %if.then327.us ] store i16 %cond346.us, ptr %arr_4, align 2 %mul354.us = mul i64 %mul354906.us, %not353 store i64 %mul354.us, ptr @var_46, align 8 br label %for.inc371.us for.inc371.us: ; preds = %cond.end345.us, %if.end282.us %mul354907.us = phi i64 [ 1, %if.end282.us ], [ 0, %cond.end345.us ] %indvars.iv.next = or i64 %indvars.iv, 1 br i1 %var_0, label %for.body194.us, label %for.cond376.preheader.us cond.true146.us: ; preds = %for.cond131.preheader.us %21 = load i8, ptr %arrayidx149.us, align 1 %conv150.us = sext i8 %21 to i32 br label %cond.end154.us cond.end154.us: ; preds = %for.cond131.preheader.us, %cond.true146.us %cond155.us = phi i32 [ %conv150.us, %cond.true146.us ], [ 0, %for.cond131.preheader.us ] %shl.us = shl i32 %div.us, %cond155.us %tobool157.not.us = icmp eq i32 %shl.us, 0 br i1 %tobool157.not.us, label %if.end.us, label %if.then.us if.then.us: ; preds = %cond.end154.us store i32 0, ptr %arr_4, align 4 br label %if.end.us if.end.us: ; preds = %if.then.us, %cond.end154.us %22 = phi i32 [ 0, %if.then.us ], [ %10, %cond.end154.us ] store i8 %1, ptr %arr_4, align 1 call void @llvm.assume(i1 true) %23 = load i8, ptr %arrayidx149.us, align 1 %conv150.us.2 = sext i8 %23 to i32 %shl.us.2 = shl i32 18984, %conv150.us.2 %tobool157.not.us.2 = icmp eq i32 %shl.us.2, 0 br i1 %tobool157.not.us.2, label %if.then.us.5, label %if.then.us.2 if.then.us.2: ; preds = %if.end.us %.sroa.speculated826.us.2 = tail call i32 @llvm.smin.i32(i32 %10, i32 0) store i8 0, ptr %arr_4, align 1 br label %if.then.us.5 if.then.us.5: ; preds = %if.then.us.2, %if.end.us %24 = phi i32 [ 0, %if.then.us.2 ], [ %22, %if.end.us ] %.sroa.speculated826.us.5 = tail call i32 @llvm.smin.i32(i32 %24, i32 1410036665) br i1 %var_0, label %cond.end154.us.7, label %cond.true146.us.7 cond.true146.us.7: ; preds = %if.then.us.5 %25 = load i8, ptr %arrayidx149.us, align 1 %conv150.us.7 = sext i8 %25 to i32 br label %cond.end154.us.7 cond.end154.us.7: ; preds = %cond.true146.us.7, %if.then.us.5 %cond155.us.7 = phi i32 [ %conv150.us.7, %cond.true146.us.7 ], [ 0, %if.then.us.5 ] %shl.us.7 = shl i32 18984, %cond155.us.7 %tobool157.not.us.7 = icmp eq i32 %shl.us.7, 0 br i1 %tobool157.not.us.7, label %if.end.us.7, label %if.then.us.7 if.then.us.7: ; preds = %cond.end154.us.7 store i32 0, ptr %arr_3, align 4 br label %if.end.us.7 if.end.us.7: ; preds = %if.then.us.7, %cond.end154.us.7 %26 = phi i32 [ 0, %if.then.us.7 ], [ %.sroa.speculated826.us.5, %cond.end154.us.7 ] %arrayidx259.us = getelementptr i16, ptr %arrayidx257.us, i64 %conv96880.us br label %for.body194.us for.body113.us: ; preds = %for.body113.us, %for.body99.us br i1 %var_0, label %for.body113.us, label %for.cond131.preheader.us for.cond510.preheader.us: ; preds = %for.inc505.us %cmp97.us = icmp slt i16 %add538, 0 br i1 %cmp97.us, label %for.body99.us, label %for.cond.cleanup98.us for.cond376.preheader.us: ; preds = %for.inc371.us %arrayidx384.us = getelementptr i16, ptr null, i64 %conv96880.us %gep876.us = getelementptr [24 x [24 x i16]], ptr %invariant.gep875.us, i64 %conv96880.us br label %for.body380.us for.cond131.preheader.us: ; preds = %for.body113.us store i8 %var_3, ptr %arr_4, align 1 %27 = load i16, ptr %gep884.us, align 2 %28 = mul i16 18984, %27 %div.us = zext i16 %28 to i32 %tobool145.not.us = icmp eq i8 0, 0 br i1 %tobool145.not.us, label %cond.end154.us, label %cond.true146.us for.cond95.preheader.us: ; preds = %for.cond.cleanup98.us, %for.body67.us %indvars.iv1021 = phi i64 [ 1, %for.cond.cleanup98.us ], [ 0, %for.body67.us ] %29 = phi i8 [ %16, %for.cond.cleanup98.us ], [ %4, %for.body67.us ] %add413978.us = phi i16 [ %var_4, %for.cond.cleanup98.us ], [ %add413977.us, %for.body67.us ] %30 = phi i8 [ %.sroa.speculated829.us, %for.cond.cleanup98.us ], [ %5, %for.body67.us ] %mul354904.us = phi i64 [ 0, %for.cond.cleanup98.us ], [ %mul354903918.us, %for.body67.us ] %gep884.us = getelementptr [24 x [24 x i16]], ptr %gep889.us, i64 %indvars.iv1021 %arrayidx321.us = getelementptr i8, ptr %arrayidx319.us, i64 %indvars.iv1021 %arrayidx257.us = getelementptr [24 x i16], ptr null, i64 %indvars.iv1021 br label %for.body99.us for.cond563.preheader: ; preds = %for.body41, %entry ret void for.body41: ; preds = %for.body41.lr.ph store i8 0, ptr %arr_12, align 1 store i8 0, ptr %arr_3, align 1 br label %for.cond563.preheader ; uselistorder directives uselistorder i16 %add413.us17, { 1, 0 } uselistorder i16 %mul287.us, { 1, 0 } } ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i8 @llvm.smin.i8(i8, i8) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umin.i64(i64, i64) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i8 @llvm.smax.i8(i8, i8) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #1 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #2 ; uselistorder directives uselistorder ptr @llvm.smax.i8, { 1, 0 } uselistorder ptr @llvm.smin.i32, { 1, 0 } attributes #0 = { "frame-pointer"="non-leaf" "target-cpu"="grace" } attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #2 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
Become a Patron
Sponsor on GitHub
Donate via PayPal
Compiler Explorer Shop
Source on GitHub
Mailing list
Installed libraries
Wiki
Report an issue
How it works
Contact the author
CE on Mastodon
CE on Bluesky
Statistics
Changelog
Version tree