xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ foo(float);
void sumProd(int n) {
  float sum = 0.0;
  float prod = 1.0;
  for (int i = 1; i <= n; i++) {
    sum = sum + i;
    prod = prod * i;
    foo(prod);
  }
}


x86 assembly (clang, -O0):
<sumProd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed5(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1181 <sumProd+0x71>
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <foo@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1137 <sumProd+0x27>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumProd>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    115f <sumProd+0x4f>
mov    %edi,%r14d
neg    %r14d
movss  0xeda(%rip),%xmm0
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
xorps  %xmm1,%xmm1
cvtsi2ss %ebx,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,0x4(%rsp)
call   1030 <foo@plt>
movss  0x4(%rsp),%xmm0
lea    (%r14,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1130 <sumProd+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @sumProd(i32 %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store i32 %0, i32* %2
store float 0.000000e+00, float* %3
store float 1.000000e+00, float* %4
store i32 1, i32* %5
br label %6
6: ; preds = %21, %1
%7 = load i32, i32* %5
%8 = load i32, i32* %2
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %24
10: ; preds = %6
%11 = load float, float* %3
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to float
%14 = fadd float %11, %13
store float %14, float* %3
%15 = load float, float* %4
%16 = load i32, i32* %5
%17 = sitofp i32 %16 to float
%18 = fmul float %15, %17
store float %18, float* %4
%19 = load float, float* %4
%20 = call i32 @foo(float %19)
br label %21
21: ; preds = %10
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @sumProd(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %4
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %10, %4 ], [ 1, %1 ]
%6 = phi float [ %8, %4 ], [ 1.000000e+00, %1 ]
%7 = sitofp i32 %5 to float
%8 = fmul float %6, %7
%9 = tail call i32 @foo(float %8)
%10 = add nuw i32 %5, 1
%11 = icmp eq i32 %5, %0
br i1 %11, label %3, label %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void sigHandler(int sig) {
  printf("\n [TEST_0] "
         "\n\n Kill signal detected, exiting process. \n\n");
  exit(0);
}


x86 assembly (clang, -O0):
<sigHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigHandler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"\0A [TEST_0] \0A\0A Kill signal detected, exiting process. \0A\0A\00"
define void @sigHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [55 x i8] c"\0A [TEST_0] \0A\0A Kill signal detected, exiting process. \0A\00"
define void @sigHandler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
void OCSP_RESPONSE_free(void) {}


x86 assembly (clang, -O0):
<OCSP_RESPONSE_free>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OCSP_RESPONSE_free>:
ret

LLVM IR (-O0):
define void @OCSP_RESPONSE_free() {
ret void
}

LLVM IR (-O2):
define void @OCSP_RESPONSE_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dmaCompleteUsbCh0Out();
void INT_Excep_USB0_D0FIFO0(void) { dmaCompleteUsbCh0Out(); }


x86 assembly (clang, -O0):
<INT_Excep_USB0_D0FIFO0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dmaCompleteUsbCh0Out@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<INT_Excep_USB0_D0FIFO0>:
xor    %eax,%eax
jmp    1030 <dmaCompleteUsbCh0Out@plt>

LLVM IR (-O0):
define void @INT_Excep_USB0_D0FIFO0() {
%1 = call i32 (...) @dmaCompleteUsbCh0Out()
ret void
}

LLVM IR (-O2):
define void @INT_Excep_USB0_D0FIFO0() {
%1 = tail call i32 (...) @dmaCompleteUsbCh0Out()
ret void
}
long limdbl2long(double d) {
  if (d > 2e9)
    return 2e9;
  else if (d < -2e9)
    return -2e9;
  else
    return d;
}


x86 assembly (clang, -O0):
<limdbl2long>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    112d <limdbl2long+0x2d>
movq   $0x77359400,-0x8(%rbp)
77
jmp    1157 <limdbl2long+0x57>
movsd  0xed3(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    114d <limdbl2long+0x4d>
movq   $0xffffffff88ca6c00,-0x8(%rbp)
88
jmp    1157 <limdbl2long+0x57>
cvttsd2si -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<limdbl2long>:
mov    $0x77359400,%eax
ucomisd 0xef3(%rip),%xmm0
ja     1129 <limdbl2long+0x29>
mov    $0xffffffff88ca6c00,%rax
movsd  0xeea(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1129 <limdbl2long+0x29>
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i64 @limdbl2long(double %0) {
%2 = alloca i64
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 2.000000e+09
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 2000000000, i64* %2
br label %14
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp olt double %8, -2.000000e+09
br i1 %9, label %10, label %11
10: ; preds = %7
store i64 -2000000000, i64* %2
br label %14
11: ; preds = %7
%12 = load double, double* %3
%13 = fptosi double %12 to i64
store i64 %13, i64* %2
br label %14
14: ; preds = %11, %10, %6
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
define i64 @limdbl2long(double %0) {
%2 = fcmp ogt double %0, 2.000000e+09
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = fcmp olt double %0, -2.000000e+09
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = fptosi double %0 to i64
br label %7
7: ; preds = %3, %1, %5
%8 = phi i64 [ %6, %5 ], [ 2000000000, %1 ], [ -2000000000, %3 ]
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int Demo_Incr(int n) {
  puts("INCR");
  return n + 1;
}


x86 assembly (clang, -O0):
<Demo_Incr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Demo_Incr>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
add    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"INCR\00"
define i32 @Demo_Incr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
@.str = [5 x i8] c"INCR\00"
define i32 @Demo_Incr(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = add nsw i32 %0, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void printGreeting() {
  puts("***           Welcome to Simpletron!           ***");
  puts("*** Please enter your program one instruction  ***");
  puts("***          (or data word) at a time.         ***");
  puts("*** Enter -99999 to stop entering your program ***");
}


x86 assembly (clang, -O0):
<printGreeting>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf33(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5a(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printGreeting>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf36(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"*** Welcome to Simpletron! ***\00"
@.str.1 = [51 x i8] c"*** Please enter your program one instruction ***\00"
@.str.2 = [51 x i8] c"*** (or data word) at a time. ***\00"
@.str.3 = [51 x i8] c"*** Enter -99999 to stop entering your program ***\00"
define void @printGreeting() {
%1 = call i32 @puts(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"*** Welcome to Simpletron! ***\00"
@.str.1 = [51 x i8] c"*** Please enter your program one instruction ***\00"
@.str.2 = [51 x i8] c"*** (or data word) at a time. ***\00"
@.str.3 = [51 x i8] c"*** Enter -99999 to stop entering your program ***\00"
define void @printGreeting() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *bintob85(char *, void *, size_t);
char *b85encode(void *p, size_t size) { return bintob85((char *)p, p, size); }


x86 assembly (clang, -O0):
<b85encode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <bintob85@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b85encode>:
mov    %rsi,%rdx
mov    %rdi,%rsi
jmp    1030 <bintob85@plt>

LLVM IR (-O0):
define i8* @b85encode(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @bintob85(i8* %5, i8* %6, i64 %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @b85encode(i8* %0, i64 %1) {
%3 = tail call i8* @bintob85(i8* %0, i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int /*<<< orphan*/ transformar(unsigned int);
void exe01(void) {
  unsigned int seg;
  printf("\n\nDigite a quantidade de segundos: ");
  scanf("%u", &seg);
  transformar(seg);
}


x86 assembly (clang, -O0):
<exe01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1050 <transformar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exe01>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <transformar@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [36 x i8] c"\0A\0ADigite a quantidade de segundos: \00"
@.str.1 = [3 x i8] c"%u\00"
define void @exe01() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @transformar(i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"\0A\0ADigite a quantidade de segundos: \00"
@.str.1 = [3 x i8] c"%u\00"
define void @exe01() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @transformar(i32 %5)
ret void
}
int d_bun_rr1(double a1, double a2) { return (__builtin_isunordered(a1, a2)); }


x86 assembly (clang, -O0):
<d_bun_rr1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setp   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_bun_rr1>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @d_bun_rr1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp uno double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @d_bun_rr1(double %0, double %1) {
%3 = fcmp uno double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned xrop3_248_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & S;
  stk1 = T | stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_248_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_248_0_0>:
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_248_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %7
%26 = load i32, i32* %9
%27 = or i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
ret i32 %28
}

LLVM IR (-O2):
define i32 @xrop3_248_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = mul nuw nsw i32 %4, 257
%6 = or i32 %5, %3
ret i32 %6
}
int service_tss_is_error(int flags) { return flags & 0xffff0000 ? 1 : 0; }


x86 assembly (clang, -O0):
<service_tss_is_error>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xffff0000,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<service_tss_is_error>:
xor    %eax,%eax
cmp    $0x10000,%edi
setae  %al
ret

LLVM IR (-O0):
define i32 @service_tss_is_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -65536
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @service_tss_is_error(i32 %0) {
%2 = icmp ugt i32 %0, 65535
%3 = zext i1 %2 to i32
ret i32 %3
}
void d2i_PKCS7_SIGNER_INFO(void) {}


x86 assembly (clang, -O0):
<d2i_PKCS7_SIGNER_INFO>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_PKCS7_SIGNER_INFO>:
ret

LLVM IR (-O0):
define void @d2i_PKCS7_SIGNER_INFO() {
ret void
}

LLVM IR (-O2):
define void @d2i_PKCS7_SIGNER_INFO() {
ret void
}
int comparacion(int a, int b) { return a > b; }


x86 assembly (clang, -O0):
<comparacion>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comparacion>:
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @comparacion(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @comparacion(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void UART_UartSaveConfig(void) {}


x86 assembly (clang, -O0):
<UART_UartSaveConfig>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART_UartSaveConfig>:
ret

LLVM IR (-O0):
define void @UART_UartSaveConfig() {
ret void
}

LLVM IR (-O2):
define void @UART_UartSaveConfig() {
ret void
}
int MIN(int a, int b) {
  a = a - b;
  return (b + (a & (a >> 31)));
}


x86 assembly (clang, -O0):
<MIN>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%edx
sar    $0x1f,%edx
and    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MIN>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @MIN(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
store i32 %7, i32* %3
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = ashr i32 %10, 31
%12 = and i32 %9, %11
%13 = add nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @MIN(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
void h_u24_to_le(uint8_t *buf, int val) {
  buf[2] = (uint8_t)(val >> 16);
  buf[1] = (uint8_t)(val >> 8);
  buf[0] = (uint8_t)(val >> 0);
}


x86 assembly (clang, -O0):
<h_u24_to_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_u24_to_le>:
mov    %esi,%eax
sar    $0x10,%eax
cltq
mov    %rax,0x10(%rdi)
movslq %esi,%rax
sar    $0x8,%esi
movslq %esi,%rcx
mov    %rcx,0x8(%rdi)
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @h_u24_to_le(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 16
%7 = sext i32 %6 to i64
%8 = load i64*, i64** %3
%9 = getelementptr inbounds i64, i64* %8, i64 2
store i64 %7, i64* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 8
%12 = sext i32 %11 to i64
%13 = load i64*, i64** %3
%14 = getelementptr inbounds i64, i64* %13, i64 1
store i64 %12, i64* %14
%15 = load i32, i32* %4
%16 = ashr i32 %15, 0
%17 = sext i32 %16 to i64
%18 = load i64*, i64** %3
%19 = getelementptr inbounds i64, i64* %18, i64 0
store i64 %17, i64* %19
ret void
}

LLVM IR (-O2):
define void @h_u24_to_le(i64* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 16
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i64, i64* %0, i64 2
store i64 %4, i64* %5
%6 = ashr i32 %1, 8
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %7, i64* %8
%9 = sext i32 %1 to i64
store i64 %9, i64* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ compute_pmf();
int /*<<< orphan*/ parse_args(int, char **);
int /*<<< orphan*/ read_input();
int main(int argc, char **argv) {
  parse_args(argc, argv);
  read_input();
  compute_pmf();
  cleanup();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <parse_args@plt>
mov    $0x0,%al
call   1060 <read_input@plt>
mov    $0x0,%al
call   1040 <compute_pmf@plt>
mov    $0x0,%al
call   1050 <cleanup@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <parse_args@plt>
xor    %eax,%eax
call   1060 <read_input@plt>
xor    %eax,%eax
call   1040 <compute_pmf@plt>
xor    %eax,%eax
call   1050 <cleanup@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @parse_args(i32 %6, i8** %7)
%9 = call i32 (...) @read_input()
%10 = call i32 (...) @compute_pmf()
%11 = call i32 (...) @cleanup()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_args(i32 %0, i8** %1)
%4 = tail call i32 (...) @read_input()
%5 = tail call i32 (...) @compute_pmf()
%6 = tail call i32 (...) @cleanup()
ret i32 0
}
float ezs_rect_window(float alpha, int position, int length) { return 1.0f; }


x86 assembly (clang, -O0):
<ezs_rect_window>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  0xee9(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ezs_rect_window>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @ezs_rect_window(float %0, i32 %1, i32 %2) {
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
store float %0, float* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret float 1.000000e+00
}

LLVM IR (-O2):
define float @ezs_rect_window(float %0, i32 %1, i32 %2) {
ret float 1.000000e+00
}
void report_meminfo(struct seq_file *m, struct sysinfo *sysinfo) {}


x86 assembly (clang, -O0):
<report_meminfo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<report_meminfo>:
ret

LLVM IR (-O0):
%struct.seq_file = type opaque
%struct.sysinfo = type opaque
define void @report_meminfo(%struct.seq_file* %0, %struct.sysinfo* %1) {
%3 = alloca %struct.seq_file*
%4 = alloca %struct.sysinfo*
store %struct.seq_file* %0, %struct.seq_file** %3
store %struct.sysinfo* %1, %struct.sysinfo** %4
ret void
}

LLVM IR (-O2):
%struct.seq_file = type opaque
%struct.sysinfo = type opaque
define void @report_meminfo(%struct.seq_file* nocapture %0, %struct.sysinfo* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_count(int);
int main(void) {
  int i;
  for (i = 10; i > 0; i -= 1) {
    print_count(i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1146 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <print_count@plt>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <print_count@plt>
mov    $0x9,%edi
call   1030 <print_count@plt>
mov    $0x8,%edi
call   1030 <print_count@plt>
mov    $0x7,%edi
call   1030 <print_count@plt>
mov    $0x6,%edi
call   1030 <print_count@plt>
mov    $0x5,%edi
call   1030 <print_count@plt>
mov    $0x4,%edi
call   1030 <print_count@plt>
mov    $0x3,%edi
call   1030 <print_count@plt>
mov    $0x2,%edi
call   1030 <print_count@plt>
mov    $0x1,%edi
call   1030 <print_count@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @print_count(i32 %7)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print_count(i32 10)
%2 = tail call i32 @print_count(i32 9)
%3 = tail call i32 @print_count(i32 8)
%4 = tail call i32 @print_count(i32 7)
%5 = tail call i32 @print_count(i32 6)
%6 = tail call i32 @print_count(i32 5)
%7 = tail call i32 @print_count(i32 4)
%8 = tail call i32 @print_count(i32 3)
%9 = tail call i32 @print_count(i32 2)
%10 = tail call i32 @print_count(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(unsigned long, unsigned char, int);
int /*<<< orphan*/ GPIOPadConfigSet(unsigned long, unsigned char, int, int);
void GPIOPinTypeUSBAnalog(unsigned long ulPort, unsigned char ucPins) {
  ;
  GPIODirModeSet(ulPort, ucPins, 0x00000000);
  GPIOPadConfigSet(ulPort, ucPins, 0x00000001, 0x00000000);
}


x86 assembly (clang, -O0):
<GPIOPinTypeUSBAnalog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
movzbl -0x9(%rbp),%esi
call   1040 <GPIODirModeSet@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
xor    %ecx,%ecx
movzbl -0x9(%rbp),%esi
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeUSBAnalog>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edx,%edx
call   1040 <GPIODirModeSet@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

LLVM IR (-O0):
define void @GPIOPinTypeUSBAnalog(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
%6 = load i8, i8* %4
%7 = call i32 @GPIODirModeSet(i64 %5, i8 zeroext %6, i32 0)
%8 = load i64, i64* %3
%9 = load i8, i8* %4
%10 = call i32 @GPIOPadConfigSet(i64 %8, i8 zeroext %9, i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @GPIOPinTypeUSBAnalog(i64 %0, i8 zeroext %1) {
%3 = tail call i32 @GPIODirModeSet(i64 %0, i8 zeroext %1, i32 0)
%4 = tail call i32 @GPIOPadConfigSet(i64 %0, i8 zeroext %1, i32 1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void deshabilitar_pic() {
  outb(0x20 + 1, 0xFF);
  outb(0xA0 + 1, 0xFF);
}


x86 assembly (clang, -O0):
<deshabilitar_pic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21,%edi
mov    $0xff,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<deshabilitar_pic>:
push   %rax
mov    $0x21,%edi
mov    $0xff,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @deshabilitar_pic() {
%1 = call i32 @outb(i32 33, i32 255)
%2 = call i32 @outb(i32 161, i32 255)
ret void
}

LLVM IR (-O2):
define void @deshabilitar_pic() {
%1 = tail call i32 @outb(i32 33, i32 255)
%2 = tail call i32 @outb(i32 161, i32 255)
ret void
}
int is_whitespace(char const value) {
  switch (value) {
  case ' ':
  case '\t':
  case '\n':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffff7,%eax
sub    $0x2,%eax
jb     1133 <is_whitespace+0x33>
jmp    1122 <is_whitespace+0x22>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
jne    113f <is_whitespace+0x3f>
jmp    1133 <is_whitespace+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1146 <is_whitespace+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_whitespace>:
cmp    $0x20,%edi
ja     111d <is_whitespace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    111d <is_whitespace+0x1d>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_whitespace(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 32, label %6
i32 9, label %6
i32 10, label %6
]
6: ; preds = %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_whitespace(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 32, label %4
i32 9, label %4
i32 10, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
/* Type definitions */
struct tgl_state {
  int dummy;
};
struct connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int fetch_int();
int /*<<< orphan*/ fetch_long();
void work_pong(struct tgl_state *TLS,
               struct connection *c __attribute__((unused)),
               long long msg_id __attribute__((unused))) {
  assert(fetch_int() == 0x347773c5);
  fetch_long();
  fetch_long();
}


x86 assembly (clang, -O0):
<work_pong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <fetch_int@plt>
cmp    $0x347773c5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x0,%al
call   1030 <fetch_long@plt>
mov    $0x0,%al
call   1030 <fetch_long@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<work_pong>:
push   %rax
xor    %eax,%eax
call   1040 <fetch_int@plt>
xor    %edi,%edi
cmp    $0x347773c5,%eax
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
call   1030 <fetch_long@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <fetch_long@plt>

LLVM IR (-O0):
%struct.tgl_state = type { i32 }
%struct.connection = type { i32 }
define void @work_pong(%struct.tgl_state* %0, %struct.connection* %1, i64 %2) {
%4 = alloca %struct.tgl_state*
%5 = alloca %struct.connection*
%6 = alloca i64
store %struct.tgl_state* %0, %struct.tgl_state** %4
store %struct.connection* %1, %struct.connection** %5
store i64 %2, i64* %6
%7 = call i32 (...) @fetch_int()
%8 = icmp eq i32 %7, 880243653
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i32 (...) @fetch_long()
%12 = call i32 (...) @fetch_long()
ret void
}

LLVM IR (-O2):
%struct.tgl_state = type { i32 }
%struct.connection = type { i32 }
define void @work_pong(%struct.tgl_state* nocapture readnone %0, %struct.connection* nocapture readnone %1, i64 %2) {
%4 = tail call i32 (...) @fetch_int()
%5 = icmp eq i32 %4, 880243653
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 (...) @fetch_long()
%9 = tail call i32 (...) @fetch_long()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
scalar_t__ cmp4(void const *, void const *);
scalar_t__ cmp8(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool cmp12(const void *a, const void *b) {
  return cmp4(a, b) && cmp8((uint8_t *)a + 4, (uint8_t *)b + 4);
}


x86 assembly (clang, -O0):
<cmp12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <cmp4@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     116e <cmp12+0x4e>
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
mov    -0x10(%rbp),%rsi
add    $0x10,%rsi
call   1030 <cmp8@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp12>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <cmp4@plt>
test   %rax,%rax
je     1154 <cmp12+0x34>
add    $0x10,%rbx
add    $0x10,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <cmp8@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    1156 <cmp12+0x36>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @cmp12(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @cmp4(i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = bitcast i8* %10 to i32*
%12 = getelementptr inbounds i32, i32* %11, i64 4
%13 = load i8*, i8** %4
%14 = bitcast i8* %13 to i32*
%15 = getelementptr inbounds i32, i32* %14, i64 4
%16 = call i64 @cmp8(i32* %12, i32* %15)
%17 = icmp ne i64 %16, 0
br label %18
18: ; preds = %9, %2
%19 = phi i1 [ false, %2 ], [ %17, %9 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @cmp12(i8* %0, i8* %1) {
%3 = tail call i64 @cmp4(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 16
%7 = bitcast i8* %6 to i32*
%8 = getelementptr inbounds i8, i8* %1, i64 16
%9 = bitcast i8* %8 to i32*
%10 = tail call i64 @cmp8(i32* %7, i32* %9)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %5, %2
%14 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %14
}
void main(void) {
  int x;
  int y;
  int m;
  if (x == 5) {
    y = 7;
    y = x / m;
  } else {
    m = 8 + m;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x5,-0x4(%rbp)
jne    1124 <main+0x24>
movl   $0x7,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x2d>
mov    -0xc(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 5
br i1 %5, label %6, label %10
6: ; preds = %0
store i32 7, i32* %2
%7 = load i32, i32* %1
%8 = load i32, i32* %3
%9 = sdiv i32 %7, %8
store i32 %9, i32* %2
br label %13
10: ; preds = %0
%11 = load i32, i32* %3
%12 = add nsw i32 8, %11
store i32 %12, i32* %3
br label %13
13: ; preds = %10, %6
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strrev(char *);
int main(void) {
  char input[] = "radioactivegarbage";
  strrev(input);
  printf("%s\n", input);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%ax
mov    %ax,-0x10(%rbp)
mov    0xebc(%rip),%al
mov    %al,-0xe(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <strrev@plt>
lea    -0x20(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x656761,0xf(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <strrev@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.input = [19 x i8] c"radioactivegarbage\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [19 x i8]
store i32 0, i32* %1
%3 = bitcast [19 x i8]* %2 to i8*
%4 = getelementptr inbounds [19 x i8], [19 x i8]* %2, i64 0, i64 0
%5 = call i32 @strrev(i8* %4)
%6 = getelementptr inbounds [19 x i8], [19 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.input = [19 x i8] c"radioactivegarbage\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [19 x i8]
%2 = getelementptr inbounds [19 x i8], [19 x i8]* %1, i64 0, i64 0
%3 = call i32 @strrev(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
int ori_to_bin(float ori, int nbins) {
  if (ori < 0)
    ori += 2 * 3.14159265358979323846;
  int bin = (int)(ori / (2 * 3.14159265358979323846) * nbins + 0.5) % nbins;
  return bin;
}


x86 assembly (clang, -O0):
<ori_to_bin>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1137 <ori_to_bin+0x37>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb8(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeab(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ori_to_bin>:
cvtss2sd %xmm0,%xmm1
movsd  0xef4(%rip),%xmm2
addsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm4
cmpltss %xmm3,%xmm4
andps  %xmm4,%xmm1
andnps %xmm0,%xmm4
orps   %xmm1,%xmm4
xorps  %xmm0,%xmm0
cvtss2sd %xmm4,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
divsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
addsd  0xec2(%rip),%xmm1
cvttsd2si %xmm1,%eax
cltd
idiv   %edi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @ori_to_bin(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%6 = load float, float* %3
%7 = fcmp olt float %6, 0.000000e+00
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = fadd double %10, 0x401921FB54442D18
%12 = fptrunc double %11 to float
store float %12, float* %3
br label %13
13: ; preds = %8, %2
%14 = load float, float* %3
%15 = fpext float %14 to double
%16 = fdiv double %15, 0x401921FB54442D18
%17 = load i32, i32* %4
%18 = sitofp i32 %17 to double
%19 = call double @llvm.fmuladd.f64(double %16, double %18, double 5.000000e-01)
%20 = fptosi double %19 to i32
%21 = load i32, i32* %4
%22 = srem i32 %20, %21
store i32 %22, i32* %5
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @ori_to_bin(float %0, i32 %1) {
%3 = fcmp olt float %0, 0.000000e+00
%4 = fpext float %0 to double
%5 = fadd double %4, 0x401921FB54442D18
%6 = fptrunc double %5 to float
%7 = select i1 %3, float %6, float %0
%8 = fpext float %7 to double
%9 = fdiv double %8, 0x401921FB54442D18
%10 = sitofp i32 %1 to double
%11 = tail call double @llvm.fmuladd.f64(double %9, double %10, double 5.000000e-01)
%12 = fptosi double %11 to i32
%13 = srem i32 %12, %1
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ cpuid_scan(char *);
int vmware_hypervisor_port_check();
bool vmware_check(void) {
  if (!cpuid_scan("VMwareVMware"))
    return false;
  return vmware_hypervisor_port_check();
}


x86 assembly (clang, -O0):
<vmware_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <cpuid_scan@plt>
cmp    $0x0,%eax
jne    1149 <vmware_check+0x29>
movl   $0x0,-0x4(%rbp)
jmp    1153 <vmware_check+0x33>
mov    $0x0,%al
call   1030 <vmware_hypervisor_port_check@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmware_check>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <cpuid_scan@plt>
test   %eax,%eax
je     1139 <vmware_check+0x19>
xor    %eax,%eax
pop    %rcx
jmp    1030 <vmware_hypervisor_port_check@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"VMwareVMware\00"
define i32 @vmware_check() {
%1 = alloca i32
%2 = call i32 @cpuid_scan(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %0
store i32 0, i32* %1
br label %7
5: ; preds = %0
%6 = call i32 (...) @vmware_hypervisor_port_check()
store i32 %6, i32* %1
br label %7
7: ; preds = %5, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [13 x i8] c"VMwareVMware\00"
define i32 @vmware_check() {
%1 = tail call i32 @cpuid_scan(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @vmware_hypervisor_port_check()
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ 0, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdout;
void bm(char *label, void (*fn)()) {
  printf(" %18s", label);
  fflush(stdout);
  fn();
}


x86 assembly (clang, -O0):
<bm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x0,%al
call   *-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bm>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
mov    %rbx,%rcx
pop    %rbx
jmp    *%rcx

LLVM IR (-O0):
@.str = [6 x i8] c" %18s\00"
@stdout = global i32 0
define void @bm(i8* %0, void (...)* %1) {
%3 = alloca i8*
%4 = alloca void (...)*
store i8* %0, i8** %3
store void (...)* %1, void (...)** %4
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
%9 = load void (...)*, void (...)** %4
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c" %18s\00"
@stdout = global i32 0
define void @bm(i8* %0, void (...)* nocapture %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
tail call void (...) %1()
ret void
}
int compare_int_(const void *x, const void *y) {
  return (*(int *)x - *(int *)y);
}


x86 assembly (clang, -O0):
<compare_int_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_int_>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compare_int_(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare_int_(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
signed short signedshort_ignoring_longdouble(signed short x, long double y) {
  return x;
}


x86 assembly (clang, -O0):
<signedshort_ignoring_longdouble>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
fldt   0x10(%rbp)
mov    %ax,-0x2(%rbp)
fstpt  -0x20(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signedshort_ignoring_longdouble>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @signedshort_ignoring_longdouble(i16 signext %0, x86_fp80 %1) {
%3 = alloca i16
%4 = alloca x86_fp80
store i16 %0, i16* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @signedshort_ignoring_longdouble(i16 returned signext %0, x86_fp80 %1) {
ret i16 %0
}
int keypin_load_journal(const char *fname) {
  (void)fname;
  return 0;
}


x86 assembly (clang, -O0):
<keypin_load_journal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<keypin_load_journal>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @keypin_load_journal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @keypin_load_journal(i8* nocapture readnone %0) {
ret i32 0
}
void ensure_max_threads_not_exceeded(void) {}


x86 assembly (clang, -O0):
<ensure_max_threads_not_exceeded>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ensure_max_threads_not_exceeded>:
ret

LLVM IR (-O0):
define void @ensure_max_threads_not_exceeded() {
ret void
}

LLVM IR (-O2):
define void @ensure_max_threads_not_exceeded() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("USAGE: fatformat <imagefile> [size=<size>|DISC]\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"USAGE: fatformat <imagefile> [size=<size>|DISC]\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [48 x i8] c"USAGE: fatformat <imagefile> [size=<size>|DISC]\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
char *file_name_from_path(char *path) {
  if (path == NULL) {
    return NULL;
  }
  char *t = strrchr(path, '/');
  if (t) {
    t++;
    return t;
  }
  return path;
}


x86 assembly (clang, -O0):
<file_name_from_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <file_name_from_path+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1172 <file_name_from_path+0x62>
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116a <file_name_from_path+0x5a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1172 <file_name_from_path+0x62>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_name_from_path>:
test   %rdi,%rdi
je     1133 <file_name_from_path+0x23>
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,%rcx
add    $0x1,%rax
test   %rcx,%rcx
cmove  %rbx,%rax
pop    %rbx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @file_name_from_path(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %19
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @strrchr(i8* %9, i8 signext 47)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %17
13: ; preds = %8
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %4
%16 = load i8*, i8** %4
store i8* %16, i8** %2
br label %19
17: ; preds = %8
%18 = load i8*, i8** %3
store i8* %18, i8** %2
br label %19
19: ; preds = %17, %13, %7
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @file_name_from_path(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @strrchr(i8* %0, i8 signext 47)
%5 = icmp eq i8* %4, null
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = select i1 %5, i8* %0, i8* %6
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %9
}