xunge/DecIR huggingface dataset:
int test_imm_49int64_lowword_reg(long long val) {
  return ((val) & (0x49 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_49int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 73
%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_49int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 73
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
double UC_11_1_8(double F_t_s_d, double F_t_u_d) {
  return (F_t_s_d / (0.7 * F_t_u_d));
}


x86 assembly (clang, -O0):
<UC_11_1_8>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee5(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<UC_11_1_8>:
mulsd  0xef8(%rip),%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @UC_11_1_8(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fmul double 0x3FE6666666666666, %6
%8 = fdiv double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @UC_11_1_8(double %0, double %1) {
%3 = fmul double %1, 0x3FE6666666666666
%4 = fdiv double %0, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void aschar(char i) { printf("%c", i); }


x86 assembly (clang, -O0):
<aschar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aschar>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @aschar(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
/* Variables and functions */
char toupper(char);
int hex_to_int(char x) {
  x = toupper(x);
  if (x >= '0' && x <= '9')
    return (x - '0');
  return (10 + (x - 'A'));
}


x86 assembly (clang, -O0):
<hex_to_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <toupper@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1153 <hex_to_int+0x43>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1153 <hex_to_int+0x43>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <hex_to_int+0x50>
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_to_int>:
push   %rax
call   1030 <toupper@plt>
movsbl %al,%eax
lea    -0x30(%rax),%ecx
lea    -0x37(%rax),%edx
add    $0xffffffd0,%eax
cmp    $0xa,%cl
cmovae %edx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @hex_to_int(i8 signext %0) {
%2 = tail call signext i8 @toupper(i8 signext %0)
%3 = sext i8 %2 to i32
%4 = add i8 %2, -48
%5 = icmp ult i8 %4, 10
%6 = select i1 %5, i32 -48, i32 -55
%7 = add nsw i32 %6, %3
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int pioneer_sonar(int);
int /*<<< orphan*/ stderr;
int carmen_base_direct_sonar_on(void) {
  int err = 0;
  fprintf(stderr, "Switching sonars on\n");
  err = pioneer_sonar(1);
  if (err < 0)
    return -1;
  return 32;
}


x86 assembly (clang, -O0):
<carmen_base_direct_sonar_on>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1030 <pioneer_sonar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1167 <carmen_base_direct_sonar_on+0x47>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <carmen_base_direct_sonar_on+0x4e>
movl   $0x20,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<carmen_base_direct_sonar_on>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1030 <pioneer_sonar@plt>
sar    $0x1f,%eax
or     $0x20,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Switching sonars on\0A\00"
define i32 @carmen_base_direct_sonar_on() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @pioneer_sonar(i32 1)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 -1, i32* %1
br label %10
9: ; preds = %0
store i32 32, i32* %1
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Switching sonars on\0A\00"
define i32 @carmen_base_direct_sonar_on() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @pioneer_sonar(i32 1)
%4 = icmp sgt i32 %3, -1
%5 = select i1 %4, i32 32, i32 -1
ret i32 %5
}
int test_imm_37uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x37 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_37uint64_midword_reg>:
test   $0x370000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_37uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 3604480
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void error_not_applicable(void *client_state) {}


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

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

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

LLVM IR (-O2):
define void @error_not_applicable(i8* nocapture %0) {
ret void
}
int move(int y, int x) {
  (void)y;
  (void)x;
  return (0);
}


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

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

LLVM IR (-O0):
define i32 @move(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
ret i32 0
}

LLVM IR (-O2):
define i32 @move(i32 %0, i32 %1) {
ret i32 0
}
unsigned char kmAlmostEqual(float lhs, float rhs) {
  return (lhs + 0.0001 > rhs && lhs - 0.0001 < rhs);
}


x86 assembly (clang, -O0):
<kmAlmostEqual>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee1(%rip),%xmm1
addsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
mov    %al,-0x9(%rbp)
jbe    1163 <kmAlmostEqual+0x63>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb4(%rip),%xmm0
subsd  %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmAlmostEqual>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm2
addsd  %xmm0,%xmm2
cvtss2sd %xmm1,%xmm1
ucomisd %xmm1,%xmm2
seta   %cl
addsd  0xee5(%rip),%xmm0
ucomisd %xmm0,%xmm1
seta   %al
and    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @kmAlmostEqual(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = fadd double %6, 1.000000e-04
%8 = load float, float* %4
%9 = fpext float %8 to double
%10 = fcmp ogt double %7, %9
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load float, float* %3
%13 = fpext float %12 to double
%14 = fsub double %13, 1.000000e-04
%15 = load float, float* %4
%16 = fpext float %15 to double
%17 = fcmp olt double %14, %16
br label %18
18: ; preds = %11, %2
%19 = phi i1 [ false, %2 ], [ %17, %11 ]
%20 = zext i1 %19 to i32
%21 = trunc i32 %20 to i8
ret i8 %21
}

LLVM IR (-O2):
define zeroext i8 @kmAlmostEqual(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fadd double %3, 1.000000e-04
%5 = fpext float %1 to double
%6 = fcmp ogt double %4, %5
%7 = fadd double %3, -1.000000e-04
%8 = fcmp olt double %7, %5
%9 = and i1 %6, %8
%10 = zext i1 %9 to i8
ret i8 %10
}
/* Type definitions */
struct list16 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ g_free(struct list16 *);
int /*<<< orphan*/ list16_deinit(struct list16 *);
void list16_delete(struct list16 *self) {
  if (self == 0) {
    return;
  }
  list16_deinit(self);
  g_free(self);
}


x86 assembly (clang, -O0):
<list16_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <list16_delete+0x1c>
jmp    114e <list16_delete+0x2e>
mov    -0x8(%rbp),%rdi
call   1040 <list16_deinit@plt>
mov    -0x8(%rbp),%rdi
call   1030 <g_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list16_delete>:
test   %rdi,%rdi
je     1137 <list16_delete+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <list16_deinit@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <g_free@plt>
ret

LLVM IR (-O0):
%struct.list16 = type { i32 }
define void @list16_delete(%struct.list16* %0) {
%2 = alloca %struct.list16*
store %struct.list16* %0, %struct.list16** %2
%3 = load %struct.list16*, %struct.list16** %2
%4 = icmp eq %struct.list16* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load %struct.list16*, %struct.list16** %2
%8 = call i32 @list16_deinit(%struct.list16* %7)
%9 = load %struct.list16*, %struct.list16** %2
%10 = call i32 @g_free(%struct.list16* %9)
br label %11
11: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.list16 = type { i32 }
define void @list16_delete(%struct.list16* %0) {
%2 = icmp eq %struct.list16* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @list16_deinit(%struct.list16* %0)
%5 = tail call i32 @g_free(%struct.list16* %0)
br label %6
6: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *exe_name) {
  if (NULL == exe_name)
    return;
  printf("Usage:\n"
         "\t%s [-ecb] [-key < 128 | 192 | 256 >] <text>\n",
         exe_name);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
jne    112d <usage+0x1d>
jmp    113d <usage+0x2d>
mov    -0x8(%rbp),%rsi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
test   %rdi,%rdi
je     1124 <usage+0x14>
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [53 x i8] c"Usage:\0A\09%s [-ecb] [-key < 128 | 192 | 256 >] <text>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* null, %3
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"Usage:\0A\09%s [-ecb] [-key < 128 | 192 | 256 >] <text>\0A\00"
define void @usage(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p384_mul(uintptr_t, uintptr_t, uintptr_t);
void fiat_p384_mul(uint32_t out1[12], const uint32_t arg1[12],
                   const uint32_t arg2[12]) {
  internal_fiat_p384_mul((uintptr_t)out1, (uintptr_t)arg1, (uintptr_t)arg2);
}


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

x86 assembly (clang, -O2):
<fiat_p384_mul>:
jmp    1030 <internal_fiat_p384_mul@plt>

LLVM IR (-O0):
define void @fiat_p384_mul(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 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_p384_mul(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_p384_mul(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_p384_mul(i64 %4, i64 %5, i64 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XShrinkRegion() {
  printf("XShrinkRegion called\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<XShrinkRegion>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"XShrinkRegion called\0A\00"
define i32 @XShrinkRegion() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [21 x i8] c"XShrinkRegion called\00"
define i32 @XShrinkRegion() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int c033(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c033() {
ret i32 0
}
double arr_sum_double(double x[4]) {
  double total = 0;
  int n;
  for (n = 0; n < 4; n++) {
    total += x[n];
  }
  return total;
}


x86 assembly (clang, -O0):
<arr_sum_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1146 <arr_sum_double+0x46>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <arr_sum_double+0x17>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<arr_sum_double>:
xorpd  %xmm0,%xmm0
addsd  (%rdi),%xmm0
addsd  0x8(%rdi),%xmm0
addsd  0x10(%rdi),%xmm0
addsd  0x18(%rdi),%xmm0
ret

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

LLVM IR (-O2):
define double @arr_sum_double(double* nocapture %0) {
%2 = load double, double* %0
%3 = fadd double %2, 0.000000e+00
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = fadd double %3, %5
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = fadd double %6, %8
%10 = getelementptr inbounds double, double* %0, i64 3
%11 = load double, double* %10
%12 = fadd double %9, %11
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ towerOfHanoi(int, int, int, int);
int main() {
  towerOfHanoi(17, 1, 3, 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x11,%edi
mov    $0x1,%esi
mov    $0x3,%edx
mov    $0x2,%ecx
call   1030 <towerOfHanoi@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x11,%edi
mov    $0x1,%esi
mov    $0x3,%edx
mov    $0x2,%ecx
call   1030 <towerOfHanoi@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @towerOfHanoi(i32 17, i32 1, i32 3, i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ I2C_TENBIT;
int ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int I2C_disable10BitAddressing(int i2c_fd) {
  int ret;
  ret = ioctl(i2c_fd, I2C_TENBIT, 0);
  if (ret < 0)
    return ret;
  return 0;
}


x86 assembly (clang, -O0):
<I2C_disable10BitAddressing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <ioctl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1146 <I2C_disable10BitAddressing+0x36>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114d <I2C_disable10BitAddressing+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2C_disable10BitAddressing>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <ioctl@plt>
mov    %eax,%ecx
sar    $0x1f,%ecx
and    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@I2C_TENBIT = global i32 0
define i32 @I2C_disable10BitAddressing(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @I2C_TENBIT
%7 = call i32 @ioctl(i32 %5, i32 %6, i32 0)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@I2C_TENBIT = global i32 0
define i32 @I2C_disable10BitAddressing(i32 %0) {
%2 = load i32, i32* @I2C_TENBIT
%3 = tail call i32 @ioctl(i32 %0, i32 %2, i32 0)
%4 = icmp slt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
__attribute__((__noreturn__)) void exitfunc14(void) {
  printf("Executing exitfunc"
         "14"
         ".\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Executing exitfunc14.\0A\00"
define void @exitfunc14() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [22 x i8] c"Executing exitfunc14.\00"
define void @exitfunc14() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
float obdConvert_0A(unsigned int A, unsigned int B, unsigned int C,
                    unsigned int D) {
  return (float)A * 3;
}


x86 assembly (clang, -O0):
<obdConvert_0A>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xee0(%rip),%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<obdConvert_0A>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
mulss  0xef1(%rip),%xmm0
ret

LLVM IR (-O0):
define float @obdConvert_0A(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = uitofp i32 %9 to float
%11 = fmul float %10, 3.000000e+00
ret float %11
}

LLVM IR (-O2):
define float @obdConvert_0A(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = uitofp i32 %0 to float
%6 = fmul float %5, 3.000000e+00
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int cpp_defs() {
  printf("CPP Defs:\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<cpp_defs>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"CPP Defs:\0A\00"
define i32 @cpp_defs() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [10 x i8] c"CPP Defs:\00"
define i32 @cpp_defs() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void gtk_text_view_get_line_at_y() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_view_get_line_at_y() {
ret void
}
/* Variables and functions */
int assert_true(int, char const *, int);
int assert_false(int a, const char *testcase, int line) {
  return assert_true(!a, testcase, line);
}


x86 assembly (clang, -O0):
<assert_false>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <assert_true@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_false>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
mov    %eax,%edi
jmp    1030 <assert_true@plt>

LLVM IR (-O0):
define i32 @assert_false(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @assert_true(i32 %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @assert_false(i32 %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert_true(i32 %5, i8* %1, i32 %2)
ret i32 %6
}
/* Type definitions */
struct group {
  int dummy;
};
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
struct group *getgrgid(gid_t gid) {
  assert(!"NYI");
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.group = type { i32 }
@.str = [4 x i8] c"NYI\00"
define %struct.group* @getgrgid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @assert(i32 0)
ret %struct.group* null
}

LLVM IR (-O2):
%struct.group = type { i32 }
define noalias %struct.group* @getgrgid(i32 %0) {
%2 = tail call i32 @assert(i32 0)
ret %struct.group* null
}
long long usuu() { return 0x7fffffff7fff7fffLL; }


x86 assembly (clang, -O0):
<usuu>:
push   %rbp
mov    %rsp,%rbp
movabs $0x7fffffff7fff7fff,%rax
ff ff 7f
pop    %rbp
ret

x86 assembly (clang, -O2):
<usuu>:
movabs $0x7fffffff7fff7fff,%rax
ff ff 7f
ret

LLVM IR (-O0):
define i64 @usuu() {
ret i64 9223372034707259391
}

LLVM IR (-O2):
define i64 @usuu() {
ret i64 9223372034707259391
}
/* Variables and functions */
int /*<<< orphan*/ ConvertFromDouble(double, unsigned char *);
int write(int, unsigned char *, int);
int ConvertWriteDouble(int fp, double val) {
  unsigned char tmp[8];
  ConvertFromDouble(val, tmp);
  if (write(fp, tmp, 8) != 8)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<ConvertWriteDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    -0x18(%rbp),%rdi
call   1040 <ConvertFromDouble@plt>
mov    -0x8(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x8,%edx
call   1030 <write@plt>
cmp    $0x8,%eax
je     1164 <ConvertWriteDouble+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <ConvertWriteDouble+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertWriteDouble>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <ConvertFromDouble@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x8,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    $0x8,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @ConvertWriteDouble(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca [8 x i8]
store i32 %0, i32* %4
store double %1, double* %5
%7 = load double, double* %5
%8 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%9 = call i32 @ConvertFromDouble(double %7, i8* %8)
%10 = load i32, i32* %4
%11 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%12 = call i32 @write(i32 %10, i8* %11, i32 8)
%13 = icmp ne i32 %12, 8
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 -1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @ConvertWriteDouble(i32 %0, double %1) {
%3 = alloca [8 x i8]
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%5 = call i32 @ConvertFromDouble(double %1, i8* %4)
%6 = call i32 @write(i32 %0, i8* %4, i32 8)
%7 = icmp ne i32 %6, 8
%8 = sext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isxdigit(int);
void t_isxdigit_0x64() {
  Assert_real((isxdigit(100)),
              "/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/ctype/test_isxdigit.c",
              505, ("isxdigit should be 1 for d"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x64>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
call   1030 <isxdigit@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1f9,%edx
lea    0xf66(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x64>:
push   %rax
mov    $0x64,%edi
call   1030 <isxdigit@plt>
lea    0xece(%rip),%rsi
lea    0xf70(%rip),%rcx
mov    %eax,%edi
mov    $0x1f9,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 1 for d\00"
define void @t_isxdigit_0x64() {
%1 = call i32 @isxdigit(i32 100)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 505, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 1 for d\00"
define void @t_isxdigit_0x64() {
%1 = tail call i32 @isxdigit(i32 100)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 505, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s\n", "hola UTN!");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee5(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [10 x i8] c"hola UTN!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [10 x i8] c"hola UTN!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test() { printf("Hello\n"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"Hello\0A\00"
define void @test() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"Hello\00"
define void @test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
char *getcwd(char *buf, size_t size) {
  errno = ENOSYS;
  return NULL;
}


x86 assembly (clang, -O0):
<getcwd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcwd>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i8* @getcwd(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i8* null
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define noalias i8* @getcwd(i8* nocapture readnone %0, i64 %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ cos(double);
int /*<<< orphan*/ cosf(float);
int /*<<< orphan*/ cosl(long double);
void uninitvar_cos(void) {
  float f;
  (void)cosf(f);
  double d;
  (void)cos(d);
  long double ld;
  (void)cosl(ld);
}


x86 assembly (clang, -O0):
<uninitvar_cos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  -0x4(%rbp),%xmm0
call   1030 <cosf@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <cos@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <cosl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_cos>:
sub    $0x18,%rsp
call   1030 <cosf@plt>
call   1050 <cos@plt>
call   1040 <cosl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_cos() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = call i32 @cosf(float %4)
%6 = load double, double* %2
%7 = call i32 @cos(double %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @cosl(x86_fp80 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_cos() {
%1 = tail call i32 @cosf(float undef)
%2 = tail call i32 @cos(double undef)
%3 = tail call i32 @cosl(x86_fp80 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  typedef struct {
    int x, y;
  } Point;
  Point p1;
  p1.x = 0;
  p1.y = 123;
  Point p2 = {77, -8};
  printf("p2 at (%d,%d)\n", p2.x, p2.y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x7b,-0x4(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x4d,%esi
mov    $0xfffffff8,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.Point = type { i32, i32 }
@__const.main.p2 = %struct.Point { i32 77, i32 -8 }
@.str = [15 x i8] c"p2 at (%d,%d)\0A\00"
define i32 @main() {
%1 = alloca %struct.Point
%2 = alloca %struct.Point
%3 = getelementptr inbounds %struct.Point, %struct.Point* %1, i32 0, i32 0
store i32 0, i32* %3
%4 = getelementptr inbounds %struct.Point, %struct.Point* %1, i32 0, i32 1
store i32 123, i32* %4
%5 = bitcast %struct.Point* %2 to i8*
%6 = getelementptr inbounds %struct.Point, %struct.Point* %2, i32 0, i32 0
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.Point, %struct.Point* %2, i32 0, i32 1
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"p2 at (%d,%d)\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 77, i32 -8)
ret i32 0
}
void fool_optimizer__() {}


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

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

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

LLVM IR (-O2):
define void @fool_optimizer__() {
ret void
}
int __ch2o_len_core_string(int n, char *p, int w) {
  while (*p) {
    n++;
    p++;
  }
  return n < w ? w : n;
}


x86 assembly (clang, -O0):
<__ch2o_len_core_string>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1135 <__ch2o_len_core_string+0x35>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <__ch2o_len_core_string+0xe>
mov    -0x4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    114c <__ch2o_len_core_string+0x4c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1152 <__ch2o_len_core_string+0x52>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ch2o_len_core_string>:
mov    %edi,%eax
cmpb   $0x0,(%rsi)
je     111c <__ch2o_len_core_string+0x1c>
add    $0x1,%rsi
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rsi)
lea    0x1(%rsi),%rsi
jne    1110 <__ch2o_len_core_string+0x10>
cmp    %edx,%eax
cmovl  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @__ch2o_len_core_string(i32 %0, i8* nocapture %1, i32 %2) {
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ %0, %3 ]
%8 = phi i8* [ %10, %6 ], [ %1, %3 ]
%9 = add nsw i32 %7, 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3
%14 = phi i32 [ %0, %3 ], [ %9, %6 ]
%15 = icmp slt i32 %14, %2
%16 = select i1 %15, i32 %2, i32 %14
ret i32 %16
}
/* Variables and functions */
int HonggfuzzMain(int, char **);
__attribute__((weak)) int main(int argc, char **argv) {
  return HonggfuzzMain(argc, argv);
}


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <HonggfuzzMain@plt>

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

LLVM IR (-O2):
define weak i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @HonggfuzzMain(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ getSeconds(unsigned long *);
int /*<<< orphan*/ printf(char *, unsigned long);
int main() {
  unsigned long sec;
  getSeconds(&sec);
  printf("Number of seconds: %ld\n", sec);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Number of seconds: %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i32 @getSeconds(i64* %2)
%4 = load i64, i64* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Number of seconds: %ld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @getSeconds(i64* %1)
%4 = load i64, i64* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
char *basename(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("%s\n", basename(argv[0]));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <basename@plt>
mov    %rax,%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rdi
call   1040 <basename@plt>
lea    0xed0(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i8* @basename(i8* %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
float exp(float);
float canny_gaussian(float x, float sigma) {
  return exp(-(x * x) / (2.0f * sigma * sigma));
}


x86 assembly (clang, -O0):
<canny_gaussian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xebf(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
call   1030 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<canny_gaussian>:
movaps 0xee9(%rip),%xmm2
xorps  %xmm0,%xmm2
mulss  %xmm2,%xmm0
movaps %xmm1,%xmm2
addss  %xmm1,%xmm2
mulss  %xmm1,%xmm2
divss  %xmm2,%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define float @canny_gaussian(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %3
%7 = fmul float %5, %6
%8 = fneg float %7
%9 = load float, float* %4
%10 = fmul float 2.000000e+00, %9
%11 = load float, float* %4
%12 = fmul float %10, %11
%13 = fdiv float %8, %12
%14 = call float @exp(float %13)
ret float %14
}

LLVM IR (-O2):
define float @canny_gaussian(float %0, float %1) {
%3 = fneg float %0
%4 = fmul float %3, %0
%5 = fmul float %1, 2.000000e+00
%6 = fmul float %5, %1
%7 = fdiv float %4, %6
%8 = tail call float @exp(float %7)
ret float %8
}
/* Type definitions */
struct cpufreq_available_governors {
  int dummy;
};

/* Variables and functions */
struct cpufreq_available_governors *
proc_get_available_governors(unsigned int cpu) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.cpufreq_available_governors = type { i32 }
define %struct.cpufreq_available_governors* @proc_get_available_governors(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret %struct.cpufreq_available_governors* null
}

LLVM IR (-O2):
%struct.cpufreq_available_governors = type { i32 }
define noalias %struct.cpufreq_available_governors* @proc_get_available_governors(i32 %0) {
ret %struct.cpufreq_available_governors* null
}
char sgSettingFromHall(const char *hallsymbol) {
  return (hallsymbol[0] == '-') ? hallsymbol[1] : hallsymbol[0];
}


x86 assembly (clang, -O0):
<sgSettingFromHall>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1128 <sgSettingFromHall+0x28>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    1132 <sgSettingFromHall+0x32>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgSettingFromHall>:
mov    (%rdi),%al
cmp    $0x2d,%al
jne    1109 <sgSettingFromHall+0x9>
mov    0x1(%rdi),%al
ret

LLVM IR (-O0):
define signext i8 @sgSettingFromHall(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 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 45
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
br label %18
13: ; preds = %1
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
br label %18
18: ; preds = %13, %8
%19 = phi i32 [ %12, %8 ], [ %17, %13 ]
%20 = trunc i32 %19 to i8
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @sgSettingFromHall(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 45
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
br label %7
7: ; preds = %1, %4
%8 = phi i8 [ %6, %4 ], [ %2, %1 ]
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ getsockname;
char *lbs_posix_socket_name(int, int /*<<< orphan*/);
char *lbs_posix_socket_sockname(int sockfd) {
  return lbs_posix_socket_name(sockfd, getsockname);
}


x86 assembly (clang, -O0):
<lbs_posix_socket_sockname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <lbs_posix_socket_name@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lbs_posix_socket_sockname>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <lbs_posix_socket_name@plt>

LLVM IR (-O0):
@getsockname = global i32 0
define i8* @lbs_posix_socket_sockname(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @getsockname
%5 = call i8* @lbs_posix_socket_name(i32 %3, i32 %4)
ret i8* %5
}

LLVM IR (-O2):
@getsockname = global i32 0
define i8* @lbs_posix_socket_sockname(i32 %0) {
%2 = load i32, i32* @getsockname
%3 = tail call i8* @lbs_posix_socket_name(i32 %0, i32 %2)
ret i8* %3
}