xunge/DecIR huggingface dataset:
/* Variables and functions */
double stress_funccall_double_1(double const);
double stress_funcdeep_double_2(double const, double const);
double __attribute__((no))
stress_funcdeep_double_3(const double a, const double b, const double c) {
  return stress_funcdeep_double_2(c, b) + stress_funccall_double_1(a);
}


x86 assembly (clang, -O0):
<stress_funcdeep_double_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <stress_funcdeep_double_2@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <stress_funccall_double_1@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_funcdeep_double_3>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
movaps %xmm2,%xmm0
call   1040 <stress_funcdeep_double_2@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <stress_funccall_double_1@plt>
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @stress_funcdeep_double_3(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* %6
%8 = load double, double* %5
%9 = call double @stress_funcdeep_double_2(double %7, double %8)
%10 = load double, double* %4
%11 = call double @stress_funccall_double_1(double %10)
%12 = fadd double %9, %11
ret double %12
}

LLVM IR (-O2):
define double @stress_funcdeep_double_3(double %0, double %1, double %2) {
%4 = tail call double @stress_funcdeep_double_2(double %2, double %1)
%5 = tail call double @stress_funccall_double_1(double %0)
%6 = fadd double %4, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, int);
int hello(char a, int b) {
  printf("Hello world %c %c\n", a, b);
  return a;
}


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%edx
lea    0xed2(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello>:
push   %rbx
mov    %esi,%edx
mov    %edi,%ebx
lea    0xee4(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Hello world %c %c\0A\00"
define i32 @hello(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8 signext %5, i32 %6)
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [19 x i8] c"Hello world %c %c\0A\00"
define i32 @hello(i8 signext %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8 signext %0, i32 %1)
%4 = sext i8 %0 to i32
ret i32 %4
}
void CRYPTO_set_locked_mem_ex_functions(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_set_locked_mem_ex_functions() {
ret void
}
/* Variables and functions */
int f193(int *);
int f194(int *p) { return f193(p); }


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

x86 assembly (clang, -O2):
<f194>:
jmp    1030 <f193@plt>

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

LLVM IR (-O2):
define i32 @f194(i32* %0) {
%2 = tail call i32 @f193(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void spam() {
  printf("skpd 1.3 - <whats[@t]wekk.net>\n"
         "==============================\n");
}


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

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

LLVM IR (-O0):
@.str = [63 x i8] c"skpd 1.3 - <whats[@t]wekk.net>\0A==============================\0A\00"
define void @spam() {
%1 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [62 x i8] c"skpd 1.3 - <whats[@t]wekk.net>\0A==============================\00"
define void @spam() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str, i64 0, i64 0))
ret void
}
int algebra2(int x) {
  int result;
  result = 3 * x * (1 + 2 * x);
  return result;
}


x86 assembly (clang, -O0):
<algebra2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3,-0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<algebra2>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
imul   %edi,%eax
lea    (%rax,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @algebra2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 3, %4
%6 = load i32, i32* %2
%7 = mul nsw i32 2, %6
%8 = add nsw i32 1, %7
%9 = mul nsw i32 %5, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @algebra2(i32 %0) {
%2 = mul nsw i32 %0, 3
%3 = shl nsw i32 %0, 1
%4 = or i32 %3, 1
%5 = mul nsw i32 %2, %4
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t c_ret_u32() { return 0xffffffff; }


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

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

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

LLVM IR (-O2):
define i32 @c_ret_u32() {
ret i32 -1
}
/* Variables and functions */
int SC68byte_order();
int SC68little_endian(void) { return !(SC68byte_order() & 255); }


x86 assembly (clang, -O0):
<SC68little_endian>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SC68byte_order@plt>
and    $0xff,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @SC68little_endian() {
%1 = call i32 (...) @SC68byte_order()
%2 = and i32 %1, 255
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @SC68little_endian() {
%1 = tail call i32 (...) @SC68byte_order()
%2 = and i32 %1, 255
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void my_gamma(int *parray) { return; }


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

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

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

LLVM IR (-O2):
define void @my_gamma(i32* nocapture %0) {
ret void
}
int __getclktck(void) { return 60; }


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

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

LLVM IR (-O0):
define i32 @__getclktck() {
ret i32 60
}

LLVM IR (-O2):
define i32 @__getclktck() {
ret i32 60
}
/* Variables and functions */
int /*<<< orphan*/ print_str(char *);
int /*<<< orphan*/ syscall();
void task1_func(void) {
  print_str("task1: Created!\n");
  print_str("task1: Now, return to kernel mode\n");
  syscall();
  while (1) {
    print_str("task1: Executed!\n");
    print_str("task1: Now, return to kernel mode\n");
    syscall();
  }
}


x86 assembly (clang, -O0):
<task1_func>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <print_str@plt>
lea    0xeda(%rip),%rdi
call   1030 <print_str@plt>
mov    $0x0,%al
call   1040 <syscall@plt>
lea    0xeea(%rip),%rdi
call   1030 <print_str@plt>
lea    0xebb(%rip),%rdi
call   1030 <print_str@plt>
mov    $0x0,%al
call   1040 <syscall@plt>
jmp    1143 <task1_func+0x23>

x86 assembly (clang, -O2):
<task1_func>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
call   1030 <print_str@plt>
lea    0xeda(%rip),%r14
mov    %r14,%rdi
call   1030 <print_str@plt>
xor    %eax,%eax
call   1040 <syscall@plt>
lea    0xee7(%rip),%rbx
nopl   (%rax)
mov    %rbx,%rdi
call   1030 <print_str@plt>
mov    %r14,%rdi
call   1030 <print_str@plt>
xor    %eax,%eax
call   1040 <syscall@plt>
jmp    1150 <task1_func+0x30>

LLVM IR (-O0):
@.str = [17 x i8] c"task1: Created!\0A\00"
@.str.1 = [35 x i8] c"task1: Now, return to kernel mode\0A\00"
@.str.2 = [18 x i8] c"task1: Executed!\0A\00"
define void @task1_func() {
%1 = call i32 @print_str(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @print_str(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @syscall()
br label %4
4: ; preds = %0, %4
%5 = call i32 @print_str(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @print_str(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @syscall()
br label %4
}

LLVM IR (-O2):
@.str = [17 x i8] c"task1: Created!\0A\00"
@.str.1 = [35 x i8] c"task1: Now, return to kernel mode\0A\00"
@.str.2 = [18 x i8] c"task1: Executed!\0A\00"
define void @task1_func() {
%1 = tail call i32 @print_str(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print_str(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @syscall()
br label %4
4: ; preds = %0, %4
%5 = tail call i32 @print_str(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @print_str(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 (...) @syscall()
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ bar();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  if (bar())
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <bar@plt>
cmp    $0x0,%rax
je     1157 <main+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <bar@plt>
test   %rax,%rax
jne    1144 <main+0x14>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @bar()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ ceil(float);
int range_hann(float r, float w, int m) { return (int)ceil(r + w / 2); }


x86 assembly (clang, -O0):
<range_hann>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xec9(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
call   1030 <ceil@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<range_hann>:
mulss  0xee8(%rip),%xmm1
addss  %xmm1,%xmm0
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define i32 @range_hann(float %0, float %1, i32 %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca i32
store float %0, float* %4
store float %1, float* %5
store i32 %2, i32* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fdiv float %8, 2.000000e+00
%10 = fadd float %7, %9
%11 = call i64 @ceil(float %10)
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @range_hann(float %0, float %1, i32 %2) {
%4 = fmul float %1, 5.000000e-01
%5 = fadd float %4, %0
%6 = tail call i64 @ceil(float %5)
%7 = trunc i64 %6 to i32
ret i32 %7
}
void XESetCopyGC() {}


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

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

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

LLVM IR (-O2):
define void @XESetCopyGC() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ sig_block(int /*<<< orphan*/);
extern void sig_term_block(void) { sig_block(SIGTERM); }


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

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

LLVM IR (-O0):
@SIGTERM = global i32 0
define void @sig_term_block() {
%1 = load i32, i32* @SIGTERM
%2 = call i32 @sig_block(i32 %1)
ret void
}

LLVM IR (-O2):
@SIGTERM = global i32 0
define void @sig_term_block() {
%1 = load i32, i32* @SIGTERM
%2 = tail call i32 @sig_block(i32 %1)
ret void
}
void g_type_qname() {}


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

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

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

LLVM IR (-O2):
define void @g_type_qname() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int uint16_t;

/* Variables and functions */
void UARTFIFODisable(uint32_t ui32Base) {
  ;
  (*((volatile uint16_t *)(ui32Base + 0xA))) &= ~0x4000;
}


x86 assembly (clang, -O0):
<UARTFIFODisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xa(%rax),%ecx
and    $0xffffbfff,%ecx
mov    %ecx,0xa(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFIFODisable>:
andl   $0xffffbfff,0xa(%rdi)
ret

LLVM IR (-O0):
define void @UARTFIFODisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 10
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -16385
store volatile i32 %7, i32* %5
ret void
}

LLVM IR (-O2):
define void @UARTFIFODisable(i64 %0) {
%2 = add nsw i64 %0, 10
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
%5 = and i32 %4, -16385
store volatile i32 %5, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free_list();
int /*<<< orphan*/ populate();
int /*<<< orphan*/ print_entries_all();
int /*<<< orphan*/ printf(char *);
void test_insert_song() {
  printf(
      "====================================================================\n");
  printf("TESTING INSERT SONG...\n");
  populate();
  print_entries_all();
  free_list();
}


x86 assembly (clang, -O0):
<test_insert_song>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
lea    0xeef(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <populate@plt>
mov    $0x0,%al
call   1030 <print_entries_all@plt>
mov    $0x0,%al
call   1060 <free_list@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_insert_song>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <populate@plt>
xor    %eax,%eax
call   1040 <print_entries_all@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <free_list@plt>

LLVM IR (-O0):
@.str = [70 x i8] c"====================================================================\0A\00"
@.str.1 = [24 x i8] c"TESTING INSERT SONG...\0A\00"
define void @test_insert_song() {
%1 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @populate()
%4 = call i32 (...) @print_entries_all()
%5 = call i32 (...) @free_list()
ret void
}

LLVM IR (-O2):
@str = [69 x i8] c"====================================================================\00"
@str.2 = [23 x i8] c"TESTING INSERT SONG...\00"
define void @test_insert_song() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 (...) @populate()
%4 = tail call i32 (...) @print_entries_all()
%5 = tail call i32 (...) @free_list()
ret void
}
int isprint(int character) {
  return ((character >= ' ') && (character <= '~'));
}


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isprint+0x20>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
double adder_chain(double x, double y, double z, double a) {
  return x * y * z * a;
}


x86 assembly (clang, -O0):
<adder_chain>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<adder_chain>:
mulsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @adder_chain(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = fmul double %9, %10
%12 = load double, double* %7
%13 = fmul double %11, %12
%14 = load double, double* %8
%15 = fmul double %13, %14
ret double %15
}

LLVM IR (-O2):
define double @adder_chain(double %0, double %1, double %2, double %3) {
%5 = fmul double %0, %1
%6 = fmul double %5, %2
%7 = fmul double %6, %3
ret double %7
}
char flip_bit(char bit_character) {
  if ('0' == bit_character)
    return '1';
  else
    return '0';
}


x86 assembly (clang, -O0):
<flip_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jne    1124 <flip_bit+0x24>
movb   $0x31,-0x1(%rbp)
jmp    1128 <flip_bit+0x28>
movb   $0x30,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flip_bit>:
cmp    $0x30,%dil
sete   %al
or     $0x30,%al
ret

LLVM IR (-O0):
define signext i8 @flip_bit(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 48, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 49, i8* %2
br label %9
8: ; preds = %1
store i8 48, i8* %2
br label %9
9: ; preds = %8, %7
%10 = load i8, i8* %2
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @flip_bit(i8 signext %0) {
%2 = icmp eq i8 %0, 48
%3 = select i1 %2, i8 49, i8 48
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Camellia_decrypt(const unsigned char *in, unsigned char *out,
                      const void *key) {
  printf("Camellia_decrypt stubbed\n");
  (void)&(in);
  (void)&(out);
  (void)&(key);
}


x86 assembly (clang, -O0):
<Camellia_decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c"Camellia_decrypt stubbed\0A\00"
define void @Camellia_decrypt(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"Camellia_decrypt stubbed\00"
define void @Camellia_decrypt(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int intInHex = 0xFE;
  printf("FE int decimal format is %d\n", intInHex);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"FE int decimal format is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 254, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"FE int decimal format is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 254)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ MYSQL;

/* Variables and functions */
int /*<<< orphan*/ mysql_init(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  MYSQL mysql_dbh;
  mysql_init(&mysql_dbh);
  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)
lea    -0x14(%rbp),%rdi
call   1030 <mysql_init@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @mysql_init(i32* %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @mysql_init(i32* %3)
ret i32 0
}
/* Variables and functions */
int strspn(char const *, char *);
int first_char(const char *s) { return *(s + strspn(s, " \t")); }


x86 assembly (clang, -O0):
<first_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <strspn@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_char>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strspn@plt>
cltq
movsbl (%rbx,%rax,1),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c" \09\00"
define i32 @first_char(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strspn(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %3, i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [3 x i8] c" \09\00"
define i32 @first_char(i8* nocapture %0) {
%2 = tail call i32 @strspn(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}
int check_mmx(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @check_mmx() {
ret i32 0
}
/* Variables and functions */
scalar_t__ islessequal(float, float);
scalar_t__ isnan(float);
float __fminf(float x, float y) {
  return (islessequal(x, y) || isnan(y)) ? x : y;
}


x86 assembly (clang, -O0):
<__fminf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <islessequal@plt>
cmp    $0x0,%rax
jne    115f <__fminf+0x3f>
movss  -0x8(%rbp),%xmm0
call   1040 <isnan@plt>
cmp    $0x0,%rax
je     116e <__fminf+0x4e>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1178 <__fminf+0x58>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fminf>:
push   %rax
movss  %xmm0,0x4(%rsp)
movss  %xmm1,(%rsp)
call   1030 <islessequal@plt>
test   %rax,%rax
je     113e <__fminf+0x1e>
movss  0x4(%rsp),%xmm0
pop    %rax
ret
movss  (%rsp),%xmm0
call   1040 <isnan@plt>
test   %rax,%rax
je     1158 <__fminf+0x38>
movss  0x4(%rsp),%xmm0
movss  %xmm0,(%rsp)
movss  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @__fminf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call i64 @islessequal(float %5, float %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load float, float* %4
%11 = call i64 @isnan(float %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9, %2
%14 = load float, float* %3
br label %17
15: ; preds = %9
%16 = load float, float* %4
br label %17
17: ; preds = %15, %13
%18 = phi float [ %14, %13 ], [ %16, %15 ]
ret float %18
}

LLVM IR (-O2):
define float @__fminf(float %0, float %1) {
%3 = tail call i64 @islessequal(float %0, float %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i64 @isnan(float %1)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, float %1, float %0
br label %9
9: ; preds = %5, %2
%10 = phi float [ %0, %2 ], [ %8, %5 ]
ret float %10
}
void ble_rsp_sm_delete_bonding(
    const struct ble_msg_sm_delete_bonding_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_sm_delete_bonding_rsp_t = type opaque
define void @ble_rsp_sm_delete_bonding(%struct.ble_msg_sm_delete_bonding_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void say_hello() { printf("Hello world!\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define void @say_hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define void @say_hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
char *grskip(p, c)
register char *p;
register int c;
{
  while (*p != '\0' && *p != c)
    ++p;
  if (*p != '\0')
    *p++ = '\0';
  return (p);
}


x86 assembly (clang, -O0):
<grskip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1130 <grskip+0x30>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1140 <grskip+0x40>
jmp    1151 <grskip+0x51>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110b <grskip+0xb>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1173 <grskip+0x73>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<grskip>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%rax),%ecx
add    $0x1,%rax
test   %ecx,%ecx
je     111f <grskip+0x1f>
cmp    %esi,%ecx
jne    1110 <grskip+0x10>
lea    -0x1(%rax),%rdx
test   %cl,%cl
je     112b <grskip+0x2b>
movb   $0x0,(%rdx)
ret
mov    %rdx,%rax
ret

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

LLVM IR (-O2):
define i8* @grskip(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = sext i8 %5 to i32
%8 = icmp eq i32 %7, %1
%9 = or i1 %6, %8
%10 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %9, label %11, label %3
11: ; preds = %3
br i1 %6, label %13, label %12
12: ; preds = %11
store i8 0, i8* %4
br label %13
13: ; preds = %12, %11
%14 = phi i8* [ %10, %12 ], [ %4, %11 ]
ret i8* %14
}
void stress_dir_flock(const int dir_fd) { (void)dir_fd; }


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

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

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

LLVM IR (-O2):
define void @stress_dir_flock(i32 %0) {
ret void
}
void out2p(x, y) {
  writeop(x);
  wrc(' ');
  wrc('L');
  wrn(y);
  wrc(' ');
}


x86 assembly (clang, -O0):
<out2p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <writeop@plt>
mov    $0x20,%edi
mov    $0x0,%al
call   1030 <wrc@plt>
mov    $0x4c,%edi
mov    $0x0,%al
call   1030 <wrc@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1050 <wrn@plt>
mov    $0x20,%edi
mov    $0x0,%al
call   1030 <wrc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out2p>:
push   %rbx
mov    %esi,%ebx
xor    %eax,%eax
call   1040 <writeop@plt>
mov    $0x20,%edi
xor    %eax,%eax
call   1030 <wrc@plt>
mov    $0x4c,%edi
xor    %eax,%eax
call   1030 <wrc@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1050 <wrn@plt>
mov    $0x20,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <wrc@plt>

LLVM IR (-O0):
define void @out2p(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 = call i32 (i32, ...) bitcast (i32 (...)* @writeop to i32 (i32, ...)*)(i32 %5)
%7 = call i32 (i32, ...) bitcast (i32 (...)* @wrc to i32 (i32, ...)*)(i32 32)
%8 = call i32 (i32, ...) bitcast (i32 (...)* @wrc to i32 (i32, ...)*)(i32 76)
%9 = load i32, i32* %4
%10 = call i32 (i32, ...) bitcast (i32 (...)* @wrn to i32 (i32, ...)*)(i32 %9)
%11 = call i32 (i32, ...) bitcast (i32 (...)* @wrc to i32 (i32, ...)*)(i32 32)
ret void
}

LLVM IR (-O2):
define void @out2p(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @writeop to i32 (i32, ...)*)(i32 %0)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @wrc to i32 (i32, ...)*)(i32 32)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @wrc to i32 (i32, ...)*)(i32 76)
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @wrn to i32 (i32, ...)*)(i32 %1)
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @wrc to i32 (i32, ...)*)(i32 32)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ double_unlock_bad(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_init(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
void double_unlock_bad2() {
  pthread_mutex_t m;
  pthread_mutex_init(&m, 0);
  pthread_mutex_lock(&m);
  double_unlock_bad(&m);
}


x86 assembly (clang, -O0):
<double_unlock_bad2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
xor    %esi,%esi
call   1040 <pthread_mutex_init@plt>
lea    -0x4(%rbp),%rdi
call   1050 <pthread_mutex_lock@plt>
lea    -0x4(%rbp),%rdi
call   1030 <double_unlock_bad@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_unlock_bad2>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <pthread_mutex_init@plt>
mov    %rbx,%rdi
call   1050 <pthread_mutex_lock@plt>
mov    %rbx,%rdi
call   1030 <double_unlock_bad@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @double_unlock_bad2() {
%1 = alloca i32
%2 = call i32 @pthread_mutex_init(i32* %1, i32 0)
%3 = call i32 @pthread_mutex_lock(i32* %1)
%4 = call i32 @double_unlock_bad(i32* %1)
ret void
}

LLVM IR (-O2):
define void @double_unlock_bad2() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @pthread_mutex_init(i32* %1, i32 0)
%4 = call i32 @pthread_mutex_lock(i32* %1)
%5 = call i32 @double_unlock_bad(i32* %1)
ret void
}
/* Type definitions */
struct group {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
struct group *getgrent();
struct group *fgetgrent(FILE *f) {
  return getgrent();
}


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

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

LLVM IR (-O0):
%struct.group = type { i32 }
define %struct.group* @fgetgrent(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call %struct.group* (...) @getgrent()
ret %struct.group* %3
}

LLVM IR (-O2):
%struct.group = type { i32 }
define %struct.group* @fgetgrent(i32* nocapture readnone %0) {
%2 = tail call %struct.group* (...) @getgrent()
ret %struct.group* %2
}
OP(dd, ec) {
  illegal_1();
  op_ec();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_ec@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_ec@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_ec()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_ec()
ret i32 undef
}
double epj2epb(epoch)
double epoch;
{
  double dj;
  dj = epj2jd(epoch);
  return (jd2epb(dj));
}


x86 assembly (clang, -O0):
<epj2epb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1030 <epj2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1040 <jd2epb@plt>
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epj2epb>:
push   %rax
mov    $0x1,%al
call   1030 <epj2jd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    $0x1,%al
call   1040 <jd2epb@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @epj2epb(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 (double, ...) bitcast (i32 (...)* @epj2jd to i32 (double, ...)*)(double %4)
%6 = sitofp i32 %5 to double
store double %6, double* %3
%7 = load double, double* %3
%8 = call i32 (double, ...) bitcast (i32 (...)* @jd2epb to i32 (double, ...)*)(double %7)
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @epj2epb(double %0) {
%2 = tail call i32 (double, ...) bitcast (i32 (...)* @epj2jd to i32 (double, ...)*)(double %0)
%3 = sitofp i32 %2 to double
%4 = tail call i32 (double, ...) bitcast (i32 (...)* @jd2epb to i32 (double, ...)*)(double %3)
%5 = sitofp i32 %4 to double
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ INT32_MAX;
int /*<<< orphan*/ INT32_MIN;
int32_t abs_i32(int32_t i) {
  if (i == INT32_MIN) {
    return INT32_MAX;
  } else {
    return i >= 0 ? i : -i;
  }
}


x86 assembly (clang, -O0):
<abs_i32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ec7(%rip),%rcx
cmp    (%rcx),%eax
jne    112a <abs_i32+0x2a>
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    114d <abs_i32+0x4d>
cmpl   $0x0,-0x8(%rbp)
jl     113f <abs_i32+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <abs_i32+0x47>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_i32>:
mov    0x2ed1(%rip),%rcx
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
cmp    %edi,(%rcx)
jne    111b <abs_i32+0x1b>
mov    0x2ec7(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@INT32_MIN = global i32 0
@INT32_MAX = global i32 0
define i32 @abs_i32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @INT32_MIN
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* @INT32_MAX
store i32 %8, i32* %2
br label %19
9: ; preds = %1
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = load i32, i32* %3
br label %17
14: ; preds = %9
%15 = load i32, i32* %3
%16 = sub nsw i32 0, %15
br label %17
17: ; preds = %14, %12
%18 = phi i32 [ %13, %12 ], [ %16, %14 ]
store i32 %18, i32* %2
br label %19
19: ; preds = %17, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@INT32_MIN = global i32 0
@INT32_MAX = global i32 0
define i32 @abs_i32(i32 %0) {
%2 = load i32, i32* @INT32_MIN
%3 = icmp eq i32 %2, %0
%4 = load i32, i32* @INT32_MAX
%5 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
/* Variables and functions */
char *skipBlank(char *);
char *skipSharp(char *);
char *skipWord(char *);
char *getPragmaStr(char *p) {
  return skipBlank(skipWord(skipBlank(skipSharp(skipBlank(p)))));
}


x86 assembly (clang, -O0):
<getPragmaStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <skipBlank@plt>
mov    %rax,%rdi
call   1030 <skipSharp@plt>
mov    %rax,%rdi
call   1050 <skipBlank@plt>
mov    %rax,%rdi
call   1040 <skipWord@plt>
mov    %rax,%rdi
call   1050 <skipBlank@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPragmaStr>:
push   %rax
call   1050 <skipBlank@plt>
mov    %rax,%rdi
call   1030 <skipSharp@plt>
mov    %rax,%rdi
call   1050 <skipBlank@plt>
mov    %rax,%rdi
call   1040 <skipWord@plt>
mov    %rax,%rdi
pop    %rax
jmp    1050 <skipBlank@plt>

LLVM IR (-O0):
define i8* @getPragmaStr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @skipBlank(i8* %3)
%5 = call i8* @skipSharp(i8* %4)
%6 = call i8* @skipBlank(i8* %5)
%7 = call i8* @skipWord(i8* %6)
%8 = call i8* @skipBlank(i8* %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @getPragmaStr(i8* %0) {
%2 = tail call i8* @skipBlank(i8* %0)
%3 = tail call i8* @skipSharp(i8* %2)
%4 = tail call i8* @skipBlank(i8* %3)
%5 = tail call i8* @skipWord(i8* %4)
%6 = tail call i8* @skipBlank(i8* %5)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *);
int system(char *);
int open_mht(const char *path) {
  char cmd[256] = {'\0'};
  sprintf(cmd, "/usr/bin/firefox \"%s\"", path);
  return system(cmd);
}


x86 assembly (clang, -O0):
<open_mht>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe9c(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <system@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_mht>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rdx
xorps  %xmm0,%xmm0
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xe64(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"/usr/bin/firefox \22%s\22\00"
define i32 @open_mht(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
store i8* %0, i8** %2
%4 = bitcast [256 x i8]* %3 to i8*
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%9 = call i32 @system(i8* %8)
ret i32 %9
}

LLVM IR (-O2):
@.str = [22 x i8] c"/usr/bin/firefox \22%s\22\00"
define i32 @open_mht(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @system(i8* %3)
ret i32 %5
}
int lchild(int n) { return (2 * n) + 1; }


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

x86 assembly (clang, -O2):
<lchild>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @lchild(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int twoToThePowerOf(int);
int leftShift(int n, int b) {
  if (b < 31)
    return n * twoToThePowerOf(b);
  else if (b == 31)
    return n * twoToThePowerOf(30) * 2;
  else
    return 0;
}


x86 assembly (clang, -O0):
<leftShift>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1f,-0xc(%rbp)
jge    1146 <leftShift+0x36>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <twoToThePowerOf@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <leftShift+0x6a>
cmpl   $0x1f,-0xc(%rbp)
jne    1173 <leftShift+0x63>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x1e,%edi
call   1030 <twoToThePowerOf@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   %ecx,%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <leftShift+0x6a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leftShift>:
push   %rbx
mov    %edi,%ebx
cmp    $0x1e,%esi
jg     1124 <leftShift+0x14>
mov    %esi,%edi
call   1030 <twoToThePowerOf@plt>
imul   %ebx,%eax
pop    %rbx
ret
xor    %eax,%eax
cmp    $0x1f,%esi
jne    113c <leftShift+0x2c>
mov    $0x1e,%edi
call   1030 <twoToThePowerOf@plt>
imul   %eax,%ebx
add    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @leftShift(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp slt i32 %6, 31
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @twoToThePowerOf(i32 %10)
%12 = mul nsw i32 %9, %11
store i32 %12, i32* %3
br label %22
13: ; preds = %2
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 31
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load i32, i32* %4
%18 = call i32 @twoToThePowerOf(i32 30)
%19 = mul nsw i32 %17, %18
%20 = mul nsw i32 %19, 2
store i32 %20, i32* %3
br label %22
21: ; preds = %13
store i32 0, i32* %3
br label %22
22: ; preds = %21, %16, %8
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @leftShift(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 31
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @twoToThePowerOf(i32 %1)
%6 = mul nsw i32 %5, %0
br label %13
7: ; preds = %2
%8 = icmp eq i32 %1, 31
br i1 %8, label %9, label %13
9: ; preds = %7
%10 = tail call i32 @twoToThePowerOf(i32 30)
%11 = shl i32 %0, 1
%12 = mul i32 %11, %10
br label %13
13: ; preds = %7, %9, %4
%14 = phi i32 [ %6, %4 ], [ %12, %9 ], [ 0, %7 ]
ret i32 %14
}
void gennotcompiled() {}


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

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

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

LLVM IR (-O2):
define void @gennotcompiled() {
ret void
}
int thaw_process(struct task_struct *p) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define i32 @thaw_process(%struct.task_struct* nocapture readnone %0) {
ret i32 1
}
int cairo_code_draw_casTitleLabel_get_width() { return 131; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casTitleLabel_get_width() {
ret i32 131
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casTitleLabel_get_width() {
ret i32 131
}