xunge/DecIR huggingface dataset:
double *calc_host(int datasize, double *data1, double *data2, double *result) {
  ;
}


x86 assembly (clang, -O0):
<calc_host>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias double* @calc_host(i32 %0, double* nocapture readnone %1, double* nocapture readnone %2, double* nocapture readnone %3) {
ret double* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ atomic_int;

/* Variables and functions */
_Bool atomic_compare_exchange_strong(int /*<<< orphan*/ *, int *, int);
_Bool fi4c(atomic_int *i) {
  int cmp = 0;
  return atomic_compare_exchange_strong(i, &cmp, 1);
}


x86 assembly (clang, -O0):
<fi4c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x1,%edx
call   1030 <atomic_compare_exchange_strong@plt>
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fi4c>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <atomic_compare_exchange_strong@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i1 @fi4c(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%4 = load i32*, i32** %2
%5 = call zeroext i1 @atomic_compare_exchange_strong(i32* %4, i32* %3, i32 1)
ret i1 %5
}

LLVM IR (-O2):
define zeroext i1 @fi4c(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call zeroext i1 @atomic_compare_exchange_strong(i32* %0, i32* %2, i32 1)
ret i1 %4
}
/* Type definitions */
struct pkg_option {
  int dummy;
};

/* Variables and functions */
int getopt_internal(int, char *const *, char const *, struct pkg_option const *,
                    int *, int);
int pkg_getopt_long(int nargc, char *const *nargv, const char *options,
                    const struct pkg_option *long_options, int *idx) {
  return (getopt_internal(nargc, nargv, options, long_options, idx, 0x01));
}


x86 assembly (clang, -O0):
<pkg_getopt_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x1,%r9d
call   1030 <getopt_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pkg_getopt_long>:
mov    $0x1,%r9d
jmp    1030 <getopt_internal@plt>

LLVM IR (-O0):
%struct.pkg_option = type { i32 }
define i32 @pkg_getopt_long(i32 %0, i8** %1, i8* %2, %struct.pkg_option* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca %struct.pkg_option*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store %struct.pkg_option* %3, %struct.pkg_option** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = load %struct.pkg_option*, %struct.pkg_option** %9
%15 = load i32*, i32** %10
%16 = call i32 @getopt_internal(i32 %11, i8** %12, i8* %13, %struct.pkg_option* %14, i32* %15, i32 1)
ret i32 %16
}

LLVM IR (-O2):
%struct.pkg_option = type { i32 }
define i32 @pkg_getopt_long(i32 %0, i8** %1, i8* %2, %struct.pkg_option* %3, i32* %4) {
%6 = tail call i32 @getopt_internal(i32 %0, i8** %1, i8* %2, %struct.pkg_option* %3, i32* %4, i32 1)
ret i32 %6
}
unsigned int hard_bsr(unsigned int n) {
  unsigned long r;
  __asm__ __volatile__("bsr %1,%0" : "=r"(r) : "rm"(n));
  return r;
}


x86 assembly (clang, -O0):
<hard_bsr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
bsr    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @hard_bsr(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 asm sideeffect "bsr $1,$0", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
int queue__close(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @queue__close() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/
UPnPResponse_ConnectionManager_GetProtocolInfo(void *, char *, char *);
int /*<<< orphan*/ printf(char *);
void UPnPConnectionManager_GetProtocolInfo(void *upnptoken) {
  printf("Invoke: UPnPConnectionManager_GetProtocolInfo();\r\n");
  UPnPResponse_ConnectionManager_GetProtocolInfo(upnptoken, "Sample String",
                                                 "Sample String");
}


x86 assembly (clang, -O0):
<UPnPConnectionManager_GetProtocolInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xef0(%rip),%rdx
mov    %rdx,%rsi
call   1040 <UPnPResponse_ConnectionManager_GetProtocolInfo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPConnectionManager_GetProtocolInfo>:
push   %rbx
mov    %rdi,%rbx
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdx
mov    %rbx,%rdi
mov    %rdx,%rsi
pop    %rbx
jmp    1040 <UPnPResponse_ConnectionManager_GetProtocolInfo@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"Invoke: UPnPConnectionManager_GetProtocolInfo();\0D\0A\00"
@.str.1 = [14 x i8] c"Sample String\00"
define void @UPnPConnectionManager_GetProtocolInfo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @UPnPResponse_ConnectionManager_GetProtocolInfo(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"Sample String\00"
@str = [50 x i8] c"Invoke: UPnPConnectionManager_GetProtocolInfo();\0D\00"
define void @UPnPConnectionManager_GetProtocolInfo(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @UPnPResponse_ConnectionManager_GetProtocolInfo(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void delay_ms(int ms) {
  timer0_reset();
  timer0_start();
  while (timer0_get_ms() < ms) {
    asm volatile("NOP");
  }
  timer0_stop();
}


x86 assembly (clang, -O0):
<delay_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <timer0_reset@plt>
mov    $0x0,%al
call   1060 <timer0_start@plt>
mov    $0x0,%al
call   1040 <timer0_get_ms@plt>
cmp    -0x4(%rbp),%eax
jge    116f <delay_ms+0x2f>
nop
jmp    1159 <delay_ms+0x19>
mov    $0x0,%al
call   1030 <timer0_stop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_ms>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <timer0_reset@plt>
xor    %eax,%eax
call   1060 <timer0_start@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <timer0_get_ms@plt>
cmp    %ebx,%eax
jge    116e <delay_ms+0x2e>
nop
jmp    1160 <delay_ms+0x20>
xor    %eax,%eax
pop    %rbx
jmp    1030 <timer0_stop@plt>

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

LLVM IR (-O2):
define void @delay_ms(i32 %0) {
%2 = tail call i32 (...) @timer0_reset()
%3 = tail call i32 (...) @timer0_start()
%4 = tail call i32 (...) @timer0_get_ms()
%5 = icmp slt i32 %4, %0
br i1 %5, label %6, label %9
6: ; preds = %1, %6
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
%7 = tail call i32 (...) @timer0_get_ms()
%8 = icmp slt i32 %7, %0
br i1 %8, label %6, label %9
9: ; preds = %6, %1
%10 = tail call i32 (...) @timer0_stop()
ret void
}
void gtk_toggle_button_get_active() {}


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

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

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

LLVM IR (-O2):
define void @gtk_toggle_button_get_active() {
ret void
}
double test_erf(double x) { return __builtin_erf(x); }


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

x86 assembly (clang, -O2):
<test_erf>:
jmp    1030 <erf@plt>

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

LLVM IR (-O2):
define double @test_erf(double %0) {
%2 = tail call double @erf(double %0)
ret double %2
}
int main() {
  for (;;)
    ;
  for (1; 2; 3) {
    return 4.0L;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    110b <main+0xb>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ Vector3NormSquared(float const *);
float sqrt(int /*<<< orphan*/);
float Vector3Norm(const float v[3]) { return sqrt(Vector3NormSquared(v)); }


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

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

LLVM IR (-O0):
define float @Vector3Norm(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = call i32 @Vector3NormSquared(float* %3)
%5 = call float @sqrt(i32 %4)
ret float %5
}

LLVM IR (-O2):
define float @Vector3Norm(float* %0) {
%2 = tail call i32 @Vector3NormSquared(float* %0)
%3 = tail call float @sqrt(i32 %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ tmll_all_selected_bits_set_1();
int /*<<< orphan*/ tmll_all_selected_bits_set_2();
int /*<<< orphan*/ tmll_mask_0();
int /*<<< orphan*/ tmll_some_selected_bits_set_msb_not_set();
int /*<<< orphan*/ tmll_some_selected_bits_set_msb_set();
int /*<<< orphan*/ tmll_value_0();
int main() {
  tmll_mask_0();
  tmll_value_0();
  tmll_all_selected_bits_set_1();
  tmll_all_selected_bits_set_2();
  tmll_some_selected_bits_set_msb_set();
  tmll_some_selected_bits_set_msb_not_set();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <tmll_mask_0@plt>
mov    $0x0,%al
call   1070 <tmll_value_0@plt>
mov    $0x0,%al
call   1080 <tmll_all_selected_bits_set_1@plt>
mov    $0x0,%al
call   1040 <tmll_all_selected_bits_set_2@plt>
mov    $0x0,%al
call   1060 <tmll_some_selected_bits_set_msb_set@plt>
mov    $0x0,%al
call   1030 <tmll_some_selected_bits_set_msb_not_set@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <tmll_mask_0@plt>
xor    %eax,%eax
call   1070 <tmll_value_0@plt>
xor    %eax,%eax
call   1080 <tmll_all_selected_bits_set_1@plt>
xor    %eax,%eax
call   1040 <tmll_all_selected_bits_set_2@plt>
xor    %eax,%eax
call   1060 <tmll_some_selected_bits_set_msb_set@plt>
xor    %eax,%eax
call   1030 <tmll_some_selected_bits_set_msb_not_set@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @tmll_mask_0()
%3 = call i32 (...) @tmll_value_0()
%4 = call i32 (...) @tmll_all_selected_bits_set_1()
%5 = call i32 (...) @tmll_all_selected_bits_set_2()
%6 = call i32 (...) @tmll_some_selected_bits_set_msb_set()
%7 = call i32 (...) @tmll_some_selected_bits_set_msb_not_set()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @tmll_mask_0()
%2 = tail call i32 (...) @tmll_value_0()
%3 = tail call i32 (...) @tmll_all_selected_bits_set_1()
%4 = tail call i32 (...) @tmll_all_selected_bits_set_2()
%5 = tail call i32 (...) @tmll_some_selected_bits_set_msb_set()
%6 = tail call i32 (...) @tmll_some_selected_bits_set_msb_not_set()
ret i32 0
}
void BeginDraw(void) { __asm__ __volatile__("int $0x40" ::"a"(12), "b"(1)); }


x86 assembly (clang, -O0):
<BeginDraw>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0xc,%eax
mov    $0x1,%ebx
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<BeginDraw>:
push   %rbx
mov    $0xc,%eax
mov    $0x1,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define void @BeginDraw() {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 12, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_evtimer();
int /*<<< orphan*/ test_operate_timer();
int main() {
  test_operate_timer();
  test_evtimer();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_operate_timer()
%2 = tail call i32 (...) @test_evtimer()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sw_beep_init();
int /*<<< orphan*/ sw_beep_off();
int /*<<< orphan*/ sw_beep_on();
int /*<<< orphan*/ sw_usleep(int);
int beeptest(int argc, char *argv[]) {
  sw_beep_init();
  while (1) {
    sw_beep_off();
    sw_usleep(1000 * 500);
    sw_beep_on();
    sw_usleep(1000 * 50);
  }
  return 0;
}


x86 assembly (clang, -O0):
<beeptest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <sw_beep_init@plt>
mov    $0x0,%al
call   1040 <sw_beep_off@plt>
mov    $0x7a120,%edi
call   1060 <sw_usleep@plt>
mov    $0x0,%al
call   1030 <sw_beep_on@plt>
mov    $0xc350,%edi
call   1060 <sw_usleep@plt>
jmp    1156 <beeptest+0x16>

x86 assembly (clang, -O2):
<beeptest>:
push   %rax
xor    %eax,%eax
call   1050 <sw_beep_init@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <sw_beep_off@plt>
mov    $0x7a120,%edi
call   1060 <sw_usleep@plt>
xor    %eax,%eax
call   1030 <sw_beep_on@plt>
mov    $0xc350,%edi
call   1060 <sw_usleep@plt>
jmp    1150 <beeptest+0x10>

LLVM IR (-O0):
define i32 @beeptest(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @sw_beep_init()
br label %6
6: ; preds = %2, %6
%7 = call i32 (...) @sw_beep_off()
%8 = call i32 @sw_usleep(i32 500000)
%9 = call i32 (...) @sw_beep_on()
%10 = call i32 @sw_usleep(i32 50000)
br label %6
}

LLVM IR (-O2):
define i32 @beeptest(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @sw_beep_init()
br label %4
4: ; preds = %2, %4
%5 = tail call i32 (...) @sw_beep_off()
%6 = tail call i32 @sw_usleep(i32 500000)
%7 = tail call i32 (...) @sw_beep_on()
%8 = tail call i32 @sw_usleep(i32 50000)
br label %4
}
void foo_2_2_1_1_1_1_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_1_1_1_2_1_1() {
ret void
}
extern double torad(double x) {
  x = fmod(x, 360.0);
  return ((x)*0.01745329251994329576);
}


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

x86 assembly (clang, -O2):
<torad>:
push   %rax
movsd  0xee7(%rip),%xmm1
call   1030 <fmod@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @torad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @fmod(double %3, double 3.600000e+02)
store double %4, double* %2
%5 = load double, double* %2
%6 = fmul double %5, 0x3F91DF46A2529D39
ret double %6
}

LLVM IR (-O2):
define double @torad(double %0) {
%2 = tail call double @fmod(double %0, double 3.600000e+02)
%3 = fmul double %2, 0x3F91DF46A2529D39
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void close_test_file(FILE *f) {
  fprintf(f, "    grid minor;\n");
  fprintf(f, "end;\n");
  fclose(f);
}


x86 assembly (clang, -O0):
<close_test_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xeca(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_test_file>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xecd(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [17 x i8] c" grid minor;\0A\00"
@.str.1 = [6 x i8] c"end;\0A\00"
define void @close_test_file(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32*, i32** %2
%8 = call i32 @fclose(i32* %7)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c" grid minor;\0A\00"
@.str.1 = [6 x i8] c"end;\0A\00"
define void @close_test_file(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 16, i64 1, i32* %0)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 5, i64 1, i32* %0)
%4 = tail call i32 @fclose(i32* %0)
ret void
}
int mod(int x, int y) { return (x % y); }


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @mod(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 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int cpuid_simple(int);
scalar_t__ cpuid_support_extended(int);
int cpuinfo_has_3dnow() {
  return cpuid_support_extended(0x80000001) &&
         (cpuid_simple(0x80000001) & 0x80000000);
}


x86 assembly (clang, -O0):
<cpuinfo_has_3dnow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x80000001,%edi
call   1040 <cpuid_support_extended@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     115c <cpuinfo_has_3dnow+0x3c>
mov    $0x80000001,%edi
call   1030 <cpuid_simple@plt>
and    $0x80000000,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuinfo_has_3dnow>:
push   %rax
mov    $0x80000001,%edi
call   1040 <cpuid_support_extended@plt>
test   %rax,%rax
je     113f <cpuinfo_has_3dnow+0x1f>
mov    $0x80000001,%edi
call   1030 <cpuid_simple@plt>
shr    $0x1f,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cpuinfo_has_3dnow() {
%1 = call i64 @cpuid_support_extended(i32 -2147483647)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = call i32 @cpuid_simple(i32 -2147483647)
%5 = and i32 %4, -2147483648
%6 = icmp ne i32 %5, 0
br label %7
7: ; preds = %3, %0
%8 = phi i1 [ false, %0 ], [ %6, %3 ]
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @cpuinfo_has_3dnow() {
%1 = tail call i64 @cpuid_support_extended(i32 -2147483647)
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @cpuid_simple(i32 -2147483647)
%5 = lshr i32 %4, 31
br label %6
6: ; preds = %3, %0
%7 = phi i32 [ 0, %0 ], [ %5, %3 ]
ret i32 %7
}
void ptrace_sandbox_permit_fd_stats(struct pt_sandbox *p_sandbox) {
  (void)p_sandbox;
}


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

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

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

LLVM IR (-O2):
%struct.pt_sandbox = type opaque
define void @ptrace_sandbox_permit_fd_stats(%struct.pt_sandbox* nocapture %0) {
ret void
}
void shutdown_network() {}


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

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

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

LLVM IR (-O2):
define void @shutdown_network() {
ret void
}
/* Variables and functions */
float __ocml_tan_f32(float);
float __tanf(float x) { return __ocml_tan_f32(x); }


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

x86 assembly (clang, -O2):
<__tanf>:
jmp    1030 <__ocml_tan_f32@plt>

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

LLVM IR (-O2):
define float @__tanf(float %0) {
%2 = tail call float @__ocml_tan_f32(float %0)
ret float %2
}
/* Variables and functions */
long square(int /*<<< orphan*/);
int /*<<< orphan*/ sum(long);
long int square_of_sums(long int m) { return square(sum(m)); }


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

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

LLVM IR (-O0):
define i64 @square_of_sums(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @sum(i64 %3)
%5 = call i64 @square(i32 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @square_of_sums(i64 %0) {
%2 = tail call i32 @sum(i64 %0)
%3 = tail call i64 @square(i32 %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void system_free(void *allocator_data, void *data) {
  (void)allocator_data;
  if (data)
    free(data);
}


x86 assembly (clang, -O0):
<system_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1134 <system_free+0x24>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<system_free>:
test   %rsi,%rsi
je     111d <system_free+0xd>
mov    %rsi,%rdi
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @system_free(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call i32 @free(i8* %9)
br label %11
11: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @system_free(i8* nocapture readnone %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int readrand(int, int, int, int *);
void R_readrand(int *numWanted, int *maxTries, int *sleepInt, int *numRead,
                int result[]) {
  *numRead = readrand(*numWanted, *maxTries, *sleepInt, result);
}


x86 assembly (clang, -O0):
<R_readrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x28(%rbp),%rcx
call   1030 <readrand@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<R_readrand>:
push   %rbx
mov    %rcx,%rbx
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    (%rdx),%edx
mov    %r8,%rcx
call   1030 <readrand@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @R_readrand(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture writeonly %3, i32* %4) {
%6 = load i32, i32* %0
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = tail call i32 @readrand(i32 %6, i32 %7, i32 %8, i32* %4)
store i32 %9, i32* %3
ret void
}
/* Variables and functions */
scalar_t__ event_playback_active();
int /*<<< orphan*/ keyboard_key_clear_internal();
scalar_t__ network_connected();
int /*<<< orphan*/ network_event_record(int, int /*<<< orphan*/ *,
                                        int /*<<< orphan*/);
void keyboard_key_clear(void) {
  if (event_playback_active()) {
    return;
  }
  if (network_connected()) {
    network_event_record(15, NULL, 0);
    return;
  }
  keyboard_key_clear_internal();
}


x86 assembly (clang, -O0):
<keyboard_key_clear>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <event_playback_active@plt>
cmp    $0x0,%rax
je     115a <keyboard_key_clear+0x1a>
jmp    1187 <keyboard_key_clear+0x47>
mov    $0x0,%al
call   1050 <network_connected@plt>
cmp    $0x0,%rax
je     1180 <keyboard_key_clear+0x40>
mov    $0xf,%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <network_event_record@plt>
jmp    1187 <keyboard_key_clear+0x47>
mov    $0x0,%al
call   1060 <keyboard_key_clear_internal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard_key_clear>:
push   %rax
xor    %eax,%eax
call   1040 <event_playback_active@plt>
test   %rax,%rax
je     114f <keyboard_key_clear+0xf>
pop    %rax
ret
xor    %eax,%eax
call   1050 <network_connected@plt>
test   %rax,%rax
je     116a <keyboard_key_clear+0x2a>
mov    $0xf,%edi
xor    %esi,%esi
xor    %edx,%edx
pop    %rax
jmp    1030 <network_event_record@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <keyboard_key_clear_internal@plt>

LLVM IR (-O0):
define void @keyboard_key_clear() {
%1 = call i64 (...) @event_playback_active()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
br label %11
4: ; preds = %0
%5 = call i64 (...) @network_connected()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = call i32 @network_event_record(i32 15, i32* null, i32 0)
br label %11
9: ; preds = %4
%10 = call i32 (...) @keyboard_key_clear_internal()
br label %11
11: ; preds = %9, %7, %3
ret void
}

LLVM IR (-O2):
define void @keyboard_key_clear() {
%1 = tail call i64 (...) @event_playback_active()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i64 (...) @network_connected()
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @network_event_record(i32 15, i32* null, i32 0)
br label %10
8: ; preds = %3
%9 = tail call i32 (...) @keyboard_key_clear_internal()
br label %10
10: ; preds = %0, %8, %6
ret void
}
/* Variables and functions */
scalar_t__ chmod(char const *, int);
int strtol(char *, int /*<<< orphan*/, int);
int XPath_SetPerm(const char *pPath, char mode[]) {
  int i = strtol(mode, 0, 8);
  if (chmod(pPath, i) < 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<XPath_SetPerm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <strtol@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <chmod@plt>
cmp    $0x0,%rax
jge    1165 <XPath_SetPerm+0x45>
movl   $0x0,-0x4(%rbp)
jmp    116c <XPath_SetPerm+0x4c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XPath_SetPerm>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <strtol@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <chmod@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @XPath_SetPerm(i8* nocapture %0, i8* %1) {
%3 = tail call i32 @strtol(i8* %1, i32 0, i32 8)
%4 = tail call i64 @chmod(i8* %0, i32 %3)
%5 = lshr i64 %4, 63
%6 = trunc i64 %5 to i32
%7 = xor i32 %6, 1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ShellPrintf(char *);
int /*<<< orphan*/ ShellPutByte(int);
void ShellAllClear(void) {
  ShellPutByte(0x1b);
  ShellPrintf("c");
  ShellPutByte(0x1b);
  ShellPrintf("[m");
  ShellPutByte(0x1b);
  ShellPrintf("[2J\n\r\r\r\r\r\r\r");
}


x86 assembly (clang, -O0):
<ShellAllClear>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
call   1030 <ShellPutByte@plt>
lea    0xecb(%rip),%rdi
call   1040 <ShellPrintf@plt>
mov    $0x1b,%edi
call   1030 <ShellPutByte@plt>
lea    0xeb7(%rip),%rdi
call   1040 <ShellPrintf@plt>
mov    $0x1b,%edi
call   1030 <ShellPutByte@plt>
lea    0xea4(%rip),%rdi
call   1040 <ShellPrintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShellAllClear>:
push   %rax
mov    $0x1b,%edi
call   1030 <ShellPutByte@plt>
lea    0xece(%rip),%rdi
call   1040 <ShellPrintf@plt>
mov    $0x1b,%edi
call   1030 <ShellPutByte@plt>
lea    0xeba(%rip),%rdi
call   1040 <ShellPrintf@plt>
mov    $0x1b,%edi
call   1030 <ShellPutByte@plt>
lea    0xea7(%rip),%rdi
pop    %rax
jmp    1040 <ShellPrintf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"c\00"
@.str.1 = [3 x i8] c"[m\00"
@.str.2 = [12 x i8] c"[2J\0A\0D\0D\0D\0D\0D\0D\0D\00"
define void @ShellAllClear() {
%1 = call i32 @ShellPutByte(i32 27)
%2 = call i32 @ShellPrintf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @ShellPutByte(i32 27)
%4 = call i32 @ShellPrintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @ShellPutByte(i32 27)
%6 = call i32 @ShellPrintf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"c\00"
@.str.1 = [3 x i8] c"[m\00"
@.str.2 = [12 x i8] c"[2J\0A\0D\0D\0D\0D\0D\0D\0D\00"
define void @ShellAllClear() {
%1 = tail call i32 @ShellPutByte(i32 27)
%2 = tail call i32 @ShellPrintf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @ShellPutByte(i32 27)
%4 = tail call i32 @ShellPrintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @ShellPutByte(i32 27)
%6 = tail call i32 @ShellPrintf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void foo506() {}


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

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

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

LLVM IR (-O2):
define void @foo506() {
ret void
}
int sys$search(struct _fab *fab, void *err, void *suc) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(suc);
    register long int _a2 asm("rsi") = (long)(err);
    register long int _a1 asm("rdi") = (long)(fab);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x82\n\t"
                 : "=a"(resultvar)
                 : "i"(24), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x18,%rax
int    $0x82
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$search>:
mov    $0x18,%rax
int    $0x82
ret

LLVM IR (-O0):
%struct._fab = type opaque
define i32 @"sys$search"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca %struct._fab*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store %struct._fab* %0, %struct._fab** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%12 = load i8*, i8** %6
%13 = ptrtoint i8* %12 to i64
store i64 %13, i64* %8
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
store i64 %15, i64* %9
%16 = load %struct._fab*, %struct._fab** %4
%17 = ptrtoint %struct._fab* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 24, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct._fab = type opaque
define i32 @"sys$search"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint %struct._fab* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 24, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
unsigned int nreg_calc_raw_hash(char const *);
scalar_t__ nreg_hash_exists(unsigned int);
unsigned int nreg_calc_hash(const char *name) {
  unsigned int hash = nreg_calc_raw_hash(name);
  while (nreg_hash_exists(hash))
    hash++;
  return hash;
}


x86 assembly (clang, -O0):
<nreg_calc_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <nreg_calc_raw_hash@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <nreg_hash_exists@plt>
cmp    $0x0,%rax
je     1158 <nreg_calc_hash+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <nreg_calc_hash+0x18>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nreg_calc_hash>:
push   %rbx
call   1030 <nreg_calc_raw_hash@plt>
mov    %eax,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1040 <nreg_hash_exists@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1130 <nreg_calc_hash+0x10>
add    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @nreg_calc_hash(i8* %0) {
%2 = tail call i32 @nreg_calc_raw_hash(i8* %0)
br label %3
3: ; preds = %3, %1
%4 = phi i32 [ %2, %1 ], [ %7, %3 ]
%5 = tail call i64 @nreg_hash_exists(i32 %4)
%6 = icmp eq i64 %5, 0
%7 = add i32 %4, 1
br i1 %6, label %8, label %3
8: ; preds = %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ tgui_ext_linear_writew(int /*<<< orphan*/,
                                          int /*<<< orphan*/, void *);
void tgui_ext_linear_writel(uint32_t addr, uint32_t val, void *p) {
  tgui_ext_linear_writew(addr, val, p);
}


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

x86 assembly (clang, -O2):
<tgui_ext_linear_writel>:
jmp    1030 <tgui_ext_linear_writew@plt>

LLVM IR (-O0):
define void @tgui_ext_linear_writel(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
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @tgui_ext_linear_writew(i32 %7, i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
define void @tgui_ext_linear_writel(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @tgui_ext_linear_writew(i32 %0, i32 %1, i8* %2)
ret void
}
/* Variables and functions */
void debug(const char *msg) {}


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

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

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

LLVM IR (-O2):
define void @debug(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ data(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  scanf("%i", &x);
  data(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <data@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <data@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @data(i32 %4)
ret i32 0
}
/* Variables and functions */
double sin(double);
double min_caml_sin(void *fv, double f) { return sin(f); }


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

x86 assembly (clang, -O2):
<min_caml_sin>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define double @min_caml_sin(i8* nocapture readnone %0, double %1) {
%3 = tail call double @sin(double %1)
ret double %3
}
/* Variables and functions */
int errno;
int send(int, void const *, int, int /*<<< orphan*/);
int os_send(int socket, const void *buffer, int length) {
  int retval;
  retval = send(socket, buffer, length, 0);
  if (retval == -1)
    retval = -errno;
  return retval;
}


x86 assembly (clang, -O0):
<os_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <send@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    114e <os_send+0x3e>
xor    %eax,%eax
mov    0x2e97(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_send>:
push   %rbx
xor    %ebx,%ebx
xor    %ecx,%ecx
call   1030 <send@plt>
mov    0x2ebf(%rip),%rcx
sub    (%rcx),%ebx
cmp    $0xffffffff,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @os_send(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @send(i32 %8, i8* %9, i32 %10, i32 0)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = load i32, i32* @errno
%16 = sub nsw i32 0, %15
store i32 %16, i32* %7
br label %17
17: ; preds = %14, %3
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @os_send(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %2, i32 0)
%5 = icmp eq i32 %4, -1
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 %7, i32 %4
ret i32 %8
}
void cond_ternary_update(const struct XCSF *xcsf, const struct Cl *c,
                         const double *x, const double *y) {
  (void)xcsf;
  (void)c;
  (void)x;
  (void)y;
}


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

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

LLVM IR (-O0):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @cond_ternary_update(%struct.XCSF* %0, %struct.Cl* %1, double* %2, double* %3) {
%5 = alloca %struct.XCSF*
%6 = alloca %struct.Cl*
%7 = alloca double*
%8 = alloca double*
store %struct.XCSF* %0, %struct.XCSF** %5
store %struct.Cl* %1, %struct.Cl** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load %struct.XCSF*, %struct.XCSF** %5
%10 = load %struct.Cl*, %struct.Cl** %6
%11 = load double*, double** %7
%12 = load double*, double** %8
ret void
}

LLVM IR (-O2):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @cond_ternary_update(%struct.XCSF* nocapture %0, %struct.Cl* nocapture %1, double* nocapture %2, double* nocapture %3) {
ret void
}
/* Variables and functions */
int PTHREAD_CANCEL_ASYNCHRONOUS;
int __libc_fsync(int);
int /*<<< orphan*/ pthread_setcanceltype(int, int *);
int __attribute__((weak)) fsync(int fd) {
  int result;
  int oldtype;
  pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
  result = __libc_fsync(fd);
  pthread_setcanceltype(oldtype, NULL);
  return result;
}


x86 assembly (clang, -O0):
<fsync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    -0xc(%rbp),%rsi
call   1040 <pthread_setcanceltype@plt>
mov    -0x4(%rbp),%edi
call   1030 <__libc_fsync@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_setcanceltype@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsync>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xc(%rsp),%rsi
call   1040 <pthread_setcanceltype@plt>
mov    %ebx,%edi
call   1030 <__libc_fsync@plt>
mov    %eax,%ebx
mov    0xc(%rsp),%edi
xor    %esi,%esi
call   1040 <pthread_setcanceltype@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
define weak i32 @fsync(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%6 = call i32 @pthread_setcanceltype(i32 %5, i32* %4)
%7 = load i32, i32* %2
%8 = call i32 @__libc_fsync(i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @pthread_setcanceltype(i32 %9, i32* null)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
define weak i32 @fsync(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%5 = call i32 @pthread_setcanceltype(i32 %4, i32* %2)
%6 = call i32 @__libc_fsync(i32 %0)
%7 = load i32, i32* %2
%8 = call i32 @pthread_setcanceltype(i32 %7, i32* null)
ret i32 %6
}