xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ mx_sleep(unsigned int);
int mx_sleep_nofail(unsigned int seconds) {
  mx_sleep(seconds);
  return 1;
}


x86 assembly (clang, -O0):
<mx_sleep_nofail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <mx_sleep@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mx_sleep_nofail>:
push   %rax
call   1030 <mx_sleep@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @mx_sleep_nofail(i32 %0) {
%2 = tail call i32 @mx_sleep(i32 %0)
ret i32 1
}
float powerHeuristic(float f, float g) { return f * f / (f * f + g * g); }


x86 assembly (clang, -O0):
<powerHeuristic>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm3
movss  -0x8(%rbp),%xmm2
mulss  -0x8(%rbp),%xmm2
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<powerHeuristic>:
mulss  %xmm0,%xmm0
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @powerHeuristic(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* %3
%7 = fmul float %5, %6
%8 = load float, float* %3
%9 = load float, float* %3
%10 = load float, float* %4
%11 = load float, float* %4
%12 = fmul float %10, %11
%13 = call float @llvm.fmuladd.f32(float %8, float %9, float %12)
%14 = fdiv float %7, %13
ret float %14
}

LLVM IR (-O2):
define float @powerHeuristic(float %0, float %1) {
%3 = fmul float %0, %0
%4 = fmul float %1, %1
%5 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %4)
%6 = fdiv float %3, %5
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void signal_handler(int signo) { printf("\nplease input exit to quit\n"); }


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [28 x i8] c"\0Aplease input exit to quit\0A\00"
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"\0Aplease input exit to quit\00"
define void @signal_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printXmlDigit(int *data, unsigned int offset, const char *name) {
  if (offset > 0) {
    printf("%*c", offset, ' ');
  }
  printf("<%s>%i</%s>\n", name, *data, name);
}


x86 assembly (clang, -O0):
<printXmlDigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jbe    1143 <printXmlDigit+0x33>
mov    -0xc(%rbp),%esi
lea    0xec9(%rip),%rdi
mov    $0x20,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rcx
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printXmlDigit>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
test   %esi,%esi
je     1131 <printXmlDigit+0x21>
lea    0xedb(%rip),%rdi
mov    $0x20,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%r14),%edx
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
mov    %rbx,%rcx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%*c\00"
@.str.1 = [13 x i8] c"<%s>%i</%s>\0A\00"
define void @printXmlDigit(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* %5
%8 = icmp ugt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i32, i32* %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10, i32 32)
br label %12
12: ; preds = %9, %3
%13 = load i8*, i8** %6
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = load i8*, i8** %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %13, i32 %15, i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%*c\00"
@.str.1 = [13 x i8] c"<%s>%i</%s>\0A\00"
define void @printXmlDigit(i32* nocapture %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1, i32 32)
br label %7
7: ; preds = %5, %3
%8 = load i32, i32* %0
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 %8, i8* %2)
ret void
}
/* Variables and functions */
char const *_dns_get_answered_ip(char const *, size_t, int);
const char *dns_get_answered_cnname(const char *rsp, size_t len) {
  return _dns_get_answered_ip(rsp, len, 5);
}


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

x86 assembly (clang, -O2):
<dns_get_answered_cnname>:
mov    $0x5,%edx
jmp    1030 <_dns_get_answered_ip@plt>

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

