xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ print_ophead(int, char const *, int);
int /*<<< orphan*/ printf(char *, int, int, int);
void print_vx_vy_n(uint16_t op, const char *name, int index) {
  print_ophead(op, name, index);
  printf("V%X, V%X, %X\n", (op & 0x0F00) >> 8, (op & 0x00F0) >> 4, op & 0x000F);
}


x86 assembly (clang, -O0):
<print_vx_vy_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <print_ophead@plt>
mov    -0x4(%rbp),%esi
and    $0xf00,%esi
sar    $0x8,%esi
mov    -0x4(%rbp),%edx
and    $0xf0,%edx
sar    $0x4,%edx
mov    -0x4(%rbp),%ecx
and    $0xf,%ecx
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_vx_vy_n>:
push   %rbx
mov    %edi,%ebx
call   1040 <print_ophead@plt>
mov    %ebx,%esi
shr    $0x8,%esi
and    $0xf,%esi
mov    %ebx,%edx
shr    $0x4,%edx
and    $0xf,%edx
and    $0xf,%ebx
lea    0xebe(%rip),%rdi
mov    %ebx,%ecx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"V%X, V%X, %X\0A\00"
define void @print_vx_vy_n(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @print_ophead(i32 %7, i8* %8, i32 %9)
%11 = load i32, i32* %4
%12 = and i32 %11, 3840
%13 = ashr i32 %12, 8
%14 = load i32, i32* %4
%15 = and i32 %14, 240
%16 = ashr i32 %15, 4
%17 = load i32, i32* %4
%18 = and i32 %17, 15
%19 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %16, i32 %18)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"V%X, V%X, %X\0A\00"
define void @print_vx_vy_n(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @print_ophead(i32 %0, i8* %1, i32 %2)
%5 = lshr i32 %0, 8
%6 = and i32 %5, 15
%7 = lshr i32 %0, 4
%8 = and i32 %7, 15
%9 = and i32 %0, 15
%10 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_ext_device_restore_read_formats_all() {
  printf("NOT IMPLEMENTED:"
         "pa_ext_device_restore_read_formats_all"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [55 x i8] c"NOT IMPLEMENTED:pa_ext_device_restore_read_formats_all\00"
define i32 @pa_ext_device_restore_read_formats_all() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void ncui_deinit(void) { endwin(); }


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

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

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

LLVM IR (-O2):
define void @ncui_deinit() {
%1 = tail call i32 (...) @endwin()
ret void
}
const char *chaz_OS_exe_ext(void) { return ""; }


x86 assembly (clang, -O0):
<chaz_OS_exe_ext>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chaz_OS_exe_ext>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @chaz_OS_exe_ext() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @chaz_OS_exe_ext() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ Show_library(int /*<<< orphan*/);
int /*<<< orphan*/ triList(int);
void IF_show_libstd(void) { Show_library(triList(1)); }


x86 assembly (clang, -O0):
<IF_show_libstd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <triList@plt>
mov    %eax,%edi
call   1030 <Show_library@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_show_libstd>:
push   %rax
mov    $0x1,%edi
call   1040 <triList@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <Show_library@plt>

LLVM IR (-O0):
define void @IF_show_libstd() {
%1 = call i32 @triList(i32 1)
%2 = call i32 @Show_library(i32 %1)
ret void
}

LLVM IR (-O2):
define void @IF_show_libstd() {
%1 = tail call i32 @triList(i32 1)
%2 = tail call i32 @Show_library(i32 %1)
ret void
}
int _strlen(const char *x) {
  int n = 0;
  while (x[n])
    n++;
  return n;
}


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

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

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

LLVM IR (-O2):
define i32 @_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ arch_local_irq_disable();
unsigned long arch_local_save_flags();
unsigned long arch_local_irq_save(void) {
  unsigned long flags = arch_local_save_flags();
  arch_local_irq_disable();
  return flags;
}


x86 assembly (clang, -O0):
<arch_local_irq_save>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <arch_local_save_flags@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <arch_local_irq_disable@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_local_irq_save>:
push   %rbx
xor    %eax,%eax
call   1040 <arch_local_save_flags@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <arch_local_irq_disable@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @arch_local_irq_save() {
%1 = alloca i64
%2 = call i64 (...) @arch_local_save_flags()
store i64 %2, i64* %1
%3 = call i32 (...) @arch_local_irq_disable()
%4 = load i64, i64* %1
ret i64 %4
}

LLVM IR (-O2):
define i64 @arch_local_irq_save() {
%1 = tail call i64 (...) @arch_local_save_flags()
%2 = tail call i32 (...) @arch_local_irq_disable()
ret i64 %1
}
/* Variables and functions */
int lge_set_qlut();
int refresh_qlut_kcal_display(void) { return lge_set_qlut(); }


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

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

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

LLVM IR (-O2):
define i32 @refresh_qlut_kcal_display() {
%1 = tail call i32 (...) @lge_set_qlut()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int singleNumber(int *, int);
int main() {
  int x[4] = {1, 1, 1, 2};
  printf("%d\n", singleNumber(x, 4));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1030 <singleNumber@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
call   1030 <singleNumber@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.x = [4 x i32] [i32 1, i32 1, i32 1, i32 2]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @singleNumber(i32* %3, i32 4)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void irq_enable(void) { __asm__ __volatile__("sti"); }


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

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

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

LLVM IR (-O2):
define void @irq_enable() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct obj {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cintern(char *);
int /*<<< orphan*/ setvar(int /*<<< orphan*/, int /*<<< orphan*/, struct obj *);
void init_acct_version(void) {
  setvar(cintern("*acct-version*"),
         cintern("$Id: acct.c,v 1.1 1996/10/17 18:40:18 gjc Exp $"),
         ((struct obj *)0));
}


x86 assembly (clang, -O0):
<init_acct_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <cintern@plt>
mov    %eax,-0x4(%rbp)
lea    0xed1(%rip),%rdi
call   1040 <cintern@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <setvar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_acct_version>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1040 <cintern@plt>
mov    %eax,%ebx
lea    0xed9(%rip),%rdi
call   1040 <cintern@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <setvar@plt>

LLVM IR (-O0):
%struct.obj = type { i32 }
@.str = [15 x i8] c"*acct-version*\00"
@.str.1 = [48 x i8] c"$Id: acct.c,v 1.1 1996/10/17 18:40:18 gjc Exp $\00"
define void @init_acct_version() {
%1 = call i32 @cintern(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @cintern(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @setvar(i32 %1, i32 %2, %struct.obj* null)
ret void
}

LLVM IR (-O2):
%struct.obj = type { i32 }
@.str = [15 x i8] c"*acct-version*\00"
@.str.1 = [48 x i8] c"$Id: acct.c,v 1.1 1996/10/17 18:40:18 gjc Exp $\00"
define void @init_acct_version() {
%1 = tail call i32 @cintern(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @cintern(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @setvar(i32 %1, i32 %2, %struct.obj* null)
ret void
}
/* Variables and functions */
int jffs2_compressor_Xable(char const *, int /*<<< orphan*/);
int jffs2_enable_compressor_name(const char *name) {
  return jffs2_compressor_Xable(name, 0);
}


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

x86 assembly (clang, -O2):
<jffs2_enable_compressor_name>:
xor    %esi,%esi
jmp    1030 <jffs2_compressor_Xable@plt>

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

LLVM IR (-O2):
define i32 @jffs2_enable_compressor_name(i8* %0) {
%2 = tail call i32 @jffs2_compressor_Xable(i8* %0, i32 0)
ret i32 %2
}
int monotonic_decrease(int *ordg, int filenum) {
  int i;
  for (i = 1; i <= filenum - 1; i++)
    if (ordg[i] > ordg[i - 1])
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<monotonic_decrease>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1163 <monotonic_decrease+0x63>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jle    1150 <monotonic_decrease+0x50>
movl   $0x0,-0x4(%rbp)
jmp    116a <monotonic_decrease+0x6a>
jmp    1155 <monotonic_decrease+0x55>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <monotonic_decrease+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<monotonic_decrease>:
mov    $0x1,%eax
cmp    $0x2,%esi
jl     1132 <monotonic_decrease+0x32>
mov    %esi,%r8d
mov    (%rdi),%edx
mov    $0x1,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edx,%ecx
mov    (%rdi,%rsi,4),%edx
cmp    %ecx,%edx
jg     1133 <monotonic_decrease+0x33>
add    $0x1,%rsi
cmp    %rsi,%r8
jne    1120 <monotonic_decrease+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @monotonic_decrease(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = load i32, i32* %0
br label %9
7: ; preds = %9
%8 = icmp eq i64 %15, %5
br i1 %8, label %16, label %9
9: ; preds = %4, %7
%10 = phi i32 [ %6, %4 ], [ %13, %7 ]
%11 = phi i64 [ 1, %4 ], [ %15, %7 ]
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = icmp sgt i32 %13, %10
%15 = add nuw nsw i64 %11, 1
br i1 %14, label %16, label %7
16: ; preds = %9, %7, %2
%17 = phi i32 [ 1, %2 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %17
}
/* Variables and functions */
int strlen(char *);
void strip(char *s) {
  int pos = strlen(s) - 1;
  if (s[pos] == '\n')
    s[pos] = '\0';
}


x86 assembly (clang, -O0):
<strip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    114c <strip+0x3c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1127 <strip+0x17>
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @strip(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 0, i8* %5
br label %9
9: ; preds = %8, %1
ret void
}
void enable_dclk_interrupt() {
  (*(volatile unsigned long *)(((0xFFFFF000) + 0x010))) = 0x04000;
}


x86 assembly (clang, -O0):
<enable_dclk_interrupt>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffff010,%eax
movq   $0x4000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_dclk_interrupt>:
mov    $0xfffff010,%eax
movq   $0x4000,(%rax)
ret

LLVM IR (-O0):
define void @enable_dclk_interrupt() {
store volatile i64 16384, i64* inttoptr (i64 4294963216 to i64*)
ret void
}

LLVM IR (-O2):
define void @enable_dclk_interrupt() {
store volatile i64 16384, i64* inttoptr (i64 4294963216 to i64*)
ret void
}
int test_imm_4Buint8_reg(unsigned char val) {
  return ((val) & (0x4B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Buint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x4b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_4Buint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 75
%6 = icmp ne i32 %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_4Buint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 75
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
char *strdup(char const *);
char *xstrdup(const char *str) {
  char *s = strdup(str);
  if (NULL == s)
    fatal("Out of memory");
  return s;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1151 <xstrdup+0x31>
lea    0xeb4(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1030 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xstrdup+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* null, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
char *stpcpy(char *dest, const char *src) {
  unsigned i = 0;
  for (; src[i]; ++i)
    dest[i] = src[i];
  dest[i] = 0;
  return dest + i;
}


x86 assembly (clang, -O0):
<stpcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
cmpb   $0x0,(%rax,%rcx,1)
je     1146 <stpcpy+0x46>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <stpcpy+0x13>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stpcpy>:
mov    (%rsi),%al
xor    %ecx,%ecx
test   %al,%al
je     1120 <stpcpy+0x20>
nopl   0x0(%rax,%rax,1)
mov    %al,(%rdi,%rcx,1)
add    $0x1,%ecx
movzbl (%rsi,%rcx,1),%eax
test   %al,%al
jne    1110 <stpcpy+0x10>
mov    %ecx,%ecx
lea    (%rdi,%rcx,1),%rax
movb   $0x0,(%rdi,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @stpcpy(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i64 [ %11, %5 ], [ 0, %2 ]
%8 = phi i32 [ %10, %5 ], [ 0, %2 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %6, i8* %9
%10 = add i32 %8, 1
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %1, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5
%16 = zext i32 %10 to i64
br label %17
17: ; preds = %2, %15
%18 = phi i64 [ %16, %15 ], [ 0, %2 ]
%19 = getelementptr inbounds i8, i8* %0, i64 %18
store i8 0, i8* %19
ret i8* %19
}
/* Variables and functions */
int /*<<< orphan*/ operation_sleep();
int /*<<< orphan*/ set_wakeup_timer(int /*<<< orphan*/, int, int);
void operation_sleep_notimer(void) {
  set_wakeup_timer(0, 0x0, 0x0);
  operation_sleep();
}


x86 assembly (clang, -O0):
<operation_sleep_notimer>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1040 <set_wakeup_timer@plt>
mov    $0x0,%al
call   1030 <operation_sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<operation_sleep_notimer>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <set_wakeup_timer@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <operation_sleep@plt>

LLVM IR (-O0):
define void @operation_sleep_notimer() {
%1 = call i32 @set_wakeup_timer(i32 0, i32 0, i32 0)
%2 = call i32 (...) @operation_sleep()
ret void
}

LLVM IR (-O2):
define void @operation_sleep_notimer() {
%1 = tail call i32 @set_wakeup_timer(i32 0, i32 0, i32 0)
%2 = tail call i32 (...) @operation_sleep()
ret void
}
int ft_iterative_factorial(int nb) {
  int fact;
  int i;
  fact = 1;
  if ((nb == 0) || (nb == 1))
    return (1);
  if ((nb < 0) || (nb > 12))
    return (0);
  else {
    while (i < nb) {
      i++;
      fact *= i;
    }
    return (fact);
  }
  return (fact);
}


x86 assembly (clang, -O0):
<ft_iterative_factorial>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1122 <ft_iterative_factorial+0x22>
cmpl   $0x1,-0x8(%rbp)
jne    112e <ft_iterative_factorial+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    117d <ft_iterative_factorial+0x7d>
cmpl   $0x0,-0x8(%rbp)
jl     1142 <ft_iterative_factorial+0x42>
cmpl   $0xc,-0x8(%rbp)
jle    114e <ft_iterative_factorial+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    117d <ft_iterative_factorial+0x7d>
jmp    1153 <ft_iterative_factorial+0x53>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1177 <ft_iterative_factorial+0x77>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1153 <ft_iterative_factorial+0x53>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_iterative_factorial>:
xor    %eax,%eax
cmp    $0xd,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ft_iterative_factorial(i32 %0) {
%2 = icmp ult i32 %0, 13
%3 = zext i1 %2 to i32
ret i32 %3
}
int foo(int x) { return 5; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 5
}
/* Variables and functions */
int manacher(char *);
int /*<<< orphan*/ printf(char *, int);
void main() {
  char str[] = "aaabbbccccbtestktsetcaa";
  printf("%d\n", manacher(str));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <manacher@plt>
mov    %eax,%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x61616374657374,%rax
mov    %rax,0x10(%rsp)
mov    %rsp,%rdi
call   1040 <manacher@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.str = [24 x i8] c"aaabbbccccbtestktsetcaa\00"
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = alloca [24 x i8]
%2 = bitcast [24 x i8]* %1 to i8*
%3 = getelementptr inbounds [24 x i8], [24 x i8]* %1, i64 0, i64 0
%4 = call i32 @manacher(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@__const.main.str = [24 x i8] c"aaabbbccccbtestktsetcaa\00"
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = alloca [24 x i8]
%2 = getelementptr inbounds [24 x i8], [24 x i8]* %1, i64 0, i64 0
%3 = call i32 @manacher(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
long long phi(long long);
long long int f(long long int n) {
  long long int i, j, k;
  j = 0;
  for (i = 1; i <= n; i++) {
    j = j + phi(i);
  }
  k = 1 + j;
  return k;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jg     116a <f+0x5a>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <phi@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112c <f+0x1c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
jle    1153 <f+0x43>
mov    %rdi,%r14
neg    %r14
mov    $0x1,%ebx
xor    %r15d,%r15d
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <phi@plt>
add    %rax,%r15
lea    (%r14,%rbx,1),%rax
add    $0x1,%rax
add    $0x1,%rbx
cmp    $0x1,%rax
jne    1130 <f+0x20>
add    $0x1,%r15
jmp    1159 <f+0x49>
mov    $0x1,%r15d
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @f(i64 %0) {
%2 = icmp slt i64 %0, 1
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 1, %1 ]
%5 = phi i64 [ %7, %3 ], [ 0, %1 ]
%6 = tail call i64 @phi(i64 %4)
%7 = add nsw i64 %6, %5
%8 = add nuw i64 %4, 1
%9 = icmp eq i64 %4, %0
br i1 %9, label %10, label %3
10: ; preds = %3
%11 = add i64 %7, 1
br label %12
12: ; preds = %10, %1
%13 = phi i64 [ 1, %1 ], [ %11, %10 ]
ret i64 %13
}
void socketDeinit() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @RTAvlrooGCPtrGet() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_fb_jpeg(char *, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
int main() { write_fb_jpeg("/root/time-lapse/tl-270/img00001.jpg", 0, 0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <write_fb_jpeg@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [37 x i8] c"/root/time-lapse/tl-270/img00001.jpg\00"
define i32 @main() {
%1 = call i32 @write_fb_jpeg(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"/root/time-lapse/tl-270/img00001.jpg\00"
define i32 @main() {
%1 = tail call i32 @write_fb_jpeg(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ w5100_write_byte(int, unsigned int);
void w5100_writeUPORT(unsigned data) {
  w5100_write_byte(0x002E, data >> 8);
  w5100_write_byte(0x002E + 1, data & 0xFF);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
shr    $0x8,%esi
mov    $0x2e,%edi
call   1030 <w5100_write_byte@plt>
mov    -0x4(%rbp),%esi
and    $0xff,%esi
mov    $0x2f,%edi
call   1030 <w5100_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %edi,%ebx
mov    %edi,%esi
shr    $0x8,%esi
mov    $0x2e,%edi
call   1030 <w5100_write_byte@plt>
movzbl %bl,%esi
mov    $0x2f,%edi
pop    %rbx
jmp    1030 <w5100_write_byte@plt>

LLVM IR (-O0):
define void @w5100_writeUPORT(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 8
%5 = call i32 @w5100_write_byte(i32 46, i32 %4)
%6 = load i32, i32* %2
%7 = and i32 %6, 255
%8 = call i32 @w5100_write_byte(i32 47, i32 %7)
ret void
}

LLVM IR (-O2):
define void @w5100_writeUPORT(i32 %0) {
%2 = lshr i32 %0, 8
%3 = tail call i32 @w5100_write_byte(i32 46, i32 %2)
%4 = and i32 %0, 255
%5 = tail call i32 @w5100_write_byte(i32 47, i32 %4)
ret void
}
/* Forward declarations */
typedef struct s TYPE_1__;

/* Type definitions */
struct s {
  char *name;
};

/* Variables and functions */
int /*<<< orphan*/ gaz(TYPE_1__ *);
void f4() {
  static struct s { char *name; } x = {"hello"};
  gaz(&x);
}


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

x86 assembly (clang, -O2):
<f4>:
lea    0x2f11(%rip),%rdi
jmp    1030 <gaz@plt>

LLVM IR (-O0):
%struct.s = type { i8* }
%struct.s.0 = type { i8* }
@f4.x = internal global %struct.s { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0) }
@.str = [6 x i8] c"hello\00"
define void @f4() {
%1 = call i32 @gaz(%struct.s.0* bitcast (%struct.s* @f4.x to %struct.s.0*))
ret void
}

LLVM IR (-O2):
%struct.s = type { i8* }
%struct.s.0 = type { i8* }
@f4.x = internal global %struct.s { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0) }
@.str = [6 x i8] c"hello\00"
define void @f4() {
%1 = tail call i32 @gaz(%struct.s.0* bitcast (%struct.s* @f4.x to %struct.s.0*))
ret void
}
int test_any_MSB_one(unsigned x) {
  int i;
  for (i = (sizeof(int) << 3) - 8; i < (sizeof(int) << 3); i++)
    if (x & (1 << i))
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<test_any_MSB_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x18,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x20,%rax
jae    1155 <test_any_MSB_one+0x55>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1142 <test_any_MSB_one+0x42>
movl   $0x1,-0x4(%rbp)
jmp    115c <test_any_MSB_one+0x5c>
jmp    1147 <test_any_MSB_one+0x47>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <test_any_MSB_one+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_any_MSB_one>:
xor    %eax,%eax
cmp    $0x1000000,%edi
setae  %al
ret

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

LLVM IR (-O2):
define i32 @test_any_MSB_one(i32 %0) {
%2 = icmp ugt i32 %0, 16777215
%3 = zext i1 %2 to i32
ret i32 %3
}
void foo105() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
sig_t setsig(int sig, sig_t handler) { return signal(sig, handler); }


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

x86 assembly (clang, -O2):
<setsig>:
jmp    1030 <signal@plt>

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

LLVM IR (-O2):
define i32 @setsig(i32 %0, i32 %1) {
%3 = tail call i32 @signal(i32 %0, i32 %1)
ret i32 %3
}
int sprintf_char(char *str, int c) {
  *str = c;
  return 1;
}


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

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

LLVM IR (-O0):
define i32 @sprintf_char(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = trunc i32 %5 to i8
%7 = load i8*, i8** %3
store i8 %6, i8* %7
ret i32 1
}

LLVM IR (-O2):
define i32 @sprintf_char(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
int main() {
  int i = 10;
  const int *const p = &i;
  printf("%d\n", *p);
  i++;
  printf("%d\n", *p);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 11)
ret i32 0
}
char const *basefilename(char const *p) {
  char const *b = p, *q = p;
  for (;;)
    switch (*q++) {
    case '/':
      b = q;
      break;
    case 0:
      return b;
    }
}


x86 assembly (clang, -O0):
<basefilename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
test   %eax,%eax
je     1158 <basefilename+0x58>
jmp    113a <basefilename+0x3a>
mov    -0x1c(%rbp),%eax
sub    $0x2f,%eax
jne    115e <basefilename+0x5e>
jmp    114b <basefilename+0x4b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    115e <basefilename+0x5e>
mov    -0x10(%rbp),%rax
pop    %rbp
ret
jmp    1118 <basefilename+0x18>

x86 assembly (clang, -O2):
<basefilename>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
movsbl (%rcx),%edx
add    $0x1,%rcx
cmp    $0x2f,%edx
je     1122 <basefilename+0x22>
test   %edx,%edx
jne    1110 <basefilename+0x10>
jmp    1127 <basefilename+0x27>
mov    %rcx,%rax
jmp    1110 <basefilename+0x10>
ret

LLVM IR (-O0):
define i8* @basefilename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %2
store i8* %6, i8** %4
br label %7
7: ; preds = %16, %1
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %4
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
switch i32 %11, label %16 [
i32 47, label %12
i32 0, label %14
]
12: ; preds = %7
%13 = load i8*, i8** %4
store i8* %13, i8** %3
br label %16
14: ; preds = %7
%15 = load i8*, i8** %3
ret i8* %15
16: ; preds = %7, %12
br label %7
}

LLVM IR (-O2):
define i8* @basefilename(i8* %0) {
br label %2
2: ; preds = %4, %1
%3 = phi i8* [ %0, %1 ], [ %6, %4 ]
br label %4
4: ; preds = %2, %4
%5 = phi i8* [ %6, %4 ], [ %3, %2 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
switch i32 %8, label %4 [
i32 47, label %2
i32 0, label %9
]
9: ; preds = %4
ret i8* %3
}
int nxtd_bt_init() { return 0; }


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

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

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

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

/* Variables and functions */
int __sfileno(int /*<<< orphan*/ *);
int fileno(FILE *fp) { return (__sfileno(fp)); }


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

x86 assembly (clang, -O2):
<fileno>:
jmp    1030 <__sfileno@plt>

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

LLVM IR (-O2):
define i32 @fileno(i32* %0) {
%2 = tail call i32 @__sfileno(i32* %0)
ret i32 %2
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ errno;
scalar_t__ stat(char const *, struct stat *);
bool path_exists(const char *path) {
  struct stat buf;
  bool found;
  found = (stat(path, &buf) == 0);
  errno = 0;
  return found;
}


x86 assembly (clang, -O0):
<path_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    0x2ea1(%rip),%rax
movq   $0x0,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    0x2eb8(%rip),%rax
movq   $0x0,(%rax)
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@errno = global i64 0
define i32 @path_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @stat(i8* %5, %struct.stat* %3)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
store i32 %8, i32* %4
store i64 0, i64* @errno
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@errno = global i64 0
define i32 @path_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
store i64 0, i64* @errno
ret i32 %6
}
void foo_with_hidden_visibility() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ setsid();
int /*<<< orphan*/ umask(int /*<<< orphan*/);
void daemonize(void) {
  pid_t child;
  child = fork();
  if (child == -1) {
    perror("Could not daemonize");
  } else if (child != 0) {
    exit(0);
  }
  setsid();
  chdir("/");
  umask(0);
}


x86 assembly (clang, -O0):
<daemonize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1080 <fork@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    118d <daemonize+0x2d>
lea    0xe7d(%rip),%rdi
call   1060 <perror@plt>
jmp    11a3 <daemonize+0x43>
cmpl   $0x0,-0x4(%rbp)
je     119e <daemonize+0x3e>
xor    %edi,%edi
call   1070 <exit@plt>
jmp    11a3 <daemonize+0x43>
mov    $0x0,%al
call   1040 <setsid@plt>
lea    0xe63(%rip),%rdi
call   1030 <chdir@plt>
xor    %edi,%edi
call   1050 <umask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<daemonize>:
push   %rax
xor    %eax,%eax
call   1080 <fork@plt>
test   %eax,%eax
jne    1187 <daemonize+0x27>
xor    %eax,%eax
call   1040 <setsid@plt>
lea    0xe9a(%rip),%rdi
call   1030 <chdir@plt>
xor    %edi,%edi
pop    %rax
jmp    1050 <umask@plt>
cmp    $0xffffffff,%eax
jne    119a <daemonize+0x3a>
lea    0xe6d(%rip),%rdi
call   1060 <perror@plt>
jmp    116c <daemonize+0xc>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Could not daemonize\00"
@.str.1 = [2 x i8] c"/\00"
define void @daemonize() {
%1 = alloca i32
%2 = call i32 (...) @fork()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %13
7: ; preds = %0
%8 = load i32, i32* %1
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %7
br label %13
13: ; preds = %12, %5
%14 = call i32 (...) @setsid()
%15 = call i32 @chdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @umask(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Could not daemonize\00"
@.str.1 = [2 x i8] c"/\00"
define void @daemonize() {
%1 = tail call i32 (...) @fork()
switch i32 %1, label %4 [
i32 -1, label %2
i32 0, label %6
]
2: ; preds = %0
%3 = tail call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %6
4: ; preds = %0
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %0, %2
%7 = tail call i32 (...) @setsid()
%8 = tail call i32 @chdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @umask(i32 0)
ret void
}