xunge/DecIR huggingface dataset:
/* Type definitions */
struct cstring {
  int dummy;
};

/* Variables and functions */
struct cstring *remove_line();
int /*<<< orphan*/ save_line_to_file(struct cstring *);
void dump_rest_of_file() {
  struct cstring *line;
  while ((line = remove_line()) != NULL)
    save_line_to_file(line);
}


x86 assembly (clang, -O0):
<dump_rest_of_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <remove_line@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     114b <dump_rest_of_file+0x2b>
mov    -0x8(%rbp),%rdi
call   1040 <save_line_to_file@plt>
jmp    1128 <dump_rest_of_file+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_rest_of_file>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <remove_line@plt>
test   %rax,%rax
je     1146 <dump_rest_of_file+0x26>
mov    %rax,%rdi
call   1040 <save_line_to_file@plt>
jmp    1130 <dump_rest_of_file+0x10>
pop    %rax
ret

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

LLVM IR (-O2):
%struct.cstring = type { i32 }
define void @dump_rest_of_file() {
%1 = tail call %struct.cstring* (...) @remove_line()
%2 = icmp eq %struct.cstring* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi %struct.cstring* [ %6, %3 ], [ %1, %0 ]
%5 = tail call i32 @save_line_to_file(%struct.cstring* %4)
%6 = tail call %struct.cstring* (...) @remove_line()
%7 = icmp eq %struct.cstring* %6, null
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret void
}
void time_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @time_deinit() {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
unsigned int strlen(char const *);
int xz_filename_p(const char *name) {
  unsigned len = strlen(name);
  return (sizeof("") > 1) && (len > sizeof("") - 1) &&
         (strcmp(name + len - (sizeof("") - 1), "") == 0);
}


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

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

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

LLVM IR (-O2):
define i32 @xz_filename_p(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ nrf_802154_swi_timeslot_exit();
void nrf_802154_priority_drop_timeslot_exit(void) {
  nrf_802154_swi_timeslot_exit();
}


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

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

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

LLVM IR (-O2):
define void @nrf_802154_priority_drop_timeslot_exit() {
%1 = tail call i32 (...) @nrf_802154_swi_timeslot_exit()
ret void
}
/* Variables and functions */
int xcmd_simple(char *, int);
int xcmd_simple_led_off(char *buffer) { return xcmd_simple(buffer, 2); }


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

x86 assembly (clang, -O2):
<xcmd_simple_led_off>:
mov    $0x2,%esi
jmp    1030 <xcmd_simple@plt>

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

LLVM IR (-O2):
define i32 @xcmd_simple_led_off(i8* %0) {
%2 = tail call i32 @xcmd_simple(i8* %0, i32 2)
ret i32 %2
}
int main(int argc, char **argv) {
  if (*argv)
    argv++;
  argv++;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     112c <main+0x2c>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i32 1
store i8** %11, i8*** %5
br label %12
12: ; preds = %9, %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i32 1
store i8** %14, i8*** %5
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ schedule_timeout_uninterruptible(long);
void delay(long ticks) { schedule_timeout_uninterruptible(ticks); }


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

x86 assembly (clang, -O2):
<delay>:
jmp    1030 <schedule_timeout_uninterruptible@plt>

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

LLVM IR (-O2):
define void @delay(i64 %0) {
%2 = tail call i32 @schedule_timeout_uninterruptible(i64 %0)
ret void
}
/* Variables and functions */
float fabs(float);
float _lon_dist(float a, float b) {
  float d1 = fabs(a - b);
  float d2 = 360.f - d1;
  return (d1 < d2) ? d1 : d2;
}


x86 assembly (clang, -O0):
<_lon_dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
movss  %xmm0,-0xc(%rbp)
movss  0xec2(%rip),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    116a <_lon_dist+0x5a>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1174 <_lon_dist+0x64>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_lon_dist>:
subss  %xmm1,%xmm0
andps  0xef5(%rip),%xmm0
movss  0xefd(%rip),%xmm1
subss  %xmm0,%xmm1
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @_lon_dist(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* %3
%8 = load float, float* %4
%9 = fsub float %7, %8
%10 = call float @fabs(float %9)
store float %10, float* %5
%11 = load float, float* %5
%12 = fsub float 3.600000e+02, %11
store float %12, float* %6
%13 = load float, float* %5
%14 = load float, float* %6
%15 = fcmp olt float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = load float, float* %5
br label %20
18: ; preds = %2
%19 = load float, float* %6
br label %20
20: ; preds = %18, %16
%21 = phi float [ %17, %16 ], [ %19, %18 ]
ret float %21
}

LLVM IR (-O2):
define float @_lon_dist(float %0, float %1) {
%3 = fsub float %0, %1
%4 = tail call float @llvm.fabs.f32(float %3)
%5 = fsub float 3.600000e+02, %4
%6 = fcmp olt float %4, %5
%7 = select i1 %6, float %4, float %5
ret float %7
}
void meminfo_log_mallinfo() {}


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

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

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

LLVM IR (-O2):
define void @meminfo_log_mallinfo() {
ret void
}
/* Variables and functions */
int putch(int);
int putchp(int c) {
  switch (c) {
  case 0:
    c = ' ';
    break;
  default:
    if (c < ' ')
      c = '.';
  }
  return putch(c);
}


x86 assembly (clang, -O0):
<putchp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
test   %eax,%eax
jne    1137 <putchp+0x27>
jmp    112b <putchp+0x1b>
movl   $0x20,-0x4(%rbp)
jmp    114d <putchp+0x3d>
cmpl   $0x20,-0x4(%rbp)
jge    1148 <putchp+0x38>
movl   $0x2e,-0x4(%rbp)
jmp    114d <putchp+0x3d>
mov    -0x4(%rbp),%edi
call   1030 <putch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchp>:
cmp    $0x20,%edi
mov    $0x2e,%eax
cmovge %edi,%eax
test   %edi,%edi
mov    $0x20,%edi
cmovne %eax,%edi
jmp    1030 <putch@plt>

LLVM IR (-O0):
define i32 @putchp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %5 [
i32 0, label %4
]
4: ; preds = %1
store i32 32, i32* %2
br label %10
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 32
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 46, i32* %2
br label %9
9: ; preds = %8, %5
br label %10
10: ; preds = %9, %4
%11 = load i32, i32* %2
%12 = call i32 @putch(i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @putchp(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = icmp slt i32 %0, 32
%4 = select i1 %3, i32 46, i32 %0
%5 = select i1 %2, i32 32, i32 %4
%6 = tail call i32 @putch(i32 %5)
ret i32 %6
}
void _set_actv(unsigned char *u) { u[2] |= (1 << 7); }


x86 assembly (clang, -O0):
<_set_actv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%ecx
or     $0x80,%ecx
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_set_actv>:
orb    $0x80,0x2(%rdi)
ret

LLVM IR (-O0):
define void @_set_actv(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 2
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = or i32 %6, 128
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
ret void
}

LLVM IR (-O2):
define void @_set_actv(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = load i8, i8* %2
%4 = or i8 %3, -128
store i8 %4, i8* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *rc_version_string();
int main() {
  printf("%s\n", rc_version_string());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @rc_version_string()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
int generic_pop_i(int a) { return __builtin_popcount(a); }


x86 assembly (clang, -O0):
<generic_pop_i>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    %ecx,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%ecx
mov    %ecx,%eax
and    $0x33333333,%eax
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<generic_pop_i>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
ret

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

LLVM IR (-O2):
define i32 @generic_pop_i(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long serial;
};
struct TYPE_4__ {
  TYPE_1__ xconfigure;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xconfigure_serial(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xconfigure.serial = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xconfigure_serial>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xconfigure_serial(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ _write_decimal(int);
void _write_decimal_1(uint8_t value) {
  uint8_t decimal_1 = (value % 10) / 1;
  _write_decimal(decimal_1);
}


x86 assembly (clang, -O0):
<_write_decimal_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <_write_decimal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write_decimal_1>:
movslq %edi,%rdi
imul   $0x66666667,%rdi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%edi
jmp    1030 <_write_decimal@plt>

LLVM IR (-O0):
define void @_write_decimal_1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 10
%6 = sdiv i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @_write_decimal(i32 %7)
ret void
}

LLVM IR (-O2):
define void @_write_decimal_1(i32 %0) {
%2 = srem i32 %0, 10
%3 = tail call i32 @_write_decimal(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t *s291_get_udw(const uint16_t *p_s291) {
  return (uint16_t *)&p_s291[6];
}


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

x86 assembly (clang, -O2):
<s291_get_udw>:
lea    0x18(%rdi),%rax
ret

LLVM IR (-O0):
define i32* @s291_get_udw(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 6
ret i32* %4
}

LLVM IR (-O2):
define i32* @s291_get_udw(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 6
ret i32* %2
}
/* Variables and functions */
scalar_t__ toupper(int);
char *airToUpper(char *str) {
  char *c;
  if (str) {
    c = str;
    while (*c) {
      *c = ((char)(toupper(((int)(*c)))));
      c++;
    }
  }
  return str;
}


x86 assembly (clang, -O0):
<airToUpper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1166 <airToUpper+0x56>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1161 <airToUpper+0x51>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <airToUpper+0x1f>
jmp    1166 <airToUpper+0x56>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<airToUpper>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rdi,%rdi
je     1146 <airToUpper+0x36>
mov    (%r14),%al
test   %al,%al
je     1146 <airToUpper+0x36>
lea    0x1(%r14),%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <airToUpper+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @airToUpper(i8* returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %13, %6 ], [ %4, %3 ]
%8 = phi i8* [ %12, %6 ], [ %0, %3 ]
%9 = sext i8 %7 to i32
%10 = tail call i64 @toupper(i32 %9)
%11 = trunc i64 %10 to i8
store i8 %11, i8* %8
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %3, %1
ret i8* %0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  double tv_sec;
  double tv_usec;
};
struct rusage {
  TYPE_1__ ru_utime;
};

/* Variables and functions */
int /*<<< orphan*/ RUSAGE_SELF;
int /*<<< orphan*/ getrusage(int /*<<< orphan*/, struct rusage *);
double GetTime() {
  struct rusage ru;
  getrusage(RUSAGE_SELF, &ru);
  return ru.ru_utime.tv_sec + ru.ru_utime.tv_usec / 1000000.0;
}


x86 assembly (clang, -O0):
<GetTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <getrusage@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xec4(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetTime>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <getrusage@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xecb(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { double, double }
@RUSAGE_SELF = global i32 0
define double @GetTime() {
%1 = alloca %struct.rusage
%2 = load i32, i32* @RUSAGE_SELF
%3 = call i32 @getrusage(i32 %2, %struct.rusage* %1)
%4 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i32 0, i32 0
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i32 0, i32 0
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 1
%9 = load double, double* %8
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %6, %10
ret double %11
}

LLVM IR (-O2):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { double, double }
@RUSAGE_SELF = global i32 0
define double @GetTime() {
%1 = alloca %struct.rusage
%2 = bitcast %struct.rusage* %1 to i8*
%3 = load i32, i32* @RUSAGE_SELF
%4 = call i32 @getrusage(i32 %3, %struct.rusage* %1)
%5 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0, i32 1
%8 = load double, double* %7
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %6, %9
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ SHUT_RDWR;
scalar_t__ close(int const);
scalar_t__ shutdown(int const, int /*<<< orphan*/);
int gaspi_sn_close(const int sockfd) {
  int ret = 0;
  if (shutdown(sockfd, SHUT_RDWR) != 0) {
    ret = 1;
  }
  if (close(sockfd) != 0) {
    ret = 1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<gaspi_sn_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
call   1030 <shutdown@plt>
cmp    $0x0,%rax
je     1154 <gaspi_sn_close+0x34>
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
cmp    $0x0,%rax
je     116d <gaspi_sn_close+0x4d>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gaspi_sn_close>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
call   1030 <shutdown@plt>
mov    %rax,%r14
mov    %ebx,%edi
call   1040 <close@plt>
xor    %ecx,%ecx
or     %r14,%rax
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SHUT_RDWR = global i32 0
define i32 @gaspi_sn_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SHUT_RDWR
%6 = call i64 @shutdown(i32 %4, i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %3
br label %9
9: ; preds = %8, %1
%10 = load i32, i32* %2
%11 = call i64 @close(i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 1, i32* %3
br label %14
14: ; preds = %13, %9
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@SHUT_RDWR = global i32 0
define i32 @gaspi_sn_close(i32 %0) {
%2 = load i32, i32* @SHUT_RDWR
%3 = tail call i64 @shutdown(i32 %0, i32 %2)
%4 = icmp ne i64 %3, 0
%5 = tail call i64 @close(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = select i1 %6, i1 true, i1 %4
%8 = zext i1 %7 to i32
ret i32 %8
}
int g2() {
  static const int i = 3;
  return i;
}


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

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

LLVM IR (-O0):
@g2.i = internal constant i32 3
define i32 @g2() {
ret i32 3
}

LLVM IR (-O2):
define i32 @g2() {
ret i32 3
}
void ff_hevc_put_hevc_qpel_hv12_8_sse4() {}


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

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

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

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

/* Variables and functions */
int dtls_int_to_uint16(unsigned char *field, uint16_t value) {
  field[0] = (value >> 8) & 0xff;
  field[1] = value & 0xff;
  return 2;
}


x86 assembly (clang, -O0):
<dtls_int_to_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtls_int_to_uint16>:
rol    $0x8,%si
mov    %si,(%rdi)
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @dtls_int_to_uint16(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 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
ret i32 2
}

LLVM IR (-O2):
define i32 @dtls_int_to_uint16(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = trunc i32 %1 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret i32 2
}
int main() {
  int x;
  char y[10];
  printf("x: %x\n", &x);
  printf("y: %x\n", &y);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    0xe(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"x: %x\0A\00"
@.str.1 = [7 x i8] c"y: %x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), [10 x i8]* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: add-host6 [-c] host IPv6\n");
  fprintf(stderr, "with -c option add comment about IPv6 address\n");
  _exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee2(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"usage: add-host6 [-c] host IPv6\0A\00"
@.str.1 = [47 x i8] c"with -c option add comment about IPv6 address\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"usage: add-host6 [-c] host IPv6\0A\00"
@.str.1 = [47 x i8] c"with -c option add comment about IPv6 address\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @_exit(i32 1)
unreachable
}
int main(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int testLib3Imp();
int testLib3(void) { return testLib3Imp(); }


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

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

LLVM IR (-O0):
define i32 @testLib3() {
%1 = call i32 (...) @testLib3Imp()
ret i32 %1
}

LLVM IR (-O2):
define i32 @testLib3() {
%1 = tail call i32 (...) @testLib3Imp()
ret i32 %1
}
int is_https_client_hello(const char *payload) {
  if (payload[0] == 0x16) {
    if (payload[1] == 0x03) {
      if (payload[5] == 0x01) {
        if (payload[9] == 0x03) {
          return 1;
        }
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_https_client_hello>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x16,%eax
jne    1166 <is_https_client_hello+0x66>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x3,%eax
jne    1161 <is_https_client_hello+0x61>
mov    -0x10(%rbp),%rax
movsbl 0x5(%rax),%eax
cmp    $0x1,%eax
jne    115c <is_https_client_hello+0x5c>
mov    -0x10(%rbp),%rax
movsbl 0x9(%rax),%eax
cmp    $0x3,%eax
jne    1157 <is_https_client_hello+0x57>
movl   $0x1,-0x4(%rbp)
jmp    116d <is_https_client_hello+0x6d>
jmp    115c <is_https_client_hello+0x5c>
jmp    1161 <is_https_client_hello+0x61>
jmp    1166 <is_https_client_hello+0x66>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_https_client_hello>:
cmpb   $0x16,(%rdi)
jne    111c <is_https_client_hello+0x1c>
cmpb   $0x3,0x1(%rdi)
jne    111c <is_https_client_hello+0x1c>
cmpb   $0x1,0x5(%rdi)
jne    111c <is_https_client_hello+0x1c>
mov    $0x1,%eax
cmpb   $0x3,0x9(%rdi)
je     111e <is_https_client_hello+0x1e>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_https_client_hello(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 22
br i1 %3, label %4, label %16
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 3
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 5
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 1
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %0, i64 9
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 3
br i1 %15, label %17, label %16
16: ; preds = %4, %12, %8, %1
br label %17
17: ; preds = %12, %16
%18 = phi i32 [ 0, %16 ], [ 1, %12 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ test1(int);
int /*<<< orphan*/ test2(int);
int /*<<< orphan*/ test3(int);
int /*<<< orphan*/ test4(int);
int /*<<< orphan*/ test5(int);
int main(int argc, char *argv[]) {
  int denom = 10;
  test1(denom);
  test2(denom);
  test3(denom);
  test4(denom);
  test5(denom);
  printf("A long double on this machine requires %d bytes\n",
         sizeof(long double));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <test1@plt>
mov    -0x14(%rbp),%edi
call   1080 <test2@plt>
mov    -0x14(%rbp),%edi
call   1040 <test3@plt>
mov    -0x14(%rbp),%edi
call   1070 <test4@plt>
mov    -0x14(%rbp),%edi
call   1030 <test5@plt>
lea    0xe54(%rip),%rdi
mov    $0x10,%esi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1050 <test1@plt>
mov    $0xa,%edi
call   1080 <test2@plt>
mov    $0xa,%edi
call   1040 <test3@plt>
mov    $0xa,%edi
call   1070 <test4@plt>
mov    $0xa,%edi
call   1030 <test5@plt>
lea    0xe66(%rip),%rdi
mov    $0x10,%esi
call   1060 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"A long double on this machine requires %d bytes\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @test1(i32 %7)
%9 = load i32, i32* %6
%10 = call i32 @test2(i32 %9)
%11 = load i32, i32* %6
%12 = call i32 @test3(i32 %11)
%13 = load i32, i32* %6
%14 = call i32 @test4(i32 %13)
%15 = load i32, i32* %6
%16 = call i32 @test5(i32 %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 16)
ret i32 0
}

LLVM IR (-O2):
@.str = [49 x i8] c"A long double on this machine requires %d bytes\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test1(i32 10)
%4 = tail call i32 @test2(i32 10)
%5 = tail call i32 @test3(i32 10)
%6 = tail call i32 @test4(i32 10)
%7 = tail call i32 @test5(i32 10)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 16)
ret i32 0
}
/* Variables and functions */
double inch_math(double input, bool inch) {
  if (inch)
    return input * 25.4;
  else
    return input;
}


x86 assembly (clang, -O0):
<inch_math>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     112d <inch_math+0x2d>
movsd  0xee2(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <inch_math+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<inch_math>:
test   %edi,%edi
je     110c <inch_math+0xc>
mulsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @inch_math(double %0, i32 %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load double, double* %4
%10 = fmul double %9, 2.540000e+01
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %4
store double %12, double* %3
br label %13
13: ; preds = %11, %8
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @inch_math(double %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = fmul double %0, 2.540000e+01
%5 = select i1 %3, double %0, double %4
ret double %5
}
/* Variables and functions */
float atan(float);
float tan(float);
float CalcFov(float fov_x, float width, float height) {
  return (float)((int)((atan(height / (width / tan(fov_x / 360 *
                                                   3.14159265358979323846f)))) *
                       57.2957795130823209071f)) *
         2;
}


x86 assembly (clang, -O0):
<CalcFov>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeb4(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xea4(%rip),%xmm1
mulss  %xmm1,%xmm0
call   1040 <tan@plt>
movss  -0x14(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x10(%rbp),%xmm0
divss  %xmm2,%xmm1
divss  %xmm1,%xmm0
call   1030 <atan@plt>
movss  0xe75(%rip),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
cvtsi2ss %eax,%xmm0
movss  0xe5d(%rip),%xmm1
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcFov>:
push   %rax
movss  %xmm2,0x4(%rsp)
movss  %xmm1,(%rsp)
divss  0xecc(%rip),%xmm0
mulss  0xec8(%rip),%xmm0
call   1040 <tan@plt>
movss  (%rsp),%xmm1
divss  %xmm0,%xmm1
movss  0x4(%rsp),%xmm0
divss  %xmm1,%xmm0
call   1030 <atan@plt>
mulss  0xea7(%rip),%xmm0
cvttps2dq %xmm0,%xmm0
cvtdq2ps %xmm0,%xmm0
addss  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @CalcFov(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load float, float* %5
%9 = load float, float* %4
%10 = fdiv float %9, 3.600000e+02
%11 = fmul float %10, 0x400921FB60000000
%12 = call float @tan(float %11)
%13 = fdiv float %8, %12
%14 = fdiv float %7, %13
%15 = call float @atan(float %14)
%16 = fmul float %15, 0x404CA5DC20000000
%17 = fptosi float %16 to i32
%18 = sitofp i32 %17 to float
%19 = fmul float %18, 2.000000e+00
ret float %19
}

LLVM IR (-O2):
define float @CalcFov(float %0, float %1, float %2) {
%4 = fdiv float %0, 3.600000e+02
%5 = fmul float %4, 0x400921FB60000000
%6 = tail call float @tan(float %5)
%7 = fdiv float %1, %6
%8 = fdiv float %2, %7
%9 = tail call float @atan(float %8)
%10 = fmul float %9, 0x404CA5DC20000000
%11 = fptosi float %10 to i32
%12 = sitofp i32 %11 to float
%13 = fmul float %12, 2.000000e+00
ret float %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int func2(int i) {
  printf("func2!\n");
  return -1 * i;
}


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

x86 assembly (clang, -O2):
<func2>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
neg    %ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [7 x i8] c"func2!\00"
define i32 @func2(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%3 = sub nsw i32 0, %0
ret i32 %3
}
/* Variables and functions */
int write(int, void *, size_t);
int __fwrite(void *ptr, size_t nmemb, int fd) { return write(fd, ptr, nmemb); }


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

x86 assembly (clang, -O2):
<__fwrite>:
mov    %edx,%eax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %eax,%edi
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @__fwrite(i8* nocapture %0, i64 %1, i32 %2) {
%4 = tail call i32 @write(i32 %2, i8* %0, i64 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cannot_execute(int);
void execute_script(int socket) {
  cannot_execute(socket);
  return;
}


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

x86 assembly (clang, -O2):
<execute_script>:
jmp    1030 <cannot_execute@plt>

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

LLVM IR (-O2):
define void @execute_script(i32 %0) {
%2 = tail call i32 @cannot_execute(i32 %0)
ret void
}
/* Variables and functions */
int foo(int, int);
int main() { return foo(5, 6); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%edi
mov    $0x6,%esi
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 5, i32 6)
ret i32 %1
}
void quantify2quantifier_possessive() {}


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

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

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

LLVM IR (-O2):
define void @quantify2quantifier_possessive() {
ret void
}
/* Variables and functions */
int Cnd_Worn();
int Cnd_NotWorn(void) { return (1 - Cnd_Worn()); }


x86 assembly (clang, -O0):
<Cnd_NotWorn>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Cnd_Worn@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cnd_NotWorn>:
push   %rax
xor    %eax,%eax
call   1030 <Cnd_Worn@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Cnd_NotWorn() {
%1 = call i32 (...) @Cnd_Worn()
%2 = sub nsw i32 1, %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @Cnd_NotWorn() {
%1 = tail call i32 (...) @Cnd_Worn()
%2 = sub nsw i32 1, %1
ret i32 %2
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  while (x > 1) {
    int old_x = x;
    x = __VERIFIER_nondet_int();
    if (x < 2 * old_x) {
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    115e <main+0x4e>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    1159 <main+0x49>
jmp    115e <main+0x4e>
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
nopw   0x0(%rax,%rax,1)
cmp    $0x2,%ebx
jl     1134 <main+0x24>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
add    %ebx,%ebx
cmp    %ebx,%eax
mov    %eax,%ebx
jge    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
br label %2
2: ; preds = %5, %0
%3 = phi i32 [ %1, %0 ], [ %6, %5 ]
%4 = icmp sgt i32 %3, 1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 (...) @__VERIFIER_nondet_int()
%7 = shl nuw nsw i32 %3, 1
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %2
9: ; preds = %5, %2
ret i32 0
}
/* Variables and functions */
int __fillcontextx2(char *ctx) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @__fillcontextx2(i8* nocapture readnone %0) {
ret i32 0
}
void led_on(void) { (*((volatile unsigned long *)0x400253FC)) |= 0x01; }


x86 assembly (clang, -O0):
<led_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400253fc,%eax
mov    (%rax),%rcx
or     $0x1,%rcx
mov    $0x400253fc,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_on>:
orq    $0x1,0x400253fc
40 01
ret

LLVM IR (-O0):
define void @led_on() {
%1 = load volatile i64, i64* inttoptr (i64 1073894396 to i64*)
%2 = or i64 %1, 1
store volatile i64 %2, i64* inttoptr (i64 1073894396 to i64*)
ret void
}

LLVM IR (-O2):
define void @led_on() {
%1 = load volatile i64, i64* inttoptr (i64 1073894396 to i64*)
%2 = or i64 %1, 1
store volatile i64 %2, i64* inttoptr (i64 1073894396 to i64*)
ret void
}