LLVM IR (-O2):
define i8* @dns_get_answered_cnname(i8* %0, i64 %1) {
%3 = tail call i8* @_dns_get_answered_ip(i8* %0, i64 %1, i32 5)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int update_crc16_ccitt_reversed(int, int /*<<< orphan*/ const *, size_t);
uint16_t crc16_ccitt_reversed(const uint8_t *data, size_t len) {
  return update_crc16_ccitt_reversed(0xFFFF, data, len) ^ 0xFFFF;
}


x86 assembly (clang, -O0):
<crc16_ccitt_reversed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0xffff,%edi
call   1030 <update_crc16_ccitt_reversed@plt>
xor    $0xffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc16_ccitt_reversed>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xffff,%edi
call   1030 <update_crc16_ccitt_reversed@plt>
xor    $0xffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @crc16_ccitt_reversed(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = call i32 @update_crc16_ccitt_reversed(i32 65535, i32* %5, i64 %6)
%8 = xor i32 %7, 65535
ret i32 %8
}

LLVM IR (-O2):
define i32 @crc16_ccitt_reversed(i32* %0, i64 %1) {
%3 = tail call i32 @update_crc16_ccitt_reversed(i32 65535, i32* %0, i64 %1)
%4 = xor i32 %3, 65535
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void warn_eof(void) {
  fprintf(stderr,
          "The \"eof\" command has been disabled.\n"
          "Use \"weof\" if you really want to write end-of-file marks,\n"
          "or \"eom\" if you rather want to skip to the end of "
          "recorded medium.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<warn_eof>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<warn_eof>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [163 x i8] c"The \22eof\22 command has been disabled.\0AUse \22weof\22 if you really want to write end-of-file marks,\0Aor \22eom\22 if you rather want to skip to the end of recorded medium.\0A\00"
define void @warn_eof() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [163 x i8] c"The \22eof\22 command has been disabled.\0AUse \22weof\22 if you really want to write end-of-file marks,\0Aor \22eom\22 if you rather want to skip to the end of recorded medium.\0A\00"
define void @warn_eof() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int do_signalfd(struct tcb *, int);
int sys_signalfd(struct tcb *tcp) { return do_signalfd(tcp, -1); }


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

x86 assembly (clang, -O2):
<sys_signalfd>:
mov    $0xffffffff,%esi
jmp    1030 <do_signalfd@plt>

LLVM IR (-O0):
%struct.tcb = type { i32 }
define i32 @sys_signalfd(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
%3 = load %struct.tcb*, %struct.tcb** %2
%4 = call i32 @do_signalfd(%struct.tcb* %3, i32 -1)
ret i32 %4
}

LLVM IR (-O2):
%struct.tcb = type { i32 }
define i32 @sys_signalfd(%struct.tcb* %0) {
%2 = tail call i32 @do_signalfd(%struct.tcb* %0, i32 -1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ gfx_set_display_video_yuv_pitch(unsigned long,
                                                   unsigned long);
int redcloud_set_video_yuv_pitch(unsigned long ypitch, unsigned long uvpitch) {
  gfx_set_display_video_yuv_pitch(ypitch, uvpitch);
  return (0);
}


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

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

LLVM IR (-O0):
define i32 @redcloud_set_video_yuv_pitch(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i32 @gfx_set_display_video_yuv_pitch(i64 %5, i64 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @redcloud_set_video_yuv_pitch(i64 %0, i64 %1) {
%3 = tail call i32 @gfx_set_display_video_yuv_pitch(i64 %0, i64 %1)
ret i32 0
}
void placer_navires_com() {}


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

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

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

LLVM IR (-O2):
define void @placer_navires_com() {
ret void
}
/* Variables and functions */
double M_PI;
double degree(double radian) { return radian * 180.0 / M_PI; }


x86 assembly (clang, -O0):
<degree>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    0x2ecb(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<degree>:
mulsd  0xef8(%rip),%xmm0
mov    0x2ed9(%rip),%rax
divsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @degree(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.800000e+02
%5 = load double, double* @M_PI
%6 = fdiv double %4, %5
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @degree(double %0) {
%2 = fmul double %0, 1.800000e+02
%3 = load double, double* @M_PI
%4 = fdiv double %2, %3
ret double %4
}
__attribute__((destructor)) void hardware_rand64_fini(void) {}


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

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

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @hardware_rand64_fini, i8* null }]
define void @hardware_rand64_fini() {
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @hardware_rand64_fini, i8* null }]
define void @hardware_rand64_fini() {
ret void
}
void g_DUMMY_menu_select_popup(int menu_id) { menu_id = menu_id; }


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

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

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

LLVM IR (-O2):
define void @g_DUMMY_menu_select_popup(i32 %0) {
ret void
}
char *movstr(a, b)
register char *a, *b;
{
  while (*b++ = *a++)
    ;
  return (--b);
}


x86 assembly (clang, -O0):
<movstr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <movstr+0x3b>
jmp    110c <movstr+0xc>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<movstr>:
mov    %rsi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %cl,0x1(%rax)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <movstr+0x10>
ret

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

LLVM IR (-O2):
define i8* @movstr(i8* nocapture %0, i8* writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %6, %3 ]
%5 = phi i8* [ %1, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %5
}
void ScaleRowDown34_0_Box_16_C() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown34_0_Box_16_C() {
ret void
}
float fastneg(const float f) {
  int i = ((*(int *)&f) ^ 0x80000000);
  return (*(float *)&i);
}


x86 assembly (clang, -O0):
<fastneg>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x80000000,%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastneg>:
xorps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define float @fastneg(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = bitcast float* %2 to i32*
%5 = load i32, i32* %4
%6 = xor i32 %5, -2147483648
store i32 %6, i32* %3
%7 = bitcast i32* %3 to float*
%8 = load float, float* %7
ret float %8
}

LLVM IR (-O2):
define float @fastneg(float %0) {
%2 = bitcast float %0 to i32
%3 = xor i32 %2, -2147483648
%4 = bitcast i32 %3 to float
ret float %4
}
void msvcrt_dllonexit(void *arg1, void *arg2) { ; }


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

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

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

LLVM IR (-O2):
define void @msvcrt_dllonexit(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int my_sort_func(const void *p1, const void *p2) {
  int v1 = *((int *)p1);
  int v2 = *((int *)p2);
  if (v1 < v2) {
    return -1;
  } else if (v1 > v2) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<my_sort_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <my_sort_func+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <my_sort_func+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    114e <my_sort_func+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <my_sort_func+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_sort_func>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @my_sort_func(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
char *malloc_wrap(size_t const);
int strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t const);
char *strdup_wrap(const char *str, const char *file, unsigned int line) {
  const size_t len = strlen(str) + 1;
  char *p = malloc_wrap(len);
  strncpy(p, str, len);
  return p;
}


x86 assembly (clang, -O0):
<strdup_wrap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <malloc_wrap@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup_wrap>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc_wrap@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strdup_wrap(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = add nsw i32 %10, 1
%12 = sext i32 %11 to i64
store i64 %12, i64* %7
%13 = load i64, i64* %7
%14 = call i8* @malloc_wrap(i64 %13)
store i8* %14, i8** %8
%15 = load i8*, i8** %8
%16 = load i8*, i8** %4
%17 = load i64, i64* %7
%18 = call i32 @strncpy(i8* %15, i8* %16, i64 %17)
%19 = load i8*, i8** %8
ret i8* %19
}

LLVM IR (-O2):
define i8* @strdup_wrap(i8* %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = sext i32 %5 to i64
%7 = tail call i8* @malloc_wrap(i64 %6)
%8 = tail call i32 @strncpy(i8* %7, i8* %0, i64 %6)
ret i8* %7
}
/* Variables and functions */
int syscall(int, char const *, char const *);
int lremovexattr(const char *path, const char *name) {
  return syscall(198, path, name);
}


x86 assembly (clang, -O0):
<lremovexattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0xc6,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lremovexattr>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xc6,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @lremovexattr(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 = call i32 @syscall(i32 198, i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @lremovexattr(i8* %0, i8* %1) {
%3 = tail call i32 @syscall(i32 198, i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int f268(int *);
int f269(int *p) { return f268(p); }


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

x86 assembly (clang, -O2):
<f269>:
jmp    1030 <f268@plt>

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

LLVM IR (-O2):
define i32 @f269(i32* %0) {
%2 = tail call i32 @f268(i32* %0)
ret i32 %2
}
int CRYPTO_secure_malloc_initialized(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @CRYPTO_secure_malloc_initialized() {
ret i32 0
}
int await(volatile int *status) {
  register int i, j, k, randnum;
  randnum = 0;
  while (*status)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<await>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    $0x0,%eax
je     1123 <await+0x23>
jmp    110f <await+0xf>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<await>:
cmpl   $0x0,(%rdi)
jne    1100 <await>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @await(i32* %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
ret i32 0
}
float axt_decode_distance(int n) {
  if (n < -10000)
    return n * 0.1 + 900.0;
  else {
    if (n > 10000)
      return n * 0.1 - 900.0;
    else
      return n * 0.01;
  }
}


x86 assembly (clang, -O0):
<axt_decode_distance>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xffffd8f0,-0x8(%rbp)
jge    113f <axt_decode_distance+0x3f>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xee7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeeb(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1191 <axt_decode_distance+0x91>
cmpl   $0x2710,-0x8(%rbp)
jle    1177 <axt_decode_distance+0x77>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xeaf(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeab(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1191 <axt_decode_distance+0x91>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xe7c(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<axt_decode_distance>:
cmp    $0xffffd8ef,%edi
jg     1121 <axt_decode_distance+0x21>
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
addsd  0xefc(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret
cvtsi2sd %edi,%xmm0
cmp    $0x2711,%edi
jl     1142 <axt_decode_distance+0x42>
mulsd  0xed3(%rip),%xmm0
addsd  0xed3(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret
mulsd  0xeb6(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @axt_decode_distance(i32 %0) {
%2 = alloca float
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, -10000
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 1.000000e-01, double 9.000000e+02)
%10 = fptrunc double %9 to float
store float %10, float* %2
br label %24
11: ; preds = %1
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 10000
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i32, i32* %3
%16 = sitofp i32 %15 to double
%17 = call double @llvm.fmuladd.f64(double %16, double 1.000000e-01, double -9.000000e+02)
%18 = fptrunc double %17 to float
store float %18, float* %2
br label %24
19: ; preds = %11
%20 = load i32, i32* %3
%21 = sitofp i32 %20 to double
%22 = fmul double %21, 1.000000e-02
%23 = fptrunc double %22 to float
store float %23, float* %2
br label %24
24: ; preds = %19, %14, %6
%25 = load float, float* %2
ret float %25
}

LLVM IR (-O2):
define float @axt_decode_distance(i32 %0) {
%2 = icmp slt i32 %0, -10000
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = sitofp i32 %0 to double
%5 = tail call double @llvm.fmuladd.f64(double %4, double 1.000000e-01, double 9.000000e+02)
br label %13
6: ; preds = %1
%7 = icmp sgt i32 %0, 10000
%8 = sitofp i32 %0 to double
br i1 %7, label %9, label %11
9: ; preds = %6
%10 = tail call double @llvm.fmuladd.f64(double %8, double 1.000000e-01, double -9.000000e+02)
br label %13
11: ; preds = %6
%12 = fmul double %8, 1.000000e-02
br label %13
13: ; preds = %11, %9, %3
%14 = phi double [ %5, %3 ], [ %10, %9 ], [ %12, %11 ]
%15 = fptrunc double %14 to float
ret float %15
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ get_port(int /*<<< orphan*/, int, int);
uint8_t io_get_port_pullups(uint8_t port) { return get_port(port, 0x0C, 0x0D); }


x86 assembly (clang, -O0):
<io_get_port_pullups>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xc,%esi
mov    $0xd,%edx
call   1030 <get_port@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_get_port_pullups>:
mov    $0xc,%esi
mov    $0xd,%edx
jmp    1030 <get_port@plt>

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

LLVM IR (-O2):
define i32 @io_get_port_pullups(i32 %0) {
%2 = tail call i32 @get_port(i32 %0, i32 12, i32 13)
ret i32 %2
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
wchar_t test4(void) { return L'\''; }


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

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

LLVM IR (-O0):
define i32 @test4() {
ret i32 39
}

LLVM IR (-O2):
define i32 @test4() {
ret i32 39
}
/* Variables and functions */
double cos(double);
double futhark_cos64(double x) { return cos(x); }


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

x86 assembly (clang, -O2):
<futhark_cos64>:
jmp    1030 <cos@plt>

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

LLVM IR (-O2):
define double @futhark_cos64(double %0) {
%2 = tail call double @cos(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_pearson_perfect_hash_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_pearson_perfect@%p::hash (rtpp_pearson_perfect_hash) is "
          "invoked after destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_pearson_perfect_hash_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<rtpp_pearson_perfect_hash_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [95 x i8] c"Method rtpp_pearson_perfect@%p::hash (rtpp_pearson_perfect_hash) is invoked after destruction\0A\00"
define void @rtpp_pearson_perfect_hash_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [95 x i8] c"Method rtpp_pearson_perfect@%p::hash (rtpp_pearson_perfect_hash) is invoked after destruction\0A\00"
define void @rtpp_pearson_perfect_hash_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ bic(int, int);
int bis(int /*<<< orphan*/, int /*<<< orphan*/);
int bool_xor(int x, int y) {
  int result = bis(bic(x, y), bic(y, x));
  return result;
}


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

x86 assembly (clang, -O2):
<bool_xor>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <bic@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <bic@plt>
mov    %r14d,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <bis@plt>

LLVM IR (-O0):
define i32 @bool_xor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @bic(i32 %6, i32 %7)
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = call i32 @bic(i32 %9, i32 %10)
%12 = call i32 @bis(i32 %8, i32 %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @bool_xor(i32 %0, i32 %1) {
%3 = tail call i32 @bic(i32 %0, i32 %1)
%4 = tail call i32 @bic(i32 %1, i32 %0)
%5 = tail call i32 @bis(i32 %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int create_dobldobl_Laurent_homotopy(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(793, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<create_dobldobl_Laurent_homotopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x319,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_dobldobl_Laurent_homotopy>:
mov    $0x319,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @create_dobldobl_Laurent_homotopy() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 793, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ break_here();
void lib2_func4(void) { break_here(); }


x86 assembly (clang, -O0):
<lib2_func4>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <break_here@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @lib2_func4() {
%1 = call i32 (...) @break_here()
ret void
}

LLVM IR (-O2):
define void @lib2_func4() {
%1 = tail call i32 (...) @break_here()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: strip_ifdefs <infile> <outfile> [key [y|n]]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"usage: strip_ifdefs <infile> <outfile> [key [y|n]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"usage: strip_ifdefs <infile> <outfile> [key [y|n]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double getTime(void) {
  struct timeval t;
  gettimeofday(&t, NULL);
  return t.tv_sec + t.tv_usec / 1000000.0;
}


x86 assembly (clang, -O0):
<getTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @getTime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = fdiv double %6, 1.000000e+06
%8 = fadd double %4, %7
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @getTime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %5, %8
ret double %9
}
long long fib(int n) {
  if (n == 0) {
    return 0;
  }
  if (n == 1) {
    return 1;
  }
  return fib(n - 1) + fib(n - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1132 <fib+0x22>
movq   $0x0,-0x8(%rbp)
jmp    1171 <fib+0x61>
cmpl   $0x1,-0xc(%rbp)
jne    1149 <fib+0x39>
movq   $0x1,-0x8(%rbp)
jmp    1171 <fib+0x61>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %r14d,%r14d
test   %ebx,%ebx
je     1137 <fib+0x27>
nopl   (%rax)
cmp    $0x1,%ebx
je     113b <fib+0x2b>
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
add    %rax,%r14
add    $0xfffffffe,%ebx
test   %ebx,%ebx
jne    1120 <fib+0x10>
xor    %eax,%eax
jmp    1140 <fib+0x30>
mov    $0x1,%eax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @fib(i32 %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i64 [ 0, %1 ], [ %9, %5 ]
%4 = phi i32 [ %0, %1 ], [ %8, %5 ]
switch i32 %4, label %5 [
i32 0, label %10
i32 1, label %11
]
5: ; preds = %2
%6 = add nsw i32 %4, -1
%7 = tail call i64 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i64 %7, %3
br label %2
10: ; preds = %2
br label %11
11: ; preds = %2, %10
%12 = phi i64 [ 0, %10 ], [ 1, %2 ]
%13 = add nsw i64 %12, %3
ret i64 %13
}
int main() {
  int i = 10;
  while (i > 0) {
    --i;
    ++i;
  }
  while (i > -1)
    --i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1133 <main+0x33>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
jmp    1138 <main+0x38>
cmpl   $0xffffffff,-0x8(%rbp)
jle    1150 <main+0x50>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1138 <main+0x38>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ trap_SendConsoleCommand(char *);
void CG_TauntKillInsult_f(void) {
  trap_SendConsoleCommand("cmd vsay kill_insult\n");
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"cmd vsay kill_insult\0A\00"
define void @CG_TauntKillInsult_f() {
%1 = call i32 @trap_SendConsoleCommand(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"cmd vsay kill_insult\0A\00"
define void @CG_TauntKillInsult_f() {
%1 = tail call i32 @trap_SendConsoleCommand(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int INLINE_SYSCALL(int /*<<< orphan*/, int, char const *, int /*<<< orphan*/,
                   char const *);
int /*<<< orphan*/ symlinkat;
int __symlink(const char *from, const char *to) {
  return INLINE_SYSCALL(symlinkat, 3, from, AT_FDCWD, to);
}


x86 assembly (clang, -O0):
<__symlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    0x2e9c(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%r8
mov    $0x3,%esi
call   1030 <INLINE_SYSCALL@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__symlink>:
mov    %rsi,%r8
mov    %rdi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
mov    0x2eaa(%rip),%rax
mov    (%rax),%ecx
mov    $0x3,%esi
jmp    1030 <INLINE_SYSCALL@plt>

LLVM IR (-O0):
@symlinkat = global i32 0
@AT_FDCWD = global i32 0
define i32 @__symlink(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @symlinkat
%6 = load i8*, i8** %3
%7 = load i32, i32* @AT_FDCWD
%8 = load i8*, i8** %4
%9 = call i32 @INLINE_SYSCALL(i32 %5, i32 3, i8* %6, i32 %7, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
@symlinkat = global i32 0
@AT_FDCWD = global i32 0
define i32 @__symlink(i8* %0, i8* %1) {
%3 = load i32, i32* @symlinkat
%4 = load i32, i32* @AT_FDCWD
%5 = tail call i32 @INLINE_SYSCALL(i32 %3, i32 3, i8* %0, i32 %4, i8* %1)
ret i32 %5
}
int f(int a) { return (-a) / 10; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movslq %edi,%rax
imul   $0xffffffff99999999,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 0, %3
%5 = sdiv i32 %4, 10
ret i32 %5
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = sdiv i32 %0, -10
ret i32 %2
}
int radToAXServo(float rads) {
  float val = (rads * 100) / 51 * 100;
  return (int)val;
}


x86 assembly (clang, -O0):
<radToAXServo>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xee6(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xed6(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
cvttss2si -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<radToAXServo>:
movss  0xef8(%rip),%xmm1
mulss  %xmm1,%xmm0
divss  0xef0(%rip),%xmm0
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @radToAXServo(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fmul float %4, 1.000000e+02
%6 = fdiv float %5, 5.100000e+01
%7 = fmul float %6, 1.000000e+02
store float %7, float* %3
%8 = load float, float* %3
%9 = fptosi float %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @radToAXServo(float %0) {
%2 = fmul float %0, 1.000000e+02
%3 = fdiv float %2, 5.100000e+01
%4 = fmul float %3, 1.000000e+02
%5 = fptosi float %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *realloc(void *, size_t);
void *checked_realloc(void *ptr, size_t size, const char *file,
                      const int line) {
  (void)file;
  (void)line;
  void *temp = realloc(ptr, size);
  if (temp == NULL) {
    do {
    } while (0);
    abort();
  }
  return temp;
}


x86 assembly (clang, -O0):
<checked_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1164 <checked_realloc+0x44>
jmp    1158 <checked_realloc+0x38>
jmp    115d <checked_realloc+0x3d>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @checked_realloc(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i8* @realloc(i8* %12, i64 %13)
store i8* %14, i8** %9
%15 = load i8*, i8** %9
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %21
17: ; preds = %4
br label %18
18: ; preds = %17
br label %19
19: ; preds = %18
%20 = call i32 (...) @abort()
unreachable
21: ; preds = %4
%22 = load i8*, i8** %9
ret i8* %22
}

LLVM IR (-O2):
define noalias i8* @checked_realloc(i8* nocapture %0, i64 %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i8* @realloc(i8* %0, i64 %1)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void addSynchronousTickee(void (*tickee)(void), unsigned periodms,
                          unsigned roundms) {
  error("ticker unsupported in this VM");
}


x86 assembly (clang, -O0):
<addSynchronousTickee>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xed7(%rip),%rdi
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [30 x i8] c"ticker unsupported in this VM\00"
define void @addSynchronousTickee(void ()* %0, i32 %1, i32 %2) {
%4 = alloca void ()*
%5 = alloca i32
%6 = alloca i32
store void ()* %0, void ()** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"ticker unsupported in this VM\00"
define void @addSynchronousTickee(void ()* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 @error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}