xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ read(int, void *, size_t);
ssize_t roaming_read(int fd, void *buf, size_t count, int *cont) {
  if (cont)
    *cont = 0;
  return read(fd, buf, count);
}


x86 assembly (clang, -O0):
<roaming_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     113c <roaming_read+0x2c>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roaming_read>:
test   %rcx,%rcx
je     111b <roaming_read+0xb>
movl   $0x0,(%rcx)
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @roaming_read(i32 %0, i8* nocapture %1, i64 %2, i32* writeonly %3) {
%5 = icmp eq i32* %3, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 0, i32* %3
br label %7
7: ; preds = %6, %4
%8 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
ret i32 %8
}
int f2(int x, int y) { return (((x << 28) & 0xf0000000)) | (y & 0xfffffff); }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1c,%eax
and    $0xf0000000,%eax
mov    -0x8(%rbp),%ecx
and    $0xfffffff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
shl    $0x1c,%edi
and    $0xfffffff,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @f2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = shl i32 %5, 28
%7 = and i32 %6, -268435456
%8 = load i32, i32* %4
%9 = and i32 %8, 268435455
%10 = or i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @f2(i32 %0, i32 %1) {
%3 = shl i32 %0, 28
%4 = and i32 %1, 268435455
%5 = or i32 %4, %3
ret i32 %5
}
/* Type definitions */
struct str {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ str_copyn(struct str *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void str_copyz(struct str *sa, const char *s) { str_copyn(sa, s, strlen(s)); }


x86 assembly (clang, -O0):
<str_copyz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <str_copyn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_copyz>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <str_copyn@plt>

LLVM IR (-O0):
%struct.str = type { i32 }
define void @str_copyz(%struct.str* %0, i8* %1) {
%3 = alloca %struct.str*
%4 = alloca i8*
store %struct.str* %0, %struct.str** %3
store i8* %1, i8** %4
%5 = load %struct.str*, %struct.str** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @str_copyn(%struct.str* %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.str = type { i32 }
define void @str_copyz(%struct.str* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @str_copyn(%struct.str* %0, i8* %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ z80_ed_5e_im_2();
void z80_ed_7e_im_2(void) { z80_ed_5e_im_2(); }


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

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

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

LLVM IR (-O2):
define void @z80_ed_7e_im_2() {
%1 = tail call i32 (...) @z80_ed_5e_im_2()
ret void
}
int isFirstLetterHANZI(unsigned short hanzi) {
  int index = hanzi - 19968;
  if (index >= 0 && index <= 20902) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<isFirstLetterHANZI>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
sub    $0x4e00,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     113a <isFirstLetterHANZI+0x3a>
cmpl   $0x51a6,-0xc(%rbp)
jg     113a <isFirstLetterHANZI+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <isFirstLetterHANZI+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isFirstLetterHANZI>:
add    $0xffffb200,%edi
movzwl %di,%ecx
xor    %eax,%eax
cmp    $0x51a7,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @isFirstLetterHANZI(i16 zeroext %0) {
%2 = alloca i32
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = sub nsw i32 %6, 19968
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i32, i32* %4
%12 = icmp sle i32 %11, 20902
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 1, i32* %2
br label %15
14: ; preds = %10, %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @isFirstLetterHANZI(i16 zeroext %0) {
%2 = add i16 %0, -19968
%3 = icmp ult i16 %2, 20903
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello world from t1 Main!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"Hello world from t1 Main!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [26 x i8] c"Hello world from t1 Main!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int con_getch();
int fright(int);
int findright(void) {
  int c = con_getch();
  if (c < 0 || c > 255)
    return 1;
  return fright(c);
}


x86 assembly (clang, -O0):
<findright>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <con_getch@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1149 <findright+0x29>
cmpl   $0xff,-0x8(%rbp)
jle    1155 <findright+0x35>
movl   $0x1,-0x4(%rbp)
jmp    1160 <findright+0x40>
mov    -0x8(%rbp),%edi
call   1040 <fright@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findright>:
push   %rax
xor    %eax,%eax
call   1030 <con_getch@plt>
cmp    $0xff,%eax
jbe    1136 <findright+0x16>
mov    $0x1,%eax
pop    %rcx
ret
mov    %eax,%edi
pop    %rax
jmp    1040 <fright@plt>

LLVM IR (-O0):
define i32 @findright() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @con_getch()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 255
br i1 %8, label %9, label %10
9: ; preds = %6, %0
store i32 1, i32* %1
br label %13
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i32 @fright(i32 %11)
store i32 %12, i32* %1
br label %13
13: ; preds = %10, %9
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @findright() {
%1 = tail call i32 (...) @con_getch()
%2 = icmp ugt i32 %1, 255
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @fright(i32 %1)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ 1, %0 ]
ret i32 %6
}
float test3f(float a) { return __builtin_copysignf(a, 0.0); }


x86 assembly (clang, -O0):
<test3f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @test3f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.copysign.f32(float %3, float 0.000000e+00)
ret float %4
}

LLVM IR (-O2):
define float @test3f(float %0) {
%2 = tail call float @llvm.fabs.f32(float %0)
ret float %2
}
void waitOneAndHalfBitTime(void) {}


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

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

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

LLVM IR (-O2):
define void @waitOneAndHalfBitTime() {
ret void
}
/* Type definitions */
struct proto_conn {
  int dummy;
};

/* Variables and functions */
int proto_common_setup(char const *, char const *, struct proto_conn **,
                       int /*<<< orphan*/);
int proto_client(const char *srcaddr, const char *dstaddr,
                 struct proto_conn **connp) {
  return (proto_common_setup(srcaddr, dstaddr, connp, 0));
}


x86 assembly (clang, -O0):
<proto_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <proto_common_setup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proto_client>:
xor    %ecx,%ecx
jmp    1030 <proto_common_setup@plt>

LLVM IR (-O0):
%struct.proto_conn = type { i32 }
define i32 @proto_client(i8* %0, i8* %1, %struct.proto_conn** %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.proto_conn**
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.proto_conn** %2, %struct.proto_conn*** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load %struct.proto_conn**, %struct.proto_conn*** %6
%10 = call i32 @proto_common_setup(i8* %7, i8* %8, %struct.proto_conn** %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.proto_conn = type { i32 }
define i32 @proto_client(i8* %0, i8* %1, %struct.proto_conn** %2) {
%4 = tail call i32 @proto_common_setup(i8* %0, i8* %1, %struct.proto_conn** %2, i32 0)
ret i32 %4
}
/* Variables and functions */
double pow(double, double);
double midp(double xi, double h) { return pow((xi + h * 0.5e0), (double)7); }


x86 assembly (clang, -O0):
<midp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xed4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xebc(%rip),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<midp>:
mulsd  0xee8(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xee4(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @midp(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @llvm.fmuladd.f64(double %6, double 5.000000e-01, double %5)
%8 = call double @pow(double %7, double 7.000000e+00)
ret double %8
}

LLVM IR (-O2):
define double @midp(double %0, double %1) {
%3 = tail call double @llvm.fmuladd.f64(double %1, double 5.000000e-01, double %0)
%4 = tail call double @pow(double %3, double 7.000000e+00)
ret double %4
}
/* Variables and functions */
scalar_t__ pow(int const, int);
float sqrt(scalar_t__);
float lash_getCartesianMagnitude(const int target_x, const int target_y,
                                 const int source_x, const int source_y) {
  return sqrt(pow(target_x - source_x, 2) + pow(target_y - source_y, 2));
}


x86 assembly (clang, -O0):
<lash_getCartesianMagnitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    -0xc(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
sub    -0x10(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    -0x18(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lash_getCartesianMagnitude>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %esi,%ebp
sub    %edx,%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %rax,%rbx
sub    %r14d,%ebp
mov    %ebp,%edi
mov    $0x2,%esi
call   1030 <pow@plt>
add    %rax,%rbx
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define float @lash_getCartesianMagnitude(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = sub nsw i32 %9, %10
%12 = call i64 @pow(i32 %11, i32 2)
%13 = load i32, i32* %6
%14 = load i32, i32* %8
%15 = sub nsw i32 %13, %14
%16 = call i64 @pow(i32 %15, i32 2)
%17 = add nsw i64 %12, %16
%18 = call float @sqrt(i64 %17)
ret float %18
}

LLVM IR (-O2):
define float @lash_getCartesianMagnitude(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %2
%6 = tail call i64 @pow(i32 %5, i32 2)
%7 = sub nsw i32 %1, %3
%8 = tail call i64 @pow(i32 %7, i32 2)
%9 = add nsw i64 %8, %6
%10 = tail call float @sqrt(i64 %9)
ret float %10
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t S(int num) { return (num & 0x1) << 0; }


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

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

LLVM IR (-O0):
define i32 @S(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = shl i32 %4, 0
ret i32 %5
}

LLVM IR (-O2):
define i32 @S(i32 %0) {
%2 = and i32 %0, 1
ret i32 %2
}
/* Type definitions */
struct ps_process {
  int dummy;
};

/* Variables and functions */
int obus_object_set_user_data(int /*<<< orphan*/, void *);
int /*<<< orphan*/ ps_process_object(struct ps_process *);
int ps_process_set_user_data(struct ps_process *object, void *user_data) {
  return obus_object_set_user_data(ps_process_object(object), user_data);
}


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

x86 assembly (clang, -O2):
<ps_process_set_user_data>:
push   %rbx
mov    %rsi,%rbx
call   1040 <ps_process_object@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <obus_object_set_user_data@plt>

LLVM IR (-O0):
%struct.ps_process = type { i32 }
define i32 @ps_process_set_user_data(%struct.ps_process* %0, i8* %1) {
%3 = alloca %struct.ps_process*
%4 = alloca i8*
store %struct.ps_process* %0, %struct.ps_process** %3
store i8* %1, i8** %4
%5 = load %struct.ps_process*, %struct.ps_process** %3
%6 = call i32 @ps_process_object(%struct.ps_process* %5)
%7 = load i8*, i8** %4
%8 = call i32 @obus_object_set_user_data(i32 %6, i8* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.ps_process = type { i32 }
define i32 @ps_process_set_user_data(%struct.ps_process* %0, i8* %1) {
%3 = tail call i32 @ps_process_object(%struct.ps_process* %0)
%4 = tail call i32 @obus_object_set_user_data(i32 %3, i8* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void baz(void) { fprintf(stderr, "baz\n"); }


x86 assembly (clang, -O0):
<baz>:
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):
<baz>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [5 x i8] c"baz\0A\00"
define void @baz() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint_fast16_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_COPY_uint_fast16_t(uint_fast16_t *const dest,
                                          uint_fast16_t const src) {
  return (((*dest) = src), true);
}


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

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

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

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_COPY_uint_fast16_t(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void p_write_error(void) {
  fprintf(stderr, ("Cannot write data to system activity file: %s\n"),
          strerror(errno));
  exit(2);
}


x86 assembly (clang, -O0):
<p_write_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<p_write_error>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeb1(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"Cannot write data to system activity file: %s\0A\00"
@errno = global i32 0
define void @p_write_error() {
%1 = load i32, i32* @stderr
%2 = load i32, i32* @errno
%3 = call i8* @strerror(i32 %2)
%4 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"Cannot write data to system activity file: %s\0A\00"
@errno = global i32 0
define void @p_write_error() {
%1 = load i32, i32* @stderr
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int passShort(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", passShort(0x80, 0xf0f4));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @passShort(i32 128, i32 61684)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @passShort(i32 128, i32 61684)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int pointAt(ix, iy)
int ix, iy;
{ return (1); }


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

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

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

LLVM IR (-O2):
define i32 @pointAt(i32 %0, i32 %1) {
ret i32 1
}
/* Variables and functions */
unsigned int f39(unsigned int);
unsigned int f40(unsigned int a) { return f39(f39(a)); }


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

x86 assembly (clang, -O2):
<f40>:
push   %rax
call   1030 <f39@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <f39@plt>

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

LLVM IR (-O2):
define i32 @f40(i32 %0) {
%2 = tail call i32 @f39(i32 %0)
%3 = tail call i32 @f39(i32 %2)
ret i32 %3
}
int randombytes(unsigned char *random_array, unsigned long long nbytes) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @randombytes(i8* nocapture readnone %0, i64 %1) {
ret i32 0
}
int main() {
  printf("%f\n", atof("15.54"));
  printf("%s\n", ftoa(1.12234));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <atof@plt>
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  0xe9b(%rip),%xmm0
mov    $0x1,%al
call   1050 <ftoa@plt>
mov    %eax,%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <atof@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0xea9(%rip),%xmm0
mov    $0x1,%al
call   1050 <ftoa@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [6 x i8] c"15.54\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @atof to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (double, ...) bitcast (i32 (...)* @ftoa to i32 (double, ...)*)(double 1.122340e+00)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [6 x i8] c"15.54\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atof to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (double, ...) bitcast (i32 (...)* @ftoa to i32 (double, ...)*)(double 1.122340e+00)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret i32 0
}
int module_authenticate(const char *pass) {
  (void)pass;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @module_authenticate(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
int recv(int, char *, int, int /*<<< orphan*/);
void recvpkt(int fd, FILE *out) {
  char buf[65535];
  int sz;
  sz = recv(fd, buf, sizeof(buf), 0);
  if (sz == -1)
    error("recv() failed");
  fwrite(buf, 1, sz, out);
}


x86 assembly (clang, -O0):
<recvpkt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10020,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10010(%rbp),%rsi
mov    $0xffff,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x10014(%rbp)
cmpl   $0xffffffff,-0x10014(%rbp)
jne    1177 <recvpkt+0x47>
lea    0xe8e(%rip),%rdi
call   1040 <error@plt>
lea    -0x10010(%rbp),%rdi
mov    -0x10014(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1050 <fwrite@plt>
add    $0x10020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recvpkt>:
push   %rbp
push   %rbx
sub    $0x10008,%rsp
mov    %rsi,%rbx
mov    %rsp,%rsi
mov    $0xffff,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    115e <recvpkt+0x2e>
lea    0xea7(%rip),%rdi
call   1040 <error@plt>
mov    %rsp,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
add    $0x10008,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"recv() failed\00"
define void @recvpkt(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca [65535 x i8]
%6 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32, i32* %3
%8 = getelementptr inbounds [65535 x i8], [65535 x i8]* %5, i64 0, i64 0
%9 = call i32 @recv(i32 %7, i8* %8, i32 65535, i32 0)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %2
%15 = getelementptr inbounds [65535 x i8], [65535 x i8]* %5, i64 0, i64 0
%16 = load i32, i32* %6
%17 = load i32*, i32** %4
%18 = call i32 @fwrite(i8* %15, i32 1, i32 %16, i32* %17)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"recv() failed\00"
define void @recvpkt(i32 %0, i32* nocapture %1) {
%3 = alloca [65535 x i8]
%4 = getelementptr inbounds [65535 x i8], [65535 x i8]* %3, i64 0, i64 0
%5 = call i32 @recv(i32 %0, i8* %4, i32 65535, i32 0)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = call i32 @fwrite(i8* %4, i32 1, i32 %5, i32* %1)
ret void
}
/* Variables and functions */
int SIGINT;
int /*<<< orphan*/ shutdown_routine();
void sigint_handler(int sig) {
  if (sig == SIGINT)
    shutdown_routine();
}


x86 assembly (clang, -O0):
<sigint_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    1134 <sigint_handler+0x24>
mov    $0x0,%al
call   1030 <shutdown_routine@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigint_handler>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jne    1122 <sigint_handler+0x12>
xor    %eax,%eax
jmp    1030 <shutdown_routine@plt>
ret

LLVM IR (-O0):
@SIGINT = global i32 0
define void @sigint_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @shutdown_routine()
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
define void @sigint_handler(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @shutdown_routine()
br label %6
6: ; preds = %4, %1
ret void
}
float maior(float pri, float seg) {
  float resul;
  if (pri >= seg) {
    resul = pri;
  }
  if (seg >= pri) {
    resul = seg;
  }
  return resul;
}


x86 assembly (clang, -O0):
<maior>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1127 <maior+0x27>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0x4(%rbp),%xmm0
jb     1140 <maior+0x40>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<maior>:
movaps %xmm0,%xmm2
cmpless %xmm1,%xmm2
andps  %xmm2,%xmm1
andnps %xmm0,%xmm2
orps   %xmm1,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @maior(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fcmp oge float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %3
store float %10, float* %5
br label %11
11: ; preds = %9, %2
%12 = load float, float* %4
%13 = load float, float* %3
%14 = fcmp oge float %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load float, float* %4
store float %16, float* %5
br label %17
17: ; preds = %15, %11
%18 = load float, float* %5
ret float %18
}

LLVM IR (-O2):
define float @maior(float %0, float %1) {
%3 = fcmp oge float %1, %0
%4 = select i1 %3, float %1, float %0
ret float %4
}
int test_uninit_1(void) {
  int result;
  return result;
}


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

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

LLVM IR (-O0):
define i32 @test_uninit_1() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @test_uninit_1() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ LBA_REG_WRITE(void *, int, int);
int apollo_util_stop(void *phys_addr) {
  LBA_REG_WRITE(phys_addr, 0x0500, 0x0);
  return 0;
}


x86 assembly (clang, -O0):
<apollo_util_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x500,%esi
xor    %edx,%edx
call   1030 <LBA_REG_WRITE@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apollo_util_stop>:
push   %rax
mov    $0x500,%esi
xor    %edx,%edx
call   1030 <LBA_REG_WRITE@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @apollo_util_stop(i8* %0) {
%2 = tail call i32 @LBA_REG_WRITE(i8* %0, i32 1280, i32 0)
ret i32 0
}
/* Variables and functions */
int symlink(char *, char *);
int sysapi_create_symlink(char *original_file_path, char *symlink_path) {
  return symlink(original_file_path, symlink_path);
}


x86 assembly (clang, -O0):
<sysapi_create_symlink>:
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 <symlink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysapi_create_symlink>:
jmp    1030 <symlink@plt>

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

LLVM IR (-O2):
define i32 @sysapi_create_symlink(i8* %0, i8* %1) {
%3 = tail call i32 @symlink(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float km;
  printf("Km: ");
  scanf("%f", &km);
  printf("Milhas: %.2f", km / 1.61);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea2(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xea7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xeae(%rip),%xmm0
lea    0xeb7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"Km: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [13 x i8] c"Milhas: %.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = fdiv double %6, 1.610000e+00
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"Km: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [13 x i8] c"Milhas: %.2f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fdiv double %6, 1.610000e+00
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
/* Variables and functions */
int part(int *, int, int);
void qsort(int a[], int l, int r) {
  int m;
  m = part(a, l, r);
  if (l < m - 1)
    qsort(a, l, m - 1);
  if (m < r)
    qsort(a, m, r);
}


x86 assembly (clang, -O0):
<qsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <part@plt>
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1167 <qsort+0x47>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <qsort@plt>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <qsort+0x62>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <qsort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %esi,%ebp
mov    %rdi,%r14
jmp    1147 <qsort+0x27>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%ebp
cmp    %r15d,%ebx
jge    1169 <qsort+0x49>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %r15d,%edx
call   1040 <part@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
cmp    %ebp,%edx
jle    1140 <qsort+0x20>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <qsort@plt>
jmp    1140 <qsort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @qsort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @part(i32* %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = sub nsw i32 %13, 1
%15 = icmp slt i32 %12, %14
br i1 %15, label %16, label %21
16: ; preds = %3
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
br label %21
21: ; preds = %16, %3
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %29
25: ; preds = %21
%26 = load i32*, i32** %4
%27 = load i32, i32* %7
%28 = load i32, i32* %6
br label %29
29: ; preds = %25, %21
ret void
}

LLVM IR (-O2):
define void @qsort(i32* %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %10, %3
%5 = phi i32 [ %1, %3 ], [ %6, %10 ]
%6 = tail call i32 @part(i32* %0, i32 %5, i32 %2)
%7 = add nsw i32 %6, -1
%8 = icmp sgt i32 %7, %5
br i1 %8, label %9, label %10
9: ; preds = %4
tail call void @qsort(i32* %0, i32 %5, i32 %7)
br label %10
10: ; preds = %9, %4
%11 = icmp slt i32 %6, %2
br i1 %11, label %4, label %12
12: ; preds = %10
ret void
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn0() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn0");
  return result;
}


x86 assembly (clang, -O0):
<fn0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn0>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"fn0\00"
define i8* @fn0() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"fn0\00"
define i8* @fn0() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
void BLInternalFlashErase(unsigned long ulAddress) {
  (*((volatile unsigned long *)(0x400FD000))) = ulAddress;
  (*((volatile unsigned long *)(0x400FD008))) = 0xA4420000 | 0x00000002;
  while ((*((volatile unsigned long *)(0x400FD008))) & 0x00000002) {
  }
}


x86 assembly (clang, -O0):
<BLInternalFlashErase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400fd000,%eax
mov    %rcx,(%rax)
mov    $0x400fd008,%eax
mov    $0xa4420002,%ecx
mov    %rcx,(%rax)
mov    $0x400fd008,%eax
mov    (%rax),%rax
and    $0x2,%rax
cmp    $0x0,%rax
je     113c <BLInternalFlashErase+0x3c>
jmp    1121 <BLInternalFlashErase+0x21>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BLInternalFlashErase>:
mov    %rdi,0x400fd000
40
mov    $0xa4420002,%eax
mov    %rax,0x400fd008
40
cs nopw 0x0(%rax,%rax,1)
nop
testq  $0x2,0x400fd008
jne    1120 <BLInternalFlashErase+0x20>
ret

LLVM IR (-O0):
define void @BLInternalFlashErase(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1074778112 to i64*)
store volatile i64 2755788802, i64* inttoptr (i64 1074778120 to i64*)
br label %4
4: ; preds = %8, %1
%5 = load volatile i64, i64* inttoptr (i64 1074778120 to i64*)
%6 = and i64 %5, 2
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @BLInternalFlashErase(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1074778112 to i64*)
store volatile i64 2755788802, i64* inttoptr (i64 1074778120 to i64*)
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* inttoptr (i64 1074778120 to i64*)
%4 = and i64 %3, 2
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
ret void
}
/* Variables and functions */
double log(double);
double aloga(double a) { return (a * log(a)); }


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

x86 assembly (clang, -O2):
<aloga>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <log@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @aloga(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @log(double %4)
%6 = fmul double %3, %5
ret double %6
}

LLVM IR (-O2):
define double @aloga(double %0) {
%2 = tail call double @log(double %0)
%3 = fmul double %2, %0
ret double %3
}
void U_WMRSAVEDC_print(const char *contents) { (void)(contents); }


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

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

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

LLVM IR (-O2):
define void @U_WMRSAVEDC_print(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int bs_size_ue(int);
int bs_size_se(int val) {
  return bs_size_ue(val <= 0 ? -val * 2 : val * 2 - 1);
}


x86 assembly (clang, -O0):
<bs_size_se>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1135 <bs_size_se+0x25>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <bs_size_se+0x31>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <bs_size_ue@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bs_size_se>:
lea    (%rdi,%rdi,1),%eax
neg    %eax
test   %edi,%edi
lea    -0x1(%rdi,%rdi,1),%edi
cmovle %eax,%edi
jmp    1030 <bs_size_ue@plt>

LLVM IR (-O0):
define i32 @bs_size_se(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
%8 = mul nsw i32 %7, 2
br label %13
9: ; preds = %1
%10 = load i32, i32* %2
%11 = mul nsw i32 %10, 2
%12 = sub nsw i32 %11, 1
br label %13
13: ; preds = %9, %5
%14 = phi i32 [ %8, %5 ], [ %12, %9 ]
%15 = call i32 @bs_size_ue(i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @bs_size_se(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = mul i32 %0, -2
%4 = shl nsw i32 %0, 1
%5 = add nsw i32 %4, -1
%6 = select i1 %2, i32 %3, i32 %5
%7 = tail call i32 @bs_size_ue(i32 %6)
ret i32 %7
}
/* Variables and functions */
double lrint(double);
double fmod_one(double x) {
  double res;
  res = x - lrint(x);
  if (res < 0.0)
    return res + 1.0;
  return res;
}


x86 assembly (clang, -O0):
<fmod_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <lrint@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1167 <fmod_one+0x57>
movsd  0xea8(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1171 <fmod_one+0x61>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmod_one>:
sub    $0x18,%rsp
movapd %xmm0,(%rsp)
call   1030 <lrint@plt>
movapd (%rsp),%xmm3
subsd  %xmm0,%xmm3
movsd  0xed1(%rip),%xmm1
addsd  %xmm3,%xmm1
xorpd  %xmm2,%xmm2
movapd %xmm3,%xmm0
cmpltsd %xmm2,%xmm0
andpd  %xmm0,%xmm1
andnpd %xmm3,%xmm0
orpd   %xmm1,%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define double @fmod_one(double %0) {
%2 = tail call double @lrint(double %0)
%3 = fsub double %0, %2
%4 = fcmp olt double %3, 0.000000e+00
%5 = fadd double %3, 1.000000e+00
%6 = select i1 %4, double %5, double %3
ret double %6
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int twi_read_2byte(int);
uint16_t read_temp0() { return (twi_read_2byte(0x48) >> 4) / 16; }


x86 assembly (clang, -O0):
<read_temp0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x48,%edi
call   1030 <twi_read_2byte@plt>
sar    $0x4,%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_temp0>:
push   %rax
mov    $0x48,%edi
call   1030 <twi_read_2byte@plt>
sar    $0x4,%eax
lea    0xf(%rax),%ecx
test   %eax,%eax
cmovs  %ecx,%eax
sar    $0x4,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @read_temp0() {
%1 = call i32 @twi_read_2byte(i32 72)
%2 = ashr i32 %1, 4
%3 = sdiv i32 %2, 16
ret i32 %3
}

LLVM IR (-O2):
define i32 @read_temp0() {
%1 = tail call i32 @twi_read_2byte(i32 72)
%2 = ashr i32 %1, 4
%3 = sdiv i32 %2, 16
ret i32 %3
}