xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_top(int val) { printf("Your Value at TOP is : %d \n", val); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"Your Value at TOP is : %d \0A\00"
define void @print_top(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Your Value at TOP is : %d \0A\00"
define void @print_top(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
struct servers_to_sync *extract_srvr(struct servers_to_sync *srvr) {
  return srvr;
}


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

x86 assembly (clang, -O2):
<extract_srvr>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.servers_to_sync = type opaque
define %struct.servers_to_sync* @extract_srvr(%struct.servers_to_sync* %0) {
%2 = alloca %struct.servers_to_sync*
store %struct.servers_to_sync* %0, %struct.servers_to_sync** %2
%3 = load %struct.servers_to_sync*, %struct.servers_to_sync** %2
ret %struct.servers_to_sync* %3
}

LLVM IR (-O2):
%struct.servers_to_sync = type opaque
define %struct.servers_to_sync* @extract_srvr(%struct.servers_to_sync* readnone returned %0) {
ret %struct.servers_to_sync* %0
}
int do_542() { return 542; }


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

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

LLVM IR (-O0):
define i32 @do_542() {
ret i32 542
}

LLVM IR (-O2):
define i32 @do_542() {
ret i32 542
}
/* Variables and functions */
int /*<<< orphan*/ test();
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3();
int /*<<< orphan*/ test4();
main() {
  test();
  test2();
  test3();
  test4();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <test@plt>
mov    $0x0,%al
call   1050 <test2@plt>
mov    $0x0,%al
call   1030 <test3@plt>
mov    $0x0,%al
call   1040 <test4@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <test@plt>
xor    %eax,%eax
call   1050 <test2@plt>
xor    %eax,%eax
call   1030 <test3@plt>
xor    %eax,%eax
call   1040 <test4@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test()
%2 = call i32 (...) @test2()
%3 = call i32 (...) @test3()
%4 = call i32 (...) @test4()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test()
%2 = tail call i32 (...) @test2()
%3 = tail call i32 (...) @test3()
%4 = tail call i32 (...) @test4()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ b_west_lever(int, int);
void b_west_lever_test(void **state) {
  assert_int_equal(0x0000000400000000ul,
                   b_west_lever(0x0000000002000000ul, 0x0000000C00000000ul));
}


x86 assembly (clang, -O0):
<b_west_lever_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2000000,%edi
xor    %esi,%esi
call   1030 <b_west_lever@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1040 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_west_lever_test>:
push   %rax
mov    $0x2000000,%edi
xor    %esi,%esi
call   1030 <b_west_lever@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <assert_int_equal@plt>

LLVM IR (-O0):
define void @b_west_lever_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @b_west_lever(i32 33554432, i32 0)
%4 = call i32 @assert_int_equal(i32 0, i32 %3)
ret void
}

LLVM IR (-O2):
define void @b_west_lever_test(i8** nocapture readnone %0) {
%2 = tail call i32 @b_west_lever(i32 33554432, i32 0)
%3 = tail call i32 @assert_int_equal(i32 0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int);
int /*<<< orphan*/ g();
void main(int i) {
  g();
  if (1)
    f(1, 2);
  else
    f(2, 2);
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @scm_mpu_unlock_kernel_text() {
ret void
}
void INT_IICA0(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_IICA0() {
ret void
}
/* Variables and functions */
float truncf(float);
float r_int(float *x) { return truncf(*x); }


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

x86 assembly (clang, -O2):
<r_int>:
movss  (%rdi),%xmm0
jmp    1030 <truncf@plt>

LLVM IR (-O0):
define float @r_int(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = call float @llvm.trunc.f32(float %4)
ret float %5
}

LLVM IR (-O2):
define float @r_int(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call float @llvm.trunc.f32(float %2)
ret float %3
}
unsigned int cast_long_uint(long int x) { return (unsigned int)x; }


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

x86 assembly (clang, -O2):
<cast_long_uint>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i32 @cast_long_uint(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @cast_long_uint(i64 %0) {
%2 = trunc i64 %0 to i32
ret i32 %2
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double rand_in_range(double min, double max) {
  return min + (((double)rand() / (double)RAND_MAX) * (max - min));
}


x86 assembly (clang, -O0):
<rand_in_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  -0x18(%rbp),%xmm1
cvtsi2sd %rax,%xmm0
mov    0x2ea4(%rip),%rax
cvtsi2sdq (%rax),%xmm2
divsd  %xmm2,%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_in_range>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm2
mov    0x2eb5(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm2
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @rand_in_range(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 = call i64 (...) @rand()
%7 = sitofp i64 %6 to double
%8 = load i64, i64* @RAND_MAX
%9 = sitofp i64 %8 to double
%10 = fdiv double %7, %9
%11 = load double, double* %4
%12 = load double, double* %3
%13 = fsub double %11, %12
%14 = call double @llvm.fmuladd.f64(double %10, double %13, double %5)
ret double %14
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @rand_in_range(double %0, double %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = load i64, i64* @RAND_MAX
%6 = sitofp i64 %5 to double
%7 = fdiv double %4, %6
%8 = fsub double %1, %0
%9 = tail call double @llvm.fmuladd.f64(double %7, double %8, double %0)
ret double %9
}
/* Type definitions */
typedef int off_t;

/* Variables and functions */
int lseek(int, int, int);
int /*<<< orphan*/ quit(char *);
off_t _lseek(int fd, off_t offset, int whence) {
  off_t o;
  if ((o = lseek(fd, offset, whence)) == -1)
    quit("lseek() failed");
  return o;
}


x86 assembly (clang, -O0):
<_lseek>:
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
mov    -0xc(%rbp),%edx
call   1040 <lseek@plt>
mov    %eax,-0x10(%rbp)
cmp    $0xffffffff,%eax
jne    1157 <_lseek+0x37>
lea    0xeae(%rip),%rdi
call   1030 <quit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_lseek>:
push   %rbx
call   1040 <lseek@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1139 <_lseek+0x19>
lea    0xecc(%rip),%rdi
call   1030 <quit@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"lseek() failed\00"
define i32 @_lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @lseek(i32 %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @quit(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %3
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
@.str = [15 x i8] c"lseek() failed\00"
define i32 @_lseek(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @lseek(i32 %0, i32 %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @quit(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
/* Variables and functions */
int get_immediate_sub(char **, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int get_immediate(char *s) {
  char *p = (char *)malloc(4096);
  strcpy(p, s);
  return get_immediate_sub(&p, 10);
}


x86 assembly (clang, -O0):
<get_immediate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1000,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1040 <get_immediate_sub@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_immediate>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    $0x1000,%edi
call   1050 <malloc@plt>
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
lea    0x8(%rsp),%rdi
mov    $0xa,%esi
call   1040 <get_immediate_sub@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_immediate(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i64 @malloc(i32 4096)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %2
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = call i32 @get_immediate_sub(i8** %3, i32 10)
ret i32 %9
}

LLVM IR (-O2):
define i32 @get_immediate(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = tail call i64 @malloc(i32 4096)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
%7 = call i32 @get_immediate_sub(i8** %2, i32 10)
ret i32 %7
}
/* Variables and functions */
int code_convert(char *, char *, char *, int, char *, int);
int u2g(char *inbuf, int inlen, char *outbuf, int outlen) {
  return code_convert("utf-8", "gb2312", inbuf, inlen, outbuf, outlen);
}


x86 assembly (clang, -O0):
<u2g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
lea    0xec4(%rip),%rdi
lea    0xec3(%rip),%rsi
call   1030 <code_convert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u2g>:
mov    %ecx,%r9d
mov    %rdx,%r8
mov    %esi,%ecx
mov    %rdi,%rdx
lea    0xede(%rip),%rdi
lea    0xedd(%rip),%rsi
jmp    1030 <code_convert@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"utf-8\00"
@.str.1 = [7 x i8] c"gb2312\00"
define i32 @u2g(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @code_convert(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %9, i32 %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [6 x i8] c"utf-8\00"
@.str.1 = [7 x i8] c"gb2312\00"
define i32 @u2g(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @code_convert(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
unsigned char GetRed90(unsigned long);
unsigned char getred(unsigned long c) { return GetRed90(c); }


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

x86 assembly (clang, -O2):
<getred>:
jmp    1030 <GetRed90@plt>

LLVM IR (-O0):
define zeroext i8 @getred(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call zeroext i8 @GetRed90(i64 %3)
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @getred(i64 %0) {
%2 = tail call zeroext i8 @GetRed90(i64 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void Handle(int sig) {
  static int Count = 0;
  printf("In handler\n");
  if (++Count == 2)
    exit(0);
}


x86 assembly (clang, -O0):
<Handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ef7(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2eee(%rip)
cmp    $0x2,%eax
jne    1156 <Handle+0x36>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Handle>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2f01(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ef8(%rip)
cmp    $0x2,%eax
je     1143 <Handle+0x23>
pop    %rax
ret
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@Handle.Count = internal global i32 0
@.str = [12 x i8] c"In handler\0A\00"
define void @Handle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @Handle.Count
%5 = add nsw i32 %4, 1
store i32 %5, i32* @Handle.Count
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@Handle.Count = internal unnamed_addr global i32 0
@str = [11 x i8] c"In handler\00"
define void @Handle(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @Handle.Count
%4 = add nsw i32 %3, 1
store i32 %4, i32* @Handle.Count
%5 = icmp eq i32 %4, 2
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %1
ret void
}
void fgen_mutate_bit(unsigned char *bitstring, int bitnumber) {
  bitstring[bitnumber / 8] ^= 1 << (bitnumber & 7);
}


x86 assembly (clang, -O0):
<fgen_mutate_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
xor    %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgen_mutate_bit>:
mov    %esi,%ecx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
lea    0x7(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
xor    %al,(%rdi,%rcx,1)
ret

LLVM IR (-O0):
define void @fgen_mutate_bit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 7
%7 = shl i32 1, %6
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = sdiv i32 %9, 8
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = xor i32 %14, %7
%16 = trunc i32 %15 to i8
store i8 %16, i8* %12
ret void
}

LLVM IR (-O2):
define void @fgen_mutate_bit(i8* nocapture %0, i32 %1) {
%3 = and i32 %1, 7
%4 = shl nuw nsw i32 1, %3
%5 = sdiv i32 %1, 8
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = trunc i32 %4 to i8
%10 = xor i8 %8, %9
store i8 %10, i8* %7
ret void
}
void RandomFunc(unsigned char input[1], unsigned char output[1]) {
  unsigned char state[1];
  unsigned char local1;
  {
    state[0UL] = (input[0UL] + 51238316UL) + (unsigned char)234;
    local1 = 0UL;
    while (local1 < 1UL) {
      state[0UL] = state[local1] + state[0UL];
      local1 += 2UL;
    }
    output[0UL] = state[0UL] - 515147141UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    $0x30dd5ac,%rax
add    $0xea,%rax
mov    %al,-0x11(%rbp)
movb   $0x0,-0x12(%rbp)
movzbl -0x12(%rbp),%eax
cmp    $0x1,%rax
jae    1156 <RandomFunc+0x56>
movzbl -0x12(%rbp),%eax
movzbl -0x11(%rbp,%rax,1),%eax
movzbl -0x11(%rbp),%ecx
add    %ecx,%eax
mov    %al,-0x11(%rbp)
movzbl -0x12(%rbp),%eax
add    $0x2,%rax
mov    %al,-0x12(%rbp)
jmp    1126 <RandomFunc+0x26>
movzbl -0x11(%rbp),%eax
sub    $0x1eb48585,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%al
add    %al,%al
add    $0xa7,%al
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1 x i8]
%6 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i64
%11 = add i64 %10, 51238316
%12 = add i64 %11, 234
%13 = trunc i64 %12 to i8
%14 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %13, i8* %14
store i8 0, i8* %6
br label %15
15: ; preds = %19, %2
%16 = load i8, i8* %6
%17 = zext i8 %16 to i64
%18 = icmp ult i64 %17, 1
br i1 %18, label %19, label %35
19: ; preds = %15
%20 = load i8, i8* %6
%21 = zext i8 %20 to i64
%22 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = add nsw i32 %24, %27
%29 = trunc i32 %28 to i8
%30 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %29, i8* %30
%31 = load i8, i8* %6
%32 = zext i8 %31 to i64
%33 = add i64 %32, 2
%34 = trunc i64 %33 to i8
store i8 %34, i8* %6
br label %15
35: ; preds = %15
%36 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%37 = load i8, i8* %36
%38 = zext i8 %37 to i64
%39 = sub i64 %38, 515147141
%40 = trunc i64 %39 to i8
%41 = load i8*, i8** %4
%42 = getelementptr inbounds i8, i8* %41, i64 0
store i8 %40, i8* %42
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = shl i8 %3, 1
%5 = add i8 %4, -89
store i8 %5, i8* %1
ret void
}
/* Variables and functions */
int strtol(char const *, void *, int);
int atoi2(const char *s) { return strtol(s, (void *)0, 10); }


x86 assembly (clang, -O0):
<atoi2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi2>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i32 @atoi2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strtol(i8* %3, i8* null, i32 10)
ret i32 %4
}

LLVM IR (-O2):
define i32 @atoi2(i8* nocapture %0) {
%2 = tail call i32 @strtol(i8* nocapture %0, i8* null, i32 10)
ret i32 %2
}
void PDNOP(void *val) {}


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

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

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

LLVM IR (-O2):
define void @PDNOP(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int config_set_user_mbox_lock(char const *, int);
int config_lock_mbox(const char *name) {
  return config_set_user_mbox_lock(name, 1);
}


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

x86 assembly (clang, -O2):
<config_lock_mbox>:
mov    $0x1,%esi
jmp    1030 <config_set_user_mbox_lock@plt>

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

LLVM IR (-O2):
define i32 @config_lock_mbox(i8* %0) {
%2 = tail call i32 @config_set_user_mbox_lock(i8* %0, i32 1)
ret i32 %2
}
int test_imm_AFint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xAF << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_AFint64_highword_mem>:
testb  $0xaf,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_AFint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 751619276800
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void hip2_2(void (*g)()) { g(); }


x86 assembly (clang, -O0):
<hip2_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hip2_2>:
xor    %eax,%eax
jmp    *%rdi

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

LLVM IR (-O2):
define void @hip2_2(void (...)* nocapture %0) {
tail call void (...) %0()
ret void
}
float f(float x) { return x * x * x - 9 * x - 5; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  0xee4(%rip),%xmm1
mulss  -0x4(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xebe(%rip),%xmm1
subss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  0xeed(%rip),%xmm0
addss  %xmm1,%xmm0
addss  0xee5(%rip),%xmm0
ret

LLVM IR (-O0):
define float @f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = load float, float* %2
%7 = load float, float* %2
%8 = fmul float 9.000000e+00, %7
%9 = fneg float %8
%10 = call float @llvm.fmuladd.f32(float %5, float %6, float %9)
%11 = fsub float %10, 5.000000e+00
ret float %11
}

LLVM IR (-O2):
define float @f(float %0) {
%2 = fmul float %0, %0
%3 = fmul float %0, -9.000000e+00
%4 = tail call float @llvm.fmuladd.f32(float %2, float %0, float %3)
%5 = fadd float %4, -5.000000e+00
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_string(char *arr) { printf("%s\n", arr); }


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

x86 assembly (clang, -O2):
<print_string>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_string(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void g_hook_free() {}


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

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

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

LLVM IR (-O2):
define void @g_hook_free() {
ret void
}
/* Type definitions */
struct nbt_tag {
  int dummy;
};

/* Variables and functions */
int __recurReadNBT(struct nbt_tag **, unsigned char *, size_t,
                   int /*<<< orphan*/);
int readNBT(struct nbt_tag **root, unsigned char *buffer, size_t buflen) {
  if (buflen == 0)
    return 0;
  return __recurReadNBT(root, buffer, buflen, 0);
}


x86 assembly (clang, -O0):
<readNBT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    113b <readNBT+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1151 <readNBT+0x41>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <__recurReadNBT@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readNBT>:
test   %rdx,%rdx
je     111c <readNBT+0xc>
xor    %ecx,%ecx
jmp    1030 <__recurReadNBT@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.nbt_tag = type { i32 }
define i32 @readNBT(%struct.nbt_tag** %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca %struct.nbt_tag**
%6 = alloca i8*
%7 = alloca i64
store %struct.nbt_tag** %0, %struct.nbt_tag*** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%8 = load i64, i64* %7
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
store i32 0, i32* %4
br label %16
11: ; preds = %3
%12 = load %struct.nbt_tag**, %struct.nbt_tag*** %5
%13 = load i8*, i8** %6
%14 = load i64, i64* %7
%15 = call i32 @__recurReadNBT(%struct.nbt_tag** %12, i8* %13, i64 %14, i32 0)
store i32 %15, i32* %4
br label %16
16: ; preds = %11, %10
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
%struct.nbt_tag = type { i32 }
define i32 @readNBT(%struct.nbt_tag** %0, i8* %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @__recurReadNBT(%struct.nbt_tag** %0, i8* %1, i64 %2, i32 0)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ 0, %3 ]
ret i32 %8
}
/* Type definitions */
struct stkpool {
  int dummy;
};

/* Variables and functions */
long stkp_free(struct stkpool *, void *);
long __stkp_free_agent(void *alloc, void *p) {
  return stkp_free((struct stkpool *)alloc, p);
}


x86 assembly (clang, -O0):
<__stkp_free_agent>:
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 <stkp_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__stkp_free_agent>:
jmp    1030 <stkp_free@plt>

LLVM IR (-O0):
%struct.stkpool = type { i32 }
define i64 @__stkp_free_agent(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to %struct.stkpool*
%7 = load i8*, i8** %4
%8 = call i64 @stkp_free(%struct.stkpool* %6, i8* %7)
ret i64 %8
}

LLVM IR (-O2):
%struct.stkpool = type { i32 }
define i64 @__stkp_free_agent(i8* %0, i8* %1) {
%3 = bitcast i8* %0 to %struct.stkpool*
%4 = tail call i64 @stkp_free(%struct.stkpool* %3, i8* %1)
ret i64 %4
}
/* Type definitions */
struct tgl_state {
  int dummy;
};

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


x86 assembly (clang, -O0):
<regen_temp_key_gw>:
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 <tglmp_regenerate_temp_auth_key@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<regen_temp_key_gw>:
jmp    1030 <tglmp_regenerate_temp_auth_key@plt>

LLVM IR (-O0):
%struct.tgl_state = type { i32 }
define void @regen_temp_key_gw(%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 @tglmp_regenerate_temp_auth_key(%struct.tgl_state* %5, i8* %6)
ret void
}

LLVM IR (-O2):
%struct.tgl_state = type { i32 }
define void @regen_temp_key_gw(%struct.tgl_state* %0, i8* %1) {
%3 = tail call i32 @tglmp_regenerate_temp_auth_key(%struct.tgl_state* %0, i8* %1)
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int timespec_to_ms(const struct timespec *t) {
  return t->tv_sec * 1000 + (t->tv_nsec + 500000) / 1000000;
}


x86 assembly (clang, -O0):
<timespec_to_ms>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3e8,(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
add    $0x7a120,%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_to_ms>:
imul   $0x3e8,(%rdi),%ecx
mov    $0x7a120,%eax
add    0x4(%rdi),%eax
cltq
imul   $0x431bde83,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i32 @timespec_to_ms(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = load %struct.timespec*, %struct.timespec** %2
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 500000
%11 = sdiv i32 %10, 1000000
%12 = add nsw i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i32 @timespec_to_ms(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 500000
%8 = sdiv i32 %7, 1000000
%9 = add nsw i32 %8, %4
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo() { printf("this function should not be called\n"); }


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"this function should not be called\0A\00"
define void @foo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"this function should not be called\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double floor(double);
double modf(double x, double *intpart) {
  double y = floor(x);
  *intpart = y;
  return x - y;
}


x86 assembly (clang, -O0):
<modf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modf>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  %xmm0,0x8(%rsp)
call   1030 <floor@plt>
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @modf(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
%5 = alloca double
store double %0, double* %3
store double* %1, double** %4
%6 = load double, double* %3
%7 = call double @llvm.floor.f64(double %6)
store double %7, double* %5
%8 = load double, double* %5
%9 = load double*, double** %4
store double %8, double* %9
%10 = load double, double* %3
%11 = load double, double* %5
%12 = fsub double %10, %11
ret double %12
}

LLVM IR (-O2):
define double @modf(double %0, double* nocapture writeonly %1) {
%3 = tail call double @llvm.floor.f64(double %0)
store double %3, double* %1
%4 = fsub double %0, %3
ret double %4
}
void GPIOPinIntClear(unsigned int baseAdd, unsigned int intLine,
                     unsigned int pinNumber) {
  if ((0x0) == intLine) {
    (*((volatile unsigned int *)(baseAdd + (0x2C + (0 * 4))))) =
        (1 << pinNumber);
  } else {
    (*((volatile unsigned int *)(baseAdd + (0x2C + (1 * 4))))) =
        (1 << pinNumber);
  }
}


x86 assembly (clang, -O0):
<GPIOPinIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jne    1133 <GPIOPinIntClear+0x33>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
jmp    1149 <GPIOPinIntClear+0x49>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinIntClear>:
mov    %edx,%ecx
xor    %eax,%eax
test   %esi,%esi
setne  %al
mov    $0x1,%edx
shl    %cl,%edx
lea    (%rdi,%rax,4),%eax
add    $0x2c,%eax
mov    %edx,(%rax)
ret

LLVM IR (-O0):
define void @GPIOPinIntClear(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* %5
%8 = icmp eq i32 0, %7
br i1 %8, label %9, label %16
9: ; preds = %3
%10 = load i32, i32* %6
%11 = shl i32 1, %10
%12 = load i32, i32* %4
%13 = add i32 %12, 44
%14 = zext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
store volatile i32 %11, i32* %15
br label %23
16: ; preds = %3
%17 = load i32, i32* %6
%18 = shl i32 1, %17
%19 = load i32, i32* %4
%20 = add i32 %19, 48
%21 = zext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
store volatile i32 %18, i32* %22
br label %23
23: ; preds = %16, %9
ret void
}

LLVM IR (-O2):
define void @GPIOPinIntClear(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
%5 = shl nuw i32 1, %2
%6 = select i1 %4, i32 44, i32 48
%7 = add i32 %6, %0
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %5, i32* %9
ret void
}
int aaa(int a) { return 4; }


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

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

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

LLVM IR (-O2):
define i32 @aaa(i32 %0) {
ret i32 4
}
/* Variables and functions */
int close(int);
int closesocket(int sock) { return close(sock); }


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

x86 assembly (clang, -O2):
<closesocket>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @closesocket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int __isign(int, int);
int intr_wrap_465(int p1, int p2) { return __isign(p1, p2); }


x86 assembly (clang, -O0):
<intr_wrap_465>:
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 <__isign@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_465>:
jmp    1030 <__isign@plt>

LLVM IR (-O0):
define i32 @intr_wrap_465(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 @__isign(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @intr_wrap_465(i32 %0, i32 %1) {
%3 = tail call i32 @__isign(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *, int);
void main() {
  int buf[100];
  foo(buf, 100);
  int x = buf[100];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
lea    -0x190(%rbp),%rdi
mov    $0x64,%esi
call   1030 <foo@plt>
mov    0x0(%rbp),%eax
mov    %eax,-0x194(%rbp)
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x198,%rsp
mov    %rsp,%rdi
mov    $0x64,%esi
call   1030 <foo@plt>
add    $0x198,%rsp
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca [100 x i32]
%2 = alloca i32
%3 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%4 = call i32 @foo(i32* %3, i32 100)
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 100
%6 = load i32, i32* %5
store i32 %6, i32* %2
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
%3 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%4 = call i32 @foo(i32* %3, i32 100)
ret void
}
double dbl_flt_max1(float a, float b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<dbl_flt_max1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <dbl_flt_max1+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <dbl_flt_max1+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbl_flt_max1>:
maxss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @dbl_flt_max1(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* %4
%7 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
%14 = fpext float %13 to double
ret double %14
}

LLVM IR (-O2):
define double @dbl_flt_max1(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
%5 = fpext float %4 to double
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int uniquePaths(int, int);
int main(void) {
  printf("%d\n", uniquePaths(3, 3));
  return (0);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @uniquePaths(i32 3, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void copyright(void) {
  fprintf(stderr, "Copyright (C) 1994-2000 Kevin E. Martin & aeb\n");
}


x86 assembly (clang, -O0):
<copyright>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyright>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"Copyright (C) 1994-2000 Kevin E. Martin & aeb\0A\00"
define void @copyright() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"Copyright (C) 1994-2000 Kevin E. Martin & aeb\0A\00"
define void @copyright() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ isupper(int);
int hotkey(char *s) {
  int c, c0 = *s;
  for (c = *s; c; s++)
    if (isupper(c))
      break;
  return c ? c : c0;
}


x86 assembly (clang, -O0):
<hotkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1167 <hotkey+0x57>
mov    -0xc(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     1151 <hotkey+0x41>
jmp    1167 <hotkey+0x57>
jmp    1156 <hotkey+0x46>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1130 <hotkey+0x20>
cmpl   $0x0,-0xc(%rbp)
je     117c <hotkey+0x6c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1182 <hotkey+0x72>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hotkey>:
push   %rbx
movsbl (%rdi),%ebx
test   %ebx,%ebx
je     112c <hotkey+0x1c>
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <isupper@plt>
test   %rax,%rax
je     1120 <hotkey+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hotkey(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
store i32 %7, i32* %4
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
store i32 %10, i32* %3
br label %11
11: ; preds = %20, %1
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %23
14: ; preds = %11
%15 = load i32, i32* %3
%16 = call i64 @isupper(i32 %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %14
br label %23
19: ; preds = %14
br label %20
20: ; preds = %19
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %2
br label %11
23: ; preds = %18, %11
%24 = load i32, i32* %3
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = load i32, i32* %3
br label %30
28: ; preds = %23
%29 = load i32, i32* %4
br label %30
30: ; preds = %28, %26
%31 = phi i32 [ %27, %26 ], [ %29, %28 ]
ret i32 %31
}

LLVM IR (-O2):
define i32 @hotkey(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = icmp eq i8 %2, 0
br i1 %4, label %8, label %5
5: ; preds = %1, %5
%6 = tail call i64 @isupper(i32 %3)
%7 = icmp eq i64 %6, 0
br i1 %7, label %5, label %8
8: ; preds = %5, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *thread_function(void *arg) { pthread_exit(NULL); }


x86 assembly (clang, -O0):
<thread_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_function>:
xor    %edi,%edi
jmp    1030 <pthread_exit@plt>

LLVM IR (-O0):
define i8* @thread_function(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @pthread_exit(i32* null)
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @thread_function(i8* nocapture readnone %0) {
%2 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
putchar(c) {
  if (c == '\n')
    putc('\r');
  putc(c);
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jne    1131 <putchar+0x21>
mov    $0xd,%edi
mov    $0x0,%al
call   1030 <putc@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <putc@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%edi
jne    1124 <putchar+0x14>
mov    $0xd,%edi
xor    %eax,%eax
call   1030 <putc@plt>
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <putc@plt>

LLVM IR (-O0):
define i32 @putchar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 10
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (i32, ...) bitcast (i32 (...)* @putc to i32 (i32, ...)*)(i32 13)
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %3
%10 = call i32 (i32, ...) bitcast (i32 (...)* @putc to i32 (i32, ...)*)(i32 %9)
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @putchar(i32 %0) {
%2 = icmp eq i32 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @putc to i32 (i32, ...)*)(i32 13)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @putc to i32 (i32, ...)*)(i32 %0)
ret i32 undef
}
/* Variables and functions */
char const *xs_err_strerror(int);
const char *xs_strerror(int errnum) { return xs_err_strerror(errnum); }


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

x86 assembly (clang, -O2):
<xs_strerror>:
jmp    1030 <xs_err_strerror@plt>

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

LLVM IR (-O2):
define i8* @xs_strerror(i32 %0) {
%2 = tail call i8* @xs_err_strerror(i32 %0)
ret i8* %2
}