xunge/DecIR huggingface dataset:
/* Type definitions */
typedef char const wchar_t;

/* Variables and functions */
wchar_t *wcschr(const wchar_t *ws, wchar_t wc) {
  while (*ws != wc) {
    if (*ws == '\0') {
      return NULL;
    }
    ++ws;
  }
  return (wchar_t *)ws;
}


x86 assembly (clang, -O0):
<wcschr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
je     114f <wcschr+0x4f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <wcschr+0x3e>
movq   $0x0,-0x8(%rbp)
jmp    1157 <wcschr+0x57>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <wcschr+0xe>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcschr>:
mov    %rdi,%rax
mov    (%rdi),%cl
cmp    %sil,%cl
je     1121 <wcschr+0x21>
nopw   0x0(%rax,%rax,1)
test   %cl,%cl
je     1122 <wcschr+0x22>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    %sil,%cl
jne    1110 <wcschr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @wcschr(i8* %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, %1
br i1 %4, label %13, label %5
5: ; preds = %2, %9
%6 = phi i8 [ %11, %9 ], [ %3, %2 ]
%7 = phi i8* [ %10, %9 ], [ %0, %2 ]
%8 = icmp eq i8 %6, 0
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, %1
br i1 %12, label %13, label %5
13: ; preds = %5, %9, %2
%14 = phi i8* [ %0, %2 ], [ %10, %9 ], [ null, %5 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ ask_pass();
int /*<<< orphan*/ match_pass();
void change_pass() {
  if (!match_pass())
    return;
  ask_pass();
}


x86 assembly (clang, -O0):
<change_pass>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <match_pass@plt>
cmp    $0x0,%eax
jne    1139 <change_pass+0x19>
jmp    1140 <change_pass+0x20>
mov    $0x0,%al
call   1040 <ask_pass@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_pass>:
push   %rax
xor    %eax,%eax
call   1030 <match_pass@plt>
test   %eax,%eax
je     1134 <change_pass+0x14>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ask_pass@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @change_pass() {
%1 = call i32 (...) @match_pass()
%2 = icmp ne i32 %1, 0
br i1 %2, label %4, label %3
3: ; preds = %0
br label %6
4: ; preds = %0
%5 = call i32 (...) @ask_pass()
br label %6
6: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
define void @change_pass() {
%1 = tail call i32 (...) @match_pass()
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @ask_pass()
br label %5
5: ; preds = %0, %3
ret void
}
void slow_work_mark_time(struct slow_work *work) {}


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

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

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

LLVM IR (-O2):
%struct.slow_work = type opaque
define void @slow_work_mark_time(%struct.slow_work* nocapture %0) {
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void main() {
  int32_t a[10];
  int32_t i;
  a[0] = 1;
  a[1] = 1;
  for (i = 2; i < 10; i = i + 1) {
    a[i] = a[i - 1] + a[i - 2];
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x30(%rbp)
movl   $0x1,-0x2c(%rbp)
movl   $0x2,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    1151 <main+0x51>
mov    -0x34(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x30(%rbp,%rax,4),%ecx
mov    -0x34(%rbp),%eax
sub    $0x2,%eax
cltq
add    -0x30(%rbp,%rax,4),%ecx
movslq -0x34(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1119 <main+0x19>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca [10 x i32]
%2 = alloca i32
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
store i32 1, i32* %3
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
store i32 1, i32* %4
store i32 2, i32* %2
br label %5
5: ; preds = %23, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %26
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = load i32, i32* %2
%15 = sub nsw i32 %14, 2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %16
%18 = load i32, i32* %17
%19 = add nsw i32 %13, %18
%20 = load i32, i32* %2
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %21
store i32 %19, i32* %22
br label %23
23: ; preds = %8
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %5
26: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
char *skipspc(char *ptr) {
  while (*ptr == ' ' || *ptr == '\t') {
    ++ptr;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<skipspc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     112d <skipspc+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <skipspc+0x3d>
jmp    114e <skipspc+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skipspc+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipspc>:
mov    %rdi,%rax
jmp    1114 <skipspc+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <skipspc+0x10>
cmp    $0x9,%cl
je     1110 <skipspc+0x10>
ret

LLVM IR (-O0):
define i8* @skipspc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 32
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 9
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ true, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @skipspc(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
void tegra_hdmivrr_update_monspecs(struct tegra_dc *dc,
                                   struct list_head *head) {
  return;
}


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

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

LLVM IR (-O0):
%struct.tegra_dc = type opaque
%struct.list_head = type opaque
define void @tegra_hdmivrr_update_monspecs(%struct.tegra_dc* %0, %struct.list_head* %1) {
%3 = alloca %struct.tegra_dc*
%4 = alloca %struct.list_head*
store %struct.tegra_dc* %0, %struct.tegra_dc** %3
store %struct.list_head* %1, %struct.list_head** %4
ret void
}

LLVM IR (-O2):
%struct.tegra_dc = type opaque
%struct.list_head = type opaque
define void @tegra_hdmivrr_update_monspecs(%struct.tegra_dc* nocapture %0, %struct.list_head* nocapture %1) {
ret void
}
/* Variables and functions */
float fgamma_s(int, float);
float fgamma_steed(int, float);
float fgamma(int m, float x) {
  if (x < (m + 0.5))
    return fgamma_s(m, x);
  else
    return fgamma_steed(m, x);
}


x86 assembly (clang, -O0):
<fgamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xeba(%rip),%xmm2
addsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    116b <fgamma+0x4b>
mov    -0x8(%rbp),%edi
movss  -0xc(%rbp),%xmm0
call   1040 <fgamma_s@plt>
movss  %xmm0,-0x4(%rbp)
jmp    117d <fgamma+0x5d>
mov    -0x8(%rbp),%edi
movss  -0xc(%rbp),%xmm0
call   1030 <fgamma_steed@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgamma>:
cvtss2sd %xmm0,%xmm1
cvtsi2sd %edi,%xmm2
addsd  0xed0(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    113b <fgamma+0x1b>
jmp    1040 <fgamma_s@plt>
jmp    1030 <fgamma_steed@plt>

LLVM IR (-O0):
define float @fgamma(i32 %0, float %1) {
%3 = alloca float
%4 = alloca i32
%5 = alloca float
store i32 %0, i32* %4
store float %1, float* %5
%6 = load float, float* %5
%7 = fpext float %6 to double
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = fadd double %9, 5.000000e-01
%11 = fcmp olt double %7, %10
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i32, i32* %4
%14 = load float, float* %5
%15 = call float @fgamma_s(i32 %13, float %14)
store float %15, float* %3
br label %20
16: ; preds = %2
%17 = load i32, i32* %4
%18 = load float, float* %5
%19 = call float @fgamma_steed(i32 %17, float %18)
store float %19, float* %3
br label %20
20: ; preds = %16, %12
%21 = load float, float* %3
ret float %21
}

LLVM IR (-O2):
define float @fgamma(i32 %0, float %1) {
%3 = fpext float %1 to double
%4 = sitofp i32 %0 to double
%5 = fadd double %4, 5.000000e-01
%6 = fcmp ogt double %5, %3
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call float @fgamma_s(i32 %0, float %1)
br label %11
9: ; preds = %2
%10 = tail call float @fgamma_steed(i32 %0, float %1)
br label %11
11: ; preds = %9, %7
%12 = phi float [ %8, %7 ], [ %10, %9 ]
ret float %12
}
int CopyCode2SDRAM(unsigned char *buf, unsigned long start_addr, int size) {
  extern void nand_read(unsigned char *buf, unsigned long start_addr, int size);
  nand_read(buf, start_addr, size);
  return 0;
}


x86 assembly (clang, -O0):
<CopyCode2SDRAM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <nand_read@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @CopyCode2SDRAM(i8* %0, i64 %1, i32 %2) {
tail call void @nand_read(i8* %0, i64 %1, i32 %2)
ret i32 0
}
int tdefault_insert_exec_catchpoint(struct target_ops *self, int arg1) {
  return 1;
}


x86 assembly (clang, -O0):
<tdefault_insert_exec_catchpoint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.target_ops = type opaque
define i32 @tdefault_insert_exec_catchpoint(%struct.target_ops* %0, i32 %1) {
%3 = alloca %struct.target_ops*
%4 = alloca i32
store %struct.target_ops* %0, %struct.target_ops** %3
store i32 %1, i32* %4
ret i32 1
}

LLVM IR (-O2):
%struct.target_ops = type opaque
define i32 @tdefault_insert_exec_catchpoint(%struct.target_ops* nocapture readnone %0, i32 %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ lace_log_errorf(char *, int);
int /*<<< orphan*/ lose_sysCx();
void signal_hook_sysCx(int sig) {
  lace_log_errorf("Caught signal: %d", sig);
  lose_sysCx();
  exit(1);
}


x86 assembly (clang, -O0):
<signal_hook_sysCx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1030 <lace_log_errorf@plt>
mov    $0x0,%al
call   1040 <lose_sysCx@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<signal_hook_sysCx>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
call   1030 <lace_log_errorf@plt>
xor    %eax,%eax
call   1040 <lose_sysCx@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Caught signal: %d\00"
define void @signal_hook_sysCx(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @lace_log_errorf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @lose_sysCx()
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"Caught signal: %d\00"
define void @signal_hook_sysCx(i32 %0) {
%2 = tail call i32 @lace_log_errorf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @lose_sysCx()
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
void *newa(void *heap, void *affinity, size_t size) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @newa(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i8* null
}
const char *Cast_Definition(void) {
  return "struct Cast {\n"
         "  var (*cast)(var, var);\n"
         "};\n";
}


x86 assembly (clang, -O0):
<Cast_Definition>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cast_Definition>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [43 x i8] c"struct Cast {\0A var (*cast)(var, var);\0A};\0A\00"
define i8* @Cast_Definition() {
ret i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [43 x i8] c"struct Cast {\0A var (*cast)(var, var);\0A};\0A\00"
define i8* @Cast_Definition() {
ret i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ crc32_c(unsigned char const *, size_t, int /*<<< orphan*/);
bool check_crc(const unsigned char *buf, size_t size) {
  uint32_t read_crc = *((unsigned long *)(buf + size));
  uint32_t comp_crc;
  comp_crc = crc32_c(buf, size, 0);
  return read_crc == comp_crc;
}


x86 assembly (clang, -O0):
<check_crc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <crc32_c@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_crc>:
push   %rbx
mov    (%rdi,%rsi,1),%rbx
xor    %edx,%edx
call   1030 <crc32_c@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @check_crc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = bitcast i8* %9 to i64*
%11 = load i64, i64* %10
store i64 %11, i64* %5
%12 = load i8*, i8** %3
%13 = load i64, i64* %4
%14 = call i64 @crc32_c(i8* %12, i64 %13, i32 0)
store i64 %14, i64* %6
%15 = load i64, i64* %5
%16 = load i64, i64* %6
%17 = icmp eq i64 %15, %16
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @check_crc(i8* %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
%6 = tail call i64 @crc32_c(i8* %0, i64 %1, i32 0)
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int convertToSimulationTime(int seconds) {
  double converted_time_in_ms = 0;
  converted_time_in_ms = ((seconds) / 600.0) * 1000;
  return (int)converted_time_in_ms;
}


x86 assembly (clang, -O0):
<convertToSimulationTime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xed8(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertToSimulationTime>:
cvtsi2sd %edi,%xmm0
divsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @convertToSimulationTime(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
store double 0.000000e+00, double* %3
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, 6.000000e+02
%7 = fmul double %6, 1.000000e+03
store double %7, double* %3
%8 = load double, double* %3
%9 = fptosi double %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @convertToSimulationTime(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fdiv double %2, 6.000000e+02
%4 = fmul double %3, 1.000000e+03
%5 = fptosi double %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ R_RegisterWorldModel(char const *, void *);
void CL_UIModule_R_RegisterWorldModel(const char *model) {
  R_RegisterWorldModel(model, ((void *)0));
}


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

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

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

LLVM IR (-O2):
define void @CL_UIModule_R_RegisterWorldModel(i8* %0) {
%2 = tail call i32 @R_RegisterWorldModel(i8* %0, i8* null)
ret void
}
void tabcomplete(char *line, int n, int i) {}


x86 assembly (clang, -O0):
<tabcomplete>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @tabcomplete(i8* nocapture %0, i32 %1, i32 %2) {
ret void
}
int guess(int num) {
  if (num == 5)
    return 0;
  if (num > 5)
    return 1;
  return -1;
}


x86 assembly (clang, -O0):
<guess>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jne    111d <guess+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    113a <guess+0x3a>
cmpl   $0x5,-0x8(%rbp)
jle    1133 <guess+0x33>
movl   $0x1,-0x4(%rbp)
jmp    113a <guess+0x3a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<guess>:
xor    %eax,%eax
cmp    $0x6,%edi
setge  %al
xor    %ecx,%ecx
cmp    $0x5,%edi
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @guess(i32 %0) {
%2 = icmp eq i32 %0, 5
%3 = icmp sgt i32 %0, 5
%4 = select i1 %3, i32 1, i32 -1
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
double fabs(double);
int /*<<< orphan*/ getch();
int /*<<< orphan*/ printf(char *, double, double);
main() {
  float fn = -1234.0;
  double dn = -12.33303;
  printf("number:%f absolute value:%f\n", fn, fabs(fn));
  printf("number:%lf absolute value:%lf\n", dn, fabs(dn));
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee8(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movsd  0xed3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movaps 0xea5(%rip),%xmm2
pand   %xmm2,%xmm1
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movaps 0xe84(%rip),%xmm2
pand   %xmm2,%xmm1
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getch@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movsd  0xed0(%rip),%xmm0
movsd  0xed0(%rip),%xmm1
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
movsd  0xec4(%rip),%xmm0
movsd  0xec4(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getch@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"number:%f absolute value:%f\0A\00"
@.str.1 = [31 x i8] c"number:%lf absolute value:%lf\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca double
store float -1.234000e+03, float* %1
store double 0xC028AA82E87D2C7C, double* %2
%3 = load float, float* %1
%4 = fpext float %3 to double
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = call double @llvm.fabs.f64(double %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), double %4, double %7)
%9 = load double, double* %2
%10 = load double, double* %2
%11 = call double @llvm.fabs.f64(double %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), double %9, double %11)
%13 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"number:%f absolute value:%f\0A\00"
@.str.1 = [31 x i8] c"number:%lf absolute value:%lf\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), double -1.234000e+03, double 1.234000e+03)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), double 0xC028AA82E87D2C7C, double 0x4028AA82E87D2C7C)
%3 = tail call i32 (...) @getch()
ret i32 0
}
/* Variables and functions */
int my_put_nbr_base(int, int, int /*<<< orphan*/);
int my_put_nbr(int n) { return (my_put_nbr_base(n, 10, 0)); }


x86 assembly (clang, -O0):
<my_put_nbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xa,%esi
xor    %edx,%edx
call   1030 <my_put_nbr_base@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_put_nbr>:
mov    $0xa,%esi
xor    %edx,%edx
jmp    1030 <my_put_nbr_base@plt>

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

LLVM IR (-O2):
define i32 @my_put_nbr(i32 %0) {
%2 = tail call i32 @my_put_nbr_base(i32 %0, i32 10, i32 0)
ret i32 %2
}
/* Variables and functions */
int clicfs_read_cow(char *);
int main(int argc, char *argv[]) {
  int ret = clicfs_read_cow(argv[1]);
  return ret;
}


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

x86 assembly (clang, -O2):
<main>:
mov    0x8(%rsi),%rdi
jmp    1030 <clicfs_read_cow@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @clicfs_read_cow(i8* %4)
ret i32 %5
}
/* Variables and functions */
void *alien_offset(int /*<<< orphan*/);
int /*<<< orphan*/ dpop();
void *unbox_alien(void) { return alien_offset(dpop()); }


x86 assembly (clang, -O0):
<unbox_alien>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dpop@plt>
mov    %eax,%edi
call   1040 <alien_offset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<unbox_alien>:
push   %rax
xor    %eax,%eax
call   1030 <dpop@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <alien_offset@plt>

LLVM IR (-O0):
define i8* @unbox_alien() {
%1 = call i32 (...) @dpop()
%2 = call i8* @alien_offset(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
define i8* @unbox_alien() {
%1 = tail call i32 (...) @dpop()
%2 = tail call i8* @alien_offset(i32 %1)
ret i8* %2
}
/* Variables and functions */
bool isvarchar(char c) {
  if (c >= 'A' && c <= 'Z') {
    return true;
  }
  if (c == '$') {
    return true;
  }
  if (c >= '0' && c <= '9') {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<isvarchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1130 <isvarchar+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1130 <isvarchar+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1176 <isvarchar+0x76>
movsbl -0x5(%rbp),%eax
cmp    $0x24,%eax
jne    1149 <isvarchar+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1176 <isvarchar+0x76>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     116f <isvarchar+0x6f>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     116f <isvarchar+0x6f>
movl   $0x1,-0x4(%rbp)
jmp    1176 <isvarchar+0x76>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isvarchar>:
lea    -0x41(%rdi),%eax
cmp    $0x1a,%al
setb   %al
cmp    $0x24,%dil
sete   %cl
or     %al,%cl
add    $0xd0,%dil
cmp    $0xa,%dil
setb   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @isvarchar(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 sge i32 %5, 65
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %27
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 36
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 1, i32* %2
br label %27
17: ; preds = %12
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp sge i32 %19, 48
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp sle i32 %23, 57
br i1 %24, label %25, label %26
25: ; preds = %21
store i32 1, i32* %2
br label %27
26: ; preds = %21, %17
store i32 0, i32* %2
br label %27
27: ; preds = %26, %25, %16, %11
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
define i32 @isvarchar(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = icmp eq i8 %0, 36
%5 = or i1 %4, %3
%6 = add i8 %0, -48
%7 = icmp ult i8 %6, 10
%8 = or i1 %7, %5
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
long tst_fs_type_(void (*)(), char const *);
long tst_fs_type(void (*cleanup)(void), const char *path) {
  return tst_fs_type_(cleanup, path);
}


x86 assembly (clang, -O0):
<tst_fs_type>:
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 <tst_fs_type_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_fs_type>:
jmp    1030 <tst_fs_type_@plt>

LLVM IR (-O0):
define i64 @tst_fs_type(void ()* %0, i8* %1) {
%3 = alloca void ()*
%4 = alloca i8*
store void ()* %0, void ()** %3
store i8* %1, i8** %4
%5 = load void ()*, void ()** %3
%6 = bitcast void ()* %5 to void (...)*
%7 = load i8*, i8** %4
%8 = call i64 @tst_fs_type_(void (...)* %6, i8* %7)
ret i64 %8
}

LLVM IR (-O2):
define i64 @tst_fs_type(void ()* %0, i8* %1) {
%3 = bitcast void ()* %0 to void (...)*
%4 = tail call i64 @tst_fs_type_(void (...)* %3, i8* %1)
ret i64 %4
}
void omap5_register_ti_gfx_buf_mgr(void) { return; }


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

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

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

LLVM IR (-O2):
define void @omap5_register_ti_gfx_buf_mgr() {
ret void
}
int test_imm_A2int8_reg(signed char val) {
  return ((val) & (0xA2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A2int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xa2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A2int8_reg>:
test   $0xa2,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A2int8_reg(i8 signext %0) {
%2 = and i8 %0, -94
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
bool dir_exists(const char *dir) {
  struct stat st;
  if (stat(dir, &st) != 0)
    return false;
  return S_ISDIR(st.st_mode);
}


x86 assembly (clang, -O0):
<dir_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
je     114f <dir_exists+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    115a <dir_exists+0x3a>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dir_exists>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <dir_exists+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @dir_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISDIR(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ malloc(int);
int main(void) { int *restrict restr = (int *)malloc(10 * sizeof(int)); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 40)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 40)
ret i32 0
}
void neural_layer_avgpool_rand(struct Layer *l) { (void)l; }


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

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

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

LLVM IR (-O2):
%struct.Layer = type opaque
define void @neural_layer_avgpool_rand(%struct.Layer* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void done() { exit(0); }


x86 assembly (clang, -O0):
<done>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<done>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @done() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @done() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ busy();
void *busy_wrapper(void *arg __attribute__((unused))) {
  busy();
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @busy_wrapper(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @busy()
ret i8* null
}
void Clearing() {}


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

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

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

LLVM IR (-O2):
define void @Clearing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
main() {
  char a;
  scanf(" %c", &a);
  printf("%c", a);
  scanf(" %c", &a);
  printf("%c", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec2(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xea2(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%r15
lea    0xf(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movsbl 0xf(%rsp),%esi
lea    0xeb5(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c" %c\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = load i8, i8* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c" %c\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = load i8, i8* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %6)
ret i32 0
}
char *Salloc(str, sz)
register char *str;
register unsigned int sz;
{
  char *res = malloc(sz);
  register char *m = res;
  if (sz && m == 0)
    No_Mem();
  while (sz--)
    *m++ = *str++;
  return res;
}


x86 assembly (clang, -O0):
<Salloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1161 <Salloc+0x41>
cmpq   $0x0,-0x20(%rbp)
jne    1161 <Salloc+0x41>
mov    $0x0,%al
call   1030 <No_Mem@plt>
jmp    1166 <Salloc+0x46>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     11a1 <Salloc+0x81>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    1166 <Salloc+0x46>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Salloc>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%r15d
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %ebp,%ebp
je     115c <Salloc+0x2c>
test   %rbx,%rbx
jne    115c <Salloc+0x2c>
xor    %eax,%eax
call   1030 <No_Mem@plt>
jmp    1160 <Salloc+0x30>
test   %ebp,%ebp
je     116e <Salloc+0x3e>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define noalias i8* @Salloc(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp ne i32 %1, 0
%6 = icmp eq i8* %4, null
%7 = and i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (...) @No_Mem()
br label %12
10: ; preds = %2
%11 = icmp eq i32 %1, 0
br i1 %11, label %13, label %12
12: ; preds = %8, %10
br label %13
13: ; preds = %12, %10
ret i8* %4
}
void vqes_closelog(void) { return; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ usleep(int /*<<< orphan*/);
void short_wait(void) { usleep((useconds_t)10000); }


x86 assembly (clang, -O0):
<short_wait>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2710,%edi
call   1030 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<short_wait>:
mov    $0x2710,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @short_wait() {
%1 = call i32 @usleep(i32 10000)
ret void
}

LLVM IR (-O2):
define void @short_wait() {
%1 = tail call i32 @usleep(i32 10000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ StopSoundExt(int, int);
void FadeSounds() { StopSoundExt(-1, ((1 << 2) | (1 << 4))); }


x86 assembly (clang, -O0):
<FadeSounds>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
mov    $0x14,%esi
call   1030 <StopSoundExt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FadeSounds>:
mov    $0xffffffff,%edi
mov    $0x14,%esi
jmp    1030 <StopSoundExt@plt>

LLVM IR (-O0):
define void @FadeSounds() {
%1 = call i32 @StopSoundExt(i32 -1, i32 20)
ret void
}

LLVM IR (-O2):
define void @FadeSounds() {
%1 = tail call i32 @StopSoundExt(i32 -1, i32 20)
ret void
}
void str_rem_chr(char *chr) {
  while (*chr) {
    *chr = *(chr + 1);
    ++chr;
  }
}


x86 assembly (clang, -O0):
<str_rem_chr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <str_rem_chr+0x33>
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <str_rem_chr+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_rem_chr>:
cmpb   $0x0,(%rdi)
je     111e <str_rem_chr+0x1e>
add    $0x1,%rdi
nopl   0x0(%rax)
movzbl (%rdi),%eax
mov    %al,-0x1(%rdi)
add    $0x1,%rdi
test   %al,%al
jne    1110 <str_rem_chr+0x10>
ret

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

LLVM IR (-O2):
define void @str_rem_chr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %0, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
unsigned long ADCComparatorIntStatus(unsigned long ulBase) {
  DEBUG_ASSERT((ulBase == 0x40038000) || (ulBase == 0x40039000));
  return ((*((volatile unsigned long *)(ulBase + 0x00000034))));
}


x86 assembly (clang, -O0):
<ADCComparatorIntStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x40038000,-0x8(%rbp)
40
mov    %al,-0x9(%rbp)
je     113d <ADCComparatorIntStatus+0x2d>
cmpq   $0x40039000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x34(%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCComparatorIntStatus>:
push   %rbx
mov    %rdi,%rbx
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x40038000,%rax
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    0x34(%rbx),%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @ADCComparatorIntStatus(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1073971200
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 1073975296
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i64, i64* %2
%13 = add i64 %12, 52
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @ADCComparatorIntStatus(i64 %0) {
%2 = and i64 %0, -4097
%3 = icmp eq i64 %2, 1073971200
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = add i64 %0, 52
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
scalar_t__ pthread_self();
void task1() {
  printf("thread %d running Task 1\n", (int)pthread_self());
  int i;
  int sum = 0;
  for (i = 0; i < 100000; i++) {
    sum += i;
  }
}


x86 assembly (clang, -O0):
<task1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x186a0,-0x4(%rbp)
jge    116f <task1+0x4f>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114b <task1+0x2b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<task1>:
push   %rax
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"thread %d running Task 1\0A\00"
define void @task1() {
%1 = alloca i32
%2 = alloca i32
%3 = call i64 (...) @pthread_self()
%4 = trunc i64 %3 to i32
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 0, i32* %2
store i32 0, i32* %1
br label %6
6: ; preds = %13, %0
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 100000
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = add nsw i32 %11, %10
store i32 %12, i32* %2
br label %13
13: ; preds = %9
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"thread %d running Task 1\0A\00"
define void @task1() {
%1 = tail call i64 (...) @pthread_self()
%2 = trunc i64 %1 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
void gdk_event_mask_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_event_mask_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ theproblem_set_myid();
int init_MPI_GRMHD_myid(void) {
  int truempiid;
  theproblem_set_myid();
  return (0);
}


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

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

LLVM IR (-O0):
define i32 @init_MPI_GRMHD_myid() {
%1 = alloca i32
%2 = call i32 (...) @theproblem_set_myid()
ret i32 0
}

LLVM IR (-O2):
define i32 @init_MPI_GRMHD_myid() {
%1 = tail call i32 (...) @theproblem_set_myid()
ret i32 0
}