xunge/DecIR huggingface dataset:
int put(c)
int c;
{ return (putchar(c)); }


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

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

LLVM IR (-O0):
define i32 @put(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @put(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t rte_arch_bswap64(uint64_t _x) {
  return (_x >> 56) | ((_x >> 40) & 0xff00) | ((_x >> 24) & 0xff0000) |
         ((_x >> 8) & 0xff000000) | ((_x << 8) & (0xffULL << 32)) |
         ((_x << 24) & (0xffULL << 40)) | ((_x << 40) & (0xffULL << 48)) |
         ((_x << 56));
}


x86 assembly (clang, -O0):
<rte_arch_bswap64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x38,%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x28,%ecx
sar    %cl,%edx
mov    %edx,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff000000,%ecx
or     %ecx,%eax
mov    %eax,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
movslq %ecx,%rcx
movabs $0xff00000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x4(%rbp),%ecx
shl    $0x18,%ecx
movslq %ecx,%rcx
movabs $0xff0000000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x4(%rbp),%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
movabs $0xff000000000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x4(%rbp),%edx
mov    $0x38,%ecx
shl    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
or     %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rte_arch_bswap64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 56
%5 = load i32, i32* %2
%6 = ashr i32 %5, 40
%7 = and i32 %6, 65280
%8 = or i32 %4, %7
%9 = load i32, i32* %2
%10 = ashr i32 %9, 24
%11 = and i32 %10, 16711680
%12 = or i32 %8, %11
%13 = load i32, i32* %2
%14 = ashr i32 %13, 8
%15 = and i32 %14, -16777216
%16 = or i32 %12, %15
%17 = zext i32 %16 to i64
%18 = load i32, i32* %2
%19 = shl i32 %18, 8
%20 = sext i32 %19 to i64
%21 = and i64 %20, 1095216660480
%22 = or i64 %17, %21
%23 = load i32, i32* %2
%24 = shl i32 %23, 24
%25 = sext i32 %24 to i64
%26 = and i64 %25, 280375465082880
%27 = or i64 %22, %26
%28 = load i32, i32* %2
%29 = shl i32 %28, 40
%30 = sext i32 %29 to i64
%31 = and i64 %30, 71776119061217280
%32 = or i64 %27, %31
%33 = load i32, i32* %2
%34 = shl i32 %33, 56
%35 = sext i32 %34 to i64
%36 = or i64 %32, %35
%37 = trunc i64 %36 to i32
ret i32 %37
}

LLVM IR (-O2):
define i32 @rte_arch_bswap64(i32 %0) {
ret i32 poison
}
int ls_costN_nm10_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 1;
  if (sz_res)
    *sz_res = 2;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 1;
  return 0;
}


x86 assembly (clang, -O0):
<ls_costN_nm10_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <ls_costN_nm10_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <ls_costN_nm10_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <ls_costN_nm10_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <ls_costN_nm10_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm10_work>:
test   %rdi,%rdi
je     110b <ls_costN_nm10_work+0xb>
movl   $0x1,(%rdi)
test   %rsi,%rsi
je     1116 <ls_costN_nm10_work+0x16>
movl   $0x2,(%rsi)
test   %rdx,%rdx
je     1121 <ls_costN_nm10_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <ls_costN_nm10_work+0x2c>
movl   $0x1,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ls_costN_nm10_work(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = load i32*, i32** %5
store i32 1, i32* %12
br label %13
13: ; preds = %11, %4
%14 = load i32*, i32** %6
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i32*, i32** %6
store i32 2, i32* %17
br label %18
18: ; preds = %16, %13
%19 = load i32*, i32** %7
%20 = icmp ne i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = load i32*, i32** %7
store i32 0, i32* %22
br label %23
23: ; preds = %21, %18
%24 = load i32*, i32** %8
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = load i32*, i32** %8
store i32 1, i32* %27
br label %28
28: ; preds = %26, %23
ret i32 0
}

