xunge/DecIR huggingface dataset:
unsigned long long C_Utils_max_ulonglong(const unsigned long long item1,
                                         const unsigned long long item2) {
  return item1 > item2 ? item1 : item2;
}


x86 assembly (clang, -O0):
<C_Utils_max_ulonglong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <C_Utils_max_ulonglong+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <C_Utils_max_ulonglong+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_max_ulonglong>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @C_Utils_max_ulonglong(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
float plogp(int);
float h(float p) { return -(plogp(p) + plogp(1 - p)); }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%edi
call   1030 <plogp@plt>
movss  %xmm0,-0x8(%rbp)
movss  0xecc(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <plogp@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
addss  %xmm1,%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
push   %rax
movss  %xmm0,(%rsp)
cvttss2si %xmm0,%edi
call   1030 <plogp@plt>
movss  %xmm0,0x4(%rsp)
movss  0xed3(%rip),%xmm0
subss  (%rsp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <plogp@plt>
addss  0x4(%rsp),%xmm0
xorps  0xec8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @h(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptosi float %3 to i32
%5 = call float @plogp(i32 %4)
%6 = load float, float* %2
%7 = fsub float 1.000000e+00, %6
%8 = fptosi float %7 to i32
%9 = call float @plogp(i32 %8)
%10 = fadd float %5, %9
%11 = fneg float %10
ret float %11
}

LLVM IR (-O2):
define float @h(float %0) {
%2 = fptosi float %0 to i32
%3 = tail call float @plogp(i32 %2)
%4 = fsub float 1.000000e+00, %0
%5 = fptosi float %4 to i32
%6 = tail call float @plogp(i32 %5)
%7 = fadd float %3, %6
%8 = fneg float %7
ret float %8
}
/* Variables and functions */
size_t get_data_tag_in_Logout(size_t __tag) {
  switch (__tag) {
  case 354:
    return 355;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<get_data_tag_in_Logout>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x162,%rax
jne    112a <get_data_tag_in_Logout+0x2a>
jmp    111d <get_data_tag_in_Logout+0x1d>
movq   $0x163,-0x8(%rbp)
jmp    1132 <get_data_tag_in_Logout+0x32>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_data_tag_in_Logout>:
xor    %ecx,%ecx
cmp    $0x162,%rdi
mov    $0x163,%eax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
define i64 @get_data_tag_in_Logout(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
switch i64 %4, label %6 [
i64 354, label %5
]
5: ; preds = %1
store i64 355, i64* %2
br label %7
6: ; preds = %1
store i64 0, i64* %2
br label %7
7: ; preds = %6, %5
%8 = load i64, i64* %2
ret i64 %8
}

LLVM IR (-O2):
define i64 @get_data_tag_in_Logout(i64 %0) {
%2 = icmp eq i64 %0, 354
%3 = select i1 %2, i64 355, i64 0
ret i64 %3
}
/* Type definitions */
struct timeval {
  long long tv_sec;
  long long tv_usec;
};

/* Variables and functions */
struct timeval tst_us_to_timeval(long long us) {
  struct timeval ret;
  ret.tv_sec = us / 1000000;
  ret.tv_usec = us % 1000000;
  return ret;
}


x86 assembly (clang, -O0):
<tst_us_to_timeval>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movabs $0x431bde82d7b634db,%rcx
de 1b 43
imul   %rcx
mov    %rdx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x12,%rax
add    %rdx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
imul   %rcx
mov    -0x20(%rbp),%rax
mov    %rdx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x12,%rcx
add    %rdx,%rcx
imul   $0xf4240,%rcx,%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_us_to_timeval>:
movabs $0x431bde82d7b634db,%rcx
de 1b 43
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x12,%rdx
add    %rdx,%rax
imul   $0xf4240,%rax,%rcx
sub    %rcx,%rdi
mov    %rdi,%rdx
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define { i64, i64 } @tst_us_to_timeval(i64 %0) {
%2 = alloca %struct.timeval
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = sdiv i64 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
store i64 %5, i64* %6
%7 = load i64, i64* %3
%8 = srem i64 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
store i64 %8, i64* %9
%10 = bitcast %struct.timeval* %2 to { i64, i64 }*
%11 = load { i64, i64 }, { i64, i64 }* %10
ret { i64, i64 } %11
}

LLVM IR (-O2):
define { i64, i64 } @tst_us_to_timeval(i64 %0) {
%2 = sdiv i64 %0, 1000000
%3 = srem i64 %0, 1000000
%4 = insertvalue { i64, i64 } poison, i64 %2, 0
%5 = insertvalue { i64, i64 } %4, i64 %3, 1
ret { i64, i64 } %5
}
/* Type definitions */
struct prinfo {
  int dummy;
};

/* Variables and functions */
scalar_t__ syscall(int, struct prinfo *);
long testCall1(struct prinfo *info) { return (long)syscall(349, info); }


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

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

LLVM IR (-O0):
%struct.prinfo = type { i32 }
define i64 @testCall1(%struct.prinfo* %0) {
%2 = alloca %struct.prinfo*
store %struct.prinfo* %0, %struct.prinfo** %2
%3 = load %struct.prinfo*, %struct.prinfo** %2
%4 = call i64 @syscall(i32 349, %struct.prinfo* %3)
ret i64 %4
}

LLVM IR (-O2):
%struct.prinfo = type { i32 }
define i64 @testCall1(%struct.prinfo* %0) {
%2 = tail call i64 @syscall(i32 349, %struct.prinfo* %0)
ret i64 %2
}
/* Variables and functions */
char *strchr(char const *, int);
int strlen(char const *);
char *strchrnul(const char *s, int c) {
  char *result;
  result = strchr(s, c);
  if (!result) {
    result = (char *)s + strlen(s);
  }
  return (result);
}


x86 assembly (clang, -O0):
<strchrnul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116b <strchrnul+0x4b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchrnul>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strchr@plt>
test   %rax,%rax
je     1130 <strchrnul+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strchrnul(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @strlen(i8* %0)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
br label %9
9: ; preds = %5, %2
%10 = phi i8* [ %3, %2 ], [ %8, %5 ]
ret i8* %10
}
double heap_maximum(double *srcdata) { return (srcdata[0]); }


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

x86 assembly (clang, -O2):
<heap_maximum>:
movsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
define double @heap_maximum(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
ret double %5
}

LLVM IR (-O2):
define double @heap_maximum(double* nocapture %0) {
%2 = load double, double* %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ timing(double *, double *);
void timing_(double *wcTime, double *cpuTime) { timing(wcTime, cpuTime); }


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

x86 assembly (clang, -O2):
<timing_>:
jmp    1030 <timing@plt>

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

LLVM IR (-O2):
define void @timing_(double* %0, double* %1) {
%3 = tail call i32 @timing(double* %0, double* %1)
ret void
}
void indent_put2s(fmt, arg) char fmt[], arg[];
{
  do_indent();
  printf(fmt, arg);
  putchar('\n');
}


x86 assembly (clang, -O0):
<indent_put2s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <do_indent@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xa,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent_put2s>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <do_indent@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @indent_put2s(i8* nocapture %0, i8* %1) {
%3 = tail call i32 (...) @do_indent()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0, i8* %1)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 10)
ret void
}
int test_imm_C6uint16_reg(unsigned short val) {
  return ((val) & (0xC6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C6uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xc6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C6uint16_reg>:
test   $0xc6,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C6uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 198
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ __VERIFIER_nondet_int();
void *dll_create_generic(void (*insert_fnc)()) {
  void *dll = NULL;
  insert_fnc(&dll);
  insert_fnc(&dll);
  while (__VERIFIER_nondet_int())
    insert_fnc(&dll);
  return dll;
}


x86 assembly (clang, -O0):
<dll_create_generic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   *-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   *-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%rax
je     1155 <dll_create_generic+0x45>
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   *-0x8(%rbp)
jmp    1136 <dll_create_generic+0x26>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dll_create_generic>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movq   $0x0,(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
xor    %eax,%eax
call   *%rbx
mov    %r14,%rdi
xor    %eax,%eax
call   *%rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
je     1153 <dll_create_generic+0x43>
mov    %rsp,%r14
nop
mov    %r14,%rdi
xor    %eax,%eax
call   *%rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
jne    1140 <dll_create_generic+0x30>
mov    (%rsp),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @dll_create_generic(void (...)* nocapture %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%4 = bitcast void (...)* %0 to void (i8**, ...)*
%5 = call i64 (...) @__VERIFIER_nondet_int()
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1, %7
%8 = call i64 (...) @__VERIFIER_nondet_int()
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %7
10: ; preds = %7, %1
%11 = load i8*, i8** %2
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ luaL_check_number(int);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
int /*<<< orphan*/ sqrt(int /*<<< orphan*/);
void math_sqrt(void) { lua_pushnumber(sqrt(luaL_check_number(1))); }


x86 assembly (clang, -O0):
<math_sqrt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mov    %eax,%edi
call   1050 <sqrt@plt>
mov    %eax,%edi
call   1040 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_sqrt>:
push   %rax
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mov    %eax,%edi
call   1050 <sqrt@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_sqrt() {
%1 = call i32 @luaL_check_number(i32 1)
%2 = call i32 @sqrt(i32 %1)
%3 = call i32 @lua_pushnumber(i32 %2)
ret void
}

LLVM IR (-O2):
define void @math_sqrt() {
%1 = tail call i32 @luaL_check_number(i32 1)
%2 = tail call i32 @sqrt(i32 %1)
%3 = tail call i32 @lua_pushnumber(i32 %2)
ret void
}
/* Variables and functions */
scalar_t__ calloc(int, size_t);
int /*<<< orphan*/ nrerror(char *);
void *space(unsigned size) {
  void *pointer;
  if ((pointer = (void *)calloc(1, (size_t)size)) == NULL) {
    nrerror("SPACE allocation failure -> no memory");
  }
  return pointer;
}


x86 assembly (clang, -O0):
<space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%esi
mov    $0x1,%edi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1154 <space+0x34>
lea    0xeb1(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<space>:
push   %rbx
mov    %edi,%esi
mov    $0x1,%edi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1141 <space+0x21>
lea    0xec4(%rip),%rdi
call   1030 <nrerror@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"SPACE allocation failure -> no memory\00"
define i8* @space(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = call i64 @calloc(i32 1, i64 %5)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @nrerror(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [38 x i8] c"SPACE allocation failure -> no memory\00"
define i8* @space(i32 %0) {
%2 = zext i32 %0 to i64
%3 = tail call i64 @calloc(i32 1, i64 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @nrerror(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = inttoptr i64 %3 to i8*
ret i8* %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_poly1305_from_bytes(uintptr_t, uintptr_t);
void fiat_poly1305_from_bytes(uint32_t out1[5], const uint8_t arg1[17]) {
  internal_fiat_poly1305_from_bytes((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_poly1305_from_bytes>:
jmp    1030 <internal_fiat_poly1305_from_bytes@plt>

LLVM IR (-O0):
define void @fiat_poly1305_from_bytes(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_poly1305_from_bytes(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_poly1305_from_bytes(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_poly1305_from_bytes(i64 %3, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_report(char *, int, int);
int /*<<< orphan*/ erl_init(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ erl_mk_port(char *, int, int);
int /*<<< orphan*/ send_term(int /*<<< orphan*/);
void t_erl_mk_xport(void) {
  erl_init(NULL, 0);
  send_term(erl_mk_port("kalle@localhost", 268435455, 1));
  do_report("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/RaimoNiskanen/otp/refs/heads/basho/lib/"
            "erl_interface/test/erl_eterm_SUITE_data/eterm_test.c",
            548, 1);
}


x86 assembly (clang, -O0):
<t_erl_mk_xport>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1060 <erl_init@plt>
lea    0xeaa(%rip),%rdi
mov    $0xfffffff,%esi
mov    $0x1,%edx
call   1030 <erl_mk_port@plt>
mov    %eax,%edi
call   1050 <send_term@plt>
lea    0xe9d(%rip),%rdi
mov    $0x224,%esi
mov    $0x1,%edx
call   1040 <do_report@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_erl_mk_xport>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1060 <erl_init@plt>
lea    0xeaf(%rip),%rdi
mov    $0xfffffff,%esi
mov    $0x1,%edx
call   1030 <erl_mk_port@plt>
mov    %eax,%edi
call   1050 <send_term@plt>
lea    0xea2(%rip),%rdi
mov    $0x224,%esi
mov    $0x1,%edx
pop    %rax
jmp    1040 <do_report@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"kalle@localhost\00"
@.str.1 = [182 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/RaimoNiskanen/otp/refs/heads/basho/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c\00"
define void @t_erl_mk_xport() {
%1 = call i32 @erl_init(i32* null, i32 0)
%2 = call i32 @erl_mk_port(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 268435455, i32 1)
%3 = call i32 @send_term(i32 %2)
%4 = call i32 @do_report(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str.1, i64 0, i64 0), i32 548, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"kalle@localhost\00"
@.str.1 = [182 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/RaimoNiskanen/otp/refs/heads/basho/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c\00"
define void @t_erl_mk_xport() {
%1 = tail call i32 @erl_init(i32* null, i32 0)
%2 = tail call i32 @erl_mk_port(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 268435455, i32 1)
%3 = tail call i32 @send_term(i32 %2)
%4 = tail call i32 @do_report(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str.1, i64 0, i64 0), i32 548, i32 1)
ret void
}
float am_fsqrt(float x) {
  float x_in = x;
  float xhalf = 0.5f * x;
  int i = *(int *)&x;
  i = 0x5f375a86 - (i >> 1);
  x = *(float *)&i;
  x = x * (1.5f - xhalf * x * x);
  return x * x_in;
}


x86 assembly (clang, -O0):
<am_fsqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xee9(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
sar    $0x1,%ecx
mov    $0x5f375a86,%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe8e(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<am_fsqrt>:
movd   %xmm0,%eax
sar    %eax
mov    $0x5f375a86,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm1
movss  0xee7(%rip),%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm1,%xmm2
mulss  %xmm1,%xmm2
addss  0xed7(%rip),%xmm2
mulss  %xmm1,%xmm2
mulss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @am_fsqrt(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store float %0, float* %2
%6 = load float, float* %2
store float %6, float* %3
%7 = load float, float* %2
%8 = fmul float 5.000000e-01, %7
store float %8, float* %4
%9 = bitcast float* %2 to i32*
%10 = load i32, i32* %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = ashr i32 %11, 1
%13 = sub nsw i32 1597463174, %12
store i32 %13, i32* %5
%14 = bitcast i32* %5 to float*
%15 = load float, float* %14
store float %15, float* %2
%16 = load float, float* %2
%17 = load float, float* %4
%18 = load float, float* %2
%19 = fmul float %17, %18
%20 = load float, float* %2
%21 = fneg float %19
%22 = call float @llvm.fmuladd.f32(float %21, float %20, float 1.500000e+00)
%23 = fmul float %16, %22
store float %23, float* %2
%24 = load float, float* %2
%25 = load float, float* %3
%26 = fmul float %24, %25
ret float %26
}

LLVM IR (-O2):
define float @am_fsqrt(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = sub nsw i32 1597463174, %3
%5 = bitcast i32 %4 to float
%6 = fmul float %0, -5.000000e-01
%7 = fmul float %6, %5
%8 = tail call float @llvm.fmuladd.f32(float %7, float %5, float 1.500000e+00)
%9 = fmul float %8, %5
%10 = fmul float %9, %0
ret float %10
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_is_signal(void *m, const char *interface, const char *member) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_is_signal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
mov    0x2ec7(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_message_is_signal>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_message_is_signal(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_is_signal(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void usage(void) {
  puts("cronlist"
       " lists upcoming cron actions from /etc/crontab\n  and your personal "
       "crontab.\nOptions:\n   -f  --from=DATETIME  list actions starting on "
       "or after DATETIME (default now)\n   -t  --to=DATETIME    list actions "
       "starting on or before DATETIME\n   -n  --entries=NUMBER stop after "
       "NUMBER actions (default 10)\n   -s  --system         show /etc/crontab "
       "only\n   -c  --crontab        show your personal crontab only\n   -h  "
       "--help           shows this help\n\n  DATETIME should be a date "
       "expression that can be passed to date(1).\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [520 x i8] c"cronlist lists upcoming cron actions from /etc/crontab\0A and your personal crontab.\0AOptions:\0A -f --from=DATETIME list actions starting on or after DATETIME (default now)\0A -t --to=DATETIME list actions starting on or before DATETIME\0A -n --entries=NUMBER stop after NUMBER actions (default 10)\0A -s --system show /etc/crontab only\0A -c --crontab show your personal crontab only\0A -h --help shows this help\0A\0A DATETIME should be a date expression that can be passed to date(1).\0A\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([520 x i8], [520 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [520 x i8] c"cronlist lists upcoming cron actions from /etc/crontab\0A and your personal crontab.\0AOptions:\0A -f --from=DATETIME list actions starting on or after DATETIME (default now)\0A -t --to=DATETIME list actions starting on or before DATETIME\0A -n --entries=NUMBER stop after NUMBER actions (default 10)\0A -s --system show /etc/crontab only\0A -c --crontab show your personal crontab only\0A -h --help shows this help\0A\0A DATETIME should be a date expression that can be passed to date(1).\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([520 x i8], [520 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memShowMap();
int MemoryMap(int argc, char *argv[]) {
  memShowMap();
  return 0;
}


x86 assembly (clang, -O0):
<MemoryMap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <memShowMap@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @MemoryMap(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @memShowMap()
ret i32 0
}
char Hex(int val) {
  if (val >= 0 && val <= 9)
    return val + '0';
  else if (val >= 10 && val <= 15)
    return val - 10 + 'a';
  else
    return ' ';
}


x86 assembly (clang, -O0):
<Hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1129 <Hex+0x29>
cmpl   $0x9,-0x8(%rbp)
jg     1129 <Hex+0x29>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1152 <Hex+0x52>
cmpl   $0xa,-0x8(%rbp)
jl     114e <Hex+0x4e>
cmpl   $0xf,-0x8(%rbp)
jg     114e <Hex+0x4e>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
jmp    1152 <Hex+0x52>
movb   $0x20,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Hex>:
cmp    $0x9,%edi
ja     110b <Hex+0xb>
add    $0x30,%dil
jmp    1119 <Hex+0x19>
lea    -0xa(%rdi),%ecx
mov    $0x20,%al
cmp    $0x5,%ecx
ja     111b <Hex+0x1b>
add    $0x57,%dil
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @Hex(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 9
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 48
%12 = trunc i32 %11 to i8
store i8 %12, i8* %2
br label %25
13: ; preds = %6, %1
%14 = load i32, i32* %3
%15 = icmp sge i32 %14, 10
br i1 %15, label %16, label %24
16: ; preds = %13
%17 = load i32, i32* %3
%18 = icmp sle i32 %17, 15
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load i32, i32* %3
%21 = sub nsw i32 %20, 10
%22 = add nsw i32 %21, 97
%23 = trunc i32 %22 to i8
store i8 %23, i8* %2
br label %25
24: ; preds = %16, %13
store i8 32, i8* %2
br label %25
25: ; preds = %24, %19, %9
%26 = load i8, i8* %2
ret i8 %26
}

LLVM IR (-O2):
define signext i8 @Hex(i32 %0) {
%2 = icmp ult i32 %0, 10
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = trunc i32 %0 to i8
%5 = add nuw nsw i8 %4, 48
br label %12
6: ; preds = %1
%7 = add i32 %0, -10
%8 = icmp ult i32 %7, 6
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = trunc i32 %0 to i8
%11 = add nuw nsw i8 %10, 87
br label %12
12: ; preds = %6, %9, %3
%13 = phi i8 [ %5, %3 ], [ %11, %9 ], [ 32, %6 ]
ret i8 %13
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgscale2(void) { gen("shl\tcx,1"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"shl\09cx,1\00"
define void @cgscale2() {
%1 = call i32 @gen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"shl\09cx,1\00"
define void @cgscale2() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncat(char *, char const *, int);
int str_concat(char *dst, const char *src, int size) {
  (void)strncat(dst, src, size);
  return dst[size - 1] == '\0' ? 0 : -1;
}


x86 assembly (clang, -O0):
<str_concat>:
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),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncat@plt>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_concat>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rdi,%r14
call   1030 <strncat@plt>
movslq %ebx,%rax
xor    %ecx,%ecx
cmp    -0x1(%rax,%r14,1),%cl
sbb    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @str_concat(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @strncat(i8* %7, i8* %8, i32 %9)
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 0
%19 = zext i1 %18 to i64
%20 = select i1 %18, i32 0, i32 -1
ret i32 %20
}

LLVM IR (-O2):
define i32 @str_concat(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strncat(i8* %0, i8* %1, i32 %2)
%5 = add nsw i32 %2, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
%10 = sext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void Section4Area(float radius) {
  printf(", the area is: %.2f.\n", radius * radius * 3.141592);
}


x86 assembly (clang, -O0):
<Section4Area>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecd(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Section4Area>:
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xee0(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c", the area is: %.2f.\0A\00"
define void @Section4Area(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = fpext float %5 to double
%7 = fmul double %6, 0x400921FAFC8B007A
%8 = fptrunc double %7 to float
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), float %8)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c", the area is: %.2f.\0A\00"
define void @Section4Area(float %0) {
%2 = fmul float %0, %0
%3 = fpext float %2 to double
%4 = fmul double %3, 0x400921FAFC8B007A
%5 = fptrunc double %4 to float
%6 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), float %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int open_berictl_dir(int);
int /*<<< orphan*/ unlinkat(int, char *, int /*<<< orphan*/);
void altera_sc_clear_status(void) {
  int ccd;
  if ((ccd = open_berictl_dir(1)) == -1)
    return;
  unlinkat(ccd, "system-console.pid", 0);
  unlinkat(ccd, "system-console.port", 0);
  close(ccd);
}


x86 assembly (clang, -O0):
<altera_sc_clear_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1050 <open_berictl_dir@plt>
mov    %eax,-0x4(%rbp)
cmp    $0xffffffff,%eax
jne    1153 <altera_sc_clear_status+0x23>
jmp    117d <altera_sc_clear_status+0x4d>
mov    -0x4(%rbp),%edi
lea    0xea3(%rip),%rsi
xor    %edx,%edx
call   1030 <unlinkat@plt>
mov    -0x4(%rbp),%edi
lea    0xea5(%rip),%rsi
xor    %edx,%edx
call   1030 <unlinkat@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<altera_sc_clear_status>:
push   %rbx
mov    $0x1,%edi
call   1050 <open_berictl_dir@plt>
cmp    $0xffffffff,%eax
je     116a <altera_sc_clear_status+0x3a>
mov    %eax,%ebx
lea    0xeb7(%rip),%rsi
mov    %eax,%edi
xor    %edx,%edx
call   1030 <unlinkat@plt>
lea    0xeba(%rip),%rsi
mov    %ebx,%edi
xor    %edx,%edx
call   1030 <unlinkat@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"system-console.pid\00"
@.str.1 = [20 x i8] c"system-console.port\00"
define void @altera_sc_clear_status() {
%1 = alloca i32
%2 = call i32 @open_berictl_dir(i32 1)
store i32 %2, i32* %1
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %5
4: ; preds = %0
br label %12
5: ; preds = %0
%6 = load i32, i32* %1
%7 = call i32 @unlinkat(i32 %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 0)
%8 = load i32, i32* %1
%9 = call i32 @unlinkat(i32 %8, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 0)
%10 = load i32, i32* %1
%11 = call i32 @close(i32 %10)
br label %12
12: ; preds = %5, %4
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"system-console.pid\00"
@.str.1 = [20 x i8] c"system-console.port\00"
define void @altera_sc_clear_status() {
%1 = tail call i32 @open_berictl_dir(i32 1)
%2 = icmp eq i32 %1, -1
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 @unlinkat(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 0)
%5 = tail call i32 @unlinkat(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 0)
%6 = tail call i32 @close(i32 %1)
br label %7
7: ; preds = %0, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int);
void clean_exit(int status) {
  cleanup();
  exit(status);
}


x86 assembly (clang, -O0):
<clean_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <cleanup@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<clean_exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <cleanup@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @clean_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @cleanup()
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
define void @clean_exit(i32 %0) {
%2 = tail call i32 (...) @cleanup()
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
scalar_t__ parson_malloc(size_t);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *parson_strndup(const char *string, size_t n) {
  char *output_string = (char *)parson_malloc(n + 1);
  if (!output_string) {
    return NULL;
  }
  output_string[n] = '\0';
  strncpy(output_string, string, n);
  return output_string;
}


x86 assembly (clang, -O0):
<parson_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1040 <parson_malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1159 <parson_strndup+0x39>
movq   $0x0,-0x8(%rbp)
jmp    117e <parson_strndup+0x5e>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parson_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x1(%rsi),%rdi
call   1040 <parson_malloc@plt>
test   %rax,%rax
je     1151 <parson_strndup+0x31>
mov    %rax,%rbx
movb   $0x0,(%rax,%r14,1)
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <strncpy@plt>
jmp    1153 <parson_strndup+0x33>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @parson_strndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i64, i64* %5
%8 = add i64 %7, 1
%9 = call i64 @parson_malloc(i64 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = icmp ne i8* %11, null
br i1 %12, label %14, label %13
13: ; preds = %2
store i8* null, i8** %3
br label %23
14: ; preds = %2
%15 = load i8*, i8** %6
%16 = load i64, i64* %5
%17 = getelementptr inbounds i8, i8* %15, i64 %16
store i8 0, i8* %17
%18 = load i8*, i8** %6
%19 = load i8*, i8** %4
%20 = load i64, i64* %5
%21 = call i32 @strncpy(i8* %18, i8* %19, i64 %20)
%22 = load i8*, i8** %6
store i8* %22, i8** %3
br label %23
23: ; preds = %14, %13
%24 = load i8*, i8** %3
ret i8* %24
}

LLVM IR (-O2):
define i8* @parson_strndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i64 @parson_malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %5, i64 %1
store i8 0, i8* %8
%9 = tail call i32 @strncpy(i8* %5, i8* %0, i64 %1)
br label %10
10: ; preds = %2, %7
%11 = phi i8* [ %5, %7 ], [ null, %2 ]
ret i8* %11
}
int fun784() { return 784; }


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

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

LLVM IR (-O0):
define i32 @fun784() {
ret i32 784
}

LLVM IR (-O2):
define i32 @fun784() {
ret i32 784
}
/* Type definitions */
typedef unsigned int uint32_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
__attribute__((always_)) uint32_t
mchp_espi_sram_bar_maddr_get(uintptr_t bar_addr) {
  uint32_t maddr;
  maddr = (uint32_t) * ((volatile uint16_t *)(uintptr_t)(bar_addr + 4ul));
  maddr <<= 16u;
  maddr += (uint32_t) * ((volatile uint16_t *)(uintptr_t)(bar_addr + 2ul));
  return maddr;
}


x86 assembly (clang, -O0):
<mchp_espi_sram_bar_maddr_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%rax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mchp_espi_sram_bar_maddr_get>:
mov    0x4(%rdi),%rcx
shl    $0x10,%ecx
mov    0x2(%rdi),%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mchp_espi_sram_bar_maddr_get(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = add i64 %4, 4
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = trunc i64 %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = shl i32 %9, 16
store i32 %10, i32* %3
%11 = load i64, i64* %2
%12 = add i64 %11, 2
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = trunc i64 %14 to i32
%16 = load i32, i32* %3
%17 = add i32 %16, %15
store i32 %17, i32* %3
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @mchp_espi_sram_bar_maddr_get(i64 %0) {
%2 = add i64 %0, 4
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = shl i32 %5, 16
%7 = add i64 %0, 2
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = add i32 %6, %10
ret i32 %11
}
int cmp(const void *a, const void *b, void *unused) {
  return *(const int *)a - *(const int *)b;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
%13 = sub nsw i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = bitcast i8* %1 to i32*
%7 = load i32, i32* %6
%8 = sub nsw i32 %5, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void giveup(char *msg) {
  fprintf(stderr, "ssl: %s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<giveup>:
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):
<giveup>:
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 = [9 x i8] c"ssl: %s\0A\00"
define void @giveup(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 ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"ssl: %s\0A\00"
define void @giveup(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int cycles_per_ms();
unsigned long long cycles_per_second() { return cycles_per_ms() * 1000; }


x86 assembly (clang, -O0):
<cycles_per_second>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <cycles_per_ms@plt>
imul   $0x3e8,%eax,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<cycles_per_second>:
push   %rax
xor    %eax,%eax
call   1030 <cycles_per_ms@plt>
imul   $0x3e8,%eax,%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @cycles_per_second() {
%1 = call i32 (...) @cycles_per_ms()
%2 = mul nsw i32 %1, 1000
%3 = sext i32 %2 to i64
ret i64 %3
}

LLVM IR (-O2):
define i64 @cycles_per_second() {
%1 = tail call i32 (...) @cycles_per_ms()
%2 = mul nsw i32 %1, 1000
%3 = sext i32 %2 to i64
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ check_ppid();
int /*<<< orphan*/ check_stdout_open();
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
void alarm_handler(int _) {
  check_ppid();
  check_stdout_open();
  alarm(2);
  signal(SIGALRM, alarm_handler);
}


x86 assembly (clang, -O0):
<alarm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <check_ppid@plt>
mov    $0x0,%al
call   1030 <check_stdout_open@plt>
mov    $0x2,%edi
call   1050 <alarm@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    0x2e5d(%rip),%rsi
call   1060 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alarm_handler>:
push   %rax
xor    %eax,%eax
call   1040 <check_ppid@plt>
xor    %eax,%eax
call   1030 <check_stdout_open@plt>
mov    $0x2,%edi
call   1050 <alarm@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
mov    0x2e67(%rip),%rsi
pop    %rax
jmp    1060 <signal@plt>

LLVM IR (-O0):
@SIGALRM = global i32 0
define void @alarm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @check_ppid()
%4 = call i32 (...) @check_stdout_open()
%5 = call i32 @alarm(i32 2)
%6 = load i32, i32* @SIGALRM
%7 = call i32 @signal(i32 %6, void (i32)* @alarm_handler)
ret void
}

LLVM IR (-O2):
@SIGALRM = global i32 0
define void @alarm_handler(i32 %0) {
%2 = tail call i32 (...) @check_ppid()
%3 = tail call i32 (...) @check_stdout_open()
%4 = tail call i32 @alarm(i32 2)
%5 = load i32, i32* @SIGALRM
%6 = tail call i32 @signal(i32 %5, void (i32)* @alarm_handler)
ret void
}
int max(int a, int b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @max(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}