Skip to content

Instantly share code, notes, and snippets.

@Voultapher
Created July 8, 2018 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Voultapher/6e5e0d948aae4caffe22ee2285cb889f to your computer and use it in GitHub Desktop.
Save Voultapher/6e5e0d948aae4caffe22ee2285cb889f to your computer and use it in GitHub Desktop.
clang++ -O3 -std=c++17 main.cpp -emit-llvm -S
; ModuleID = 'main.cpp'
source_filename = "main.cpp"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
; Function Attrs: readnone sspstrong uwtable
define { i64, i8 } @_Z15return_optionall(i64) local_unnamed_addr #0 {
%2 = icmp slt i64 %0, 32
%3 = srem i64 %0, 752
%4 = zext i1 %2 to i8
%5 = insertvalue { i64, i8 } undef, i64 %3, 0
%6 = insertvalue { i64, i8 } %5, i8 %4, 1
ret { i64, i8 } %6
}
; Function Attrs: readnone sspstrong uwtable
define i64 @_Z3fool(i64) local_unnamed_addr #0 {
%2 = icmp sgt i64 %0, 31
%3 = srem i64 %0, 752
%4 = select i1 %2, i64 17, i64 %3
%5 = add nsw i64 %4, %0
ret i64 %5
}
attributes #0 = { readnone sspstrong uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
!llvm.module.flags = !{!0, !1, !2}
!llvm.ident = !{!3}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 7, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{!"clang version 6.0.0 (tags/RELEASE_600/final)"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment