xunge/DecIR huggingface dataset:
/* Variables and functions */
int _gcd(int, int);
int gcd(int a, int b) {
  if (a > b) {
    return _gcd(a, b);
  }
  return _gcd(b, a);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113d <gcd+0x2d>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <_gcd@plt>
mov    %eax,-0x4(%rbp)
jmp    114b <gcd+0x3b>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
cmp    %esi,%edi
jle    111d <gcd+0xd>
mov    %eax,%edi
jmp    1030 <_gcd@plt>
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <_gcd@plt>

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @_gcd(i32 %0, i32 %1)
br label %8
6: ; preds = %2
%7 = tail call i32 @_gcd(i32 %1, i32 %0)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
/* Variables and functions */
int strcmp(char const *, char const *);
int qsort_strcmp_callback(const void *a, const void *b) {
  return strcmp((const char *)*(char **)a, (const char *)*(char **)b);
}


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

x86 assembly (clang, -O2):
<qsort_strcmp_callback>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @qsort_strcmp_callback(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @qsort_strcmp_callback(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("opts: [mitm|flood] -i interface -a hostA -b hostB");
  return;
}


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

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

LLVM IR (-O0):
@.str = [50 x i8] c"opts: [mitm|flood] -i interface -a hostA -b hostB\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"opts: [mitm|flood] -i interface -a hostA -b hostB\00"
define void @usage() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rand();
int calculateNext(int s2) {
  int cnex;
  do
    cnex = rand();
  while (cnex == s2 || cnex == 0);
  return cnex;
}


x86 assembly (clang, -O0):
<calculateNext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%al
cmp    -0x4(%rbp),%ecx
mov    %al,-0x9(%rbp)
je     1140 <calculateNext+0x30>
cmpl   $0x0,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    111b <calculateNext+0xb>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateNext>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <rand@plt>
cmp    %ebx,%eax
je     1120 <calculateNext+0x10>
test   %eax,%eax
je     1120 <calculateNext+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @calculateNext(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 (...) @rand()
%4 = icmp eq i32 %3, %0
%5 = icmp eq i32 %3, 0
%6 = or i1 %4, %5
br i1 %6, label %2, label %7
7: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int _rtc_handler(int argc, char **argv) {
  (void)argc;
  (void)argv;
  puts("not implemented");
  return 1;
}


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

x86 assembly (clang, -O2):
<_rtc_handler>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"not implemented\00"
define i32 @_rtc_handler(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 i8**, i8*** %4
%7 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [16 x i8] c"not implemented\00"
define i32 @_rtc_handler(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
gen_or() {
  gen_pop();
  gen_call("ccor");
}


x86 assembly (clang, -O0):
<gen_or>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xeca(%rip),%rdi
call   1040 <gen_call@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_or>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"ccor\00"
define i32 @gen_or() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int snapshot_read_byte(FILE *f, unsigned char *b_return) {
  int c;
  c = fgetc(f);
  if (c == EOF)
    return -1;
  *b_return = (unsigned char)c;
  return 0;
}


x86 assembly (clang, -O0):
<snapshot_read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    0x2eb2(%rip),%rcx
cmp    (%rcx),%eax
jne    114a <snapshot_read_byte+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <snapshot_read_byte+0x4c>
mov    -0x1c(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snapshot_read_byte>:
push   %rbx
mov    %rsi,%rbx
call   1030 <fgetc@plt>
mov    0x2ec8(%rip),%rdx
mov    $0xffffffff,%ecx
cmp    (%rdx),%eax
je     112d <snapshot_read_byte+0x1d>
mov    %al,(%rbx)
xor    %ecx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @snapshot_read_byte(i32* nocapture %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @fgetc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = trunc i32 %3 to i8
store i8 %7, i8* %1
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ 0, %6 ], [ -1, %2 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fseeko(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
uint32_t file_set_pos(FILE *stream, uint64_t offset, int whence) {
  return fseeko(stream, offset, whence);
}


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

x86 assembly (clang, -O2):
<file_set_pos>:
jmp    1030 <fseeko@plt>

LLVM IR (-O0):
define i32 @file_set_pos(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 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @fseeko(i32* %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @file_set_pos(i32* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @fseeko(i32* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write(int, int *, int);
int ft_putchar(int c) {
  write(1, &c, 1);
  return (c);
}


x86 assembly (clang, -O0):
<ft_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edx
lea    -0x4(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putchar>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ft_putchar(i32 returned %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @write(i32 1, i32* %2, i32 1)
ret i32 %0
}
short v_short_func() { return (0); }


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

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

LLVM IR (-O0):
define signext i16 @v_short_func() {
ret i16 0
}

LLVM IR (-O2):
define signext i16 @v_short_func() {
ret i16 0
}
/* Variables and functions */
int /*<<< orphan*/ EBADF;
int /*<<< orphan*/ errno;
int __attribute__((weak)) _isatty(int fd) {
  switch (fd) {
  case 0:
  case 1:
  case 2:
    return 1;
  }
  errno = EBADF;
  return 0;
}


x86 assembly (clang, -O0):
<_isatty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
ja     1124 <_isatty+0x24>
jmp    1118 <_isatty+0x18>
movl   $0x1,-0x4(%rbp)
jmp    113d <_isatty+0x3d>
mov    0x2ead(%rip),%rax
mov    (%rax),%ecx
mov    0x2eac(%rip),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_isatty>:
mov    $0x1,%eax
cmp    $0x3,%edi
jb     111e <_isatty+0x1e>
mov    0x2ec7(%rip),%rax
mov    (%rax),%eax
mov    0x2ec6(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@EBADF = global i32 0
@errno = global i32 0
define weak i32 @_isatty(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 0, label %5
i32 1, label %5
i32 2, label %5
]
5: ; preds = %1, %1, %1
store i32 1, i32* %2
br label %8
6: ; preds = %1
%7 = load i32, i32* @EBADF
store i32 %7, i32* @errno
store i32 0, i32* %2
br label %8
8: ; preds = %6, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@EBADF = global i32 0
@errno = global i32 0
define weak i32 @_isatty(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = load i32, i32* @EBADF
store i32 %4, i32* @errno
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 0, %3 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_exit(void *);
void *proc(void *var) {
  printf("%d\n", (int)var);
  pthread_exit(var);
}


x86 assembly (clang, -O0):
<proc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <pthread_exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define noalias i8* @proc(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @pthread_exit(i8* %0)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void recover(char *str) { strcpy(str, "Hello World"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
define void @recover(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define void @recover(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int gcd(int, int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i;
  for (i = 0; i < 20; i++) {
    printf("gcd of 12 and %d is %d\n", i, gcd(12, i));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    1172 <main+0x52>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    $0xc,%edi
call   1040 <gcd@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    $0xc,%edi
mov    %ebx,%esi
call   1040 <gcd@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x14,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [24 x i8] c"gcd of 12 and %d is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 20
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @gcd(i32 12, i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
br label %11
11: ; preds = %6
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %3
14: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"gcd of 12 and %d is %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 @gcd(i32 12, i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 20
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
void RGB24ToARGBRow_Any_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @RGB24ToARGBRow_Any_SSSE3() {
ret void
}
void gtk_window_get_destroy_with_parent() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_get_destroy_with_parent() {
ret void
}
/* Type definitions */
struct passwd {
  int dummy;
};

/* Variables and functions */
struct passwd *getpwent(void) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.passwd = type { i32 }
define %struct.passwd* @getpwent() {
ret %struct.passwd* null
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
define noalias %struct.passwd* @getpwent() {
ret %struct.passwd* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fF() { printf("I am fF,I was in after fE!\n"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"I am fF,I was in after fE!\0A\00"
define void @fF() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"I am fF,I was in after fE!\00"
define void @fF() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
void gdk_event_send_clientmessage_toall() {}


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

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

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

LLVM IR (-O2):
define void @gdk_event_send_clientmessage_toall() {
ret void
}
float dizi_toplam(float d[6]) {
  int i;
  float toplam = 0;
  for (i = 0; i < 6; i++) {
    toplam += d[i];
  }
  return toplam;
}


x86 assembly (clang, -O0):
<dizi_toplam>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jge    1146 <dizi_toplam+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <dizi_toplam+0x17>
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dizi_toplam>:
xorps  %xmm0,%xmm0
addss  (%rdi),%xmm0
addss  0x4(%rdi),%xmm0
addss  0x8(%rdi),%xmm0
addss  0xc(%rdi),%xmm0
addss  0x10(%rdi),%xmm0
addss  0x14(%rdi),%xmm0
ret

LLVM IR (-O0):
define float @dizi_toplam(float* %0) {
%2 = alloca float*
%3 = alloca i32
%4 = alloca float
store float* %0, float** %2
store float 0.000000e+00, float* %4
store i32 0, i32* %3
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 6
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load float*, float** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds float, float* %9, i64 %11
%13 = load float, float* %12
%14 = load float, float* %4
%15 = fadd float %14, %13
store float %15, float* %4
br label %16
16: ; preds = %8
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %5
19: ; preds = %5
%20 = load float, float* %4
ret float %20
}

LLVM IR (-O2):
define float @dizi_toplam(float* nocapture %0) {
%2 = load float, float* %0
%3 = fadd float %2, 0.000000e+00
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = fadd float %3, %5
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = fadd float %6, %8
%10 = getelementptr inbounds float, float* %0, i64 3
%11 = load float, float* %10
%12 = fadd float %9, %11
%13 = getelementptr inbounds float, float* %0, i64 4
%14 = load float, float* %13
%15 = fadd float %12, %14
%16 = getelementptr inbounds float, float* %0, i64 5
%17 = load float, float* %16
%18 = fadd float %15, %17
ret float %18
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) int softboundcets_fgetc(FILE *stream) {
  return fgetc(stream);
}


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

x86 assembly (clang, -O2):
<softboundcets_fgetc>:
jmp    1030 <fgetc@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_fgetc(i32* %0) {
%2 = tail call i32 @fgetc(i32* %0)
ret i32 %2
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int strcmp(int /*<<< orphan*/, int /*<<< orphan*/);
int dirent_compare(const void *a, const void *b) {
  const struct dirent *c, *d;
  c = a, d = b;
  return strcmp(c->d_name, d->d_name);
}


x86 assembly (clang, -O0):
<dirent_compare>:
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    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
call   1030 <strcmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dirent_compare>:
mov    (%rdi),%edi
mov    (%rsi),%esi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @dirent_compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.dirent*
%6 = alloca %struct.dirent*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.dirent*
store %struct.dirent* %8, %struct.dirent** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to %struct.dirent*
store %struct.dirent* %10, %struct.dirent** %6
%11 = load %struct.dirent*, %struct.dirent** %5
%12 = getelementptr inbounds %struct.dirent, %struct.dirent* %11, i32 0, i32 0
%13 = load i32, i32* %12
%14 = load %struct.dirent*, %struct.dirent** %6
%15 = getelementptr inbounds %struct.dirent, %struct.dirent* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = call i32 @strcmp(i32 %13, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @dirent_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = tail call i32 @strcmp(i32 %4, i32 %6)
ret i32 %7
}
/* Type definitions */
struct _Locale_name_hint {
  int dummy;
};

/* Variables and functions */
char const *_Locale_extract_name(char const *, int *);
char const *_Locale_extract_numeric_name(const char *name,
                                         char *buf __attribute__((__unused__)),
                                         struct _Locale_name_hint *hint
                                         __attribute__((__unused__)),
                                         int *__err_code) {
  return _Locale_extract_name(name, __err_code);
}


x86 assembly (clang, -O0):
<_Locale_extract_numeric_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <_Locale_extract_name@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Locale_extract_numeric_name>:
mov    %rcx,%rsi
jmp    1030 <_Locale_extract_name@plt>

LLVM IR (-O0):
%struct._Locale_name_hint = type { i32 }
define i8* @_Locale_extract_numeric_name(i8* %0, i8* %1, %struct._Locale_name_hint* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct._Locale_name_hint*
%8 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store %struct._Locale_name_hint* %2, %struct._Locale_name_hint** %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i32*, i32** %8
%11 = call i8* @_Locale_extract_name(i8* %9, i32* %10)
ret i8* %11
}

LLVM IR (-O2):
%struct._Locale_name_hint = type { i32 }
define i8* @_Locale_extract_numeric_name(i8* %0, i8* nocapture readnone %1, %struct._Locale_name_hint* nocapture readnone %2, i32* %3) {
%5 = tail call i8* @_Locale_extract_name(i8* %0, i32* %3)
ret i8* %5
}
int test_imm_BEuint32_mem(unsigned int *val) {
  return ((*val) & (0xBE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BEuint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xbe,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_BEuint32_mem>:
testb  $0xbe,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_BEuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 190
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
double d_rnd(double);
double dl_rnd(int index, double maximum) { return d_rnd(maximum); }


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

x86 assembly (clang, -O2):
<dl_rnd>:
jmp    1030 <d_rnd@plt>

LLVM IR (-O0):
define double @dl_rnd(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = call double @d_rnd(double %5)
ret double %6
}

LLVM IR (-O2):
define double @dl_rnd(i32 %0, double %1) {
%3 = tail call double @d_rnd(double %1)
ret double %3
}
unsigned int count_ones(unsigned int _x) {
  unsigned int num_ones = 0;
  unsigned int i;
  for (i = 0; i < 64; i++) {
    num_ones += _x & 0x01;
    _x >>= 1;
  }
  return num_ones;
}


x86 assembly (clang, -O0):
<count_ones>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x40,-0xc(%rbp)
jae    1142 <count_ones+0x42>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <count_ones+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_ones>:
xor    %eax,%eax
mov    $0x40,%ecx
nopw   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %eax,%edx
mov    %edi,%eax
shr    %eax
and    $0x1,%eax
add    %edx,%eax
mov    %edi,%edx
shr    $0x2,%edx
and    $0x1,%edx
add    %eax,%edx
mov    %edi,%eax
shr    $0x3,%eax
and    $0x1,%eax
add    %edx,%eax
shr    $0x4,%edi
add    $0xfffffffc,%ecx
jne    1110 <count_ones+0x10>
ret

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

LLVM IR (-O2):
define i32 @count_ones(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %18, %2 ]
%4 = phi i32 [ 0, %1 ], [ %16, %2 ]
%5 = phi i32 [ %0, %1 ], [ %17, %2 ]
%6 = and i32 %5, 1
%7 = add i32 %4, %6
%8 = lshr i32 %5, 1
%9 = and i32 %8, 1
%10 = add i32 %7, %9
%11 = lshr i32 %5, 2
%12 = and i32 %11, 1
%13 = add i32 %10, %12
%14 = lshr i32 %5, 3
%15 = and i32 %14, 1
%16 = add i32 %13, %15
%17 = lshr i32 %5, 4
%18 = add nuw nsw i32 %3, 4
%19 = icmp eq i32 %18, 64
br i1 %19, label %20, label %2
20: ; preds = %2
ret i32 %16
}
/* Type definitions */
struct lm {
  int dummy;
};

/* Variables and functions */
char *separateString(char *, char *, int, struct lm *);
char *untsvString(char *tsvIn, int ix, struct lm *lm) {
  return separateString(tsvIn, "\t", ix, lm);
}


x86 assembly (clang, -O0):
<untsvString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rsi
call   1030 <separateString@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<untsvString>:
mov    %rdx,%rcx
mov    %esi,%edx
lea    0xee4(%rip),%rsi
jmp    1030 <separateString@plt>

LLVM IR (-O0):
%struct.lm = type { i32 }
@.str = [2 x i8] c"\09\00"
define i8* @untsvString(i8* %0, i32 %1, %struct.lm* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.lm*
store i8* %0, i8** %4
store i32 %1, i32* %5
store %struct.lm* %2, %struct.lm** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load %struct.lm*, %struct.lm** %6
%10 = call i8* @separateString(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %8, %struct.lm* %9)
ret i8* %10
}

LLVM IR (-O2):
%struct.lm = type { i32 }
@.str = [2 x i8] c"\09\00"
define i8* @untsvString(i8* %0, i32 %1, %struct.lm* %2) {
%4 = tail call i8* @separateString(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %1, %struct.lm* %2)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef void const *b;
typedef void *a;

/* Variables and functions */
int /*<<< orphan*/ cpy1(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int cpy8(void *, void const *);
void cpy9(void *a, const void *b) {
  cpy8(a, b), cpy1((uint8_t *)a + 8, (uint8_t *)b + 8);
}


x86 assembly (clang, -O0):
<cpy9>:
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 <cpy8@plt>
mov    -0x8(%rbp),%rdi
add    $0x20,%rdi
mov    -0x10(%rbp),%rsi
add    $0x20,%rsi
call   1040 <cpy1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpy9>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <cpy8@plt>
add    $0x20,%rbx
add    $0x20,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <cpy1@plt>

LLVM IR (-O0):
define void @cpy9(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @cpy8(i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = getelementptr inbounds i32, i32* %9, i64 8
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32*
%13 = getelementptr inbounds i32, i32* %12, i64 8
%14 = call i32 @cpy1(i32* %10, i32* %13)
ret void
}

LLVM IR (-O2):
define void @cpy9(i8* %0, i8* %1) {
%3 = tail call i32 @cpy8(i8* %0, i8* %1)
%4 = getelementptr inbounds i8, i8* %0, i64 32
%5 = bitcast i8* %4 to i32*
%6 = getelementptr inbounds i8, i8* %1, i64 32
%7 = bitcast i8* %6 to i32*
%8 = tail call i32 @cpy1(i32* %5, i32* %7)
ret void
}
int XGetIconSizes() {}


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

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

LLVM IR (-O0):
define i32 @XGetIconSizes() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XGetIconSizes() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ spg_get_smallest_lattice(double **, double **, double);
void spg_get_smallest_lattice_(double smallest_lattice[3][3],
                               double lattice[3][3], double *symprec) {
  spg_get_smallest_lattice(smallest_lattice, lattice, *symprec);
}


x86 assembly (clang, -O0):
<spg_get_smallest_lattice_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <spg_get_smallest_lattice@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spg_get_smallest_lattice_>:
movsd  (%rdx),%xmm0
jmp    1030 <spg_get_smallest_lattice@plt>

LLVM IR (-O0):
define void @spg_get_smallest_lattice_([3 x double]* %0, [3 x double]* %1, double* %2) {
%4 = alloca [3 x double]*
%5 = alloca [3 x double]*
%6 = alloca double*
store [3 x double]* %0, [3 x double]** %4
store [3 x double]* %1, [3 x double]** %5
store double* %2, double** %6
%7 = load [3 x double]*, [3 x double]** %4
%8 = bitcast [3 x double]* %7 to double**
%9 = load [3 x double]*, [3 x double]** %5
%10 = bitcast [3 x double]* %9 to double**
%11 = load double*, double** %6
%12 = load double, double* %11
%13 = call i32 @spg_get_smallest_lattice(double** %8, double** %10, double %12)
ret void
}

LLVM IR (-O2):
define void @spg_get_smallest_lattice_([3 x double]* %0, [3 x double]* %1, double* nocapture %2) {
%4 = bitcast [3 x double]* %0 to double**
%5 = bitcast [3 x double]* %1 to double**
%6 = load double, double* %2
%7 = tail call i32 @spg_get_smallest_lattice(double** %4, double** %5, double %6)
ret void
}
signed int spi_dataread(void *handle, unsigned short addr,
                        unsigned char command, unsigned char *data,
                        unsigned int length) {
  return 0;
}


x86 assembly (clang, -O0):
<spi_dataread>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %si,%dx
mov    %rdi,-0x8(%rbp)
mov    %dx,-0xa(%rbp)
mov    %al,-0xb(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @spi_dataread(i8* %0, i16 zeroext %1, i8 zeroext %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i16
%8 = alloca i8
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %6
store i16 %1, i16* %7
store i8 %2, i8* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @spi_dataread(i8* nocapture readnone %0, i16 zeroext %1, i8 zeroext %2, i8* nocapture readnone %3, i32 %4) {
ret i32 0
}
int __tapdisk_blk_storage_type(const char *rpath) { return 3; }


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

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

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

LLVM IR (-O2):
define i32 @__tapdisk_blk_storage_type(i8* nocapture readnone %0) {
ret i32 3
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double systime_wall() {
  struct timeval t;
  gettimeofday(&t, NULL);
  return (double)t.tv_sec + ((double)t.tv_usec) / 1000000.;
}


x86 assembly (clang, -O0):
<systime_wall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<systime_wall>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @systime_wall() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @systime_wall() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char, int);
int /*<<< orphan*/ stderr;
void a(int x) { fprintf(stderr, "%c%d\n", 'a', x); }


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%ecx
lea    0xed2(%rip),%rsi
mov    $0x61,%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
mov    %edi,%ecx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
mov    $0x61,%edx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @a(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 97, i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @a(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 97, i32 %0)
ret void
}
/* Variables and functions */
int ENOSYS;
int sysfs_modify_policy_governor(unsigned int cpu, char *governor) {
  return -ENOSYS;
}


x86 assembly (clang, -O0):
<sysfs_modify_policy_governor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ed4(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @sysfs_modify_policy_governor(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @sysfs_modify_policy_governor(i32 %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ g();
void foo(int x) {
  if (x != 0x123456)
    g();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x123456,-0x4(%rbp)
je     112f <foo+0x1f>
mov    $0x0,%al
call   1030 <g@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x123456,%edi
jne    1119 <foo+0x9>
ret
xor    %eax,%eax
jmp    1030 <g@plt>

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 1193046
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @g()
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = icmp eq i32 %0, 1193046
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @g()
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err(int, int /*<<< orphan*/ *);
void *malloc(size_t);
void *bmalloc(size_t sz) {
  void *p;
  p = malloc(sz);
  if (p == NULL)
    err(1, NULL);
  return (p);
}


x86 assembly (clang, -O0):
<bmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1152 <bmalloc+0x32>
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <bmalloc+0x1a>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @bmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @err(i32 1, i32* null)
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @bmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err(i32 1, i32* null)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void seed_random(arg) long arg;
{ srand((unsigned int)arg); }


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

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

LLVM IR (-O0):
define void @seed_random(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = call i32 (i32, ...) bitcast (i32 (...)* @srand to i32 (i32, ...)*)(i32 %4)
ret void
}

LLVM IR (-O2):
define void @seed_random(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @srand to i32 (i32, ...)*)(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, size_t, int /*<<< orphan*/ *);
char *read_scala_line(char *buf, size_t len, FILE *fp) {
  while (true) {
    if (!fgets(buf, len, fp)) {
      return NULL;
    }
    if (buf[0] != '!') {
      return buf;
    }
  }
}


x86 assembly (clang, -O0):
<read_scala_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <fgets@plt>
cmp    $0x0,%eax
jne    114b <read_scala_line+0x3b>
movq   $0x0,-0x8(%rbp)
jmp    116d <read_scala_line+0x5d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x21,%eax
je     1168 <read_scala_line+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116d <read_scala_line+0x5d>
jmp    1124 <read_scala_line+0x14>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_scala_line>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <fgets@plt>
test   %eax,%eax
je     1139 <read_scala_line+0x29>
cmpb   $0x21,(%rbx)
je     1120 <read_scala_line+0x10>
jmp    113b <read_scala_line+0x2b>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @read_scala_line(i8* %0, i64 %1, i32* nocapture %2) {
br label %4
4: ; preds = %7, %3
%5 = tail call i32 @fgets(i8* %0, i64 %1, i32* %2)
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = load i8, i8* %0
%9 = icmp eq i8 %8, 33
br i1 %9, label %4, label %10
10: ; preds = %7, %4
%11 = phi i8* [ null, %4 ], [ %0, %7 ]
ret i8* %11
}
void initOnLoopStart(struct aeEventLoop *el) {}


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

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

LLVM IR (-O0):
%struct.aeEventLoop = type opaque
define void @initOnLoopStart(%struct.aeEventLoop* %0) {
%2 = alloca %struct.aeEventLoop*
store %struct.aeEventLoop* %0, %struct.aeEventLoop** %2
ret void
}

LLVM IR (-O2):
%struct.aeEventLoop = type opaque
define void @initOnLoopStart(%struct.aeEventLoop* nocapture %0) {
ret void
}