xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("main, pre-bar!\n");
  bar();
  printf("main, post-bar!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <bar@plt>
lea    0xec7(%rip),%rdi
call   1040 <printf@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>
xor    %eax,%eax
call   1040 <bar@plt>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"main, pre-bar!\0A\00"
@.str.1 = [17 x i8] c"main, post-bar!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @bar()
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"main, pre-bar!\00"
@str.2 = [16 x i8] c"main, post-bar!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @bar()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int main() {
  f(1);
  f(2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <f@plt>
mov    $0x2,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <f@plt>
mov    $0x2,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f(i32 1)
%2 = call i32 @f(i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1)
%2 = tail call i32 @f(i32 2)
ret i32 0
}
/* Variables and functions */
size_t strlen(const char *s) {
  size_t count;
  for (count = 0; s[count]; count++)
    ;
  return count;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1138 <strlen+0x38>
jmp    1127 <strlen+0x27>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
scalar_t__ euler_problem_84();
int /*<<< orphan*/ printf(char *);
int main() {
  if (euler_problem_84() != 0) {
    printf("ERROR\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <euler_problem_84@plt>
cmp    $0x0,%rax
je     114c <main+0x2c>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <euler_problem_84@plt>
test   %rax,%rax
je     1139 <main+0x19>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [6 x i8] c"ERROR\00"
define i32 @main() {
%1 = tail call i64 (...) @euler_problem_84()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int sys_unlinkat(int, char const *, int /*<<< orphan*/);
int sys_unlink(const char *pathname) {
  return sys_unlinkat((-100), pathname, 0);
}


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

x86 assembly (clang, -O2):
<sys_unlink>:
mov    %rdi,%rsi
mov    $0xffffff9c,%edi
xor    %edx,%edx
jmp    1030 <sys_unlinkat@plt>

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

LLVM IR (-O2):
define i32 @sys_unlink(i8* %0) {
%2 = tail call i32 @sys_unlinkat(i32 -100, i8* %0, i32 0)
ret i32 %2
}
/* Type definitions */
typedef long int32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, long const *, int);
void oswp4s(void *p, const long l) {
  const int32_t tmp = l;
  memcpy(p, &tmp, 4);
}


x86 assembly (clang, -O0):
<oswp4s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oswp4s>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @oswp4s(i8* %0, i64 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 %1, i64* %3
%5 = call i32 @memcpy(i8* %0, i64* %3, i32 4)
ret void
}
/* Variables and functions */
char *malloc(unsigned int);
int /*<<< orphan*/ memcpy(char *, char const *, unsigned int);
char *tl_strndup(const char *a, unsigned na) {
  char *ret = malloc(na + 1);
  if (!ret) {
    return NULL;
  }
  memcpy(ret, a, na);
  ret[na] = '\0';
  return ret;
}


x86 assembly (clang, -O0):
<tl_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1156 <tl_strndup+0x36>
movq   $0x0,-0x8(%rbp)
jmp    1179 <tl_strndup+0x59>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x14(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tl_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%r15
lea    0x1(%r14),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1151 <tl_strndup+0x31>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
call   1030 <memcpy@plt>
mov    %r14d,%eax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @tl_strndup(i8* %0, i32 %1) {
%3 = add i32 %1, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %1)
%8 = zext i32 %1 to i64
%9 = getelementptr inbounds i8, i8* %4, i64 %8
store i8 0, i8* %9
br label %10
10: ; preds = %2, %6
ret i8* %4
}
int close(int fd) {
  do {
    if (!(0))
      asm volatile(".byte 0xd6" : : "a"(1));
  } while (0);
  return 0;
}


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

x86 assembly (clang, -O2):
<close>:
mov    $0x1,%eax
(bad)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @close(i32 %0) {
tail call void asm sideeffect ".byte 0xd6", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 1)
ret i32 0
}
void clean_bss(void) {
  extern int __bss_start, __bss_end;
  int *p = &__bss_start;
  for (; p < &__bss_end; p++)
    *p = 0;
}


x86 assembly (clang, -O0):
<clean_bss>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2eca(%rip),%rax
cmp    %rax,-0x8(%rbp)
jae    113b <clean_bss+0x3b>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <clean_bss+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_bss>:
push   %rax
mov    0x2ed0(%rip),%rdi
cmp    0x2ec1(%rip),%rdi
jae    114c <clean_bss+0x3c>
lea    0x4(%rdi),%rax
mov    0x2eb4(%rip),%rcx
cmp    %rax,%rcx
cmova  %rcx,%rax
mov    %rdi,%rcx
not    %rcx
lea    (%rcx,%rax,1),%rdx
add    $0x4,%rdx
and    $0xfffffffffffffffc,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

LLVM IR (-O0):
@__bss_start = external global i32
@__bss_end = external global i32
define void @clean_bss() {
%1 = alloca i32*
store i32* @__bss_start, i32** %1
br label %2
2: ; preds = %7, %0
%3 = load i32*, i32** %1
%4 = icmp ult i32* %3, @__bss_end
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32*, i32** %1
store i32 0, i32* %6
br label %7
7: ; preds = %5
%8 = load i32*, i32** %1
%9 = getelementptr inbounds i32, i32* %8, i32 1
store i32* %9, i32** %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
@__bss_start = external global i32
@__bss_end = external global i32
define void @clean_bss() {
br i1 icmp ult (i32* @__bss_start, i32* @__bss_end), label %1, label %5
1: ; preds = %0
%2 = call i64 @llvm.umax.i64(i64 ptrtoint (i32* @__bss_end to i64), i64 add (i64 ptrtoint (i32* @__bss_start to i64), i64 4))
%3 = add i64 %2, add (i64 xor (i64 ptrtoint (i32* @__bss_start to i64), i64 -1), i64 4)
%4 = and i64 %3, -4
br label %5
5: ; preds = %1, %0
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int64_t max64(int64_t a, int64_t b) { return ((a) < (b) ? (a) : (b)); }


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

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

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

LLVM IR (-O2):
define i64 @max64(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ shds_free(void *);
void shds_str_free(void *self) { shds_free(self); }


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

x86 assembly (clang, -O2):
<shds_str_free>:
jmp    1030 <shds_free@plt>

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

LLVM IR (-O2):
define void @shds_str_free(i8* %0) {
%2 = tail call i32 @shds_free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ msg_print(char *);
scalar_t__ target_set_interactive(int, int, int);
void do_cmd_target(void) {
  if (target_set_interactive(0x01, -1, -1)) {
    msg_print("Target Selected.");
  } else {
    msg_print("Target Aborted.");
  }
}


x86 assembly (clang, -O0):
<do_cmd_target>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0xffffffff,%edx
mov    %edx,%esi
call   1030 <target_set_interactive@plt>
cmp    $0x0,%rax
je     1150 <do_cmd_target+0x30>
lea    0xeba(%rip),%rdi
call   1040 <msg_print@plt>
jmp    115c <do_cmd_target+0x3c>
lea    0xeba(%rip),%rdi
call   1040 <msg_print@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_cmd_target>:
push   %rax
mov    $0x1,%edi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
call   1030 <target_set_interactive@plt>
test   %rax,%rax
lea    0xed2(%rip),%rax
lea    0xeba(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1040 <msg_print@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Target Selected.\00"
@.str.1 = [16 x i8] c"Target Aborted.\00"
define void @do_cmd_target() {
%1 = call i64 @target_set_interactive(i32 1, i32 -1, i32 -1)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @msg_print(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = call i32 @msg_print(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Target Selected.\00"
@.str.1 = [16 x i8] c"Target Aborted.\00"
define void @do_cmd_target() {
%1 = tail call i64 @target_set_interactive(i32 1, i32 -1, i32 -1)
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @msg_print(i8* %3)
ret void
}
/* Type definitions */
struct index_node_f {
  int dummy;
};
struct index_file {
  int dummy;
};

/* Variables and functions */
struct index_node_f *index_readroot(struct index_file *);
char *index_search__node(struct index_node_f *, char const *,
                         int /*<<< orphan*/);
char *index_search(struct index_file *in, const char *key) {
  struct index_node_f *root;
  char *value;
  root = index_readroot(in);
  value = index_search__node(root, key, 0);
  return value;
}


x86 assembly (clang, -O0):
<index_search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <index_readroot@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <index_search__node@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<index_search>:
push   %rbx
mov    %rsi,%rbx
call   1040 <index_readroot@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
pop    %rbx
jmp    1030 <index_search__node@plt>

LLVM IR (-O0):
%struct.index_file = type { i32 }
%struct.index_node_f = type { i32 }
define i8* @index_search(%struct.index_file* %0, i8* %1) {
%3 = alloca %struct.index_file*
%4 = alloca i8*
%5 = alloca %struct.index_node_f*
%6 = alloca i8*
store %struct.index_file* %0, %struct.index_file** %3
store i8* %1, i8** %4
%7 = load %struct.index_file*, %struct.index_file** %3
%8 = call %struct.index_node_f* @index_readroot(%struct.index_file* %7)
store %struct.index_node_f* %8, %struct.index_node_f** %5
%9 = load %struct.index_node_f*, %struct.index_node_f** %5
%10 = load i8*, i8** %4
%11 = call i8* @index_search__node(%struct.index_node_f* %9, i8* %10, i32 0)
store i8* %11, i8** %6
%12 = load i8*, i8** %6
ret i8* %12
}

LLVM IR (-O2):
%struct.index_file = type { i32 }
%struct.index_node_f = type { i32 }
define i8* @index_search(%struct.index_file* %0, i8* %1) {
%3 = tail call %struct.index_node_f* @index_readroot(%struct.index_file* %0)
%4 = tail call i8* @index_search__node(%struct.index_node_f* %3, i8* %1, i32 0)
ret i8* %4
}
int decode_int32(const unsigned char *address) {
  unsigned u = (((((address[0] << 8) + address[1]) << 8) + address[2]) << 8) +
               address[3];
  return (int)u;
}


x86 assembly (clang, -O0):
<decode_int32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
add    %ecx,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_int32>:
mov    (%rdi),%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @decode_int32(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl i32 %7, 8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = add nsw i32 %8, %12
%14 = shl i32 %13, 8
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = add nsw i32 %14, %18
%20 = shl i32 %19, 8
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = add nsw i32 %20, %24
store i32 %25, i32* %3
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @decode_int32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %3, 16
%8 = shl nuw nsw i32 %6, 8
%9 = or i32 %8, %7
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = or i32 %9, %12
%14 = shl nuw i32 %13, 8
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char *str = "HTTP/1.1 200 OK\nxxooxxoo:xxooxox";
  uint32_t *resp = (uint32_t *)str;
  printf("%d\n", atoi((char *)&resp[2]));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"HTTP/1.1 200 OK\0Axxooxxoo:xxooxox\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32*
store i32 0, i32* %1
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 2
%8 = bitcast i32* %7 to i8*
%9 = call i32 @atoi(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"HTTP/1.1 200 OK\0Axxooxxoo:xxooxox\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @atoi(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 8))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef union fc_sockaddr {
  int dummy;
} fc_sockaddr;
struct genlist {
  int dummy;
};
struct fc_sockaddr_list_link {
  int dummy;
};
struct fc_sockaddr_list {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_search(struct genlist const *, union fc_sockaddr const *);
struct fc_sockaddr_list_link *
fc_sockaddr_list_search(const struct fc_sockaddr_list *tthis,
                        const union fc_sockaddr *pfoo) {
  return ((struct fc_sockaddr_list_link *)genlist_search(
      (const struct genlist *)tthis, pfoo));
}


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

x86 assembly (clang, -O2):
<fc_sockaddr_list_search>:
jmp    1030 <genlist_search@plt>

LLVM IR (-O0):
%struct.fc_sockaddr_list_link = type { i32 }
%struct.fc_sockaddr_list = type { i32 }
%union.fc_sockaddr = type { i32 }
%struct.genlist = type { i32 }
define %struct.fc_sockaddr_list_link* @fc_sockaddr_list_search(%struct.fc_sockaddr_list* %0, %union.fc_sockaddr* %1) {
%3 = alloca %struct.fc_sockaddr_list*
%4 = alloca %union.fc_sockaddr*
store %struct.fc_sockaddr_list* %0, %struct.fc_sockaddr_list** %3
store %union.fc_sockaddr* %1, %union.fc_sockaddr** %4
%5 = load %struct.fc_sockaddr_list*, %struct.fc_sockaddr_list** %3
%6 = bitcast %struct.fc_sockaddr_list* %5 to %struct.genlist*
%7 = load %union.fc_sockaddr*, %union.fc_sockaddr** %4
%8 = call i64 @genlist_search(%struct.genlist* %6, %union.fc_sockaddr* %7)
%9 = inttoptr i64 %8 to %struct.fc_sockaddr_list_link*
ret %struct.fc_sockaddr_list_link* %9
}

LLVM IR (-O2):
%struct.fc_sockaddr_list_link = type { i32 }
%struct.fc_sockaddr_list = type { i32 }
%union.fc_sockaddr = type { i32 }
%struct.genlist = type { i32 }
define %struct.fc_sockaddr_list_link* @fc_sockaddr_list_search(%struct.fc_sockaddr_list* %0, %union.fc_sockaddr* %1) {
%3 = bitcast %struct.fc_sockaddr_list* %0 to %struct.genlist*
%4 = tail call i64 @genlist_search(%struct.genlist* %3, %union.fc_sockaddr* %1)
%5 = inttoptr i64 %4 to %struct.fc_sockaddr_list_link*
ret %struct.fc_sockaddr_list_link* %5
}
void foo549() {}


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

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

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

LLVM IR (-O2):
define void @foo549() {
ret void
}
int invert(int x, int p, int n) {
  long unsigned mask = ~0;
  mask = ~(mask << n);
  mask = (mask << p);
  x = mask ^ x;
  return x;
}


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    %cl,%rax
xor    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
xor    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert>:
mov    %edx,%ecx
mov    $0xffffffffffffffff,%rax
shl    %cl,%rax
not    %rax
mov    %esi,%ecx
shl    %cl,%rax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i64 -1, i64* %7
%8 = load i64, i64* %7
%9 = load i32, i32* %6
%10 = zext i32 %9 to i64
%11 = shl i64 %8, %10
%12 = xor i64 %11, -1
store i64 %12, i64* %7
%13 = load i64, i64* %7
%14 = load i32, i32* %5
%15 = zext i32 %14 to i64
%16 = shl i64 %13, %15
store i64 %16, i64* %7
%17 = load i64, i64* %7
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = xor i64 %17, %19
%21 = trunc i64 %20 to i32
store i32 %21, i32* %4
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = zext i32 %2 to i64
%5 = shl nsw i64 -1, %4
%6 = xor i64 %5, -1
%7 = zext i32 %1 to i64
%8 = shl i64 %6, %7
%9 = trunc i64 %8 to i32
%10 = xor i32 %9, %0
ret i32 %10
}
/* Variables and functions */
int cgc_strlen(char *);
int /*<<< orphan*/ strcpy(char *, char const *);
char *strcat(char *dest, const char *src) {
  strcpy(dest + cgc_strlen(dest), src);
  return dest;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <cgc_strlen@plt>
mov    -0x18(%rbp),%rdi
cltq
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <cgc_strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @cgc_strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8*, i8** %4
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* %1) {
%3 = tail call i32 @cgc_strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @strcpy(i8* %5, i8* %1)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ SkipQuotes(char **);
int DoUrl(char *s) {
  SkipQuotes(&s);
  return 0;
}


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

x86 assembly (clang, -O2):
<DoUrl>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <SkipQuotes@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @DoUrl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @SkipQuotes(i8** %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void pmu_adc_disable() {
  mbus_remote_register_write(0x3, 0x3B,
                             ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) |
                              (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7) |
                              (1 << 8) | (1 << 9) | (1 << 10) | (0 << 11) |
                              (0 << 12) | (0 << 13) | (1 << 14) | (1 << 15) |
                              (1 << 16) | (1 << 17) | (1 << 18) | (1 << 19)));
  delay(100);
}


x86 assembly (clang, -O0):
<pmu_adc_disable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0x3b,%esi
mov    $0xfc7ff,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_adc_disable>:
push   %rax
mov    $0x3,%edi
mov    $0x3b,%esi
mov    $0xfc7ff,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @pmu_adc_disable() {
%1 = call i32 @mbus_remote_register_write(i32 3, i32 59, i32 1034239)
%2 = call i32 @delay(i32 100)
ret void
}

LLVM IR (-O2):
define void @pmu_adc_disable() {
%1 = tail call i32 @mbus_remote_register_write(i32 3, i32 59, i32 1034239)
%2 = tail call i32 @delay(i32 100)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_retrieve_next_standard_initialize(void) {
  int a, *b, fail;
  double *c;
  a = 0;
  fail = _ada_use_c2phc4c(276, &a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_retrieve_next_standard_initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x114,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_retrieve_next_standard_initialize>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x114,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @solcon_retrieve_next_standard_initialize() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
store i32 0, i32* %1
%5 = load i32*, i32** %2
%6 = load double*, double** %4
%7 = call i32 @_ada_use_c2phc4c(i32 276, i32* %1, i32* %5, double* %6, i32 0)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @solcon_retrieve_next_standard_initialize() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @_ada_use_c2phc4c(i32 276, i32* %1, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int);
int main(void) { kill(getpid(), 19); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    $0x13,%esi
call   1040 <kill@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%edi
mov    $0x13,%esi
call   1040 <kill@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @getpid()
%2 = call i32 @kill(i32 %1, i32 19)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @kill(i32 %1, i32 19)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
int errex(char *s, int n) {
  fprintf(stderr, "\n*** Error: %s [%d]!\n", s, n);
  return 1;
}


x86 assembly (clang, -O0):
<errex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errex>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"\0A*** Error: %s [%d]!\0A\00"
define i32 @errex(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"\0A*** Error: %s [%d]!\0A\00"
define i32 @errex(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ yar_server_shutdown(int);
void yar_server_sig_handler(int signo) {
  yar_server_shutdown(signo);
  return;
}


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

x86 assembly (clang, -O2):
<yar_server_sig_handler>:
jmp    1030 <yar_server_shutdown@plt>

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

LLVM IR (-O2):
define void @yar_server_sig_handler(i32 %0) {
%2 = tail call i32 @yar_server_shutdown(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int printrowbegin() { printf("<tr>\n"); }


x86 assembly (clang, -O0):
<printrowbegin>:
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):
<printrowbegin>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [5 x i8] c"<tr>\00"
define i32 @printrowbegin() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;

/* Variables and functions */
int /*<<< orphan*/ NID_commonName;
int set_cn(int /*<<< orphan*/ *, int /*<<< orphan*/, char const *,
           int /*<<< orphan*/, char *, int /*<<< orphan*/);
int set_cn3(X509 *crt, const char *name) {
  return set_cn(crt, NID_commonName, name, NID_commonName, "dummy value", 0);
}


x86 assembly (clang, -O0):
<set_cn3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ecx
lea    0xebf(%rip),%r8
xor    %r9d,%r9d
call   1030 <set_cn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cn3>:
mov    %rsi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%ecx
lea    0xedd(%rip),%r8
mov    %ecx,%esi
xor    %r9d,%r9d
jmp    1030 <set_cn@plt>

LLVM IR (-O0):
@NID_commonName = global i32 0
@.str = [12 x i8] c"dummy value\00"
define i32 @set_cn3(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* @NID_commonName
%7 = load i8*, i8** %4
%8 = load i32, i32* @NID_commonName
%9 = call i32 @set_cn(i32* %5, i32 %6, i8* %7, i32 %8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %9
}

LLVM IR (-O2):
@NID_commonName = global i32 0
@.str = [12 x i8] c"dummy value\00"
define i32 @set_cn3(i32* %0, i8* %1) {
%3 = load i32, i32* @NID_commonName
%4 = tail call i32 @set_cn(i32* %0, i32 %3, i8* %1, i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int main(void) {
  printf("Hello world!");
  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 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world!\00"
@stdout = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(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
}
/* Variables and functions */
int /*<<< orphan*/ usbcb_suspend();
void usb_suspend(void) {
  *(volatile unsigned *)(0xBF800000 + (0x85050)) |= 0x0010;
  *(volatile unsigned *)(0xBF800000 + (0x85200)) = 0x0010;
  usbcb_suspend();
}


x86 assembly (clang, -O0):
<usb_suspend>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbf885050,%eax
mov    (%rax),%ecx
or     $0x10,%ecx
mov    $0xbf885050,%eax
mov    %ecx,(%rax)
mov    $0xbf885200,%eax
movl   $0x10,(%rax)
mov    $0x0,%al
call   1030 <usbcb_suspend@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_suspend>:
mov    $0xbf885050,%eax
orl    $0x10,(%rax)
movl   $0x10,0x1b0(%rax)
xor    %eax,%eax
jmp    1030 <usbcb_suspend@plt>

LLVM IR (-O0):
define void @usb_suspend() {
%1 = load volatile i32, i32* inttoptr (i64 3213381712 to i32*)
%2 = or i32 %1, 16
store volatile i32 %2, i32* inttoptr (i64 3213381712 to i32*)
store volatile i32 16, i32* inttoptr (i64 3213382144 to i32*)
%3 = call i32 (...) @usbcb_suspend()
ret void
}

LLVM IR (-O2):
define void @usb_suspend() {
%1 = load volatile i32, i32* inttoptr (i64 3213381712 to i32*)
%2 = or i32 %1, 16
store volatile i32 %2, i32* inttoptr (i64 3213381712 to i32*)
store volatile i32 16, i32* inttoptr (i64 3213382144 to i32*)
%3 = tail call i32 (...) @usbcb_suspend()
ret void
}
void SSI0_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<SSI0_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <SSI0_Handler+0x9>
jmp    1109 <SSI0_Handler+0x9>

x86 assembly (clang, -O2):
<SSI0_Handler>:
jmp    1100 <SSI0_Handler>

LLVM IR (-O0):
define void @SSI0_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @SSI0_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ kbd_close();
int endln() {
  kbd_close();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @endln() {
%1 = call i32 (...) @kbd_close()
ret i32 0
}

LLVM IR (-O2):
define i32 @endln() {
%1 = tail call i32 (...) @kbd_close()
ret i32 0
}
void _rtld_atfork_pre(int *locks) {}


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

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

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

LLVM IR (-O2):
define void @_rtld_atfork_pre(i32* nocapture %0) {
ret void
}
unsigned sizechar(char n) { return 1; }


x86 assembly (clang, -O0):
<sizechar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sizechar(i8 signext %0) {
ret i32 1
}
int geti() { return 3; }


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

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

LLVM IR (-O0):
define i32 @geti() {
ret i32 3
}

LLVM IR (-O2):
define i32 @geti() {
ret i32 3
}
int cmp0(const void *pa, const void *pb) {
  const short *a = (const short *)pa;
  const short *b = (const short *)pb;
  if (a[0] < b[0])
    return -1;
  if (a[0] > b[0])
    return +1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movswl (%rax),%eax
mov    -0x28(%rbp),%rcx
movswl (%rcx),%ecx
cmp    %ecx,%eax
jge    113e <cmp0+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <cmp0+0x67>
mov    -0x20(%rbp),%rax
movswl (%rax),%eax
mov    -0x28(%rbp),%rcx
movswl (%rcx),%ecx
cmp    %ecx,%eax
jle    1160 <cmp0+0x60>
movl   $0x1,-0x4(%rbp)
jmp    1167 <cmp0+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp0>:
movzwl (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%ax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp0(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i16*
%4 = bitcast i8* %1 to i16*
%5 = load i16, i16* %3
%6 = load i16, i16* %4
%7 = icmp slt i16 %5, %6
%8 = icmp sgt i16 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void rtp_set_seqnum(uint8_t *p_rtp, uint16_t i_seqnum) {
  p_rtp[2] = i_seqnum >> 8;
  p_rtp[3] = i_seqnum & 0xff;
}


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

x86 assembly (clang, -O2):
<rtp_set_seqnum>:
movzbl %sil,%eax
sar    $0x8,%esi
mov    %esi,0x8(%rdi)
mov    %eax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @rtp_set_seqnum(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = and i32 %9, 255
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 3
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
define void @rtp_set_seqnum(i32* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 8
%4 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %3, i32* %4
%5 = and i32 %1, 255
%6 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %5, i32* %6
ret void
}
/* Variables and functions */
char *d_s(char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char *s;
  printf("String value before d_s() = [%s]\n", s);
  printf("Enter string value: ");
  s = d_s(s);
  printf("String value after d_s() = [%s]\n", s);
  free(s);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
call   1050 <d_s@plt>
mov    %rax,%rbx
lea    0xedb(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"String value before d_s() = [%s]\0A\00"
@.str.1 = [21 x i8] c"Enter string value: \00"
@.str.2 = [33 x i8] c"String value after d_s() = [%s]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = call i8* @d_s(i8* %6)
store i8* %7, i8** %2
%8 = load i8*, i8** %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %2
%11 = call i32 @free(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"String value before d_s() = [%s]\0A\00"
@.str.1 = [21 x i8] c"Enter string value: \00"
@.str.2 = [33 x i8] c"String value after d_s() = [%s]\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* undef)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i8* @d_s(i8* undef)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%5 = tail call i32 @free(i8* %3)
ret i32 0
}
__attribute__((no, noclone)) int foo(void) {
  asm volatile("" ::: "memory");
  return 4195552;
}


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 4195552
}

LLVM IR (-O2):
define i32 @foo() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret i32 4195552
}
/* Variables and functions */
int /*<<< orphan*/ useSockets();
void test1(void) { useSockets(); }


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

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

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

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