LLVM IR (-O2):
define i32 @ls_costN_nm10_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 1, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 2, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 1, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(char *, int, int, int /*<<< orphan*/ *);
scalar_t__ malloc(int);
char *fu_Fnread(FILE *stream, int length) {
  char *buffer = (char *)malloc(sizeof(char) * (length + 1));
  size_t n = fread(buffer, 1, length, stream);
  buffer[n] = 0;
  return buffer;
}


x86 assembly (clang, -O0):
<fu_Fnread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fu_Fnread>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1,%esi
mov    %r15d,%edx
mov    %r14,%rcx
call   1030 <fread@plt>
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @fu_Fnread(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = mul i64 1, %9
%11 = trunc i64 %10 to i32
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = load i32, i32* %4
%16 = load i32*, i32** %3
%17 = call i64 @fread(i8* %14, i32 1, i32 %15, i32* %16)
store i64 %17, i64* %6
%18 = load i8*, i8** %5
%19 = load i64, i64* %6
%20 = getelementptr inbounds i8, i8* %18, i64 %19
store i8 0, i8* %20
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
define i8* @fu_Fnread(i32* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i64 @fread(i8* %5, i32 1, i32 %1, i32* %0)
%7 = getelementptr inbounds i8, i8* %5, i64 %6
store i8 0, i8* %7
ret i8* %5
}
/* Variables and functions */
void teredo_dummy_recv_cb(void *o, const void *p, size_t l) {
  (void)o;
  (void)p;
  (void)l;
}


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

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

LLVM IR (-O0):
define void @teredo_dummy_recv_cb(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
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
ret void
}

LLVM IR (-O2):
define void @teredo_dummy_recv_cb(i8* nocapture %0, i8* nocapture %1, i64 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("this is test!!!"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"this is test!!!\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"this is test!!!\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_uid_get_state(uid_t uid,
                                                            char **state) {
  return -EINVAL;
}


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

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

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_uid_get_state(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ clear_bss_datasegment();
int /*<<< orphan*/ init_datasegment_from_rom();
int /*<<< orphan*/ main();
void reset_interrupt(void) {
  init_datasegment_from_rom();
  clear_bss_datasegment();
  main();
  while (1) {
  }
}


x86 assembly (clang, -O0):
<reset_interrupt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <init_datasegment_from_rom@plt>
mov    $0x0,%al
call   1030 <clear_bss_datasegment@plt>
mov    $0x0,%al
call   1050 <main@plt>
jmp    1149 <reset_interrupt+0x19>

x86 assembly (clang, -O2):
<reset_interrupt>:
push   %rax
xor    %eax,%eax
call   1040 <init_datasegment_from_rom@plt>
xor    %eax,%eax
call   1030 <clear_bss_datasegment@plt>
xor    %eax,%eax
call   1050 <main@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1150 <reset_interrupt+0x20>

LLVM IR (-O0):
define void @reset_interrupt() {
%1 = call i32 (...) @init_datasegment_from_rom()
%2 = call i32 (...) @clear_bss_datasegment()
%3 = call i32 (...) @main()
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
define void @reset_interrupt() {
%1 = tail call i32 (...) @init_datasegment_from_rom()
%2 = tail call i32 (...) @clear_bss_datasegment()
%3 = tail call i32 (...) @main()
br label %4
4: ; preds = %0, %4
br label %4
}
unsigned int int_hash(void *vlocation) {
  int *location;
  location = (int *)vlocation;
  return (unsigned int)*location;
}


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

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

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

LLVM IR (-O2):
define i32 @int_hash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
void ARGBToARGB4444Row_Any_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToARGB4444Row_Any_SSE2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mysql_library_end();
int db_mysql_uninit(void) {
  mysql_library_end();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @db_mysql_uninit() {
%1 = tail call i32 (...) @mysql_library_end()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, char);
int main(void) {
  char *p = (char *)malloc(1);
  *p = 'a';
  char c = *p;
  printf("\n [%c]\n", c);
  free(p);
  free(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x61,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
lea    0xe9c(%rip),%rdi
movsbl -0x11(%rbp),%esi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movb   $0x61,(%rax)
lea    0xeb8(%rip),%rdi
mov    $0x61,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"\0A [%c]\0A\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 1)
%2 = inttoptr i64 %1 to i8*
store i8 97, i8* %2
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext 97)
%4 = tail call i32 @free(i8* %2)
%5 = tail call i32 @free(i8* %2)
ret i32 0
}
struct B {
  int i, j, k;
  void *p;
} g() {
  return (struct B){1, 2, 3, 0};
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,%rax
movl   $0x1,(%rdi)
movl   $0x2,0x4(%rdi)
movl   $0x3,0x8(%rdi)
movq   $0x0,0x10(%rdi)
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
mov    %rdi,%rax
movabs $0x200000001,%rcx
mov    %rcx,(%rdi)
movl   $0x3,0x8(%rdi)
movq   $0x0,0x10(%rdi)
ret

LLVM IR (-O0):
%struct.B = type { i32, i32, i32, i8* }
define void @g(%struct.B* noalias sret(%struct.B) align 8 %0) {
%2 = getelementptr inbounds %struct.B, %struct.B* %0, i32 0, i32 0
store i32 1, i32* %2
%3 = getelementptr inbounds %struct.B, %struct.B* %0, i32 0, i32 1
store i32 2, i32* %3
%4 = getelementptr inbounds %struct.B, %struct.B* %0, i32 0, i32 2
store i32 3, i32* %4
%5 = getelementptr inbounds %struct.B, %struct.B* %0, i32 0, i32 3
store i8* null, i8** %5
ret void
}

LLVM IR (-O2):
%struct.B = type { i32, i32, i32, i8* }
define void @g(%struct.B* noalias nocapture writeonly sret(%struct.B) align 8 %0) {
%2 = getelementptr inbounds %struct.B, %struct.B* %0, i64 0, i32 0
store i32 1, i32* %2
%3 = getelementptr inbounds %struct.B, %struct.B* %0, i64 0, i32 1
store i32 2, i32* %3
%4 = getelementptr inbounds %struct.B, %struct.B* %0, i64 0, i32 2
store i32 3, i32* %4
%5 = getelementptr inbounds %struct.B, %struct.B* %0, i64 0, i32 3
store i8* null, i8** %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void const *);
void kfree(const void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<kfree>:
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):
<kfree>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @kfree(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 @kfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int test_imm_6Buint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x6B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Buint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 107
%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_6Buint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 107
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void BlockCopy(uint8_t *output, uint8_t *input) { memcpy(output, input, 16); }


x86 assembly (clang, -O0):
<BlockCopy>:
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    $0x10,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BlockCopy>:
mov    $0x10,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @BlockCopy(i32* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %0, i32* %1, i32 16)
ret void
}
void MarkAsNonResource(filename) char *filename;
{ AddResource("mkpsresPrivate", "NONRESOURCE", filename, 0); }


x86 assembly (clang, -O0):
<MarkAsNonResource>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xee1(%rip),%rsi
xor    %ecx,%ecx
mov    $0x0,%al
call   1030 <AddResource@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MarkAsNonResource>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %ecx,%ecx
xor    %eax,%eax
jmp    1030 <AddResource@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"mkpsresPrivate\00"
@.str.1 = [12 x i8] c"NONRESOURCE\00"
define void @MarkAsNonResource(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @AddResource to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %3, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"mkpsresPrivate\00"
@.str.1 = [12 x i8] c"NONRESOURCE\00"
define void @MarkAsNonResource(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @AddResource to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fill_array(int, int *);
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ print_array(int, int *);
int /*<<< orphan*/ sort_array_recursive(int, int *);
int main() {
  int *input_array;
  int array_size = 10;
  input_array = malloc(array_size * sizeof(int));
  fill_array(array_size, input_array);
  print_array(array_size, input_array);
  sort_array_recursive(array_size, input_array);
  print_array(array_size, input_array);
  free(input_array);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <fill_array@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <print_array@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1070 <sort_array_recursive@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <print_array@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x28,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0xa,%edi
mov    %rax,%rsi
call   1060 <fill_array@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <print_array@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1070 <sort_array_recursive@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <print_array@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %3
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 4
%7 = trunc i64 %6 to i32
%8 = call i32* @malloc(i32 %7)
store i32* %8, i32** %2
%9 = load i32, i32* %3
%10 = load i32*, i32** %2
%11 = call i32 @fill_array(i32 %9, i32* %10)
%12 = load i32, i32* %3
%13 = load i32*, i32** %2
%14 = call i32 @print_array(i32 %12, i32* %13)
%15 = load i32, i32* %3
%16 = load i32*, i32** %2
%17 = call i32 @sort_array_recursive(i32 %15, i32* %16)
%18 = load i32, i32* %3
%19 = load i32*, i32** %2
%20 = call i32 @print_array(i32 %18, i32* %19)
%21 = load i32*, i32** %2
%22 = call i32 @free(i32* %21)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 40)
%2 = tail call i32 @fill_array(i32 10, i32* %1)
%3 = tail call i32 @print_array(i32 10, i32* %1)
%4 = tail call i32 @sort_array_recursive(i32 10, i32* %1)
%5 = tail call i32 @print_array(i32 10, i32* %1)
%6 = tail call i32 @free(i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ I2CSlaveBaseValid(unsigned long);
void I2CSlaveDisable(unsigned long ulBase) {
  DEBUG_ASSERT(I2CSlaveBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x00000004))) = 0;
  (*((volatile unsigned long *)(ulBase - 0x40020800 + 0x40020000 +
                                0x00000020))) &= ~(0x00000020);
}


x86 assembly (clang, -O0):
<I2CSlaveDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <I2CSlaveBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,0x4(%rax)
mov    -0x8(%rbp),%rax
sub    $0x40020800,%rax
mov    0x40020020(%rax),%rcx
and    $0xffffffffffffffdf,%rcx
mov    %rcx,0x40020020(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveDisable>:
push   %rbx
mov    %rdi,%rbx
call   1040 <I2CSlaveBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
movq   $0x0,0x4(%rbx)
andq   $0xffffffffffffffdf,-0x7e0(%rbx)
df
pop    %rbx
ret

LLVM IR (-O0):
define void @I2CSlaveDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @I2CSlaveBaseValid(i64 %3)
%5 = call i32 @DEBUG_ASSERT(i32 %4)
%6 = load i64, i64* %2
%7 = add i64 %6, 4
%8 = inttoptr i64 %7 to i64*
store volatile i64 0, i64* %8
%9 = load i64, i64* %2
%10 = sub i64 %9, 1073874944
%11 = add i64 %10, 1073872896
%12 = add i64 %11, 32
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = and i64 %14, -33
store volatile i64 %15, i64* %13
ret void
}

LLVM IR (-O2):
define void @I2CSlaveDisable(i64 %0) {
%2 = tail call i32 @I2CSlaveBaseValid(i64 %0)
%3 = tail call i32 @DEBUG_ASSERT(i32 %2)
%4 = add i64 %0, 4
%5 = inttoptr i64 %4 to i64*
store volatile i64 0, i64* %5
%6 = add i64 %0, -2016
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, -33
store volatile i64 %9, i64* %7
ret void
}
/* Variables and functions */
float GetFloat();
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  float amount;
  printf("How much change is owned? \n");
  amount = GetFloat();
  printf("Amount of change is: %f\n", amount);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <GetFloat@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeca(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <GetFloat@plt>
cvtss2sd %xmm0,%xmm0
lea    0xeb1(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"How much change is owned? \0A\00"
@.str.1 = [25 x i8] c"Amount of change is: %f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = call float (...) @GetFloat()
store float %3, float* %1
%4 = load float, float* %1
%5 = fpext float %4 to double
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), double %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [25 x i8] c"Amount of change is: %f\0A\00"
@str = [27 x i8] c"How much change is owned? \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call float (...) @GetFloat()
%3 = fpext float %2 to double
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), double %3)
ret i32 0
}
void destroy(void **dados) {}


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

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

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

LLVM IR (-O2):
define void @destroy(i8** nocapture %0) {
ret void
}
/* Type definitions */
typedef int cl_uint;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int);
int /*<<< orphan*/ stderr;
void check_error(const char *msg, cl_uint error) {
  if (!error)
    return;
  fprintf(stderr, "Error during %s: %d\n", msg, error);
  fflush(stderr);
  abort();
}


x86 assembly (clang, -O0):
<check_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    114f <check_error+0x1f>
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xe9a(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<check_error>:
test   %esi,%esi
jne    1135 <check_error+0x5>
ret
push   %rbx
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2e9e(%rip),%rbx
mov    (%rbx),%edi
lea    0xeb5(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Error during %s: %d\0A\00"
define void @check_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %2
ret void
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11)
%13 = load i32, i32* @stderr
%14 = call i32 @fflush(i32 %13)
%15 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Error during %s: %d\0A\00"
define void @check_error(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %2
ret void
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fflush(i32 %8)
%10 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int serverPlayersPlaying();
int server_players_playing() { return serverPlayersPlaying(); }


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

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

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

LLVM IR (-O2):
define i32 @server_players_playing() {
%1 = tail call i32 (...) @serverPlayersPlaying()
ret i32 %1
}
/* Variables and functions */
unsigned int const random_rand();
unsigned int random_int(const unsigned int max) {
  return (max == 0) ? 0 : random_rand() % max;
}


x86 assembly (clang, -O0):
<random_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112f <random_int+0x1f>
xor    %edx,%edx
mov    %edx,-0x8(%rbp)
jmp    113e <random_int+0x2e>
mov    $0x0,%al
call   1030 <random_rand@plt>
xor    %edx,%edx
divl   -0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_int>:
test   %edi,%edi
je     1126 <random_int+0x16>
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <random_rand@plt>
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @random_int(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 (...) @random_rand()
%5 = urem i32 %4, %0
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ baz();
void bar(void) { baz(); }


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

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

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

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 (...) @baz()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ linear_regression();
int main(void) {
  linear_regression();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @linear_regression()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @linear_regression()
ret i32 0
}
/* Variables and functions */
int yahoo_M1Common(unsigned int, int);
int yahoo_f01_58(int Salt, int Parameter) {
  unsigned b = Salt ^ 0x3F331713;
  return yahoo_M1Common(b, Parameter);
}


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

x86 assembly (clang, -O2):
<yahoo_f01_58>:
xor    $0x3f331713,%edi
jmp    1030 <yahoo_M1Common@plt>

LLVM IR (-O0):
define i32 @yahoo_f01_58(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = xor i32 %6, 1060312851
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = call i32 @yahoo_M1Common(i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @yahoo_f01_58(i32 %0, i32 %1) {
%3 = xor i32 %0, 1060312851
%4 = tail call i32 @yahoo_M1Common(i32 %3, i32 %1)
ret i32 %4
}
double berechne_verbrauch_liter_pro_km(double strecke, double verbrauch) {
  double verbrauch_liter_pro_km = verbrauch / strecke;
  return verbrauch_liter_pro_km;
}


x86 assembly (clang, -O0):
<berechne_verbrauch_liter_pro_km>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<berechne_verbrauch_liter_pro_km>:
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @berechne_verbrauch_liter_pro_km(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fdiv double %6, %7
store double %8, double* %5
%9 = load double, double* %5
ret double %9
}

LLVM IR (-O2):
define double @berechne_verbrauch_liter_pro_km(double %0, double %1) {
%3 = fdiv double %1, %0
ret double %3
}
INSTR(TRAPA) { LOG_FATAL("unsupported TRAPA"); }


x86 assembly (clang, -O0):
<INSTR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <LOG_FATAL@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INSTR>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <LOG_FATAL@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"unsupported TRAPA\00"
define i32 @INSTR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @LOG_FATAL to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [18 x i8] c"unsupported TRAPA\00"
define i32 @INSTR(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @LOG_FATAL to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int parse_face(char *);
int /*<<< orphan*/ skip_whitespace(char *);
int parse_cubie(char *p) {
  skip_whitespace(p);
  int v = 1;
  int f = 0;
  while ((f = parse_face(p)) >= 0) {
    v = v * 6 + f;
    if (v >= 2 * 6 * 6 * 6)
      return -1;
  }
  return v;
}


x86 assembly (clang, -O0):
<parse_cubie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <skip_whitespace@plt>
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <parse_face@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jl     1180 <parse_cubie+0x60>
imul   $0x6,-0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x1b0,-0x14(%rbp)
jl     117b <parse_cubie+0x5b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1186 <parse_cubie+0x66>
jmp    1143 <parse_cubie+0x23>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_cubie>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <skip_whitespace@plt>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <parse_face@plt>
test   %eax,%eax
js     115f <parse_cubie+0x3f>
lea    (%rbx,%rbx,2),%ecx
lea    (%rax,%rcx,2),%ebx
cmp    $0x1b0,%ebx
jl     1140 <parse_cubie+0x20>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @parse_cubie(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @skip_whitespace(i8* %6)
store i32 1, i32* %4
store i32 0, i32* %5
br label %8
8: ; preds = %20, %1
%9 = load i8*, i8** %3
%10 = call i32 @parse_face(i8* %9)
store i32 %10, i32* %5
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %8
%13 = load i32, i32* %4
%14 = mul nsw i32 %13, 6
%15 = load i32, i32* %5
%16 = add nsw i32 %14, %15
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = icmp sge i32 %17, 432
br i1 %18, label %19, label %20
19: ; preds = %12
store i32 -1, i32* %2
br label %23
20: ; preds = %12
br label %8
21: ; preds = %8
%22 = load i32, i32* %4
store i32 %22, i32* %2
br label %23
23: ; preds = %21, %19
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @parse_cubie(i8* %0) {
%2 = tail call i32 @skip_whitespace(i8* %0)
br label %3
3: ; preds = %7, %1
%4 = phi i32 [ 1, %1 ], [ %9, %7 ]
%5 = tail call i32 @parse_face(i8* %0)
%6 = icmp sgt i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = mul nsw i32 %4, 6
%9 = add nsw i32 %8, %5
%10 = icmp sgt i32 %9, 431
br i1 %10, label %11, label %3
11: ; preds = %3, %7
%12 = phi i32 [ -1, %7 ], [ %4, %3 ]
ret i32 %12
}
int get_num_in_zone(int i, int j, int k) {
  return (k * (201) * (201) + j * (201) + i) + 1;
}


x86 assembly (clang, -O0):
<get_num_in_zone>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0xc9,-0xc(%rbp),%eax
imul   $0xc9,%eax,%eax
imul   $0xc9,-0x8(%rbp),%ecx
add    %ecx,%eax
add    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_num_in_zone>:
imul   $0x9dd1,%edx,%eax
imul   $0xc9,%esi,%ecx
add    %edi,%ecx
add    %ecx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @get_num_in_zone(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* %6
%8 = mul nsw i32 %7, 201
%9 = mul nsw i32 %8, 201
%10 = load i32, i32* %5
%11 = mul nsw i32 %10, 201
%12 = add nsw i32 %9, %11
%13 = load i32, i32* %4
%14 = add nsw i32 %12, %13
%15 = add nsw i32 %14, 1
ret i32 %15
}

LLVM IR (-O2):
define i32 @get_num_in_zone(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %2, 40401
%5 = mul nsw i32 %1, 201
%6 = add i32 %0, 1
%7 = add i32 %6, %5
%8 = add i32 %7, %4
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void die(char *m) {
  fprintf(stderr, "Fatal: %s\n", m);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"Fatal: %s\0A\00"
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Fatal: %s\0A\00"
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int do_126() { return 126; }


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

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

LLVM IR (-O0):
define i32 @do_126() {
ret i32 126
}

LLVM IR (-O2):
define i32 @do_126() {
ret i32 126
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
scalar_t__ cmp2(void const *, void const *);
scalar_t__ cmp8(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool cmp10(const void *a, const void *b) {
  return cmp2(a, b) && cmp8((uint8_t *)a + 2, (uint8_t *)b + 2);
}


x86 assembly (clang, -O0):
<cmp10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <cmp2@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     116e <cmp10+0x4e>
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1030 <cmp8@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp10>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <cmp2@plt>
test   %rax,%rax
je     1154 <cmp10+0x34>
add    $0x8,%rbx
add    $0x8,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <cmp8@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    1156 <cmp10+0x36>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @cmp10(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 i64 @cmp2(i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = bitcast i8* %10 to i32*
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i8*, i8** %4
%14 = bitcast i8* %13 to i32*
%15 = getelementptr inbounds i32, i32* %14, i64 2
%16 = call i64 @cmp8(i32* %12, i32* %15)
%17 = icmp ne i64 %16, 0
br label %18
18: ; preds = %9, %2
%19 = phi i1 [ false, %2 ], [ %17, %9 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @cmp10(i8* %0, i8* %1) {
%3 = tail call i64 @cmp2(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 8
%7 = bitcast i8* %6 to i32*
%8 = getelementptr inbounds i8, i8* %1, i64 8
%9 = bitcast i8* %8 to i32*
%10 = tail call i64 @cmp8(i32* %7, i32* %9)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %5, %2
%14 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %14
}
/* Type definitions */
struct kmod_module_section {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct kmod_module_section *);
void kmod_module_section_free(struct kmod_module_section *section) {
  free(section);
}


x86 assembly (clang, -O0):
<kmod_module_section_free>:
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):
<kmod_module_section_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.kmod_module_section = type { i32 }
define void @kmod_module_section_free(%struct.kmod_module_section* nocapture %0) {
%2 = tail call i32 @free(%struct.kmod_module_section* %0)
ret void
}
/* Type definitions */
typedef int ptrdiff_t;

/* Variables and functions */
ptrdiff_t hash_1d(ptrdiff_t x) { return ((x + 7) * 11) & 0xff; }


x86 assembly (clang, -O0):
<hash_1d>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x7,%eax
imul   $0xb,%eax,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_1d>:
lea    (%rdi,%rdi,4),%eax
lea    (%rdi,%rax,2),%eax
add    $0x4d,%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @hash_1d(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 7
%5 = mul nsw i32 %4, 11
%6 = and i32 %5, 255
ret i32 %6
}

LLVM IR (-O2):
define i32 @hash_1d(i32 %0) {
%2 = mul i32 %0, 11
%3 = add i32 %2, 77
%4 = and i32 %3, 255
ret i32 %4
}
int f(void) {
  int x = 'a';
  double z = 3;
  x = x + 'c' + 2 + z;
  return 'a';
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x61,-0x4(%rbp)
movsd  0xeed(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x63,%eax
add    $0x2,%eax
cvtsi2sd %eax,%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    $0x61,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
%2 = alloca double
store i32 97, i32* %1
store double 3.000000e+00, double* %2
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 99
%5 = add nsw i32 %4, 2
%6 = sitofp i32 %5 to double
%7 = load double, double* %2
%8 = fadd double %6, %7
%9 = fptosi double %8 to i32
store i32 %9, i32* %1
ret i32 97
}

LLVM IR (-O2):
define i32 @f() {
ret i32 97
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XRecolorCursor() {
  printf("XRecolorCursor called\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"XRecolorCursor called\0A\00"
define i32 @XRecolorCursor() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"XRecolorCursor called\00"
define i32 @XRecolorCursor() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}