xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ check_read(unsigned short, char *);
void insl(unsigned short int port, void *addr, unsigned long int count) {
  for (unsigned long int i = 0; i < count; i++) {
    check_read(port + i, "insb");
  }
}


x86 assembly (clang, -O0):
<insl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1165 <insl+0x55>
movzwl -0x2(%rbp),%eax
add    -0x20(%rbp),%rax
lea    0xeb4(%rip),%rsi
movzwl %ax,%edi
call   1030 <check_read@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112f <insl+0x1f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insl>:
push   %rbp
push   %r14
push   %rbx
test   %rdx,%rdx
je     1146 <insl+0x36>
mov    %rdx,%rbx
mov    %edi,%ebp
lea    0xedb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
movzwl %bp,%ebp
mov    %ebp,%edi
mov    %r14,%rsi
call   1030 <check_read@plt>
add    $0x1,%ebp
add    $0xffffffffffffffff,%rbx
jne    1130 <insl+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"insb\00"
define void @insl(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i64 0, i64* %7
br label %8
8: ; preds = %19, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %6
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i16, i16* %4
%14 = zext i16 %13 to i64
%15 = load i64, i64* %7
%16 = add i64 %14, %15
%17 = trunc i64 %16 to i16
%18 = call i32 @check_read(i16 zeroext %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %12
%20 = load i64, i64* %7
%21 = add i64 %20, 1
store i64 %21, i64* %7
br label %8
22: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"insb\00"
define void @insl(i16 zeroext %0, i8* nocapture readnone %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i64 [ %11, %6 ], [ 0, %3 ]
%8 = trunc i64 %7 to i16
%9 = add i16 %8, %0
%10 = tail call i32 @check_read(i16 zeroext %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %2
br i1 %12, label %5, label %6
}
void xio_fini_vmsg(struct xio_vmsg *vmsg) {}


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

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

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

LLVM IR (-O2):
%struct.xio_vmsg = type opaque
define void @xio_fini_vmsg(%struct.xio_vmsg* nocapture %0) {
ret void
}
void ntp_senduser(void) {}


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

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

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

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

/* Variables and functions */
uint16_t swap_uint16(uint16_t v) { return (v << 8) | (v >> 8); }


x86 assembly (clang, -O0):
<swap_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_uint16>:
mov    %edi,%eax
shl    $0x8,%eax
sar    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @swap_uint16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = load i32, i32* %2
%6 = ashr i32 %5, 8
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @swap_uint16(i32 %0) {
%2 = shl i32 %0, 8
%3 = ashr i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
unsigned long sgIP_Hub_GetCompatibleIP(unsigned long);
unsigned long sgIP_IP_GetLocalBindAddr(unsigned long srcip,
                                       unsigned long destip) {
  if (srcip)
    return srcip;
  return sgIP_Hub_GetCompatibleIP(destip);
}


x86 assembly (clang, -O0):
<sgIP_IP_GetLocalBindAddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1138 <sgIP_IP_GetLocalBindAddr+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1145 <sgIP_IP_GetLocalBindAddr+0x35>
mov    -0x18(%rbp),%rdi
call   1030 <sgIP_Hub_GetCompatibleIP@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgIP_IP_GetLocalBindAddr>:
test   %rdi,%rdi
je     1119 <sgIP_IP_GetLocalBindAddr+0x9>
mov    %rdi,%rax
ret
mov    %rsi,%rdi
jmp    1030 <sgIP_Hub_GetCompatibleIP@plt>

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

LLVM IR (-O2):
define i64 @sgIP_IP_GetLocalBindAddr(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i64 @sgIP_Hub_GetCompatibleIP(i64 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i64 [ %5, %4 ], [ %0, %2 ]
ret i64 %7
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRDE_get(void) { return U_WMRCORENONE_get("U_WMRDE"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRDE\00"
define i32 @U_WMRDE_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ lgen(char *, char *, int);
void cgstorsw(int n) { lgen("%s\t%c%d,ax", "mov", n); }


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

x86 assembly (clang, -O2):
<cgstorsw>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xeeb(%rip),%rsi
jmp    1030 <lgen@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s\09%c%d,ax\00"
@.str.1 = [4 x i8] c"mov\00"
define void @cgstorsw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @lgen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s\09%c%d,ax\00"
@.str.1 = [4 x i8] c"mov\00"
define void @cgstorsw(i32 %0) {
%2 = tail call i32 @lgen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
long long zzss() { return 0x00000000ffffffffLL; }


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

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

LLVM IR (-O0):
define i64 @zzss() {
ret i64 4294967295
}

LLVM IR (-O2):
define i64 @zzss() {
ret i64 4294967295
}
int execlp(const char *path, const char *arg, ...) {}


x86 assembly (clang, -O0):
<execlp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @execlp(i8* nocapture readnone %0, i8* nocapture readnone %1, ...) {
ret i32 undef
}
/* Variables and functions */
int chdir(char *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
int cd(char *c) {
  int r = chdir(c);
  if (r < 0) {
    fprintf(stderr, "%s:", c);
    fflush(stderr);
    perror("chdir()");
  }
  return r;
}


x86 assembly (clang, -O0):
<cd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <chdir@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1195 <cd+0x55>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe8a(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xe74(%rip),%rdi
call   1060 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cd>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <chdir@plt>
mov    %eax,%ebx
test   %eax,%eax
js     115b <cd+0x1b>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    0x2e7e(%rip),%r15
mov    (%r15),%edi
lea    0xe94(%rip),%rsi
mov    %r14,%rdx
call   1040 <fprintf@plt>
mov    (%r15),%edi
call   1050 <fflush@plt>
lea    0xe81(%rip),%rdi
call   1060 <perror@plt>
jmp    1153 <cd+0x13>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s:\00"
@.str.1 = [8 x i8] c"chdir()\00"
define i32 @cd(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @chdir(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32, i32* @stderr
%13 = call i32 @fflush(i32 %12)
%14 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %8, %1
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s:\00"
@.str.1 = [8 x i8] c"chdir()\00"
define i32 @cd(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fflush(i32 %7)
%9 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %4, %1
ret i32 %2
}
void gtk_gamma_curve_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_gamma_curve_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sum10(int *);
int test() {
  int x[10];
  x[0] = 41;
  x[1] = 33;
  sum10(x);
  return x[0];
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x29,-0x30(%rbp)
movl   $0x21,-0x2c(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <sum10@plt>
mov    -0x30(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
sub    $0x28,%rsp
movabs $0x2100000029,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <sum10@plt>
mov    (%rsp),%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @test() {
%1 = alloca [10 x i32]
%2 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
store i32 41, i32* %2
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
store i32 33, i32* %3
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = call i32 @sum10(i32* %4)
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @test() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
store i32 41, i32* %3
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
store i32 33, i32* %4
%5 = call i32 @sum10(i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ outbyte(char);
void nl() { outbyte('\n'); }


x86 assembly (clang, -O0):
<nl>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <outbyte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nl>:
mov    $0xa,%edi
jmp    1030 <outbyte@plt>

LLVM IR (-O0):
define void @nl() {
%1 = call i32 @outbyte(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @nl() {
%1 = tail call i32 @outbyte(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_autoconf_comment_entities();
void all_autoconf_tests() { test_autoconf_comment_entities(); }


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

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

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

LLVM IR (-O2):
define void @all_autoconf_tests() {
%1 = tail call i32 (...) @test_autoconf_comment_entities()
ret void
}
/* Variables and functions */
double cpm_c(double const);
double log(double const);
double entropy_from_thetas_c(const double thetas, const double qt) {
  return cpm_c(qt) * log(thetas / 298.15) + (1.0 - qt) * 6864.8 + qt * 10513.6;
}


x86 assembly (clang, -O0):
<entropy_from_thetas_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <cpm_c@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeca(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <log@plt>
movsd  -0x18(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  0xea9(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  0xe94(%rip),%xmm3
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xe73(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<entropy_from_thetas_c>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
movaps %xmm1,%xmm0
call   1030 <cpm_c@plt>
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
divsd  0xeb6(%rip),%xmm0
call   1040 <log@plt>
movsd  0xeb1(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
subsd  %xmm2,%xmm1
mulsd  0xea7(%rip),%xmm1
mulsd  0x10(%rsp),%xmm0
addsd  %xmm1,%xmm0
mulsd  0xe9d(%rip),%xmm2
addsd  %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @entropy_from_thetas_c(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = call double @cpm_c(double %5)
%7 = load double, double* %3
%8 = fdiv double %7, 2.981500e+02
%9 = call double @log(double %8)
%10 = load double, double* %4
%11 = fsub double 1.000000e+00, %10
%12 = fmul double %11, 6.864800e+03
%13 = call double @llvm.fmuladd.f64(double %6, double %9, double %12)
%14 = load double, double* %4
%15 = call double @llvm.fmuladd.f64(double %14, double 1.051360e+04, double %13)
ret double %15
}

LLVM IR (-O2):
define double @entropy_from_thetas_c(double %0, double %1) {
%3 = tail call double @cpm_c(double %1)
%4 = fdiv double %0, 2.981500e+02
%5 = tail call double @log(double %4)
%6 = fsub double 1.000000e+00, %1
%7 = fmul double %6, 6.864800e+03
%8 = tail call double @llvm.fmuladd.f64(double %3, double %5, double %7)
%9 = tail call double @llvm.fmuladd.f64(double %1, double 1.051360e+04, double %8)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_array(int *arr, int size) {
  int i;
  for (i = 0; i < size; ++i)
    printf("%d ", arr[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_array+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_array+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_array(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
char *strdup(char const *);
char *is_param(const char *param) {
  if (param[0] == '-')
    return NULL;
  if ((param[0] == '\\') && (param[1] == '-'))
    param++;
  return strdup(param);
}


x86 assembly (clang, -O0):
<is_param>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1139 <is_param+0x29>
movq   $0x0,-0x8(%rbp)
jmp    1173 <is_param+0x63>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    1166 <is_param+0x56>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2d,%eax
jne    1166 <is_param+0x56>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_param>:
mov    (%rdi),%al
cmp    $0x2d,%al
je     112b <is_param+0x1b>
cmp    $0x5c,%al
jne    1126 <is_param+0x16>
lea    0x1(%rdi),%rax
cmpb   $0x2d,0x1(%rdi)
cmove  %rax,%rdi
jmp    1030 <strdup@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @is_param(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %8 [
i8 45, label %11
i8 92, label %3
]
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 45
%7 = select i1 %6, i8* %4, i8* %0
br label %8
8: ; preds = %3, %1
%9 = phi i8* [ %0, %1 ], [ %7, %3 ]
%10 = tail call i8* @strdup(i8* %9)
br label %11
11: ; preds = %1, %8
%12 = phi i8* [ %10, %8 ], [ null, %1 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ times(struct tbuffer *);
double TIME() {
  struct tbuffer {
    long proc_user_time;
    long proc_system_time;
    long child_user_time;
    long child_system_time;
  };
  struct tbuffer tb;
  times(&tb);
  return ((double)(tb.proc_user_time + tb.proc_system_time +
                   tb.child_user_time + tb.child_system_time) /
          60);
}


x86 assembly (clang, -O0):
<TIME>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
call   1030 <times@plt>
mov    -0x20(%rbp),%rax
add    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
add    -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
movsd  0xec2(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TIME>:
sub    $0x28,%rsp
mov    %rsp,%rdi
call   1030 <times@plt>
movdqa (%rsp),%xmm0
paddq  0x10(%rsp),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddq  %xmm0,%xmm1
movq   %xmm1,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
divsd  0xebb(%rip),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.tbuffer = type { i64, i64, i64, i64 }
%struct.tbuffer.0 = type opaque
define double @TIME() {
%1 = alloca %struct.tbuffer
%2 = bitcast %struct.tbuffer* %1 to %struct.tbuffer.0*
%3 = call i32 @times(%struct.tbuffer.0* %2)
%4 = getelementptr inbounds %struct.tbuffer, %struct.tbuffer* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.tbuffer, %struct.tbuffer* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = add nsw i64 %5, %7
%9 = getelementptr inbounds %struct.tbuffer, %struct.tbuffer* %1, i32 0, i32 2
%10 = load i64, i64* %9
%11 = add nsw i64 %8, %10
%12 = getelementptr inbounds %struct.tbuffer, %struct.tbuffer* %1, i32 0, i32 3
%13 = load i64, i64* %12
%14 = add nsw i64 %11, %13
%15 = sitofp i64 %14 to double
%16 = fdiv double %15, 6.000000e+01
ret double %16
}

LLVM IR (-O2):
%struct.tbuffer.0 = type opaque
define double @TIME() {
%1 = alloca <4 x i64>
%2 = bitcast <4 x i64>* %1 to i8*
%3 = bitcast <4 x i64>* %1 to %struct.tbuffer.0*
%4 = call i32 @times(%struct.tbuffer.0* %3)
%5 = load <4 x i64>, <4 x i64>* %1
%6 = call i64 @llvm.vector.reduce.add.v4i64(<4 x i64> %5)
%7 = sitofp i64 %6 to double
%8 = fdiv double %7, 6.000000e+01
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ get_reg(int);
int get_rega(int /*<<< orphan*/);
uint16_t get_opa(uint32_t insn) {
  int reg;
  reg = get_rega(insn);
  return get_reg(reg);
}


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

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

LLVM IR (-O0):
define i32 @get_opa(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @get_rega(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @get_reg(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_opa(i32 %0) {
%2 = tail call i32 @get_rega(i32 %0)
%3 = tail call i32 @get_reg(i32 %2)
ret i32 %3
}
/* Variables and functions */
char EOF;
int is_predicate_end(char c) { return ((c) == '\n') || ((c) == EOF); }


x86 assembly (clang, -O0):
<is_predicate_end>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     1132 <is_predicate_end+0x32>
movsbl -0x1(%rbp),%eax
mov    0x2ec1(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_predicate_end>:
cmp    $0xa,%dil
sete   %al
mov    0x2eda(%rip),%rcx
cmp    %dil,(%rcx)
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
@EOF = global i8 0
define i32 @is_predicate_end(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 10
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = load i8, i8* @EOF
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %8, %10
br label %12
12: ; preds = %6, %1
%13 = phi i1 [ true, %1 ], [ %11, %6 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @is_predicate_end(i8 signext %0) {
%2 = icmp eq i8 %0, 10
%3 = load i8, i8* @EOF
%4 = icmp eq i8 %3, %0
%5 = select i1 %2, i1 true, i1 %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void print_digit(digit, charout) int digit;
void (*charout)();
{
  if (digit < 10)
    charout('0' + digit);
  else
    charout('A' + digit - 10);
}


x86 assembly (clang, -O0):
<print_digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    112c <print_digit+0x2c>
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%edi
add    $0x30,%edi
mov    $0x0,%al
call   *%rcx
jmp    113d <print_digit+0x3d>
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%edi
add    $0x41,%edi
sub    $0xa,%edi
mov    $0x0,%al
call   *%rcx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_digit>:
lea    0x37(%rdi),%ecx
lea    0x30(%rdi),%eax
cmp    $0xa,%edi
cmovge %ecx,%eax
mov    %eax,%edi
xor    %eax,%eax
jmp    *%rsi

LLVM IR (-O0):
define void @print_digit(i32 %0, void (...)* %1) {
%3 = alloca i32
%4 = alloca void (...)*
store i32 %0, i32* %3
store void (...)* %1, void (...)** %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load void (...)*, void (...)** %4
%9 = load i32, i32* %3
%10 = add nsw i32 48, %9
%11 = bitcast void (...)* %8 to void (i32, ...)*
br label %18
12: ; preds = %2
%13 = load void (...)*, void (...)** %4
%14 = load i32, i32* %3
%15 = add nsw i32 65, %14
%16 = sub nsw i32 %15, 10
%17 = bitcast void (...)* %13 to void (i32, ...)*
br label %18
18: ; preds = %12, %7
ret void
}

LLVM IR (-O2):
define void @print_digit(i32 %0, void (...)* nocapture %1) {
%3 = icmp slt i32 %0, 10
%4 = select i1 %3, i32 48, i32 55
%5 = add nsw i32 %4, %0
%6 = bitcast void (...)* %1 to void (i32, ...)*
tail call void (i32, ...) %6(i32 %5)
ret void
}
/* Variables and functions */
int keyboard_status();
int keyboard_ready() {
  while (1) {
    if ((keyboard_status() & 2) == 0) {
      return 1;
    }
  }
}


x86 assembly (clang, -O0):
<keyboard_ready>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <keyboard_ready+0x9>
mov    $0x0,%al
call   1030 <keyboard_status@plt>
and    $0x2,%eax
cmp    $0x0,%eax
jne    1133 <keyboard_ready+0x23>
mov    $0x1,%eax
pop    %rbp
ret
jmp    1119 <keyboard_ready+0x9>

x86 assembly (clang, -O2):
<keyboard_ready>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <keyboard_status@plt>
test   $0x2,%al
jne    1120 <keyboard_ready+0x10>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @keyboard_ready() {
br label %1
1: ; preds = %0, %6
%2 = call i32 (...) @keyboard_status()
%3 = and i32 %2, 2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
ret i32 1
6: ; preds = %1
br label %1
}

LLVM IR (-O2):
define i32 @keyboard_ready() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @keyboard_status()
%3 = and i32 %2, 2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void ignore() { fprintf(stdout, "ignored\n"); }


x86 assembly (clang, -O0):
<ignore>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [9 x i8] c"ignored\0A\00"
define void @ignore() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [9 x i8] c"ignored\0A\00"
define void @ignore() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ daemon(int, int /*<<< orphan*/);
int /*<<< orphan*/ pause();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("run as daemon\n");
  daemon(1, 0);
  pause();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1050 <daemon@plt>
mov    $0x0,%al
call   1040 <pause@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1050 <daemon@plt>
xor    %eax,%eax
call   1040 <pause@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"run as daemon\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @daemon(i32 1, i32 0)
%8 = call i32 (...) @pause()
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"run as daemon\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @daemon(i32 1, i32 0)
%5 = tail call i32 (...) @pause()
ret i32 0
}
double findMedianSortedArrays(int *nums1, int nums1Size, int *nums2,
                              int nums2Size) {}


x86 assembly (clang, -O0):
<findMedianSortedArrays>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @findMedianSortedArrays(i32* nocapture readnone %0, i32 %1, i32* nocapture readnone %2, i32 %3) {
ret double undef
}
/* Variables and functions */
int /*<<< orphan*/ GetGust86OsculatingCoor(double, double, int, double *);
void GetGust86Coor(double jd, int body, double *xyz) {
  GetGust86OsculatingCoor(jd, jd, body, xyz);
}


x86 assembly (clang, -O0):
<GetGust86Coor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <GetGust86OsculatingCoor@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetGust86Coor>:
movaps %xmm0,%xmm1
jmp    1030 <GetGust86OsculatingCoor@plt>

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

LLVM IR (-O2):
define void @GetGust86Coor(double %0, i32 %1, double* %2) {
%4 = tail call i32 @GetGust86OsculatingCoor(double %0, double %0, i32 %1, double* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_strcmp(char const *, char const *);
scalar_t__ ft_strlen(char const *);
int ft_strequ(char const *s1, char const *s2) {
  if (ft_strlen(s1) != ft_strlen(s2))
    return (0);
  return (!ft_strcmp(s1, s2));
}


x86 assembly (clang, -O0):
<ft_strequ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ft_strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <ft_strlen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
je     1162 <ft_strequ+0x42>
movl   $0x0,-0x4(%rbp)
jmp    117f <ft_strequ+0x5f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <ft_strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strequ>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <ft_strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <ft_strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rbx
jne    1159 <ft_strequ+0x39>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <ft_strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @ft_strequ(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = call i64 @ft_strlen(i8* %6)
%8 = load i8*, i8** %5
%9 = call i64 @ft_strlen(i8* %8)
%10 = icmp ne i64 %7, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %19
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = call i32 @ft_strcmp(i8* %13, i8* %14)
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
%18 = zext i1 %17 to i32
store i32 %18, i32* %3
br label %19
19: ; preds = %12, %11
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @ft_strequ(i8* %0, i8* %1) {
%3 = tail call i64 @ft_strlen(i8* %0)
%4 = tail call i64 @ft_strlen(i8* %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i32 @ft_strcmp(i8* %0, i8* %1)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
ret i32 %11
}
int mi_strlen(char *InputString) {
  int i = 0;
  while (*InputString) {
    i++;
    InputString++;
  }
  return i;
}


x86 assembly (clang, -O0):
<mi_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1136 <mi_strlen+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <mi_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mi_strlen>:
cmpb   $0x0,(%rdi)
je     111c <mi_strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <mi_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mi_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
int test_imm_75uint8_mem(unsigned char *val) {
  return ((*val) & (0x75 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_75uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 117
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ __getcwd(char *, size_t);
char *getcwd(char *buf, size_t size) {
  return (__getcwd(buf, size) < 0) ? NULL : buf;
}


x86 assembly (clang, -O0):
<getcwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <__getcwd@plt>
cmp    $0x0,%rax
jge    1142 <getcwd+0x32>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    114a <getcwd+0x3a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcwd>:
push   %rbx
mov    %rdi,%rbx
call   1030 <__getcwd@plt>
xor    %ecx,%ecx
test   %rax,%rax
cmovns %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @getcwd(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 i64 @__getcwd(i8* %5, i64 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
br label %12
10: ; preds = %2
%11 = load i8*, i8** %3
br label %12
12: ; preds = %10, %9
%13 = phi i8* [ null, %9 ], [ %11, %10 ]
ret i8* %13
}

LLVM IR (-O2):
define i8* @getcwd(i8* %0, i64 %1) {
%3 = tail call i64 @__getcwd(i8* %0, i64 %1)
%4 = icmp slt i64 %3, 0
%5 = select i1 %4, i8* null, i8* %0
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int x;
  int y;
  assume(x == 4 * y && x >= 0);
  while (x > 0) {
    x -= 4;
    y--;
  }
  assert(y >= 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%edx
shl    $0x2,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0xd(%rbp)
jne    114f <main+0x2f>
cmpl   $0x0,-0x8(%rbp)
setge  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
cmpl   $0x0,-0x8(%rbp)
jle    117d <main+0x5d>
mov    -0x8(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    115c <main+0x3c>
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = mul nsw i32 4, %5
%7 = icmp eq i32 %4, %6
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 0
br label %11
11: ; preds = %8, %0
%12 = phi i1 [ false, %0 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
%14 = call i32 @assume(i32 %13)
br label %15
15: ; preds = %18, %11
%16 = load i32, i32* %2
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = load i32, i32* %2
%20 = sub nsw i32 %19, 4
store i32 %20, i32* %2
%21 = load i32, i32* %3
%22 = add nsw i32 %21, -1
store i32 %22, i32* %3
br label %15
23: ; preds = %15
%24 = load i32, i32* %3
%25 = icmp sge i32 %24, 0
%26 = zext i1 %25 to i32
%27 = call i32 @assert(i32 %26)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char str[] = {'h', 'e', 'l', 'l', 'o'};
  printf("str is %s\n", str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xedd(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x5(%rbp),%rsi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x6f,0x4(%rsp)
movl   $0x6c6c6568,(%rsp)
lea    0xee1(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.str = [5 x i8] c"hello"
@.str = [11 x i8] c"str is %s\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = bitcast [5 x i8]* %1 to i8*
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [5 x i8] c"hello"
@.str = [11 x i8] c"str is %s\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ stb_nptr_realloc(void *, void *, int);
void stb_nptr_move(void *new_address, void *old_address) {
  stb_nptr_realloc(new_address, old_address, 1);
}


x86 assembly (clang, -O0):
<stb_nptr_move>:
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    $0x1,%edx
call   1030 <stb_nptr_realloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_nptr_move>:
mov    $0x1,%edx
jmp    1030 <stb_nptr_realloc@plt>

LLVM IR (-O0):
define void @stb_nptr_move(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 @stb_nptr_realloc(i8* %5, i8* %6, i32 1)
ret void
}

LLVM IR (-O2):
define void @stb_nptr_move(i8* %0, i8* %1) {
%3 = tail call i32 @stb_nptr_realloc(i8* %0, i8* %1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void usage(void) {
  die("usage: "
      "zmenu"
      " [-i] [-b] [-x posx] [-y posy] [-width val] [-height val] [-font "
      "fontname] [-nb color] [-nf color] [-sb color] [-sf color]\n");
}


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

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

LLVM IR (-O0):
@.str = [136 x i8] c"usage: zmenu [-i] [-b] [-x posx] [-y posy] [-width val] [-height val] [-font fontname] [-nb color] [-nf color] [-sb color] [-sf color]\0A\00"
define void @usage() {
%1 = call i32 @die(i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [136 x i8] c"usage: zmenu [-i] [-b] [-x posx] [-y posy] [-width val] [-height val] [-font fontname] [-nb color] [-nf color] [-sb color] [-sf color]\0A\00"
define void @usage() {
%1 = tail call i32 @die(i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *program_name) {
  fprintf(stderr, "%s :\n", program_name);
  fprintf(stderr, "%s :\n", program_name);
  return;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb7(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2ec1(%rip),%r15
mov    (%r15),%edi
lea    0xed7(%rip),%r14
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"%s :\0A\00"
define void @usage(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 ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%s :\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int memory_read_access() { return 610; }


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

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

LLVM IR (-O0):
define i32 @memory_read_access() {
ret i32 610
}

LLVM IR (-O2):
define i32 @memory_read_access() {
ret i32 610
}
OP(fd, ce) { op_ce(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_ce()
ret i32 undef
}
int fb_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fb_init() {
ret i32 0
}