xunge/DecIR huggingface dataset:
/* Variables and functions */
float level_gravity();
float f_gravity() { return level_gravity(); }


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

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

LLVM IR (-O0):
define float @f_gravity() {
%1 = call float (...) @level_gravity()
ret float %1
}

LLVM IR (-O2):
define float @f_gravity() {
%1 = tail call float (...) @level_gravity()
ret float %1
}
int multiplexStrlen30(const char *z) {
  const char *z2 = z;
  if (z == 0)
    return 0;
  while (*z2) {
    z2++;
  }
  return 0x3fffffff & (int)(z2 - z);
}


x86 assembly (clang, -O0):
<multiplexStrlen30>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1127 <multiplexStrlen30+0x27>
movl   $0x0,-0x4(%rbp)
jmp    115d <multiplexStrlen30+0x5d>
jmp    112c <multiplexStrlen30+0x2c>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <multiplexStrlen30+0x4a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112c <multiplexStrlen30+0x2c>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
and    $0x3fffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiplexStrlen30>:
test   %rdi,%rdi
je     1122 <multiplexStrlen30+0x22>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <multiplexStrlen30+0x10>
and    $0x3fffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @multiplexStrlen30(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %7, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = ptrtoint i8* %4 to i64
%10 = ptrtoint i8* %0 to i64
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
%13 = and i32 %12, 1073741823
br label %14
14: ; preds = %1, %8
%15 = phi i32 [ %13, %8 ], [ 0, %1 ]
ret i32 %15
}
void arch_spin_unlock(unsigned long *lock) { *lock = 0; }


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

x86 assembly (clang, -O2):
<arch_spin_unlock>:
movq   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @arch_spin_unlock(i64* nocapture writeonly %0) {
store i64 0, i64* %0
ret void
}
int introspect_enter_PEMU() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @introspect_enter_PEMU() {
ret i32 0
}
void overflow_handler(struct exception_info *info) {
  asm volatile("" : : :);
  asm volatile("hlt");
}


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

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

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

