xunge/DecIR huggingface dataset:
void X2DRIV(ifunc, rbuf, nbuf, chr, lchr, mode, w_ifunc, w_rbuf, w_nbuf, w_chr,
            w_lchr, w_mode) int *ifunc;
float *rbuf;
int *nbuf;
char *chr;
int *lchr;
int w_ifunc, w_rbuf, w_nbuf, w_chr, w_lchr, w_mode;
{
  x2driv_(ifunc, rbuf, nbuf, chr, lchr, mode, w_chr);
  return;
}


x86 assembly (clang, -O0):
<X2DRIV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
mov    0x28(%rbp),%eax
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <x2driv_@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<X2DRIV>:
push   %rax
mov    0x28(%rsp),%eax
mov    %eax,(%rsp)
xor    %eax,%eax
call   1030 <x2driv_@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @X2DRIV(i32* %0, float* %1, i32* %2, i8* %3, i32* %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11) {
%13 = alloca i32*
%14 = alloca float*
%15 = alloca i32*
%16 = alloca i8*
%17 = alloca i32*
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
store i32* %0, i32** %13
store float* %1, float** %14
store i32* %2, i32** %15
store i8* %3, i8** %16
store i32* %4, i32** %17
store i32 %5, i32* %18
store i32 %6, i32* %19
store i32 %7, i32* %20
store i32 %8, i32* %21
store i32 %9, i32* %22
store i32 %10, i32* %23
store i32 %11, i32* %24
%25 = load i32*, i32** %13
%26 = load float*, float** %14
%27 = load i32*, i32** %15
%28 = load i8*, i8** %16
%29 = load i32*, i32** %17
%30 = load i32, i32* %18
%31 = load i32, i32* %22
%32 = call i32 (i32*, float*, i32*, i8*, i32*, i32, i32, ...) bitcast (i32 (...)* @x2driv_ to i32 (i32*, float*, i32*, i8*, i32*, i32, i32, ...)*)(i32* %25, float* %26, i32* %27, i8* %28, i32* %29, i32 %30, i32 %31)
ret void
}

