xunge/DecIR huggingface dataset:
void *move_ptr_align128(void *ptr, unsigned long offset) {
  return (void *)(((unsigned long)(ptr + offset) + 127) & (~127));
}


x86 assembly (clang, -O0):
<move_ptr_align128>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x7f,%rax
and    $0xffffffffffffff80,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_ptr_align128>:
lea    (%rdi,%rsi,1),%rax
add    $0x7f,%rax
and    $0xffffffffffffff80,%rax
ret

LLVM IR (-O0):
define i8* @move_ptr_align128(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = getelementptr i8, i8* %5, i64 %6
%8 = ptrtoint i8* %7 to i64
%9 = add i64 %8, 127
%10 = and i64 %9, -128
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
define i8* @move_ptr_align128(i8* %0, i64 %1) {
%3 = getelementptr i8, i8* %0, i64 %1
%4 = ptrtoint i8* %3 to i64
%5 = add i64 %4, 127
%6 = and i64 %5, -128
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Type definitions */
typedef size_t uint32_t;
typedef int /*<<< orphan*/ int32_t;
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int /*<<< orphan*/, int /*<<< orphan*/ *);
void set_all_evtfd(int32_t evtfd[], uint32_t ndev, fd_set *p_evtfd_set) {
  for (uint32_t i = 0; i < ndev; i++) {
    FD_SET(evtfd[i], p_evtfd_set);
  }
}


x86 assembly (clang, -O0):
<set_all_evtfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115f <set_all_evtfd+0x4f>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x18(%rbp),%rsi
call   1030 <FD_SET@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <set_all_evtfd+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_all_evtfd>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1145 <set_all_evtfd+0x35>
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edi
mov    %r14,%rsi
call   1030 <FD_SET@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <set_all_evtfd+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @set_all_evtfd(i32* nocapture %0, i64 %1, i32* %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i64 [ %11, %6 ], [ 0, %3 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @FD_SET(i32 %9, i32* %2)
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %5, label %6
}
/* Type definitions */
typedef int /*<<< orphan*/ token;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ get_next_token(int /*<<< orphan*/ *, char *, int);
int parse_int(char *);
int get_next_int(FILE *fp) {
  char token[11];
  get_next_token(fp, token, sizeof(token));
  return parse_int(token);
}


x86 assembly (clang, -O0):
<get_next_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x13(%rbp),%rsi
mov    $0xb,%edx
call   1030 <get_next_token@plt>
lea    -0x13(%rbp),%rdi
call   1040 <parse_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_next_int>:
push   %rbx
sub    $0x10,%rsp
lea    0x5(%rsp),%rbx
mov    %rbx,%rsi
mov    $0xb,%edx
call   1030 <get_next_token@plt>
mov    %rbx,%rdi
call   1040 <parse_int@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_next_int(i32* %0) {
%2 = alloca i32*
%3 = alloca [11 x i8]
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%6 = call i32 @get_next_token(i32* %4, i8* %5, i32 11)
%7 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%8 = call i32 @parse_int(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_next_int(i32* %0) {
%2 = alloca [11 x i8]
%3 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%4 = call i32 @get_next_token(i32* %0, i8* %3, i32 11)
%5 = call i32 @parse_int(i8* %3)
ret i32 %5
}
unsigned long align_to(unsigned long n, unsigned long alignment) {
  int count = (n + alignment - 1) / alignment;
  return count * alignment;
}


x86 assembly (clang, -O0):
<align_to>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
sub    $0x1,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
imul   -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_to>:
lea    (%rdi,%rsi,1),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     111b <align_to+0x1b>
xor    %edx,%edx
div    %rsi
jmp    111f <align_to+0x1f>
xor    %edx,%edx
div    %esi
cltq
imul   %rsi,%rax
ret

LLVM IR (-O0):
define i64 @align_to(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = add i64 %6, %7
%9 = sub i64 %8, 1
%10 = load i64, i64* %4
%11 = udiv i64 %9, %10
%12 = trunc i64 %11 to i32
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = load i64, i64* %4
%16 = mul i64 %14, %15
ret i64 %16
}

LLVM IR (-O2):
define i64 @align_to(i64 %0, i64 %1) {
%3 = add i64 %0, -1
%4 = add i64 %3, %1
%5 = udiv i64 %4, %1
%6 = shl i64 %5, 32
%7 = ashr exact i64 %6, 32
%8 = mul i64 %7, %1
ret i64 %8
}
/* Type definitions */
struct timex {
  scalar_t__ status;
  void *modes;
};

/* Variables and functions */
void *ADJ_STATUS;
scalar_t__ STA_PLL;
int adjtimex(struct timex *);
int clear_time_state(void) {
  struct timex tx;
  int ret;
  tx.modes = ADJ_STATUS;
  tx.status = STA_PLL;
  ret = adjtimex(&tx);
  tx.modes = ADJ_STATUS;
  tx.status = 0;
  ret = adjtimex(&tx);
  return ret;
}


x86 assembly (clang, -O0):
<clear_time_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <adjtimex@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <adjtimex@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_time_state>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    0x2ec2(%rip),%r14
mov    (%r14),%rax
mov    %rax,0x10(%rsp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <adjtimex@plt>
mov    (%r14),%rax
mov    %rax,0x10(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <adjtimex@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timex = type { i64, i8* }
@ADJ_STATUS = global i8* null
@STA_PLL = global i64 0
define i32 @clear_time_state() {
%1 = alloca %struct.timex
%2 = alloca i32
%3 = load i8*, i8** @ADJ_STATUS
%4 = getelementptr inbounds %struct.timex, %struct.timex* %1, i32 0, i32 1
store i8* %3, i8** %4
%5 = load i64, i64* @STA_PLL
%6 = getelementptr inbounds %struct.timex, %struct.timex* %1, i32 0, i32 0
store i64 %5, i64* %6
%7 = call i32 @adjtimex(%struct.timex* %1)
store i32 %7, i32* %2
%8 = load i8*, i8** @ADJ_STATUS
%9 = getelementptr inbounds %struct.timex, %struct.timex* %1, i32 0, i32 1
store i8* %8, i8** %9
%10 = getelementptr inbounds %struct.timex, %struct.timex* %1, i32 0, i32 0
store i64 0, i64* %10
%11 = call i32 @adjtimex(%struct.timex* %1)
store i32 %11, i32* %2
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.timex = type { i64, i8* }
@ADJ_STATUS = global i8* null
@STA_PLL = global i64 0
define i32 @clear_time_state() {
%1 = alloca %struct.timex
%2 = bitcast %struct.timex* %1 to i8*
%3 = load i8*, i8** @ADJ_STATUS
%4 = getelementptr inbounds %struct.timex, %struct.timex* %1, i64 0, i32 1
store i8* %3, i8** %4
%5 = load i64, i64* @STA_PLL
%6 = getelementptr inbounds %struct.timex, %struct.timex* %1, i64 0, i32 0
store i64 %5, i64* %6
%7 = call i32 @adjtimex(%struct.timex* %1)
%8 = load i8*, i8** @ADJ_STATUS
store i8* %8, i8** %4
store i64 0, i64* %6
%9 = call i32 @adjtimex(%struct.timex* %1)
ret i32 %9
}
void gtk_container_get_resize_mode() {}


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

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

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

LLVM IR (-O2):
define void @gtk_container_get_resize_mode() {
ret void
}
__complex__ float foo(void) {
  __complex__ float f[1];
  __real__ f[0] = 1.0;
  __imag__ f[0] = 1.0;
  f[0] = __builtin_conjf(f[0]);
  return f[0];
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3f800000,-0x10(%rbp)
movl   $0x3f800000,-0xc(%rbp)
movaps 0xee7(%rip),%xmm1
movss  -0xc(%rbp),%xmm0
pxor   %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movaps 0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define <2 x float> @foo() {
%1 = alloca { float, float }
%2 = alloca [1 x { float, float }]
%3 = getelementptr inbounds [1 x { float, float }], [1 x { float, float }]* %2, i64 0, i64 0
%4 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
store float 1.000000e+00, float* %4
%5 = getelementptr inbounds [1 x { float, float }], [1 x { float, float }]* %2, i64 0, i64 0
%6 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 1
store float 1.000000e+00, float* %6
%7 = getelementptr inbounds [1 x { float, float }], [1 x { float, float }]* %2, i64 0, i64 0
%8 = getelementptr inbounds { float, float }, { float, float }* %7, i32 0, i32 0
%9 = load float, float* %8
%10 = getelementptr inbounds { float, float }, { float, float }* %7, i32 0, i32 1
%11 = load float, float* %10
%12 = fneg float %11
%13 = getelementptr inbounds [1 x { float, float }], [1 x { float, float }]* %2, i64 0, i64 0
%14 = getelementptr inbounds { float, float }, { float, float }* %13, i32 0, i32 0
%15 = getelementptr inbounds { float, float }, { float, float }* %13, i32 0, i32 1
store float %9, float* %14
store float %12, float* %15
%16 = getelementptr inbounds [1 x { float, float }], [1 x { float, float }]* %2, i64 0, i64 0
%17 = getelementptr inbounds { float, float }, { float, float }* %16, i32 0, i32 0
%18 = load float, float* %17
%19 = getelementptr inbounds { float, float }, { float, float }* %16, i32 0, i32 1
%20 = load float, float* %19
%21 = getelementptr inbounds { float, float }, { float, float }* %1, i32 0, i32 0
%22 = getelementptr inbounds { float, float }, { float, float }* %1, i32 0, i32 1
store float %18, float* %21
store float %20, float* %22
%23 = bitcast { float, float }* %1 to <2 x float>*
%24 = load <2 x float>, <2 x float>* %23
ret <2 x float> %24
}

LLVM IR (-O2):
define <2 x float> @foo() {
ret <2 x float> <float 1.000000e+00, float -1.000000e+00>
}
void ignr_read(void) {}


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

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

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

LLVM IR (-O2):
define void @ignr_read() {
ret void
}
__attribute__((no, noclone)) signed __int128 t112_3sub(signed __int128 y) {
  signed __int128 r;
  if (__builtin_sub_overflow(
          (signed __int128)((
              (signed __int128)(((unsigned __int128)1 << (16 * 8 - 1)) - 1))),
          y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t112_3sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rcx
mov    -0x28(%rbp),%rax
movabs $0x7fffffffffffffff,%rdx
ff ff 7f
sub    %rax,%rdx
seto   %al
not    %rcx
mov    %rdx,-0x38(%rbp)
mov    %rcx,-0x40(%rbp)
test   $0x1,%al
jne    1160 <t112_3sub+0x50>
jmp    1167 <t112_3sub+0x57>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t112_3sub>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
not    %r14
movabs $0x7fffffffffffffff,%rbx
ff ff 7f
sub    %rsi,%rbx
jno    1130 <t112_3sub+0x20>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t112_3sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.ssub.with.overflow.i128(i128 170141183460469231731687303715884105727, i128 %11)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t112_3sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.ssub.with.overflow.i128(i128 170141183460469231731687303715884105727, i128 %6)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
void typesym() {
  asm volatile("subq $0x8, %%r11\n\t"
               "movq (%%rsp), %%rax\n\t"
               "movq 0x8(%%rax), %%rbx\n\t"
               "movq %%rbx, (%%r11)\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<typesym>:
push   %rbp
mov    %rsp,%rbp
sub    $0x8,%r11
mov    (%rsp),%rax
mov    0x8(%rax),%rbx
mov    %rbx,(%r11)
pop    %rbp
ret

x86 assembly (clang, -O2):
<typesym>:
sub    $0x8,%r11
mov    (%rsp),%rax
mov    0x8(%rax),%rbx
mov    %rbx,(%r11)
ret

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

LLVM IR (-O2):
define void @typesym() {
tail call void asm sideeffect "subq $$0x8, %r11\0A\09movq (%rsp), %rax\0A\09movq 0x8(%rax), %rbx\0A\09movq %rbx, (%r11)\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void CANRegWrite(unsigned long ulRegAddress, unsigned long ulRegValue) {
  volatile int iDelay;
  (*((volatile unsigned long *)(ulRegAddress))) = ulRegValue;
  for (iDelay = 0; iDelay < (5); iDelay++) {
  }
}


x86 assembly (clang, -O0):
<CANRegWrite>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    $0x5,%eax
jge    113d <CANRegWrite+0x3d>
jmp    112f <CANRegWrite+0x2f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111e <CANRegWrite+0x1e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANRegWrite>:
mov    %rsi,(%rdi)
movl   $0x0,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x4,%eax
jg     112e <CANRegWrite+0x2e>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
addl   $0x1,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x5,%eax
jl     1120 <CANRegWrite+0x20>
ret

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

LLVM IR (-O2):
define void @CANRegWrite(i64 %0, i64 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = inttoptr i64 %0 to i64*
store volatile i64 %1, i64* %5
store volatile i32 0, i32* %3
%6 = load volatile i32, i32* %3
%7 = icmp slt i32 %6, 5
br i1 %7, label %8, label %13
8: ; preds = %2, %8
%9 = load volatile i32, i32* %3
%10 = add nsw i32 %9, 1
store volatile i32 %10, i32* %3
%11 = load volatile i32, i32* %3
%12 = icmp slt i32 %11, 5
br i1 %12, label %8, label %13
13: ; preds = %8, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void co_write16(void const *ptr16, uint32_t value) {
  *(uint16_t *)ptr16 = value;
}


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

x86 assembly (clang, -O2):
<co_write16>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @co_write16(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @co_write16(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t millis() { return 42; }


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

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

LLVM IR (-O0):
define i32 @millis() {
ret i32 42
}

LLVM IR (-O2):
define i32 @millis() {
ret i32 42
}
int nrow(int a) {
  int p = 0, c = 0;
  while (a > c)
    c += ++p + 1;
  return p;
}


x86 assembly (clang, -O0):
<nrow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1138 <nrow+0x38>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
add    $0x1,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <nrow+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrow>:
test   %edi,%edi
jle    1121 <nrow+0x21>
xor    %ecx,%ecx
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%eax
add    $0x1,%eax
add    %edx,%ecx
add    $0x2,%ecx
mov    %eax,%edx
cmp    %edi,%ecx
jl     1110 <nrow+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @nrow(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ 0, %1 ]
%6 = add nuw nsw i32 %5, 1
%7 = add nuw nsw i32 %5, 2
%8 = add nuw nsw i32 %7, %4
%9 = icmp slt i32 %8, %0
br i1 %9, label %3, label %10
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ pmu_set_active_clk(int);
int /*<<< orphan*/ pmu_set_sar_ratio(int);
int /*<<< orphan*/ pmu_set_sleep_clk(int);
void pmu_set_clk_init() {
  pmu_set_active_clk(0x0D020F0F);
  pmu_set_sleep_clk(0x0F010102);
  pmu_set_sar_ratio(52);
}


x86 assembly (clang, -O0):
<pmu_set_clk_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd020f0f,%edi
call   1040 <pmu_set_active_clk@plt>
mov    $0xf010102,%edi
call   1030 <pmu_set_sleep_clk@plt>
mov    $0x34,%edi
call   1050 <pmu_set_sar_ratio@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_set_clk_init>:
push   %rax
mov    $0xd020f0f,%edi
call   1040 <pmu_set_active_clk@plt>
mov    $0xf010102,%edi
call   1030 <pmu_set_sleep_clk@plt>
mov    $0x34,%edi
pop    %rax
jmp    1050 <pmu_set_sar_ratio@plt>

LLVM IR (-O0):
define void @pmu_set_clk_init() {
%1 = call i32 @pmu_set_active_clk(i32 218238735)
%2 = call i32 @pmu_set_sleep_clk(i32 251724034)
%3 = call i32 @pmu_set_sar_ratio(i32 52)
ret void
}

LLVM IR (-O2):
define void @pmu_set_clk_init() {
%1 = tail call i32 @pmu_set_active_clk(i32 218238735)
%2 = tail call i32 @pmu_set_sleep_clk(i32 251724034)
%3 = tail call i32 @pmu_set_sar_ratio(i32 52)
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
char *skip_spaces(char *s) {
  while (*s && isspace(*s))
    s++;
  return s;
}


x86 assembly (clang, -O0):
<skip_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <skip_spaces+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <skip_spaces+0x47>
jmp    1168 <skip_spaces+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_spaces+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_spaces>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <skip_spaces+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <skip_spaces+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skip_spaces+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skip_spaces(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
char *get_state_name(int state) {
  switch (state) {
  case 444:
    return "occupied";
    break;
  case 555:
    return "freed";
    break;
  case 666:
    return "empty";
    break;
  default:
    return "?????";
    break;
  }
}


x86 assembly (clang, -O0):
<get_state_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1bc,%eax
je     1143 <get_state_name+0x43>
jmp    111d <get_state_name+0x1d>
mov    -0x10(%rbp),%eax
sub    $0x22b,%eax
je     1153 <get_state_name+0x53>
jmp    1130 <get_state_name+0x30>
mov    -0x10(%rbp),%eax
sub    $0x29a,%eax
je     1163 <get_state_name+0x63>
jmp    1173 <get_state_name+0x73>
lea    0xeb6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117e <get_state_name+0x7e>
lea    0xeaf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117e <get_state_name+0x7e>
lea    0xea5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117e <get_state_name+0x7e>
lea    0xe9b(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_state_name>:
cmp    $0x1bc,%edi
je     1120 <get_state_name+0x20>
cmp    $0x29a,%edi
je     1128 <get_state_name+0x28>
cmp    $0x22b,%edi
jne    1130 <get_state_name+0x30>
lea    0xeea(%rip),%rax
ret
lea    0xed9(%rip),%rax
ret
lea    0xee0(%rip),%rax
ret
lea    0xede(%rip),%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"occupied\00"
@.str.1 = [6 x i8] c"freed\00"
@.str.2 = [6 x i8] c"empty\00"
@.str.3 = [6 x i8] c"?????\00"
define i8* @get_state_name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 444, label %5
i32 555, label %6
i32 666, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [9 x i8] c"occupied\00"
@.str.1 = [6 x i8] c"freed\00"
@.str.2 = [6 x i8] c"empty\00"
@.str.3 = [6 x i8] c"?????\00"
define i8* @get_state_name(i32 %0) {
switch i32 %0, label %4 [
i32 444, label %5
i32 555, label %2
i32 666, label %3
]
2: ; preds = %1
br label %5
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3, %2
%6 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int write_quaddobl_start_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(768, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<write_quaddobl_start_Laurent_system>:
mov    $0x300,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @write_quaddobl_start_Laurent_system() {
%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_c2phc4c(i32 768, 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 @write_quaddobl_start_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 768, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
struct obus_server {
  int dummy;
};
struct obus_bus_event {
  int dummy;
};
struct net_bus_event {
  int dummy;
};

/* Variables and functions */
int obus_server_send_bus_event(struct obus_server *, struct obus_bus_event *);
int net_bus_event_send(struct obus_server *server,
                       struct net_bus_event *event) {
  struct obus_bus_event *evt = (struct obus_bus_event *)event;
  return obus_server_send_bus_event(server, evt);
}


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

x86 assembly (clang, -O2):
<net_bus_event_send>:
jmp    1030 <obus_server_send_bus_event@plt>

LLVM IR (-O0):
%struct.obus_server = type { i32 }
%struct.net_bus_event = type { i32 }
%struct.obus_bus_event = type { i32 }
define i32 @net_bus_event_send(%struct.obus_server* %0, %struct.net_bus_event* %1) {
%3 = alloca %struct.obus_server*
%4 = alloca %struct.net_bus_event*
%5 = alloca %struct.obus_bus_event*
store %struct.obus_server* %0, %struct.obus_server** %3
store %struct.net_bus_event* %1, %struct.net_bus_event** %4
%6 = load %struct.net_bus_event*, %struct.net_bus_event** %4
%7 = bitcast %struct.net_bus_event* %6 to %struct.obus_bus_event*
store %struct.obus_bus_event* %7, %struct.obus_bus_event** %5
%8 = load %struct.obus_server*, %struct.obus_server** %3
%9 = load %struct.obus_bus_event*, %struct.obus_bus_event** %5
%10 = call i32 @obus_server_send_bus_event(%struct.obus_server* %8, %struct.obus_bus_event* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.obus_server = type { i32 }
%struct.net_bus_event = type { i32 }
%struct.obus_bus_event = type { i32 }
define i32 @net_bus_event_send(%struct.obus_server* %0, %struct.net_bus_event* %1) {
%3 = bitcast %struct.net_bus_event* %1 to %struct.obus_bus_event*
%4 = tail call i32 @obus_server_send_bus_event(%struct.obus_server* %0, %struct.obus_bus_event* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ stderr;
void helpMessage() {
  fprintf(stderr,
          "testopt [options] <message>\n"
          "-h  help message\n"
          "-k  assign key (default: 0x%08X\n"
          "-q  system message queue status\n"
          "-t  assign type (default:%d)\n",
          0x0ADA5000, 9);
}


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

x86 assembly (clang, -O2):
<helpMessage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
mov    $0xada5000,%edx
mov    $0x9,%ecx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [139 x i8] c"testopt [options] <message>\0A-h help message\0A-k assign key (default: 0x%08X\0A-q system message queue status\0A-t assign type (default:%d)\0A\00"
define void @helpMessage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 182079488, i32 9)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [139 x i8] c"testopt [options] <message>\0A-h help message\0A-k assign key (default: 0x%08X\0A-q system message queue status\0A-t assign type (default:%d)\0A\00"
define void @helpMessage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 182079488, i32 9)
ret void
}
void leds_arch_init(void) {}


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

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

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

LLVM IR (-O2):
define void @leds_arch_init() {
ret void
}
void outofmemoryerror(message) char *message;
{
  error2error("compiler out of memory", message);
  finishup();
}


x86 assembly (clang, -O0):
<outofmemoryerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1040 <error2error@plt>
mov    $0x0,%al
call   1030 <finishup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outofmemoryerror>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <error2error@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <finishup@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"compiler out of memory\00"
define void @outofmemoryerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error2error to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (...) @finishup()
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"compiler out of memory\00"
define void @outofmemoryerror(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error2error to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (...) @finishup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
main() {
  float d = 1.0;
  int v, *p, bit;
  p = &d;
  v = *p;
  for (bit = 31; bit >= 0; bit--)
    printf("%d", (v >> bit) & 1);
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
movl   $0x1f,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     1175 <main+0x65>
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%ecx
sar    %cl,%esi
and    $0x1,%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1144 <main+0x34>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1f,%ebx
lea    0xed0(%rip),%r14
mov    $0x3f800000,%esi
mov    %ebx,%ecx
shr    %cl,%esi
and    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebx
jb     1130 <main+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 0, i32* %1
store float 1.000000e+00, float* %2
%6 = bitcast float* %2 to i32*
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
store i32 %8, i32* %3
store i32 31, i32* %5
br label %9
9: ; preds = %18, %0
%10 = load i32, i32* %5
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %9
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = ashr i32 %13, %14
%16 = and i32 %15, 1
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %12
%19 = load i32, i32* %5
%20 = add nsw i32 %19, -1
store i32 %20, i32* %5
br label %9
21: ; preds = %9
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 31, %0 ], [ %6, %1 ]
%3 = lshr i32 1065353216, %2
%4 = and i32 %3, 1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nsw i32 %2, -1
%7 = icmp eq i32 %2, 0
br i1 %7, label %8, label %1
8: ; preds = %1
%9 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void errorNoMem() {
  fatal("Out of object or bitmap memory or pointers ... SPLAT!!\n");
}


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

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

LLVM IR (-O0):
@.str = [56 x i8] c"Out of object or bitmap memory or pointers ... SPLAT!!\0A\00"
define void @errorNoMem() {
%1 = call i32 @fatal(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c"Out of object or bitmap memory or pointers ... SPLAT!!\0A\00"
define void @errorNoMem() {
%1 = tail call i32 @fatal(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int dobro(int);
int /*<<< orphan*/ printf(char *, int);
main() {
  printf("Dobro de 4 eh: %d", dobro(4));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"Dobro de 4 eh: %d\00"
define i32 @main() {
%1 = tail call i32 @dobro(i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ perror(char *);
FILE *open_file(char *filename) {
  FILE *f = fopen(filename, "rb");
  if (!f) {
    perror(filename);
    exit(1);
  }
  return f;
}


x86 assembly (clang, -O0):
<open_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116e <open_file+0x3e>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_file>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
call   1030 <fopen@plt>
test   %rax,%rax
je     1147 <open_file+0x17>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
define i32* @open_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp ne i32* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @perror(i8* %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i32*, i32** %3
ret i32* %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define noalias i32* @open_file(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ aes_ctx_free(void *);
void crypto_free_cipher_context(void *ctx, int cipher) {
  switch (cipher) {
  case 10:
  case 11:
  case 12:
    aes_ctx_free(ctx);
  }
}


x86 assembly (clang, -O0):
<crypto_free_cipher_context>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xfffffff6,%eax
sub    $0x2,%eax
ja     113c <crypto_free_cipher_context+0x2c>
jmp    1133 <crypto_free_cipher_context+0x23>
mov    -0x8(%rbp),%rdi
call   1030 <aes_ctx_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_free_cipher_context>:
add    $0xfffffff6,%esi
cmp    $0x2,%esi
ja     111d <crypto_free_cipher_context+0xd>
jmp    1030 <aes_ctx_free@plt>
ret

LLVM IR (-O0):
define void @crypto_free_cipher_context(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
switch i32 %5, label %9 [
i32 10, label %6
i32 11, label %6
i32 12, label %6
]
6: ; preds = %2, %2, %2
%7 = load i8*, i8** %3
%8 = call i32 @aes_ctx_free(i8* %7)
br label %9
9: ; preds = %6, %2
ret void
}

LLVM IR (-O2):
define void @crypto_free_cipher_context(i8* %0, i32 %1) {
%3 = add i32 %1, -10
%4 = icmp ult i32 %3, 3
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @aes_ctx_free(i8* %0)
br label %7
7: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCD_command_2D(int, int);
void LCD_set_offset_register(int offset) { LCD_command_2D(0x22, offset); }


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

x86 assembly (clang, -O2):
<LCD_set_offset_register>:
mov    %edi,%esi
mov    $0x22,%edi
jmp    1030 <LCD_command_2D@plt>

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

LLVM IR (-O2):
define void @LCD_set_offset_register(i32 %0) {
%2 = tail call i32 @LCD_command_2D(i32 34, i32 %0)
ret void
}
void _M2_NetworkOrder_init(__attribute__((unused)) int argc,
                           __attribute__((unused)) char *argv[]) {}


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

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

LLVM IR (-O0):
define void @_M2_NetworkOrder_init(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret void
}

LLVM IR (-O2):
define void @_M2_NetworkOrder_init(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit_byte(int);
void emit_dword(int i) {
  emit_byte(i & 0xff);
  emit_byte((i >> 8) & 0xff);
  emit_byte((i >> 16) & 0xff);
  emit_byte((i >> 24) & 0xff);
}


x86 assembly (clang, -O0):
<emit_dword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <emit_byte@plt>
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
call   1030 <emit_byte@plt>
mov    -0x4(%rbp),%edi
sar    $0x10,%edi
and    $0xff,%edi
call   1030 <emit_byte@plt>
mov    -0x4(%rbp),%edi
sar    $0x18,%edi
and    $0xff,%edi
call   1030 <emit_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_dword>:
push   %rbx
mov    %edi,%ebx
movzbl %bl,%edi
call   1030 <emit_byte@plt>
movzbl %bh,%edi
call   1030 <emit_byte@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
call   1030 <emit_byte@plt>
shr    $0x18,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <emit_byte@plt>

LLVM IR (-O0):
define void @emit_dword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = call i32 @emit_byte(i32 %4)
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = call i32 @emit_byte(i32 %8)
%10 = load i32, i32* %2
%11 = ashr i32 %10, 16
%12 = and i32 %11, 255
%13 = call i32 @emit_byte(i32 %12)
%14 = load i32, i32* %2
%15 = ashr i32 %14, 24
%16 = and i32 %15, 255
%17 = call i32 @emit_byte(i32 %16)
ret void
}

LLVM IR (-O2):
define void @emit_dword(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 @emit_byte(i32 %2)
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = tail call i32 @emit_byte(i32 %5)
%7 = lshr i32 %0, 16
%8 = and i32 %7, 255
%9 = tail call i32 @emit_byte(i32 %8)
%10 = lshr i32 %0, 24
%11 = tail call i32 @emit_byte(i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ changeBefore(int *);
void checkForCallee4(int *x) {
  if (x) {
    changeBefore(x);
  }
}


x86 assembly (clang, -O0):
<checkForCallee4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <checkForCallee4+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <changeBefore@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkForCallee4>:
test   %rdi,%rdi
je     111a <checkForCallee4+0xa>
jmp    1030 <changeBefore@plt>
ret

LLVM IR (-O0):
define void @checkForCallee4(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32*, i32** %2
%7 = call i32 @changeBefore(i32* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @checkForCallee4(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @changeBefore(i32* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func2();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("\n Inside main()\n");
  int i = 0;
  for (; i < 0xffffff; i++)
    ;
  func2();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xffffff,-0x8(%rbp)
jge    1162 <main+0x42>
jmp    1154 <main+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <main+0x22>
mov    $0x0,%al
call   1040 <func2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"\0A Inside main()\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %4
4: ; preds = %8, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 16777215
br i1 %6, label %7, label %11
7: ; preds = %4
br label %8
8: ; preds = %7
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %4
11: ; preds = %4
%12 = call i32 (...) @func2()
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"\0A Inside main()\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @func2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dummy_oracle() { printf("\n"); }


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

x86 assembly (clang, -O2):
<dummy_oracle>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @dummy_oracle() {
%1 = tail call i32 @putchar(i32 10)
ret void
}