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

/* Variables and functions */
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int _sighold(int sig) {
  sigset_t block_mask;
  sigemptyset(&block_mask);
  sigaddset(&block_mask, sig);
  return sigprocmask(SIG_BLOCK, &block_mask, NULL);
}


x86 assembly (clang, -O0):
<_sighold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    -0x4(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sighold>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <sigemptyset@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <sigaddset@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
define i32 @_sighold(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @sigemptyset(i32* %3)
%5 = load i32, i32* %2
%6 = call i32 @sigaddset(i32* %3, i32 %5)
%7 = load i32, i32* @SIG_BLOCK
%8 = call i32 @sigprocmask(i32 %7, i32* %3, i32* null)
ret i32 %8
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
define i32 @_sighold(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sigemptyset(i32* %2)
%5 = call i32 @sigaddset(i32* %2, i32 %0)
%6 = load i32, i32* @SIG_BLOCK
%7 = call i32 @sigprocmask(i32 %6, i32* %2, i32* null)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ stackPush(int, int);
int /*<<< orphan*/ switchActiveContext(int);
int primitiveContext_Resume_(int receiver, int *arguments) {
  stackPush(receiver, arguments[0]);
  switchActiveContext(receiver);
  return receiver;
}


x86 assembly (clang, -O0):
<primitiveContext_Resume_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1040 <stackPush@plt>
mov    -0x4(%rbp),%edi
call   1030 <switchActiveContext@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitiveContext_Resume_>:
push   %rbx
mov    %edi,%ebx
mov    (%rsi),%esi
call   1040 <stackPush@plt>
mov    %ebx,%edi
call   1030 <switchActiveContext@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @primitiveContext_Resume_(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 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = call i32 @stackPush(i32 %5, i32 %8)
%10 = load i32, i32* %3
%11 = call i32 @switchActiveContext(i32 %10)
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @primitiveContext_Resume_(i32 returned %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @stackPush(i32 %0, i32 %3)
%5 = tail call i32 @switchActiveContext(i32 %0)
ret i32 %0
}
int AddNum(int a, int b) { return a + b; }


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

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

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

LLVM IR (-O2):
define i32 @AddNum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int const log(float);
float getTemperature(int value, const float R, const int B) {
  float resistance = (float)(1023 - value) * R / value;
  float temperature = 1.0f / (log(resistance / R) / B + 1 / 298.15) - 273.15;
  return temperature;
}


x86 assembly (clang, -O0):
<getTemperature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x3ff,%eax
sub    -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm0
mulss  -0x8(%rbp),%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
call   1030 <log@plt>
cltd
idivl  -0xc(%rbp)
cvtsi2sd %eax,%xmm1
movsd  0xeaf(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xe9b(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xe87(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTemperature>:
push   %rbx
mov    $0x3ff,%eax
sub    %edi,%eax
cvtsi2ss %eax,%xmm1
cvtsi2ss %edi,%xmm2
mov    %esi,%ebx
mulss  %xmm0,%xmm1
divss  %xmm2,%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
call   1030 <log@plt>
cltd
idiv   %ebx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0xeb8(%rip),%xmm0
movsd  0xeb8(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xeb4(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define float @getTemperature(i32 %0, float %1, i32 %2) {
%4 = alloca i32
%5 = alloca float
%6 = alloca i32
%7 = alloca float
%8 = alloca float
store i32 %0, i32* %4
store float %1, float* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = sub nsw i32 1023, %9
%11 = sitofp i32 %10 to float
%12 = load float, float* %5
%13 = fmul float %11, %12
%14 = load i32, i32* %4
%15 = sitofp i32 %14 to float
%16 = fdiv float %13, %15
store float %16, float* %7
%17 = load float, float* %7
%18 = load float, float* %5
%19 = fdiv float %17, %18
%20 = call i32 @log(float %19)
%21 = load i32, i32* %6
%22 = sdiv i32 %20, %21
%23 = sitofp i32 %22 to double
%24 = fadd double %23, 0x3F6B79E1DCB5DB83
%25 = fdiv double 1.000000e+00, %24
%26 = fsub double %25, 2.731500e+02
%27 = fptrunc double %26 to float
store float %27, float* %8
%28 = load float, float* %8
ret float %28
}

LLVM IR (-O2):
define float @getTemperature(i32 %0, float %1, i32 %2) {
%4 = sub nsw i32 1023, %0
%5 = sitofp i32 %4 to float
%6 = fmul float %5, %1
%7 = sitofp i32 %0 to float
%8 = fdiv float %6, %7
%9 = fdiv float %8, %1
%10 = tail call i32 @log(float %9)
%11 = sdiv i32 %10, %2
%12 = sitofp i32 %11 to double
%13 = fadd double %12, 0x3F6B79E1DCB5DB83
%14 = fdiv double 1.000000e+00, %13
%15 = fadd double %14, -2.731500e+02
%16 = fptrunc double %15 to float
ret float %16
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void net_enable_dhcpcd(void) {
  system("killall -2 "
         "dhcpcd");
  system("/opt/ipnc/dhcpcd/"
         "dhcpcd");
}


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

x86 assembly (clang, -O2):
<net_enable_dhcpcd>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
lea    0xeee(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"killall -2 dhcpcd\00"
@.str.1 = [24 x i8] c"/opt/ipnc/dhcpcd/dhcpcd\00"
define void @net_enable_dhcpcd() {
%1 = call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"killall -2 dhcpcd\00"
@.str.1 = [24 x i8] c"/opt/ipnc/dhcpcd/dhcpcd\00"
define void @net_enable_dhcpcd() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ roundf(float);
long lroundf(float x) { return (long)roundf(x); }


x86 assembly (clang, -O0):
<lroundf>:
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):
<lroundf>:
jmp    1030 <roundf@plt>

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

LLVM IR (-O2):
define i64 @lroundf(float %0) {
%2 = tail call i64 @roundf(float %0)
ret i64 %2
}
int GetNextThreadId() {
  static long currentThreadID = 0;
  return ++currentThreadID;
}


x86 assembly (clang, -O0):
<GetNextThreadId>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1d(%rip),%rax
add    $0x1,%rax
mov    %rax,0x2f12(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetNextThreadId>:
mov    0x2f21(%rip),%rax
add    $0x1,%rax
mov    %rax,0x2f16(%rip)
ret

LLVM IR (-O0):
@GetNextThreadId.currentThreadID = internal global i64 0
define i32 @GetNextThreadId() {
%1 = load i64, i64* @GetNextThreadId.currentThreadID
%2 = add nsw i64 %1, 1
store i64 %2, i64* @GetNextThreadId.currentThreadID
%3 = trunc i64 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
@GetNextThreadId.currentThreadID = internal unnamed_addr global i64 0
define i32 @GetNextThreadId() {
%1 = load i64, i64* @GetNextThreadId.currentThreadID
%2 = add nsw i64 %1, 1
store i64 %2, i64* @GetNextThreadId.currentThreadID
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
void dllockinit(void *context, void *(*lock_create)(void *context),
                void (*rlock_acquire)(void *lock),
                void (*wlock_acquire)(void *lock),
                void (*lock_release)(void *lock),
                void (*lock_destroy)(void *lock),
                void (*context_destroy)(void *context)) {
  if (context_destroy != NULL)
    context_destroy(context);
}


x86 assembly (clang, -O0):
<dllockinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpq   $0x0,0x10(%rbp)
je     1139 <dllockinit+0x39>
mov    0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dllockinit>:
mov    0x8(%rsp),%rax
test   %rax,%rax
je     110c <dllockinit+0xc>
jmp    *%rax
ret

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

LLVM IR (-O2):
define void @dllockinit(i8* %0, i8* (i8*)* nocapture readnone %1, void (i8*)* nocapture readnone %2, void (i8*)* nocapture readnone %3, void (i8*)* nocapture readnone %4, void (i8*)* nocapture readnone %5, void (i8*)* %6) {
%8 = icmp eq void (i8*)* %6, null
br i1 %8, label %10, label %9
9: ; preds = %7
tail call void %6(i8* %0)
br label %10
10: ; preds = %9, %7
ret void
}
/* Variables and functions */
int number_mm();
long number_bits(int width) { return number_mm() & ((1 << width) - 1); }


x86 assembly (clang, -O0):
<number_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <number_mm@plt>
mov    -0x4(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_bits>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <number_mm@plt>
mov    $0xffffffff,%edx
mov    %ebx,%ecx
shl    %cl,%edx
not    %edx
and    %eax,%edx
movslq %edx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @number_bits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @number_mm()
%4 = load i32, i32* %2
%5 = shl i32 1, %4
%6 = sub nsw i32 %5, 1
%7 = and i32 %3, %6
%8 = sext i32 %7 to i64
ret i64 %8
}

LLVM IR (-O2):
define i64 @number_bits(i32 %0) {
%2 = tail call i32 (...) @number_mm()
%3 = shl nsw i32 -1, %0
%4 = xor i32 %3, -1
%5 = and i32 %2, %4
%6 = sext i32 %5 to i64
ret i64 %6
}
/* Variables and functions */
int physmem_total();
double physmem_available() { return physmem_total() / 4; }


x86 assembly (clang, -O0):
<physmem_available>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <physmem_total@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<physmem_available>:
push   %rax
xor    %eax,%eax
call   1030 <physmem_total@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x2,%ecx
cvtsi2sd %ecx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @physmem_available() {
%1 = call i32 (...) @physmem_total()
%2 = sdiv i32 %1, 4
%3 = sitofp i32 %2 to double
ret double %3
}

LLVM IR (-O2):
define double @physmem_available() {
%1 = tail call i32 (...) @physmem_total()
%2 = sdiv i32 %1, 4
%3 = sitofp i32 %2 to double
ret double %3
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int initialize_quaddobl_monodromy(int n, int d, int k) {
  int fail;
  double *c;
  int dk[2];
  dk[0] = d;
  dk[1] = k;
  fail = _ada_use_c2phc4c(670, &n, dk, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<initialize_quaddobl_monodromy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x29e,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_quaddobl_monodromy>:
sub    $0x18,%rsp
mov    %edi,0xc(%rsp)
mov    %esi,0x10(%rsp)
mov    %edx,0x14(%rsp)
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    $0x29e,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @initialize_quaddobl_monodromy(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
%9 = alloca [2 x i32]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %5
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
store i32 %10, i32* %11
%12 = load i32, i32* %6
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
store i32 %12, i32* %13
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%15 = load double*, double** %8
%16 = call i32 @_ada_use_c2phc4c(i32 670, i32* %4, i32* %14, double* %15, i32 0)
store i32 %16, i32* %7
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @initialize_quaddobl_monodromy(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca [2 x i32]
store i32 %0, i32* %4
%6 = bitcast [2 x i32]* %5 to i8*
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %1, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %2, i32* %8
%9 = call i32 @_ada_use_c2phc4c(i32 670, i32* %4, i32* %7, double* undef, i32 0)
ret i32 %9
}
void rc_cpt_lock(void) { return; }


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

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

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

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

/* Variables and functions */
int fscanf(int /*<<< orphan*/ *, char *, float *);
int zomp_readFloat(void *file, float *val) {
  return fscanf((FILE *)file, "%f", val);
}


x86 assembly (clang, -O0):
<zomp_readFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <fscanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zomp_readFloat>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fscanf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @zomp_readFloat(i8* %0, float* %1) {
%3 = alloca i8*
%4 = alloca float*
store i8* %0, i8** %3
store float* %1, float** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load float*, float** %4
%8 = call i32 @fscanf(i32* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @zomp_readFloat(i8* nocapture %0, float* %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cube(double);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
int main(void) {
  double i;
  printf("Please enter the number to be cubed:\n");
  scanf("%lf", &i);
  cube(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <cube@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
call   1050 <cube@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Please enter the number to be cubed:\0A\00"
@.str.1 = [4 x i8] c"%lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = call i32 @cube(double %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%lf\00"
@str = [37 x i8] c"Please enter the number to be cubed:\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = call i32 @cube(double %5)
ret i32 0
}
/* Variables and functions */
scalar_t__ xrand();
int rand_range(int _min, int _max) {
  return ((int)xrand() % (_max - _min + 1)) + _min;
}


x86 assembly (clang, -O0):
<rand_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <xrand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_range>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <xrand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rand_range(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i64 (...) @xrand()
%6 = trunc i64 %5 to i32
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 1
%11 = srem i32 %6, %10
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @rand_range(i32 %0, i32 %1) {
%3 = tail call i64 (...) @xrand()
%4 = trunc i64 %3 to i32
%5 = sub i32 1, %0
%6 = add i32 %5, %1
%7 = srem i32 %4, %6
%8 = add nsw i32 %7, %0
ret i32 %8
}
int snes2pc(int ad) { return (((ad & 0x7f0000) >> 1) | (ad & 0x7fff)); }


x86 assembly (clang, -O0):
<snes2pc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f0000,%eax
sar    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x7fff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<snes2pc>:
mov    %edi,%eax
shr    %eax
and    $0x3f8000,%eax
and    $0x7fff,%edi
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @snes2pc(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 4161536
%4 = and i32 %0, 32767
%5 = or i32 %3, %4
ret i32 %5
}
int hasslash(s)
char *s;
{
  for (; *s; ++s)
    if (*s == '/')
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<hasslash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1147 <hasslash+0x47>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1131 <hasslash+0x31>
movl   $0x1,-0x4(%rbp)
jmp    114e <hasslash+0x4e>
jmp    1136 <hasslash+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <hasslash+0x8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasslash>:
movzbl (%rdi),%eax
test   %al,%al
je     1111 <hasslash+0x11>
cmp    $0x2f,%al
je     1114 <hasslash+0x14>
add    $0x1,%rdi
jmp    1100 <hasslash>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @hasslash(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %8
i8 47, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %9
}
unsigned chizu_internal_next_power_of_2(unsigned n) {
  n--;
  n |= n >> 1;
  n |= n >> 2;
  n |= n >> 4;
  n |= n >> 8;
  n |= n >> 16;
  n++;
  return n;
}


x86 assembly (clang, -O0):
<chizu_internal_next_power_of_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chizu_internal_next_power_of_2>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
shr    %ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
shr    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
shr    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @chizu_internal_next_power_of_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = lshr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = lshr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = lshr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = lshr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add i32 %25, 1
store i32 %26, i32* %2
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @chizu_internal_next_power_of_2(i32 %0) {
%2 = add i32 %0, -1
%3 = lshr i32 %2, 1
%4 = or i32 %3, %2
%5 = lshr i32 %4, 2
%6 = or i32 %5, %4
%7 = lshr i32 %6, 4
%8 = or i32 %7, %6
%9 = lshr i32 %8, 8
%10 = or i32 %9, %8
%11 = lshr i32 %10, 16
%12 = or i32 %11, %10
%13 = add i32 %12, 1
ret i32 %13
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ err_sys(char *);
int gettimeofday(struct timeval *, void *);
void Gettimeofday(struct timeval *tv, void *foo) {
  if (gettimeofday(tv, foo) == -1)
    err_sys("gettimeofday error");
  return;
}


x86 assembly (clang, -O0):
<Gettimeofday>:
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   1040 <gettimeofday@plt>
cmp    $0xffffffff,%eax
jne    1152 <Gettimeofday+0x32>
lea    0xeb3(%rip),%rdi
call   1030 <err_sys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Gettimeofday>:
push   %rax
call   1040 <gettimeofday@plt>
cmp    $0xffffffff,%eax
je     112d <Gettimeofday+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <err_sys@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
@.str = [19 x i8] c"gettimeofday error\00"
define void @Gettimeofday(%struct.timeval* %0, i8* %1) {
%3 = alloca %struct.timeval*
%4 = alloca i8*
store %struct.timeval* %0, %struct.timeval** %3
store i8* %1, i8** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = load i8*, i8** %4
%7 = call i32 @gettimeofday(%struct.timeval* %5, i8* %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @err_sys(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@.str = [19 x i8] c"gettimeofday error\00"
define void @Gettimeofday(%struct.timeval* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @gettimeofday(%struct.timeval* %0, i8* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err_sys(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
int f_eq_mm2(float *a1, float *a2) { return !(((*a1) == (*a2))); }


x86 assembly (clang, -O0):
<f_eq_mm2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_eq_mm2>:
movss  (%rsi),%xmm0
cmpneqss (%rdi),%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f_eq_mm2(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = load float*, float** %4
%8 = load float, float* %7
%9 = fcmp oeq float %6, %8
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @f_eq_mm2(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = fcmp une float %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void func1(void) {
  printf("%s: %s_NOT_OP1\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/zzz0072/Linux_Programming_Practice/refs/"
         "heads/master/18_gdb_static_debug/same_func1.c",
         __PRETTY_FUNCTION__);
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeee(%rip),%rsi
lea    0xf97(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
lea    0xee9(%rip),%rdi
lea    0xef2(%rip),%rsi
lea    0xf9b(%rip),%rdx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%s: %s_NOT_OP1\0A\00"
@.str.1 = [176 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zzz0072/Linux_Programming_Practice/refs/heads/master/18_gdb_static_debug/same_func1.c\00"
@__PRETTY_FUNCTION__.func1 = [17 x i8] c"void func1(void)\00"
define void @func1() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__PRETTY_FUNCTION__.func1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%s: %s_NOT_OP1\0A\00"
@.str.1 = [176 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zzz0072/Linux_Programming_Practice/refs/heads/master/18_gdb_static_debug/same_func1.c\00"
@__PRETTY_FUNCTION__.func1 = [17 x i8] c"void func1(void)\00"
define void @func1() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__PRETTY_FUNCTION__.func1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int /*<<< orphan*/ gptp(char *, int);
void g_pthread_mutexattr_t() {
  gptp("pthread_mutexattr_t", sizeof(pthread_mutexattr_t));
}


x86 assembly (clang, -O0):
<g_pthread_mutexattr_t>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
call   1030 <gptp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_pthread_mutexattr_t>:
lea    0xee9(%rip),%rdi
mov    $0x4,%esi
jmp    1030 <gptp@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"pthread_mutexattr_t\00"
define void @g_pthread_mutexattr_t() {
%1 = call i32 @gptp(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 4)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"pthread_mutexattr_t\00"
define void @g_pthread_mutexattr_t() {
%1 = tail call i32 @gptp(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 4)
ret void
}
void swift_checkMetadataState(void) {}


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

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

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

LLVM IR (-O2):
define void @swift_checkMetadataState() {
ret void
}
void X509_subject_name_cmp(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_subject_name_cmp() {
ret void
}
void outb(unsigned short port, unsigned char value) {
  asm("outb %b0, %w1" : : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    -0x2(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @outb(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i16, i16* %3
ret void
}

LLVM IR (-O2):
define void @outb(i16 zeroext %0, i8 zeroext %1) {
tail call void asm sideeffect "outb ${0:b}, ${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i8 %1, i16 %0)
ret void
}
unsigned long ntohl(unsigned long l) {
  unsigned char r[4];
  unsigned char i = 4;
  while (i-- > 0) {
    r[i] = l & 0xff;
    l >>= 8;
  }
  return *(unsigned long *)r;
}


x86 assembly (clang, -O0):
<ntohl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x4,-0xd(%rbp)
mov    -0xd(%rbp),%al
mov    %al,%cl
add    $0xff,%cl
mov    %cl,-0xd(%rbp)
movzbl %al,%eax
cmp    $0x0,%eax
jle    1148 <ntohl+0x48>
mov    -0x8(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
movzbl -0xd(%rbp),%eax
mov    %cl,-0xc(%rbp,%rax,1)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <ntohl+0xc>
mov    -0xc(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntohl>:
mov    %rdi,%rax
bswap  %eax
ret

LLVM IR (-O0):
define i64 @ntohl(i64 %0) {
%2 = alloca i64
%3 = alloca [4 x i8]
%4 = alloca i8
store i64 %0, i64* %2
store i8 4, i8* %4
br label %5
5: ; preds = %10, %1
%6 = load i8, i8* %4
%7 = add i8 %6, -1
store i8 %7, i8* %4
%8 = zext i8 %6 to i32
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %5
%11 = load i64, i64* %2
%12 = and i64 %11, 255
%13 = trunc i64 %12 to i8
%14 = load i8, i8* %4
%15 = zext i8 %14 to i64
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 %15
store i8 %13, i8* %16
%17 = load i64, i64* %2
%18 = lshr i64 %17, 8
store i64 %18, i64* %2
br label %5
19: ; preds = %5
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%21 = bitcast i8* %20 to i64*
%22 = load i64, i64* %21
ret i64 %22
}

LLVM IR (-O2):
define i64 @ntohl(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = call i32 @llvm.bswap.i32(i32 %2)
%4 = zext i32 %3 to i64
ret i64 %4
}
signed char compareChar(void *t1, void *t2) {
  int _t1 = *(char *)t1;
  int _t2 = *(char *)t2;
  if (_t1 < _t2)
    return -1;
  else if (_t1 > _t2)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compareChar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1135 <compareChar+0x35>
movb   $0xff,-0x1(%rbp)
jmp    114e <compareChar+0x4e>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    114a <compareChar+0x4a>
movb   $0x1,-0x1(%rbp)
jmp    114e <compareChar+0x4e>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @compareChar(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp slt i8 %3, %4
%6 = icmp sgt i8 %3, %4
%7 = zext i1 %6 to i8
%8 = select i1 %5, i8 -1, i8 %7
ret i8 %8
}
int modular(int x, unsigned int exp, int mod) {
  int res = 1;
  x = x % mod;
  while (exp > 0) {
    if (exp & 1)
      res = (res * x) % mod;
    exp = exp >> 1;
    x = (x * x) % mod;
  }
  return res;
}


x86 assembly (clang, -O0):
<modular>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jbe    1161 <modular+0x61>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1145 <modular+0x45>
mov    -0x10(%rbp),%eax
imul   -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x4(%rbp)
jmp    111e <modular+0x1e>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modular>:
test   %esi,%esi
je     113c <modular+0x3c>
mov    %edx,%r8d
mov    $0x1,%ecx
jmp    111e <modular+0x1e>
xchg   %ax,%ax
mov    %esi,%eax
shr    %eax
imul   %edi,%edi
cmp    $0x1,%esi
mov    %eax,%esi
jbe    1139 <modular+0x39>
mov    %edi,%eax
cltd
idiv   %r8d
mov    %edx,%edi
test   $0x1,%sil
je     1110 <modular+0x10>
imul   %edi,%ecx
mov    %ecx,%eax
cltd
idiv   %r8d
mov    %edx,%ecx
jmp    1110 <modular+0x10>
mov    %ecx,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @modular(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
store i32 1, i32* %7
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = srem i32 %8, %9
store i32 %10, i32* %4
br label %11
11: ; preds = %24, %3
%12 = load i32, i32* %5
%13 = icmp ugt i32 %12, 0
br i1 %13, label %14, label %32
14: ; preds = %11
%15 = load i32, i32* %5
%16 = and i32 %15, 1
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %14
%19 = load i32, i32* %7
%20 = load i32, i32* %4
%21 = mul nsw i32 %19, %20
%22 = load i32, i32* %6
%23 = srem i32 %21, %22
store i32 %23, i32* %7
br label %24
24: ; preds = %18, %14
%25 = load i32, i32* %5
%26 = lshr i32 %25, 1
store i32 %26, i32* %5
%27 = load i32, i32* %4
%28 = load i32, i32* %4
%29 = mul nsw i32 %27, %28
%30 = load i32, i32* %6
%31 = srem i32 %29, %30
store i32 %31, i32* %4
br label %11
32: ; preds = %11
%33 = load i32, i32* %7
ret i32 %33
}

LLVM IR (-O2):
define i32 @modular(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %20, label %5
5: ; preds = %3, %15
%6 = phi i32 [ %18, %15 ], [ %0, %3 ]
%7 = phi i32 [ %16, %15 ], [ 1, %3 ]
%8 = phi i32 [ %17, %15 ], [ %1, %3 ]
%9 = srem i32 %6, %2
%10 = and i32 %8, 1
%11 = icmp eq i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %5
%13 = mul nsw i32 %9, %7
%14 = srem i32 %13, %2
br label %15
15: ; preds = %12, %5
%16 = phi i32 [ %14, %12 ], [ %7, %5 ]
%17 = lshr i32 %8, 1
%18 = mul nsw i32 %9, %9
%19 = icmp ult i32 %8, 2
br i1 %19, label %20, label %5
20: ; preds = %15, %3
%21 = phi i32 [ 1, %3 ], [ %16, %15 ]
ret i32 %21
}
/* Variables and functions */
unsigned char *blowfish448ecb_decrypt(unsigned char *, size_t *,
                                      unsigned char const *, size_t,
                                      unsigned char const *,
                                      unsigned char const *);
unsigned char *crypt_decrypt_blowfish448ecb(unsigned char *out, size_t *out_len,
                                            const unsigned char *in,
                                            size_t in_len,
                                            const unsigned char *nonce,
                                            const unsigned char *key) {
  return blowfish448ecb_decrypt(out, out_len, in, in_len, nonce, key);
}


x86 assembly (clang, -O0):
<crypt_decrypt_blowfish448ecb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <blowfish448ecb_decrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_decrypt_blowfish448ecb>:
jmp    1030 <blowfish448ecb_decrypt@plt>

LLVM IR (-O0):
define i8* @crypt_decrypt_blowfish448ecb(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i64* %1, i64** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load i64*, i64** %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i8* @blowfish448ecb_decrypt(i8* %13, i64* %14, i8* %15, i64 %16, i8* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @crypt_decrypt_blowfish448ecb(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = tail call i8* @blowfish448ecb_decrypt(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5)
ret i8* %7
}
unsigned int uv_version(void) { return ((0 << 16) | (10 << 8) | (3)); }


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

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

LLVM IR (-O0):
define i32 @uv_version() {
ret i32 2563
}

LLVM IR (-O2):
define i32 @uv_version() {
ret i32 2563
}
/* Variables and functions */
void *thread_routine(void *arg) {
  int keepgoing = 0;
  return NULL;
}


x86 assembly (clang, -O0):
<thread_routine>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @thread_routine(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int old, days;
  printf("How old are you?\t");
  scanf("%d", &old);
  days = old * 365;
  printf("You are lived %d days!", days);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
imul   $0x16d,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
imul   $0x16d,0x4(%rsp),%esi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"How old are you?\09\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [23 x i8] c"You are lived %d days!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, 365
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"How old are you?\09\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [23 x i8] c"You are lived %d days!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 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), i32* %1)
%5 = load i32, i32* %1
%6 = mul nsw i32 %5, 365
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ find_track_regex(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  char search_for[80];
  printf("Search for: ");
  fgets(search_for, 80, stdin);
  find_track_regex(search_for);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1050 <find_track_regex@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Search for: \00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [80 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %8, i32 80, i32 %9)
%11 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%12 = call i32 @find_track_regex(i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Search for: \00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [80 x i8]
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %4, i32 80, i32 %6)
%8 = call i32 @find_track_regex(i8* %4)
ret i32 0
}
/* Type definitions */
struct yaffs_obj {
  int dummy;
};

/* Variables and functions */
int yaffs_do_xattrib_fetch(struct yaffs_obj *, int /*<<< orphan*/, char *, int);
int yaffs_list_xattrib(struct yaffs_obj *obj, char *buffer, int size) {
  return yaffs_do_xattrib_fetch(obj, (0), buffer, size);
}


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

x86 assembly (clang, -O2):
<yaffs_list_xattrib>:
mov    %edx,%ecx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <yaffs_do_xattrib_fetch@plt>

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

LLVM IR (-O2):
%struct.yaffs_obj = type { i32 }
define i32 @yaffs_list_xattrib(%struct.yaffs_obj* %0, i8* %1, i32 %2) {
%4 = tail call i32 @yaffs_do_xattrib_fetch(%struct.yaffs_obj* %0, i32 0, i8* %1, i32 %2)
ret i32 %4
}
void RTRandAdvS64(void) {}


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

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

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

LLVM IR (-O2):
define void @RTRandAdvS64() {
ret void
}