xunge/DecIR huggingface dataset:
/* Variables and functions */
int or_l(int *, int *);
int intr_wrap_544(int p1, int p2) { return or_l(&p1, &p2); }


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

x86 assembly (clang, -O2):
<intr_wrap_544>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <or_l@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @intr_wrap_544(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @or_l(i32* %3, i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @intr_wrap_544(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @or_l(i32* %3, i32* %4)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ DH;

/* Variables and functions */
int /*<<< orphan*/ *DH_new_method(int /*<<< orphan*/ *);
DH *DH_new(void) { return DH_new_method(NULL); }


x86 assembly (clang, -O0):
<DH_new>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <DH_new_method@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DH_new>:
xor    %edi,%edi
jmp    1030 <DH_new_method@plt>

LLVM IR (-O0):
define i32* @DH_new() {
%1 = call i32* @DH_new_method(i32* null)
ret i32* %1
}

LLVM IR (-O2):
define i32* @DH_new() {
%1 = tail call i32* @DH_new_method(i32* null)
ret i32* %1
}
void *memset(void *s, char c, int count) {
  __asm__("cld\n\t"
          "rep\n\t"
          "stosb" ::"a"(c),
          "D"(s), "c"(count));
  return s;
}


x86 assembly (clang, -O0):
<memset>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%ecx
cld
rep stos %al,%es:(%rdi)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset>:
mov    %edx,%ecx
mov    %esi,%eax
cld
rep stos %al,%es:(%rdi)
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @memset(i8* returned %0, i8 signext %1, i32 %2) {
tail call void asm sideeffect "cld\0A\09rep\0A\09stosb", "{ax},{di},{cx},~{dirflag},~{fpsr},~{flags}"(i8 %1, i8* %0, i32 %2)
ret i8* %0
}
float max_f(float a, float b) {
  if (a > b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<max_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    112c <max_f+0x2c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1136 <max_f+0x36>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_f>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @max_f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp ogt float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %5
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @max_f(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
int test_imm_E8int64_highword_reg(long long val) {
  return ((val >> 32) & (0xE8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E8int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0xe8,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E8int64_highword_reg>:
movabs $0xe800000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E8int64_highword_reg(i64 %0) {
%2 = and i64 %0, 996432412672
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int b011_CloseLink(LinkId)
int LinkId;
{
  if (UnlockBoard() == 0l)
    return (-2);
  return (1l);
}


x86 assembly (clang, -O0):
<b011_CloseLink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <UnlockBoard@plt>
cltq
cmp    $0x0,%rax
jne    113a <b011_CloseLink+0x2a>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1141 <b011_CloseLink+0x31>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b011_CloseLink>:
push   %rax
xor    %eax,%eax
call   1030 <UnlockBoard@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
lea    (%rcx,%rcx,2),%eax
add    $0xfffffffe,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @b011_CloseLink(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @UnlockBoard()
%5 = sext i32 %4 to i64
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -2, i32* %2
br label %9
8: ; preds = %1
store i32 1, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @b011_CloseLink(i32 %0) {
%2 = tail call i32 (...) @UnlockBoard()
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -2, i32 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
int /*<<< orphan*/ dlclose(void *);
void chckDlUnload(void *handle) {
  assert(handle);
  dlclose(handle);
}


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

x86 assembly (clang, -O2):
<chckDlUnload>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <dlclose@plt>

LLVM IR (-O0):
define void @chckDlUnload(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @dlclose(i8* %5)
ret void
}

LLVM IR (-O2):
define void @chckDlUnload(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i32 @dlclose(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_barrier_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_barrier_wait(int /*<<< orphan*/ *);
void check_threads(pthread_barrier_t *barrier) {
  pthread_barrier_wait(barrier);
}


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

x86 assembly (clang, -O2):
<check_threads>:
jmp    1030 <pthread_barrier_wait@plt>

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

LLVM IR (-O2):
define void @check_threads(i32* %0) {
%2 = tail call i32 @pthread_barrier_wait(i32* %0)
ret void
}
void I2CAutoIdleDisable(unsigned int baseAdd) {
  (*((volatile unsigned int *)(baseAdd + (0x10)))) &= ~(0x00000001u);
}


x86 assembly (clang, -O0):
<I2CAutoIdleDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CAutoIdleDisable>:
add    $0x10,%edi
andl   $0xfffffffe,(%rdi)
ret

LLVM IR (-O0):
define void @I2CAutoIdleDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 16
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -2
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @I2CAutoIdleDisable(i32 %0) {
%2 = add i32 %0, 16
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, -2
store volatile i32 %6, i32* %4
ret void
}
unsigned char VsReadWriteByte(unsigned char data) {
  while (!((*(volatile unsigned long *)(0xE0030000 + 0x0C)) & (1 << 1)))
    ;
  (*(volatile unsigned long *)(0xE0030000 + 0x08)) = data;
  while (!((*(volatile unsigned long *)(0xE0030000 + 0x0C)) & (1 << 2)))
    ;
  return (*(volatile unsigned long *)(0xE0030000 + 0x08));
}


x86 assembly (clang, -O0):
<VsReadWriteByte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xe003000c,%eax
mov    (%rax),%rax
and    $0x2,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112c <VsReadWriteByte+0x2c>
jmp    1131 <VsReadWriteByte+0x31>
jmp    110a <VsReadWriteByte+0xa>
movzbl -0x1(%rbp),%eax
mov    %eax,%ecx
mov    $0xe0030008,%eax
mov    %rcx,(%rax)
mov    $0xe003000c,%eax
mov    (%rax),%rax
and    $0x4,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1161 <VsReadWriteByte+0x61>
jmp    1166 <VsReadWriteByte+0x66>
jmp    113f <VsReadWriteByte+0x3f>
mov    $0xe0030008,%eax
mov    (%rax),%rax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VsReadWriteByte>:
mov    $0xe0030008,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testq  $0x2,0x4(%rax)
je     1110 <VsReadWriteByte+0x10>
movzbl %dil,%ecx
mov    %rcx,(%rax)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
testq  $0x4,0x4(%rax)
je     1130 <VsReadWriteByte+0x30>
mov    (%rax),%rax
ret

LLVM IR (-O0):
define zeroext i8 @VsReadWriteByte(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i64, i64* inttoptr (i64 3758293004 to i64*)
%5 = and i64 %4, 2
%6 = icmp ne i64 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = load i8, i8* %2
%11 = zext i8 %10 to i64
store volatile i64 %11, i64* inttoptr (i64 3758293000 to i64*)
br label %12
12: ; preds = %17, %9
%13 = load volatile i64, i64* inttoptr (i64 3758293004 to i64*)
%14 = and i64 %13, 4
%15 = icmp ne i64 %14, 0
%16 = xor i1 %15, true
br i1 %16, label %17, label %18
17: ; preds = %12
br label %12
18: ; preds = %12
%19 = load volatile i64, i64* inttoptr (i64 3758293000 to i64*)
%20 = trunc i64 %19 to i8
ret i8 %20
}

LLVM IR (-O2):
define zeroext i8 @VsReadWriteByte(i8 zeroext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* inttoptr (i64 3758293004 to i64*)
%4 = and i64 %3, 2
%5 = icmp eq i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = zext i8 %0 to i64
store volatile i64 %7, i64* inttoptr (i64 3758293000 to i64*)
br label %8
8: ; preds = %8, %6
%9 = load volatile i64, i64* inttoptr (i64 3758293004 to i64*)
%10 = and i64 %9, 4
%11 = icmp eq i64 %10, 0
br i1 %11, label %8, label %12
12: ; preds = %8
%13 = load volatile i64, i64* inttoptr (i64 3758293000 to i64*)
%14 = trunc i64 %13 to i8
ret i8 %14
}
void reg_set_bounds(double *xpos, double *ypos, double *fieldx,
                    double *fieldy) {
  xpos[0] = fieldx[0];
  xpos[1] = fieldx[1];
  ypos[0] = fieldy[0];
  ypos[1] = fieldy[1];
}


x86 assembly (clang, -O0):
<reg_set_bounds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg_set_bounds>:
movsd  (%rdx),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rdx),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  (%rcx),%xmm0
movsd  %xmm0,(%rsi)
movsd  0x8(%rcx),%xmm0
movsd  %xmm0,0x8(%rsi)
ret

LLVM IR (-O0):
define void @reg_set_bounds(double* %0, double* %1, double* %2, double* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double*, double** %7
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = load double*, double** %5
%13 = getelementptr inbounds double, double* %12, i64 0
store double %11, double* %13
%14 = load double*, double** %7
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = load double*, double** %5
%18 = getelementptr inbounds double, double* %17, i64 1
store double %16, double* %18
%19 = load double*, double** %8
%20 = getelementptr inbounds double, double* %19, i64 0
%21 = load double, double* %20
%22 = load double*, double** %6
%23 = getelementptr inbounds double, double* %22, i64 0
store double %21, double* %23
%24 = load double*, double** %8
%25 = getelementptr inbounds double, double* %24, i64 1
%26 = load double, double* %25
%27 = load double*, double** %6
%28 = getelementptr inbounds double, double* %27, i64 1
store double %26, double* %28
ret void
}

LLVM IR (-O2):
define void @reg_set_bounds(double* nocapture writeonly %0, double* nocapture writeonly %1, double* nocapture %2, double* nocapture %3) {
%5 = load double, double* %2
store double %5, double* %0
%6 = getelementptr inbounds double, double* %2, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %0, i64 1
store double %7, double* %8
%9 = load double, double* %3
store double %9, double* %1
%10 = getelementptr inbounds double, double* %3, i64 1
%11 = load double, double* %10
%12 = getelementptr inbounds double, double* %1, i64 1
store double %11, double* %12
ret void
}
/* Variables and functions */
long read_device_file_long(size_t, char *);
long get_max_brightness(size_t led_number) {
  return read_device_file_long(led_number, "max_brightness");
}


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

x86 assembly (clang, -O2):
<get_max_brightness>:
lea    0xee9(%rip),%rsi
jmp    1030 <read_device_file_long@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"max_brightness\00"
define i64 @get_max_brightness(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @read_device_file_long(i64 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i64 %4
}

LLVM IR (-O2):
@.str = [15 x i8] c"max_brightness\00"
define i64 @get_max_brightness(i64 %0) {
%2 = tail call i64 @read_device_file_long(i64 %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i64 %2
}
int PurchaseLargerThan100(const char *id, const char *name, int purchase) {
  if (purchase > 100)
    return purchase;
  else
    return 0;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x64,-0x1c(%rbp)
jle    1124 <PurchaseLargerThan100+0x24>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112b <PurchaseLargerThan100+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
xor    %eax,%eax
cmp    $0x65,%edx
cmovge %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @PurchaseLargerThan100(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = icmp sgt i32 %2, 100
%5 = select i1 %4, i32 %2, i32 0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void lcd_puts(const char *str) { printf("LCD: %s", str); }


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

x86 assembly (clang, -O2):
<lcd_puts>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"LCD: %s\00"
define void @lcd_puts(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nmm_get_cpu(int *, int *);
void NMM_GET_CPU__(int *c, int *i) { nmm_get_cpu(c, i); }


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

x86 assembly (clang, -O2):
<NMM_GET_CPU__>:
jmp    1030 <nmm_get_cpu@plt>

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

LLVM IR (-O2):
define void @NMM_GET_CPU__(i32* %0, i32* %1) {
%3 = tail call i32 @nmm_get_cpu(i32* %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char *, char *);
int isSupported(char *type) {
  if (!strcasecmp(type, "IMAGE"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isSupported>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1141 <isSupported+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <isSupported+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSupported>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"IMAGE\00"
define i32 @isSupported(i8* nocapture %0) {
%2 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ test_client_handshake();
int main(void) {
  assert(test_client_handshake());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_client_handshake@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_client_handshake@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_client_handshake()
%3 = call i32 @assert(i32 %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_client_handshake()
%2 = tail call i32 @assert(i32 %1)
ret i32 0
}
int diminuto_module_example_function(int input) { return ~input; }


x86 assembly (clang, -O0):
<diminuto_module_example_function>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<diminuto_module_example_function>:
mov    %edi,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @diminuto_module_example_function(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
ret i32 %4
}

LLVM IR (-O2):
define i32 @diminuto_module_example_function(i32 %0) {
%2 = xor i32 %0, -1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
debug_print(char *t) { printf("%s", t); }


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

x86 assembly (clang, -O2):
<debug_print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @debug_print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 undef
}
int default_mpgdecoder_reset_audio(void *ctx) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @default_mpgdecoder_reset_audio(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("hello,xue");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%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>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"hello,xue\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
unsigned int cfetch(int);
unsigned int ifetch() { return (cfetch(4)); }


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

x86 assembly (clang, -O2):
<ifetch>:
mov    $0x4,%edi
jmp    1030 <cfetch@plt>

LLVM IR (-O0):
define i32 @ifetch() {
%1 = call i32 @cfetch(i32 4)
ret i32 %1
}

LLVM IR (-O2):
define i32 @ifetch() {
%1 = tail call i32 @cfetch(i32 4)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ change_window();
int /*<<< orphan*/ try_activate_view_mode();
void go_to_other_pane(void) {
  change_window();
  try_activate_view_mode();
}


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

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

LLVM IR (-O0):
define void @go_to_other_pane() {
%1 = call i32 (...) @change_window()
%2 = call i32 (...) @try_activate_view_mode()
ret void
}

LLVM IR (-O2):
define void @go_to_other_pane() {
%1 = tail call i32 (...) @change_window()
%2 = tail call i32 (...) @try_activate_view_mode()
ret void
}
float nx(float f) { return 2.0 * f - 1.0; }


x86 assembly (clang, -O0):
<nx>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm0,%xmm0
movsd  0xee2(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<nx>:
cvtss2sd %xmm0,%xmm0
addsd  %xmm0,%xmm0
addsd  0xef0(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @nx(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %4, double -1.000000e+00)
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @nx(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 2.000000e+00, double -1.000000e+00)
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int sqFileThisSession();
int getThisSession(void) { return sqFileThisSession(); }


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

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

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

LLVM IR (-O2):
define i32 @getThisSession() {
%1 = tail call i32 (...) @sqFileThisSession()
ret i32 %1
}
void _Jv_byteClass(void) {}


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

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

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

LLVM IR (-O2):
define void @_Jv_byteClass() {
ret void
}
/* Variables and functions */
void *malloc(int);
void *mhs_malloc(int size) { return (malloc(size)); }


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

x86 assembly (clang, -O2):
<mhs_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @mhs_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ int_off();
int /*<<< orphan*/ int_on();
int /*<<< orphan*/ system(char *);
void do_unix(char *s) {
  int_off();
  system(s);
  int_on();
}


x86 assembly (clang, -O0):
<do_unix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <int_off@plt>
mov    -0x8(%rbp),%rdi
call   1050 <system@plt>
mov    $0x0,%al
call   1030 <int_on@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_unix>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <int_off@plt>
mov    %rbx,%rdi
call   1050 <system@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <int_on@plt>

LLVM IR (-O0):
define void @do_unix(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @int_off()
%4 = load i8*, i8** %2
%5 = call i32 @system(i8* %4)
%6 = call i32 (...) @int_on()
ret void
}

LLVM IR (-O2):
define void @do_unix(i8* nocapture %0) {
%2 = tail call i32 (...) @int_off()
%3 = tail call i32 @system(i8* %0)
%4 = tail call i32 (...) @int_on()
ret void
}
/* Type definitions */
struct b_tonegen {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ setMIDIDrawBar(struct b_tonegen *, int, unsigned char);
void setDrawbar6(void *d, unsigned char v) {
  setMIDIDrawBar((struct b_tonegen *)d, 6, v);
}


x86 assembly (clang, -O0):
<setDrawbar6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x6,%esi
movzbl -0x9(%rbp),%edx
call   1030 <setMIDIDrawBar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setDrawbar6>:
mov    %esi,%edx
mov    $0x6,%esi
jmp    1030 <setMIDIDrawBar@plt>

LLVM IR (-O0):
%struct.b_tonegen = type { i32 }
define void @setDrawbar6(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to %struct.b_tonegen*
%7 = load i8, i8* %4
%8 = call i32 @setMIDIDrawBar(%struct.b_tonegen* %6, i32 6, i8 zeroext %7)
ret void
}

LLVM IR (-O2):
%struct.b_tonegen = type { i32 }
define void @setDrawbar6(i8* %0, i8 zeroext %1) {
%3 = bitcast i8* %0 to %struct.b_tonegen*
%4 = tail call i32 @setMIDIDrawBar(%struct.b_tonegen* %3, i32 6, i8 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ replaceN(char *, char const *, char const *, int);
void replace(char *line, const char *orig, const char *new) {
  replaceN(line, orig, new, 1);
}


x86 assembly (clang, -O0):
<replace>:
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    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <replaceN@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace>:
mov    $0x1,%ecx
jmp    1030 <replaceN@plt>

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

LLVM IR (-O2):
define void @replace(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @replaceN(i8* %0, i8* %1, i8* %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit_cmpimm(int, int);
int /*<<< orphan*/ emit_movimm(int, int);
int /*<<< orphan*/ emit_sbbimm(int /*<<< orphan*/, int);
void emit_set_nz32(int rs, int rt) {
  emit_cmpimm(rs, 1);
  emit_movimm(1, rt);
  emit_sbbimm(0, rt);
}


x86 assembly (clang, -O0):
<emit_set_nz32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <emit_cmpimm@plt>
mov    -0x8(%rbp),%esi
mov    $0x1,%edi
call   1050 <emit_movimm@plt>
mov    -0x8(%rbp),%esi
xor    %edi,%edi
call   1040 <emit_sbbimm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_set_nz32>:
push   %rbx
mov    %esi,%ebx
mov    $0x1,%esi
call   1030 <emit_cmpimm@plt>
mov    $0x1,%edi
mov    %ebx,%esi
call   1050 <emit_movimm@plt>
xor    %edi,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <emit_sbbimm@plt>

LLVM IR (-O0):
define void @emit_set_nz32(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 = call i32 @emit_cmpimm(i32 %5, i32 1)
%7 = load i32, i32* %4
%8 = call i32 @emit_movimm(i32 1, i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @emit_sbbimm(i32 0, i32 %9)
ret void
}

LLVM IR (-O2):
define void @emit_set_nz32(i32 %0, i32 %1) {
%3 = tail call i32 @emit_cmpimm(i32 %0, i32 1)
%4 = tail call i32 @emit_movimm(i32 1, i32 %1)
%5 = tail call i32 @emit_sbbimm(i32 0, i32 %1)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  uint16_t x = 1000;
  int y = x;
  printf("%d", y);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1000)
ret i32 0
}
void RTTarFileExists(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTarFileExists() {
ret void
}
/* Variables and functions */
scalar_t__ inc_addr(void *, int);
int readlink(char const *, char *, int);
int bad_readlink(void *addr) {
  return readlink((const char *)addr, (char *)inc_addr(addr, 1), 8192);
}


x86 assembly (clang, -O0):
<bad_readlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <inc_addr@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rsi
mov    $0x2000,%edx
call   1030 <readlink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_readlink>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%esi
call   1040 <inc_addr@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x2000,%edx
pop    %rbx
jmp    1030 <readlink@plt>

LLVM IR (-O0):
define i32 @bad_readlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @inc_addr(i8* %4, i32 1)
%6 = inttoptr i64 %5 to i8*
%7 = call i32 @readlink(i8* %3, i8* %6, i32 8192)
ret i32 %7
}

LLVM IR (-O2):
define i32 @bad_readlink(i8* %0) {
%2 = tail call i64 @inc_addr(i8* %0, i32 1)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @readlink(i8* %0, i8* %3, i32 8192)
ret i32 %4
}
void avpriv_open() {}


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

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

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

LLVM IR (-O2):
define void @avpriv_open() {
ret void
}
int func1(int a, int b) { return a * b; }


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @func1(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 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @func1(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
int cal(float a) {
  float b = 1.2;
  float c = 2.2;
  if ((a + b) != c)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<cal>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  0xef3(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xee2(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jne    1142 <cal+0x42>
jp     1142 <cal+0x42>
jmp    114e <cal+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1155 <cal+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cal>:
addss  0xef8(%rip),%xmm0
cmpeqss 0xef3(%rip),%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @cal(float %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float 0x3FF3333340000000, float* %4
store float 0x40019999A0000000, float* %5
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fadd float %6, %7
%9 = load float, float* %5
%10 = fcmp une float %8, %9
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 0, i32* %2
br label %13
12: ; preds = %1
store i32 1, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @cal(float %0) {
%2 = fadd float %0, 0x3FF3333340000000
%3 = fcmp oeq float %2, 0x40019999A0000000
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
void *ft_memset(void *data, int c, size_t len) {
  size_t i;
  unsigned char *d;
  d = (unsigned char *)data;
  i = 0;
  while (i < len)
    d[i++] = (unsigned char)c;
  return (data);
}


x86 assembly (clang, -O0):
<ft_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    114d <ft_memset+0x4d>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,-0x20(%rbp)
mov    %dl,(%rax,%rcx,1)
jmp    111f <ft_memset+0x1f>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memset>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1121 <ft_memset+0x11>
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ft_memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[], char *envp[]) {
  if (argc >= 3) {
    if (argc <= 3) {
    }
    printf("MinMax adjusted number of arguments is %d\n", 3);
  } else {
    printf("MinMax adjusted number of arguments is %d\n", -2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x3,-0x8(%rbp)
jl     1159 <main+0x49>
cmpl   $0x3,-0x8(%rbp)
jg     1143 <main+0x33>
jmp    1143 <main+0x33>
lea    0xeb6(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
jmp    116a <main+0x5a>
lea    0xea0(%rip),%rdi
mov    $0xfffffffe,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
cmp    $0x3,%edi
setge  %al
lea    (%rax,%rax,4),%esi
add    $0xfffffffe,%esi
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"MinMax adjusted number of arguments is %d\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i32, i32* %5
%9 = icmp sge i32 %8, 3
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = load i32, i32* %5
%12 = icmp sle i32 %11, 3
br i1 %12, label %13, label %14
13: ; preds = %10
br label %14
14: ; preds = %13, %10
%15 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 3)
br label %18
16: ; preds = %3
%17 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 -2)
br label %18
18: ; preds = %16, %14
ret i32 0
}

LLVM IR (-O2):
@.str = [43 x i8] c"MinMax adjusted number of arguments is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = icmp slt i32 %0, 3
%5 = select i1 %4, i32 -2, i32 3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void pgxpRecNULL() {}


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

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

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

LLVM IR (-O2):
define void @pgxpRecNULL() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Atom;

/* Variables and functions */
int /*<<< orphan*/ XA_ATOM;
int x_get_property(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                   int, void **, int *);
int x_get_atom_property(Window window, Atom property, Atom **prop_ret,
                        int *nr_ret) {
  return x_get_property(window, XA_ATOM, property, sizeof(Atom),
                        (void **)prop_ret, nr_ret);
}


x86 assembly (clang, -O0):
<x_get_atom_property>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    $0x4,%ecx
call   1030 <x_get_property@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_get_atom_property>:
mov    %rcx,%r9
mov    %rdx,%r8
mov    %esi,%edx
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    $0x4,%ecx
jmp    1030 <x_get_property@plt>

LLVM IR (-O0):
@XA_ATOM = global i32 0
define i32 @x_get_atom_property(i32 %0, i32 %1, i32** %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32**
%8 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32** %2, i32*** %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = load i32, i32* @XA_ATOM
%11 = load i32, i32* %6
%12 = load i32**, i32*** %7
%13 = bitcast i32** %12 to i8**
%14 = load i32*, i32** %8
%15 = call i32 @x_get_property(i32 %9, i32 %10, i32 %11, i32 4, i8** %13, i32* %14)
ret i32 %15
}

LLVM IR (-O2):
@XA_ATOM = global i32 0
define i32 @x_get_atom_property(i32 %0, i32 %1, i32** %2, i32* %3) {
%5 = load i32, i32* @XA_ATOM
%6 = bitcast i32** %2 to i8**
%7 = tail call i32 @x_get_property(i32 %0, i32 %5, i32 %1, i32 4, i8** %6, i32* %3)
ret i32 %7
}
/* Type definitions */
struct vm_area_struct {
  int dummy;
};
struct kobject {
  int dummy;
};
struct bin_attribute {
  int dummy;
};

/* Variables and functions */
int pci_mmap_resource(struct kobject *, struct bin_attribute *,
                      struct vm_area_struct *, int);
int pci_mmap_resource_sparse(struct kobject *kobj, struct bin_attribute *attr,
                             struct vm_area_struct *vma) {
  return pci_mmap_resource(kobj, attr, vma, 1);
}


x86 assembly (clang, -O0):
<pci_mmap_resource_sparse>:
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    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <pci_mmap_resource@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_mmap_resource_sparse>:
mov    $0x1,%ecx
jmp    1030 <pci_mmap_resource@plt>

LLVM IR (-O0):
%struct.kobject = type { i32 }
%struct.bin_attribute = type { i32 }
%struct.vm_area_struct = type { i32 }
define i32 @pci_mmap_resource_sparse(%struct.kobject* %0, %struct.bin_attribute* %1, %struct.vm_area_struct* %2) {
%4 = alloca %struct.kobject*
%5 = alloca %struct.bin_attribute*
%6 = alloca %struct.vm_area_struct*
store %struct.kobject* %0, %struct.kobject** %4
store %struct.bin_attribute* %1, %struct.bin_attribute** %5
store %struct.vm_area_struct* %2, %struct.vm_area_struct** %6
%7 = load %struct.kobject*, %struct.kobject** %4
%8 = load %struct.bin_attribute*, %struct.bin_attribute** %5
%9 = load %struct.vm_area_struct*, %struct.vm_area_struct** %6
%10 = call i32 @pci_mmap_resource(%struct.kobject* %7, %struct.bin_attribute* %8, %struct.vm_area_struct* %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.kobject = type { i32 }
%struct.bin_attribute = type { i32 }
%struct.vm_area_struct = type { i32 }
define i32 @pci_mmap_resource_sparse(%struct.kobject* %0, %struct.bin_attribute* %1, %struct.vm_area_struct* %2) {
%4 = tail call i32 @pci_mmap_resource(%struct.kobject* %0, %struct.bin_attribute* %1, %struct.vm_area_struct* %2, i32 1)
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t max(uint64_t x, uint64_t y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @max(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
typedef int u_int16_t;

/* Variables and functions */
int bs_character_width(u_int16_t uc) {
  if (uc < 0x80 || (uc >= 0xff60 && uc <= 0xff9f))
    return 1;
  else
    return 2;
}


x86 assembly (clang, -O0):
<bs_character_width>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jl     112e <bs_character_width+0x2e>
cmpl   $0xff60,-0x8(%rbp)
jl     113a <bs_character_width+0x3a>
cmpl   $0xff9f,-0x8(%rbp)
jg     113a <bs_character_width+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <bs_character_width+0x41>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bs_character_width>:
cmp    $0x80,%edi
setl   %al
add    $0xffff00a0,%edi
cmp    $0x40,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%ecx
mov    $0x2,%eax
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @bs_character_width(i32 %0) {
%2 = icmp slt i32 %0, 128
%3 = add i32 %0, -65376
%4 = icmp ult i32 %3, 64
%5 = or i1 %2, %4
%6 = select i1 %5, i32 1, i32 2
ret i32 %6
}