xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void cross_stack_direction(void) {
  static char *addr = 0;
  auto char dummy;
  if (addr == 0) {
    addr = &dummy;
    cross_stack_direction();
    return;
  }
  printf("cross_stack_direction=%d\n", (&dummy > addr) ? 1 : -1);
}


x86 assembly (clang, -O0):
<cross_stack_direction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpq   $0x0,0x2f08(%rip)
jne    114b <cross_stack_direction+0x2b>
lea    -0x1(%rbp),%rax
mov    %rax,0x2ef7(%rip)
call   1040 <cross_stack_direction@plt>
jmp    1172 <cross_stack_direction+0x52>
mov    0x2ee6(%rip),%rdx
lea    -0x1(%rbp),%rcx
mov    $0xffffffff,%esi
mov    $0x1,%eax
cmp    %rdx,%rcx
cmova  %eax,%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cross_stack_direction>:
push   %rax
mov    0x2f10(%rip),%rax
test   %rax,%rax
je     114e <cross_stack_direction+0x2e>
lea    0x7(%rsp),%rcx
xor    %edx,%edx
cmp    %rax,%rcx
seta   %dl
lea    (%rdx,%rdx,1),%esi
add    $0xffffffff,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
pop    %rax
ret
lea    0x7(%rsp),%rax
mov    %rax,0x2ede(%rip)
call   1040 <cross_stack_direction@plt>
pop    %rax
ret

LLVM IR (-O0):
@cross_stack_direction.addr = internal global i8* null
@.str = [26 x i8] c"cross_stack_direction=%d\0A\00"
define void @cross_stack_direction() {
%1 = alloca i8
%2 = load i8*, i8** @cross_stack_direction.addr
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %5
4: ; preds = %0
store i8* %1, i8** @cross_stack_direction.addr
br label %11
5: ; preds = %0
%6 = load i8*, i8** @cross_stack_direction.addr
%7 = icmp ugt i8* %1, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 -1
%10 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %5, %4
ret void
}

LLVM IR (-O2):
@cross_stack_direction.addr = internal unnamed_addr global i8* null
@.str = [26 x i8] c"cross_stack_direction=%d\0A\00"
define void @cross_stack_direction() {
%1 = alloca i8
%2 = load i8*, i8** @cross_stack_direction.addr
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %5
4: ; preds = %0
store i8* %1, i8** @cross_stack_direction.addr
br label %9
5: ; preds = %0
%6 = icmp ugt i8* %1, %2
%7 = select i1 %6, i32 1, i32 -1
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %5, %4
ret void
}
/* Type definitions */
struct dlist_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dlist_del(struct dlist_head *);
int /*<<< orphan*/ dlist_init(struct dlist_head *);
void dlist_del_init(struct dlist_head *head) {
  dlist_del(head);
  dlist_init(head);
}


x86 assembly (clang, -O0):
<dlist_del_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <dlist_del@plt>
mov    -0x8(%rbp),%rdi
call   1030 <dlist_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlist_del_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <dlist_del@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <dlist_init@plt>

LLVM IR (-O0):
%struct.dlist_head = type { i32 }
define void @dlist_del_init(%struct.dlist_head* %0) {
%2 = alloca %struct.dlist_head*
store %struct.dlist_head* %0, %struct.dlist_head** %2
%3 = load %struct.dlist_head*, %struct.dlist_head** %2
%4 = call i32 @dlist_del(%struct.dlist_head* %3)
%5 = load %struct.dlist_head*, %struct.dlist_head** %2
%6 = call i32 @dlist_init(%struct.dlist_head* %5)
ret void
}

LLVM IR (-O2):
%struct.dlist_head = type { i32 }
define void @dlist_del_init(%struct.dlist_head* %0) {
%2 = tail call i32 @dlist_del(%struct.dlist_head* %0)
%3 = tail call i32 @dlist_init(%struct.dlist_head* %0)
ret void
}
/* Variables and functions */
double pow(double, double);
double atm_pres(double elev) {
  int ok = 1;
  double t1, t2;
  double pa;
  t1 = 1.0 - (0.0065 * elev) / 288.15;
  t2 = 9.80665 / (0.0065 * (8.3143 / 28.9644e-3));
  pa = 101325.0 * pow(t1, t2);
  return (pa);
}


