xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushcomplex4array_(char *x, unsigned int *n) { pushNarray(x, (*n * 4)); }


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

x86 assembly (clang, -O2):
<pushcomplex4array_>:
mov    (%rsi),%esi
shl    $0x2,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushcomplex4array_(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 = load i32, i32* %6
%8 = mul i32 %7, 4
%9 = call i32 @pushNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @pushcomplex4array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 2
%5 = tail call i32 @pushNarray(i8* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ very_long_function(int);
int blah() { very_long_function(1); }


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

x86 assembly (clang, -O2):
<blah>:
mov    $0x1,%edi
jmp    1030 <very_long_function@plt>

LLVM IR (-O0):
define i32 @blah() {
%1 = alloca i32
%2 = call i32 @very_long_function(i32 1)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @blah() {
%1 = tail call i32 @very_long_function(i32 1)
ret i32 undef
}
void Cyc_BansheeIf_add_variable(void *cvar) { ; }


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

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

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

LLVM IR (-O2):
define void @Cyc_BansheeIf_add_variable(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void shopar() {
  printf("Show what?  (Type \"show ?\" for a list of possibilities.)\n");
}


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

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

LLVM IR (-O0):
@.str = [58 x i8] c"Show what? (Type \22show ?\22 for a list of possibilities.)\0A\00"
define void @shopar() {
%1 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [57 x i8] c"Show what? (Type \22show ?\22 for a list of possibilities.)\00"
define void @shopar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
ret void
}
void ff_hevc_put_hevc_bi_epel_hv6_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_hv6_10_sse4() {
ret void
}
int diskGetUsbDriveId(int driveId, int driveNo) {
  return 2 + 8 * driveId + driveNo;
}


x86 assembly (clang, -O0):
<diskGetUsbDriveId>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
add    $0x2,%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<diskGetUsbDriveId>:
lea    (%rsi,%rdi,8),%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @diskGetUsbDriveId(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 = mul nsw i32 8, %5
%7 = add nsw i32 2, %6
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @diskGetUsbDriveId(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 3
%4 = or i32 %3, 2
%5 = add nsw i32 %4, %1
ret i32 %5
}
void d_fetchuw(register const unsigned char **ptr,
               register unsigned short *dest) {
  *dest = (((unsigned short)(*ptr)[0] << 8) | ((unsigned short)(*ptr)[1] << 0));
  *ptr += 2;
}


x86 assembly (clang, -O0):
<d_fetchuw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl (%rax),%eax
movzwl %ax,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
movzbl 0x1(%rcx),%ecx
movzwl %cx,%ecx
shl    $0x0,%ecx
or     %ecx,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_fetchuw>:
mov    (%rdi),%rax
movzwl (%rax),%ecx
rol    $0x8,%cx
mov    %cx,(%rsi)
add    $0x2,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @d_fetchuw(i8** %0, i16* %1) {
%3 = alloca i8**
%4 = alloca i16*
store i8** %0, i8*** %3
store i16* %1, i16** %4
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = zext i8 %8 to i16
%10 = zext i16 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8**, i8*** %3
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = zext i8 %15 to i16
%17 = zext i16 %16 to i32
%18 = shl i32 %17, 0
%19 = or i32 %11, %18
%20 = trunc i32 %19 to i16
%21 = load i16*, i16** %4
store i16 %20, i16* %21
%22 = load i8**, i8*** %3
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8, i8* %23, i64 2
store i8* %24, i8** %22
ret void
}

LLVM IR (-O2):
define void @d_fetchuw(i8** nocapture %0, i16* nocapture writeonly %1) {
%3 = load i8*, i8** %0
%4 = load i8, i8* %3
%5 = zext i8 %4 to i16
%6 = shl nuw i16 %5, 8
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i16
%10 = or i16 %6, %9
store i16 %10, i16* %1
%11 = getelementptr inbounds i8, i8* %3, i64 2
store i8* %11, i8** %0
ret void
}
/* Variables and functions */
int M_PI;
float math_degrees_to_radians(const float degrees) {
  return degrees * (M_PI / 180);
}


x86 assembly (clang, -O0):
<math_degrees_to_radians>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
mov    (%rax),%eax
mov    $0xb4,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_degrees_to_radians>:
mov    0x2ee1(%rip),%rax
movslq (%rax),%rax
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0x7,%ecx
add    %eax,%ecx
cvtsi2ss %ecx,%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global i32 0
define float @math_degrees_to_radians(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load i32, i32* @M_PI
%5 = sdiv i32 %4, 180
%6 = sitofp i32 %5 to float
%7 = fmul float %3, %6
ret float %7
}

LLVM IR (-O2):
@M_PI = global i32 0
define float @math_degrees_to_radians(float %0) {
%2 = load i32, i32* @M_PI
%3 = sdiv i32 %2, 180
%4 = sitofp i32 %3 to float
%5 = fmul float %4, %0
ret float %5
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_data_device_manager {
  int dummy;
};

/* Variables and functions */
void *wl_proxy_get_user_data(struct wl_proxy *);
void *wl_data_device_manager_get_user_data(
    struct wl_data_device_manager *wl_data_device_manager) {
  return wl_proxy_get_user_data((struct wl_proxy *)wl_data_device_manager);
}


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

x86 assembly (clang, -O2):
<wl_data_device_manager_get_user_data>:
jmp    1030 <wl_proxy_get_user_data@plt>

LLVM IR (-O0):
%struct.wl_data_device_manager = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_data_device_manager_get_user_data(%struct.wl_data_device_manager* %0) {
%2 = alloca %struct.wl_data_device_manager*
store %struct.wl_data_device_manager* %0, %struct.wl_data_device_manager** %2
%3 = load %struct.wl_data_device_manager*, %struct.wl_data_device_manager** %2
%4 = bitcast %struct.wl_data_device_manager* %3 to %struct.wl_proxy*
%5 = call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.wl_data_device_manager = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_data_device_manager_get_user_data(%struct.wl_data_device_manager* %0) {
%2 = bitcast %struct.wl_data_device_manager* %0 to %struct.wl_proxy*
%3 = tail call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %2)
ret i8* %3
}
/* Variables and functions */
unsigned long my_power_it(int, int);
int /*<<< orphan*/ my_putchar(int /*<<< orphan*/);
int /*<<< orphan*/ my_putnbr_base(unsigned long, char *);
void my_print_b_16(unsigned long vl, int nbc) {
  while (vl / (my_power_it(16, nbc)) == 0) {
    my_putchar('0');
    --nbc;
  }
  my_putnbr_base(vl, "0123456789abcdef");
}


x86 assembly (clang, -O0):
<my_print_b_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x10,%edi
call   1040 <my_power_it@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
xor    %edx,%edx
div    %rcx
cmp    $0x0,%rax
jne    1182 <my_print_b_16+0x52>
mov    $0x30,%edi
call   1050 <my_putchar@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <my_print_b_16+0xf>
mov    -0x8(%rbp),%rdi
lea    0xe73(%rip),%rsi
call   1030 <my_putnbr_base@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_print_b_16>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x10,%edi
call   1040 <my_power_it@plt>
cmp    %rbx,%rax
jbe    116e <my_print_b_16+0x3e>
add    $0xffffffff,%ebp
nopw   0x0(%rax,%rax,1)
mov    $0x30,%edi
call   1050 <my_putchar@plt>
mov    $0x10,%edi
mov    %ebp,%esi
call   1040 <my_power_it@plt>
add    $0xffffffff,%ebp
cmp    %rbx,%rax
ja     1150 <my_print_b_16+0x20>
lea    0xe8b(%rip),%rsi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <my_putnbr_base@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"0123456789abcdef\00"
define void @my_print_b_16(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %11, %2
%6 = load i64, i64* %3
%7 = load i32, i32* %4
%8 = call i64 @my_power_it(i32 16, i32 %7)
%9 = udiv i64 %6, %8
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %5
%12 = call i32 @my_putchar(i32 48)
%13 = load i32, i32* %4
%14 = add nsw i32 %13, -1
store i32 %14, i32* %4
br label %5
15: ; preds = %5
%16 = load i64, i64* %3
%17 = call i32 @my_putnbr_base(i64 %16, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"0123456789abcdef\00"
define void @my_print_b_16(i64 %0, i32 %1) {
%3 = tail call i64 @my_power_it(i32 16, i32 %1)
%4 = icmp ugt i64 %3, %0
br i1 %4, label %5, label %11
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %1, %2 ]
%7 = tail call i32 @my_putchar(i32 48)
%8 = add nsw i32 %6, -1
%9 = tail call i64 @my_power_it(i32 16, i32 %8)
%10 = icmp ugt i64 %9, %0
br i1 %10, label %5, label %11
11: ; preds = %5, %2
%12 = tail call i32 @my_putnbr_base(i64 %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct SymbolGroup {
  int dummy;
};

/* Variables and functions */
struct SymbolGroup *CreateSymbolGroup(const char *fname) {
  struct SymbolGroup *retval = NULL;
  return retval;
}


x86 assembly (clang, -O0):
<CreateSymbolGroup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.SymbolGroup = type { i32 }
define %struct.SymbolGroup* @CreateSymbolGroup(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.SymbolGroup*
store i8* %0, i8** %2
store %struct.SymbolGroup* null, %struct.SymbolGroup** %3
%4 = load %struct.SymbolGroup*, %struct.SymbolGroup** %3
ret %struct.SymbolGroup* %4
}

LLVM IR (-O2):
%struct.SymbolGroup = type { i32 }
define noalias %struct.SymbolGroup* @CreateSymbolGroup(i8* nocapture readnone %0) {
ret %struct.SymbolGroup* null
}
void vtime_task_switch(struct task_struct *prev) {}


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define void @vtime_task_switch(%struct.task_struct* %0) {
%2 = alloca %struct.task_struct*
store %struct.task_struct* %0, %struct.task_struct** %2
ret void
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @vtime_task_switch(%struct.task_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AtSayA(int, int, unsigned char, char *);
int strlen(char *);
void CenterA(int y, unsigned char attrib, char *s) {
  AtSayA((80 - strlen(s)) / 2, y, attrib, s);
}


x86 assembly (clang, -O0):
<CenterA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    $0x50,%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x4(%rbp),%esi
mov    -0x5(%rbp),%al
mov    -0x10(%rbp),%rcx
movzbl %al,%edx
call   1030 <AtSayA@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CenterA>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %edi,%ebp
mov    %rdx,%rdi
call   1040 <strlen@plt>
mov    $0x50,%ecx
sub    %eax,%ecx
mov    %ecx,%edi
shr    $0x1f,%edi
add    %ecx,%edi
sar    %edi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %rbx,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <AtSayA@plt>

LLVM IR (-O0):
define void @CenterA(i32 %0, i8 zeroext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8*
store i32 %0, i32* %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @strlen(i8* %7)
%9 = sub nsw i32 80, %8
%10 = sdiv i32 %9, 2
%11 = load i32, i32* %4
%12 = load i8, i8* %5
%13 = load i8*, i8** %6
%14 = call i32 @AtSayA(i32 %10, i32 %11, i8 zeroext %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @CenterA(i32 %0, i8 zeroext %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = sub nsw i32 80, %4
%6 = sdiv i32 %5, 2
%7 = tail call i32 @AtSayA(i32 %6, i32 %0, i8 zeroext %1, i8* %2)
ret void
}
char *copy_string(s)
char *s;
{ return strcpy(safe_malloc(strlen(s) + 1), s); }


x86 assembly (clang, -O0):
<copy_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x0,%al
call   1040 <safe_malloc@plt>
movslq %eax,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_string>:
push   %rbx
mov    %rdi,%rbx
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
xor    %eax,%eax
call   1040 <safe_malloc@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @copy_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = add i64 %4, 1
%6 = call i32 (i64, ...) bitcast (i32 (...)* @safe_malloc to i32 (i64, ...)*)(i64 %5)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = load i8*, i8** %2
%10 = call i8* @strcpy(i8* %8, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @copy_string(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @safe_malloc to i32 (i64, ...)*)(i64 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %6, i8* dereferenceable(1) %0)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ ctest1(int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x;
  ctest1(&x);
  printf("Valx=%d\n", x);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"Valx=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @ctest1(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
unsigned int qikpart(int *, unsigned int, unsigned int);
void qikcore(int *a, unsigned left, unsigned right) {
  unsigned last;
  last = qikpart(a, left, right);
  if (!last)
    return;
  qikcore(a, left, last - 1);
  qikcore(a, last + 1, right);
}


x86 assembly (clang, -O0):
<qikcore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <qikpart@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1153 <qikcore+0x33>
jmp    1177 <qikcore+0x57>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <qikcore@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <qikcore@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qikcore>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
call   1030 <qikpart@plt>
test   %eax,%eax
je     1165 <qikcore+0x45>
mov    %eax,%ebx
nopw   0x0(%rax,%rax,1)
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <qikcore@plt>
mov    %ebx,%ebp
add    $0x1,%ebp
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <qikpart@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1140 <qikcore+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @qikcore(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @qikpart(i32* %0, i32 %1, i32 %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %11, %6 ], [ %4, %3 ]
%8 = phi i32 [ %10, %6 ], [ %1, %3 ]
%9 = add i32 %7, -1
tail call void @qikcore(i32* %0, i32 %8, i32 %9)
%10 = add i32 %7, 1
%11 = tail call i32 @qikpart(i32* %0, i32 %10, i32 %2)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGKILL;
int /*<<< orphan*/ kill(int, int /*<<< orphan*/);
__attribute__((noreturn)) void libc_thread_kill(int tid) {
  kill(tid, SIGKILL);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<libc_thread_kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
jmp    112c <libc_thread_kill+0x1c>

x86 assembly (clang, -O2):
<libc_thread_kill>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
nop
jmp    1120 <libc_thread_kill+0x10>

LLVM IR (-O0):
@SIGKILL = global i32 0
define void @libc_thread_kill(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGKILL
%5 = call i32 @kill(i32 %3, i32 %4)
br label %6
6: ; preds = %1, %6
br label %6
}

LLVM IR (-O2):
@SIGKILL = global i32 0
define void @libc_thread_kill(i32 %0) {
%2 = load i32, i32* @SIGKILL
%3 = tail call i32 @kill(i32 %0, i32 %2)
br label %4
4: ; preds = %1, %4
br label %4
}
int f() {
  static int s = 0;
  s++;
  return s;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
mov    0x2f0b(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    0x2f1e(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f15(%rip)
ret

LLVM IR (-O0):
@f.s = internal global i32 0
define i32 @f() {
%1 = load i32, i32* @f.s
%2 = add nsw i32 %1, 1
store i32 %2, i32* @f.s
%3 = load i32, i32* @f.s
ret i32 %3
}

LLVM IR (-O2):
@f.s = internal unnamed_addr global i32 0
define i32 @f() {
%1 = load i32, i32* @f.s
%2 = add nsw i32 %1, 1
store i32 %2, i32* @f.s
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void error_exit() {
  fprintf(stderr, "Please set correct arguments for the counterexample.\nTry "
                  "counterexample -h for help.\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error_exit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_exit>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [86 x i8] c"Please set correct arguments for the counterexample.\0ATry counterexample -h for help.\0A\00"
@EXIT_FAILURE = global i32 0
define void @error_exit() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [86 x i8] c"Please set correct arguments for the counterexample.\0ATry counterexample -h for help.\0A\00"
@EXIT_FAILURE = global i32 0
define void @error_exit() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ msg_new;

/* Variables and functions */
int /*<<< orphan*/ OutputDebugStringA(char const *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *);
void RARCH_ERR_V(const char *tag, const char *fmt, ...) {
  char msg_new[1024];
  snprintf(msg_new, sizeof(msg_new), "RetroArch [ERR] :: %s%s", tag ? tag : "",
           fmt);
  OutputDebugStringA(fmt);
}


x86 assembly (clang, -O0):
<RARCH_ERR_V>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x418(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115c <RARCH_ERR_V+0x3c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x420(%rbp)
jmp    116f <RARCH_ERR_V+0x4f>
lea    0xeb4(%rip),%rax
mov    %rax,-0x420(%rbp)
jmp    116f <RARCH_ERR_V+0x4f>
mov    -0x418(%rbp),%rdi
mov    -0x420(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xe78(%rip),%rdx
mov    $0x400,%esi
call   1030 <snprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <OutputDebugStringA@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RARCH_ERR_V>:
push   %rbx
sub    $0x400,%rsp
mov    %rsi,%rbx
test   %rdi,%rdi
lea    0xee2(%rip),%rcx
cmovne %rdi,%rcx
lea    0xec0(%rip),%rdx
mov    %rsp,%rdi
mov    $0x400,%esi
mov    %rbx,%r8
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <OutputDebugStringA@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"RetroArch [ERR] :: %s%s\00"
@.str.1 = [1 x i8] zeroinitializer
define void @RARCH_ERR_V(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1024 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i8*, i8** %3
br label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %9
%13 = phi i8* [ %10, %9 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %11 ]
%14 = load i8*, i8** %4
%15 = call i32 @snprintf(i8* %6, i32 1024, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %14)
%16 = load i8*, i8** %4
%17 = call i32 @OutputDebugStringA(i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"RetroArch [ERR] :: %s%s\00"
@.str.1 = [1 x i8] zeroinitializer
define void @RARCH_ERR_V(i8* %0, i8* %1, ...) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = icmp eq i8* %0, null
%6 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %0
%7 = call i32 @snprintf(i8* %4, i32 1024, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %1)
%8 = call i32 @OutputDebugStringA(i8* %1)
ret void
}
/* Type definitions */
struct timeval {
  long long tv_sec;
  long long tv_usec;
};
typedef long long int64_t;

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int64_t now_ns() {
  struct timeval t;
  gettimeofday(&t, NULL);
  return t.tv_sec * 1000000000LL + t.tv_usec * 1000LL;
}


x86 assembly (clang, -O0):
<now_ns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3b9aca00,-0x10(%rbp),%rax
3b
imul   $0x3e8,-0x8(%rbp),%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now_ns>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3b9aca00,0x8(%rsp),%rcx
9a 3b
imul   $0x3e8,0x10(%rsp),%rax
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @now_ns() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = mul nsw i64 %4, 1000000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = mul nsw i64 %7, 1000
%9 = add nsw i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @now_ns() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = mul nsw i64 %8, 1000
%10 = add nsw i64 %9, %6
ret i64 %10
}
/* Variables and functions */
int ft_uporlow(int);
int ft_toupper(int c) {
  if (ft_uporlow(c) == 2)
    c -= 32;
  return (c);
}


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ft_uporlow@plt>
cmp    $0x2,%eax
jne    1135 <ft_toupper+0x25>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <ft_uporlow@plt>
lea    -0x20(%rbx),%ecx
cmp    $0x2,%eax
cmovne %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ft_toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ft_uporlow(i32 %3)
%5 = icmp eq i32 %4, 2
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 32
store i32 %8, i32* %2
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = tail call i32 @ft_uporlow(i32 %0)
%3 = icmp eq i32 %2, 2
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
char *strncpy(char *s, const char *t, int n) {
  char *os;
  os = s;
  while (n-- > 0 && (*s++ = *t++) != 0)
    ;
  return os;
}


x86 assembly (clang, -O0):
<strncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%ecx
mov    %ecx,%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x21(%rbp)
jle    115e <strncpy+0x5e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    116e <strncpy+0x6e>
jmp    1173 <strncpy+0x73>
jmp    1117 <strncpy+0x17>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
test   %edx,%edx
jle    1128 <strncpy+0x28>
add    $0xffffffff,%edx
movzbl (%rsi,%rcx,1),%edi
mov    %dil,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dil,%dil
jne    1110 <strncpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strncpy(i8* returned writeonly %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %1, %3 ], [ %11, %9 ]
%6 = phi i32 [ %2, %3 ], [ %10, %9 ]
%7 = phi i8* [ %0, %3 ], [ %13, %9 ]
%8 = icmp sgt i32 %6, 0
br i1 %8, label %9, label %15
9: ; preds = %4
%10 = add nsw i32 %6, -1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = load i8, i8* %5
%13 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %12, i8* %7
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %9
ret i8* %0
}
/* Variables and functions */
double pow(double, int);
double g0(double Rnet, double t0, double alb, double ndvi) {
  double result = Rnet * (t0 - 273.15) * (0.0038 + 0.0074 * alb) *
                  (1 - 0.98 * pow(ndvi, 4));
  return (result);
}


x86 assembly (clang, -O0):
<g0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xee2(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xebd(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xeb9(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    $0x4,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
movsd  0xe75(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe71(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g0>:
push   %rax
addsd  0xee7(%rip),%xmm1
mulsd  0xee7(%rip),%xmm2
mulsd  %xmm1,%xmm0
addsd  0xee3(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  %xmm0,(%rsp)
movapd %xmm3,%xmm0
mov    $0x4,%edi
call   1030 <pow@plt>
mulsd  0xecc(%rip),%xmm0
addsd  0xecc(%rip),%xmm0
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @g0(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%10 = load double, double* %5
%11 = load double, double* %6
%12 = fsub double %11, 2.731500e+02
%13 = fmul double %10, %12
%14 = load double, double* %7
%15 = call double @llvm.fmuladd.f64(double 7.400000e-03, double %14, double 3.800000e-03)
%16 = fmul double %13, %15
%17 = load double, double* %8
%18 = call double @pow(double %17, i32 4)
%19 = call double @llvm.fmuladd.f64(double 0xBFEF5C28F5C28F5C, double %18, double 1.000000e+00)
%20 = fmul double %16, %19
store double %20, double* %9
%21 = load double, double* %9
ret double %21
}

LLVM IR (-O2):
define double @g0(double %0, double %1, double %2, double %3) {
%5 = fadd double %1, -2.731500e+02
%6 = fmul double %5, %0
%7 = tail call double @llvm.fmuladd.f64(double %2, double 7.400000e-03, double 3.800000e-03)
%8 = fmul double %6, %7
%9 = tail call double @pow(double %3, i32 4)
%10 = tail call double @llvm.fmuladd.f64(double %9, double 0xBFEF5C28F5C28F5C, double 1.000000e+00)
%11 = fmul double %8, %10
ret double %11
}
void acc_i2c_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @acc_i2c_cleanup() {
ret void
}
int do_130() { return 130; }


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

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

LLVM IR (-O0):
define i32 @do_130() {
ret i32 130
}

LLVM IR (-O2):
define i32 @do_130() {
ret i32 130
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ perror(char *);
int openFH(char *inFile, FILE **fh, char *type) {
  if ((*fh = fopen(inFile, type)) == NULL) {
    perror("Error: Failed to open file.\n");
    exit(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<openFH>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <fopen@plt>
mov    -0x10(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    1178 <openFH+0x48>
lea    0xe97(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openFH>:
push   %rbx
mov    %rsi,%rbx
mov    %rdx,%rsi
call   1030 <fopen@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     1148 <openFH+0x18>
xor    %eax,%eax
pop    %rbx
ret
lea    0xeb1(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [29 x i8] c"Error: Failed to open file.\0A\00"
define i32 @openFH(i8* nocapture %0, i32** nocapture writeonly %1, i8* nocapture %2) {
%4 = tail call i32* @fopen(i8* %0, i8* %2)
store i32* %4, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ read_elem_db();
int /*<<< orphan*/ read_elem_skilldb();
void elem_reload(void) {
  read_elem_db();
  read_elem_skilldb();
}


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

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

LLVM IR (-O0):
define void @elem_reload() {
%1 = call i32 (...) @read_elem_db()
%2 = call i32 (...) @read_elem_skilldb()
ret void
}

LLVM IR (-O2):
define void @elem_reload() {
%1 = tail call i32 (...) @read_elem_db()
%2 = tail call i32 (...) @read_elem_skilldb()
ret void
}
__typeof__(puts()) test_puts_202(void) { return puts(); }


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

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

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

LLVM IR (-O2):
define i32 @test_puts_202() {
%1 = tail call i32 (...) @puts()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long);
long long rand();
int /*<<< orphan*/ srand(int);
int time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  srand(time(NULL) * 0x0000444400004444LL);
  long long int a = rand();
  long long int b = rand();
  long long int c = rand();
  printf("%llu\n", a * b * c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
cltq
movabs $0x444400004444,%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rsi
imul   -0x20(%rbp),%rsi
imul   -0x28(%rbp),%rsi
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
imul   $0x4444,%eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1060 <rand@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
imul   %r14,%rbx
imul   %rax,%rbx
lea    0xe80(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%llu\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i32 %0, i32* %3
store i8** %1, i8*** %4
%8 = call i32 @time(i32* null)
%9 = sext i32 %8 to i64
%10 = mul nsw i64 %9, 75058848482372
%11 = trunc i64 %10 to i32
%12 = call i32 @srand(i32 %11)
%13 = call i64 (...) @rand()
store i64 %13, i64* %5
%14 = call i64 (...) @rand()
store i64 %14, i64* %6
%15 = call i64 (...) @rand()
store i64 %15, i64* %7
%16 = load i64, i64* %5
%17 = load i64, i64* %6
%18 = mul nsw i64 %16, %17
%19 = load i64, i64* %7
%20 = mul nsw i64 %18, %19
%21 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%llu\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @time(i32* null)
%4 = mul i32 %3, 17476
%5 = tail call i32 @srand(i32 %4)
%6 = tail call i64 (...) @rand()
%7 = tail call i64 (...) @rand()
%8 = tail call i64 (...) @rand()
%9 = mul nsw i64 %7, %6
%10 = mul nsw i64 %9, %8
%11 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;
typedef int /*<<< orphan*/ __u16;

/* Variables and functions */
int /*<<< orphan*/ __get_unaligned_be16(int /*<<< orphan*/ const *);
__u16 get_unaligned_be16(const void *p) {
  return __get_unaligned_be16((const __u8 *)p);
}


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

x86 assembly (clang, -O2):
<get_unaligned_be16>:
jmp    1030 <__get_unaligned_be16@plt>

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

LLVM IR (-O2):
define i32 @get_unaligned_be16(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @__get_unaligned_be16(i32* %2)
ret i32 %3
}
/* Variables and functions */
int yas_mma8452q_read_reg(unsigned char, unsigned char *, int);
int yas_mma8452q_read_reg_byte(unsigned char adr) {
  unsigned char buf;
  int err;
  err = yas_mma8452q_read_reg(adr, &buf, 1);
  if (err == 0) {
    return buf;
  }
  return 0;
}


x86 assembly (clang, -O0):
<yas_mma8452q_read_reg_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    -0x6(%rbp),%rsi
mov    $0x1,%edx
movzbl -0x5(%rbp),%edi
call   1030 <yas_mma8452q_read_reg@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1149 <yas_mma8452q_read_reg_byte+0x39>
movzbl -0x6(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <yas_mma8452q_read_reg_byte+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_mma8452q_read_reg_byte>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <yas_mma8452q_read_reg@plt>
xor    %ecx,%ecx
test   %eax,%eax
movzbl 0x7(%rsp),%eax
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yas_mma8452q_read_reg_byte(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %3
%6 = load i8, i8* %3
%7 = call i32 @yas_mma8452q_read_reg(i8 zeroext %6, i8* %4, i32 1)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @yas_mma8452q_read_reg_byte(i8 zeroext %0) {
%2 = alloca i8
%3 = call i32 @yas_mma8452q_read_reg(i8 zeroext %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, 0
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = select i1 %4, i32 %6, i32 0
ret i32 %7
}
int is_whitespace(const char c) { return ' ' == c || '\t' == c; }


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
mov    $0x1,%al
mov    $0x20,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
je     1131 <is_whitespace+0x31>
movsbl -0x1(%rbp),%ecx
mov    $0x9,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_whitespace>:
cmp    $0x20,%dil
sete   %al
cmp    $0x9,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_whitespace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 32, %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 9, %8
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_whitespace(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void h265hvcc_set_chroma_format(uint8_t *p, uint8_t val) { p[15] = 0xfc | val; }


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

x86 assembly (clang, -O2):
<h265hvcc_set_chroma_format>:
or     $0xfc,%esi
mov    %esi,0x3c(%rdi)
ret

LLVM IR (-O0):
define void @h265hvcc_set_chroma_format(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = or i32 252, %5
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 15
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @h265hvcc_set_chroma_format(i32* nocapture writeonly %0, i32 %1) {
%3 = or i32 %1, 252
%4 = getelementptr inbounds i32, i32* %0, i64 15
store i32 %3, i32* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hci_event_connection_complete_get_link_type(const uint8_t *event) {
  return event[11];
}


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

x86 assembly (clang, -O2):
<hci_event_connection_complete_get_link_type>:
mov    0x2c(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @hci_event_connection_complete_get_link_type(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 11
%3 = load i32, i32* %2
ret i32 %3
}