xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _fail(char const *const, int const);
int /*<<< orphan*/ memory_not_equal_display_error(char const *, char const *,
                                                  size_t const);
void _assert_memory_not_equal(const void *const a, const void *const b,
                              const size_t size, const char *const file,
                              const int line) {
  if (!memory_not_equal_display_error((const char *)a, (const char *)b, size)) {
    _fail(file, line);
  }
}


x86 assembly (clang, -O0):
<_assert_memory_not_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memory_not_equal_display_error@plt>
cmp    $0x0,%eax
jne    1162 <_assert_memory_not_equal+0x42>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <_fail@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assert_memory_not_equal>:
push   %rbp
push   %rbx
push   %rax
mov    %r8d,%ebp
mov    %rcx,%rbx
call   1040 <memory_not_equal_display_error@plt>
test   %eax,%eax
je     1139 <_assert_memory_not_equal+0x19>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_fail@plt>

LLVM IR (-O0):
define void @_assert_memory_not_equal(i8* %0, i8* %1, i64 %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = call i32 @memory_not_equal_display_error(i8* %11, i8* %12, i64 %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %20, label %16
16: ; preds = %5
%17 = load i8*, i8** %9
%18 = load i32, i32* %10
%19 = call i32 @_fail(i8* %17, i32 %18)
br label %20
20: ; preds = %16, %5
ret void
}

LLVM IR (-O2):
define void @_assert_memory_not_equal(i8* %0, i8* %1, i64 %2, i8* %3, i32 %4) {
%6 = tail call i32 @memory_not_equal_display_error(i8* %0, i8* %1, i64 %2)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @_fail(i8* %3, i32 %4)
br label %10
10: ; preds = %8, %5
ret void
}
void ASAP_PutLittleEndian(unsigned char *buffer, int offset, int value) {
  buffer[offset] = (unsigned char)value;
  buffer[offset + 1] = (unsigned char)(value >> 8);
  buffer[offset + 2] = (unsigned char)(value >> 16);
  buffer[offset + 3] = (unsigned char)(value >> 24);
}


x86 assembly (clang, -O0):
<ASAP_PutLittleEndian>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
sar    $0x8,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
sar    $0x10,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
sar    $0x18,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASAP_PutLittleEndian>:
movslq %esi,%rax
mov    %edx,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @ASAP_PutLittleEndian(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 %8, i8* %12
%13 = load i32, i32* %6
%14 = ashr i32 %13, 8
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %4
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %16, i64 %19
store i8 %15, i8* %20
%21 = load i32, i32* %6
%22 = ashr i32 %21, 16
%23 = trunc i32 %22 to i8
%24 = load i8*, i8** %4
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %24, i64 %27
store i8 %23, i8* %28
%29 = load i32, i32* %6
%30 = ashr i32 %29, 24
%31 = trunc i32 %30 to i8
%32 = load i8*, i8** %4
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 3
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %32, i64 %35
store i8 %31, i8* %36
ret void
}

LLVM IR (-O2):
define void @ASAP_PutLittleEndian(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = trunc i32 %2 to i8
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %4, i8* %6
%7 = lshr i32 %2, 8
%8 = trunc i32 %7 to i8
%9 = add nsw i32 %1, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 %8, i8* %11
%12 = lshr i32 %2, 16
%13 = trunc i32 %12 to i8
%14 = add nsw i32 %1, 2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %0, i64 %15
store i8 %13, i8* %16
%17 = lshr i32 %2, 24
%18 = trunc i32 %17 to i8
%19 = add nsw i32 %1, 3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %0, i64 %20
store i8 %18, i8* %21
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
int set_random(void *dst, size_t len) {
  int ret = 0;
  memset(dst, 0, len);
  return ret;
}


x86 assembly (clang, -O0):
<set_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_random>:
push   %rax
mov    %rsi,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @set_random(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ rmonitor_helper_initialize();
void __attribute__((constructor)) init() { rmonitor_helper_initialize(); }


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init, i8* null }]
define void @init() {
%1 = call i32 (...) @rmonitor_helper_initialize()
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init, i8* null }]
define void @init() {
%1 = tail call i32 (...) @rmonitor_helper_initialize()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eulerf_from_mat3f(float *, float *, char const *);
int /*<<< orphan*/ mat3f_from_mat4f(float *, float const *);
void eulerf_from_mat4f(float angles[3], const float m[16],
                       const char order[3]) {
  float tmpMat[9];
  mat3f_from_mat4f(tmpMat, m);
  eulerf_from_mat3f(angles, tmpMat, order);
}


x86 assembly (clang, -O0):
<eulerf_from_mat4f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <mat3f_from_mat4f@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <eulerf_from_mat3f@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eulerf_from_mat4f>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <mat3f_from_mat4f@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <eulerf_from_mat3f@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @eulerf_from_mat4f(float* %0, float* %1, i8* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca i8*
%7 = alloca [9 x float]
store float* %0, float** %4
store float* %1, float** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [9 x float], [9 x float]* %7, i64 0, i64 0
%9 = load float*, float** %5
%10 = call i32 @mat3f_from_mat4f(float* %8, float* %9)
%11 = load float*, float** %4
%12 = getelementptr inbounds [9 x float], [9 x float]* %7, i64 0, i64 0
%13 = load i8*, i8** %6
%14 = call i32 @eulerf_from_mat3f(float* %11, float* %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @eulerf_from_mat4f(float* %0, float* %1, i8* %2) {
%4 = alloca [9 x float]
%5 = bitcast [9 x float]* %4 to i8*
%6 = getelementptr inbounds [9 x float], [9 x float]* %4, i64 0, i64 0
%7 = call i32 @mat3f_from_mat4f(float* %6, float* %1)
%8 = call i32 @eulerf_from_mat3f(float* %0, float* %6, i8* %2)
ret void
}
/* Variables and functions */
int wait(int *);
int w1() {
  int w;
  return wait(&w);
}


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

x86 assembly (clang, -O2):
<w1>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <wait@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @w1() {
%1 = alloca i32
%2 = call i32 @wait(i32* %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @w1() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @wait(i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ led_err(int);
int /*<<< orphan*/ led_ptt(int /*<<< orphan*/);
int /*<<< orphan*/ led_pwr(int /*<<< orphan*/);
int /*<<< orphan*/ led_rt(int /*<<< orphan*/);
int /*<<< orphan*/ sm1000_leds_switches_init();
int /*<<< orphan*/ switch_back();
int /*<<< orphan*/ switch_ptt();
int /*<<< orphan*/ switch_select();
int main(void) {
  sm1000_leds_switches_init();
  while (1) {
    led_pwr(switch_select());
    led_ptt(switch_ptt());
    led_rt(switch_back());
    led_err(!switch_back());
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <sm1000_leds_switches_init@plt>
mov    $0x0,%al
call   1080 <switch_select@plt>
mov    %eax,%edi
call   1040 <led_pwr@plt>
mov    $0x0,%al
call   1050 <switch_ptt@plt>
mov    %eax,%edi
call   1090 <led_ptt@plt>
mov    $0x0,%al
call   1030 <switch_back@plt>
mov    %eax,%edi
call   10a0 <led_rt@plt>
mov    $0x0,%al
call   1030 <switch_back@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x6(%rbp)
and    $0x1,%al
mov    %al,-0x5(%rbp)
movzbl %al,%edi
call   1070 <led_err@plt>
jmp    1196 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <sm1000_leds_switches_init@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1080 <switch_select@plt>
mov    %eax,%edi
call   1040 <led_pwr@plt>
xor    %eax,%eax
call   1050 <switch_ptt@plt>
mov    %eax,%edi
call   1090 <led_ptt@plt>
xor    %eax,%eax
call   1030 <switch_back@plt>
mov    %eax,%edi
call   10a0 <led_rt@plt>
xor    %eax,%eax
call   1030 <switch_back@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1070 <led_err@plt>
jmp    1190 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @sm1000_leds_switches_init()
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @switch_select()
%5 = call i32 @led_pwr(i32 %4)
%6 = call i32 (...) @switch_ptt()
%7 = call i32 @led_ptt(i32 %6)
%8 = call i32 (...) @switch_back()
%9 = call i32 @led_rt(i32 %8)
%10 = call i32 (...) @switch_back()
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
%14 = call i32 @led_err(i32 %13)
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @sm1000_leds_switches_init()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @switch_select()
%4 = tail call i32 @led_pwr(i32 %3)
%5 = tail call i32 (...) @switch_ptt()
%6 = tail call i32 @led_ptt(i32 %5)
%7 = tail call i32 (...) @switch_back()
%8 = tail call i32 @led_rt(i32 %7)
%9 = tail call i32 (...) @switch_back()
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @led_err(i32 %11)
br label %2
}
unsigned long hash(const char *str) {
  unsigned long result = 5381;
  int c;
  while ((c = *str++))
    result = ((result << 5) + result) + c;
  return result;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hash+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
mov    $0x1505,%eax
ret

LLVM IR (-O0):
define i64 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32
store i8* %0, i8** %2
store i64 5381, i64* %3
br label %5
5: ; preds = %11, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
store i32 %9, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %5
%12 = load i64, i64* %3
%13 = shl i64 %12, 5
%14 = load i64, i64* %3
%15 = add i64 %13, %14
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = add i64 %15, %17
store i64 %18, i64* %3
br label %5
19: ; preds = %5
%20 = load i64, i64* %3
ret i64 %20
}

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a = 1;
  a++;
  printf("A = %d\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec7(%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    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"A = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
void fd169(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    a:
      goto a;
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd169>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd169+0x7>

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

LLVM IR (-O0):
define void @fd169(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; preds = %32
br label %32
33: ; No predecessors!
%34 = load i32, i32* %2
%35 = zext i32 %34 to i64
br label %36
36: ; preds = %36, %33
br label %36
37: ; preds = %37
br label %37
38: ; No predecessors!
%39 = load i32, i32* %2
%40 = zext i32 %39 to i64
br label %41
41: ; preds = %41, %38
br label %41
42: ; preds = %42
br label %42
43: ; No predecessors!
%44 = load i32, i32* %2
%45 = zext i32 %44 to i64
br label %46
46: ; preds = %46, %43
br label %46
47: ; preds = %47
br label %47
}

LLVM IR (-O2):
define void @fd169(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
void *malloc(size_t);
void *brain_alloc_(size_t in_size, int in_hint) { return malloc(in_size); }


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

x86 assembly (clang, -O2):
<brain_alloc_>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @brain_alloc_(i64 %0, i32 %1) {
%3 = tail call i8* @malloc(i64 %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ CC2420SpiP__SpiResource__granted();
void HplCC2420SpiP__Resource__granted(void) {
  CC2420SpiP__SpiResource__granted();
}


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

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

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

LLVM IR (-O2):
define void @HplCC2420SpiP__Resource__granted() {
%1 = tail call i32 (...) @CC2420SpiP__SpiResource__granted()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ccvt_420i(int, int, unsigned char *, unsigned char *, int);
void ccvt_420i_bgr32(int width, int height, void *src, void *dst) {
  ccvt_420i(width, height, (unsigned char *)src, (unsigned char *)dst, 4);
}


x86 assembly (clang, -O0):
<ccvt_420i_bgr32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <ccvt_420i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccvt_420i_bgr32>:
mov    $0x4,%r8d
jmp    1030 <ccvt_420i@plt>

LLVM IR (-O0):
define void @ccvt_420i_bgr32(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @ccvt_420i(i32 %9, i32 %10, i8* %11, i8* %12, i32 4)
ret void
}

LLVM IR (-O2):
define void @ccvt_420i_bgr32(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @ccvt_420i(i32 %0, i32 %1, i8* %2, i8* %3, i32 4)
ret void
}
double foster_1981(double annual_pmm) {
  double result;
  result = ((annual_pmm * 0.276 * 75.0) / 100.0);
  return result;
}


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

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

LLVM IR (-O0):
define double @foster_1981(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double %4, 2.760000e-01
%6 = fmul double %5, 7.500000e+01
%7 = fdiv double %6, 1.000000e+02
store double %7, double* %3
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
define double @foster_1981(double %0) {
%2 = fmul double %0, 2.760000e-01
%3 = fmul double %2, 7.500000e+01
%4 = fdiv double %3, 1.000000e+02
ret double %4
}
void XShapeInputSelected() {}


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

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

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

LLVM IR (-O2):
define void @XShapeInputSelected() {
ret void
}
int chdir(char *path) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @chdir(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_str(long, long, char *);
void wipe_star(long x, long y) { print_str(x, y, " "); }


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

x86 assembly (clang, -O2):
<wipe_star>:
lea    0xee9(%rip),%rdx
jmp    1030 <print_str@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @wipe_star(i64 %0, i64 %1) {
%3 = tail call i32 @print_str(i64 %0, i64 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
bool ext4_bmap_is_bit_set(uint8_t *bmap, uint32_t bit) {
  return (*(bmap + (bit >> 3)) & (1 << (bit & 7)));
}


x86 assembly (clang, -O0):
<ext4_bmap_is_bit_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext4_bmap_is_bit_set>:
mov    %esi,%ecx
mov    %esi,%edx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
sar    $0x3,%edx
movslq %edx,%rcx
and    (%rdi,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @ext4_bmap_is_bit_set(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 = ashr i32 %6, 3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %4
%12 = and i32 %11, 7
%13 = shl i32 1, %12
%14 = and i32 %10, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @ext4_bmap_is_bit_set(i32* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 3
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = and i32 %1, 7
%8 = shl nuw nsw i32 1, %7
%9 = and i32 %6, %8
ret i32 %9
}
/* Variables and functions */
unsigned char bitmask_get(unsigned char, unsigned char);
unsigned char lnp_addressing_host(unsigned char mask, unsigned char address) {
  return (bitmask_get(mask, address));
}


x86 assembly (clang, -O0):
<lnp_addressing_host>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
movzbl %al,%edi
movzbl -0x2(%rbp),%esi
call   1030 <bitmask_get@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lnp_addressing_host>:
jmp    1030 <bitmask_get@plt>

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

LLVM IR (-O2):
define zeroext i8 @lnp_addressing_host(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call zeroext i8 @bitmask_get(i8 zeroext %0, i8 zeroext %1)
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void print_db() { print("I reached\n"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"I reached\0A\00"
define void @print_db() {
%1 = call i32 @print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"I reached\0A\00"
define void @print_db() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ nums;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int *searchRange(int *, int, int, int *);
int main(int argc, char *argv[]) {
  int nums[] = {5, 7, 7, 8, 8, 10};
  int size;
  int *p = searchRange(nums, sizeof(nums) / 4, 8, &size);
  printf("%d, %d\n", p[0], p[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x6,%esi
mov    $0x8,%edx
lea    -0x34(%rbp),%rcx
call   1040 <searchRange@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    (%rax),%esi
mov    -0x40(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rcx
mov    $0x6,%esi
mov    $0x8,%edx
call   1040 <searchRange@plt>
mov    (%rax),%esi
mov    0x4(%rax),%edx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.nums = [6 x i32] [i32 5, i32 7, i32 7, i32 8, i32 8, i32 10]
@.str = [8 x i8] c"%d, %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [6 x i32]
%7 = alloca i32
%8 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [6 x i32]* %6 to i8*
%10 = getelementptr inbounds [6 x i32], [6 x i32]* %6, i64 0, i64 0
%11 = call i32* @searchRange(i32* %10, i32 6, i32 8, i32* %7)
store i32* %11, i32** %8
%12 = load i32*, i32** %8
%13 = getelementptr inbounds i32, i32* %12, i64 0
%14 = load i32, i32* %13
%15 = load i32*, i32** %8
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32, i32* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %17)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [6 x i32] [i32 5, i32 7, i32 7, i32 8, i32 8, i32 10]
@.str = [8 x i8] c"%d, %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [6 x i32]
%4 = alloca i32
%5 = bitcast [6 x i32]* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%8 = call i32* @searchRange(i32* %7, i32 6, i32 8, i32* %4)
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %8, i64 1
%11 = load i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %11)
ret i32 0
}
void hr(int *ed, signed char *ju) {
  int kc;
  {
    int xj;
    int *q2 = (*ed == 0) ? &xj : &kc;
    *ju = 0;
    kc = *ju;
  }
}


x86 assembly (clang, -O0):
<hr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1126 <hr+0x26>
lea    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1133 <hr+0x33>
lea    -0x14(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1133 <hr+0x33>
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<hr>:
movb   $0x0,(%rsi)
ret

LLVM IR (-O0):
define void @hr(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32* %0, i32** %3
store i8* %1, i8** %4
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
br label %13
12: ; preds = %2
br label %13
13: ; preds = %12, %11
%14 = phi i32* [ %6, %11 ], [ %5, %12 ]
store i32* %14, i32** %7
%15 = load i8*, i8** %4
store i8 0, i8* %15
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
store i32 %18, i32* %5
ret void
}

LLVM IR (-O2):
define void @hr(i32* nocapture readnone %0, i8* nocapture writeonly %1) {
store i8 0, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RegWriteA_lc898122_sharp(int, int);
void SetPanTiltMode_lc898122_sharp(unsigned char UcPnTmod) {
  switch (UcPnTmod) {
  case 0x00:
    RegWriteA_lc898122_sharp(0x0109, 0x00);
    break;
  case 0x01:
    RegWriteA_lc898122_sharp(0x0109, 0x01);
    break;
  }
}


x86 assembly (clang, -O0):
<SetPanTiltMode_lc898122_sharp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     1143 <SetPanTiltMode_lc898122_sharp+0x33>
jmp    1132 <SetPanTiltMode_lc898122_sharp+0x22>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     1154 <SetPanTiltMode_lc898122_sharp+0x44>
jmp    1163 <SetPanTiltMode_lc898122_sharp+0x53>
mov    $0x109,%edi
xor    %esi,%esi
call   1030 <RegWriteA_lc898122_sharp@plt>
jmp    1163 <SetPanTiltMode_lc898122_sharp+0x53>
mov    $0x109,%edi
mov    $0x1,%esi
call   1030 <RegWriteA_lc898122_sharp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetPanTiltMode_lc898122_sharp>:
test   %edi,%edi
je     1129 <SetPanTiltMode_lc898122_sharp+0x19>
cmp    $0x1,%dil
jne    1135 <SetPanTiltMode_lc898122_sharp+0x25>
mov    $0x1,%esi
mov    $0x109,%edi
jmp    1030 <RegWriteA_lc898122_sharp@plt>
xor    %esi,%esi
mov    $0x109,%edi
jmp    1030 <RegWriteA_lc898122_sharp@plt>
ret

LLVM IR (-O0):
define void @SetPanTiltMode_lc898122_sharp(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %7
]
5: ; preds = %1
%6 = call i32 @RegWriteA_lc898122_sharp(i32 265, i32 0)
br label %9
7: ; preds = %1
%8 = call i32 @RegWriteA_lc898122_sharp(i32 265, i32 1)
br label %9
9: ; preds = %1, %7, %5
ret void
}

LLVM IR (-O2):
define void @SetPanTiltMode_lc898122_sharp(i8 zeroext %0) {
switch i8 %0, label %6 [
i8 0, label %3
i8 1, label %2
]
2: ; preds = %1
br label %3
3: ; preds = %1, %2
%4 = phi i32 [ 1, %2 ], [ 0, %1 ]
%5 = tail call i32 @RegWriteA_lc898122_sharp(i32 265, i32 %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EPERM;
int /*<<< orphan*/ errno;
int settimeofday(struct timeval *_tp, ...) {
  errno = EPERM;
  return -1;
}


x86 assembly (clang, -O0):
<settimeofday>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<settimeofday>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
@EPERM = global i32 0
@errno = global i32 0
define i32 @settimeofday(%struct.timeval* %0, ...) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load i32, i32* @EPERM
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@EPERM = global i32 0
@errno = global i32 0
define i32 @settimeofday(%struct.timeval* nocapture readnone %0, ...) {
%2 = load i32, i32* @EPERM
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void init_test(void) {
  system("insmod "
         "af_stp"
         ".ko");
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"insmod af_stp.ko\00"
define void @init_test() {
%1 = call i32 @system(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"insmod af_stp.ko\00"
define void @init_test() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
OP(ed, f2) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stdout;
int exec_cmd(int ac, char *av[]) {
  execvp(av[0], &av[0]);
  fflush(stdout);
  perror(av[0]);
  exit(-1);
}


x86 assembly (clang, -O0):
<exec_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <execvp@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<exec_cmd>:
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%rdi
call   1050 <execvp@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    (%rbx),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
define i32 @exec_cmd(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = call i32 @execvp(i8* %7, i8** %9)
%11 = load i32, i32* @stdout
%12 = call i32 @fflush(i32 %11)
%13 = load i8**, i8*** %4
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 @perror(i8* %15)
%17 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @exec_cmd(i32 %0, i8** %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @execvp(i8* %3, i8** %1)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
%7 = load i8*, i8** %1
%8 = tail call i32 @perror(i8* %7)
%9 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int THRandom_geometric(double);
unsigned Random_geometric(double p) { return THRandom_geometric(p); }


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

x86 assembly (clang, -O2):
<Random_geometric>:
jmp    1030 <THRandom_geometric@plt>

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

LLVM IR (-O2):
define i32 @Random_geometric(double %0) {
%2 = tail call i32 @THRandom_geometric(double %0)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t mcd(uint64_t a, uint64_t b) {
  while (a != b) {
    if (a > b)
      a -= b;
    else
      b -= a;
  }
  return a;
}


x86 assembly (clang, -O0):
<mcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1150 <mcd+0x50>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    113c <mcd+0x3c>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    114b <mcd+0x4b>
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <mcd+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcd>:
mov    %rdi,%rax
cmp    %rsi,%rdi
je     112e <mcd+0x2e>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
cmp    %rax,%rsi
mov    $0x0,%edx
cmovl  %rsi,%rdx
mov    %rax,%rdi
cmovl  %rcx,%rdi
sub    %rdx,%rax
sub    %rdi,%rsi
cmp    %rsi,%rax
jne    1110 <mcd+0x10>
ret

LLVM IR (-O0):
define i64 @mcd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
br label %5
5: ; preds = %21, %2
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %22
9: ; preds = %5
%10 = load i64, i64* %3
%11 = load i64, i64* %4
%12 = icmp sgt i64 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i64, i64* %4
%15 = load i64, i64* %3
%16 = sub nsw i64 %15, %14
store i64 %16, i64* %3
br label %21
17: ; preds = %9
%18 = load i64, i64* %3
%19 = load i64, i64* %4
%20 = sub nsw i64 %19, %18
store i64 %20, i64* %4
br label %21
21: ; preds = %17, %13
br label %5
22: ; preds = %5
%23 = load i64, i64* %3
ret i64 %23
}

LLVM IR (-O2):
define i64 @mcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %11, %4 ], [ %1, %2 ]
%6 = phi i64 [ %9, %4 ], [ %0, %2 ]
%7 = icmp slt i64 %5, %6
%8 = select i1 %7, i64 %5, i64 0
%9 = sub nsw i64 %6, %8
%10 = select i1 %7, i64 0, i64 %6
%11 = sub nsw i64 %5, %10
%12 = icmp eq i64 %9, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i64 [ %0, %2 ], [ %9, %4 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ porting_dbg(char *, char const *);
int chroot(const char *path) {
  porting_dbg("chroot(%s) not supported", path);
  return -1;
}


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

x86 assembly (clang, -O2):
<chroot>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <porting_dbg@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"chroot(%s) not supported\00"
define i32 @chroot(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @porting_dbg(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 -1
}

LLVM IR (-O2):
@.str = [25 x i8] c"chroot(%s) not supported\00"
define i32 @chroot(i8* %0) {
%2 = tail call i32 @porting_dbg(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 -1
}
void my_function() { char *my_string = "Hello"; }


x86 assembly (clang, -O0):
<my_function>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
define void @my_function() {
%1 = alloca i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %1
ret void
}

LLVM IR (-O2):
define void @my_function() {
ret void
}
/* Variables and functions */
int core4_safe(char const *);
int U_EMRRECTANGLE_safe(const char *record) { return (core4_safe(record)); }


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

x86 assembly (clang, -O2):
<U_EMRRECTANGLE_safe>:
jmp    1030 <core4_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRRECTANGLE_safe(i8* %0) {
%2 = tail call i32 @core4_safe(i8* %0)
ret i32 %2
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int quaddobl_Newton_Laurent_step(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(328, a, b, c, 0);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @quaddobl_Newton_Laurent_step() {
%1 = tail call i32 @_ada_use_c2phc(i32 328, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
float g(float x) { return 2 / x + 3 / x; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
divss  -0x4(%rbp),%xmm0
movss  0xee2(%rip),%xmm1
divss  -0x4(%rbp),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
shufps $0x0,%xmm0,%xmm0
movaps 0xef5(%rip),%xmm1
divps  %xmm0,%xmm1
movaps %xmm1,%xmm0
shufps $0x55,%xmm1,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @g(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float 2.000000e+00, %3
%5 = load float, float* %2
%6 = fdiv float 3.000000e+00, %5
%7 = fadd float %4, %6
ret float %7
}

LLVM IR (-O2):
define float @g(float %0) {
%2 = insertelement <2 x float> poison, float %0, i64 0
%3 = shufflevector <2 x float> %2, <2 x float> poison, <2 x i32> zeroinitializer
%4 = fdiv <2 x float> <float 2.000000e+00, float 3.000000e+00>, %3
%5 = shufflevector <2 x float> %4, <2 x float> poison, <2 x i32> <i32 1, i32 undef>
%6 = fadd <2 x float> %4, %5
%7 = extractelement <2 x float> %6, i64 0
ret float %7
}
/* Type definitions */
typedef double uint64_t;

/* Variables and functions */
int /*<<< orphan*/ usleep(double);
void ts_sleep(uint64_t no_of_ts) {
  no_of_ts = no_of_ts / ((double)1000000ull / 1000000ull);
  usleep(no_of_ts);
}


x86 assembly (clang, -O0):
<ts_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_sleep>:
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @ts_sleep(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.000000e+00
store double %4, double* %2
%5 = load double, double* %2
%6 = call i32 @usleep(double %5)
ret void
}

LLVM IR (-O2):
define void @ts_sleep(double %0) {
%2 = tail call i32 @usleep(double %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Free(int *);
void *Malloc(int);
int main(int argc, char *argv[]) {
  int r = 36;
  int *p = (int *)Malloc(sizeof(int));
  *p = 36;
  if (r != *p)
    return 1;
  Free(p);
  void *q = Malloc(1024 * 1024 + 1);
  if (q == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x24,-0x14(%rbp)
mov    $0x4,%edi
call   1030 <Malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x24,(%rax)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
je     1170 <main+0x50>
movl   $0x1,-0x4(%rbp)
jmp    11a5 <main+0x85>
mov    -0x20(%rbp),%rdi
call   1040 <Free@plt>
mov    $0x100001,%edi
call   1030 <Malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    119e <main+0x7e>
movl   $0x1,-0x4(%rbp)
jmp    11a5 <main+0x85>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <Malloc@plt>
movl   $0x24,(%rax)
mov    %rax,%rdi
call   1040 <Free@plt>
mov    $0x100001,%edi
call   1030 <Malloc@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 36, i32* %6
%9 = call i8* @Malloc(i32 4)
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %7
%11 = load i32*, i32** %7
store i32 36, i32* %11
%12 = load i32, i32* %6
%13 = load i32*, i32** %7
%14 = load i32, i32* %13
%15 = icmp ne i32 %12, %14
br i1 %15, label %16, label %17
16: ; preds = %2
store i32 1, i32* %3
br label %25
17: ; preds = %2
%18 = load i32*, i32** %7
%19 = call i32 @Free(i32* %18)
%20 = call i8* @Malloc(i32 1048577)
store i8* %20, i8** %8
%21 = load i8*, i8** %8
%22 = icmp eq i8* %21, null
br i1 %22, label %23, label %24
23: ; preds = %17
store i32 1, i32* %3
br label %25
24: ; preds = %17
store i32 0, i32* %3
br label %25
25: ; preds = %24, %23, %16
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @Malloc(i32 4)
%4 = bitcast i8* %3 to i32*
store i32 36, i32* %4
%5 = tail call i32 @Free(i32* %4)
%6 = tail call i8* @Malloc(i32 1048577)
%7 = icmp eq i8* %6, null
%8 = zext i1 %7 to i32
ret i32 %8
}