xunge/DecIR huggingface dataset:
int imax(int a, int b) { return (a < b) ? b : a; }


x86 assembly (clang, -O0):
<imax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <imax+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <imax+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imax>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @imax(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ wait(int *);
void sigchld_handler(int signum) {
  int status;
  wait(&status);
}


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

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

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

LLVM IR (-O2):
define void @sigchld_handler(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @wait(i32* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ reqbuf;

/* Variables and functions */
int ph_rpc(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
int phStopConf(int cid1, int cid2) {
  char reqbuf[1000];
  snprintf(reqbuf, sizeof(reqbuf), "NOCONF CID=%d CIDT=%d", cid1, cid2);
  return ph_rpc(reqbuf);
}


x86 assembly (clang, -O0):
<phStopConf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    $0x3e8,%esi
lea    0xeb5(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x3f0(%rbp),%rdi
call   1040 <ph_rpc@plt>
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phStopConf>:
push   %rbx
sub    $0x3f0,%rsp
mov    %esi,%r8d
mov    %edi,%ecx
lea    0xecc(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <ph_rpc@plt>
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"NOCONF CID=%d CIDT=%d\00"
define i32 @phStopConf(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [1000 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @snprintf(i8* %6, i32 1000, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%11 = call i32 @ph_rpc(i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [22 x i8] c"NOCONF CID=%d CIDT=%d\00"
define i32 @phStopConf(i32 %0, i32 %1) {
%3 = alloca [1000 x i8]
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 1000, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%6 = call i32 @ph_rpc(i8* %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ native_restore_flags(unsigned long);
void arch_local_irq_restore(unsigned long flags) {
  native_restore_flags(flags);
}


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

x86 assembly (clang, -O2):
<arch_local_irq_restore>:
jmp    1030 <native_restore_flags@plt>

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

LLVM IR (-O2):
define void @arch_local_irq_restore(i64 %0) {
%2 = tail call i32 @native_restore_flags(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430TimerCapComP__5__Control__setControlAsCompare();
void Msp430AlarmC__1__Msp430TimerControl__setControlAsCompare(void) {
  Msp430TimerCapComP__5__Control__setControlAsCompare();
}


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

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

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

LLVM IR (-O2):
define void @Msp430AlarmC__1__Msp430TimerControl__setControlAsCompare() {
%1 = tail call i32 (...) @Msp430TimerCapComP__5__Control__setControlAsCompare()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("First OSS code");
  printf("second OSS code");
  printf("마스터브랜치에 코드를 추가하였음");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"First OSS code\00"
@.str.1 = [16 x i8] c"second OSS code\00"
@.str.2 = [48 x i8] c"\EB\A7\88\EC\8A\A4\ED\84\B0\EB\B8\8C\EB\9E\9C\EC\B9\98\EC\97\90 \EC\BD\94\EB\93\9C\EB\A5\BC \EC\B6\94\EA\B0\80\ED\95\98\EC\98\80\EC\9D\8C\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"First OSS code\00"
@.str.1 = [16 x i8] c"second OSS code\00"
@.str.2 = [48 x i8] c"\EB\A7\88\EC\8A\A4\ED\84\B0\EB\B8\8C\EB\9E\9C\EC\B9\98\EC\97\90 \EC\BD\94\EB\93\9C\EB\A5\BC \EC\B6\94\EA\B0\80\ED\95\98\EC\98\80\EC\9D\8C\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct wl_resource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/);
void wl_shm_send_format(struct wl_resource *resource_, uint32_t format) {
  wl_resource_post_event(resource_, 0, format);
}


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

x86 assembly (clang, -O2):
<wl_shm_send_format>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <wl_resource_post_event@plt>

LLVM IR (-O0):
%struct.wl_resource = type { i32 }
define void @wl_shm_send_format(%struct.wl_resource* %0, i32 %1) {
%3 = alloca %struct.wl_resource*
%4 = alloca i32
store %struct.wl_resource* %0, %struct.wl_resource** %3
store i32 %1, i32* %4
%5 = load %struct.wl_resource*, %struct.wl_resource** %3
%6 = load i32, i32* %4
%7 = call i32 @wl_resource_post_event(%struct.wl_resource* %5, i32 0, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_shm_send_format(%struct.wl_resource* %0, i32 %1) {
%3 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int mvwscanw(int /*<<< orphan*/ *, int, int, char *, char *);
int s_mvwscanw(WINDOW *win, int y, int x, char *fmt, char *string) {
  return (mvwscanw(win, y, x, fmt, string));
}


x86 assembly (clang, -O0):
<s_mvwscanw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <mvwscanw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_mvwscanw>:
jmp    1030 <mvwscanw@plt>

LLVM IR (-O0):
define i32 @s_mvwscanw(i32* %0, i32 %1, i32 %2, i8* %3, i8* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i8*, i8** %9
%15 = load i8*, i8** %10
%16 = call i32 @mvwscanw(i32* %11, i32 %12, i32 %13, i8* %14, i8* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @s_mvwscanw(i32* %0, i32 %1, i32 %2, i8* %3, i8* %4) {
%6 = tail call i32 @mvwscanw(i32* %0, i32 %1, i32 %2, i8* %3, i8* %4)
ret i32 %6
}
/* Variables and functions */
scalar_t__ log10(double);
float fe_mel(float x) {
  return (float)(2595.0 * (float)log10(1.0 + x / 700.0));
}


x86 assembly (clang, -O0):
<fe_mel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee2(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1030 <log10@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeac(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fe_mel>:
push   %rax
cvtss2sd %xmm0,%xmm0
divsd  0xee3(%rip),%xmm0
addsd  0xee3(%rip),%xmm0
call   1030 <log10@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
mulss  0xed6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fe_mel(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double %4, 7.000000e+02
%6 = fadd double 1.000000e+00, %5
%7 = call i64 @log10(double %6)
%8 = sitofp i64 %7 to float
%9 = fpext float %8 to double
%10 = fmul double 2.595000e+03, %9
%11 = fptrunc double %10 to float
ret float %11
}

LLVM IR (-O2):
define float @fe_mel(float %0) {
%2 = fpext float %0 to double
%3 = fdiv double %2, 7.000000e+02
%4 = fadd double %3, 1.000000e+00
%5 = tail call i64 @log10(double %4)
%6 = sitofp i64 %5 to float
%7 = fmul float %6, 2.595000e+03
ret float %7
}
unsigned fnv_32a_str(char *str, unsigned hval) {
  unsigned char *s = (unsigned char *)str;
  while (*s) {
    hval ^= (unsigned)*s++;
    hval +=
        (hval << 1) + (hval << 4) + (hval << 7) + (hval << 8) + (hval << 24);
  }
  return hval;
}


x86 assembly (clang, -O0):
<fnv_32a_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1169 <fnv_32a_str+0x69>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movzbl (%rax),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0xc(%rbp),%ecx
shl    $0x4,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x7,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x18,%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1113 <fnv_32a_str+0x13>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnv_32a_str>:
mov    %esi,%eax
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <fnv_32a_str+0x26>
add    $0x1,%rdi
nopl   0x0(%rax)
movzbl %cl,%ecx
xor    %eax,%ecx
imul   $0x1000193,%ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <fnv_32a_str+0x10>
ret

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

LLVM IR (-O2):
define i32 @fnv_32a_str(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = phi i32 [ %12, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = zext i8 %6 to i32
%11 = xor i32 %8, %10
%12 = mul i32 %11, 16777619
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ %1, %2 ], [ %12, %5 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello static world!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"Hello static world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct VectorArray_Int {
  int dummy;
};

/* Variables and functions */
struct VectorArray_Int *make_Int_VectorArray_Int(int);
struct VectorArray_Int *make_VectorArray_Int() {
  return make_Int_VectorArray_Int(2);
}


x86 assembly (clang, -O0):
<make_VectorArray_Int>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <make_Int_VectorArray_Int@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_VectorArray_Int>:
mov    $0x2,%edi
jmp    1030 <make_Int_VectorArray_Int@plt>

LLVM IR (-O0):
%struct.VectorArray_Int = type { i32 }
define %struct.VectorArray_Int* @make_VectorArray_Int() {
%1 = call %struct.VectorArray_Int* @make_Int_VectorArray_Int(i32 2)
ret %struct.VectorArray_Int* %1
}

LLVM IR (-O2):
%struct.VectorArray_Int = type { i32 }
define %struct.VectorArray_Int* @make_VectorArray_Int() {
%1 = tail call %struct.VectorArray_Int* @make_Int_VectorArray_Int(i32 2)
ret %struct.VectorArray_Int* %1
}
/* Variables and functions */
scalar_t__ abs(int /*<<< orphan*/);
int main() { return !(abs(0) == 0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <abs@plt>
cmp    $0x0,%rax
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <abs@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @abs(i32 0)
%3 = icmp eq i64 %2, 0
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @abs(i32 0)
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int user_match(char *username) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @user_match(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void check_ptr_eq(void (*f1)(void), void (*f2)(void)) {
  if (f1 != f2)
    abort();
}


x86 assembly (clang, -O0):
<check_ptr_eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1135 <check_ptr_eq+0x25>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_ptr_eq>:
cmp    %rsi,%rdi
jne    1116 <check_ptr_eq+0x6>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @check_ptr_eq(void ()* readnone %0, void ()* readnone %1) {
%3 = icmp eq void ()* %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %2
ret void
}
void ECAPSyncInOutSelect(unsigned int baseAdd, unsigned int syncIn,
                         unsigned int syncOut) {
  (*((volatile unsigned short *)(baseAdd + (0x2A)))) &= 0xffffffdf;
  (*((volatile unsigned short *)(baseAdd + (0x2A)))) |= syncIn;
  (*((volatile unsigned short *)(baseAdd + (0x2A)))) &= 0xffffff3f;
  (*((volatile unsigned short *)(baseAdd + (0x2A)))) |= syncOut;
}


x86 assembly (clang, -O0):
<ECAPSyncInOutSelect>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2a,%eax
mov    %eax,%eax
mov    (%rax),%cx
movzwl %cx,%ecx
and    $0xffffffdf,%ecx
mov    %cx,(%rax)
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%eax
add    $0x2a,%eax
mov    %eax,%eax
mov    (%rax),%cx
movzwl %cx,%ecx
or     %edx,%ecx
mov    %cx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x2a,%eax
mov    %eax,%eax
mov    (%rax),%cx
movzwl %cx,%ecx
and    $0xffffff3f,%ecx
mov    %cx,(%rax)
mov    -0xc(%rbp),%edx
mov    -0x4(%rbp),%eax
add    $0x2a,%eax
mov    %eax,%eax
mov    (%rax),%cx
movzwl %cx,%ecx
or     %edx,%ecx
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ECAPSyncInOutSelect>:
add    $0x2a,%edi
andw   $0xffdf,(%rdi)
or     %si,(%rdi)
andw   $0xff3f,(%rdi)
or     %dx,(%rdi)
ret

LLVM IR (-O0):
define void @ECAPSyncInOutSelect(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = add i32 %7, 42
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i16*
%11 = load volatile i16, i16* %10
%12 = zext i16 %11 to i32
%13 = and i32 %12, -33
%14 = trunc i32 %13 to i16
store volatile i16 %14, i16* %10
%15 = load i32, i32* %5
%16 = load i32, i32* %4
%17 = add i32 %16, 42
%18 = zext i32 %17 to i64
%19 = inttoptr i64 %18 to i16*
%20 = load volatile i16, i16* %19
%21 = zext i16 %20 to i32
%22 = or i32 %21, %15
%23 = trunc i32 %22 to i16
store volatile i16 %23, i16* %19
%24 = load i32, i32* %4
%25 = add i32 %24, 42
%26 = zext i32 %25 to i64
%27 = inttoptr i64 %26 to i16*
%28 = load volatile i16, i16* %27
%29 = zext i16 %28 to i32
%30 = and i32 %29, -193
%31 = trunc i32 %30 to i16
store volatile i16 %31, i16* %27
%32 = load i32, i32* %6
%33 = load i32, i32* %4
%34 = add i32 %33, 42
%35 = zext i32 %34 to i64
%36 = inttoptr i64 %35 to i16*
%37 = load volatile i16, i16* %36
%38 = zext i16 %37 to i32
%39 = or i32 %38, %32
%40 = trunc i32 %39 to i16
store volatile i16 %40, i16* %36
ret void
}

LLVM IR (-O2):
define void @ECAPSyncInOutSelect(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %0, 42
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i16*
%7 = load volatile i16, i16* %6
%8 = and i16 %7, -33
store volatile i16 %8, i16* %6
%9 = load volatile i16, i16* %6
%10 = trunc i32 %1 to i16
%11 = or i16 %9, %10
store volatile i16 %11, i16* %6
%12 = load volatile i16, i16* %6
%13 = and i16 %12, -193
store volatile i16 %13, i16* %6
%14 = load volatile i16, i16* %6
%15 = trunc i32 %2 to i16
%16 = or i16 %14, %15
store volatile i16 %16, i16* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void pr_sep(void) { printf("\n"); }


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

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

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

LLVM IR (-O2):
define void @pr_sep() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sqlite3_free(void *);
void result_string_destructor(void *result_string) {
  sqlite3_free(result_string);
}


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

x86 assembly (clang, -O2):
<result_string_destructor>:
jmp    1030 <sqlite3_free@plt>

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

LLVM IR (-O2):
define void @result_string_destructor(i8* %0) {
%2 = tail call i32 @sqlite3_free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ *malloc(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ rand_data(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ thread_yield();
void test(void *arg) {
  printf("hi! %u\n", (uint32_t)arg);
  uint8_t *buf = malloc(4242);
  while (true) {
    rand_data(buf, 4242);
    thread_yield();
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1092,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1092,%esi
call   1030 <rand_data@plt>
mov    $0x0,%al
call   1050 <thread_yield@plt>
jmp    116c <test+0x2c>

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %rdi,%rsi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1092,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
nopl   (%rax)
mov    %rbx,%rdi
mov    $0x1092,%esi
call   1030 <rand_data@plt>
xor    %eax,%eax
call   1050 <thread_yield@plt>
jmp    1160 <test+0x20>

LLVM IR (-O0):
@.str = [8 x i8] c"hi! %u\0A\00"
define void @test(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32* @malloc(i32 4242)
store i32* %7, i32** %3
br label %8
8: ; preds = %1, %8
%9 = load i32*, i32** %3
%10 = call i32 @rand_data(i32* %9, i32 4242)
%11 = call i32 (...) @thread_yield()
br label %8
}

LLVM IR (-O2):
@.str = [8 x i8] c"hi! %u\0A\00"
define void @test(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32* @malloc(i32 4242)
br label %6
6: ; preds = %6, %1
%7 = tail call i32 @rand_data(i32* %5, i32 4242)
%8 = tail call i32 (...) @thread_yield()
br label %6
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_dmd_empty_comments() {
  test_parser_verify_parse(test_parser_sourcefile("dmd", " //\n"), "dmd", "",
                           "//\n", 0);
}


x86 assembly (clang, -O0):
<test_dmd_empty_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xec1(%rip),%rdx
lea    0xeb7(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_dmd_empty_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xeca(%rip),%rdx
lea    0xec0(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"dmd\00"
@.str.1 = [5 x i8] c" //\0A\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [4 x i8] c"//\0A\00"
define void @test_dmd_empty_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"dmd\00"
@.str.1 = [5 x i8] c" //\0A\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [4 x i8] c"//\0A\00"
define void @test_dmd_empty_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
OP(fd, dc) { op_dc(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_dc@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_dc()
ret i32 undef
}
int is_big_endian() {
  long one = 1;
  return !(*((char *)(&one)));
}


x86 assembly (clang, -O0):
<is_big_endian>:
push   %rbp
mov    %rsp,%rbp
movq   $0x1,-0x8(%rbp)
cmpb   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_big_endian() {
%1 = alloca i64
store i64 1, i64* %1
%2 = bitcast i64* %1 to i8*
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_big_endian() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ INI(int, int);
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_ED_0xa2(void) {
  INI(6, 9);
  T_WAIT_UNTIL(12);
  return;
}


x86 assembly (clang, -O0):
<op_ED_0xa2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x9,%esi
call   1030 <INI@plt>
mov    $0xc,%edi
call   1040 <T_WAIT_UNTIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_ED_0xa2>:
push   %rax
mov    $0x6,%edi
mov    $0x9,%esi
call   1030 <INI@plt>
mov    $0xc,%edi
pop    %rax
jmp    1040 <T_WAIT_UNTIL@plt>

LLVM IR (-O0):
define void @op_ED_0xa2() {
%1 = call i32 @INI(i32 6, i32 9)
%2 = call i32 @T_WAIT_UNTIL(i32 12)
ret void
}

LLVM IR (-O2):
define void @op_ED_0xa2() {
%1 = tail call i32 @INI(i32 6, i32 9)
%2 = tail call i32 @T_WAIT_UNTIL(i32 12)
ret void
}
int test_imm_A8uint32_reg(unsigned int val) {
  return ((val) & (0xA8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A8uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xa8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A8uint32_reg>:
test   $0xa8,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A8uint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 168
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_A8uint32_reg(i32 %0) {
%2 = and i32 %0, 168
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int jack_get_data(const char *name) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @jack_get_data(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assignwhr();
int /*<<< orphan*/ feedrdm();
int /*<<< orphan*/ gamestart();
int /*<<< orphan*/ mainmenu();
int /*<<< orphan*/ resultscreen();
int /*<<< orphan*/ selectscreen();
int /*<<< orphan*/ setdiffmedium();
int /*<<< orphan*/ weather();
int main() {
  setdiffmedium();
  feedrdm();
  mainmenu();
  gamestart();
  for (;;) {
    weather();
    assignwhr();
    selectscreen();
    resultscreen();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <setdiffmedium@plt>
mov    $0x0,%al
call   1080 <feedrdm@plt>
mov    $0x0,%al
call   10a0 <mainmenu@plt>
mov    $0x0,%al
call   1030 <gamestart@plt>
mov    $0x0,%al
call   1060 <weather@plt>
mov    $0x0,%al
call   1040 <assignwhr@plt>
mov    $0x0,%al
call   1050 <selectscreen@plt>
mov    $0x0,%al
call   1090 <resultscreen@plt>
jmp    11ab <main+0x2b>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <setdiffmedium@plt>
xor    %eax,%eax
call   1080 <feedrdm@plt>
xor    %eax,%eax
call   10a0 <mainmenu@plt>
xor    %eax,%eax
call   1030 <gamestart@plt>
nopl   (%rax)
xor    %eax,%eax
call   1060 <weather@plt>
xor    %eax,%eax
call   1040 <assignwhr@plt>
xor    %eax,%eax
call   1050 <selectscreen@plt>
xor    %eax,%eax
call   1090 <resultscreen@plt>
jmp    11a0 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @setdiffmedium()
%3 = call i32 (...) @feedrdm()
%4 = call i32 (...) @mainmenu()
%5 = call i32 (...) @gamestart()
br label %6
6: ; preds = %6, %0
%7 = call i32 (...) @weather()
%8 = call i32 (...) @assignwhr()
%9 = call i32 (...) @selectscreen()
%10 = call i32 (...) @resultscreen()
br label %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setdiffmedium()
%2 = tail call i32 (...) @feedrdm()
%3 = tail call i32 (...) @mainmenu()
%4 = tail call i32 (...) @gamestart()
br label %5
5: ; preds = %5, %0
%6 = tail call i32 (...) @weather()
%7 = tail call i32 (...) @assignwhr()
%8 = tail call i32 (...) @selectscreen()
%9 = tail call i32 (...) @resultscreen()
br label %5
}
regx0adr1_set(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (p0[x0]) = (*((short *)11111111)); }


x86 assembly (clang, -O0):
<regx0adr1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0xa98ac7,%eax
mov    (%rax),%dx
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0adr1_set>:
movzwl 0xa98ac7,%eax
movslq %edx,%rcx
mov    %ax,(%r8,%rcx,2)
ret

LLVM IR (-O0):
define i32 @regx0adr1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* inttoptr (i64 11111111 to i16*)
%17 = load i16*, i16** %12
%18 = load i32, i32* %10
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i16, i16* %17, i64 %19
store i16 %16, i16* %20
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @regx0adr1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture writeonly %4, i16* nocapture readnone %5) {
%7 = load i16, i16* inttoptr (i64 11111111 to i16*)
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i16, i16* %4, i64 %8
store i16 %7, i16* %9
ret i32 undef
}
int ft_strlen(const char *str) {
  int i;
  if (!str)
    return (0);
  i = -1;
  while (str[++i])
    ;
  return (i);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <ft_strlen+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    114b <ft_strlen+0x4b>
movl   $0xffffffff,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1145 <ft_strlen+0x45>
jmp    1126 <ft_strlen+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
test   %rdi,%rdi
je     111d <ft_strlen+0x1d>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %5, %3 ], [ -1, %1 ]
%5 = add nsw i64 %4, 1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %5 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void set_16(unsigned char *p, uint16_t v) {
  p[0] = (v & 0xff);
  p[1] = ((v >> 8) & 0xff);
}


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

x86 assembly (clang, -O2):
<set_16>:
mov    %si,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_16(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
int child(void) { return 5; }


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

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

LLVM IR (-O0):
define i32 @child() {
ret i32 5
}

LLVM IR (-O2):
define i32 @child() {
ret i32 5
}
/* 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__ xselectionrequest;
};
typedef TYPE_2__ XEvent;

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


x86 assembly (clang, -O0):
<set_XEvent_xselectionrequest_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_xselectionrequest_serial>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xselectionrequest_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_xselectionrequest_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int unlink(char const *);
int d2u_unlink(const char *filename) { return unlink(filename); }


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

x86 assembly (clang, -O2):
<d2u_unlink>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define i32 @d2u_unlink(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 %2
}
void *a_swap_p(void *volatile *x, void *v) {
  __asm__("xchg %0, %1" : "=r"(v), "=m"(*(void **)x) : "0"(v) : "memory");
  return v;
}


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

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

LLVM IR (-O0):
define i8* @a_swap_p(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %4
%7 = call i8* asm "xchg $0, $1", "=r,=*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %5, i8* %6)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
ret i8* %8
}

LLVM IR (-O2):
define i8* @a_swap_p(i8** %0, i8* %1) {
%3 = tail call i8* asm "xchg $0, $1", "=r,=*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %0, i8* %1)
ret i8* %3
}
int is_sfi(char *s) {
  while (*s) {
    if (*s == '=')
      return (1);
    s++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<is_sfi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <is_sfi+0x42>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
jne    1131 <is_sfi+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1149 <is_sfi+0x49>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <is_sfi+0x8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_sfi>:
movzbl (%rdi),%eax
test   %al,%al
je     1111 <is_sfi+0x11>
cmp    $0x3d,%al
je     1114 <is_sfi+0x14>
add    $0x1,%rdi
jmp    1100 <is_sfi>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_sfi(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %8
i8 61, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %9
}
void SetRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @SetRow_Any_NEON() {
ret void
}
int str_len(char *str) {
  int len = 0;
  while (str[len] != '\0') {
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<str_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <str_len+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <str_len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_len>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <str_len+0x10>
ret

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

LLVM IR (-O2):
define i32 @str_len(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ outchar(int);
void outdig(int dig) {
  if (dig < 10)
    outchar(dig + '0');
  else
    outchar(dig - 10 + 'A');
}


x86 assembly (clang, -O0):
<outdig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1135 <outdig+0x25>
mov    -0x4(%rbp),%edi
add    $0x30,%edi
call   1030 <outchar@plt>
jmp    1143 <outdig+0x33>
mov    -0x4(%rbp),%edi
sub    $0xa,%edi
add    $0x41,%edi
call   1030 <outchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outdig>:
lea    0x37(%rdi),%ecx
lea    0x30(%rdi),%eax
cmp    $0xa,%edi
cmovge %ecx,%eax
mov    %eax,%edi
jmp    1030 <outchar@plt>

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

LLVM IR (-O2):
define void @outdig(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = select i1 %2, i32 48, i32 55
%4 = add nsw i32 %3, %0
%5 = tail call i32 @outchar(i32 %4)
ret void
}
int execute_uselib() { return 0; }


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

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

LLVM IR (-O0):
define i32 @execute_uselib() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_uselib() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ set_warn_handler(void *);
int /*<<< orphan*/ warn_err_obj(char const *);
void die_err_obj(const char *obj) {
  set_warn_handler(((void *)0));
  warn_err_obj(obj);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<die_err_obj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <set_warn_handler@plt>
mov    -0x8(%rbp),%rdi
call   1030 <warn_err_obj@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die_err_obj>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <set_warn_handler@plt>
mov    %rbx,%rdi
call   1030 <warn_err_obj@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @die_err_obj(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @set_warn_handler(i8* null)
%4 = load i8*, i8** %2
%5 = call i32 @warn_err_obj(i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @die_err_obj(i8* %0) {
%2 = tail call i32 @set_warn_handler(i8* null)
%3 = tail call i32 @warn_err_obj(i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void _NOTAFUNCTIONJUSTTOPREVENTENDOFREADFILE_TUMORS() {}


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

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

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

LLVM IR (-O2):
define void @_NOTAFUNCTIONJUSTTOPREVENTENDOFREADFILE_TUMORS() {
ret void
}