xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_MAKE_I2C_BUS1_SDA_INPUT() { clear_io_bit(0x36, 5); }


x86 assembly (clang, -O0):
<TOSH_MAKE_I2C_BUS1_SDA_INPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x36,%edi
mov    $0x5,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_I2C_BUS1_SDA_INPUT>:
mov    $0x36,%edi
mov    $0x5,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_I2C_BUS1_SDA_INPUT() {
%1 = call i32 @clear_io_bit(i32 54, i32 5)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_I2C_BUS1_SDA_INPUT() {
%1 = tail call i32 @clear_io_bit(i32 54, i32 5)
ret void
}
VT(double VT) {
  double q6, a;
  if (VT > 15) {
    return 9;
  }
  a = (VT + 0.1815) * (VT + 0.1815);
  q6 = 1 / (0.0003869 * a + 0.01081);
  return q6;
}


x86 assembly (clang, -O0):
<VT>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    112c <VT+0x2c>
movl   $0x9,-0x4(%rbp)
jmp    1185 <VT+0x85>
movsd  0xeec(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xedf(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  0xeb4(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xeb0(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xe94(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VT>:
mov    $0x9,%eax
ucomisd 0xef3(%rip),%xmm0
ja     113b <VT+0x3b>
addsd  0xef1(%rip),%xmm0
mulsd  %xmm0,%xmm0
mulsd  0xeed(%rip),%xmm0
addsd  0xeed(%rip),%xmm0
movsd  0xeed(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
ret

LLVM IR (-O0):
define i32 @VT(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
%6 = load double, double* %3
%7 = fcmp ogt double %6, 1.500000e+01
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 9, i32* %2
br label %20
9: ; preds = %1
%10 = load double, double* %3
%11 = fadd double %10, 1.815000e-01
%12 = load double, double* %3
%13 = fadd double %12, 1.815000e-01
%14 = fmul double %11, %13
store double %14, double* %5
%15 = load double, double* %5
%16 = call double @llvm.fmuladd.f64(double 3.869000e-04, double %15, double 1.081000e-02)
%17 = fdiv double 1.000000e+00, %16
store double %17, double* %4
%18 = load double, double* %4
%19 = fptosi double %18 to i32
store i32 %19, i32* %2
br label %20
20: ; preds = %9, %8
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @VT(double %0) {
%2 = fcmp ogt double %0, 1.500000e+01
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = fadd double %0, 1.815000e-01
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double 3.869000e-04, double 1.081000e-02)
%7 = fdiv double 1.000000e+00, %6
%8 = fptosi double %7 to i32
br label %9
9: ; preds = %1, %3
%10 = phi i32 [ %8, %3 ], [ 9, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ MacroCleanup();
int /*<<< orphan*/ StructCleanup();
void DotCleanup(int pass) {
  StructCleanup();
  MacroCleanup();
}


x86 assembly (clang, -O0):
<DotCleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <StructCleanup@plt>
mov    $0x0,%al
call   1040 <MacroCleanup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DotCleanup>:
push   %rax
xor    %eax,%eax
call   1030 <StructCleanup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <MacroCleanup@plt>

LLVM IR (-O0):
define void @DotCleanup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @StructCleanup()
%4 = call i32 (...) @MacroCleanup()
ret void
}

LLVM IR (-O2):
define void @DotCleanup(i32 %0) {
%2 = tail call i32 (...) @StructCleanup()
%3 = tail call i32 (...) @MacroCleanup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void naturalToBin(long n) {
  if (n == 0)
    return;
  naturalToBin(n / 2);
  printf("%d", (n % 2));
}


x86 assembly (clang, -O0):
<naturalToBin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <naturalToBin+0x1c>
jmp    116f <naturalToBin+0x4f>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
call   1040 <naturalToBin@plt>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rdx,%rsi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<naturalToBin>:
test   %rdi,%rdi
je     115e <naturalToBin+0x3e>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rdi,%rbx
shr    $0x3f,%rbx
add    %rdi,%rbx
mov    %rbx,%rdi
sar    %rdi
call   1040 <naturalToBin@plt>
and    $0xfffffffffffffffe,%rbx
sub    %rbx,%r14
lea    0xeb1(%rip),%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @naturalToBin(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %12
6: ; preds = %1
%7 = load i64, i64* %2
%8 = sdiv i64 %7, 2
%9 = load i64, i64* %2
%10 = srem i64 %9, 2
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %10)
br label %12
12: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @naturalToBin(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1, %4
ret void
4: ; preds = %1
%5 = sdiv i64 %0, 2
tail call void @naturalToBin(i64 %5)
%6 = srem i64 %0, 2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %6)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ oosmos_DelayMS(int);
int /*<<< orphan*/ oosmos_RunStateMachines();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ threadyieldtestNew(char *, int);
extern int main(void) {
  printf("\nThis test does not end.  Control-C to exit.\n\n");
  (void)threadyieldtestNew("TestA", 3);
  (void)threadyieldtestNew("TestB", 10);
  for (;;) {
    oosmos_RunStateMachines();
    oosmos_DelayMS(1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
mov    $0x3,%esi
call   1030 <threadyieldtestNew@plt>
lea    0xec2(%rip),%rdi
mov    $0xa,%esi
call   1030 <threadyieldtestNew@plt>
mov    $0x0,%al
call   1060 <oosmos_RunStateMachines@plt>
mov    $0x1,%edi
call   1050 <oosmos_DelayMS@plt>
jmp    117d <main+0x3d>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
mov    $0x3,%esi
call   1040 <threadyieldtestNew@plt>
lea    0xea1(%rip),%rdi
mov    $0xa,%esi
call   1040 <threadyieldtestNew@plt>
nop
xor    %eax,%eax
call   1060 <oosmos_RunStateMachines@plt>
mov    $0x1,%edi
call   1050 <oosmos_DelayMS@plt>
jmp    1170 <main+0x30>

LLVM IR (-O0):
@.str = [47 x i8] c"\0AThis test does not end. Control-C to exit.\0A\0A\00"
@.str.1 = [6 x i8] c"TestA\00"
@.str.2 = [6 x i8] c"TestB\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @threadyieldtestNew(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 3)
%4 = call i32 @threadyieldtestNew(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 10)
br label %5
5: ; preds = %5, %0
%6 = call i32 (...) @oosmos_RunStateMachines()
%7 = call i32 @oosmos_DelayMS(i32 1)
br label %5
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"TestA\00"
@.str.2 = [6 x i8] c"TestB\00"
@str = [46 x i8] c"\0AThis test does not end. Control-C to exit.\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @threadyieldtestNew(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 3)
%3 = tail call i32 @threadyieldtestNew(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 10)
br label %4
4: ; preds = %4, %0
%5 = tail call i32 (...) @oosmos_RunStateMachines()
%6 = tail call i32 @oosmos_DelayMS(i32 1)
br label %4
}
RS(i) int i;
{ return (((i) >> 21) & 0x1f); }


x86 assembly (clang, -O0):
<RS>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x15,%eax
and    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RS>:
mov    %edi,%eax
shr    $0x15,%eax
and    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @RS(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 21
%5 = and i32 %4, 31
ret i32 %5
}

LLVM IR (-O2):
define i32 @RS(i32 %0) {
%2 = lshr i32 %0, 21
%3 = and i32 %2, 31
ret i32 %3
}
/* Variables and functions */
double pow(double, double);
double probability(unsigned int a, unsigned int b) {
  double i, j;
  i = (((double)a) - ((double)b)) / 400.0;
  j = pow(10.0, -i);
  return (1.0 / (1.0 + j));
}


x86 assembly (clang, -O0):
<probability>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
mov    -0x8(%rbp),%eax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xea1(%rip),%xmm0
call   1030 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xe87(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  0xe7a(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<probability>:
push   %rax
mov    %edi,%eax
cvtsi2sd %rax,%xmm1
mov    %esi,%eax
cvtsi2sd %rax,%xmm0
subsd  %xmm0,%xmm1
divsd  0xed5(%rip),%xmm1
movsd  0xed5(%rip),%xmm0
call   1030 <pow@plt>
movsd  0xed0(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @probability(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = uitofp i32 %7 to double
%9 = load i32, i32* %4
%10 = uitofp i32 %9 to double
%11 = fsub double %8, %10
%12 = fdiv double %11, 4.000000e+02
store double %12, double* %5
%13 = load double, double* %5
%14 = fneg double %13
%15 = call double @pow(double 1.000000e+01, double %14)
store double %15, double* %6
%16 = load double, double* %6
%17 = fadd double 1.000000e+00, %16
%18 = fdiv double 1.000000e+00, %17
ret double %18
}

LLVM IR (-O2):
define double @probability(i32 %0, i32 %1) {
%3 = uitofp i32 %0 to double
%4 = uitofp i32 %1 to double
%5 = fsub double %3, %4
%6 = fdiv double %5, -4.000000e+02
%7 = tail call double @pow(double 1.000000e+01, double %6)
%8 = fadd double %7, 1.000000e+00
%9 = fdiv double 1.000000e+00, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ strCopy(char **, char **);
int main(void) {
  char original[] = "Hola mundo.";
  char copy[50];
  strCopy(&original, &copy);
  printf("Original: %s\nCopy:     %s\n", original, copy);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1040 <strCopy@plt>
lea    -0x10(%rbp),%rsi
lea    -0x50(%rbp),%rdx
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
movabs $0x6e756d20616c6f48,%rax
6d 75 6e
mov    %rax,(%rsp)
movl   $0x2e6f64,0x8(%rsp)
mov    %rsp,%rbx
lea    0x10(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strCopy@plt>
lea    0xeb5(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.original = [12 x i8] c"Hola mundo.\00"
@.str = [27 x i8] c"Original: %s\0ACopy: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
%3 = alloca [50 x i8]
store i32 0, i32* %1
%4 = bitcast [12 x i8]* %2 to i8*
%5 = bitcast [12 x i8]* %2 to i8**
%6 = bitcast [50 x i8]* %3 to i8**
%7 = call i32 @strCopy(i8** %5, i8** %6)
%8 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.original = [12 x i8] c"Hola mundo.\00"
@.str = [27 x i8] c"Original: %s\0ACopy: %s\0A\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%5 = bitcast [12 x i8]* %1 to i8**
%6 = bitcast [50 x i8]* %2 to i8**
%7 = call i32 @strCopy(i8** %5, i8** %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret i32 0
}
void triexit(status) int status;
{}


x86 assembly (clang, -O0):
<triexit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @triexit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @triexit(i32 %0) {
ret void
}
int grfmem(size, pointer)
int *size, *pointer;
{
  char *area = (char *)*pointer;
  free(area);
  return 1;
}


x86 assembly (clang, -O0):
<grfmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grfmem>:
push   %rax
movslq (%rsi),%rdi
call   1030 <free@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @grfmem(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i8*
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %5
ret i32 1
}

LLVM IR (-O2):
define i32 @grfmem(i32* nocapture readnone %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
tail call void @free(i8* %5)
ret i32 1
}
int args(int P, int H, int S, int R) {
  if (P > 0 && P % 2 == 0 && H >= 0 && H < 5001 && S >= 0 && S < 5001 &&
      R >= 0 && R < 5001) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<args>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    117f <args+0x7f>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    117f <args+0x7f>
cmpl   $0x0,-0xc(%rbp)
jl     117f <args+0x7f>
cmpl   $0x1389,-0xc(%rbp)
jge    117f <args+0x7f>
cmpl   $0x0,-0x10(%rbp)
jl     117f <args+0x7f>
cmpl   $0x1389,-0x10(%rbp)
jge    117f <args+0x7f>
cmpl   $0x0,-0x14(%rbp)
jl     117f <args+0x7f>
cmpl   $0x1389,-0x14(%rbp)
jge    117f <args+0x7f>
movl   $0x0,-0x4(%rbp)
jmp    1186 <args+0x86>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<args>:
test   %edi,%edi
jle    1124 <args+0x24>
cmp    $0x1388,%ecx
ja     1124 <args+0x24>
cmp    $0x1388,%edx
ja     1124 <args+0x24>
cmp    $0x1388,%esi
ja     1124 <args+0x24>
xor    %eax,%eax
and    $0x1,%edi
jne    1124 <args+0x24>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @args(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %6
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %35
12: ; preds = %4
%13 = load i32, i32* %6
%14 = srem i32 %13, 2
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %35
16: ; preds = %12
%17 = load i32, i32* %7
%18 = icmp sge i32 %17, 0
br i1 %18, label %19, label %35
19: ; preds = %16
%20 = load i32, i32* %7
%21 = icmp slt i32 %20, 5001
br i1 %21, label %22, label %35
22: ; preds = %19
%23 = load i32, i32* %8
%24 = icmp sge i32 %23, 0
br i1 %24, label %25, label %35
25: ; preds = %22
%26 = load i32, i32* %8
%27 = icmp slt i32 %26, 5001
br i1 %27, label %28, label %35
28: ; preds = %25
%29 = load i32, i32* %9
%30 = icmp sge i32 %29, 0
br i1 %30, label %31, label %35
31: ; preds = %28
%32 = load i32, i32* %9
%33 = icmp slt i32 %32, 5001
br i1 %33, label %34, label %35
34: ; preds = %31
store i32 0, i32* %5
br label %36
35: ; preds = %31, %28, %25, %22, %19, %16, %12, %4
store i32 1, i32* %5
br label %36
36: ; preds = %35, %34
%37 = load i32, i32* %5
ret i32 %37
}

LLVM IR (-O2):
define i32 @args(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %15
6: ; preds = %4
%7 = and i32 %0, 1
%8 = icmp eq i32 %7, 0
%9 = icmp ult i32 %1, 5001
%10 = and i1 %9, %8
%11 = icmp ult i32 %2, 5001
%12 = and i1 %11, %10
%13 = icmp ult i32 %3, 5001
%14 = and i1 %13, %12
br i1 %14, label %16, label %15
15: ; preds = %6, %4
br label %16
16: ; preds = %6, %15
%17 = phi i32 [ 1, %15 ], [ 0, %6 ]
ret i32 %17
}
void prefetch(const void *x) {
  asm volatile("prefetcht0 %P0" : : "m"(*(const char *)x));
}


x86 assembly (clang, -O0):
<prefetch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
prefetcht0 (%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefetch>:
prefetcht0 (%rdi)
ret

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

LLVM IR (-O2):
define void @prefetch(i8* %0) {
tail call void asm sideeffect "prefetcht0 ${0:P}", "*m,~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %0)
ret void
}
cbuf13(f, n) { return (cbuf(f, n, 13)); }


x86 assembly (clang, -O0):
<cbuf13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0xd,%edx
mov    $0x0,%al
call   1030 <cbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf13>:
mov    $0xd,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf13(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 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %5, i32 %6, i32 13)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf13(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 13)
ret i32 %3
}
/* Variables and functions */
double getLux(int);
int /*<<< orphan*/ printf(char *, double);
int wiringPiI2CSetup(int);
int main() {
  int fd = wiringPiI2CSetup(0x4A);
  printf("Lux: %.3f \n", getLux(fd));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4a,%edi
call   1030 <wiringPiI2CSetup@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <getLux@plt>
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4a,%edi
call   1030 <wiringPiI2CSetup@plt>
mov    %eax,%edi
call   1050 <getLux@plt>
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Lux: %.3f \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @wiringPiI2CSetup(i32 74)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call double @getLux(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Lux: %.3f \0A\00"
define i32 @main() {
%1 = tail call i32 @wiringPiI2CSetup(i32 74)
%2 = tail call double @getLux(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}
void do_optimize(int b) { do_optimize(0); }


x86 assembly (clang, -O0):
<do_optimize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <do_optimize@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_optimize>:
jmp    1100 <do_optimize>

LLVM IR (-O0):
define void @do_optimize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @do_optimize(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
char *procprt_PRI_e(struct tstat *curstat, int avgval, int nsecs) {
  return "  -";
}


x86 assembly (clang, -O0):
<procprt_PRI_e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeeb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<procprt_PRI_e>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct.tstat = type opaque
@.str = [4 x i8] c" -\00"
define i8* @procprt_PRI_e(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type opaque
@.str = [4 x i8] c" -\00"
define i8* @procprt_PRI_e(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
void gtk_container_set_focus_child() {}


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

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

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

LLVM IR (-O2):
define void @gtk_container_set_focus_child() {
ret void
}
void ExitToMultiplayer(void) { (**(volatile void (**)(void))0x600026C)(); }


x86 assembly (clang, -O0):
<ExitToMultiplayer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x600026c,%eax
call   *(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExitToMultiplayer>:
jmp    *0x600026c

LLVM IR (-O0):
define void @ExitToMultiplayer() {
%1 = load void ()*, void ()** inttoptr (i64 100663916 to void ()**)
ret void
}

LLVM IR (-O2):
define void @ExitToMultiplayer() {
%1 = load void ()*, void ()** inttoptr (i64 100663916 to void ()**)
tail call void %1()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_158() {
  Assert_real((isqrt(158) == 12),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              795, ("Integer square root of 158 should be 12"));
}


x86 assembly (clang, -O0):
<t_sqrt_158>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9e,%edi
call   1030 <isqrt@plt>
cmp    $0xc,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x31b,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_158>:
push   %rax
mov    $0x9e,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xc,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x31b,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 158 should be 12\00"
define void @t_sqrt_158() {
%1 = call i32 @isqrt(i32 158)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 795, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 158 should be 12\00"
define void @t_sqrt_158() {
%1 = tail call i32 @isqrt(i32 158)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 795, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned long unpack(const unsigned char *x) {
  return (unsigned long)(x[0]) | (((unsigned long)(x[1])) << 8) |
         (((unsigned long)(x[2])) << 16) | (((unsigned long)(x[3])) << 24);
}


x86 assembly (clang, -O0):
<unpack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%rcx
or     %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @unpack(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i64
%11 = shl i64 %10, 8
%12 = or i64 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i64
%17 = shl i64 %16, 16
%18 = or i64 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = zext i8 %21 to i64
%23 = shl i64 %22, 24
%24 = or i64 %18, %23
ret i64 %24
}

LLVM IR (-O2):
define i64 @unpack(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl nuw nsw i64 %6, 8
%8 = or i64 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl nuw nsw i64 %11, 16
%13 = or i64 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i64
%17 = shl nuw nsw i64 %16, 24
%18 = or i64 %13, %17
ret i64 %18
}
/* Variables and functions */
int shlib_1_func();
int main() {
  int x = shlib_1_func();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <shlib_1_func@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <shlib_1_func@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @shlib_1_func()
store i32 %3, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @shlib_1_func()
ret i32 0
}
int eq(int a, int b) { return a == b; }


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

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

LLVM IR (-O0):
define i32 @eq(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 eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @eq(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SIG_DFL;
int getpid();
int /*<<< orphan*/ kill(int, int);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
void sighandler(int signum) {
  printf("Process %d got signal %d\n", getpid(), signum);
  signal(signum, SIG_DFL);
  kill(getpid(), signum);
}


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
mov    -0x4(%rbp),%edx
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    0x2e73(%rip),%rax
mov    (%rax),%esi
call   1050 <signal@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1060 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighandler>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
call   1040 <printf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1050 <signal@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1060 <kill@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Process %d got signal %d\0A\00"
@SIG_DFL = global i32 0
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32, i32* %2
%7 = load i32, i32* @SIG_DFL
%8 = call i32 @signal(i32 %6, i32 %7)
%9 = call i32 (...) @getpid()
%10 = load i32, i32* %2
%11 = call i32 @kill(i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Process %d got signal %d\0A\00"
@SIG_DFL = global i32 0
define void @sighandler(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %0)
%4 = load i32, i32* @SIG_DFL
%5 = tail call i32 @signal(i32 %0, i32 %4)
%6 = tail call i32 (...) @getpid()
%7 = tail call i32 @kill(i32 %6, i32 %0)
ret void
}
x(const char *s) {
  char a[1];
  const char *ss = s;
  a[*s++] |= 1;
  return (int)(ss + 1) == (int)s;
}


x86 assembly (clang, -O0):
<x>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbq (%rax),%rax
movsbl -0x9(%rbp,%rax,1),%ecx
or     $0x1,%ecx
mov    %cl,-0x9(%rbp,%rax,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    -0x8(%rbp),%rcx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<x>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @x(i8* %0) {
%2 = alloca i8*
%3 = alloca [1 x i8]
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %4
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
%9 = sext i8 %8 to i64
%10 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = or i32 %12, 1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %10
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = ptrtoint i8* %16 to i32
%18 = load i8*, i8** %2
%19 = ptrtoint i8* %18 to i32
%20 = icmp eq i32 %17, %19
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @x(i8* %0) {
ret i32 1
}
execl(name, args) char *name;
int args;
{
  extern char **environ;
  execve(name, &args, environ);
}


x86 assembly (clang, -O0):
<execl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ebe(%rip),%rax
mov    (%rax),%rdx
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1030 <execve@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execl>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ecc(%rip),%rax
mov    (%rax),%rdx
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <execve@plt>
pop    %rcx
ret

LLVM IR (-O0):
@environ = external global i8**
define i32 @execl(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = load i8**, i8*** @environ
%8 = call i32 (i8*, i32*, i8**, ...) bitcast (i32 (...)* @execve to i32 (i8*, i32*, i8**, ...)*)(i8* %6, i32* %5, i8** %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@environ = external global i8**
define i32 @execl(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i8**, i8*** @environ
%5 = call i32 (i8*, i32*, i8**, ...) bitcast (i32 (...)* @execve to i32 (i8*, i32*, i8**, ...)*)(i8* %0, i32* %3, i8** %4)
ret i32 undef
}
int HelpItem105(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @HelpItem105() {
ret i32 0
}

LLVM IR (-O2):
define i32 @HelpItem105() {
ret i32 0
}
int vde_chain_nm9_alloc(void **mem, const int *idata, const double *rdata) {
  if (mem)
    *mem = 0;
  (void)idata;
  (void)rdata;
  return 0;
}


x86 assembly (clang, -O0):
<vde_chain_nm9_alloc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1126 <vde_chain_nm9_alloc+0x26>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vde_chain_nm9_alloc>:
test   %rdi,%rdi
je     110c <vde_chain_nm9_alloc+0xc>
movq   $0x0,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @vde_chain_nm9_alloc(i8** %0, i32* %1, double* %2) {
%4 = alloca i8**
%5 = alloca i32*
%6 = alloca double*
store i8** %0, i8*** %4
store i32* %1, i32** %5
store double* %2, double** %6
%7 = load i8**, i8*** %4
%8 = icmp ne i8** %7, null
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = load i8**, i8*** %4
store i8* null, i8** %10
br label %11
11: ; preds = %9, %3
%12 = load i32*, i32** %5
%13 = load double*, double** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @vde_chain_nm9_alloc(i8** writeonly %0, i32* nocapture readnone %1, double* nocapture readnone %2) {
%4 = icmp eq i8** %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
store i8* null, i8** %0
br label %6
6: ; preds = %5, %3
ret i32 0
}
/* Variables and functions */
scalar_t__ prj_get_links();
int prj_getlistsize(void **);
int prj_get_numlinks() { return prj_getlistsize((void **)prj_get_links()); }


x86 assembly (clang, -O0):
<prj_get_numlinks>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <prj_get_links@plt>
mov    %rax,%rdi
call   1030 <prj_getlistsize@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<prj_get_numlinks>:
push   %rax
xor    %eax,%eax
call   1040 <prj_get_links@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <prj_getlistsize@plt>

LLVM IR (-O0):
define i32 @prj_get_numlinks() {
%1 = call i64 (...) @prj_get_links()
%2 = inttoptr i64 %1 to i8**
%3 = call i32 @prj_getlistsize(i8** %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @prj_get_numlinks() {
%1 = tail call i64 (...) @prj_get_links()
%2 = inttoptr i64 %1 to i8**
%3 = tail call i32 @prj_getlistsize(i8** %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ XResizeRequestEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XResizeRequestEvent(void) {
  XResizeRequestEvent *_p =
      (XResizeRequestEvent *)malloc(sizeof(XResizeRequestEvent));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XResizeRequestEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XResizeRequestEvent+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XResizeRequestEvent>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XResizeRequestEvent+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XResizeRequestEvent() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XResizeRequestEvent() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  char name[50];
  printf("Please enter your name: ");
  scanf("%s", name);
  int length = strlen(name);
  printf("Your name is %d characters long\n", length);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xec8(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xeb8(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Please enter your name: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [33 x i8] c"Your name is %d characters long\0A\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Please enter your name: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [33 x i8] c"Your name is %d characters long\0A\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 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), i8* %2)
%5 = call i32 @strlen(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ unlink(char *);
void sighandler(void) {
  unlink("./sock-tcp-client");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <unlink@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sighandler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <unlink@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"./sock-tcp-client\00"
@EXIT_SUCCESS = global i32 0
define void @sighandler() {
%1 = call i32 @unlink(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"./sock-tcp-client\00"
@EXIT_SUCCESS = global i32 0
define void @sighandler() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
void nested_loop3_Bad() {
  double arr[10];
  int i, j;
  for (i = 0; i <= 10; i++) {
    for (j = 5; j < 15; j++) {
      arr[i] = 0.0;
    }
  }
}


x86 assembly (clang, -O0):
<nested_loop3_Bad>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x54(%rbp)
cmpl   $0xa,-0x54(%rbp)
jg     1154 <nested_loop3_Bad+0x54>
movl   $0x5,-0x58(%rbp)
cmpl   $0xf,-0x58(%rbp)
jge    1141 <nested_loop3_Bad+0x41>
movslq -0x54(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp,%rax,8)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    111c <nested_loop3_Bad+0x1c>
jmp    1146 <nested_loop3_Bad+0x46>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    110b <nested_loop3_Bad+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @nested_loop3_Bad() {
%1 = alloca [10 x double]
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
br label %4
4: ; preds = %19, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 10
br i1 %6, label %7, label %22
7: ; preds = %4
store i32 5, i32* %3
br label %8
8: ; preds = %15, %7
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 15
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 %13
store double 0.000000e+00, double* %14
br label %15
15: ; preds = %11
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %8
18: ; preds = %8
br label %19
19: ; preds = %18
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %4
22: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @nested_loop3_Bad() {
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ create_tree(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("Invalid Parameters");
  }
  int depth;
  depth = atoi(argv[1]);
  create_tree(1, 0, depth);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     115c <main+0x2c>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <create_tree@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
je     1145 <main+0x15>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
mov    0x8(%rbx),%rdi
call   1050 <atoi@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    %eax,%edx
call   1030 <create_tree@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Invalid Parameters\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = call i32 @create_tree(i32 1, i32 0, i32 %16)
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@.str = [19 x i8] c"Invalid Parameters\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = tail call i32 @create_tree(i32 1, i32 0, i32 %9)
ret i32 0
}
int add(int i) { return i + i; }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @add(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @add(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
int execNoop(void *NotUsed, int argc, char **argv, char **colv) { return 0; }


x86 assembly (clang, -O0):
<execNoop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @execNoop(i8* %0, i32 %1, i8** %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8**
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @execNoop(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2, i8** nocapture readnone %3) {
ret i32 0
}
void g_byte_array_sized_new() {}


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

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

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

LLVM IR (-O2):
define void @g_byte_array_sized_new() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void _write_word(FILE *f, int i) {
  fprintf(f, "%c", i & 0xff);
  fprintf(f, "%c", (i >> 8) & 0xff);
}


x86 assembly (clang, -O0):
<_write_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
and    $0xff,%edx
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sar    $0x8,%edx
and    $0xff,%edx
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write_word>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
movzbl %bl,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
movzbl %bh,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @_write_word(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 = and i32 %6, 255
%8 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = ashr i32 %10, 8
%12 = and i32 %11, 255
%13 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %12)
ret void
}

LLVM IR (-O2):
define void @_write_word(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 255
%4 = tail call i32 @fputc(i32 %3, i32* %0)
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = tail call i32 @fputc(i32 %6, i32* %0)
ret void
}