xunge/DecIR huggingface dataset:
void ff_hevc_put_hevc_uni_epel_h16_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_h16_8_sse4() {
ret void
}
void anx_dbg_print(const char *name, int status, const char *extra) {}


x86 assembly (clang, -O0):
<anx_dbg_print>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @anx_dbg_print(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @anx_dbg_print(i8* nocapture %0, i32 %1, i8* nocapture %2) {
ret void
}
float DINT_TO_REAL(int var) {
  float newvar = (float)var;
  return newvar;
}


x86 assembly (clang, -O0):
<DINT_TO_REAL>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<DINT_TO_REAL>:
cvtsi2ss %edi,%xmm0
ret

LLVM IR (-O0):
define float @DINT_TO_REAL(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to float
store float %5, float* %3
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @DINT_TO_REAL(i32 %0) {
%2 = sitofp i32 %0 to float
ret float %2
}
void DSP_Uninit(void) {}


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

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

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

LLVM IR (-O2):
define void @DSP_Uninit() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int protected_mode_call_1arg(void *func, uint32_t arg1) {
  int (*doit)(uint32_t arg1) = func;
  return doit(arg1);
}


x86 assembly (clang, -O0):
<protected_mode_call_1arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%edi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<protected_mode_call_1arg>:
mov    %rdi,%rax
mov    %esi,%edi
jmp    *%rax

LLVM IR (-O0):
define i32 @protected_mode_call_1arg(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32 (i32)*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32 (i32)*
store i32 (i32)* %7, i32 (i32)** %5
%8 = load i32 (i32)*, i32 (i32)** %5
%9 = load i32, i32* %4
%10 = call i32 %8(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @protected_mode_call_1arg(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i32 (i32)*
%4 = tail call i32 %3(i32 %1)
ret i32 %4
}
int test5(int x) { return x / -10 < 2; }


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xfffffff6,%ecx
cltd
idiv   %ecx
cmp    $0x2,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
xor    %eax,%eax
cmp    $0xffffffed,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @test5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, -10
%5 = icmp slt i32 %4, 2
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test5(i32 %0) {
%2 = icmp sgt i32 %0, -20
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
double acos(double);
double myAcos(double d) {
  if (d >= 1.0)
    return (0.0);
  if (d <= -1.0)
    return (3.1415926535897932384626433832795);
  return (acos(d));
}


x86 assembly (clang, -O0):
<myAcos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1141 <myAcos+0x31>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1175 <myAcos+0x65>
movsd  0xebf(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1166 <myAcos+0x56>
movsd  0xeb4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1175 <myAcos+0x65>
movsd  -0x10(%rbp),%xmm0
call   1030 <acos@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myAcos>:
xorps  %xmm1,%xmm1
ucomisd 0xee5(%rip),%xmm0
jae    1138 <myAcos+0x28>
movsd  0xeeb(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1130 <myAcos+0x20>
jmp    1030 <acos@plt>
movsd  0xed0(%rip),%xmm1
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @myAcos(double %0) {
%2 = fcmp ult double %0, 1.000000e+00
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fcmp ugt double %0, -1.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call double @acos(double %0)
br label %7
7: ; preds = %3, %1, %5
%8 = phi double [ %6, %5 ], [ 0.000000e+00, %1 ], [ 0x400921FB54442D18, %3 ]
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct timeval {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int gettimeofday(struct timeval *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  struct timeval tv;
  int n;
  time_t t;
  t = time(NULL);
  n = gettimeofday(&tv, 0);
  printf("%d  %ld %ld  ..  %ld\n", n, tv.tv_sec, tv.tv_usec, t);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x18(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%ebx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    0x8(%rsp),%ecx
mov    0xc(%rsp),%edx
lea    0xea7(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
@.str = [22 x i8] c"%d %ld %ld .. %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timeval
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @time(i32* null)
store i32 %5, i32* %4
%6 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%11 = load i32, i32* %10
%12 = load i32, i32* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9, i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
@.str = [22 x i8] c"%d %ld %ld .. %ld\0A\00"
define i32 @main() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = tail call i32 @time(i32* null)
%4 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6, i32 %8, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ des();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ rc4();
int /*<<< orphan*/ stderr;
main() {
  fprintf(stderr, "rc4\n");
  rc4();
  fprintf(stderr, "cfb des\n");
  des();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1040 <rc4@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1030 <des@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
lea    0xebf(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1040 <rc4@plt>
mov    (%rbx),%edi
lea    0xeaf(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1030 <des@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [5 x i8] c"rc4\0A\00"
@.str.1 = [9 x i8] c"cfb des\0A\00"
define i32 @main() {
%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))
%3 = call i32 (...) @rc4()
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @des()
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [5 x i8] c"rc4\0A\00"
@.str.1 = [9 x i8] c"cfb des\0A\00"
define i32 @main() {
%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))
%3 = tail call i32 (...) @rc4()
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (...) @des()
ret i32 0
}
/* Type definitions */
typedef float uint16_t;

/* Variables and functions */
uint16_t tcs34725_calculateLux(uint16_t r, uint16_t g, uint16_t b) {
  float illuminance;
  illuminance = (-0.32466F * r) + (1.57837F * g) + (-0.73191F * b);
  return (uint16_t)illuminance;
}


x86 assembly (clang, -O0):
<tcs34725_calculateLux>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  0xee8(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  0xed7(%rip),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
movss  0xebe(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcs34725_calculateLux>:
mulss  0xef8(%rip),%xmm1
mulss  0xef4(%rip),%xmm0
addss  %xmm1,%xmm0
mulss  0xeec(%rip),%xmm2
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @tcs34725_calculateLux(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %4
%9 = load float, float* %5
%10 = fmul float 0x3FF94100E0000000, %9
%11 = call float @llvm.fmuladd.f32(float 0xBFD4C73AC0000000, float %8, float %10)
%12 = load float, float* %6
%13 = call float @llvm.fmuladd.f32(float 0xBFE76BCE80000000, float %12, float %11)
store float %13, float* %7
%14 = load float, float* %7
ret float %14
}

LLVM IR (-O2):
define float @tcs34725_calculateLux(float %0, float %1, float %2) {
%4 = fmul float %1, 0x3FF94100E0000000
%5 = tail call float @llvm.fmuladd.f32(float %0, float 0xBFD4C73AC0000000, float %4)
%6 = tail call float @llvm.fmuladd.f32(float %2, float 0xBFE76BCE80000000, float %5)
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help(void) {
  printf("Usage:\n\n\t-b <boot sector>\n\t-s <DiegOS>\n\t-d <image>\n\n");
}


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

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

LLVM IR (-O0):
@.str = [53 x i8] c"Usage:\0A\0A\09-b <boot sector>\0A\09-s <DiegOS>\0A\09-d <image>\0A\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [52 x i8] c"Usage:\0A\0A\09-b <boot sector>\0A\09-s <DiegOS>\0A\09-d <image>\0A\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int semget(int, int, int);
int open_semaphore(int key) { return semget(key, 1, 0660); }


x86 assembly (clang, -O0):
<open_semaphore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
mov    $0x1b0,%edx
call   1030 <semget@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_semaphore>:
mov    $0x1,%esi
mov    $0x1b0,%edx
jmp    1030 <semget@plt>

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

LLVM IR (-O2):
define i32 @open_semaphore(i32 %0) {
%2 = tail call i32 @semget(i32 %0, i32 1, i32 432)
ret i32 %2
}
__attribute__((no_sanitize("undefined"))) char *
blacklist_0(char *base, unsigned long offset) {
  return base + offset;
}


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

x86 assembly (clang, -O2):
<blacklist_0>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i8* @blacklist_0(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 = getelementptr inbounds i8, i8* %5, i64 %6
ret i8* %7
}

LLVM IR (-O2):
define i8* @blacklist_0(i8* readnone %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long);
int /*<<< orphan*/ testBool(int);
void testLong(long long X) {
  printf("%lld ", X);
  testBool(X != 0);
}


x86 assembly (clang, -O0):
<testLong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <testBool@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testLong>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
pop    %rbx
jmp    1030 <testBool@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%lld \00"
define void @testLong(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %3)
%5 = load i64, i64* %2
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @testBool(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%lld \00"
define void @testLong(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %0)
%3 = icmp ne i64 %0, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @testBool(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ stderr;
char *strerror(int);
void log_csv_error(int len, int err) {
  fprintf(stderr, "unable to write %d bytes to csv %s\n", len, strerror(err));
}


x86 assembly (clang, -O0):
<log_csv_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <strerror@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    %rax,%rcx
lea    0xea8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_csv_error>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2eb4(%rip),%rax
mov    (%rax),%ebp
mov    %esi,%edi
call   1040 <strerror@plt>
lea    0xec4(%rip),%rsi
mov    %ebp,%edi
mov    %ebx,%edx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"unable to write %d bytes to csv %s\0A\00"
define void @log_csv_error(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i8* @strerror(i32 %7)
%9 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %8)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"unable to write %d bytes to csv %s\0A\00"
define void @log_csv_error(i32 %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i8* @strerror(i32 %1)
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *argv0) {
  fprintf(stderr, "Usage: %s host/port[/ttl] host/port[/ttl] [...]\n", argv0);
}


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>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [49 x i8] c"Usage: %s host/port[/ttl] host/port[/ttl] [...]\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 ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [49 x i8] c"Usage: %s host/port[/ttl] host/port[/ttl] [...]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
char char_unescape(char d) {
  switch (d) {
  case 'n':
    return '\n';
  case 't':
    return '\t';
  default:
    return d;
  }
}


x86 assembly (clang, -O0):
<char_unescape>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x6e,%eax
je     1130 <char_unescape+0x30>
jmp    111f <char_unescape+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x74,%eax
je     1139 <char_unescape+0x39>
jmp    1142 <char_unescape+0x42>
movb   $0xa,-0x1(%rbp)
jmp    1148 <char_unescape+0x48>
movb   $0x9,-0x1(%rbp)
jmp    1148 <char_unescape+0x48>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_unescape>:
cmp    $0x6e,%edi
je     110f <char_unescape+0xf>
mov    %edi,%eax
cmp    $0x74,%edi
jne    110e <char_unescape+0xe>
mov    $0x9,%al
ret
mov    $0xa,%al
ret

LLVM IR (-O0):
define signext i8 @char_unescape(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %8 [
i32 110, label %6
i32 116, label %7
]
6: ; preds = %1
store i8 10, i8* %2
br label %10
7: ; preds = %1
store i8 9, i8* %2
br label %10
8: ; preds = %1
%9 = load i8, i8* %3
store i8 %9, i8* %2
br label %10
10: ; preds = %8, %7, %6
%11 = load i8, i8* %2
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @char_unescape(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %4 [
i32 110, label %5
i32 116, label %3
]
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3
%6 = phi i8 [ %0, %4 ], [ 9, %3 ], [ 10, %1 ]
ret i8 %6
}
/* Type definitions */
typedef int uint32_t;
struct _WsbmFenceObject {
  int dummy;
};

/* Variables and functions */
int wsbmFenceSignaledTypeCached(struct _WsbmFenceObject *);
int wsbmFenceSignaledCached(struct _WsbmFenceObject *fence,
                            uint32_t flush_type) {
  uint32_t signaled_types = wsbmFenceSignaledTypeCached(fence);
  return ((signaled_types & flush_type) == flush_type);
}


x86 assembly (clang, -O0):
<wsbmFenceSignaledCached>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <wsbmFenceSignaledTypeCached@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wsbmFenceSignaledCached>:
push   %rbx
mov    %esi,%ebx
call   1030 <wsbmFenceSignaledTypeCached@plt>
not    %eax
xor    %ecx,%ecx
test   %eax,%ebx
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct._WsbmFenceObject = type { i32 }
define i32 @wsbmFenceSignaledCached(%struct._WsbmFenceObject* %0, i32 %1) {
%3 = alloca %struct._WsbmFenceObject*
%4 = alloca i32
%5 = alloca i32
store %struct._WsbmFenceObject* %0, %struct._WsbmFenceObject** %3
store i32 %1, i32* %4
%6 = load %struct._WsbmFenceObject*, %struct._WsbmFenceObject** %3
%7 = call i32 @wsbmFenceSignaledTypeCached(%struct._WsbmFenceObject* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = and i32 %8, %9
%11 = load i32, i32* %4
%12 = icmp eq i32 %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
%struct._WsbmFenceObject = type { i32 }
define i32 @wsbmFenceSignaledCached(%struct._WsbmFenceObject* %0, i32 %1) {
%3 = tail call i32 @wsbmFenceSignaledTypeCached(%struct._WsbmFenceObject* %0)
%4 = and i32 %3, %1
%5 = icmp eq i32 %4, %1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_socket_server_new_ipv4_string() {
  printf("NOT IMPLEMENTED:"
         "pa_socket_server_new_ipv4_string"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [50 x i8] c"NOT IMPLEMENTED:pa_socket_server_new_ipv4_string\0A\00"
define i32 @pa_socket_server_new_ipv4_string() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [49 x i8] c"NOT IMPLEMENTED:pa_socket_server_new_ipv4_string\00"
define i32 @pa_socket_server_new_ipv4_string() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct yaffs_stat {
  int dummy;
};
struct yaffs_obj {
  int dummy;
};

/* Variables and functions */
int yaffsfs_DoStatOrLStat_reldir(struct yaffs_obj *, char const *,
                                 struct yaffs_stat *, int /*<<< orphan*/);
int yaffs_stat_reldir(struct yaffs_obj *reldir, const char *path,
                      struct yaffs_stat *buf) {
  return yaffsfs_DoStatOrLStat_reldir(reldir, path, buf, 0);
}


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

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

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

LLVM IR (-O2):
%struct.yaffs_obj = type { i32 }
%struct.yaffs_stat = type { i32 }
define i32 @yaffs_stat_reldir(%struct.yaffs_obj* %0, i8* %1, %struct.yaffs_stat* %2) {
%4 = tail call i32 @yaffsfs_DoStatOrLStat_reldir(%struct.yaffs_obj* %0, i8* %1, %struct.yaffs_stat* %2, i32 0)
ret i32 %4
}
digit(c) { return (c >= '0' && c <= '9'); }


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

x86 assembly (clang, -O2):
<digit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @digit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
float test_roundf(float x) { return __builtin_roundf(x); }


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

x86 assembly (clang, -O2):
<test_roundf>:
jmp    1030 <roundf@plt>

LLVM IR (-O0):
define float @test_roundf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.round.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @test_roundf(float %0) {
%2 = tail call float @llvm.round.f32(float %0)
ret float %2
}
/* Variables and functions */
int inb(int);
int /*<<< orphan*/ iowait();
int /*<<< orphan*/ outb(int, int);
int keyboard_scan() {
  int code;
  int ack;
  code = inb(0x60);
  iowait();
  ack = inb(0x61);
  iowait();
  ack |= 0x80;
  outb(ack, 0x61);
  iowait();
  outb(ack, 0x61);
  iowait();
  return code;
}


x86 assembly (clang, -O0):
<keyboard_scan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x60,%edi
call   1050 <inb@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <iowait@plt>
mov    $0x61,%edi
call   1050 <inb@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <iowait@plt>
mov    -0x8(%rbp),%eax
or     $0x80,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x61,%esi
call   1030 <outb@plt>
mov    $0x0,%al
call   1040 <iowait@plt>
mov    -0x8(%rbp),%edi
mov    $0x61,%esi
call   1030 <outb@plt>
mov    $0x0,%al
call   1040 <iowait@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard_scan>:
push   %rbp
push   %rbx
push   %rax
mov    $0x60,%edi
call   1050 <inb@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <iowait@plt>
mov    $0x61,%edi
call   1050 <inb@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <iowait@plt>
or     $0x80,%ebp
mov    %ebp,%edi
mov    $0x61,%esi
call   1030 <outb@plt>
xor    %eax,%eax
call   1040 <iowait@plt>
mov    %ebp,%edi
mov    $0x61,%esi
call   1030 <outb@plt>
xor    %eax,%eax
call   1040 <iowait@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @keyboard_scan() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @inb(i32 96)
store i32 %3, i32* %1
%4 = call i32 (...) @iowait()
%5 = call i32 @inb(i32 97)
store i32 %5, i32* %2
%6 = call i32 (...) @iowait()
%7 = load i32, i32* %2
%8 = or i32 %7, 128
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @outb(i32 %9, i32 97)
%11 = call i32 (...) @iowait()
%12 = load i32, i32* %2
%13 = call i32 @outb(i32 %12, i32 97)
%14 = call i32 (...) @iowait()
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @keyboard_scan() {
%1 = tail call i32 @inb(i32 96)
%2 = tail call i32 (...) @iowait()
%3 = tail call i32 @inb(i32 97)
%4 = tail call i32 (...) @iowait()
%5 = or i32 %3, 128
%6 = tail call i32 @outb(i32 %5, i32 97)
%7 = tail call i32 (...) @iowait()
%8 = tail call i32 @outb(i32 %5, i32 97)
%9 = tail call i32 (...) @iowait()
ret i32 %1
}
/* Variables and functions */
int i2c_smbus_read_byte_data(int, int);
int hummingboardI2CReadReg8(int fd, int reg) {
  return i2c_smbus_read_byte_data(fd, reg);
}


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

x86 assembly (clang, -O2):
<hummingboardI2CReadReg8>:
jmp    1030 <i2c_smbus_read_byte_data@plt>

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

LLVM IR (-O2):
define i32 @hummingboardI2CReadReg8(i32 %0, i32 %1) {
%3 = tail call i32 @i2c_smbus_read_byte_data(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void syserr(const char *err) {
  fprintf(stderr, "%s\n", err);
  exit(1);
}


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

x86 assembly (clang, -O2):
<syserr>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @syserr(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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @syserr(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ errx(int /*<<< orphan*/, char *);
char *strdup(char const *);
char *xstrdup(const char *s) {
  char *str;
  assert(s != NULL);
  str = strdup(s);
  if (str == NULL)
    errx(EXIT_FAILURE, "out of memory string duplication");
  return str;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117b <xstrdup+0x4b>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
lea    0xe8a(%rip),%rsi
call   1030 <errx@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1050 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1167 <xstrdup+0x37>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1030 <errx@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [33 x i8] c"out of memory string duplication\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i8*, i8** %2
%9 = call i8* @strdup(i8* %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @errx(i32 %13, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %12, %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [33 x i8] c"out of memory string duplication\00"
define noalias i8* @xstrdup(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i8* @strdup(i8* %0)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @errx(i32 %8, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %7, %1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ assert_perror(int);
void assert3(void) { assert_perror(2); }


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

x86 assembly (clang, -O2):
<assert3>:
mov    $0x2,%edi
jmp    1030 <assert_perror@plt>

LLVM IR (-O0):
define void @assert3() {
%1 = call i32 @assert_perror(i32 2)
ret void
}

LLVM IR (-O2):
define void @assert3() {
%1 = tail call i32 @assert_perror(i32 2)
ret void
}
/* Variables and functions */
int LUMI_test_main(int, char **);
int main(int argc, char *argv[]) { return LUMI_test_main(argc, argv); }


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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <LUMI_test_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <LUMI_test_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @LUMI_test_main(i32 %0, i8** %1)
ret i32 %3
}
/* Type definitions */
struct afp_volume {
  int dummy;
};

/* Variables and functions */
int EPERM;
int extra_translate(struct afp_volume *, char const *, char **);
int /*<<< orphan*/ free(char *);
int appledouble_readlink(struct afp_volume *volume, const char *path, char *buf,
                         size_t size) {
  int resource;
  char *newpath;
  resource = extra_translate(volume, path, &newpath);
  free(newpath);
  if (resource == 0)
    return 0;
  return -EPERM;
}


x86 assembly (clang, -O0):
<appledouble_readlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x38(%rbp),%rdx
call   1040 <extra_translate@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x0,-0x2c(%rbp)
jne    116b <appledouble_readlink+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    1179 <appledouble_readlink+0x59>
xor    %eax,%eax
mov    0x2e64(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appledouble_readlink>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rdx
call   1040 <extra_translate@plt>
mov    %eax,%ebx
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    0x2e96(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
test   %ebx,%ebx
cmove  %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.afp_volume = type { i32 }
@EPERM = global i32 0
define i32 @appledouble_readlink(%struct.afp_volume* %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca %struct.afp_volume*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca i8*
store %struct.afp_volume* %0, %struct.afp_volume** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
%12 = load %struct.afp_volume*, %struct.afp_volume** %6
%13 = load i8*, i8** %7
%14 = call i32 @extra_translate(%struct.afp_volume* %12, i8* %13, i8** %11)
store i32 %14, i32* %10
%15 = load i8*, i8** %11
%16 = call i32 @free(i8* %15)
%17 = load i32, i32* %10
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %4
store i32 0, i32* %5
br label %23
20: ; preds = %4
%21 = load i32, i32* @EPERM
%22 = sub nsw i32 0, %21
store i32 %22, i32* %5
br label %23
23: ; preds = %20, %19
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
%struct.afp_volume = type { i32 }
@EPERM = global i32 0
define i32 @appledouble_readlink(%struct.afp_volume* %0, i8* %1, i8* nocapture readnone %2, i64 %3) {
%5 = alloca i8*
%6 = bitcast i8** %5 to i8*
%7 = call i32 @extra_translate(%struct.afp_volume* %0, i8* %1, i8** %5)
%8 = load i8*, i8** %5
%9 = call i32 @free(i8* %8)
%10 = icmp eq i32 %7, 0
%11 = load i32, i32* @EPERM
%12 = sub nsw i32 0, %11
%13 = select i1 %10, i32 0, i32 %12
ret i32 %13
}
/* Variables and functions */
double d_abs(double *);
double intr_wrap_092(double p1) { return d_abs(&p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_092>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <d_abs@plt>
pop    %rax
ret

LLVM IR (-O0):
define double @intr_wrap_092(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double @d_abs(double* %2)
ret double %3
}

LLVM IR (-O2):
define double @intr_wrap_092(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double @d_abs(double* %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ cadre();
int /*<<< orphan*/ effaceCadre();
int /*<<< orphan*/ printf(char *, int);
void afficheInt(int entier) {
  effaceCadre();
  printf("  %u\n", entier);
  cadre();
}


x86 assembly (clang, -O0):
<afficheInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <effaceCadre@plt>
mov    -0x4(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <cadre@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<afficheInt>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <effaceCadre@plt>
lea    0xebf(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <cadre@plt>

LLVM IR (-O0):
@.str = [6 x i8] c" %u\0A\00"
define void @afficheInt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @effaceCadre()
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @cadre()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c" %u\0A\00"
define void @afficheInt(i32 %0) {
%2 = tail call i32 (...) @effaceCadre()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 (...) @cadre()
ret void
}
float raw_to_float(const unsigned char *raw) { return *(float *)raw; }


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

x86 assembly (clang, -O2):
<raw_to_float>:
movss  (%rdi),%xmm0
ret

LLVM IR (-O0):
define float @raw_to_float(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to float*
%5 = load float, float* %4
ret float %5
}

LLVM IR (-O2):
define float @raw_to_float(i8* nocapture %0) {
%2 = bitcast i8* %0 to float*
%3 = load float, float* %2
ret float %3
}
int foo(unsigned long *addr) {
  int __ret_pu;
  unsigned long __pu_val;
  return ({
    asm volatile("call __put_user_"
                 "8"
                 : "=a"(__ret_pu)
                 : "0"(__pu_val), "c"(addr)
                 : "ebx");
    __ret_pu;
  });
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
call   1030 <__put_user_8@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %rdi,%rcx
call   1030 <__put_user_8@plt>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @foo(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i64* %0, i64** %2
%6 = load i64, i64* %4
%7 = load i64*, i64** %2
%8 = call i64 asm sideeffect "call __put_user_8", "={ax},0,{cx},~{ebx},~{dirflag},~{fpsr},~{flags}"(i64 %6, i64* %7)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
%10 = load i32, i32* %3
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @foo(i64* %0) {
%2 = tail call i64 asm sideeffect "call __put_user_8", "={ax},0,{cx},~{ebx},~{dirflag},~{fpsr},~{flags}"(i64 undef, i64* %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
long atol(char const *);
long CLongChars(const char *Src) { return atol(Src); }


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

x86 assembly (clang, -O2):
<CLongChars>:
jmp    1030 <atol@plt>

LLVM IR (-O0):
define i64 @CLongChars(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @atol(i8* %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @CLongChars(i8* nocapture %0) {
%2 = tail call i64 @atol(i8* %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void seedRand() { srand((unsigned int)time(NULL)); }


x86 assembly (clang, -O0):
<seedRand>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<seedRand>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @seedRand() {
%1 = call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = call i32 @srand(i32 %2)
ret void
}

LLVM IR (-O2):
define void @seedRand() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
ret void
}
void clear(int a[10]) {
  for (int i = 0; i < 10; i++) {
    a[i] = 0;
  }
}


x86 assembly (clang, -O0):
<clear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1136 <clear+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <clear+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear>:
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movq   $0x0,0x20(%rdi)
ret

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

LLVM IR (-O2):
define void @clear(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_vertical(int);
int main(int argc, char **argv) {
  int a = 1234;
  print_vertical(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4d2,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <print_vertical@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4d2,%edi
call   1030 <print_vertical@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @print_vertical(i32 1234)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ NAME_CONSTRAINTS;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ NAME_CONSTRAINTS_it;
NAME_CONSTRAINTS *NAME_CONSTRAINTS_new(void) {
  return (NAME_CONSTRAINTS *)ASN1_item_new(&NAME_CONSTRAINTS_it);
}


x86 assembly (clang, -O0):
<NAME_CONSTRAINTS_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NAME_CONSTRAINTS_new>:
mov    0x2ee1(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@NAME_CONSTRAINTS_it = global i32 0
define i32* @NAME_CONSTRAINTS_new() {
%1 = call i64 @ASN1_item_new(i32* @NAME_CONSTRAINTS_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@NAME_CONSTRAINTS_it = global i32 0
define i32* @NAME_CONSTRAINTS_new() {
%1 = tail call i64 @ASN1_item_new(i32* @NAME_CONSTRAINTS_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
int f(x)
float x;
{ return 0; }


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

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

LLVM IR (-O0):
define i32 @f(double %0) {
%2 = alloca float
%3 = fptrunc double %0 to float
store float %3, float* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @f(double %0) {
ret i32 0
}
/* Variables and functions */
int f456(int *);
int f457(int *p) { return f456(p); }


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

x86 assembly (clang, -O2):
<f457>:
jmp    1030 <f456@plt>

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

LLVM IR (-O2):
define i32 @f457(i32* %0) {
%2 = tail call i32 @f456(i32* %0)
ret i32 %2
}