xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ gl_sort_pass();
void gl_sort() {
  while (gl_sort_pass())
    ;
}


x86 assembly (clang, -O0):
<gl_sort>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <gl_sort+0x9>
mov    $0x0,%al
call   1030 <gl_sort_pass@plt>
cmp    $0x0,%rax
je     112f <gl_sort+0x1f>
jmp    1119 <gl_sort+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gl_sort>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <gl_sort_pass@plt>
test   %rax,%rax
jne    1120 <gl_sort+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @gl_sort() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @gl_sort_pass()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @gl_sort() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @gl_sort_pass()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
void ExttCarrierAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttCarrierAuxTable() {
ret void
}
double potential(double lon_geodetic, double lat_geodetic,
                 double height_geodetic) {}


x86 assembly (clang, -O0):
<potential>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @potential(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %4
ret double %8
}

LLVM IR (-O2):
define double @potential(double %0, double %1, double %2) {
ret double undef
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int result = fib(28);
  printf("%d\n", result);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @fib(i32 28)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void xfrm4_rcv(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<xfrm4_rcv>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfrm4_rcv>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.xfrm4_rcv = [10 x i8] c"xfrm4_rcv\00"
define void @xfrm4_rcv() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.xfrm4_rcv, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.xfrm4_rcv = [10 x i8] c"xfrm4_rcv\00"
define void @xfrm4_rcv() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.xfrm4_rcv, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *print_jump(unsigned int, char *);
char *print_pcofs(int ofs, unsigned int PC, char *output) {
  ofs = (ofs + 1) * 4;
  return print_jump(PC + ofs, output);
}


x86 assembly (clang, -O0):
<print_pcofs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
shl    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%edi
add    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <print_jump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_pcofs>:
lea    (%rsi,%rdi,4),%edi
add    $0x4,%edi
mov    %rdx,%rsi
jmp    1030 <print_jump@plt>

LLVM IR (-O0):
define i8* @print_pcofs(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = mul nsw i32 %8, 4
store i32 %9, i32* %4
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = add i32 %10, %11
%13 = load i8*, i8** %6
%14 = call i8* @print_jump(i32 %12, i8* %13)
ret i8* %14
}

LLVM IR (-O2):
define i8* @print_pcofs(i32 %0, i32 %1, i8* %2) {
%4 = shl i32 %0, 2
%5 = add i32 %4, 4
%6 = add i32 %5, %1
%7 = tail call i8* @print_jump(i32 %6, i8* %2)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ __CRAB_assert(int);
int main() {
  int k = 200;
  int n = 100;
  int x = 0, y = k;
  while (x < n) {
    x++;
    y = k - 2 * x;
  }
  __CRAB_assert(x + y <= k);
  return x + y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc8,-0x8(%rbp)
movl   $0x64,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    113a <main+0x2a>
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CRAB_assert@plt>
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <__CRAB_assert@plt>
mov    $0x64,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 200, i32* %2
store i32 100, i32* %3
store i32 0, i32* %4
%6 = load i32, i32* %2
store i32 %6, i32* %5
br label %7
7: ; preds = %11, %0
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %18
11: ; preds = %7
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 1
store i32 %13, i32* %4
%14 = load i32, i32* %2
%15 = load i32, i32* %4
%16 = mul nsw i32 2, %15
%17 = sub nsw i32 %14, %16
store i32 %17, i32* %5
br label %7
18: ; preds = %7
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = add nsw i32 %19, %20
%22 = load i32, i32* %2
%23 = icmp sle i32 %21, %22
%24 = zext i1 %23 to i32
%25 = call i32 @__CRAB_assert(i32 %24)
%26 = load i32, i32* %4
%27 = load i32, i32* %5
%28 = add nsw i32 %26, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__CRAB_assert(i32 1)
ret i32 100
}
__typeof__(memcpy(1, 1, 1)) test_memcpy_110(void) { return memcpy(1, 1, 1); }


x86 assembly (clang, -O0):
<test_memcpy_110>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
mov    (%rax),%cl
mov    %cl,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @test_memcpy_110() {
ret i8* inttoptr (i64 1 to i8*)
}

LLVM IR (-O2):
define i8* @test_memcpy_110() {
ret i8* inttoptr (i64 1 to i8*)
}
/* Type definitions */
struct vec2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec2_zero(float *);
__attribute__((always_)) struct vec2 *psvec2_zero(struct vec2 *result) {
  vec2_zero((float *)result);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec2_zero>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec2_zero@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec2 = type { i32 }
define %struct.vec2* @psvec2_zero(%struct.vec2* %0) {
%2 = alloca %struct.vec2*
store %struct.vec2* %0, %struct.vec2** %2
%3 = load %struct.vec2*, %struct.vec2** %2
%4 = bitcast %struct.vec2* %3 to float*
%5 = call i32 @vec2_zero(float* %4)
%6 = load %struct.vec2*, %struct.vec2** %2
ret %struct.vec2* %6
}

LLVM IR (-O2):
%struct.vec2 = type { i32 }
define %struct.vec2* @psvec2_zero(%struct.vec2* returned %0) {
%2 = bitcast %struct.vec2* %0 to float*
%3 = tail call i32 @vec2_zero(float* %2)
ret %struct.vec2* %0
}
void write_cr3(unsigned long val) {
  asm volatile("mov %0, %%cr3" : : "r"(val) : "memory");
}


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

x86 assembly (clang, -O2):
<write_cr3>:
mov    %rdi,%cr3
ret

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

LLVM IR (-O2):
define void @write_cr3(i64 %0) {
tail call void asm sideeffect "mov $0, %cr3", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_negative_to_positive();
int /*<<< orphan*/ test_positive_to_negative();
void execute_tests() {
  test_positive_to_negative();
  test_negative_to_positive();
}


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

x86 assembly (clang, -O2):
<execute_tests>:
push   %rax
xor    %eax,%eax
call   1040 <test_positive_to_negative@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_negative_to_positive@plt>

LLVM IR (-O0):
define void @execute_tests() {
%1 = call i32 (...) @test_positive_to_negative()
%2 = call i32 (...) @test_negative_to_positive()
ret void
}

LLVM IR (-O2):
define void @execute_tests() {
%1 = tail call i32 (...) @test_positive_to_negative()
%2 = tail call i32 (...) @test_negative_to_positive()
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int class;
};
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
TYPE_1__ *DefaultVisual(int /*<<< orphan*/ *, int);
int get_visual_class(Display *d, int scr) {
  return (DefaultVisual(d, scr)->class);
}


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

x86 assembly (clang, -O2):
<get_visual_class>:
push   %rax
call   1030 <DefaultVisual@plt>
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define i32 @get_visual_class(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call %struct.TYPE_2__* @DefaultVisual(i32* %5, i32 %6)
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
%struct.TYPE_2__ = type { i32 }
define i32 @get_visual_class(i32* %0, i32 %1) {
%3 = tail call %struct.TYPE_2__* @DefaultVisual(i32* %0, i32 %1)
%4 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %3, i64 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}
int binv_check_bl(int bl) {
  switch (bl) {
  case 16:
  case 24:
  case 32:
    return 1;
  default:
    return -11;
  }
}


x86 assembly (clang, -O0):
<binv_check_bl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x10,%eax
je     113d <binv_check_bl+0x3d>
jmp    111b <binv_check_bl+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x18,%eax
je     113d <binv_check_bl+0x3d>
jmp    112c <binv_check_bl+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
jne    1149 <binv_check_bl+0x49>
jmp    113d <binv_check_bl+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1150 <binv_check_bl+0x50>
movl   $0xfffffff5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binv_check_bl>:
cmp    $0x20,%edi
ja     111d <binv_check_bl+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x101010000,%rdx
bt     %rcx,%rdx
jae    111d <binv_check_bl+0x1d>
ret
mov    $0xfffffff5,%eax
ret

LLVM IR (-O0):
define i32 @binv_check_bl(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 16, label %5
i32 24, label %5
i32 32, label %5
]
5: ; preds = %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 -11, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @binv_check_bl(i32 %0) {
switch i32 %0, label %2 [
i32 16, label %3
i32 24, label %3
i32 32, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %2
%4 = phi i32 [ -11, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Type definitions */
struct input_event {
  scalar_t__ type;
  int value;
};

/* Variables and functions */
scalar_t__ EV_KEY;
int event_is_keyboard(struct input_event *event) {
  return (event->type == EV_KEY && event->value >= 0 && event->value <= 2);
}


x86 assembly (clang, -O0):
<event_is_keyboard>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
xor    %eax,%eax
mov    0x2ed0(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x9(%rbp)
jne    1145 <event_is_keyboard+0x45>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpl   $0x0,0x8(%rcx)
mov    %al,-0x9(%rbp)
jl     1145 <event_is_keyboard+0x45>
mov    -0x8(%rbp),%rax
cmpl   $0x2,0x8(%rax)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_is_keyboard>:
mov    (%rdi),%rcx
mov    0x2ede(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
jne    1120 <event_is_keyboard+0x20>
mov    0x8(%rdi),%ecx
test   %ecx,%ecx
js     1120 <event_is_keyboard+0x20>
xor    %eax,%eax
cmp    $0x3,%ecx
setb   %al
ret

LLVM IR (-O0):
%struct.input_event = type { i64, i32 }
@EV_KEY = global i64 0
define i32 @event_is_keyboard(%struct.input_event* %0) {
%2 = alloca %struct.input_event*
store %struct.input_event* %0, %struct.input_event** %2
%3 = load %struct.input_event*, %struct.input_event** %2
%4 = getelementptr inbounds %struct.input_event, %struct.input_event* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = load i64, i64* @EV_KEY
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %18
8: ; preds = %1
%9 = load %struct.input_event*, %struct.input_event** %2
%10 = getelementptr inbounds %struct.input_event, %struct.input_event* %9, i32 0, i32 1
%11 = load i32, i32* %10
%12 = icmp sge i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load %struct.input_event*, %struct.input_event** %2
%15 = getelementptr inbounds %struct.input_event, %struct.input_event* %14, i32 0, i32 1
%16 = load i32, i32* %15
%17 = icmp sle i32 %16, 2
br label %18
18: ; preds = %13, %8, %1
%19 = phi i1 [ false, %8 ], [ false, %1 ], [ %17, %13 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
%struct.input_event = type { i64, i32 }
@EV_KEY = global i64 0
define i32 @event_is_keyboard(%struct.input_event* nocapture %0) {
%2 = getelementptr inbounds %struct.input_event, %struct.input_event* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = load i64, i64* @EV_KEY
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = getelementptr inbounds %struct.input_event, %struct.input_event* %0, i64 0, i32 1
%8 = load i32, i32* %7
%9 = icmp sgt i32 %8, -1
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = icmp ult i32 %8, 3
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %10, %6, %1
%14 = phi i32 [ 0, %6 ], [ 0, %1 ], [ %12, %10 ]
ret i32 %14
}
const char *roadmap_log_access_mode() { return ("sa"); }


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

x86 assembly (clang, -O2):
<roadmap_log_access_mode>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"sa\00"
define i8* @roadmap_log_access_mode() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [3 x i8] c"sa\00"
define i8* @roadmap_log_access_mode() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int hour, minute;
  hour = 11;
  minute = 59;
  printf("current time is  %d and %d hours\n", hour, minute / 60);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xb,-0x8(%rbp)
movl   $0x3b,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
lea    0xebc(%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    $0xb,%esi
xor    %edx,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"current time is %d and %d hours\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 11, i32* %2
store i32 59, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = sdiv i32 %5, 60
%7 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"current time is %d and %d hours\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 11, i32 0)
ret i32 0
}
/* Variables and functions */
int rand();
char dado() { return rand() % 6; }


x86 assembly (clang, -O0):
<dado>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %dl,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dado>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @dado() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 6
%3 = trunc i32 %2 to i8
ret i8 %3
}

LLVM IR (-O2):
define signext i8 @dado() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 6
%3 = trunc i32 %2 to i8
ret i8 %3
}
unsigned char fub_(unsigned char *const ub) { return (*ub); }


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

x86 assembly (clang, -O2):
<fub_>:
mov    (%rdi),%al
ret

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

LLVM IR (-O2):
define zeroext i8 @fub_(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
/* Variables and functions */
regint() {
  register int x, *p;
  x = *p++;
  x = *++p;
  x = *p--;
  x = *--p;
}


x86 assembly (clang, -O0):
<regint>:
push   %rbp
mov    %rsp,%rbp
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x4(%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x10(%rbp)
mov    -0x4(%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @regint() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i32 1
store i32* %5, i32** %3
%6 = load i32, i32* %4
store i32 %6, i32* %2
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i32 1
store i32* %8, i32** %3
%9 = load i32, i32* %8
store i32 %9, i32* %2
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i32 -1
store i32* %11, i32** %3
%12 = load i32, i32* %10
store i32 %12, i32* %2
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i32 -1
store i32* %14, i32** %3
%15 = load i32, i32* %14
store i32 %15, i32* %2
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @regint() {
ret i32 undef
}
int main() {
  int local = 7;
  int *ptr = &local;
  *ptr = 9;
  ptr = (int *)23;
  local = (int)ptr;
  ptr = &local;
  return *ptr + local * 10 - (23 + 23 * 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x9,(%rax)
mov    $0x17,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
imul   $0xa,-0x8(%rbp),%ecx
add    %ecx,%eax
sub    $0xfd,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 7, i32* %2
store i32* %2, i32** %3
%4 = load i32*, i32** %3
store i32 9, i32* %4
store i32* inttoptr (i64 23 to i32*), i32** %3
%5 = load i32*, i32** %3
%6 = ptrtoint i32* %5 to i32
store i32 %6, i32* %2
store i32* %2, i32** %3
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = load i32, i32* %2
%10 = mul nsw i32 %9, 10
%11 = add nsw i32 %8, %10
%12 = sub nsw i32 %11, 253
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void triggerGenClean(struct LSD_SceneNodeInst const *inst, void *instData) {}


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

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

LLVM IR (-O0):
%struct.LSD_SceneNodeInst = type opaque
define void @triggerGenClean(%struct.LSD_SceneNodeInst* %0, i8* %1) {
%3 = alloca %struct.LSD_SceneNodeInst*
%4 = alloca i8*
store %struct.LSD_SceneNodeInst* %0, %struct.LSD_SceneNodeInst** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.LSD_SceneNodeInst = type opaque
define void @triggerGenClean(%struct.LSD_SceneNodeInst* nocapture %0, i8* nocapture %1) {
ret void
}
int main(void) {
  return (!(
      ((((1) < (3)) ? (1) : (3)) == 1) && ((((9) < (7)) ? (9) : (7)) == 7) &&
      ((((0) < (0)) ? (0) : (0)) == 0) && ((((10) < (0)) ? (10) : (0)) == 0) &&
      ((((0) < (10)) ? (0) : (10)) == 0)));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ decode_lcdchar(int, char *, char *);
void decode_fatchar(uint16_t word, char *ch, char *punct, bool *end) {
  uint16_t lcdchar = word & 0x003f;
  if (word & 0x40)
    lcdchar |= 0x0100;
  decode_lcdchar(lcdchar, ch, punct);
  *end = (word & 0x0080) != 0;
}


x86 assembly (clang, -O0):
<decode_fatchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3f,%eax
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     114a <decode_fatchar+0x3a>
mov    -0x24(%rbp),%eax
or     $0x100,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <decode_lcdchar@plt>
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_fatchar>:
push   %rbp
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %edi,%ebp
mov    %edi,%eax
and    $0x3f,%eax
mov    %edi,%ecx
and    $0x40,%ecx
lea    (%rax,%rcx,4),%edi
call   1030 <decode_lcdchar@plt>
shr    $0x7,%ebp
and    $0x1,%ebp
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @decode_fatchar(i32 %0, i8* %1, i8* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32* %3, i32** %8
%10 = load i32, i32* %5
%11 = and i32 %10, 63
store i32 %11, i32* %9
%12 = load i32, i32* %5
%13 = and i32 %12, 64
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %4
%16 = load i32, i32* %9
%17 = or i32 %16, 256
store i32 %17, i32* %9
br label %18
18: ; preds = %15, %4
%19 = load i32, i32* %9
%20 = load i8*, i8** %6
%21 = load i8*, i8** %7
%22 = call i32 @decode_lcdchar(i32 %19, i8* %20, i8* %21)
%23 = load i32, i32* %5
%24 = and i32 %23, 128
%25 = icmp ne i32 %24, 0
%26 = zext i1 %25 to i32
%27 = load i32*, i32** %8
store i32 %26, i32* %27
ret void
}

LLVM IR (-O2):
define void @decode_fatchar(i32 %0, i8* %1, i8* %2, i32* nocapture writeonly %3) {
%5 = and i32 %0, 63
%6 = shl i32 %0, 2
%7 = and i32 %6, 256
%8 = or i32 %7, %5
%9 = tail call i32 @decode_lcdchar(i32 %8, i8* %1, i8* %2)
%10 = lshr i32 %0, 7
%11 = and i32 %10, 1
store i32 %11, i32* %3
ret void
}
/* Variables and functions */
int proc_false();
int proc_false_context(void *context) { return proc_false(); }


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

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

LLVM IR (-O0):
define i32 @proc_false_context(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @proc_false()
ret i32 %3
}

LLVM IR (-O2):
define i32 @proc_false_context(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @proc_false()
ret i32 %2
}
/* Type definitions */
struct rte_mempool {
  int dummy;
};

/* Variables and functions */
int rte_mempool_sc_get(struct rte_mempool *, void **);
int rte_mempool_get(struct rte_mempool *mp, void **obj_p) {
  return (rte_mempool_sc_get(mp, obj_p));
}


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

x86 assembly (clang, -O2):
<rte_mempool_get>:
jmp    1030 <rte_mempool_sc_get@plt>

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

LLVM IR (-O2):
%struct.rte_mempool = type { i32 }
define i32 @rte_mempool_get(%struct.rte_mempool* %0, i8** %1) {
%3 = tail call i32 @rte_mempool_sc_get(%struct.rte_mempool* %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ d_openmpt_module_destroy(void *);
scalar_t__ load_dll();
void openmpt_module_destroy(void *mod) {
  if (load_dll())
    d_openmpt_module_destroy(mod);
}


x86 assembly (clang, -O0):
<openmpt_module_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <load_dll@plt>
cmp    $0x0,%rax
je     1146 <openmpt_module_destroy+0x26>
mov    -0x8(%rbp),%rdi
call   1040 <d_openmpt_module_destroy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openmpt_module_destroy>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <load_dll@plt>
test   %rax,%rax
je     1139 <openmpt_module_destroy+0x19>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <d_openmpt_module_destroy@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @openmpt_module_destroy(i8* %0) {
%2 = tail call i64 (...) @load_dll()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @d_openmpt_module_destroy(i8* %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ read(int, char *, int);
int autosar_fgetc(FILE *file) {
  char c;
  int fd;
  fd = fileno(file);
  read(fd, &c, 1);
  return c;
}


x86 assembly (clang, -O0):
<autosar_fgetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fileno@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<autosar_fgetc>:
push   %rax
call   1040 <fileno@plt>
lea    0x7(%rsp),%rsi
mov    %eax,%edi
mov    $0x1,%edx
call   1030 <read@plt>
movsbl 0x7(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @autosar_fgetc(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @fileno(i32* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @read(i32 %7, i8* %3, i32 1)
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @autosar_fgetc(i32* nocapture %0) {
%2 = alloca i8
%3 = tail call i32 @fileno(i32* %0)
%4 = call i32 @read(i32 %3, i8* %2, i32 1)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
ret i32 %6
}
/* Variables and functions */
char *curl_maprintf(char *, char const *, int);
char *create_hostcache_id(const char *server, int port) {
  return curl_maprintf("%s:%d", server, port);
}


x86 assembly (clang, -O0):
<create_hostcache_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rdi
call   1030 <curl_maprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_hostcache_id>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <curl_maprintf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s:%d\00"
define i8* @create_hostcache_id(i8* %0, i32 %1) {
%3 = tail call i8* @curl_maprintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf(
      "\n smbw_sample - a sample program that uses smbw\n \n smbw_sample "
      "<options> path\n \n   options:\n      -W workgroup\n      -l logfile\n  "
      "    -P prefix\n      -d debuglevel\n      -U username%%password\n      "
      "-R resolve order\n \n note that path must start with /smb/\n ");
}


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

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

LLVM IR (-O0):
@.str = [257 x i8] c"\0A smbw_sample - a sample program that uses smbw\0A \0A smbw_sample <options> path\0A \0A options:\0A -W workgroup\0A -l logfile\0A -P prefix\0A -d debuglevel\0A -U username%%password\0A -R resolve order\0A \0A note that path must start with /smb/\0A \00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([257 x i8], [257 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [257 x i8] c"\0A smbw_sample - a sample program that uses smbw\0A \0A smbw_sample <options> path\0A \0A options:\0A -W workgroup\0A -l logfile\0A -P prefix\0A -d debuglevel\0A -U username%%password\0A -R resolve order\0A \0A note that path must start with /smb/\0A \00"
define void @usage() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([257 x i8], [257 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ BUF_MEM;

/* Variables and functions */
int /*<<< orphan*/ BUF_MEM_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ BUF_MEM_grow(int /*<<< orphan*/ *, size_t);
int /*<<< orphan*/ *BUF_MEM_new();
BUF_MEM *BUF_MEM_create(size_t len) {
  BUF_MEM *out = BUF_MEM_new();
  if (!out)
    return NULL;
  if (!BUF_MEM_grow(out, len)) {
    BUF_MEM_free(out);
    return NULL;
  }
  return out;
}


x86 assembly (clang, -O0):
<BUF_MEM_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <BUF_MEM_new@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115f <BUF_MEM_create+0x2f>
movq   $0x0,-0x8(%rbp)
jmp    1193 <BUF_MEM_create+0x63>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <BUF_MEM_grow@plt>
cmp    $0x0,%eax
jne    118b <BUF_MEM_create+0x5b>
mov    -0x18(%rbp),%rdi
call   1050 <BUF_MEM_free@plt>
movq   $0x0,-0x8(%rbp)
jmp    1193 <BUF_MEM_create+0x63>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BUF_MEM_create>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <BUF_MEM_new@plt>
test   %rax,%rax
je     115d <BUF_MEM_create+0x2d>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <BUF_MEM_grow@plt>
test   %eax,%eax
jne    115f <BUF_MEM_create+0x2f>
mov    %rbx,%rdi
call   1050 <BUF_MEM_free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32* @BUF_MEM_create(i64 %0) {
%2 = tail call i32* (...) @BUF_MEM_new()
%3 = icmp eq i32* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @BUF_MEM_grow(i32* %2, i64 %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @BUF_MEM_free(i32* %2)
br label %9
9: ; preds = %4, %1, %7
%10 = phi i32* [ null, %7 ], [ null, %1 ], [ %2, %4 ]
ret i32* %10
}
int copy(char to[], char from[]) {
  int i;
  for (i = 0; from[i] != '\0'; i++) {
    to[i] = from[i];
  }
  if (from[i] != '\0') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <copy+0x4c>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <copy+0x13>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     116d <copy+0x6d>
movl   $0x1,-0x4(%rbp)
jmp    1174 <copy+0x74>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
mov    (%rsi),%al
test   %al,%al
je     1120 <copy+0x20>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %al,(%rdi,%rcx,1)
movzbl 0x1(%rsi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <copy+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @copy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret i32 0
}
/* Type definitions */
struct CoSimComm {
  int dummy;
};

/* Variables and functions */
int atoi(char *);
scalar_t__ readMessage(char *, struct CoSimComm *, int /*<<< orphan*/);
int getAccept(struct CoSimComm *comm) {
  char str[64 + 1];
  return readMessage(str, comm, 0) < 0 ? -1 : (atoi(str) == 1 ? 1 : -1);
}


x86 assembly (clang, -O0):
<getAccept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rsi
xor    %edx,%edx
call   1030 <readMessage@plt>
cmp    $0x0,%rax
jge    1152 <getAccept+0x32>
mov    $0xffffffff,%eax
mov    %eax,-0x54(%rbp)
jmp    1170 <getAccept+0x50>
lea    -0x50(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,%edx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAccept>:
sub    $0x48,%rsp
mov    %rdi,%rsi
mov    %rsp,%rdi
xor    %edx,%edx
call   1030 <readMessage@plt>
test   %rax,%rax
js     1151 <getAccept+0x31>
mov    %rsp,%rdi
call   1040 <atoi@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
lea    (%rcx,%rcx,1),%eax
add    $0xffffffff,%eax
add    $0x48,%rsp
ret
mov    $0xffffffff,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
%struct.CoSimComm = type { i32 }
define i32 @getAccept(%struct.CoSimComm* %0) {
%2 = alloca %struct.CoSimComm*
%3 = alloca [65 x i8]
store %struct.CoSimComm* %0, %struct.CoSimComm** %2
%4 = getelementptr inbounds [65 x i8], [65 x i8]* %3, i64 0, i64 0
%5 = load %struct.CoSimComm*, %struct.CoSimComm** %2
%6 = call i64 @readMessage(i8* %4, %struct.CoSimComm* %5, i32 0)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %15
9: ; preds = %1
%10 = getelementptr inbounds [65 x i8], [65 x i8]* %3, i64 0, i64 0
%11 = call i32 @atoi(i8* %10)
%12 = icmp eq i32 %11, 1
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 -1
br label %15
15: ; preds = %9, %8
%16 = phi i32 [ -1, %8 ], [ %14, %9 ]
ret i32 %16
}

LLVM IR (-O2):
%struct.CoSimComm = type { i32 }
define i32 @getAccept(%struct.CoSimComm* %0) {
%2 = alloca [65 x i8]
%3 = getelementptr inbounds [65 x i8], [65 x i8]* %2, i64 0, i64 0
%4 = call i64 @readMessage(i8* %3, %struct.CoSimComm* %0, i32 0)
%5 = icmp slt i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = call i32 @atoi(i8* %3)
%8 = icmp eq i32 %7, 1
%9 = select i1 %8, i32 1, i32 -1
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ -1, %1 ]
ret i32 %11
}
long long Integer_0_toInteger_2_Integer(long long value) { return value; }


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

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

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

LLVM IR (-O2):
define i64 @Integer_0_toInteger_2_Integer(i64 returned %0) {
ret i64 %0
}
int mod(int n, int m) {
  while (n < 0)
    n += m;
  return n % m;
}


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1122 <mod+0x22>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110a <mod+0xa>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
mov    %edi,%eax
sub    %esi,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    %esi,%eax
js     1110 <mod+0x10>
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @mod(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %6, %3 ]
%5 = icmp slt i32 %4, 0
%6 = add nsw i32 %4, %1
br i1 %5, label %3, label %7
7: ; preds = %3
%8 = srem i32 %4, %1
ret i32 %8
}
/* Type definitions */
struct t_arraylist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(void *);
void calc_list_free_cb(void *data, struct t_arraylist *arraylist,
                       void *pointer) {
  (void)data;
  (void)arraylist;
  free(pointer);
}


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

x86 assembly (clang, -O2):
<calc_list_free_cb>:
mov    %rdx,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.t_arraylist = type { i32 }
define void @calc_list_free_cb(i8* %0, %struct.t_arraylist* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca %struct.t_arraylist*
%6 = alloca i8*
store i8* %0, i8** %4
store %struct.t_arraylist* %1, %struct.t_arraylist** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load %struct.t_arraylist*, %struct.t_arraylist** %5
%9 = load i8*, i8** %6
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
%struct.t_arraylist = type { i32 }
define void @calc_list_free_cb(i8* nocapture readnone %0, %struct.t_arraylist* nocapture readnone %1, i8* nocapture %2) {
%4 = tail call i32 @free(i8* %2)
ret void
}
void dummy(void *a) {}


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

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

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

LLVM IR (-O2):
define void @dummy(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doGPS();
int app_main(void) {
  doGPS();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @app_main() {
%1 = call i32 (...) @doGPS()
ret i32 0
}

LLVM IR (-O2):
define i32 @app_main() {
%1 = tail call i32 (...) @doGPS()
ret i32 0
}
/* Type definitions */
struct snd_ac97 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ snd_ac97_update_bits(struct snd_ac97 *, int, int, int);
int patch_alc203(struct snd_ac97 *ac97) {
  snd_ac97_update_bits(ac97, 0x7a, 0x400, 0x400);
  return 0;
}


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

x86 assembly (clang, -O2):
<patch_alc203>:
push   %rax
mov    $0x7a,%esi
mov    $0x400,%edx
mov    $0x400,%ecx
call   1030 <snd_ac97_update_bits@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.snd_ac97 = type { i32 }
define i32 @patch_alc203(%struct.snd_ac97* %0) {
%2 = alloca %struct.snd_ac97*
store %struct.snd_ac97* %0, %struct.snd_ac97** %2
%3 = load %struct.snd_ac97*, %struct.snd_ac97** %2
%4 = call i32 @snd_ac97_update_bits(%struct.snd_ac97* %3, i32 122, i32 1024, i32 1024)
ret i32 0
}

LLVM IR (-O2):
%struct.snd_ac97 = type { i32 }
define i32 @patch_alc203(%struct.snd_ac97* %0) {
%2 = tail call i32 @snd_ac97_update_bits(%struct.snd_ac97* %0, i32 122, i32 1024, i32 1024)
ret i32 0
}
/* Type definitions */
struct df_t {
  int dummy;
};

/* Variables and functions */
char next_char(struct df_t *);
void read_groupname(struct df_t *D) {
  char c = '[';
  while (c != ']') {
    c = next_char(D);
  }
}


x86 assembly (clang, -O0):
<read_groupname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x5b,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x5d,%eax
je     113e <read_groupname+0x2e>
mov    -0x8(%rbp),%rdi
call   1030 <next_char@plt>
mov    %al,-0x9(%rbp)
jmp    1120 <read_groupname+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_groupname>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <next_char@plt>
cmp    $0x5d,%al
jne    1120 <read_groupname+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.df_t = type { i32 }
define void @read_groupname(%struct.df_t* %0) {
%2 = alloca %struct.df_t*
%3 = alloca i8
store %struct.df_t* %0, %struct.df_t** %2
store i8 91, i8* %3
br label %4
4: ; preds = %8, %1
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 93
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load %struct.df_t*, %struct.df_t** %2
%10 = call signext i8 @next_char(%struct.df_t* %9)
store i8 %10, i8* %3
br label %4
11: ; preds = %4
ret void
}

LLVM IR (-O2):
%struct.df_t = type { i32 }
define void @read_groupname(%struct.df_t* %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call signext i8 @next_char(%struct.df_t* %0)
%4 = icmp eq i8 %3, 93
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}