x86 assembly (clang, -O0):
<atm_pres>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movsd  0xef4(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xedf(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xecb(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeb2(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe8b(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atm_pres>:
push   %rax
mulsd  0xee7(%rip),%xmm0
divsd  0xee7(%rip),%xmm0
addsd  0xee7(%rip),%xmm0
movsd  0xee7(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @atm_pres(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %2
store i32 1, i32* %3
%7 = load double, double* %2
%8 = fmul double 0x3F7A9FBE76C8B439, %7
%9 = fdiv double %8, 2.881500e+02
%10 = fsub double 1.000000e+00, %9
store double %10, double* %4
store double 0x40150607B3BE2A29, double* %5
%11 = load double, double* %4
%12 = load double, double* %5
%13 = call double @pow(double %11, double %12)
%14 = fmul double 1.013250e+05, %13
store double %14, double* %6
%15 = load double, double* %6
ret double %15
}

LLVM IR (-O2):
define double @atm_pres(double %0) {
%2 = fmul double %0, 0x3F7A9FBE76C8B439
%3 = fdiv double %2, 2.881500e+02
%4 = fsub double 1.000000e+00, %3
%5 = tail call double @pow(double %4, double 0x40150607B3BE2A29)
%6 = fmul double %5, 1.013250e+05
ret double %6
}
/* Variables and functions */
long rrandom();
int get_rand(int x, int y) {
  int r, t;
  long lr;
  if (x > y) {
    t = y;
    y = x;
    x = t;
  }
  lr = rrandom();
  lr &= 0x00003fffL;
  r = (int)lr;
  r = (r % ((y - x) + 1)) + x;
  return (r);
}


x86 assembly (clang, -O0):
<get_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    113c <get_rand+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rrandom@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0x3fff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
add    -0x4(%rbp),%edx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rand>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
cmp    %esi,%edi
mov    %esi,%ebp
cmovg  %edi,%ebp
cmovg  %esi,%ebx
xor    %eax,%eax
call   1030 <rrandom@plt>
and    $0x3fff,%eax
sub    %ebx,%ebp
add    $0x1,%ebp
xor    %edx,%edx
idiv   %ebp
add    %edx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_rand(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* %4
store i32 %12, i32* %6
%13 = load i32, i32* %3
store i32 %13, i32* %4
%14 = load i32, i32* %6
store i32 %14, i32* %3
br label %15
15: ; preds = %11, %2
%16 = call i64 (...) @rrandom()
store i64 %16, i64* %7
%17 = load i64, i64* %7
%18 = and i64 %17, 16383
store i64 %18, i64* %7
%19 = load i64, i64* %7
%20 = trunc i64 %19 to i32
store i32 %20, i32* %5
%21 = load i32, i32* %5
%22 = load i32, i32* %4
%23 = load i32, i32* %3
%24 = sub nsw i32 %22, %23
%25 = add nsw i32 %24, 1
%26 = srem i32 %21, %25
%27 = load i32, i32* %3
%28 = add nsw i32 %26, %27
store i32 %28, i32* %5
%29 = load i32, i32* %5
ret i32 %29
}

LLVM IR (-O2):
define i32 @get_rand(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
%5 = select i1 %3, i32 %1, i32 %0
%6 = tail call i64 (...) @rrandom()
%7 = trunc i64 %6 to i32
%8 = and i32 %7, 16383
%9 = sub i32 1, %5
%10 = add i32 %9, %4
%11 = srem i32 %8, %10
%12 = add nsw i32 %11, %5
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void c_print_float(float f) { printf("%f", f); }


x86 assembly (clang, -O0):
<c_print_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define void @c_print_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @c_print_float(float %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %0)
ret void
}
void burn_loop_do_work(void *group_data, void *task_data,
                       unsigned long iterations) {
  unsigned long i;
  for (i = 0; i < iterations; i++) {
  }
}


x86 assembly (clang, -O0):
<burn_loop_do_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    113c <burn_loop_do_work+0x3c>
jmp    112b <burn_loop_do_work+0x2b>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <burn_loop_do_work+0x18>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @burn_loop_do_work(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i64 0, i64* %7
br label %8
8: ; preds = %13, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %6
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %8
br label %13
13: ; preds = %12
%14 = load i64, i64* %7
%15 = add i64 %14, 1
store i64 %15, i64* %7
br label %8
16: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @burn_loop_do_work(i8* nocapture %0, i8* nocapture %1, i64 %2) {
ret void
}
/* Variables and functions */
double cauchy(int);
double gumbel(int /*<<< orphan*/, double, int);
double laplace(int, int, int);
int /*<<< orphan*/ printf(char *, double);
int main() {
  printf("Cauchy: %f\n", cauchy(-2));
  printf("Gumbel: %f\n", gumbel(0, 0.5, 2));
  printf("Laplace: %f\n", laplace(-6, -5, 4));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xfffffffe,%edi
call   1050 <cauchy@plt>
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
movsd  0xe91(%rip),%xmm0
mov    $0x2,%esi
call   1060 <gumbel@plt>
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
mov    $0xfffffffa,%edi
mov    $0xfffffffb,%esi
mov    $0x4,%edx
call   1030 <laplace@plt>
lea    0xe80(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xfffffffe,%edi
call   1050 <cauchy@plt>
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
movsd  0xea1(%rip),%xmm0
xor    %edi,%edi
mov    $0x2,%esi
call   1060 <gumbel@plt>
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
mov    $0xfffffffa,%edi
mov    $0xfffffffb,%esi
mov    $0x4,%edx
call   1030 <laplace@plt>
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Cauchy: %f\0A\00"
@.str.1 = [12 x i8] c"Gumbel: %f\0A\00"
@.str.2 = [13 x i8] c"Laplace: %f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @cauchy(i32 -2)
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %2)
%4 = call double @gumbel(i32 0, double 5.000000e-01, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = call double @laplace(i32 -6, i32 -5, i32 4)
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Cauchy: %f\0A\00"
@.str.1 = [12 x i8] c"Gumbel: %f\0A\00"
@.str.2 = [13 x i8] c"Laplace: %f\0A\00"
define i32 @main() {
%1 = tail call double @cauchy(i32 -2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call double @gumbel(i32 0, double 5.000000e-01, i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %3)
%5 = tail call double @laplace(i32 -6, i32 -5, i32 4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %5)
ret i32 0
}
/* Variables and functions */
scalar_t__ __VERIFIER_nondet_int();
int /*<<< orphan*/ gl_insert(scalar_t__);
void gl_read() {
  int c = 0;
  do {
    c = c + 1;
    gl_insert(__VERIFIER_nondet_int());
  } while (c < 3 && __VERIFIER_nondet_int());
}


x86 assembly (clang, -O0):
<gl_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %rax,%rdi
call   1030 <gl_insert@plt>
xor    %eax,%eax
cmpl   $0x3,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jge    1167 <gl_read+0x47>
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    112f <gl_read+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gl_read>:
push   %rax
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
mov    %rax,%rdi
call   1030 <gl_insert@plt>
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
je     1167 <gl_read+0x47>
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
mov    %rax,%rdi
call   1030 <gl_insert@plt>
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
je     1167 <gl_read+0x47>
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <gl_insert@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @gl_read() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %13, %0
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = call i64 (...) @__VERIFIER_nondet_int()
%6 = call i32 @gl_insert(i64 %5)
br label %7
7: ; preds = %2
%8 = load i32, i32* %1
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = call i64 (...) @__VERIFIER_nondet_int()
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %10, %7
%14 = phi i1 [ false, %7 ], [ %12, %10 ]
br i1 %14, label %2, label %15
15: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @gl_read() {
%1 = tail call i64 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 @gl_insert(i64 %1)
%3 = tail call i64 (...) @__VERIFIER_nondet_int()
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %0
%6 = tail call i64 (...) @__VERIFIER_nondet_int()
%7 = tail call i32 @gl_insert(i64 %6)
%8 = tail call i64 (...) @__VERIFIER_nondet_int()
%9 = icmp eq i64 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %5
%11 = tail call i64 (...) @__VERIFIER_nondet_int()
%12 = tail call i32 @gl_insert(i64 %11)
br label %13
13: ; preds = %10, %5, %0
ret void
}
double doubleme() { return (20000.0); }


x86 assembly (clang, -O0):
<doubleme>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @doubleme() {
ret double 2.000000e+04
}

LLVM IR (-O2):
define double @doubleme() {
ret double 2.000000e+04
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int connect(short, struct sockaddr *, int);
int socketConnect(short socket, struct sockaddr *sa) {
  return connect(socket, sa, sizeof(struct sockaddr));
}


x86 assembly (clang, -O0):
<socketConnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
movswl %ax,%edi
call   1030 <connect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socketConnect>:
mov    $0x4,%edx
jmp    1030 <connect@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @socketConnect(i16 signext %0, %struct.sockaddr* %1) {
%3 = alloca i16
%4 = alloca %struct.sockaddr*
store i16 %0, i16* %3
store %struct.sockaddr* %1, %struct.sockaddr** %4
%5 = load i16, i16* %3
%6 = load %struct.sockaddr*, %struct.sockaddr** %4
%7 = call i32 @connect(i16 signext %5, %struct.sockaddr* %6, i32 4)
ret i32 %7
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @socketConnect(i16 signext %0, %struct.sockaddr* %1) {
%3 = tail call i32 @connect(i16 signext %0, %struct.sockaddr* %1, i32 4)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ showError(char const *, int);
void errorLog(const char msg[], int x) { showError(msg, x); }


x86 assembly (clang, -O0):
<errorLog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <showError@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errorLog>:
jmp    1030 <showError@plt>

LLVM IR (-O0):
define void @errorLog(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @showError(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @errorLog(i8* %0, i32 %1) {
%3 = tail call i32 @showError(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCM_BM_occurrence_deliver(int, int);
int /*<<< orphan*/ LCM_BM_occurrence_deliver_iter_delete(int, int);
void LCM_BM_occurrence_deliver_(int item, int mask) {
  LCM_BM_occurrence_deliver_iter_delete(item, mask);
  LCM_BM_occurrence_deliver(item - 1, mask);
}


x86 assembly (clang, -O0):
<LCM_BM_occurrence_deliver_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <LCM_BM_occurrence_deliver_iter_delete@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1040 <LCM_BM_occurrence_deliver@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCM_BM_occurrence_deliver_>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <LCM_BM_occurrence_deliver_iter_delete@plt>
add    $0xffffffff,%ebp
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <LCM_BM_occurrence_deliver@plt>

LLVM IR (-O0):
define void @LCM_BM_occurrence_deliver_(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 @LCM_BM_occurrence_deliver_iter_delete(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = load i32, i32* %4
%11 = call i32 @LCM_BM_occurrence_deliver(i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @LCM_BM_occurrence_deliver_(i32 %0, i32 %1) {
%3 = tail call i32 @LCM_BM_occurrence_deliver_iter_delete(i32 %0, i32 %1)
%4 = add nsw i32 %0, -1
%5 = tail call i32 @LCM_BM_occurrence_deliver(i32 %4, i32 %1)
ret void
}
/* Variables and functions */
int f(int /*<<< orphan*/);
int /*<<< orphan*/ g(int /*<<< orphan*/);
int /*<<< orphan*/ h();
main() { return f(g(h())); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <h@plt>
mov    %eax,%edi
call   1050 <g@plt>
mov    %eax,%edi
call   1040 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <h@plt>
mov    %eax,%edi
call   1050 <g@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <f@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @h()
%2 = tail call i32 @g(i32 %1)
%3 = tail call i32 @f(i32 %2)
ret i32 %3
}
void wait_for_tb_resync(void) {}


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

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

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

LLVM IR (-O2):
define void @wait_for_tb_resync() {
ret void
}
void initiateArray2zero(double *A, int n) {
  int i;
  for (i = 0; i < n; i++) {
    A[i] = 0.0;
  }
}


x86 assembly (clang, -O0):
<initiateArray2zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113c <initiateArray2zero+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <initiateArray2zero+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initiateArray2zero>:
test   %esi,%esi
jle    1126 <initiateArray2zero+0x16>
push   %rax
mov    %esi,%edx
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @initiateArray2zero(double* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast double* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 3
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
size_t strlen(char *);
scalar_t__ tolower(char);
void toLowerCase(char *s) {
  size_t i, length = strlen(s);
  for (i = 0; i < length; i++)
    s[i] = (char)tolower(s[i]);
}


x86 assembly (clang, -O0):
<toLowerCase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    117e <toLowerCase+0x5e>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1141 <toLowerCase+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toLowerCase>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1030 <strlen@plt>
test   %rax,%rax
je     1157 <toLowerCase+0x37>
mov    %rax,%r14
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1040 <tolower@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <toLowerCase+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @toLowerCase(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %4
store i64 0, i64* %3
br label %7
7: ; preds = %21, %1
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %7
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = getelementptr inbounds i8, i8* %12, i64 %13
%15 = load i8, i8* %14
%16 = call i64 @tolower(i8 signext %15)
%17 = trunc i64 %16 to i8
%18 = load i8*, i8** %2
%19 = load i64, i64* %3
%20 = getelementptr inbounds i8, i8* %18, i64 %19
store i8 %17, i8* %20
br label %21
21: ; preds = %11
%22 = load i64, i64* %3
%23 = add i64 %22, 1
store i64 %23, i64* %3
br label %7
24: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @toLowerCase(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i64 @tolower(i8 signext %7)
%9 = trunc i64 %8 to i8
store i8 %9, i8* %6
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %2
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t bar2() { return 6; }


x86 assembly (clang, -O0):
<bar2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bar2() {
ret i32 6
}

LLVM IR (-O2):
define i32 @bar2() {
ret i32 6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void THFree(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<THFree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @THFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int undef(int);
int r(void) { return undef(3); }


x86 assembly (clang, -O0):
<r>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <undef@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<r>:
mov    $0x3,%edi
jmp    1030 <undef@plt>

LLVM IR (-O0):
define i32 @r() {
%1 = call i32 @undef(i32 3)
ret i32 %1
}

LLVM IR (-O2):
define i32 @r() {
%1 = tail call i32 @undef(i32 3)
ret i32 %1
}
/* Variables and functions */
char max_letter(char);
int /*<<< orphan*/ print_board();
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ update(char, char);
void artificial3(void) {
  char color;
  color = max_letter('^');
  printf("%c\n", color);
  update('^', color);
  print_board();
}


x86 assembly (clang, -O0):
<artificial3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5e,%edi
call   1040 <max_letter@plt>
mov    %al,-0x1(%rbp)
lea    0xea4(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1050 <printf@plt>
mov    $0x5e,%edi
movsbl -0x1(%rbp),%esi
call   1030 <update@plt>
mov    $0x0,%al
call   1060 <print_board@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<artificial3>:
push   %rbx
mov    $0x5e,%edi
call   1040 <max_letter@plt>
movsbl %al,%ebx
lea    0xeab(%rip),%rdi
mov    %ebx,%esi
call   1050 <printf@plt>
mov    $0x5e,%edi
mov    %ebx,%esi
call   1030 <update@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <print_board@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%c\0A\00"
define void @artificial3() {
%1 = alloca i8
%2 = call signext i8 @max_letter(i8 signext 94)
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = load i8, i8* %1
%6 = call i32 @update(i8 signext 94, i8 signext %5)
%7 = call i32 (...) @print_board()
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define void @artificial3() {
%1 = tail call signext i8 @max_letter(i8 signext 94)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %1)
%3 = tail call i32 @update(i8 signext 94, i8 signext %1)
%4 = tail call i32 (...) @print_board()
ret void
}
/* Type definitions */
struct tgl_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ send_all_acks(struct tgl_state *, void *);
void send_all_acks_gateway(struct tgl_state *TLS, void *arg) {
  send_all_acks(TLS, arg);
}


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

x86 assembly (clang, -O2):
<send_all_acks_gateway>:
jmp    1030 <send_all_acks@plt>

LLVM IR (-O0):
%struct.tgl_state = type { i32 }
define void @send_all_acks_gateway(%struct.tgl_state* %0, i8* %1) {
%3 = alloca %struct.tgl_state*
%4 = alloca i8*
store %struct.tgl_state* %0, %struct.tgl_state** %3
store i8* %1, i8** %4
%5 = load %struct.tgl_state*, %struct.tgl_state** %3
%6 = load i8*, i8** %4
%7 = call i32 @send_all_acks(%struct.tgl_state* %5, i8* %6)
ret void
}

LLVM IR (-O2):
%struct.tgl_state = type { i32 }
define void @send_all_acks_gateway(%struct.tgl_state* %0, i8* %1) {
%3 = tail call i32 @send_all_acks(%struct.tgl_state* %0, i8* %1)
ret void
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void MSCP_ResponseSink_ConnectionManager_GetCurrentConnectionIDs(
    struct UPnPService *Service, int ErrorCode, void *User,
    char *ConnectionIDs) {
  printf("MSCP_ Invoke Response: "
         "ConnectionManager/GetCurrentConnectionIDs[ErrorCode:%d](%s)\r\n",
         ErrorCode, ConnectionIDs);
}


x86 assembly (clang, -O0):
<MSCP_ResponseSink_ConnectionManager_GetCurrentConnectionIDs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MSCP_ResponseSink_ConnectionManager_GetCurrentConnectionIDs>:
lea    0xee9(%rip),%rdi
mov    %rcx,%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [85 x i8] c"MSCP_ Invoke Response: ConnectionManager/GetCurrentConnectionIDs[ErrorCode:%d](%s)\0D\0A\00"
define void @MSCP_ResponseSink_ConnectionManager_GetCurrentConnectionIDs(%struct.UPnPService* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca %struct.UPnPService*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %6
%10 = load i8*, i8** %8
%11 = call i32 @printf(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [85 x i8] c"MSCP_ Invoke Response: ConnectionManager/GetCurrentConnectionIDs[ErrorCode:%d](%s)\0D\0A\00"
define void @MSCP_ResponseSink_ConnectionManager_GetCurrentConnectionIDs(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pr_info(char *, unsigned long long);
scalar_t__ strlen(char *);
int myinit(void) {
  char buf[] = {'p', 'w', 'n'};
  pr_info("%llu\n", (long long unsigned)strlen(buf));
  return 0;
}


x86 assembly (clang, -O0):
<myinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec9(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x3(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rsi
lea    0xeb4(%rip),%rdi
call   1030 <pr_info@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myinit>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x3,%esi
call   1030 <pr_info@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.myinit.buf = [3 x i8] c"pwn"
@.str = [6 x i8] c"%llu\0A\00"
define i32 @myinit() {
%1 = alloca [3 x i8]
%2 = bitcast [3 x i8]* %1 to i8*
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = call i64 @strlen(i8* %3)
%5 = call i32 @pr_info(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%llu\0A\00"
define i32 @myinit() {
%1 = tail call i32 @pr_info(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void dummy() {
  int i = 0;
  assert(i == 0);
  assert(i == 1);
}


x86 assembly (clang, -O0):
<dummy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dummy>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @dummy() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret void
}

LLVM IR (-O2):
define void @dummy() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
scalar_t__ Char_3d_array(int, int, int);
short ***Short_3d_array(int i_size, int j_size, int k_size) {
  return ((short ***)Char_3d_array(i_size, j_size, k_size * sizeof(short)));
}


x86 assembly (clang, -O0):
<Short_3d_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
movslq -0xc(%rbp),%rax
shl    $0x1,%rax
mov    %eax,%edx
call   1030 <Char_3d_array@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Short_3d_array>:
add    %edx,%edx
jmp    1030 <Char_3d_array@plt>

LLVM IR (-O0):
define i16*** @Short_3d_array(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 2
%12 = trunc i64 %11 to i32
%13 = call i64 @Char_3d_array(i32 %7, i32 %8, i32 %12)
%14 = inttoptr i64 %13 to i16***
ret i16*** %14
}

LLVM IR (-O2):
define i16*** @Short_3d_array(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %2, 1
%5 = tail call i64 @Char_3d_array(i32 %0, i32 %1, i32 %4)
%6 = inttoptr i64 %5 to i16***
ret i16*** %6
}
int main() {
  unsigned int plus_one = 1;
  int minus_one = -1;
  if (plus_one < minus_one) {
    goto ERROR;
  }
  return (0);
ERROR:
  return (-1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    112a <main+0x2a>
jmp    1136 <main+0x36>
movl   $0x0,-0x4(%rbp)
jmp    113d <main+0x3d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 -1
}
/* Variables and functions */
scalar_t__ WX_GetRainDataRecord(int);
int sumRainDataRecords(int startRecord, int endRecord) {
  int i;
  int sum = 0;
  for (i = startRecord; i <= endRecord; i++)
    sum += WX_GetRainDataRecord(i);
  return (sum);
}


x86 assembly (clang, -O0):
<sumRainDataRecords>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     115a <sumRainDataRecords+0x4a>
mov    -0xc(%rbp),%edi
call   1030 <WX_GetRainDataRecord@plt>
mov    %rax,%rcx
movslq -0x10(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <sumRainDataRecords+0x1b>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumRainDataRecords>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
cmp    %esi,%edi
jg     1141 <sumRainDataRecords+0x31>
mov    %esi,%r14d
mov    %edi,%ebp
add    $0x1,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,%edi
call   1030 <WX_GetRainDataRecord@plt>
add    %eax,%ebx
add    $0x1,%ebp
cmp    %ebp,%r14d
jne    1130 <sumRainDataRecords+0x20>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sumRainDataRecords(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %6
%7 = load i32, i32* %3
store i32 %7, i32* %5
br label %8
8: ; preds = %19, %2
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i32, i32* %5
%14 = call i64 @WX_GetRainDataRecord(i32 %13)
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = add nsw i64 %16, %14
%18 = trunc i64 %17 to i32
store i32 %18, i32* %6
br label %19
19: ; preds = %12
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %8
22: ; preds = %8
%23 = load i32, i32* %6
ret i32 %23
}

LLVM IR (-O2):
define i32 @sumRainDataRecords(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ 0, %2 ]
%6 = phi i32 [ %10, %4 ], [ %0, %2 ]
%7 = tail call i64 @WX_GetRainDataRecord(i32 %6)
%8 = trunc i64 %7 to i32
%9 = add i32 %5, %8
%10 = add i32 %6, 1
%11 = icmp eq i32 %6, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = phi i32 [ 0, %2 ], [ %9, %4 ]
ret i32 %13
}
int strlength(char a2[50]) {
  int l = 0, j;
  for (j = 0; j < 50; j++) {
    if (a2[j] != '\0') {
      l = l + 1;
    }
    return l + 1;
  }
}


x86 assembly (clang, -O0):
<strlength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x32,-0x18(%rbp)
jge    1147 <strlength+0x47>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     113e <strlength+0x3e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlength>:
cmpb   $0x1,(%rdi)
mov    $0x2,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @strlength(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %23, %1
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 50
br i1 %8, label %9, label %26
9: ; preds = %6
%10 = load i8*, i8** %3
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %9
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %20
20: ; preds = %17, %9
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %26
23: ; No predecessors!
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %6
26: ; preds = %20, %6
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @strlength(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 1, i32 2
ret i32 %4
}
void ff_h264qpel_init_arm() {}


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

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

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

LLVM IR (-O2):
define void @ff_h264qpel_init_arm() {
ret void
}
void MIDI_UART_SaveConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @MIDI_UART_SaveConfig() {
ret void
}
int test_imm_50int64_lowword_reg(long long val) {
  return ((val) & (0x50 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_50int64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x50,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_50int64_lowword_reg>:
test   $0x50,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_50int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 80
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: elwe <path/to/file>\n");
  exit(EXIT_SUCCESS);
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"Usage: elwe <path/to/file>\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [27 x i8] c"Usage: elwe <path/to/file>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int clear_quaddobl_data(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(248, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<clear_quaddobl_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xf8,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_quaddobl_data>:
mov    $0xf8,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @clear_quaddobl_data() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 248, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @clear_quaddobl_data() {
%1 = tail call i32 @_ada_use_c2phc(i32 248, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ run_cpuid(int, int /*<<< orphan*/, int *);
int has_POPCNT() {
  int abcd[4];
  run_cpuid(1, 0, abcd);
  if ((abcd[2] & (1 << 23)) != (1 << 23))
    return 0;
  return (1 << 23);
}


x86 assembly (clang, -O0):
<has_POPCNT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <run_cpuid@plt>
mov    -0x18(%rbp),%eax
and    $0x800000,%eax
cmp    $0x800000,%eax
je     1147 <has_POPCNT+0x37>
movl   $0x0,-0x4(%rbp)
jmp    114e <has_POPCNT+0x3e>
movl   $0x800000,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_POPCNT>:
sub    $0x18,%rsp
mov    %rsp,%rdx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <run_cpuid@plt>
mov    $0x800000,%eax
and    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @has_POPCNT() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%4 = call i32 @run_cpuid(i32 1, i32 0, i32* %3)
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
%6 = load i32, i32* %5
%7 = and i32 %6, 8388608
%8 = icmp ne i32 %7, 8388608
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 0, i32* %1
br label %11
10: ; preds = %0
store i32 8388608, i32* %1
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @has_POPCNT() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @run_cpuid(i32 1, i32 0, i32* %3)
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 2
%6 = load i32, i32* %5
%7 = and i32 %6, 8388608
ret i32 %7
}
/* Variables and functions */
int err_syntax18_parse();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("yyparse() = %d\n", err_syntax18_parse());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <err_syntax18_parse@plt>
mov    %eax,%esi
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <err_syntax18_parse@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"yyparse() = %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @err_syntax18_parse()
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"yyparse() = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @err_syntax18_parse()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int baz(double d) {
  double e = bar(d);
  asm volatile("" : : : "st");
  return printf("%lg\n", e);
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1030 <bar@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xeb2(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
push   %rax
mov    $0x1,%al
call   1030 <bar@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
lea    0xeca(%rip),%rdi
mov    $0x1,%al
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%lg\0A\00"
define i32 @baz(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 (double, ...) bitcast (i32 (...)* @bar to i32 (double, ...)*)(double %4)
%6 = sitofp i32 %5 to double
store double %6, double* %3
%7 = load double, double* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lg\0A\00"
define i32 @baz(double %0) {
%2 = tail call i32 (double, ...) bitcast (i32 (...)* @bar to i32 (double, ...)*)(double %0)
%3 = sitofp i32 %2 to double
tail call void asm sideeffect "", "~{st},~{dirflag},~{fpsr},~{flags}"()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %3)
ret i32 %4
}