xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Free(void *);
void argv_destroy(char **argv) {
  int i;
  for (i = 0; argv[i] != NULL; i++)
    Free((void *)argv[i]);
  Free((void *)argv);
}


x86 assembly (clang, -O0):
<argv_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1155 <argv_destroy+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <Free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <argv_destroy+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <Free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argv_destroy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <argv_destroy+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <Free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <argv_destroy+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <Free@plt>

LLVM IR (-O0):
define void @argv_destroy(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %18, %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, null
br i1 %10, label %11, label %21
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 @Free(i8* %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
%22 = load i8**, i8*** %2
%23 = bitcast i8** %22 to i8*
%24 = call i32 @Free(i8* %23)
ret void
}

LLVM IR (-O2):
define void @argv_destroy(i8** %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
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 @Free(i8* %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, null
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = bitcast i8** %0 to i8*
%14 = tail call i32 @Free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
size_t str_sz_round(size_t sz) {
  size_t res = (1 << 4);
  while (res < sz) {
    res *= 2;
    assert(res > 0);
  }
  return res;
}


x86 assembly (clang, -O0):
<str_sz_round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x10,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1155 <str_sz_round+0x45>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
jmp    1124 <str_sz_round+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_sz_round>:
push   %r14
push   %rbx
push   %rax
mov    $0x10,%ebx
cmp    $0x11,%rdi
jb     1143 <str_sz_round+0x33>
mov    %rdi,%r14
mov    $0x10,%ebx
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
add    %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
cmp    %r14,%rbx
jb     1130 <str_sz_round+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @str_sz_round(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 16, i64* %3
br label %4
4: ; preds = %8, %1
%5 = load i64, i64* %3
%6 = load i64, i64* %2
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load i64, i64* %3
%10 = mul i64 %9, 2
store i64 %10, i64* %3
%11 = load i64, i64* %3
%12 = icmp ugt i64 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
br label %4
15: ; preds = %4
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @str_sz_round(i64 %0) {
%2 = icmp ugt i64 %0, 16
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i64 [ %5, %3 ], [ 16, %1 ]
%5 = shl i64 %4, 1
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = icmp ult i64 %5, %0
br i1 %9, label %3, label %10
10: ; preds = %3, %1
%11 = phi i64 [ 16, %1 ], [ %5, %3 ]
ret i64 %11
}
double ls_cost_nm9_sign(double x) { return x < 0 ? -1 : x > 0 ? 1 : x; }


x86 assembly (clang, -O0):
<ls_cost_nm9_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <ls_cost_nm9_sign+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <ls_cost_nm9_sign+0x61>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <ls_cost_nm9_sign+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <ls_cost_nm9_sign+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm9_sign>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
movsd  0xed2(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ls_cost_nm9_sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load double, double* %2
br label %12
12: ; preds = %10, %9
%13 = phi double [ 1.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi double [ -1.000000e+00, %5 ], [ %13, %12 ]
ret double %15
}

LLVM IR (-O2):
define double @ls_cost_nm9_sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
int ft_min(int x, int y) { return (x < y ? x : y); }


x86 assembly (clang, -O0):
<ft_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <ft_min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <ft_min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void *LoadSymbol(void *handle, const char *symbol) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @LoadSymbol(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_gettid;
int /*<<< orphan*/ syscall(int /*<<< orphan*/);
pid_t gettid(void) { return (pid_t)syscall(SYS_gettid); }


x86 assembly (clang, -O0):
<gettid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettid>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_gettid = global i32 0
define i32 @gettid() {
%1 = load i32, i32* @SYS_gettid
%2 = call i32 @syscall(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@SYS_gettid = global i32 0
define i32 @gettid() {
%1 = load i32, i32* @SYS_gettid
%2 = tail call i32 @syscall(i32 %1)
ret i32 %2
}
int Bematech_FI_LeituraCheque(Var, Retorno) {
  return Formata("\x1b|76|\x1b", Var, Retorno);
}


x86 assembly (clang, -O0):
<Bematech_FI_LeituraCheque>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <Formata@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bematech_FI_LeituraCheque>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <Formata@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\1B|76|\1B\00"
define i32 @Bematech_FI_LeituraCheque(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B|76|\1B\00"
define i32 @Bematech_FI_LeituraCheque(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 %3
}
int test_imm_35int16_mem(short *val) {
  return ((*val) & (0x35 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_35int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 53
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void g_on_error_query() {}


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

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

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

LLVM IR (-O2):
define void @g_on_error_query() {
ret void
}
/* Variables and functions */
int get_next_rec_buffer(int);
int /*<<< orphan*/ is_space(int);
int get_next_space(int maxusec) {
  int data;
  data = get_next_rec_buffer(maxusec);
  if (data == 0)
    return (0);
  if (!is_space(data)) {
    do {
    } while (0);
    return (0);
  }
  return (data);
}


x86 assembly (clang, -O0):
<get_next_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <get_next_rec_buffer@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    114c <get_next_space+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1179 <get_next_space+0x59>
mov    -0xc(%rbp),%edi
call   1030 <is_space@plt>
cmp    $0x0,%eax
jne    1173 <get_next_space+0x53>
jmp    1162 <get_next_space+0x42>
jmp    1167 <get_next_space+0x47>
movl   $0x0,-0x4(%rbp)
jmp    1179 <get_next_space+0x59>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_next_space>:
push   %rbx
call   1040 <get_next_rec_buffer@plt>
test   %eax,%eax
je     113a <get_next_space+0x1a>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <is_space@plt>
test   %eax,%eax
cmove  %eax,%ebx
jmp    113c <get_next_space+0x1c>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @get_next_space(i32 %0) {
%2 = tail call i32 @get_next_rec_buffer(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @is_space(i32 %2)
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 0, i32 %2
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vprintf(char *, int /*<<< orphan*/);
void uninivar_vprintf(char *Format, va_list Arg) {
  char *format;
  va_list arg;
  (void)vprintf(format, arg);
  (void)vprintf(format, Arg);
  (void)vprintf(Format, Arg);
  (void)vprintf(Format, arg);
}


x86 assembly (clang, -O0):
<uninivar_vprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <vprintf@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <vprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <vprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <vprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninivar_vprintf>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <vprintf@plt>
mov    %ebx,%esi
call   1030 <vprintf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <vprintf@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <vprintf@plt>

LLVM IR (-O0):
define void @uninivar_vprintf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = call i32 @vprintf(i8* %7, i32 %8)
%10 = load i8*, i8** %5
%11 = load i32, i32* %4
%12 = call i32 @vprintf(i8* %10, i32 %11)
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = call i32 @vprintf(i8* %13, i32 %14)
%16 = load i8*, i8** %3
%17 = load i32, i32* %6
%18 = call i32 @vprintf(i8* %16, i32 %17)
ret void
}

LLVM IR (-O2):
define void @uninivar_vprintf(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @vprintf(i8* undef, i32 undef)
%4 = tail call i32 @vprintf(i8* undef, i32 %1)
%5 = tail call i32 @vprintf(i8* %0, i32 %1)
%6 = tail call i32 @vprintf(i8* %0, i32 undef)
ret void
}
void foo053() {}


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

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

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

LLVM IR (-O2):
define void @foo053() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mb_register(int /*<<< orphan*/);
int /*<<< orphan*/ mb_status();
int /*<<< orphan*/ sleep(int);
void status_loop(void) {
  mb_register(0);
  while (1) {
    sleep(10);
    mb_status();
  }
}


x86 assembly (clang, -O0):
<status_loop>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <mb_register@plt>
mov    $0xa,%edi
call   1050 <sleep@plt>
mov    $0x0,%al
call   1030 <mb_status@plt>
jmp    113b <status_loop+0xb>

x86 assembly (clang, -O2):
<status_loop>:
push   %rax
xor    %edi,%edi
call   1040 <mb_register@plt>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
call   1030 <mb_status@plt>
jmp    1140 <status_loop+0x10>

LLVM IR (-O0):
define void @status_loop() {
%1 = call i32 @mb_register(i32 0)
br label %2
2: ; preds = %0, %2
%3 = call i32 @sleep(i32 10)
%4 = call i32 (...) @mb_status()
br label %2
}

LLVM IR (-O2):
define void @status_loop() {
%1 = tail call i32 @mb_register(i32 0)
br label %2
2: ; preds = %0, %2
%3 = tail call i32 @sleep(i32 10)
%4 = tail call i32 (...) @mb_status()
br label %2
}
void display_digit(int digit) {}


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

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

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

LLVM IR (-O2):
define void @display_digit(i32 %0) {
ret void
}
void Tcl_Exit(status) int status;
{
  Tcl_Finalize();
  exit(status);
}


x86 assembly (clang, -O0):
<Tcl_Exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Tcl_Finalize@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Tcl_Exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <Tcl_Finalize@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @Tcl_Exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @Tcl_Finalize()
%4 = load i32, i32* %2
unreachable
}

LLVM IR (-O2):
define void @Tcl_Exit(i32 %0) {
%2 = tail call i32 (...) @Tcl_Finalize()
tail call void @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ NumberIO_StrToInt(char *, int, int *);
int /*<<< orphan*/ StrIO_ReadString(char *, int);
void NumberIO_ReadInt(int *x) {
  typedef struct _T5_a _T5;
  struct _T5_a {
    char array[79 + 1];
  };
  _T5 a;
  StrIO_ReadString((char *)&a.array[0], 79);
  NumberIO_StrToInt((char *)&a.array[0], 79, x);
}


x86 assembly (clang, -O0):
<NumberIO_ReadInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x58(%rbp),%rdi
mov    $0x4f,%esi
call   1040 <StrIO_ReadString@plt>
lea    -0x58(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x4f,%esi
call   1030 <NumberIO_StrToInt@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NumberIO_ReadInt>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%r14
mov    %r14,%rdi
mov    $0x4f,%esi
call   1040 <StrIO_ReadString@plt>
mov    %r14,%rdi
mov    $0x4f,%esi
mov    %rbx,%rdx
call   1030 <NumberIO_StrToInt@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct._T5_a = type { [80 x i8] }
define void @NumberIO_ReadInt(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct._T5_a
store i32* %0, i32** %2
%4 = getelementptr inbounds %struct._T5_a, %struct._T5_a* %3, i32 0, i32 0
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%6 = call i32 @StrIO_ReadString(i8* %5, i32 79)
%7 = getelementptr inbounds %struct._T5_a, %struct._T5_a* %3, i32 0, i32 0
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%9 = load i32*, i32** %2
%10 = call i32 @NumberIO_StrToInt(i8* %8, i32 79, i32* %9)
ret void
}

LLVM IR (-O2):
%struct._T5_a = type { [80 x i8] }
define void @NumberIO_ReadInt(i32* %0) {
%2 = alloca %struct._T5_a
%3 = getelementptr inbounds %struct._T5_a, %struct._T5_a* %2, i64 0, i32 0, i64 0
%4 = call i32 @StrIO_ReadString(i8* %3, i32 79)
%5 = call i32 @NumberIO_StrToInt(i8* %3, i32 79, i32* %0)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ runShox();
int /*<<< orphan*/ welcome(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  welcome(getpid());
  runShox();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
call   1040 <welcome@plt>
mov    $0x0,%al
call   1050 <runShox@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%edi
call   1040 <welcome@plt>
xor    %eax,%eax
call   1050 <runShox@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @getpid()
%7 = call i32 @welcome(i32 %6)
%8 = call i32 (...) @runShox()
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @welcome(i32 %3)
%5 = tail call i32 (...) @runShox()
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *);
int /*<<< orphan*/ system(char *);
void doesStorageExist() {
  FILE *file;
  if ((file = fopen(".storage", "r")) != NULL) {
    fclose(file);
  } else {
    char cmd[100];
    sprintf(cmd, "mkdir .storage");
    system(cmd);
  }
}


x86 assembly (clang, -O0):
<doesStorageExist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    0xeb9(%rip),%rdi
lea    0xeaa(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1177 <doesStorageExist+0x37>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
jmp    1190 <doesStorageExist+0x50>
lea    -0x70(%rbp),%rdi
lea    0xe80(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x70(%rbp),%rdi
call   1040 <system@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doesStorageExist>:
sub    $0x68,%rsp
lea    0xecd(%rip),%rdi
lea    0xebe(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1158 <doesStorageExist+0x28>
mov    %rax,%rdi
add    $0x68,%rsp
jmp    1030 <fclose@plt>
movabs $0x656761726f7473,%rax
mov    %rax,0x7(%rsp)
movabs $0x732e207269646b6d,%rax
20 2e 73
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1040 <system@plt>
add    $0x68,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c".storage\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [15 x i8] c"mkdir .storage\00"
define void @doesStorageExist() {
%1 = alloca i32*
%2 = alloca [100 x i8]
%3 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32*, i32** %1
%7 = call i32 @fclose(i32* %6)
br label %13
8: ; preds = %0
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%10 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%12 = call i32 @system(i8* %11)
br label %13
13: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c".storage\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [15 x i8] c"mkdir .storage\00"
define void @doesStorageExist() {
%1 = alloca [100 x i8]
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @fclose(i32* %2)
br label %9
6: ; preds = %0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%8 = call i32 @system(i8* %7)
br label %9
9: ; preds = %6, %4
ret void
}
/* Variables and functions */
int mwsp_send_command(int, int, int);
int mwsp_eeprom_write(int fd) { return mwsp_send_command(fd, 250, 0x1); }


x86 assembly (clang, -O0):
<mwsp_eeprom_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xfa,%esi
mov    $0x1,%edx
call   1030 <mwsp_send_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mwsp_eeprom_write>:
mov    $0xfa,%esi
mov    $0x1,%edx
jmp    1030 <mwsp_send_command@plt>

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

LLVM IR (-O2):
define i32 @mwsp_eeprom_write(i32 %0) {
%2 = tail call i32 @mwsp_send_command(i32 %0, i32 250, i32 1)
ret i32 %2
}
void avio_print_string_array() {}


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

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

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

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

/* Variables and functions */
void drda_log(int debug_lvl, FILE *dumpfile, const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @drda_log(i32 %0, i32* nocapture %1, i8* nocapture %2, ...) {
ret void
}
int length(char *line) {
  register int i = 1;
  while (*line++ != '\n')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1138 <length+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
mov    $0x1,%eax
cmpb   $0xa,(%rdi)
je     111a <length+0x1a>
mov    $0x1,%eax
nop
cmpb   $0xa,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <length+0x10>
ret

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

LLVM IR (-O2):
define i32 @length(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 10
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 1, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 10
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %12
}
char *hello_world() { return "Hello, world!"; }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\00"
define i8* @hello_world() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
define i8* @hello_world() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
float cosine_interp(float, float, float);
float bicosine_interp(float tl, float tr, float bl, float br, float x_amount,
                      float y_amount) {
  float left = cosine_interp(tl, bl, y_amount);
  float right = cosine_interp(tr, br, y_amount);
  return cosine_interp(right, left, x_amount);
}


x86 assembly (clang, -O0):
<bicosine_interp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
call   1030 <cosine_interp@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
call   1030 <cosine_interp@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
call   1030 <cosine_interp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bicosine_interp>:
sub    $0x18,%rsp
movss  %xmm5,0x4(%rsp)
movss  %xmm4,0x14(%rsp)
movss  %xmm3,0x10(%rsp)
movss  %xmm1,0xc(%rsp)
movaps %xmm2,%xmm1
movaps %xmm5,%xmm2
call   1030 <cosine_interp@plt>
movss  %xmm0,0x8(%rsp)
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
movss  0x4(%rsp),%xmm2
call   1030 <cosine_interp@plt>
movss  0x8(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
add    $0x18,%rsp
jmp    1030 <cosine_interp@plt>

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

LLVM IR (-O2):
define float @bicosine_interp(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = tail call float @cosine_interp(float %0, float %2, float %5)
%8 = tail call float @cosine_interp(float %1, float %3, float %5)
%9 = tail call float @cosine_interp(float %8, float %7, float %4)
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int x;
  x = 1;
  if (x)
    printf("x is 1\n");
  return 0;
}


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)
movl   $0x1,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1143 <main+0x33>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"x is 1\0A\00"
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
store i32 1, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"x is 1\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int gw_sched_wrap() { return 1; }


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

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

LLVM IR (-O0):
define i32 @gw_sched_wrap() {
ret i32 1
}

LLVM IR (-O2):
define i32 @gw_sched_wrap() {
ret i32 1
}
void ERR_get_err_state_table(void) {}


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

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

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

LLVM IR (-O2):
define void @ERR_get_err_state_table() {
ret void
}
double Rand(pseed)
unsigned *pseed;
{
  unsigned temp;
  double temp1;
  temp = (1220703125 * *pseed) & 0x7fffffff;
  *pseed = temp;
  temp1 = temp;
  temp1 *= 0.465613e-9;
  return temp1;
}


x86 assembly (clang, -O0):
<Rand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
imul   $0x48c27395,%eax,%eax
and    $0x7fffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec6(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rand>:
imul   $0x48c27395,(%rdi),%eax
and    $0x7fffffff,%eax
mov    %eax,(%rdi)
cvtsi2sd %eax,%xmm0
mulsd  0xee7(%rip),%xmm0
ret

LLVM IR (-O0):
define double @Rand(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = mul i32 1220703125, %6
%8 = and i32 %7, 2147483647
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32*, i32** %2
store i32 %9, i32* %10
%11 = load i32, i32* %3
%12 = uitofp i32 %11 to double
store double %12, double* %4
%13 = load double, double* %4
%14 = fmul double %13, 4.656130e-10
store double %14, double* %4
%15 = load double, double* %4
ret double %15
}

LLVM IR (-O2):
define double @Rand(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul i32 %2, 1220703125
%4 = and i32 %3, 2147483647
store i32 %4, i32* %0
%5 = uitofp i32 %4 to double
%6 = fmul double %5, 4.656130e-10
ret double %6
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double drand(double low, double high) {
  return ((double)rand() * (high - low)) / (double)RAND_MAX + low;
}


x86 assembly (clang, -O0):
<drand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  -0x10(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mov    0x2ea5(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drand>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
mov    0x2e9e(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @drand(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i64 (...) @rand()
%6 = sitofp i64 %5 to double
%7 = load double, double* %4
%8 = load double, double* %3
%9 = fsub double %7, %8
%10 = fmul double %6, %9
%11 = load i64, i64* @RAND_MAX
%12 = sitofp i64 %11 to double
%13 = fdiv double %10, %12
%14 = load double, double* %3
%15 = fadd double %13, %14
ret double %15
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @drand(double %0, double %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = fsub double %1, %0
%6 = fmul double %5, %4
%7 = load i64, i64* @RAND_MAX
%8 = sitofp i64 %7 to double
%9 = fdiv double %6, %8
%10 = fadd double %9, %0
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint8_t;

/* Variables and functions */
__attribute__((always_)) uint8_t read8(unsigned long addr) {
  return *((volatile uint8_t *)(addr));
}


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

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

LLVM IR (-O0):
define i32 @read8(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @read8(i64 %0) {
%2 = inttoptr i64 %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int le2me_32(int /*<<< orphan*/);
int /*<<< orphan*/ unaligned32(void const *);
int unaligned32_le(const void *v) { return le2me_32(unaligned32(v)); }


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

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

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

LLVM IR (-O2):
define i32 @unaligned32_le(i8* %0) {
%2 = tail call i32 @unaligned32(i8* %0)
%3 = tail call i32 @le2me_32(i32 %2)
ret i32 %3
}
int test2(int a) { return 1 - a == a; }


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%eax
sub    -0x4(%rbp),%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
add    %edi,%edi
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @test2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 1, %3
%5 = load i32, i32* %2
%6 = icmp eq i32 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @test2(i32 %0) {
%2 = sub nsw i32 1, %0
%3 = icmp eq i32 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
void ARGBMultiplyRow_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBMultiplyRow_Any_AVX2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void leave(int i) {
  if (i != 0)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<leave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113c <leave+0x1c>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<leave>:
push   %rax
test   %edi,%edi
jne    112c <leave+0xc>
xor    %edi,%edi
call   1040 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @leave(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @leave(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = tail call i32 @exit(i32 0)
unreachable
}
void X509_CRL_get_ext_d2i(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_CRL_get_ext_d2i() {
ret void
}
/* Variables and functions */
double exp(double);
double qDBO(double DBO) {
  if (DBO > 30)
    return 2.0;
  return 102.6 * exp(0.1815 * DBO);
}


x86 assembly (clang, -O0):
<qDBO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1146 <qDBO+0x36>
movsd  0xedc(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116c <qDBO+0x5c>
movsd  0xec2(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xea5(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qDBO>:
push   %rax
ucomisd 0xeef(%rip),%xmm0
jbe    1125 <qDBO+0x15>
movsd  0xedd(%rip),%xmm0
pop    %rax
ret
mulsd  0xee3(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @qDBO(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 3.000000e+01
br i1 %5, label %6, label %7
6: ; preds = %1
store double 2.000000e+00, double* %2
br label %12
7: ; preds = %1
%8 = load double, double* %3
%9 = fmul double 1.815000e-01, %8
%10 = call double @exp(double %9)
%11 = fmul double 1.026000e+02, %10
store double %11, double* %2
br label %12
12: ; preds = %7, %6
%13 = load double, double* %2
ret double %13
}

LLVM IR (-O2):
define double @qDBO(double %0) {
%2 = fcmp ogt double %0, 3.000000e+01
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = fmul double %0, 1.815000e-01
%5 = tail call double @exp(double %4)
%6 = fmul double %5, 1.026000e+02
br label %7
7: ; preds = %1, %3
%8 = phi double [ %6, %3 ], [ 2.000000e+00, %1 ]
ret double %8
}
void WhereIsWho() {}


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

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

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

LLVM IR (-O2):
define void @WhereIsWho() {
ret void
}
void exp_unused() {}


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

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

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

LLVM IR (-O2):
define void @exp_unused() {
ret void
}
/* Variables and functions */
char *WCPU_cpudetectmesg();
char *WCPU_fpudetectmesg();
int /*<<< orphan*/ printf(char *, char *);
void WCPU_cpufpumesg() {
  printf("detected CPU type: %s\n", WCPU_cpudetectmesg());
  printf("detected FPU type: %s\n", WCPU_fpudetectmesg());
}


x86 assembly (clang, -O0):
<WCPU_cpufpumesg>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <WCPU_cpudetectmesg@plt>
mov    %rax,%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <WCPU_fpudetectmesg@plt>
mov    %rax,%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WCPU_cpufpumesg>:
push   %rax
xor    %eax,%eax
call   1040 <WCPU_cpudetectmesg@plt>
lea    0xec1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <WCPU_fpudetectmesg@plt>
lea    0xec2(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"detected CPU type: %s\0A\00"
@.str.1 = [23 x i8] c"detected FPU type: %s\0A\00"
define void @WCPU_cpufpumesg() {
%1 = call i8* (...) @WCPU_cpudetectmesg()
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = call i8* (...) @WCPU_fpudetectmesg()
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"detected CPU type: %s\0A\00"
@.str.1 = [23 x i8] c"detected FPU type: %s\0A\00"
define void @WCPU_cpufpumesg() {
%1 = tail call i8* (...) @WCPU_cpudetectmesg()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i8* (...) @WCPU_fpudetectmesg()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int fsetxattr(int, char *, char *, int /*<<< orphan*/, int /*<<< orphan*/,
              int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int xattrkv_set(int db, char *key, char *value) {
  int retval;
  retval = fsetxattr(db, key, (char *)value, strlen(value), 0, 0);
  return retval;
}


x86 assembly (clang, -O0):
<xattrkv_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x34(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    %eax,%ecx
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <fsetxattr@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xattrkv_set>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    %rdx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fsetxattr@plt>

LLVM IR (-O0):
define i32 @xattrkv_set(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %6
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @fsetxattr(i32 %8, i8* %9, i8* %10, i32 %12, i32 0, i32 0)
store i32 %13, i32* %7
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
define i32 @xattrkv_set(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = tail call i32 @fsetxattr(i32 %0, i8* %1, i8* %2, i32 %4, i32 0, i32 0)
ret i32 %5
}
/* Type definitions */
struct RNAheat_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ RNAheat_cmdline_parser_release(struct RNAheat_args_info *);
void RNAheat_cmdline_parser_free(struct RNAheat_args_info *args_info) {
  RNAheat_cmdline_parser_release(args_info);
}


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

x86 assembly (clang, -O2):
<RNAheat_cmdline_parser_free>:
jmp    1030 <RNAheat_cmdline_parser_release@plt>

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

LLVM IR (-O2):
%struct.RNAheat_args_info = type { i32 }
define void @RNAheat_cmdline_parser_free(%struct.RNAheat_args_info* %0) {
%2 = tail call i32 @RNAheat_cmdline_parser_release(%struct.RNAheat_args_info* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Log_Out(char const *);
void Log_Puts(const char *string) {
  Log_Out(string);
  Log_Out("\n");
}


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

x86 assembly (clang, -O2):
<Log_Puts>:
push   %rax
call   1030 <Log_Out@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <Log_Out@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @Log_Puts(i8* %0) {
%2 = tail call i32 @Log_Out(i8* %0)
%3 = tail call i32 @Log_Out(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}