xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int st_size;
};
typedef int int64_t;

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int64_t get_file_size(const char *path) {
  int64_t file_size = -1;
  struct stat statbuff;
  if (stat(path, &statbuff) < 0) {
    return file_size;
  } else {
    file_size = statbuff.st_size;
    return file_size;
  }
}


x86 assembly (clang, -O0):
<get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    1145 <get_file_size+0x35>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <get_file_size+0x41>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
js     1129 <get_file_size+0x19>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @get_file_size(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.stat
store i8* %0, i8** %3
store i32 -1, i32* %4
%6 = load i8*, i8** %3
%7 = call i64 @stat(i8* %6, %struct.stat* %5)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %15
11: ; preds = %1
%12 = getelementptr inbounds %struct.stat, %struct.stat* %5, i32 0, i32 0
%13 = load i32, i32* %12
store i32 %13, i32* %4
%14 = load i32, i32* %4
store i32 %14, i32* %2
br label %15
15: ; preds = %11, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @get_file_size(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Type definitions */
struct s_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ setFullStatus(struct s_info *, int /*<<< orphan*/);
void setSlotEmpty(struct s_info *s) { setFullStatus(s, 0); }


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

x86 assembly (clang, -O2):
<setSlotEmpty>:
xor    %esi,%esi
jmp    1030 <setFullStatus@plt>

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

LLVM IR (-O2):
%struct.s_info = type { i32 }
define void @setSlotEmpty(%struct.s_info* %0) {
%2 = tail call i32 @setFullStatus(%struct.s_info* %0, i32 0)
ret void
}
int syscall1(int n, int a0) {
  int ret;
  asm volatile("syscall" : "=a"(ret) : "a"(n), "D"(a0));
  return ret;
}


x86 assembly (clang, -O0):
<syscall1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edi
syscall
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall1>:
mov    %edi,%eax
mov    %esi,%edi
syscall
ret

LLVM IR (-O0):
define i32 @syscall1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 asm sideeffect "syscall", "={ax},{ax},{di},~{dirflag},~{fpsr},~{flags}"(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscall1(i32 %0, i32 %1) {
%3 = tail call i32 asm sideeffect "syscall", "={ax},{ax},{di},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Str_Match(void const *, void const *);
int CondStrMatch(const void *string, const void *pattern) {
  return (!Str_Match(string, pattern));
}


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

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

LLVM IR (-O0):
define i32 @CondStrMatch(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 @Str_Match(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @CondStrMatch(i8* %0, i8* %1) {
%3 = tail call i32 @Str_Match(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int new_irq_level(int);
void SekInterruptClearS68k(int irq) { int level_new = new_irq_level(irq); }


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

x86 assembly (clang, -O2):
<SekInterruptClearS68k>:
jmp    1030 <new_irq_level@plt>

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

LLVM IR (-O2):
define void @SekInterruptClearS68k(i32 %0) {
%2 = tail call i32 @new_irq_level(i32 %0)
ret void
}
void OTG_FS_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @OTG_FS_IRQHandler() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ mem_invalidate_range(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mem_writeb_phys(int /*<<< orphan*/, int /*<<< orphan*/);
void _dma_write(uint32_t addr, uint8_t val) {
  mem_writeb_phys(addr, val);
  mem_invalidate_range(addr, addr);
}


x86 assembly (clang, -O0):
<_dma_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <mem_writeb_phys@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <mem_invalidate_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dma_write>:
push   %rbx
mov    %edi,%ebx
call   1040 <mem_writeb_phys@plt>
mov    %ebx,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <mem_invalidate_range@plt>

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

LLVM IR (-O2):
define void @_dma_write(i32 %0, i32 %1) {
%3 = tail call i32 @mem_writeb_phys(i32 %0, i32 %1)
%4 = tail call i32 @mem_invalidate_range(i32 %0, i32 %0)
ret void
}
void test1_ptr_ok(int x) {
  int buf[100];
  int *p = buf;
  p[99] = 1;
}


x86 assembly (clang, -O0):
<test1_ptr_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x1a0(%rbp),%rax
mov    %rax,-0x1a8(%rbp)
mov    -0x1a8(%rbp),%rax
movl   $0x1,0x18c(%rax)
add    $0x130,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test1_ptr_ok(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int, int);
void exitfunc2(int status, void *arg) {
  printf("Executing exitfunc2 (status=%d, arg=%d)\n", status, (int)arg);
  exit((int)arg);
}


x86 assembly (clang, -O0):
<exitfunc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc2>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
lea    0xed3(%rip),%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Executing exitfunc2 (status=%d, arg=%d)\0A\00"
define void @exitfunc2(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i32
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@.str = [41 x i8] c"Executing exitfunc2 (status=%d, arg=%d)\0A\00"
define void @exitfunc2(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %4)
%6 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ test(char const *);
int foo() {
  const char *a =
      "http://192.168.1.1:2001/a/b-d/b/"
      "download.ts?from=2012121212000-12102012&to=1020200200100-1020002002";
  test(a);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <test@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [100 x i8] c"http://192.168.1.1:2001/a/b-d/b/download.ts?from=2012121212000-12102012&to=1020200200100-1020002002\00"
define i32 @foo() {
%1 = alloca i32
%2 = alloca i8*
store i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @test(i8* %3)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [100 x i8] c"http://192.168.1.1:2001/a/b-d/b/download.ts?from=2012121212000-12102012&to=1020200200100-1020002002\00"
define i32 @foo() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void encodeDmaWriteMemBarrier(void) {}


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

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

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

LLVM IR (-O2):
define void @encodeDmaWriteMemBarrier() {
ret void
}
int toku_fs_mount(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @toku_fs_mount() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glGenBuffers(int, unsigned int *);
void V_genbuffer(unsigned int *buf) { glGenBuffers(1, buf); }


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

x86 assembly (clang, -O2):
<V_genbuffer>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <glGenBuffers@plt>

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

LLVM IR (-O2):
define void @V_genbuffer(i32* %0) {
%2 = tail call i32 @glGenBuffers(i32 1, i32* %0)
ret void
}
int toNumber(char card) {
  if (card == 'T')
    return 10;
  if (card == 'J')
    return 11;
  if (card == 'Q')
    return 12;
  if (card == 'K')
    return 13;
  if (card == 'A')
    return 14;
  return 0;
}


x86 assembly (clang, -O0):
<toNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x54,%eax
jne    1123 <toNumber+0x23>
movl   $0xa,-0x4(%rbp)
jmp    118e <toNumber+0x8e>
movsbl -0x5(%rbp),%eax
cmp    $0x4a,%eax
jne    113c <toNumber+0x3c>
movl   $0xb,-0x4(%rbp)
jmp    118e <toNumber+0x8e>
movsbl -0x5(%rbp),%eax
cmp    $0x51,%eax
jne    1155 <toNumber+0x55>
movl   $0xc,-0x4(%rbp)
jmp    118e <toNumber+0x8e>
movsbl -0x5(%rbp),%eax
cmp    $0x4b,%eax
jne    116e <toNumber+0x6e>
movl   $0xd,-0x4(%rbp)
jmp    118e <toNumber+0x8e>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jne    1187 <toNumber+0x87>
movl   $0xe,-0x4(%rbp)
jmp    118e <toNumber+0x8e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toNumber>:
add    $0xbf,%dil
cmp    $0x13,%dil
ja     1129 <toNumber+0x29>
mov    $0xa,%eax
movzbl %dil,%ecx
lea    0xee6(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0xe,%eax
ret
xor    %eax,%eax
ret
mov    $0xb,%eax
ret
mov    $0xd,%eax
ret
mov    $0xc,%eax
ret

LLVM IR (-O0):
define i32 @toNumber(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 84
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 10, i32* %2
br label %29
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 74
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 11, i32* %2
br label %29
13: ; preds = %8
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 81
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 12, i32* %2
br label %29
18: ; preds = %13
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 75
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 13, i32* %2
br label %29
23: ; preds = %18
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 65
br i1 %26, label %27, label %28
27: ; preds = %23
store i32 14, i32* %2
br label %29
28: ; preds = %23
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27, %22, %17, %12, %7
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @toNumber(i8 signext %0) {
switch i8 %0, label %6 [
i8 84, label %7
i8 74, label %2
i8 81, label %3
i8 75, label %4
i8 65, label %5
]
2: ; preds = %1
br label %7
3: ; preds = %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5, %4, %3, %2
%8 = phi i32 [ 11, %2 ], [ 12, %3 ], [ 13, %4 ], [ 14, %5 ], [ 0, %6 ], [ 10, %1 ]
ret i32 %8
}
void foo070() {}


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

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

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

LLVM IR (-O2):
define void @foo070() {
ret void
}
/* Variables and functions */
int cubit(int);
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%d\n", cubit(-3)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffd,%edi
call   1040 <cubit@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = call i32 @cubit(i32 -3)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @cubit(i32 -3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ m68k_disassemble(char *, int, unsigned int, unsigned int);
char *m68ki_disassemble_quick(unsigned int pc, unsigned int cpu_type) {
  static char buff[200];
  buff[0] = 0;
  m68k_disassemble(buff, sizeof buff, pc, cpu_type);
  return buff;
}


x86 assembly (clang, -O0):
<m68ki_disassemble_quick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movb   $0x0,0x2f1b(%rip)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0x2f0e(%rip),%rdi
mov    $0xc8,%esi
call   1030 <m68k_disassemble@plt>
lea    0x2efd(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68ki_disassemble_quick>:
push   %rbx
mov    %esi,%ecx
mov    %edi,%edx
movb   $0x0,0x2f24(%rip)
lea    0x2f1d(%rip),%rbx
mov    %rbx,%rdi
mov    $0xc8,%esi
call   1030 <m68k_disassemble@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@m68ki_disassemble_quick.buff = internal global [200 x i8] zeroinitializer
define i8* @m68ki_disassemble_quick(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i8 0, i8* getelementptr inbounds ([200 x i8], [200 x i8]* @m68ki_disassemble_quick.buff, i64 0, i64 0)
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @m68k_disassemble(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @m68ki_disassemble_quick.buff, i64 0, i64 0), i32 200, i32 %5, i32 %6)
ret i8* getelementptr inbounds ([200 x i8], [200 x i8]* @m68ki_disassemble_quick.buff, i64 0, i64 0)
}

LLVM IR (-O2):
@m68ki_disassemble_quick.buff = internal global [200 x i8] zeroinitializer
define i8* @m68ki_disassemble_quick(i32 %0, i32 %1) {
store i8 0, i8* getelementptr inbounds ([200 x i8], [200 x i8]* @m68ki_disassemble_quick.buff, i64 0, i64 0)
%3 = tail call i32 @m68k_disassemble(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @m68ki_disassemble_quick.buff, i64 0, i64 0), i32 200, i32 %0, i32 %1)
ret i8* getelementptr inbounds ([200 x i8], [200 x i8]* @m68ki_disassemble_quick.buff, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int nthreads, tid;
  nthreads = 1;
  tid = 0;
  printf("Hello World from thread = %d\n", tid);
  printf("Number of threads = %d\n", nthreads);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [30 x i8] c"Hello World from thread = %d\0A\00"
@.str.1 = [24 x i8] c"Number of threads = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"Hello World from thread = %d\0A\00"
@.str.1 = [24 x i8] c"Number of threads = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int scanf(char *, int *);
void checkIntInput(int *a) {
  if ((scanf("%d", a)) != 1) {
    printf("Not digit!");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<checkIntInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     116f <checkIntInput+0x3f>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkIntInput>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1147 <checkIntInput+0x17>
pop    %rax
ret
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"Not digit!\00"
@EXIT_FAILURE = global i32 0
define void @checkIntInput(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"Not digit!\00"
@EXIT_FAILURE = global i32 0
define void @checkIntInput(i32* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
int row_byte_gbk1(int row) { return 0x81 + row; }


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

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

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

LLVM IR (-O2):
define i32 @row_byte_gbk1(i32 %0) {
%2 = add nsw i32 %0, 129
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ ulong;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ buf_int32(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ lseek(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
void update_max_bufsize(int fd, int offset, ulong sz) {
  char buf[4];
  buf_int32(buf, sz, 0);
  lseek(fd, offset, SEEK_SET);
  write(fd, buf, 4);
}


x86 assembly (clang, -O0):
<update_max_bufsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1050 <buf_int32@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2e84(%rip),%rax
mov    (%rax),%edx
call   1040 <lseek@plt>
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_max_bufsize>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xc(%rsp),%r14
mov    %r14,%rdi
mov    %edx,%esi
xor    %edx,%edx
call   1050 <buf_int32@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edx
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <lseek@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define void @update_max_bufsize(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [4 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %6
%10 = call i32 @buf_int32(i8* %8, i32 %9, i32 0)
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* @SEEK_SET
%14 = call i32 @lseek(i32 %11, i32 %12, i32 %13)
%15 = load i32, i32* %4
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%17 = call i32 @write(i32 %15, i8* %16, i32 4)
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @update_max_bufsize(i32 %0, i32 %1, i32 %2) {
%4 = alloca [4 x i8]
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%6 = call i32 @buf_int32(i8* %5, i32 %2, i32 0)
%7 = load i32, i32* @SEEK_SET
%8 = call i32 @lseek(i32 %0, i32 %1, i32 %7)
%9 = call i32 @write(i32 %0, i8* %5, i32 4)
ret void
}
double get_dynamical_diff_other(double JD) {
  double TD, a;
  a = (JD - 2382148.0);
  a *= a;
  TD = -15.0 + a / 41048480.0;
  return TD;
}


x86 assembly (clang, -O0):
<get_dynamical_diff_other>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xefa(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  0xecd(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xeb9(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dynamical_diff_other>:
addsd  0xef8(%rip),%xmm0
mulsd  %xmm0,%xmm0
divsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @get_dynamical_diff_other(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fsub double %5, 0x41422CA200000000
store double %6, double* %4
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %8, %7
store double %9, double* %4
%10 = load double, double* %4
%11 = fdiv double %10, 0x418392CD00000000
%12 = fadd double -1.500000e+01, %11
store double %12, double* %3
%13 = load double, double* %3
ret double %13
}

LLVM IR (-O2):
define double @get_dynamical_diff_other(double %0) {
%2 = fadd double %0, 0xC1422CA200000000
%3 = fmul double %2, %2
%4 = fdiv double %3, 0x418392CD00000000
%5 = fadd double %4, -1.500000e+01
ret double %5
}
/* Variables and functions */
int set_setting(char *, int);
int set_mptcp(int value) {
  return set_setting("/proc/sys/net/mptcp/mptcp_enabled", value);
}


x86 assembly (clang, -O0):
<set_mptcp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <set_setting@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_mptcp>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <set_setting@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"/proc/sys/net/mptcp/mptcp_enabled\00"
define i32 @set_mptcp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @set_setting(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [34 x i8] c"/proc/sys/net/mptcp/mptcp_enabled\00"
define i32 @set_mptcp(i32 %0) {
%2 = tail call i32 @set_setting(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ *stdin;
scalar_t__ strcmp(char const *, char *);
FILE *openStream(const char *path) {
  if (strcmp(path, "-") == 0) {
    return stdin;
  }
  return fopen(path, "r");
}


x86 assembly (clang, -O0):
<openStream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1159 <openStream+0x39>
mov    0x2e9b(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    116d <openStream+0x4d>
mov    -0x10(%rbp),%rdi
lea    0xe9e(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openStream>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1145 <openStream+0x25>
lea    0xec6(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fopen@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@stdin = global i32* null
@.str.1 = [2 x i8] c"r\00"
define i32* @openStream(i8* %0) {
%2 = alloca i32*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32*, i32** @stdin
store i32* %8, i32** %2
br label %12
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32* @fopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %11, i32** %2
br label %12
12: ; preds = %9, %7
%13 = load i32*, i32** %2
ret i32* %13
}

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
@stdin = global i32* null
@.str.1 = [2 x i8] c"r\00"
define i32* @openStream(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = load i32*, i32** @stdin
br label %8
6: ; preds = %1
%7 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = phi i32* [ %5, %4 ], [ %7, %6 ]
ret i32* %9
}
/* Variables and functions */
int /*<<< orphan*/ single_decay(float, float, float);
int /*<<< orphan*/ srand48(int);
int main() {
  float N_0 = 100.0;
  float Lambda = 1.0 / 2.0;
  float Dt = 0.001;
  srand48(1);
  single_decay(N_0, Lambda, Dt);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed1(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xec0(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xeaf(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <srand48@plt>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
call   1040 <single_decay@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <srand48@plt>
movss  0xecd(%rip),%xmm0
movss  0xec9(%rip),%xmm1
movss  0xec5(%rip),%xmm2
call   1040 <single_decay@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
store float 1.000000e+02, float* %2
store float 5.000000e-01, float* %3
store float 0x3F50624DE0000000, float* %4
%5 = call i32 @srand48(i32 1)
%6 = load float, float* %2
%7 = load float, float* %3
%8 = load float, float* %4
%9 = call i32 @single_decay(float %6, float %7, float %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @srand48(i32 1)
%2 = tail call i32 @single_decay(float 1.000000e+02, float 5.000000e-01, float 0x3F50624DE0000000)
ret i32 0
}
void stress_log_system_mem_info(void) {}


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

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

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

LLVM IR (-O2):
define void @stress_log_system_mem_info() {
ret void
}
int gtp_kernel_tunnel_add(struct pdp_t *pdp) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.pdp_t = type opaque
define i32 @gtp_kernel_tunnel_add(%struct.pdp_t* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ getuid();
uid_t geteuid(void) { return (getuid()); }


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

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

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

LLVM IR (-O2):
define i32 @geteuid() {
%1 = tail call i32 (...) @getuid()
ret i32 %1
}
/* Variables and functions */
long llroundf(float);
long lroundf(float __a) { return llroundf(__a); }


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

x86 assembly (clang, -O2):
<lroundf>:
jmp    1030 <llroundf@plt>

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

LLVM IR (-O2):
define i64 @lroundf(float %0) {
%2 = tail call i64 @llroundf(float %0)
ret i64 %2
}
void sam_init(void) {}


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

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

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

LLVM IR (-O2):
define void @sam_init() {
ret void
}
/* Variables and functions */
double fmodf(double, double);
double fmod(double x, double y) { return fmodf(x, y); }


x86 assembly (clang, -O0):
<fmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <fmodf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmod>:
jmp    1030 <fmodf@plt>

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

LLVM IR (-O2):
define double @fmod(double %0, double %1) {
%3 = tail call double @fmodf(double %0, double %1)
ret double %3
}
unsigned get_16(const unsigned char *s, int e) {
  e &= 1;
  return s[e] << 8 | s[1 - e];
}


x86 assembly (clang, -O0):
<get_16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
sub    -0xc(%rbp),%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_16>:
and    $0x1,%esi
movzbl (%rdi,%rsi,1),%ecx
shl    $0x8,%ecx
xor    $0x1,%rsi
movzbl (%rdi,%rsi,1),%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @get_16(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 = and i32 %5, 1
store i32 %6, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = sub nsw i32 1, %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %14, i64 %17
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = or i32 %13, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @get_16(i8* nocapture %0, i32 %1) {
%3 = and i32 %1, 1
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = xor i32 %3, 1
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = or i32 %8, %13
ret i32 %14
}
/* Variables and functions */
int _size_t_cmp(const void *_i1, const void *_i2) {
  const size_t i1 = *(const size_t *)_i1, i2 = *(const size_t *)_i2;
  if (i1 < i2)
    return -1;
  else if (i1 == i2)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<_size_t_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    113c <_size_t_cmp+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <_size_t_cmp+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    1156 <_size_t_cmp+0x56>
movl   $0x0,-0x4(%rbp)
jmp    115d <_size_t_cmp+0x5d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_size_t_cmp>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setne  %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @_size_t_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp ult i64 %4, %6
%8 = icmp ne i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int SIGCHLD;
int /*<<< orphan*/ printf(char *, int);
int waitpid(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/);
void sig_handler(int signo) {
  int pid = 0;
  if (signo == SIGCHLD) {
    pid = waitpid(0, NULL, 0);
    printf("child_pid: %d terminted\n", pid);
  }
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%eax
jne    1163 <sig_handler+0x43>
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%esi
mov    %edx,%edi
call   1040 <waitpid@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_handler>:
push   %rax
mov    0x2ec0(%rip),%rax
cmp    %edi,(%rax)
jne    1146 <sig_handler+0x26>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <waitpid@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@SIGCHLD = global i32 0
@.str = [25 x i8] c"child_pid: %d terminted\0A\00"
define void @sig_handler(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SIGCHLD
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 @waitpid(i32 0, i32* null, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@SIGCHLD = global i32 0
@.str = [25 x i8] c"child_pid: %d terminted\0A\00"
define void @sig_handler(i32 %0) {
%2 = load i32, i32* @SIGCHLD
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @waitpid(i32 0, i32* null, i32 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %4, %1
ret void
}
int order(int Na, int Nb) { return Na > Nb ? Na - 1 : Nb - 1; }


x86 assembly (clang, -O0):
<order>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1124 <order+0x24>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <order+0x2d>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<order>:
cmp    %esi,%edi
cmovg  %edi,%esi
lea    -0x1(%rsi),%eax
ret

LLVM IR (-O0):
define i32 @order(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 1
br label %14
11: ; preds = %2
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 1
br label %14
14: ; preds = %11, %8
%15 = phi i32 [ %10, %8 ], [ %13, %11 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @order(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
%5 = add nsw i32 %4, -1
ret i32 %5
}
void fromRowMajor(int flat, int *i, int *j, int cols) {
  *i = flat / cols;
  *j = flat % cols;
}


x86 assembly (clang, -O0):
<fromRowMajor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %edx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fromRowMajor>:
mov    %rdx,%r8
mov    %edi,%eax
cltd
idiv   %ecx
mov    %eax,(%rsi)
mov    %edx,(%r8)
ret

LLVM IR (-O0):
define void @fromRowMajor(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 = load i32, i32* %8
%11 = sdiv i32 %9, %10
%12 = load i32*, i32** %6
store i32 %11, i32* %12
%13 = load i32, i32* %5
%14 = load i32, i32* %8
%15 = srem i32 %13, %14
%16 = load i32*, i32** %7
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @fromRowMajor(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32 %3) {
%5 = sdiv i32 %0, %3
store i32 %5, i32* %1
%6 = srem i32 %0, %3
store i32 %6, i32* %2
ret void
}
int register_chrdev(unsigned int i, const char *c, struct file_operations *f) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.file_operations = type opaque
define i32 @register_chrdev(i32 %0, i8* %1, %struct.file_operations* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.file_operations*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.file_operations* %2, %struct.file_operations** %6
ret i32 0
}

LLVM IR (-O2):
%struct.file_operations = type opaque
define i32 @register_chrdev(i32 %0, i8* nocapture readnone %1, %struct.file_operations* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ hal_entry();
int main(void) {
  hal_entry();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @hal_entry()
ret i32 0
}
void foo(int *a, char *b, char *c) {
  __builtin_memmove(c, b, a[c[0]]);
  __builtin_memmove(c, b, a[b[0]]);
}


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

x86 assembly (clang, -O2):
<foo>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
movsbq (%rdx),%rax
movslq (%rdi,%rax,4),%rdx
mov    %rbx,%rdi
call   1030 <memmove@plt>
movsbq (%r14),%rax
movslq (%r15,%rax,4),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define void @foo(i32* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
%4 = load i8, i8* %2
%5 = sext i8 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %2, i8* align 1 %1, i64 %8, i1 false)
%9 = load i8, i8* %1
%10 = sext i8 %9 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = sext i32 %12 to i64
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %2, i8* align 1 %1, i64 %13, i1 false)
ret void
}
void not_scary(void) {
  volatile int *x = 0xdeadbeef;
  *x = 10;
}


x86 assembly (clang, -O0):
<not_scary>:
push   %rbp
mov    %rsp,%rbp
mov    $0xdeadbeef,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xa,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_scary>:
mov    $0xdeadbeef,%eax
movl   $0xa,(%rax)
ret

LLVM IR (-O0):
define void @not_scary() {
%1 = alloca i32*
store i32* inttoptr (i64 3735928559 to i32*), i32** %1
%2 = load i32*, i32** %1
store volatile i32 10, i32* %2
ret void
}

LLVM IR (-O2):
define void @not_scary() {
store volatile i32 10, i32* inttoptr (i64 3735928559 to i32*)
ret void
}
void ktsan_irq_restore(unsigned long flags) {}


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

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

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

LLVM IR (-O2):
define void @ktsan_irq_restore(i64 %0) {
ret void
}