LLVM IR (-O2):
define void @X2DRIV(i32* %0, float* %1, i32* %2, i8* %3, i32* %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11) {
%13 = tail call i32 (i32*, float*, i32*, i8*, i32*, i32, i32, ...) bitcast (i32 (...)* @x2driv_ to i32 (i32*, float*, i32*, i8*, i32*, i32, i32, ...)*)(i32* %0, float* %1, i32* %2, i8* %3, i32* %4, i32 %5, i32 %9)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int chown(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int fs_chown(char *path, int uid, int gid) {
  return chown(path, (uid_t)uid, (gid_t)gid);
}


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

x86 assembly (clang, -O2):
<fs_chown>:
jmp    1030 <chown@plt>

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

LLVM IR (-O2):
define i32 @fs_chown(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @chown(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int _mm_ucomineq_sd(int /*<<< orphan*/, int /*<<< orphan*/);
int test_mm_ucomineq_sd(__m128d A, __m128d B) { return _mm_ucomineq_sd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_ucomineq_sd>:
jmp    1030 <_mm_ucomineq_sd@plt>

LLVM IR (-O0):
define i32 @test_mm_ucomineq_sd(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 @_mm_ucomineq_sd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_ucomineq_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_ucomineq_sd(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ UStringSearch;

/* Variables and functions */
int /*<<< orphan*/ usearch_close(int /*<<< orphan*/ *);
void icuContainsDelete(void *p) {
  UStringSearch *pSearch = (UStringSearch *)p;
  usearch_close(pSearch);
}


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

x86 assembly (clang, -O2):
<icuContainsDelete>:
jmp    1030 <usearch_close@plt>

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

LLVM IR (-O2):
define void @icuContainsDelete(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @usearch_close(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_symbol(char const *, unsigned long);
void print_fn_descriptor_symbol(const char *fmt, void *addr) {
  print_symbol(fmt, (unsigned long)addr);
}


x86 assembly (clang, -O0):
<print_fn_descriptor_symbol>:
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 <print_symbol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_fn_descriptor_symbol>:
jmp    1030 <print_symbol@plt>

LLVM IR (-O0):
define void @print_fn_descriptor_symbol(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 = ptrtoint i8* %6 to i64
%8 = call i32 @print_symbol(i8* %5, i64 %7)
ret void
}

LLVM IR (-O2):
define void @print_fn_descriptor_symbol(i8* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = tail call i32 @print_symbol(i8* %0, i64 %3)
ret void
}
void us(unsigned short *p, double x) { *p = x; }


x86 assembly (clang, -O0):
<us>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<us>:
cvttsd2si %xmm0,%eax
mov    %ax,(%rdi)
ret

LLVM IR (-O0):
define void @us(i16* %0, double %1) {
%3 = alloca i16*
%4 = alloca double
store i16* %0, i16** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fptoui double %5 to i16
%7 = load i16*, i16** %3
store i16 %6, i16* %7
ret void
}

LLVM IR (-O2):
define void @us(i16* nocapture writeonly %0, double %1) {
%3 = fptoui double %1 to i16
store i16 %3, i16* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ android_compiler_barrier();
extern __attribute__((always_)) void
android_atomic_release_store(int32_t value, volatile int32_t *ptr) {
  android_compiler_barrier();
  *ptr = value;
}


x86 assembly (clang, -O0):
<android_atomic_release_store>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <android_compiler_barrier@plt>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<android_atomic_release_store>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <android_compiler_barrier@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @android_atomic_release_store(i32 %0, i32* %1) {
%3 = tail call i32 (...) @android_compiler_barrier()
store volatile i32 %0, i32* %1
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _TimerBaseValid(scalar_t__ volatile);
uint32_t TimerDMAEventGet(uint32_t ui32Base) {
  ASSERT(_TimerBaseValid(ui32Base));
  return ((*((volatile uint32_t *)(ui32Base + 0x0000006C))));
}


x86 assembly (clang, -O0):
<TimerDMAEventGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <_TimerBaseValid@plt>
mov    %eax,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x6c(%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerDMAEventGet>:
push   %rax
mov    %rdi,(%rsp)
mov    (%rsp),%rdi
call   1040 <_TimerBaseValid@plt>
mov    %eax,%edi
call   1030 <ASSERT@plt>
mov    (%rsp),%rax
mov    0x6c(%rax),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @TimerDMAEventGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = call i32 @_TimerBaseValid(i64 %3)
%5 = call i32 @ASSERT(i32 %4)
%6 = load volatile i64, i64* %2
%7 = add nsw i64 %6, 108
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @TimerDMAEventGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = tail call i32 @_TimerBaseValid(i64 %3)
%5 = tail call i32 @ASSERT(i32 %4)
%6 = load volatile i64, i64* %2
%7 = add nsw i64 %6, 108
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}
/* Variables and functions */
int bbm_byte_write(void *, unsigned short, unsigned char);
signed int bbm_com_byte_write(void *handle, unsigned short addr,
                              unsigned char data) {
  signed int res;
  res = bbm_byte_write(handle, addr, data);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_byte_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %si,%cx
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%ax
movzwl %ax,%esi
movzbl -0xb(%rbp),%edx
call   1030 <bbm_byte_write@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_byte_write>:
jmp    1030 <bbm_byte_write@plt>

LLVM IR (-O0):
define i32 @bbm_com_byte_write(i8* %0, i16 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i8
%7 = alloca i32
store i8* %0, i8** %4
store i16 %1, i16* %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
%9 = load i16, i16* %5
%10 = load i8, i8* %6
%11 = call i32 @bbm_byte_write(i8* %8, i16 zeroext %9, i8 zeroext %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
define i32 @bbm_com_byte_write(i8* %0, i16 zeroext %1, i8 zeroext %2) {
%4 = tail call i32 @bbm_byte_write(i8* %0, i16 zeroext %1, i8 zeroext %2)
ret i32 %4
}
int CLibraryFunction() { return 5; }


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

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

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

LLVM IR (-O2):
define i32 @CLibraryFunction() {
ret i32 5
}
int bq27541_battery_open(struct inode *inode, struct file *filp) { return 0; }


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

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

LLVM IR (-O0):
%struct.inode = type opaque
%struct.file = type opaque
define i32 @bq27541_battery_open(%struct.inode* %0, %struct.file* %1) {
%3 = alloca %struct.inode*
%4 = alloca %struct.file*
store %struct.inode* %0, %struct.inode** %3
store %struct.file* %1, %struct.file** %4
ret i32 0
}

LLVM IR (-O2):
%struct.inode = type opaque
%struct.file = type opaque
define i32 @bq27541_battery_open(%struct.inode* nocapture readnone %0, %struct.file* nocapture readnone %1) {
ret i32 0
}
void destroy_list(double **listval, int *listprop) {
  int i, list_orde;
  list_orde = listprop[1];
  for (i = 0; i < list_orde; i++) {
    free(listval[i]);
  }
  free(listval);
  free(listprop);
}


x86 assembly (clang, -O0):
<destroy_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    115c <destroy_list+0x4c>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1131 <destroy_list+0x21>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_list>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
mov    0x4(%rsi),%r12d
test   %r12d,%r12d
jle    1142 <destroy_list+0x32>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r15,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <destroy_list+0x20>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @destroy_list(double** nocapture %0, i32* nocapture %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 1
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %2
%7 = zext i32 %4 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds double*, double** %0, i64 %9
%11 = bitcast double** %10 to i8**
%12 = load i8*, i8** %11
tail call void @free(i8* %12)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %2
%16 = bitcast double** %0 to i8*
tail call void @free(i8* %16)
%17 = bitcast i32* %1 to i8*
tail call void @free(i8* %17)
ret void
}
int muspcm_start(int slot, int loop) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @muspcm_start(i32 %0, i32 %1) {
ret i32 -1
}
signed int fstatat(signed int __fd, const char *__filename,
                   struct stat *__statbuf, signed int __flag) {
  signed int return_value___fxstatat$1;
  return_value___fxstatat$1 =
      __fxstatat(1, __fd, __filename, __statbuf, __flag);
  return return_value___fxstatat$1;
}


x86 assembly (clang, -O0):
<fstatat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <__fxstatat@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstatat>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <__fxstatat@plt>

LLVM IR (-O0):
%struct.stat = type opaque
define i32 @fstatat(i32 %0, i8* %1, %struct.stat* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca %struct.stat*
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store %struct.stat* %2, %struct.stat** %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = load %struct.stat*, %struct.stat** %7
%13 = load i32, i32* %8
%14 = call i32 (i32, i32, i8*, %struct.stat*, i32, ...) bitcast (i32 (...)* @__fxstatat to i32 (i32, i32, i8*, %struct.stat*, i32, ...)*)(i32 1, i32 %10, i8* %11, %struct.stat* %12, i32 %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @fstatat(i32 %0, i8* %1, %struct.stat* %2, i32 %3) {
%5 = tail call i32 (i32, i32, i8*, %struct.stat*, i32, ...) bitcast (i32 (...)* @__fxstatat to i32 (i32, i32, i8*, %struct.stat*, i32, ...)*)(i32 1, i32 %0, i8* %1, %struct.stat* %2, i32 %3)
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;
struct serializer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ s_w8(struct serializer *, int);
void s_wl16(struct serializer *s, uint16_t u16) {
  s_w8(s, (uint8_t)u16);
  s_w8(s, u16 >> 8);
  return;
}


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

x86 assembly (clang, -O2):
<s_wl16>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <s_w8@plt>
sar    $0x8,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <s_w8@plt>

LLVM IR (-O0):
%struct.serializer = type { i32 }
define void @s_wl16(%struct.serializer* %0, i32 %1) {
%3 = alloca %struct.serializer*
%4 = alloca i32
store %struct.serializer* %0, %struct.serializer** %3
store i32 %1, i32* %4
%5 = load %struct.serializer*, %struct.serializer** %3
%6 = load i32, i32* %4
%7 = call i32 @s_w8(%struct.serializer* %5, i32 %6)
%8 = load %struct.serializer*, %struct.serializer** %3
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = call i32 @s_w8(%struct.serializer* %8, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.serializer = type { i32 }
define void @s_wl16(%struct.serializer* %0, i32 %1) {
%3 = tail call i32 @s_w8(%struct.serializer* %0, i32 %1)
%4 = ashr i32 %1, 8
%5 = tail call i32 @s_w8(%struct.serializer* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test(int arg) {
  printf("arg=%d\n", arg);
  arg = 50;
  printf("arg changed=%d\n\n", arg);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
movl   $0x32,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x32,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"arg=%d\0A\00"
@.str.1 = [17 x i8] c"arg changed=%d\0A\0A\00"
define void @test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 50, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"arg=%d\0A\00"
@.str.1 = [17 x i8] c"arg changed=%d\0A\0A\00"
define void @test(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 50)
ret void
}
int foo(int *c) {
  int i = 0;
  int j = 10;
  while (1) {
    if (i == j)
      break;
    i++;
    j--;
  }
  return j;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1127 <foo+0x27>
jmp    113e <foo+0x3e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <foo+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo(i32* nocapture readnone %0) {
ret i32 5
}
int I_NoAppServicesServerGetClientsFromLobby(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @I_NoAppServicesServerGetClientsFromLobby() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rgph_d2u64(double);
int /*<<< orphan*/ rgph_u32_murmur32s_u64(int /*<<< orphan*/, uintptr_t);
uint32_t rgph_u32_murmur32s_f64(double value, uintptr_t seed) {
  return rgph_u32_murmur32s_u64(rgph_d2u64(value), seed);
}


x86 assembly (clang, -O0):
<rgph_u32_murmur32s_f64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <rgph_d2u64@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <rgph_u32_murmur32s_u64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgph_u32_murmur32s_f64>:
push   %rbx
mov    %rdi,%rbx
call   1030 <rgph_d2u64@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <rgph_u32_murmur32s_u64@plt>

LLVM IR (-O0):
define i32 @rgph_u32_murmur32s_f64(double %0, i64 %1) {
%3 = alloca double
%4 = alloca i64
store double %0, double* %3
store i64 %1, i64* %4
%5 = load double, double* %3
%6 = call i32 @rgph_d2u64(double %5)
%7 = load i64, i64* %4
%8 = call i32 @rgph_u32_murmur32s_u64(i32 %6, i64 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @rgph_u32_murmur32s_f64(double %0, i64 %1) {
%3 = tail call i32 @rgph_d2u64(double %0)
%4 = tail call i32 @rgph_u32_murmur32s_u64(i32 %3, i64 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void print_byte(int i) {
  unsigned char c = i;
  printf("%c", c);
}


x86 assembly (clang, -O0):
<print_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
lea    0xed8(%rip),%rdi
movzbl -0x5(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_byte>:
movzbl %dil,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @print_byte(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 zeroext %2)
ret void
}
void main(void) {
  static const char msg[] = "hello world\r\n";
  char *str;
  char ch;
  str = msg;
  do {
    ch = *str++;
  } while (ch);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
cmpb   $0x0,-0x9(%rbp)
jne    110f <main+0xf>
pop    %rbp
ret

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

LLVM IR (-O0):
@main.msg = internal constant [14 x i8] c"hello world\0D\0A\00"
define void @main() {
%1 = alloca i8*
%2 = alloca i8
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @main.msg, i64 0, i64 0), i8** %1
br label %3
3: ; preds = %7, %0
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i32 1
store i8* %5, i8** %1
%6 = load i8, i8* %4
store i8 %6, i8* %2
br label %7
7: ; preds = %3
%8 = load i8, i8* %2
%9 = icmp ne i8 %8, 0
br i1 %9, label %3, label %10
10: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
float log2(float);
float LOG2(float x) { return log2(x); }


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

x86 assembly (clang, -O2):
<LOG2>:
jmp    1030 <log2@plt>

LLVM IR (-O0):
define float @LOG2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @log2(float %3)
ret float %4
}

LLVM IR (-O2):
define float @LOG2(float %0) {
%2 = tail call float @log2(float %0)
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(int *, int, int, int /*<<< orphan*/ *);
void ecrire_int_binaire(FILE *fichier, int entier) {
  fwrite(&entier, 4, 1, fichier);
}


x86 assembly (clang, -O0):
<ecrire_int_binaire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecrire_int_binaire>:
push   %rax
mov    %rdi,%rcx
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @ecrire_int_binaire(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 @fwrite(i32* %4, i32 4, i32 1, i32* %5)
ret void
}

LLVM IR (-O2):
define void @ecrire_int_binaire(i32* nocapture %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
size_t fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int fgetc(FILE *stream) {
  unsigned char c;
  size_t ret = fread(&c, 1, 1, stream);
  return ret == 1 ? c : EOF;
}


x86 assembly (clang, -O0):
<fgetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0x9(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x1,-0x18(%rbp)
jne    114b <fgetc+0x3b>
movzbl -0x9(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1157 <fgetc+0x47>
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetc>:
push   %rax
mov    %rdi,%rcx
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%rax
je     1139 <fgetc+0x29>
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
movzbl 0x7(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @fgetc(i32* nocapture %0) {
%2 = alloca i8
%3 = call i64 @fread(i8* %2, i32 1, i32 1, i32* %0)
%4 = icmp eq i64 %3, 1
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = load i32, i32* @EOF
%8 = select i1 %4, i32 %6, i32 %7
ret i32 %8
}
__attribute__((no, noclone)) unsigned long long f3(unsigned x) {
  return ((unsigned long long)x) << 4;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
mov    %edi,%eax
shl    $0x4,%rax
ret

LLVM IR (-O0):
define i64 @f3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = shl i64 %4, 4
ret i64 %5
}

LLVM IR (-O2):
define i64 @f3(i32 %0) {
%2 = zext i32 %0 to i64
%3 = shl nuw nsw i64 %2, 4
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ emit_sarimm(int, int, int);
int /*<<< orphan*/ emit_shlimm(int, int, int);
void emit_movswl_reg(int rs, int rt) {
  emit_shlimm(rs, 16, rt);
  emit_sarimm(rt, 16, rt);
}


x86 assembly (clang, -O0):
<emit_movswl_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x10,%esi
call   1040 <emit_shlimm@plt>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x10,%esi
call   1030 <emit_sarimm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_movswl_reg>:
push   %rbx
mov    %esi,%ebx
mov    $0x10,%esi
mov    %ebx,%edx
call   1040 <emit_shlimm@plt>
mov    %ebx,%edi
mov    $0x10,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <emit_sarimm@plt>

LLVM IR (-O0):
define void @emit_movswl_reg(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 @emit_shlimm(i32 %5, i32 16, i32 %6)
%8 = load i32, i32* %4
%9 = load i32, i32* %4
%10 = call i32 @emit_sarimm(i32 %8, i32 16, i32 %9)
ret void
}

LLVM IR (-O2):
define void @emit_movswl_reg(i32 %0, i32 %1) {
%3 = tail call i32 @emit_shlimm(i32 %0, i32 16, i32 %1)
%4 = tail call i32 @emit_sarimm(i32 %1, i32 16, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ USB_PHY2_DriverIRQHandler();
__attribute__((weak)) void USB_PHY2_IRQHandler(void) {
  USB_PHY2_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @USB_PHY2_IRQHandler() {
%1 = call i32 (...) @USB_PHY2_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @USB_PHY2_IRQHandler() {
%1 = tail call i32 (...) @USB_PHY2_DriverIRQHandler()
ret void
}
/* Variables and functions */
int SQLITE_OK;
int atoi(char *);
int hgd_get_num_votes_cb(void *arg, int argc, char **data, char **names) {
  int *num = (int *)arg;
  (void)argc;
  (void)names;
  *num = atoi(data[0]);
  return (SQLITE_OK);
}


x86 assembly (clang, -O0):
<hgd_get_num_votes_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hgd_get_num_votes_cb>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdx),%rdi
call   1030 <atoi@plt>
mov    %eax,(%rbx)
mov    0x2ec3(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@SQLITE_OK = global i32 0
define i32 @hgd_get_num_votes_cb(i8* %0, i32 %1, i8** %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8**
%9 = alloca i32*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
store i32* %11, i32** %9
%12 = load i32, i32* %6
%13 = load i8**, i8*** %8
%14 = load i8**, i8*** %7
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
%18 = load i32*, i32** %9
store i32 %17, i32* %18
%19 = load i32, i32* @SQLITE_OK
ret i32 %19
}

LLVM IR (-O2):
@SQLITE_OK = global i32 0
define i32 @hgd_get_num_votes_cb(i8* nocapture writeonly %0, i32 %1, i8** nocapture %2, i8** nocapture readnone %3) {
%5 = bitcast i8* %0 to i32*
%6 = load i8*, i8** %2
%7 = tail call i32 @atoi(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* @SQLITE_OK
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ test_xmlschema_comment_entities();
int /*<<< orphan*/ test_xmlschema_comments();
void all_xmlschema_tests() {
  test_xmlschema_comments();
  test_xmlschema_comment_entities();
}


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

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

LLVM IR (-O0):
define void @all_xmlschema_tests() {
%1 = call i32 (...) @test_xmlschema_comments()
%2 = call i32 (...) @test_xmlschema_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_xmlschema_tests() {
%1 = tail call i32 (...) @test_xmlschema_comments()
%2 = tail call i32 (...) @test_xmlschema_comment_entities()
ret void
}
void message_handler_req_lib_amf_componenterrorclear(void *conn, void *msg) {}


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

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

LLVM IR (-O0):
define void @message_handler_req_lib_amf_componenterrorclear(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @message_handler_req_lib_amf_componenterrorclear(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void gtk_viewport_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_viewport_new() {
ret void
}
/* Variables and functions */
int second_smallest(int *, int);
int test_two_elements() {
  int input[] = {1, 0};
  return second_smallest(input, 2) == 1;
}


x86 assembly (clang, -O0):
<test_two_elements>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1030 <second_smallest@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_two_elements>:
push   %rax
movq   $0x1,(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
call   1030 <second_smallest@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.test_two_elements.input = [2 x i32] [i32 1, i32 0]
define i32 @test_two_elements() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = call i32 @second_smallest(i32* %3, i32 2)
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test_two_elements() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 1, i64* %1
%3 = bitcast i64* %1 to i32*
%4 = call i32 @second_smallest(i32* %3, i32 2)
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  bar(1);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <bar@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <bar@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @bar(i32 1)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bar(i32 1)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int pow(int, int);
int sqrOfSum(int x) {
  int sum = (1 + x) * x / 2;
  return pow(sum, 2);
}


x86 assembly (clang, -O0):
<sqrOfSum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
imul   -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrOfSum>:
lea    0x1(%rdi),%eax
imul   %eax,%edi
mov    %edi,%eax
shr    $0x1f,%eax
add    %eax,%edi
sar    %edi
mov    $0x2,%esi
jmp    1030 <pow@plt>

LLVM IR (-O0):
define i32 @sqrOfSum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 1, %4
%6 = load i32, i32* %2
%7 = mul nsw i32 %5, %6
%8 = sdiv i32 %7, 2
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @pow(i32 %9, i32 2)
ret i32 %10
}

LLVM IR (-O2):
define i32 @sqrOfSum(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = mul nsw i32 %2, %0
%4 = sdiv i32 %3, 2
%5 = tail call i32 @pow(i32 %4, i32 2)
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int hammingWeight_naive(uint32_t n) {
  uint32_t i;
  int dist;
  dist = 0;
  i = n;
  while (i > 0) {
    if (i & 1)
      dist++;
    i >>= 1;
  }
  return dist;
}


x86 assembly (clang, -O0):
<hammingWeight_naive>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1144 <hammingWeight_naive+0x44>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1136 <hammingWeight_naive+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1114 <hammingWeight_naive+0x14>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hammingWeight_naive>:
xor    %eax,%eax
test   %edi,%edi
jle    1120 <hammingWeight_naive+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <hammingWeight_naive+0x10>
ret

LLVM IR (-O0):
define i32 @hammingWeight_naive(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
%5 = load i32, i32* %2
store i32 %5, i32* %3
br label %6
6: ; preds = %16, %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i32, i32* %3
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %16
16: ; preds = %13, %9
%17 = load i32, i32* %3
%18 = ashr i32 %17, 1
store i32 %18, i32* %3
br label %6
19: ; preds = %6
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @hammingWeight_naive(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %4, %6
%8 = lshr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
int main() { printf(&1 ["\021%six\012\0"], (1)["have"] + "fun" - 0x60); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movsbl 0xeee(%rip),%eax
cltq
lea    0xee9(%rip),%rsi
add    %rax,%rsi
add    $0xffffffffffffffa0,%rsi
lea    0xece(%rip),%rdi
add    $0x1,%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"\11%six\0A\00\00"
@.str.1 = [5 x i8] c"have\00"
@.str.2 = [4 x i8] c"fun\00"
define i32 @main() {
%1 = load i8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 1)
%2 = sext i8 %1 to i32
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -96
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 1), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"\11%six\0A\00\00"
@.str.2 = [4 x i8] c"fun\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 1), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 1))
ret i32 0
}
unsigned xrop3_17_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = D | S;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_17_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_17_1_1>:
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %edi,%esi
not    %edi
shl    $0x8,%edi
not    %eax
and    %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_17_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
store i32 %14, i32* %6
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 8
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
store i32 %20, i32* %7
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = or i32 %21, %22
store i32 %23, i32* %8
%24 = load i32, i32* %8
%25 = xor i32 %24, -1
store i32 %25, i32* %8
%26 = load i32, i32* %8
%27 = load i32, i32* %6
%28 = xor i32 %27, -1
%29 = and i32 %26, %28
%30 = load i32, i32* %7
%31 = xor i32 %30, -1
%32 = and i32 %29, %31
%33 = load i32, i32* %5
%34 = load i32, i32* %6
%35 = and i32 %33, %34
%36 = or i32 %32, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %7
%39 = and i32 %37, %38
%40 = or i32 %36, %39
ret i32 %40
}

LLVM IR (-O2):
define i32 @xrop3_17_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = mul nuw nsw i32 %4, 257
%6 = xor i32 %3, -1
%7 = shl nsw i32 %6, 8
%8 = xor i32 %5, -1
%9 = and i32 %7, %8
%10 = or i8 %1, %0
%11 = zext i8 %10 to i32
%12 = or i32 %9, %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ lcase(char *);
char *popString();
int /*<<< orphan*/ pushString(int /*<<< orphan*/);
void basLCase() {
  char *string;
  string = popString();
  pushString(lcase(string));
}


x86 assembly (clang, -O0):
<basLCase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <popString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <lcase@plt>
mov    %eax,%edi
call   1050 <pushString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basLCase>:
push   %rax
xor    %eax,%eax
call   1040 <popString@plt>
mov    %rax,%rdi
call   1030 <lcase@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <pushString@plt>

LLVM IR (-O0):
define void @basLCase() {
%1 = alloca i8*
%2 = call i8* (...) @popString()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @lcase(i8* %3)
%5 = call i32 @pushString(i32 %4)
ret void
}

LLVM IR (-O2):
define void @basLCase() {
%1 = tail call i8* (...) @popString()
%2 = tail call i32 @lcase(i8* %1)
%3 = tail call i32 @pushString(i32 %2)
ret void
}
void modif_rear_unit2MODIF_MULTILINE() {}


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

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

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

LLVM IR (-O2):
define void @modif_rear_unit2MODIF_MULTILINE() {
ret void
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  int i = INT_MAX;
  printf("%i %i %i\n", i, i + 1, i + 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
add    $0x1,%edx
mov    -0x8(%rbp),%ecx
add    $0x2,%ecx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0x1(%rsi),%edx
lea    0x2(%rsi),%ecx
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@INT_MAX = global i32 0
@.str = [10 x i8] c"%i %i %i\0A\00"
define i32 @main() {
%1 = load i32, i32* @INT_MAX
%2 = add nsw i32 %1, 1
%3 = add nsw i32 %1, 2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3)
ret i32 0
}