LLVM IR (-O2):
%struct.exception_info = type opaque
define void @overflow_handler(%struct.exception_info* nocapture readnone %0) {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ withSync();
int main(int argc, const char *argv[]) {
  withSync();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <withSync@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @withSync()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @withSync()
ret i32 0
}
/* Variables and functions */
long long fib(int);
long long sequence(int n) { return fib(n); }


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

x86 assembly (clang, -O2):
<sequence>:
jmp    1030 <fib@plt>

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

LLVM IR (-O2):
define i64 @sequence(i32 %0) {
%2 = tail call i64 @fib(i32 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *strdup(char const *);
void access_log_redefine_str_var(const char *given_str, char **given_var) {
  if (*given_var != NULL)
    free(*given_var);
  if (given_str != NULL)
    *given_var = strdup(given_str);
  else
    *given_var = NULL;
}


x86 assembly (clang, -O0):
<access_log_redefine_str_var>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     114a <access_log_redefine_str_var+0x2a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x8(%rbp)
je     116d <access_log_redefine_str_var+0x4d>
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    1178 <access_log_redefine_str_var+0x58>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<access_log_redefine_str_var>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rsi),%rdi
test   %rdi,%rdi
je     1137 <access_log_redefine_str_var+0x17>
call   1030 <free@plt>
test   %rbx,%rbx
je     1146 <access_log_redefine_str_var+0x26>
mov    %rbx,%rdi
call   1040 <strdup@plt>
jmp    1148 <access_log_redefine_str_var+0x28>
xor    %eax,%eax
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @access_log_redefine_str_var(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = load i8*, i8** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8**, i8*** %4
%10 = load i8*, i8** %9
%11 = call i32 @free(i8* %10)
br label %12
12: ; preds = %8, %2
%13 = load i8*, i8** %3
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i8*, i8** %3
%17 = call i8* @strdup(i8* %16)
%18 = load i8**, i8*** %4
store i8* %17, i8** %18
br label %21
19: ; preds = %12
%20 = load i8**, i8*** %4
store i8* null, i8** %20
br label %21
21: ; preds = %19, %15
ret void
}

LLVM IR (-O2):
define void @access_log_redefine_str_var(i8* %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @free(i8* %3)
br label %7
7: ; preds = %5, %2
%8 = icmp eq i8* %0, null
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i8* @strdup(i8* %0)
br label %11
11: ; preds = %7, %9
%12 = phi i8* [ %10, %9 ], [ null, %7 ]
store i8* %12, i8** %1
ret void
}
int streq(a, b)
char *a;
char *b;
{ return (strcmp(a, b) == 0); }


x86 assembly (clang, -O0):
<streq>:
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 <strcmp@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<streq>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @streq(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 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @streq(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int ad7476_scan_from_ring(struct ad7476_state *st) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ad7476_state = type opaque
define i32 @ad7476_scan_from_ring(%struct.ad7476_state* nocapture readnone %0) {
ret i32 0
}
void print_pcp_comment(int *tab, int action, char *cur_date, char *cur_time,
                       int utc, char *comment, struct file_header *file_hdr,
                       struct record_header *record_hdr) {}


x86 assembly (clang, -O0):
<print_pcp_comment>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.file_header = type opaque
%struct.record_header = type opaque
define void @print_pcp_comment(i32* %0, i32 %1, i8* %2, i8* %3, i32 %4, i8* %5, %struct.file_header* %6, %struct.record_header* %7) {
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i8*
%15 = alloca %struct.file_header*
%16 = alloca %struct.record_header*
store i32* %0, i32** %9
store i32 %1, i32* %10
store i8* %2, i8** %11
store i8* %3, i8** %12
store i32 %4, i32* %13
store i8* %5, i8** %14
store %struct.file_header* %6, %struct.file_header** %15
store %struct.record_header* %7, %struct.record_header** %16
ret void
}

LLVM IR (-O2):
%struct.file_header = type opaque
%struct.record_header = type opaque
define void @print_pcp_comment(i32* nocapture %0, i32 %1, i8* nocapture %2, i8* nocapture %3, i32 %4, i8* nocapture %5, %struct.file_header* nocapture %6, %struct.record_header* nocapture %7) {
ret void
}
/* Variables and functions */
int close(int);
__attribute__((__weak__, __always___)) int softboundcets_close(int fd) {
  return close(fd);
}


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

x86 assembly (clang, -O2):
<softboundcets_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
int bar(int n) { return n - 1; }


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

x86 assembly (clang, -O2):
<bar>:
lea    -0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = add nsw i32 %0, -1
ret i32 %2
}
int mlt_version_get_revision() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mlt_version_get_revision() {
ret i32 0
}
unsigned ScopeTableSize(unsigned Level) {
  switch (Level) {
  case 0:
    return 213;
  case 1:
    return 53;
  default:
    return 29;
  }
}


x86 assembly (clang, -O0):
<ScopeTableSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     112b <ScopeTableSize+0x2b>
jmp    111a <ScopeTableSize+0x1a>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     1137 <ScopeTableSize+0x37>
jmp    1143 <ScopeTableSize+0x43>
movl   $0xd5,-0x4(%rbp)
jmp    114a <ScopeTableSize+0x4a>
movl   $0x35,-0x4(%rbp)
jmp    114a <ScopeTableSize+0x4a>
movl   $0x1d,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScopeTableSize>:
cmp    $0x1,%edi
mov    $0x35,%eax
mov    $0x1d,%ecx
cmove  %eax,%ecx
test   %edi,%edi
mov    $0xd5,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ScopeTableSize(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i32 53, i32 29
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 213, i32 %3
ret i32 %5
}
/* Variables and functions */
int abs(int);
__attribute__((__weak__, __always___)) int softboundcets_abs(int j) {
  return abs(j);
}


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

x86 assembly (clang, -O2):
<softboundcets_abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define weak i32 @softboundcets_abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int bdopen_raw(char const *, int);
int bdopen(const char *name, int addflags) {
  return bdopen_raw(name, addflags);
}


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

x86 assembly (clang, -O2):
<bdopen>:
jmp    1030 <bdopen_raw@plt>

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

LLVM IR (-O2):
define i32 @bdopen(i8* %0, i32 %1) {
%3 = tail call i32 @bdopen_raw(i8* %0, i32 %1)
ret i32 %3
}
int test_imm_C3int64_highword_reg(long long val) {
  return ((val >> 32) & (0xC3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C3int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0xc3,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C3int64_highword_reg>:
movabs $0xc300000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C3int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 195
%6 = icmp ne i64 %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_C3int64_highword_reg(i64 %0) {
%2 = and i64 %0, 837518622720
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void __DELETE_java_lang_ref_Reference(void *me, void *client_data) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @config_rom_init() {
ret void
}
float dp_to_fp(double d) { return d; }


x86 assembly (clang, -O0):
<dp_to_fp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dp_to_fp>:
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @dp_to_fp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptrunc double %3 to float
ret float %4
}

LLVM IR (-O2):
define float @dp_to_fp(double %0) {
%2 = fptrunc double %0 to float
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void panic(void) {
  fprintf(stderr, "Panic, bala bala...\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<panic>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Panic, bala bala...\0A\00"
@EXIT_FAILURE = global i32 0
define void @panic() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Panic, bala bala...\0A\00"
@EXIT_FAILURE = global i32 0
define void @panic() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ strcat(void *, void const *);
int /*<<< orphan*/ strcpy(void *, void const *);
void path_concat(void *dest, void const *child, void const *parent) {
  (void)strcpy(dest, parent);
  (void)strcat(dest, "->");
  (void)strcat(dest, child);
}


x86 assembly (clang, -O0):
<path_concat>:
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    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_concat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdx,%rsi
call   1030 <strcpy@plt>
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strcat@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"->\00"
define void @path_concat(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %6
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = load i8*, i8** %4
%11 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = call i32 @strcat(i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"->\00"
define void @path_concat(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strcpy(i8* %0, i8* %2)
%5 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @strcat(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int free_arguments(const void *key, void *value, void *context) {
  free(value);
  return 1;
}


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

x86 assembly (clang, -O2):
<free_arguments>:
push   %rax
mov    %rsi,%rdi
call   1030 <free@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @free_arguments(i8* nocapture readnone %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = tail call i32 @free(i8* %1)
ret i32 1
}
float make_ls_vector_identity(int tree) { return 1.0; }


x86 assembly (clang, -O0):
<make_ls_vector_identity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  0xef1(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_ls_vector_identity>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @make_ls_vector_identity(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret float 1.000000e+00
}

LLVM IR (-O2):
define float @make_ls_vector_identity(i32 %0) {
ret float 1.000000e+00
}
/* Variables and functions */
int iso9660_serial(char const *, char *, int, int /*<<< orphan*/);
int iso_serial(const char *path, char *serial) {
  return iso9660_serial(path, serial, 0x0800, 0);
}


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

x86 assembly (clang, -O2):
<iso_serial>:
mov    $0x800,%edx
xor    %ecx,%ecx
jmp    1030 <iso9660_serial@plt>

LLVM IR (-O0):
define i32 @iso_serial(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 @iso9660_serial(i8* %5, i8* %6, i32 2048, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @iso_serial(i8* %0, i8* %1) {
%3 = tail call i32 @iso9660_serial(i8* %0, i8* %1, i32 2048, i32 0)
ret i32 %3
}
float fahrenheit(float gradiCelsius) {
  float gradiFahrenheit;
  return gradiFahrenheit = (gradiCelsius * 1.8) + 32;
}


x86 assembly (clang, -O0):
<fahrenheit>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee2(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahrenheit>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @fahrenheit(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = call double @llvm.fmuladd.f64(double %5, double 1.800000e+00, double 3.200000e+01)
%7 = fptrunc double %6 to float
store float %7, float* %3
ret float %7
}

LLVM IR (-O2):
define float @fahrenheit(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 1.800000e+00, double 3.200000e+01)
%4 = fptrunc double %3 to float
ret float %4
}
void glmGenerateTransposeMatrix2f(float t[4], const float m[4]) {
  t[0] = m[0];
  t[2] = m[1];
  t[1] = m[2];
  t[3] = m[3];
}


x86 assembly (clang, -O0):
<glmGenerateTransposeMatrix2f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmGenerateTransposeMatrix2f>:
movss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
movss  0x8(%rsi),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0xc(%rsi),%xmm0
movss  %xmm0,0xc(%rdi)
ret

LLVM IR (-O0):
define void @glmGenerateTransposeMatrix2f(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %3
%9 = getelementptr inbounds float, float* %8, i64 0
store float %7, float* %9
%10 = load float*, float** %4
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = load float, float* %11
%13 = load float*, float** %3
%14 = getelementptr inbounds float, float* %13, i64 2
store float %12, float* %14
%15 = load float*, float** %4
%16 = getelementptr inbounds float, float* %15, i64 2
%17 = load float, float* %16
%18 = load float*, float** %3
%19 = getelementptr inbounds float, float* %18, i64 1
store float %17, float* %19
%20 = load float*, float** %4
%21 = getelementptr inbounds float, float* %20, i64 3
%22 = load float, float* %21
%23 = load float*, float** %3
%24 = getelementptr inbounds float, float* %23, i64 3
store float %22, float* %24
ret void
}

LLVM IR (-O2):
define void @glmGenerateTransposeMatrix2f(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
store float %3, float* %0
%4 = getelementptr inbounds float, float* %1, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %0, i64 2
store float %5, float* %6
%7 = getelementptr inbounds float, float* %1, i64 2
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %0, i64 1
store float %8, float* %9
%10 = getelementptr inbounds float, float* %1, i64 3
%11 = load float, float* %10
%12 = getelementptr inbounds float, float* %0, i64 3
store float %11, float* %12
ret void
}
/* Variables and functions */
char *strdup(char *);
char *convert_path(char *origpath) {
  char *newpath;
  int i;
  newpath = strdup(origpath);
  i = 0;
  while (newpath[i] != 0) {
    if (newpath[i] == '\\') {
      newpath[i] = '/';
    }
    i++;
  }
  return (newpath);
}


x86 assembly (clang, -O0):
<convert_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1174 <convert_path+0x64>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
jne    1166 <convert_path+0x56>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x2f,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1130 <convert_path+0x20>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_path>:
push   %rax
call   1030 <strdup@plt>
mov    %rax,%rcx
jmp    1127 <convert_path+0x17>
nopl   0x0(%rax,%rax,1)
movb   $0x2f,(%rcx)
add    $0x1,%rcx
movzbl (%rcx),%edx
cmp    $0x5c,%dl
je     1120 <convert_path+0x10>
test   %dl,%dl
jne    1123 <convert_path+0x13>
pop    %rcx
ret

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

LLVM IR (-O2):
define noalias i8* @convert_path(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
br label %3
3: ; preds = %8, %1
%4 = phi i64 [ %9, %8 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %2, i64 %4
%6 = load i8, i8* %5
switch i8 %6, label %8 [
i8 0, label %10
i8 92, label %7
]
7: ; preds = %3
store i8 47, i8* %5
br label %8
8: ; preds = %3, %7
%9 = add nuw i64 %4, 1
br label %3
10: ; preds = %3
ret i8* %2
}
void asctoe113(s, y) char *s;
unsigned short *y;
{ asctoeg(s, y, 113); }


x86 assembly (clang, -O0):
<asctoe113>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x71,%edx
mov    $0x0,%al
call   1030 <asctoeg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asctoe113>:
mov    $0x71,%edx
xor    %eax,%eax
jmp    1030 <asctoeg@plt>

LLVM IR (-O0):
define void @asctoe113(i8* %0, i16* %1) {
%3 = alloca i8*
%4 = alloca i16*
store i8* %0, i8** %3
store i16* %1, i16** %4
%5 = load i8*, i8** %3
%6 = load i16*, i16** %4
%7 = call i32 (i8*, i16*, i32, ...) bitcast (i32 (...)* @asctoeg to i32 (i8*, i16*, i32, ...)*)(i8* %5, i16* %6, i32 113)
ret void
}

LLVM IR (-O2):
define void @asctoe113(i8* %0, i16* %1) {
%3 = tail call i32 (i8*, i16*, i32, ...) bitcast (i32 (...)* @asctoeg to i32 (i8*, i16*, i32, ...)*)(i8* %0, i16* %1, i32 113)
ret void
}
__attribute__((no, noclone)) long double truncl(long double x) { return x; }


x86 assembly (clang, -O0):
<truncl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<truncl>:
fldt   0x8(%rsp)
ret

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

LLVM IR (-O2):
define x86_fp80 @truncl(x86_fp80 returned %0) {
ret x86_fp80 %0
}
/* Type definitions */
struct ac_buffer {
  int dummy;
};

/* Variables and functions */
int _buffer_read_array(struct ac_buffer *, char *, int *, int);
int buffer_read_char_array(struct ac_buffer *buffer, char *value, int *size) {
  return _buffer_read_array(buffer, value, size, sizeof(char));
}


x86 assembly (clang, -O0):
<buffer_read_char_array>:
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),%rdx
mov    $0x1,%ecx
call   1030 <_buffer_read_array@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_read_char_array>:
mov    $0x1,%ecx
jmp    1030 <_buffer_read_array@plt>

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

LLVM IR (-O2):
%struct.ac_buffer = type { i32 }
define i32 @buffer_read_char_array(%struct.ac_buffer* %0, i8* %1, i32* %2) {
%4 = tail call i32 @_buffer_read_array(%struct.ac_buffer* %0, i8* %1, i32* %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ hello_func(char *);
int main(int argc, char *argv[]) {
  hello_func(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <hello_func@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <hello_func@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @hello_func(i8* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @hello_func(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *, char *);
scalar_t__ pthread_self();
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ whie(int);
void *busy(void *arg) {
  fprintf(stderr, "thread tid %p is %s\n", (void *)pthread_self(), (char *)arg);
  whie(1);
}


x86 assembly (clang, -O0):
<busy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    -0x14(%rbp),%edi
mov    %rax,%rdx
mov    -0x10(%rbp),%rcx
lea    0xea0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1030 <whie@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<busy>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xeb3(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
mov    %rbx,%rcx
call   1040 <fprintf@plt>
mov    $0x1,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <whie@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"thread tid %p is %s\0A\00"
define i8* @busy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i32, i32* @stderr
%5 = call i64 (...) @pthread_self()
%6 = inttoptr i64 %5 to i8*
%7 = load i8*, i8** %3
%8 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = call i32 @whie(i32 1)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"thread tid %p is %s\0A\00"
define noalias i8* @busy(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i64 (...) @pthread_self()
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %0)
%6 = tail call i32 @whie(i32 1)
ret i8* undef
}
void reset_brick_pos(int play_brick_pos[]) {
  play_brick_pos[0] = 1;
  play_brick_pos[1] = 7;
}


x86 assembly (clang, -O0):
<reset_brick_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x7,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_brick_pos>:
movabs $0x700000001,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @reset_brick_pos(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 1, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 7, i32* %6
ret void
}

LLVM IR (-O2):
define void @reset_brick_pos(i32* nocapture writeonly %0) {
store i32 1, i32* %0
%2 = getelementptr inbounds i32, i32* %0, i64 1
store i32 7, i32* %2
ret void
}
int WebPGetEncoderVersion(void) { return (0 << 16) | (4 << 8) | 2; }


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

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

LLVM IR (-O0):
define i32 @WebPGetEncoderVersion() {
ret i32 1026
}

LLVM IR (-O2):
define i32 @WebPGetEncoderVersion() {
ret i32 1026
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void error(char *msg) {
  perror(msg);
  exit(-1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
void *memmove(void *dest, const void *src, size_t n) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @memmove(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @memmove(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("test中文test");
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"test\E4\B8\AD\E6\96\87test\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"test\E4\B8\AD\E6\96\87test\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void *read_pointer(void *src) {
  switch ((sizeof(void *))) {
  case 4:
    return (void *)((uint64_t)(*((uint32_t *)src)));
  case 8:
    return (void *)(*((uint64_t *)src));
  default:
    return NULL;
  }
}


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

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

LLVM IR (-O0):
define i8* @read_pointer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @read_pointer(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ __libc_free(void *);
int /*<<< orphan*/ log_event(int, void *, int /*<<< orphan*/);
void free(void *ptr) {
  log_event(2, ptr, 0);
  __libc_free(ptr);
}


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

x86 assembly (clang, -O2):
<free>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1040 <log_event@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <__libc_free@plt>

LLVM IR (-O0):
define void @free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @log_event(i32 2, i8* %3, i32 0)
%5 = load i8*, i8** %2
%6 = call i32 @__libc_free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @free(i8* %0) {
%2 = tail call i32 @log_event(i32 2, i8* %0, i32 0)
%3 = tail call i32 @__libc_free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void dirname_data_destructor(void *buffer) { free(buffer); }


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

x86 assembly (clang, -O2):
<dirname_data_destructor>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @dirname_data_destructor(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int CellNextForLive(int neighborNum) {
  return (neighborNum >= 2) && (neighborNum <= 3);
}


x86 assembly (clang, -O0):
<CellNextForLive>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x2,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <CellNextForLive+0x20>
cmpl   $0x3,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CellNextForLive>:
and    $0xfffffffe,%edi
xor    %eax,%eax
cmp    $0x2,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @CellNextForLive(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 2
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 3
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @CellNextForLive(i32 %0) {
%2 = and i32 %0, -2
%3 = icmp eq i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_F1int32_mem(int *val) {
  return ((*val) & (0xF1 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F1int32_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, 241
%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_F1int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 241
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ drawList();
int /*<<< orphan*/ init_LCD();
void init_DRAWMANAGER() {
  init_LCD();
  drawList();
}


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

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

LLVM IR (-O0):
define void @init_DRAWMANAGER() {
%1 = call i32 (...) @init_LCD()
%2 = call i32 (...) @drawList()
ret void
}

LLVM IR (-O2):
define void @init_DRAWMANAGER() {
%1 = tail call i32 (...) @init_LCD()
%2 = tail call i32 (...) @drawList()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pl_fbdev_close();
void CloseDisplay(void) { pl_fbdev_close(); }


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

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

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

LLVM IR (-O2):
define void @CloseDisplay() {
%1 = tail call i32 (...) @pl_fbdev_close()
ret void
}
/* Type definitions */
struct world_allocator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(struct world_allocator *);
void world_allocator_destroy(struct world_allocator *a) { assert(a); }


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

x86 assembly (clang, -O2):
<world_allocator_destroy>:
jmp    1030 <assert@plt>

LLVM IR (-O0):
%struct.world_allocator = type { i32 }
define void @world_allocator_destroy(%struct.world_allocator* %0) {
%2 = alloca %struct.world_allocator*
store %struct.world_allocator* %0, %struct.world_allocator** %2
%3 = load %struct.world_allocator*, %struct.world_allocator** %2
%4 = call i32 @assert(%struct.world_allocator* %3)
ret void
}

LLVM IR (-O2):
%struct.world_allocator = type { i32 }
define void @world_allocator_destroy(%struct.world_allocator* %0) {
%2 = tail call i32 @assert(%struct.world_allocator* %0)
ret void
}