xunge/DecIR huggingface dataset:
int my_strcmp(const char *cs, const char *ct) {
  unsigned char c1, c2;
  while (1) {
    c1 = *cs++;
    c2 = *ct++;
    if (c1 != c2)
      return c1 < c2 ? -1 : 1;
    if (!c1)
      break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<my_strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    %al,-0x1a(%rbp)
movzbl -0x19(%rbp),%eax
movzbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
je     1163 <my_strcmp+0x63>
movzbl -0x19(%rbp),%edx
movzbl -0x1a(%rbp),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    117e <my_strcmp+0x7e>
cmpb   $0x0,-0x19(%rbp)
jne    1172 <my_strcmp+0x72>
jmp    1177 <my_strcmp+0x77>
jmp    110c <my_strcmp+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcmp>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
cmp    (%rsi,%rax,1),%cl
jne    1124 <my_strcmp+0x24>
add    $0x1,%rax
test   %cl,%cl
jne    1110 <my_strcmp+0x10>
xor    %eax,%eax
ret
setae  %al
movzbl %al,%eax
add    %eax,%eax
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @my_strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %12, %2
%4 = phi i8* [ %1, %2 ], [ %13, %12 ]
%5 = phi i8* [ %0, %2 ], [ %14, %12 ]
%6 = load i8, i8* %5
%7 = load i8, i8* %4
%8 = icmp eq i8 %6, %7
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = icmp ult i8 %6, %7
%11 = select i1 %10, i32 -1, i32 1
br label %16
12: ; preds = %3
%13 = getelementptr inbounds i8, i8* %4, i64 1
%14 = getelementptr inbounds i8, i8* %5, i64 1
%15 = icmp eq i8 %6, 0
br i1 %15, label %16, label %3
16: ; preds = %12, %9
%17 = phi i32 [ %11, %9 ], [ 0, %12 ]
ret i32 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int SIGCHLD;
int /*<<< orphan*/ clone(int (*)(void *), char **, int, int /*<<< orphan*/ *,
                         int *);
pid_t pidfd_clone(int flags, int *pidfd, int (*fn)(void *)) {
  size_t stack_size = 1024;
  char *stack[1024] = {0};
  return clone(fn, stack + stack_size, flags | SIGCHLD, NULL, pidfd);
}


x86 assembly (clang, -O0):
<pidfd_clone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2020,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x400,-0x20(%rbp)
lea    -0x2020(%rbp),%rdi
xor    %esi,%esi
mov    $0x2000,%edx
call   1040 <memset@plt>
mov    -0x18(%rbp),%rdi
lea    -0x2020(%rbp),%rsi
mov    -0x20(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x4(%rbp),%edx
mov    0x2e77(%rip),%rax
or     (%rax),%edx
mov    -0x10(%rbp),%r8
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <clone@plt>
add    $0x2020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pidfd_clone>:
push   %rbp
push   %r14
push   %rbx
sub    $0x2000,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    %rsp,%rdi
mov    $0x2000,%edx
xor    %esi,%esi
call   1040 <memset@plt>
lea    0x2000(%rsp),%rsi
mov    0x2e97(%rip),%rax
or     (%rax),%ebp
mov    %rbx,%rdi
mov    %ebp,%edx
xor    %ecx,%ecx
mov    %r14,%r8
call   1030 <clone@plt>
add    $0x2000,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@SIGCHLD = global i32 0
define i32 @pidfd_clone(i32 %0, i32* %1, i32 (i8*)* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32 (i8*)*
%7 = alloca i64
%8 = alloca [1024 x i8*]
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 (i8*)* %2, i32 (i8*)** %6
store i64 1024, i64* %7
%9 = bitcast [1024 x i8*]* %8 to i8*
%10 = load i32 (i8*)*, i32 (i8*)** %6
%11 = getelementptr inbounds [1024 x i8*], [1024 x i8*]* %8, i64 0, i64 0
%12 = load i64, i64* %7
%13 = getelementptr inbounds i8*, i8** %11, i64 %12
%14 = load i32, i32* %4
%15 = load i32, i32* @SIGCHLD
%16 = or i32 %14, %15
%17 = load i32*, i32** %5
%18 = call i32 @clone(i32 (i8*)* %10, i8** %13, i32 %16, i32* null, i32* %17)
ret i32 %18
}

LLVM IR (-O2):
@SIGCHLD = global i32 0
define i32 @pidfd_clone(i32 %0, i32* %1, i32 (i8*)* %2) {
%4 = alloca [1024 x i8*]
%5 = bitcast [1024 x i8*]* %4 to i8*
%6 = getelementptr inbounds [1024 x i8*], [1024 x i8*]* %4, i64 0, i64 1024
%7 = load i32, i32* @SIGCHLD
%8 = or i32 %7, %0
%9 = call i32 @clone(i32 (i8*)* %2, i8** %6, i32 %8, i32* null, i32* %1)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__36__IO__toggle();
void Msp430GpioC__7__HplGeneralIO__toggle(void) {
  HplMsp430GeneralIOP__36__IO__toggle();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__7__HplGeneralIO__toggle() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__36__IO__toggle()
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *_xdg_get_base_name(const char *file_name) {
  const char *base_name;
  if (file_name == NULL)
    return NULL;
  base_name = strrchr(file_name, '/');
  if (base_name == NULL)
    return file_name;
  else
    return base_name + 1;
}


x86 assembly (clang, -O0):
<_xdg_get_base_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <_xdg_get_base_name+0x24>
movq   $0x0,-0x8(%rbp)
jmp    116a <_xdg_get_base_name+0x5a>
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115e <_xdg_get_base_name+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116a <_xdg_get_base_name+0x5a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_xdg_get_base_name>:
test   %rdi,%rdi
je     1133 <_xdg_get_base_name+0x23>
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,%rcx
add    $0x1,%rax
test   %rcx,%rcx
cmove  %rbx,%rax
pop    %rbx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @_xdg_get_base_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %18
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @strrchr(i8* %9, i8 signext 47)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = load i8*, i8** %3
store i8* %14, i8** %2
br label %18
15: ; preds = %8
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8* %17, i8** %2
br label %18
18: ; preds = %15, %13, %7
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @_xdg_get_base_name(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @strrchr(i8* %0, i8 signext 47)
%5 = icmp eq i8* %4, null
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = select i1 %5, i8* %0, i8* %6
br label %8
8: ; preds = %3, %1
%9 = phi i8* [ null, %1 ], [ %7, %3 ]
ret i8* %9
}
int do_193() { return 193; }


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

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

LLVM IR (-O0):
define i32 @do_193() {
ret i32 193
}

LLVM IR (-O2):
define i32 @do_193() {
ret i32 193
}
/* Variables and functions */
int /*<<< orphan*/ idle_run();
void *idle_run_proc(void *arg) {
  idle_run();
  return NULL;
}


x86 assembly (clang, -O0):
<idle_run_proc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <idle_run@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idle_run_proc>:
push   %rax
xor    %eax,%eax
call   1030 <idle_run@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @idle_run_proc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @idle_run()
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @idle_run_proc(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @idle_run()
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("*argv[0] -d <UIO_DEV_FILE> -i|-o <VALUE>\n");
  printf(" -d UIO device file. e.g. /dev/uio0\n");
  return;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf05(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"*argv[0] -d <UIO_DEV_FILE> -i|-o <VALUE>\0A\00"
@.str.1 = [37 x i8] c" -d UIO device file. e.g. /dev/uio0\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [41 x i8] c"*argv[0] -d <UIO_DEV_FILE> -i|-o <VALUE>\00"
@str.2 = [36 x i8] c" -d UIO device file. e.g. /dev/uio0\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.2, i64 0, i64 0))
ret void
}
void assert2(void) {
  ((1 == 2) ? ((void)0)
            : (__assert(__func__,
                        "/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/DeidaraC/"
                        "assert/refs/heads/master/test/test_assert_fail.c",
                        7, "1 == 2")));
}


x86 assembly (clang, -O0):
<assert2>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee6(%rip),%rsi
mov    $0x7,%edx
lea    0xf6e(%rip),%rcx
mov    $0x0,%al
call   1030 <__assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert2>:
lea    0xee9(%rip),%rdi
lea    0xeea(%rip),%rsi
lea    0xf77(%rip),%rcx
mov    $0x7,%edx
xor    %eax,%eax
jmp    1030 <__assert@plt>

LLVM IR (-O0):
@__func__.assert2 = [8 x i8] c"assert2\00"
@.str = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/DeidaraC/assert/refs/heads/master/test/test_assert_fail.c\00"
@.str.1 = [7 x i8] c"1 == 2\00"
define void @assert2() {
%1 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.assert2, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i32 7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.assert2 = [8 x i8] c"assert2\00"
@.str = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/DeidaraC/assert/refs/heads/master/test/test_assert_fail.c\00"
@.str.1 = [7 x i8] c"1 == 2\00"
define void @assert2() {
%1 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.assert2, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i32 7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct emmc_block_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sd_card_init(struct emmc_block_dev *, char,
                                int /*<<< orphan*/);
void removeprotect(struct emmc_block_dev *emmc_dev) {
  sd_card_init(emmc_dev, 'R', 0);
  return;
}


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

x86 assembly (clang, -O2):
<removeprotect>:
mov    $0x52,%esi
xor    %edx,%edx
jmp    1030 <sd_card_init@plt>

LLVM IR (-O0):
%struct.emmc_block_dev = type { i32 }
define void @removeprotect(%struct.emmc_block_dev* %0) {
%2 = alloca %struct.emmc_block_dev*
store %struct.emmc_block_dev* %0, %struct.emmc_block_dev** %2
%3 = load %struct.emmc_block_dev*, %struct.emmc_block_dev** %2
%4 = call i32 @sd_card_init(%struct.emmc_block_dev* %3, i8 signext 82, i32 0)
ret void
}

LLVM IR (-O2):
%struct.emmc_block_dev = type { i32 }
define void @removeprotect(%struct.emmc_block_dev* %0) {
%2 = tail call i32 @sd_card_init(%struct.emmc_block_dev* %0, i8 signext 82, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put_char(float);
int main() {
  int f1 = 1;
  int f2 = 1;
  int result = 0;
  while (f2 < 4000) {
    int f = f1 + f2;
    f1 = f2;
    f2 = f;
    if (f % 2 == 0) {
      result = result + f;
    }
  }
  put_char('f');
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xfa0,-0xc(%rbp)
jge    1178 <main+0x68>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1173 <main+0x63>
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <main+0x24>
movss  0xe80(%rip),%xmm0
call   1030 <put_char@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
mov    $0x1,%ecx
mov    $0x1,%eax
nopl   (%rax)
mov    %ecx,%edx
add    %eax,%edx
test   $0x1,%dl
mov    $0x0,%ecx
cmove  %edx,%ecx
add    %ecx,%ebx
mov    %eax,%ecx
mov    %edx,%eax
cmp    $0xfa0,%edx
jl     1120 <main+0x10>
movss  0xebb(%rip),%xmm0
call   1030 <put_char@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 1, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %22, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 4000
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %3
store i32 %13, i32* %2
%14 = load i32, i32* %5
store i32 %14, i32* %3
%15 = load i32, i32* %5
%16 = srem i32 %15, 2
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %9
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = add nsw i32 %19, %20
store i32 %21, i32* %4
br label %22
22: ; preds = %18, %9
br label %6
23: ; preds = %6
%24 = call i32 @put_char(float 1.020000e+02)
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = phi i32 [ 0, %0 ], [ %9, %1 ]
%4 = phi i32 [ 1, %0 ], [ %5, %1 ]
%5 = add nsw i32 %2, %4
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 %5, i32 0
%9 = add nsw i32 %8, %3
%10 = icmp slt i32 %5, 4000
br i1 %10, label %1, label %11
11: ; preds = %1
%12 = tail call i32 @put_char(float 1.020000e+02)
ret i32 %9
}
int SignExtendAGS(int i) {
  if (i & 0400000)
    i |= ~0777777;
  return (i);
}


x86 assembly (clang, -O0):
<SignExtendAGS>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x20000,%eax
cmp    $0x0,%eax
je     1123 <SignExtendAGS+0x23>
mov    -0x4(%rbp),%eax
or     $0xfffc0000,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SignExtendAGS>:
mov    %edi,%eax
or     $0xfffc0000,%eax
test   $0x20000,%edi
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @SignExtendAGS(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 131072
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = or i32 %7, -262144
store i32 %8, i32* %2
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @SignExtendAGS(i32 %0) {
%2 = and i32 %0, 131072
%3 = icmp eq i32 %2, 0
%4 = or i32 %0, -262144
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cctools_fatal(char *, int /*<<< orphan*/);
int debug_file_reopen();
int /*<<< orphan*/ errno;
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void debug_reopen(void) {
  if (debug_file_reopen() == -1)
    cctools_fatal("could not reopen debug log: %s", strerror(errno));
}


x86 assembly (clang, -O0):
<debug_reopen>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <debug_file_reopen@plt>
cmp    $0xffffffff,%eax
jne    1160 <debug_reopen+0x30>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%esi
lea    0xea5(%rip),%rdi
call   1040 <cctools_fatal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_reopen>:
push   %rax
xor    %eax,%eax
call   1030 <debug_file_reopen@plt>
cmp    $0xffffffff,%eax
je     113f <debug_reopen+0xf>
pop    %rax
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeac(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <cctools_fatal@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"could not reopen debug log: %s\00"
@errno = global i32 0
define void @debug_reopen() {
%1 = call i32 (...) @debug_file_reopen()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = load i32, i32* @errno
%5 = call i32 @strerror(i32 %4)
%6 = call i32 @cctools_fatal(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"could not reopen debug log: %s\00"
@errno = global i32 0
define void @debug_reopen() {
%1 = tail call i32 (...) @debug_file_reopen()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = load i32, i32* @errno
%5 = tail call i32 @strerror(i32 %4)
%6 = tail call i32 @cctools_fatal(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %3, %0
ret void
}
int breakStatementFunction() {
  while (0) {
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<breakStatementFunction>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <breakStatementFunction+0x9>
xor    %eax,%eax
test   $0x1,%al
jne    1118 <breakStatementFunction+0x18>
jmp    111d <breakStatementFunction+0x1d>
jmp    111d <breakStatementFunction+0x1d>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @breakStatementFunction() {
br label %1
1: ; preds = %0
br i1 false, label %2, label %3
2: ; preds = %1
br label %3
3: ; preds = %2, %1
ret i32 0
}

LLVM IR (-O2):
define i32 @breakStatementFunction() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printChar(char);
int /*<<< orphan*/ printInt(int);
void print_array(int array[], int len) {
  int i;
  for (i = 0; i < len; i++) {
    printInt(array[i]);
    printChar(' ');
  }
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116a <print_array+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <printInt@plt>
mov    $0x20,%edi
call   1040 <printChar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <print_array+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    115c <print_array+0x3c>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
call   1030 <printInt@plt>
mov    $0x20,%edi
call   1040 <printChar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <print_array+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @print_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printInt(i32 %9)
%11 = tail call i32 @printChar(i8 signext 32)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned int state;
};
typedef TYPE_1__ XButtonReleasedEvent;

/* Variables and functions */
void set_XButtonReleasedEvent_state(void *_p, unsigned _v) {
  ((XButtonReleasedEvent *)_p)->state = (unsigned)_v;
}


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

x86 assembly (clang, -O2):
<set_XButtonReleasedEvent_state>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XButtonReleasedEvent_state(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XButtonReleasedEvent_state(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int main(void) {
  printf("hello from C\n");
  fflush(stdout);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello from C\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [13 x i8] c"hello from C\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret i32 0
}
void fill_outgoing_packet_header(unsigned char *buf, unsigned char type,
                                 int body_len) {
  buf[0x00] = 0x57;
  buf[0x01] = type;
  buf[0x02] = body_len & 0xff;
  buf[0x03] = (body_len >> 8) & 0xff;
}


x86 assembly (clang, -O0):
<fill_outgoing_packet_header>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x57,(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_outgoing_packet_header>:
movb   $0x57,(%rdi)
mov    %sil,0x1(%rdi)
mov    %dl,0x2(%rdi)
mov    %dh,0x3(%rdi)
ret

LLVM IR (-O0):
define void @fill_outgoing_packet_header(i8* %0, i8 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 87, i8* %8
%9 = load i8, i8* %5
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %9, i8* %11
%12 = load i32, i32* %6
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 2
store i8 %14, i8* %16
%17 = load i32, i32* %6
%18 = ashr i32 %17, 8
%19 = and i32 %18, 255
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 3
store i8 %20, i8* %22
ret void
}

LLVM IR (-O2):
define void @fill_outgoing_packet_header(i8* nocapture writeonly %0, i8 zeroext %1, i32 %2) {
store i8 87, i8* %0
%4 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %1, i8* %4
%5 = trunc i32 %2 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %5, i8* %6
%7 = lshr i32 %2, 8
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %8, i8* %9
ret void
}
/* Variables and functions */
char *stringprep_convert(char const *, int /*<<< orphan*/, char *);
int /*<<< orphan*/ stringprep_locale_charset();
char *stringprep_utf8_to_locale(const char *str) {
  return stringprep_convert(str, stringprep_locale_charset(), "UTF-8");
}


x86 assembly (clang, -O0):
<stringprep_utf8_to_locale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <stringprep_locale_charset@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
lea    0xeb8(%rip),%rdx
call   1040 <stringprep_convert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringprep_utf8_to_locale>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <stringprep_locale_charset@plt>
lea    0xece(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <stringprep_convert@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"UTF-8\00"
define i8* @stringprep_utf8_to_locale(i8* %0) {
%2 = tail call i32 (...) @stringprep_locale_charset()
%3 = tail call i8* @stringprep_convert(i8* %0, i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
int main(int argc, const char *argv[]) {
  struct {
    int a;
    float b;
    double c;
  } x, y;
  x.a = 2;
  x.b = 4.0;
  x.c = 8.45;
  y = x;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x20(%rbp)
movss  0xee7(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i32, float, double }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.anon
%7 = alloca %struct.anon
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 0
store i32 2, i32* %8
%9 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 1
store float 4.000000e+00, float* %9
%10 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 2
store double 0x4020E66666666666, double* %10
%11 = bitcast %struct.anon* %7 to i8*
%12 = bitcast %struct.anon* %6 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void QEIVelocityConfigure(uint32_t ui32Base, uint32_t ui32PreDiv,
                          uint32_t ui32Period) {
  ;
  ;
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) =
      (((*((volatile uint32_t *)(ui32Base + 0x00000000))) & ~(0x000001C0)) |
       ui32PreDiv);
  (*((volatile uint32_t *)(ui32Base + 0x00000010))) = ui32Period - 1;
}


x86 assembly (clang, -O0):
<QEIVelocityConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%ecx
and    $0xfffffe3f,%ecx
or     -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x4(%rbp),%eax
add    $0x10,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIVelocityConfigure>:
movslq %edi,%rax
mov    $0xfffffe3f,%ecx
and    (%rax),%ecx
or     %esi,%ecx
mov    %ecx,(%rax)
add    $0xffffffff,%edx
mov    %edx,0x10(%rax)
ret

LLVM IR (-O0):
define void @QEIVelocityConfigure(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 0
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, -449
%13 = load i32, i32* %5
%14 = or i32 %12, %13
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 0
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
store volatile i32 %14, i32* %18
%19 = load i32, i32* %6
%20 = sub nsw i32 %19, 1
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 16
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to i32*
store volatile i32 %20, i32* %24
ret void
}

LLVM IR (-O2):
define void @QEIVelocityConfigure(i32 %0, i32 %1, i32 %2) {
%4 = sext i32 %0 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -449
%8 = or i32 %7, %1
store volatile i32 %8, i32* %5
%9 = add nsw i32 %2, -1
%10 = add nsw i32 %0, 16
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store volatile i32 %9, i32* %12
ret void
}
void MUSIC_Continue(void) {}


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

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

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

LLVM IR (-O2):
define void @MUSIC_Continue() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ InsertSyntax2(int, int, int /*<<< orphan*/);
void InsertSyntax(int pos, int t) { InsertSyntax2(pos, t, 0); }


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

x86 assembly (clang, -O2):
<InsertSyntax>:
xor    %edx,%edx
jmp    1030 <InsertSyntax2@plt>

LLVM IR (-O0):
define void @InsertSyntax(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 @InsertSyntax2(i32 %5, i32 %6, i32 0)
ret void
}

LLVM IR (-O2):
define void @InsertSyntax(i32 %0, i32 %1) {
%3 = tail call i32 @InsertSyntax2(i32 %0, i32 %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ util_memcpy(char *, char *, int);
int util_strlen(char *);
int util_strcpy(char *dst, char *src) {
  int l = util_strlen(src);
  util_memcpy(dst, src, l + 1);
  return l;
}


x86 assembly (clang, -O0):
<util_strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <util_strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
call   1030 <util_memcpy@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_strcpy>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <util_strlen@plt>
mov    %eax,%ebx
lea    0x1(%rbx),%edx
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <util_memcpy@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @util_strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @util_strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 1
%12 = call i32 @util_memcpy(i8* %8, i8* %9, i32 %11)
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @util_strcpy(i8* %0, i8* %1) {
%3 = tail call i32 @util_strlen(i8* %1)
%4 = add nsw i32 %3, 1
%5 = tail call i32 @util_memcpy(i8* %0, i8* %1, i32 %4)
ret i32 %3
}
/* Variables and functions */
int NumberOfWaves();
int SizeOfMessage() { return (8 * (1 << 20)) / NumberOfWaves(); }


x86 assembly (clang, -O0):
<SizeOfMessage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <NumberOfWaves@plt>
mov    %eax,%ecx
mov    $0x800000,%eax
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<SizeOfMessage>:
push   %rax
xor    %eax,%eax
call   1030 <NumberOfWaves@plt>
mov    %eax,%ecx
mov    $0x800000,%eax
xor    %edx,%edx
idiv   %ecx
pop    %rcx
ret

LLVM IR (-O0):
define i32 @SizeOfMessage() {
%1 = call i32 (...) @NumberOfWaves()
%2 = sdiv i32 8388608, %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @SizeOfMessage() {
%1 = tail call i32 (...) @NumberOfWaves()
%2 = sdiv i32 8388608, %1
ret i32 %2
}
int __child_l(const int idx) { return idx * 2 + 1; }


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

x86 assembly (clang, -O2):
<__child_l>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @__child_l(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 2
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @__child_l(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
char *encode(char *longUrl) { return longUrl; }


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

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

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

LLVM IR (-O2):
define i8* @encode(i8* readnone returned %0) {
ret i8* %0
}
/* Type definitions */
struct timeval {
  double tv_sec;
  int tv_usec;
};

/* Variables and functions */
double tkh_timeval_to_double(const struct timeval *tv) {
  return tv->tv_sec + 1e-6 * (tv->tv_usec);
}


x86 assembly (clang, -O0):
<tkh_timeval_to_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
cvtsi2sdl 0x8(%rax),%xmm0
movsd  0xedf(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tkh_timeval_to_double>:
cvtsi2sdl 0x8(%rdi),%xmm0
mulsd  0xef3(%rip),%xmm0
addsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { double, i32 }
define double @tkh_timeval_to_double(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%5 = load double, double* %4
%6 = load %struct.timeval*, %struct.timeval** %2
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = call double @llvm.fmuladd.f64(double 0x3EB0C6F7A0B5ED8D, double %9, double %5)
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { double, i32 }
define double @tkh_timeval_to_double(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%3 = load double, double* %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = tail call double @llvm.fmuladd.f64(double %6, double 0x3EB0C6F7A0B5ED8D, double %3)
ret double %7
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  short rbearing;
};
struct TYPE_4__ {
  TYPE_1__ min_bounds;
};
typedef TYPE_2__ XFontStruct;

/* Variables and functions */
void set_XFontStruct_min_bounds_rbearing(void *_p, short _v) {
  ((XFontStruct *)_p)->min_bounds.rbearing = (short)_v;
}


x86 assembly (clang, -O0):
<set_XFontStruct_min_bounds_rbearing>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i16 }
define void @set_XFontStruct_min_bounds_rbearing(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i16 %5, i16* %9
ret void
}

LLVM IR (-O2):
define void @set_XFontStruct_min_bounds_rbearing(i8* nocapture writeonly %0, i16 signext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
void read_some(int fd, char *buf) {}


x86 assembly (clang, -O0):
<read_some>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @read_some(i32 %0, i8* nocapture %1) {
ret void
}
int nth_position(int num, int position) {
  int result = (num >> position) & 1;
  return result;
}


x86 assembly (clang, -O0):
<nth_position>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nth_position>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @nth_position(i32 %0, i32 %1) {
%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 = load i32, i32* %4
%8 = ashr i32 %6, %7
%9 = and i32 %8, 1
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @nth_position(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
__attribute__((visibility("default"))) uint64_t
sd_bus_creds_get_mask(const void *c) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_creds_get_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_creds_get_mask>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_creds_get_mask(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_creds_get_mask(i8* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
int dbg_old_index_check_init(struct ubifs_info *c,
                             struct ubifs_zbranch *zroot) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.ubifs_info = type opaque
%struct.ubifs_zbranch = type opaque
define i32 @dbg_old_index_check_init(%struct.ubifs_info* nocapture readnone %0, %struct.ubifs_zbranch* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG(char *);
void s3c_show_mode(void) { DEBUG("[S3C USB-OTG MODE] : DMA\n"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"[S3C USB-OTG MODE] : DMA\0A\00"
define void @s3c_show_mode() {
%1 = call i32 @DEBUG(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"[S3C USB-OTG MODE] : DMA\0A\00"
define void @s3c_show_mode() {
%1 = tail call i32 @DEBUG(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct suggest_input {
  int dummy;
};
struct suffixtree {
  int dummy;
};

/* Variables and functions */
struct suggest_input *_suffixtree_find_word(struct suffixtree *, char *,
                                            int /*<<< orphan*/);
struct suggest_input *suffixtree_find_word(struct suffixtree *root,
                                           char *word) {
  return _suffixtree_find_word(root, word, 0);
}


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

x86 assembly (clang, -O2):
<suffixtree_find_word>:
xor    %edx,%edx
jmp    1030 <_suffixtree_find_word@plt>

LLVM IR (-O0):
%struct.suggest_input = type { i32 }
%struct.suffixtree = type { i32 }
define %struct.suggest_input* @suffixtree_find_word(%struct.suffixtree* %0, i8* %1) {
%3 = alloca %struct.suffixtree*
%4 = alloca i8*
store %struct.suffixtree* %0, %struct.suffixtree** %3
store i8* %1, i8** %4
%5 = load %struct.suffixtree*, %struct.suffixtree** %3
%6 = load i8*, i8** %4
%7 = call %struct.suggest_input* @_suffixtree_find_word(%struct.suffixtree* %5, i8* %6, i32 0)
ret %struct.suggest_input* %7
}

LLVM IR (-O2):
%struct.suggest_input = type { i32 }
%struct.suffixtree = type { i32 }
define %struct.suggest_input* @suffixtree_find_word(%struct.suffixtree* %0, i8* %1) {
%3 = tail call %struct.suggest_input* @_suffixtree_find_word(%struct.suffixtree* %0, i8* %1, i32 0)
ret %struct.suggest_input* %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: losetup [-r] [-c | -x | -d] [-o offset] [-s size] "
                  "loop_device [file | loop_num]\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [88 x i8] c"usage: losetup [-r] [-c | -x | -d] [-o offset] [-s size] loop_device [file | loop_num]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [88 x i8] c"usage: losetup [-r] [-c | -x | -d] [-o offset] [-s size] loop_device [file | loop_num]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
char *calloc(int /*<<< orphan*/, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(char *);
char *str_calloc(uint32_t size) {
  char *str = calloc(size, sizeof(char));
  if (str == NULL) {
    free(str);
    exit(1);
  }
  return str;
}


x86 assembly (clang, -O0):
<str_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116a <str_calloc+0x3a>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_calloc>:
push   %rax
mov    $0x1,%esi
call   1040 <calloc@plt>
test   %rax,%rax
je     1142 <str_calloc+0x12>
pop    %rcx
ret
xor    %edi,%edi
call   1030 <free@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i8* @str_calloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @calloc(i32 %4, i32 1)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define noalias i8* @str_calloc(i32 %0) {
%2 = tail call i8* @calloc(i32 %0, i32 1)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @free(i8* null)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ f4();
void f3() { f4(); }


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

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

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

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