xunge/DecIR huggingface dataset:
int main() {
  int i = 0;
  int res = 0;
  goto L1;
  for (i = 0; i < 10; i++) {
    goto L1;
    return 42;
  L1:
    res++;
    i++;
    if (i < 10)
      goto L1;
  }
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
jmp    112d <main+0x2d>
cmpl   $0xa,-0x8(%rbp)
jge    1161 <main+0x61>
jmp    112d <main+0x2d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    114e <main+0x4e>
jmp    112d <main+0x2d>
jmp    1153 <main+0x53>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111e <main+0x1e>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %9
4: ; No predecessors!
store i32 0, i32* %2
br label %5
5: ; preds = %18, %4
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %21
8: ; preds = %5
br label %9
9: ; preds = %16, %8, %0
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = icmp slt i32 %14, 10
br i1 %15, label %16, label %17
16: ; preds = %9
br label %9
17: ; preds = %9
br label %18
18: ; preds = %17
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %5
21: ; preds = %5
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @main() {
ret i32 10
}
void hrtimer_get_remaining(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<hrtimer_get_remaining>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hrtimer_get_remaining>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.hrtimer_get_remaining = [22 x i8] c"hrtimer_get_remaining\00"
define void @hrtimer_get_remaining() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.hrtimer_get_remaining, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.hrtimer_get_remaining = [22 x i8] c"hrtimer_get_remaining\00"
define void @hrtimer_get_remaining() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.hrtimer_get_remaining, i64 0, i64 0))
ret void
}
int format_int_to_hex(int n, char *buf, int len) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @format_int_to_hex(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
int ft_sisnum(const char *str) {
  if (!str)
    return (0);
  while (*str != '\0') {
    if (*str >= '0' && *str <= '9')
      ++str;
    else
      return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<ft_sisnum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <ft_sisnum+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    117d <ft_sisnum+0x7d>
jmp    1124 <ft_sisnum+0x24>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1176 <ft_sisnum+0x76>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     1165 <ft_sisnum+0x65>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jg     1165 <ft_sisnum+0x65>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1171 <ft_sisnum+0x71>
movl   $0x0,-0x4(%rbp)
jmp    117d <ft_sisnum+0x7d>
jmp    1124 <ft_sisnum+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_sisnum>:
xor    %eax,%eax
test   %rdi,%rdi
je     1138 <ft_sisnum+0x38>
mov    (%rdi),%cl
test   %cl,%cl
je     1133 <ft_sisnum+0x33>
add    $0x1,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0xd0,%cl
cmp    $0xa,%cl
jae    1138 <ft_sisnum+0x38>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <ft_sisnum+0x20>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_sisnum(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %9
6: ; preds = %9
%7 = load i8, i8* %14
%8 = icmp eq i8 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %3, %6
%10 = phi i8 [ %7, %6 ], [ %4, %3 ]
%11 = phi i8* [ %14, %6 ], [ %0, %3 ]
%12 = add i8 %10, -48
%13 = icmp ult i8 %12, 10
%14 = getelementptr inbounds i8, i8* %11, i64 1
br i1 %13, label %6, label %15
15: ; preds = %9, %6, %3, %1
%16 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 0, %9 ], [ 1, %6 ]
ret i32 %16
}
void ramster_register_pamops(struct tmem_pamops *p) {}


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

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

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

LLVM IR (-O2):
%struct.tmem_pamops = type opaque
define void @ramster_register_pamops(%struct.tmem_pamops* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
bool cmp2(const void *a, const void *b) {
  return *(uint16_t *)a == *(uint16_t *)b;
}


x86 assembly (clang, -O0):
<cmp2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp2>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmp    (%rsi),%rcx
sete   %al
ret

LLVM IR (-O0):
define i32 @cmp2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = icmp eq i64 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @cmp2(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 eq i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ dmnsn_max(double, double);
double dmnsn_min(int /*<<< orphan*/, double);
double dmnsn_clamp(double n, double min, double max) {
  return dmnsn_min(dmnsn_max(n, min), max);
}


x86 assembly (clang, -O0):
<dmnsn_clamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <dmnsn_max@plt>
mov    %eax,%edi
movsd  -0x18(%rbp),%xmm0
call   1040 <dmnsn_min@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmnsn_clamp>:
push   %rax
movsd  %xmm2,(%rsp)
call   1030 <dmnsn_max@plt>
mov    %eax,%edi
movsd  (%rsp),%xmm0
pop    %rax
jmp    1040 <dmnsn_min@plt>

LLVM IR (-O0):
define double @dmnsn_clamp(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = call i32 @dmnsn_max(double %7, double %8)
%10 = load double, double* %6
%11 = call double @dmnsn_min(i32 %9, double %10)
ret double %11
}

LLVM IR (-O2):
define double @dmnsn_clamp(double %0, double %1, double %2) {
%4 = tail call i32 @dmnsn_max(double %0, double %1)
%5 = tail call double @dmnsn_min(i32 %4, double %2)
ret double %5
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR67_get(void) { return U_WMRCORENONE_get("U_WMR67"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR67\00"
define i32 @U_WMR67_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR67\00"
define i32 @U_WMR67_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ *get_object(char const *);
int libpd_exists(const char *sym) { return get_object(sym) != NULL; }


x86 assembly (clang, -O0):
<libpd_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_object@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @libpd_exists(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32* @get_object(i8* %3)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @libpd_exists(i8* %0) {
%2 = tail call i32* @get_object(i8* %0)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
void f() {
  int a[5];
  float b[7];
  int m[2][10];
  float n[6][4][3][20];
}


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

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

LLVM IR (-O0):
define void @f() {
%1 = alloca [5 x i32]
%2 = alloca [7 x float]
%3 = alloca [2 x [10 x i32]]
%4 = alloca [6 x [4 x [3 x [20 x float]]]]
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dup2(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ open(char *, int /*<<< orphan*/);
void sasm_replace_stdin(void) { dup2(open("input.txt", 0), 0); }


x86 assembly (clang, -O0):
<sasm_replace_stdin>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
xor    %esi,%esi
call   1040 <open@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <dup2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sasm_replace_stdin>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %esi,%esi
call   1040 <open@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <dup2@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"input.txt\00"
define void @sasm_replace_stdin() {
%1 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = call i32 @dup2(i32 %1, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"input.txt\00"
define void @sasm_replace_stdin() {
%1 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @dup2(i32 %1, i32 0)
ret void
}
void pcp_print_cpu_stats(struct activity *a, int curr) {}


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

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

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

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_cpu_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}
void f2b_csocket_destroy(int csock, const char *path) {
  (void)(csock);
  (void)(path);
  return;
}


x86 assembly (clang, -O0):
<f2b_csocket_destroy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f2b_csocket_destroy(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
ret void
}

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


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

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

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

LLVM IR (-O2):
define void @null_close_device() {
ret void
}
int test_imm_78int64_midword_reg(long long val) {
  return ((val >> 16) & (0x78 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_78int64_midword_reg>:
test   $0x780000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_78int64_midword_reg(i64 %0) {
%2 = and i64 %0, 7864320
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ se_write_byte(int);
void se_wakeup(void) {
  printf("Wakeup\n");
  se_write_byte(0x0F);
}


x86 assembly (clang, -O0):
<se_wakeup>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xf,%edi
call   1040 <se_write_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<se_wakeup>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xf,%edi
pop    %rax
jmp    1040 <se_write_byte@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Wakeup\0A\00"
define void @se_wakeup() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @se_write_byte(i32 15)
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Wakeup\00"
define void @se_wakeup() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @se_write_byte(i32 15)
ret void
}
void elision_(void *key) {}


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

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

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

LLVM IR (-O2):
define void @elision_(i8* nocapture %0) {
ret void
}
int tls13_client_finished_send(struct tls13_ctx *ctx) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.tls13_ctx = type opaque
define i32 @tls13_client_finished_send(%struct.tls13_ctx* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
long date_dos2unix(unsigned long, unsigned long);
int /*<<< orphan*/ sscanf(char const *, char *, unsigned long *);
long parse_sfbin_date_to_unix(const char *s) {
  unsigned long x;
  sscanf(s, "%lX", &x);
  return date_dos2unix(((x << 16) >> 16), (x >> 16));
}


x86 assembly (clang, -O0):
<parse_sfbin_date_to_unix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <sscanf@plt>
mov    -0x10(%rbp),%rdi
shl    $0x10,%rdi
shr    $0x10,%rdi
mov    -0x10(%rbp),%rsi
shr    $0x10,%rsi
call   1040 <date_dos2unix@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_sfbin_date_to_unix>:
push   %rax
lea    0xed8(%rip),%rsi
mov    %rsp,%rdx
call   1030 <sscanf@plt>
mov    (%rsp),%rsi
movabs $0xffffffffffff,%rdi
and    %rsi,%rdi
shr    $0x10,%rsi
call   1040 <date_dos2unix@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lX\00"
define i64 @parse_sfbin_date_to_unix(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %3)
%6 = load i64, i64* %3
%7 = shl i64 %6, 16
%8 = lshr i64 %7, 16
%9 = load i64, i64* %3
%10 = lshr i64 %9, 16
%11 = call i64 @date_dos2unix(i64 %8, i64 %10)
ret i64 %11
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lX\00"
define i64 @parse_sfbin_date_to_unix(i8* nocapture %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %2)
%5 = load i64, i64* %2
%6 = and i64 %5, 281474976710655
%7 = lshr i64 %5, 16
%8 = call i64 @date_dos2unix(i64 %6, i64 %7)
ret i64 %8
}
void uex_kpanic(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @uex_kpanic(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
void *arakoon_memory_abort_malloc(size_t s) {
  void *ret = NULL;
  ret = malloc(s);
  if (ret == NULL) {
    abort();
  }
  return ret;
}


x86 assembly (clang, -O0):
<arakoon_memory_abort_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1153 <arakoon_memory_abort_malloc+0x33>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arakoon_memory_abort_malloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     112d <arakoon_memory_abort_malloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define noalias i8* @arakoon_memory_abort_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret i8* %2
}
/* Variables and functions */
char *closureContent(char *, char, char);
char *parenthesesContent(char *start) {
  return closureContent(start, '(', ')');
}


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

x86 assembly (clang, -O2):
<parenthesesContent>:
mov    $0x28,%esi
mov    $0x29,%edx
jmp    1030 <closureContent@plt>

LLVM IR (-O0):
define i8* @parenthesesContent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @closureContent(i8* %3, i8 signext 40, i8 signext 41)
ret i8* %4
}

LLVM IR (-O2):
define i8* @parenthesesContent(i8* %0) {
%2 = tail call i8* @closureContent(i8* %0, i8 signext 40, i8 signext 41)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printColor(int /*<<< orphan*/);
int /*<<< orphan*/ underline(char *);
void cmUnderline(char *str) { printColor(underline(str)); }


x86 assembly (clang, -O0):
<cmUnderline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <underline@plt>
mov    %eax,%edi
call   1030 <printColor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmUnderline>:
push   %rax
call   1040 <underline@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <printColor@plt>

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

LLVM IR (-O2):
define void @cmUnderline(i8* %0) {
%2 = tail call i32 @underline(i8* %0)
%3 = tail call i32 @printColor(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void sigint_handler(int x) {
  printf("Caught a Ctrl-C (SIGINT) in a separate handler\nExiting..\n");
  exit(0);
}


x86 assembly (clang, -O0):
<sigint_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigint_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [58 x i8] c"Caught a Ctrl-C (SIGINT) in a separate handler\0AExiting..\0A\00"
define void @sigint_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [57 x i8] c"Caught a Ctrl-C (SIGINT) in a separate handler\0AExiting..\00"
define void @sigint_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
void dummyvideo_SetRenderingCallback(void (*callback)(void)) {}


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

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

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

LLVM IR (-O2):
define void @dummyvideo_SetRenderingCallback(void ()* nocapture %0) {
ret void
}
/* Type definitions */
struct dentry {
  int dummy;
};

/* Variables and functions */
int cap_inode_removexattr(struct dentry *, char *);
int security_inode_removexattr(struct dentry *dentry, char *name) {
  return cap_inode_removexattr(dentry, name);
}


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

x86 assembly (clang, -O2):
<security_inode_removexattr>:
jmp    1030 <cap_inode_removexattr@plt>

LLVM IR (-O0):
%struct.dentry = type { i32 }
define i32 @security_inode_removexattr(%struct.dentry* %0, i8* %1) {
%3 = alloca %struct.dentry*
%4 = alloca i8*
store %struct.dentry* %0, %struct.dentry** %3
store i8* %1, i8** %4
%5 = load %struct.dentry*, %struct.dentry** %3
%6 = load i8*, i8** %4
%7 = call i32 @cap_inode_removexattr(%struct.dentry* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.dentry = type { i32 }
define i32 @security_inode_removexattr(%struct.dentry* %0, i8* %1) {
%3 = tail call i32 @cap_inode_removexattr(%struct.dentry* %0, i8* %1)
ret i32 %3
}
void i2d_PKCS7_SIGN_ENVELOPE(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_PKCS7_SIGN_ENVELOPE() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void ft_putstr(char *argv) {
  int i;
  i = 0;
  while (argv[i]) {
    ft_putchar(argv[i]);
    i++;
  }
  ft_putchar('\n');
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1154 <ft_putstr+0x44>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ft_putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ft_putstr+0x13>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <ft_putstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <ft_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <ft_putstr+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <ft_putchar@plt>

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

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @ft_putchar(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 @ft_putchar(i8 signext 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int /*<<< orphan*/ ssl3_free(int /*<<< orphan*/ *);
void tls1_free(SSL *s) { ssl3_free(s); }


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

x86 assembly (clang, -O2):
<tls1_free>:
jmp    1030 <ssl3_free@plt>

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

LLVM IR (-O2):
define void @tls1_free(i32* %0) {
%2 = tail call i32 @ssl3_free(i32* %0)
ret void
}
/* Variables and functions */
int u8isuppercyrilici(int /*<<< orphan*/);
int /*<<< orphan*/ u8tointcc(char const *);
int u8isuppercyriliccc(const char *c) {
  return u8isuppercyrilici(u8tointcc(c));
}


x86 assembly (clang, -O0):
<u8isuppercyriliccc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <u8tointcc@plt>
mov    %eax,%edi
call   1030 <u8isuppercyrilici@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8isuppercyriliccc>:
push   %rax
call   1040 <u8tointcc@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <u8isuppercyrilici@plt>

LLVM IR (-O0):
define i32 @u8isuppercyriliccc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @u8tointcc(i8* %3)
%5 = call i32 @u8isuppercyrilici(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @u8isuppercyriliccc(i8* %0) {
%2 = tail call i32 @u8tointcc(i8* %0)
%3 = tail call i32 @u8isuppercyrilici(i32 %2)
ret i32 %3
}
/* Variables and functions */
scalar_t__ isPerfectSquare(int);
int /*<<< orphan*/ printf(char *, int);
void test(int num) {
  if (isPerfectSquare(num)) {
    printf("%d is perfect.\n", num);
  } else {
    printf("%d is ugly.\n", num);
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isPerfectSquare@plt>
cmp    $0x0,%rax
je     1151 <test+0x31>
mov    -0x4(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
jmp    1160 <test+0x40>
mov    -0x4(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %edi,%ebx
call   1030 <isPerfectSquare@plt>
test   %rax,%rax
lea    0xede(%rip),%rax
lea    0xec7(%rip),%rdi
cmove  %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%d is perfect.\0A\00"
@.str.1 = [13 x i8] c"%d is ugly.\0A\00"
define void @test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isPerfectSquare(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%d is perfect.\0A\00"
@.str.1 = [13 x i8] c"%d is ugly.\0A\00"
define void @test(i32 %0) {
%2 = tail call i64 @isPerfectSquare(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
%5 = tail call i32 @printf(i8* %4, i32 %0)
ret void
}
int fun_1(int *x) {
  x += 50;
  return x[0] + x[1] + x[2] + x[3];
}


x86 assembly (clang, -O0):
<fun_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xc8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
add    0x4(%rcx),%eax
mov    -0x8(%rbp),%rcx
add    0x8(%rcx),%eax
mov    -0x8(%rbp),%rcx
add    0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_1>:
movdqu 0xc8(%rdi),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @fun_1(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 50
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = add nsw i32 %7, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = add nsw i32 %11, %14
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i64 3
%18 = load i32, i32* %17
%19 = add nsw i32 %15, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @fun_1(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 50
%3 = bitcast i32* %2 to <4 x i32>*
%4 = load <4 x i32>, <4 x i32>* %3
%5 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %4)
ret i32 %5
}
void sti(void) { __asm__ __volatile__("sti" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @sti() {
tail call void asm sideeffect "sti", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ hal_printfWarning(char *, int /*<<< orphan*/,
                                     int /*<<< orphan*/, int /*<<< orphan*/,
                                     int /*<<< orphan*/);
void onCacheMiss(uint32_t reqStartPos, uint32_t reqNumBytes,
                 uint32_t cachePosOnReq, uint32_t cacheSize) {
  hal_printfWarning("Cache Miss: requested: %d bytes from %d, cache was at %d "
                    "with a size of %d!",
                    reqNumBytes, reqStartPos, cachePosOnReq, cacheSize);
}


x86 assembly (clang, -O0):
<onCacheMiss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xec8(%rip),%rdi
call   1030 <hal_printfWarning@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<onCacheMiss>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %edi,%edx
lea    0xee2(%rip),%rdi
jmp    1030 <hal_printfWarning@plt>

LLVM IR (-O0):
@.str = [76 x i8] c"Cache Miss: requested: %d bytes from %d, cache was at %d with a size of %d!\00"
define void @onCacheMiss(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* %6
%10 = load i32, i32* %5
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @hal_printfWarning(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [76 x i8] c"Cache Miss: requested: %d bytes from %d, cache was at %d with a size of %d!\00"
define void @onCacheMiss(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @hal_printfWarning(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int mseconds();
void msleep(int s) {
  s += mseconds();
  while (mseconds() < s)
    ;
}


x86 assembly (clang, -O0):
<msleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <mseconds@plt>
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <mseconds@plt>
cmp    -0x4(%rbp),%eax
jge    113d <msleep+0x2d>
jmp    1128 <msleep+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msleep>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <mseconds@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   1030 <mseconds@plt>
cmp    %ebx,%eax
jl     1120 <msleep+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @msleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @mseconds()
%4 = load i32, i32* %2
%5 = add nsw i32 %4, %3
store i32 %5, i32* %2
br label %6
6: ; preds = %10, %1
%7 = call i32 (...) @mseconds()
%8 = load i32, i32* %2
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %6
br label %6
11: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @msleep(i32 %0) {
%2 = tail call i32 (...) @mseconds()
%3 = add nsw i32 %2, %0
br label %4
4: ; preds = %4, %1
%5 = tail call i32 (...) @mseconds()
%6 = icmp slt i32 %5, %3
br i1 %6, label %4, label %7
7: ; preds = %4
ret void
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
int main() {
  char buf[16];
  ssize_t n = 1;
  return (int)(n <= 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
%3 = alloca i64
store i32 0, i32* %1
store i64 1, i64* %3
%4 = load i64, i64* %3
%5 = icmp sle i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void buffer_move_forward_word(struct buffer *buf) {}


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

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

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

LLVM IR (-O2):
%struct.buffer = type opaque
define void @buffer_move_forward_word(%struct.buffer* nocapture %0) {
ret void
}
int foo(char x[]) { return x[0]; }


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

x86 assembly (clang, -O2):
<foo>:
movsbl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @foo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
ret i32 %3
}
void test12() {
  (void)__builtin_offsetof(
      struct {
        char c;
        int i;
      },
      i);
}


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

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

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

LLVM IR (-O2):
define void @test12() {
ret void
}
int Amember(int i, int *a) {
  while (*a != i) {
    if (*a == -1)
      return 0;
    a++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<Amember>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
je     1144 <Amember+0x44>
mov    -0x10(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    1133 <Amember+0x33>
movl   $0x0,-0x4(%rbp)
jmp    114b <Amember+0x4b>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <Amember+0xb>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Amember>:
mov    (%rsi),%ecx
mov    $0x1,%eax
cmp    %edi,%ecx
je     111f <Amember+0x1f>
add    $0x4,%rsi
nop
cmp    $0xffffffff,%ecx
je     1120 <Amember+0x20>
mov    (%rsi),%ecx
add    $0x4,%rsi
cmp    %edi,%ecx
jne    1110 <Amember+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Amember(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, %0
br i1 %4, label %13, label %8
5: ; preds = %8
%6 = load i32, i32* %12
%7 = icmp eq i32 %6, %0
br i1 %7, label %13, label %8
8: ; preds = %2, %5
%9 = phi i32 [ %6, %5 ], [ %3, %2 ]
%10 = phi i32* [ %12, %5 ], [ %1, %2 ]
%11 = icmp eq i32 %9, -1
%12 = getelementptr inbounds i32, i32* %10, i64 1
br i1 %11, label %13, label %5
13: ; preds = %8, %5, %2
%14 = phi i32 [ 1, %2 ], [ 1, %5 ], [ 0, %8 ]
ret i32 %14
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
scalar_t__ cpu_le();
uint32_t be_u32(const uint32_t v) {
  if (cpu_le())
    return ((v & 0xFF000000) >> 24) | ((v & 0x00FF0000) >> 8) |
           ((v & 0x0000FF00) << 8) | ((v & 0x000000FF) << 24);
  return v;
}


x86 assembly (clang, -O0):
<be_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <cpu_le@plt>
cmp    $0x0,%rax
je     1169 <be_u32+0x59>
mov    -0x8(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    -0x8(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    116f <be_u32+0x5f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be_u32>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <cpu_le@plt>
test   %rax,%rax
mov    %ebx,%eax
bswap  %eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @be_u32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 (...) @cpu_le()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %22
6: ; preds = %1
%7 = load i32, i32* %3
%8 = and i32 %7, -16777216
%9 = lshr i32 %8, 24
%10 = load i32, i32* %3
%11 = and i32 %10, 16711680
%12 = ashr i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %3
%15 = and i32 %14, 65280
%16 = shl i32 %15, 8
%17 = or i32 %13, %16
%18 = load i32, i32* %3
%19 = and i32 %18, 255
%20 = shl i32 %19, 24
%21 = or i32 %17, %20
store i32 %21, i32* %2
br label %24
22: ; preds = %1
%23 = load i32, i32* %3
store i32 %23, i32* %2
br label %24
24: ; preds = %22, %6
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @be_u32(i32 %0) {
%2 = tail call i64 (...) @cpu_le()
%3 = icmp eq i64 %2, 0
%4 = tail call i32 @llvm.bswap.i32(i32 %0)
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void main() {
  unsigned rightrot(unsigned x, int n);
  unsigned kkk;
  kkk = rightrot(123456789, 2);
  printf(" unsigned: %lu\n", kkk);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x75bcd15,%edi
mov    $0x2,%esi
call   1040 <rightrot@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x75bcd15,%edi
mov    $0x2,%esi
call   1040 <rightrot@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c" unsigned: %lu\0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 @rightrot(i32 123456789, i32 2)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c" unsigned: %lu\0A\00"
define void @main() {
%1 = tail call i32 @rightrot(i32 123456789, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void log_putln(int fd) { write(fd, "\n", 1); }


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

x86 assembly (clang, -O2):
<log_putln>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @log_putln(i32 %0) {
%2 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
int simulated_nested_loop_cond_in_goto_constant(int p) {
  int k = 0;
  int t = 5;
  int j = 0;
  for (int i = 0; i < 5; i++) {
  B:
    if (i > 2) {
      t = 3;
    } else {
      t = 4;
    }
    j++;
    if (j >= 100)
      j = 0;
    else {
      goto B;
    }
  }
  return k;
}


x86 assembly (clang, -O0):
<simulated_nested_loop_cond_in_goto_constant>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    1186 <simulated_nested_loop_cond_in_goto_constant+0x86>
jmp    1132 <simulated_nested_loop_cond_in_goto_constant+0x32>
cmpl   $0x2,-0x14(%rbp)
jle    1148 <simulated_nested_loop_cond_in_goto_constant+0x48>
movl   $0x3,-0xc(%rbp)
jmp    114f <simulated_nested_loop_cond_in_goto_constant+0x4f>
movl   $0x4,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x64,-0x10(%rbp)
jl     116e <simulated_nested_loop_cond_in_goto_constant+0x6e>
movl   $0x0,-0x10(%rbp)
jmp    1173 <simulated_nested_loop_cond_in_goto_constant+0x73>
jmp    1132 <simulated_nested_loop_cond_in_goto_constant+0x32>
jmp    1178 <simulated_nested_loop_cond_in_goto_constant+0x78>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <simulated_nested_loop_cond_in_goto_constant+0x23>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @simulated_nested_loop_cond_in_goto_constant(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test(void) { printf("I'm in test1.c\n"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"I'm in test1.c\0A\00"
define void @test() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"I'm in test1.c\00"
define void @test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}