xunge/DecIR huggingface dataset:
int syscall4(int syscall, int arg0, int arg1, int arg2, int arg3) {
  int ret;
  __asm__("movl %[syscall],%%eax\n\t"
          "movl %[arg0],%%ebx\n\t"
          "movl %[arg1],%%ecx\n\t"
          "movl %[arg2],%%edx\n\t"
          "movl %[arg3],%%esi\n\t"
          "int $0x80\n\t"
          "movl %%eax,%[ret]\n\t"
          : [ret] "=r"(ret)
          : [syscall] "m"(syscall), [arg0] "m"(arg0), [arg1] "m"(arg1),
            [arg2] "m"(arg2), [arg3] "m"(arg3)
          : "eax", "ebx", "ecx", "edx", "esi");
  return ret;
}


x86 assembly (clang, -O0):
<syscall4>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ebx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%esi
int    $0x80
mov    %eax,%edi
mov    %edi,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall4>:
push   %rbx
mov    %edi,-0x4(%rsp)
mov    %esi,-0x8(%rsp)
mov    %edx,-0xc(%rsp)
mov    %ecx,-0x10(%rsp)
mov    %r8d,-0x14(%rsp)
mov    -0x4(%rsp),%eax
mov    -0x8(%rsp),%ebx
mov    -0xc(%rsp),%ecx
mov    -0x10(%rsp),%edx
mov    -0x14(%rsp),%esi
int    $0x80
mov    %eax,%edi
mov    %edi,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @syscall4(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = call i32 asm "movl $1,%eax\0A\09movl $2,%ebx\0A\09movl $3,%ecx\0A\09movl $4,%edx\0A\09movl $5,%esi\0A\09int $$0x80\0A\09movl %eax,$0\0A\09", "=r,*m,*m,*m,*m,*m,~{eax},~{ebx},~{ecx},~{edx},~{esi},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %6, i32* elementtype(i32) %7, i32* elementtype(i32) %8, i32* elementtype(i32) %9, i32* elementtype(i32) %10)
store i32 %12, i32* %11
%13 = load i32, i32* %11
ret i32 %13
}

LLVM IR (-O2):
define i32 @syscall4(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = call i32 asm "movl $1,%eax\0A\09movl $2,%ebx\0A\09movl $3,%ecx\0A\09movl $4,%edx\0A\09movl $5,%esi\0A\09int $$0x80\0A\09movl %eax,$0\0A\09", "=r,*m,*m,*m,*m,*m,~{eax},~{ebx},~{ecx},~{edx},~{esi},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %6, i32* elementtype(i32) %7, i32* elementtype(i32) %8, i32* elementtype(i32) %9, i32* elementtype(i32) %10)
ret i32 %11
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void lput4(void *p, uint32_t v) {
  uint8_t *u = p;
  assert(p != NULL);
  u[0] = v >> 0;
  u[1] = v >> 8;
  u[2] = v >> 16;
  u[3] = v >> 24;
}


x86 assembly (clang, -O0):
<lput4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xc(%rbp),%ecx
sar    $0x0,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lput4>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
mov    %ebx,(%r14)
mov    %ebx,%eax
sar    $0x8,%eax
mov    %eax,0x4(%r14)
mov    %ebx,%eax
sar    $0x10,%eax
mov    %eax,0x8(%r14)
sar    $0x18,%ebx
mov    %ebx,0xc(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @lput4(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %4
%13 = ashr i32 %12, 0
%14 = load i32*, i32** %5
%15 = getelementptr inbounds i32, i32* %14, i64 0
store i32 %13, i32* %15
%16 = load i32, i32* %4
%17 = ashr i32 %16, 8
%18 = load i32*, i32** %5
%19 = getelementptr inbounds i32, i32* %18, i64 1
store i32 %17, i32* %19
%20 = load i32, i32* %4
%21 = ashr i32 %20, 16
%22 = load i32*, i32** %5
%23 = getelementptr inbounds i32, i32* %22, i64 2
store i32 %21, i32* %23
%24 = load i32, i32* %4
%25 = ashr i32 %24, 24
%26 = load i32*, i32** %5
%27 = getelementptr inbounds i32, i32* %26, i64 3
store i32 %25, i32* %27
ret void
}

LLVM IR (-O2):
define void @lput4(i8* writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = icmp ne i8* %0, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
store i32 %1, i32* %3
%7 = ashr i32 %1, 8
%8 = getelementptr inbounds i8, i8* %0, i64 4
%9 = bitcast i8* %8 to i32*
store i32 %7, i32* %9
%10 = ashr i32 %1, 16
%11 = getelementptr inbounds i8, i8* %0, i64 8
%12 = bitcast i8* %11 to i32*
store i32 %10, i32* %12
%13 = ashr i32 %1, 24
%14 = getelementptr inbounds i8, i8* %0, i64 12
%15 = bitcast i8* %14 to i32*
store i32 %13, i32* %15
ret void
}
/* Variables and functions */
int /*<<< orphan*/ move(float, float, float, float, float);
int main(int argc, char **argv) {
  float x = 40, y = 34, z = 0, e = 55, f = 1500;
  move(x * 320.0, y * 320.0, z * 200.0, e * 287.0, f);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movss  0xefd(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xeec(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xed3(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  0xec2(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea4(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe8b(%rip),%xmm2
mulsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
movss  -0x1c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movsd  0xe6a(%rip),%xmm3
mulsd  %xmm3,%xmm2
cvtsd2ss %xmm2,%xmm2
movss  -0x20(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
movsd  0xe49(%rip),%xmm4
mulsd  %xmm4,%xmm3
cvtsd2ss %xmm3,%xmm3
movss  -0x24(%rbp),%xmm4
call   1030 <move@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xee7(%rip),%xmm0
movss  0xee3(%rip),%xmm1
movss  0xedf(%rip),%xmm3
movss  0xedb(%rip),%xmm4
xorps  %xmm2,%xmm2
call   1030 <move@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
store i32 %0, i32* %3
store i8** %1, i8*** %4
store float 4.000000e+01, float* %5
store float 3.400000e+01, float* %6
store float 0.000000e+00, float* %7
store float 5.500000e+01, float* %8
store float 1.500000e+03, float* %9
%10 = load float, float* %5
%11 = fpext float %10 to double
%12 = fmul double %11, 3.200000e+02
%13 = fptrunc double %12 to float
%14 = load float, float* %6
%15 = fpext float %14 to double
%16 = fmul double %15, 3.200000e+02
%17 = fptrunc double %16 to float
%18 = load float, float* %7
%19 = fpext float %18 to double
%20 = fmul double %19, 2.000000e+02
%21 = fptrunc double %20 to float
%22 = load float, float* %8
%23 = fpext float %22 to double
%24 = fmul double %23, 2.870000e+02
%25 = fptrunc double %24 to float
%26 = load float, float* %9
%27 = call i32 @move(float %13, float %17, float %21, float %25, float %26)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @move(float 1.280000e+04, float 1.088000e+04, float 0.000000e+00, float 1.578500e+04, float 1.500000e+03)
ret i32 0
}
int _af_ulaw2linear(unsigned char u_val) {
  int t;
  u_val = ~u_val;
  t = ((u_val & (0xf)) << 3) + (0x84);
  t <<= ((unsigned)u_val & (0x70)) >> (4);
  return ((u_val & (0x80)) ? ((0x84) - t) : (t - (0x84)));
}


x86 assembly (clang, -O0):
<_af_ulaw2linear>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
shl    $0x3,%eax
add    $0x84,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x1(%rbp),%ecx
and    $0x70,%ecx
shr    $0x4,%ecx
mov    -0x8(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     115a <_af_ulaw2linear+0x5a>
mov    $0x84,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1165 <_af_ulaw2linear+0x65>
mov    -0x8(%rbp),%eax
sub    $0x84,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_af_ulaw2linear>:
not    %dil
movzbl %dil,%edx
lea    0x0(,%rdx,8),%eax
or     $0x84,%eax
movzbl %al,%eax
mov    %edx,%ecx
shr    $0x4,%cl
and    $0x7,%cl
shl    %cl,%eax
mov    $0x84,%ecx
sub    %eax,%ecx
add    $0xffffff7c,%eax
test   $0x80,%dl
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @_af_ulaw2linear(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = xor i32 %5, -1
%7 = trunc i32 %6 to i8
store i8 %7, i8* %2
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = and i32 %9, 15
%11 = shl i32 %10, 3
%12 = add nsw i32 %11, 132
store i32 %12, i32* %3
%13 = load i8, i8* %2
%14 = zext i8 %13 to i32
%15 = and i32 %14, 112
%16 = lshr i32 %15, 4
%17 = load i32, i32* %3
%18 = shl i32 %17, %16
store i32 %18, i32* %3
%19 = load i8, i8* %2
%20 = zext i8 %19 to i32
%21 = and i32 %20, 128
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %1
%24 = load i32, i32* %3
%25 = sub nsw i32 132, %24
br label %29
26: ; preds = %1
%27 = load i32, i32* %3
%28 = sub nsw i32 %27, 132
br label %29
29: ; preds = %26, %23
%30 = phi i32 [ %25, %23 ], [ %28, %26 ]
ret i32 %30
}

LLVM IR (-O2):
define i32 @_af_ulaw2linear(i8 zeroext %0) {
%2 = xor i8 %0, -1
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 3
%5 = and i32 %4, 120
%6 = or i32 %5, 132
%7 = lshr i32 %3, 4
%8 = and i32 %7, 7
%9 = shl i32 %6, %8
%10 = and i32 %3, 128
%11 = icmp eq i32 %10, 0
%12 = sub nsw i32 132, %9
%13 = add nsw i32 %9, -132
%14 = select i1 %11, i32 %13, i32 %12
ret i32 %14
}
/* Variables and functions */
int EOF;
int condition(int limit, int i, int c) {
  return i < limit - 1 ? c != '\n' ? c != EOF ? 1 : 0 : 0 : 0;
}


x86 assembly (clang, -O0):
<condition>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    115d <condition+0x5d>
cmpl   $0xa,-0xc(%rbp)
je     1148 <condition+0x48>
mov    -0xc(%rbp),%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovne %ecx,%eax
mov    %eax,-0x10(%rbp)
jmp    1152 <condition+0x52>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    1152 <condition+0x52>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1167 <condition+0x67>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    1167 <condition+0x67>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<condition>:
add    $0xffffffff,%edi
cmp    %esi,%edi
setg   %al
cmp    $0xa,%edx
setne  %cl
and    %al,%cl
mov    0x2ed1(%rip),%rax
cmp    %edx,(%rax)
setne  %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @condition(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 1
%10 = icmp slt i32 %7, %9
br i1 %10, label %11, label %23
11: ; preds = %3
%12 = load i32, i32* %6
%13 = icmp ne i32 %12, 10
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = load i32, i32* %6
%16 = load i32, i32* @EOF
%17 = icmp ne i32 %15, %16
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 1, i32 0
br label %21
20: ; preds = %11
br label %21
21: ; preds = %20, %14
%22 = phi i32 [ %19, %14 ], [ 0, %20 ]
br label %24
23: ; preds = %3
br label %24
24: ; preds = %23, %21
%25 = phi i32 [ %22, %21 ], [ 0, %23 ]
ret i32 %25
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @condition(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %0, -1
%5 = icmp sgt i32 %4, %1
%6 = icmp ne i32 %2, 10
%7 = and i1 %5, %6
%8 = load i32, i32* @EOF
%9 = icmp ne i32 %8, %2
%10 = select i1 %7, i1 %9, i1 false
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int myitoa(unsigned int, char *, int);
int printfint(unsigned int number, char *buf, int index) {
  int counter;
  counter = myitoa(number, buf, index);
  return counter;
}


x86 assembly (clang, -O0):
<printfint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <myitoa@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printfint>:
jmp    1030 <myitoa@plt>

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

LLVM IR (-O2):
define i32 @printfint(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @myitoa(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ print_instr(char *);
void cgen_pop() { print_instr("addiu $sp $sp 4"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"addiu $sp $sp 4\00"
define void @cgen_pop() {
%1 = call i32 @print_instr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"addiu $sp $sp 4\00"
define void @cgen_pop() {
%1 = tail call i32 @print_instr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fn0800_01FA();
void fn0800_01FF() {
  fn0800_01FA();
  fn0800_01FA();
  fn0800_01FA();
  fn0800_01FA();
  fn0800_01FA();
  fn0800_01FA();
  fn0800_01FA();
  fn0800_01FA();
  fn0800_01FA();
  fn0800_01FA();
  return;
}


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

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

LLVM IR (-O0):
define void @fn0800_01FF() {
%1 = call i32 (...) @fn0800_01FA()
%2 = call i32 (...) @fn0800_01FA()
%3 = call i32 (...) @fn0800_01FA()
%4 = call i32 (...) @fn0800_01FA()
%5 = call i32 (...) @fn0800_01FA()
%6 = call i32 (...) @fn0800_01FA()
%7 = call i32 (...) @fn0800_01FA()
%8 = call i32 (...) @fn0800_01FA()
%9 = call i32 (...) @fn0800_01FA()
%10 = call i32 (...) @fn0800_01FA()
ret void
}

LLVM IR (-O2):
define void @fn0800_01FF() {
%1 = tail call i32 (...) @fn0800_01FA()
%2 = tail call i32 (...) @fn0800_01FA()
%3 = tail call i32 (...) @fn0800_01FA()
%4 = tail call i32 (...) @fn0800_01FA()
%5 = tail call i32 (...) @fn0800_01FA()
%6 = tail call i32 (...) @fn0800_01FA()
%7 = tail call i32 (...) @fn0800_01FA()
%8 = tail call i32 (...) @fn0800_01FA()
%9 = tail call i32 (...) @fn0800_01FA()
%10 = tail call i32 (...) @fn0800_01FA()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void __attribute__((noreturn)) usage(void) {
  fprintf(stderr, "Usage: nec-enc -i infile -o outfile -k <key>\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"Usage: nec-enc -i infile -o outfile -k <key>\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"Usage: nec-enc -i infile -o outfile -k <key>\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ uioPrint(char *);
int /*<<< orphan*/ uioPrintChar(char);
int TestArgs(int argc, char *argv[]) {
  for (int i = 0; i < argc; i++) {
    uioPrint(argv[i]);
    uioPrintChar('\n');
  }
  return 0;
}


x86 assembly (clang, -O0):
<TestArgs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116b <TestArgs+0x4b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <uioPrint@plt>
mov    $0xa,%edi
call   1040 <uioPrintChar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <TestArgs+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestArgs>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    115c <TestArgs+0x3c>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <uioPrint@plt>
mov    $0xa,%edi
call   1040 <uioPrintChar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <TestArgs+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @TestArgs(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i8**, i8*** %4
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
%16 = call i32 @uioPrint(i8* %15)
%17 = call i32 @uioPrintChar(i8 signext 10)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @TestArgs(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret i32 0
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %13, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @uioPrint(i8* %10)
%12 = tail call i32 @uioPrintChar(i8 signext 10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
void C_HEAT_Get_Required_Temperature(void) {}


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

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

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

LLVM IR (-O2):
define void @C_HEAT_Get_Required_Temperature() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(unsigned long);
char *ft_strnew(unsigned long size) {
  char *str;
  unsigned long count;
  count = 0;
  if ((str = (char *)malloc(size * sizeof(*str))) == NULL)
    return (NULL);
  while (count <= size) {
    str[count] = 0x00;
    count++;
  }
  return (str);
}


x86 assembly (clang, -O0):
<ft_strnew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
shl    $0x0,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    114c <ft_strnew+0x3c>
movq   $0x0,-0x8(%rbp)
jmp    1184 <ft_strnew+0x74>
jmp    1151 <ft_strnew+0x41>
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
ja     117c <ft_strnew+0x6c>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1151 <ft_strnew+0x41>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strnew>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1147 <ft_strnew+0x27>
mov    %rax,%r14
add    $0x1,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
jmp    114a <ft_strnew+0x2a>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @ft_strnew(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = inttoptr i64 %2 to i8*
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = add nuw i64 %0, 1
br label %7
7: ; preds = %5, %1
%8 = phi i8* [ null, %1 ], [ %3, %5 ]
ret i8* %8
}
/* Type definitions */
typedef int /*<<< orphan*/ DIST_POINT;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ DIST_POINT_it;
void DIST_POINT_free(DIST_POINT *a) {
  ASN1_item_free((ASN1_VALUE *)a, &DIST_POINT_it);
}


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

x86 assembly (clang, -O2):
<DIST_POINT_free>:
mov    0x2ed1(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

LLVM IR (-O0):
@DIST_POINT_it = global i32 0
define void @DIST_POINT_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ASN1_item_free(i32* %3, i32* @DIST_POINT_it)
ret void
}

LLVM IR (-O2):
@DIST_POINT_it = global i32 0
define void @DIST_POINT_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @DIST_POINT_it)
ret void
}
float timedex(float y, float z, float y2, float z2, float y3, float z3, float J,
              float Delta, float zcoupling) {
  return J * (z * (y2 + y3) - Delta * y * (z2 + z3) + y * zcoupling);
}


x86 assembly (clang, -O0):
<timedex>:
push   %rbp
mov    %rsp,%rbp
movss  0x10(%rbp),%xmm8
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  %xmm6,-0x1c(%rbp)
movss  %xmm7,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movss  -0xc(%rbp),%xmm3
addss  -0x14(%rbp),%xmm3
movss  -0x20(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  -0x10(%rbp),%xmm4
addss  -0x18(%rbp),%xmm4
mulss  %xmm4,%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm3,%xmm2
addss  %xmm1,%xmm2
movss  -0x4(%rbp),%xmm1
movss  0x10(%rbp),%xmm3
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<timedex>:
addss  %xmm4,%xmm2
addss  %xmm5,%xmm3
mulss  %xmm0,%xmm7
mulss  %xmm3,%xmm7
mulss  %xmm1,%xmm2
subss  %xmm7,%xmm2
mulss  0x8(%rsp),%xmm0
addss  %xmm2,%xmm0
mulss  %xmm6,%xmm0
ret

LLVM IR (-O0):
define float @timedex(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8) {
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
store float %0, float* %10
store float %1, float* %11
store float %2, float* %12
store float %3, float* %13
store float %4, float* %14
store float %5, float* %15
store float %6, float* %16
store float %7, float* %17
store float %8, float* %18
%19 = load float, float* %16
%20 = load float, float* %11
%21 = load float, float* %12
%22 = load float, float* %14
%23 = fadd float %21, %22
%24 = load float, float* %17
%25 = load float, float* %10
%26 = fmul float %24, %25
%27 = load float, float* %13
%28 = load float, float* %15
%29 = fadd float %27, %28
%30 = fmul float %26, %29
%31 = fneg float %30
%32 = call float @llvm.fmuladd.f32(float %20, float %23, float %31)
%33 = load float, float* %10
%34 = load float, float* %18
%35 = call float @llvm.fmuladd.f32(float %33, float %34, float %32)
%36 = fmul float %19, %35
ret float %36
}

LLVM IR (-O2):
define float @timedex(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8) {
%10 = fadd float %2, %4
%11 = fadd float %3, %5
%12 = fneg float %7
%13 = fmul float %12, %0
%14 = fmul float %11, %13
%15 = tail call float @llvm.fmuladd.f32(float %1, float %10, float %14)
%16 = tail call float @llvm.fmuladd.f32(float %0, float %8, float %15)
%17 = fmul float %16, %6
ret float %17
}
/* Variables and functions */
int /*<<< orphan*/ AccumulatorSetValue(int /*<<< orphan*/);
int /*<<< orphan*/ MemoryGetWordAt(int /*<<< orphan*/);
int /*<<< orphan*/ OperandGetValue();
void Load(void) { AccumulatorSetValue(MemoryGetWordAt(OperandGetValue())); }


x86 assembly (clang, -O0):
<Load>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <OperandGetValue@plt>
mov    %eax,%edi
call   1030 <MemoryGetWordAt@plt>
mov    %eax,%edi
call   1050 <AccumulatorSetValue@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Load>:
push   %rax
xor    %eax,%eax
call   1040 <OperandGetValue@plt>
mov    %eax,%edi
call   1030 <MemoryGetWordAt@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <AccumulatorSetValue@plt>

LLVM IR (-O0):
define void @Load() {
%1 = call i32 (...) @OperandGetValue()
%2 = call i32 @MemoryGetWordAt(i32 %1)
%3 = call i32 @AccumulatorSetValue(i32 %2)
ret void
}

LLVM IR (-O2):
define void @Load() {
%1 = tail call i32 (...) @OperandGetValue()
%2 = tail call i32 @MemoryGetWordAt(i32 %1)
%3 = tail call i32 @AccumulatorSetValue(i32 %2)
ret void
}
/* Type definitions */
struct vec4i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec4i_clamp(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *, int /*<<< orphan*/ *);
__attribute__((always_)) struct vec4i *psvec4i_clamp(struct vec4i *result,
                                                     struct vec4i *a,
                                                     struct vec4i *lower,
                                                     struct vec4i *higher) {
  vec4i_clamp((int32_t *)result, (int32_t *)a, (int32_t *)lower,
              (int32_t *)higher);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec4i_clamp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec4i_clamp@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec4i = type { i32 }
define %struct.vec4i* @psvec4i_clamp(%struct.vec4i* %0, %struct.vec4i* %1, %struct.vec4i* %2, %struct.vec4i* %3) {
%5 = alloca %struct.vec4i*
%6 = alloca %struct.vec4i*
%7 = alloca %struct.vec4i*
%8 = alloca %struct.vec4i*
store %struct.vec4i* %0, %struct.vec4i** %5
store %struct.vec4i* %1, %struct.vec4i** %6
store %struct.vec4i* %2, %struct.vec4i** %7
store %struct.vec4i* %3, %struct.vec4i** %8
%9 = load %struct.vec4i*, %struct.vec4i** %5
%10 = bitcast %struct.vec4i* %9 to i32*
%11 = load %struct.vec4i*, %struct.vec4i** %6
%12 = bitcast %struct.vec4i* %11 to i32*
%13 = load %struct.vec4i*, %struct.vec4i** %7
%14 = bitcast %struct.vec4i* %13 to i32*
%15 = load %struct.vec4i*, %struct.vec4i** %8
%16 = bitcast %struct.vec4i* %15 to i32*
%17 = call i32 @vec4i_clamp(i32* %10, i32* %12, i32* %14, i32* %16)
%18 = load %struct.vec4i*, %struct.vec4i** %5
ret %struct.vec4i* %18
}

LLVM IR (-O2):
%struct.vec4i = type { i32 }
define %struct.vec4i* @psvec4i_clamp(%struct.vec4i* returned %0, %struct.vec4i* %1, %struct.vec4i* %2, %struct.vec4i* %3) {
%5 = getelementptr %struct.vec4i, %struct.vec4i* %0, i64 0, i32 0
%6 = getelementptr %struct.vec4i, %struct.vec4i* %1, i64 0, i32 0
%7 = getelementptr %struct.vec4i, %struct.vec4i* %2, i64 0, i32 0
%8 = getelementptr %struct.vec4i, %struct.vec4i* %3, i64 0, i32 0
%9 = tail call i32 @vec4i_clamp(i32* %5, i32* %6, i32* %7, i32* %8)
ret %struct.vec4i* %0
}
/* Variables and functions */
bool sancus_get_frll(long long v, long long a, long long b, double *out) {
  if ((v >= a) && (v <= b)) {
    if (out != NULL)
      *out = (double)v;
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<sancus_get_frll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jl     1155 <sancus_get_frll+0x55>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jg     1155 <sancus_get_frll+0x55>
cmpq   $0x0,-0x28(%rbp)
je     1149 <sancus_get_frll+0x49>
cvtsi2sdq -0x10(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    115c <sancus_get_frll+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_get_frll>:
xor    %eax,%eax
cmp    %rsi,%rdi
jl     111f <sancus_get_frll+0x1f>
cmp    %rdx,%rdi
jg     111f <sancus_get_frll+0x1f>
mov    $0x1,%eax
test   %rcx,%rcx
je     111f <sancus_get_frll+0x1f>
cvtsi2sd %rdi,%xmm0
movsd  %xmm0,(%rcx)
ret

LLVM IR (-O0):
define i32 @sancus_get_frll(i64 %0, i64 %1, i64 %2, double* %3) {
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca double*
store i64 %0, i64* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store double* %3, double** %9
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = icmp sge i64 %10, %11
br i1 %12, label %13, label %25
13: ; preds = %4
%14 = load i64, i64* %6
%15 = load i64, i64* %8
%16 = icmp sle i64 %14, %15
br i1 %16, label %17, label %25
17: ; preds = %13
%18 = load double*, double** %9
%19 = icmp ne double* %18, null
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = load i64, i64* %6
%22 = sitofp i64 %21 to double
%23 = load double*, double** %9
store double %22, double* %23
br label %24
24: ; preds = %20, %17
store i32 1, i32* %5
br label %26
25: ; preds = %13, %4
store i32 0, i32* %5
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %5
ret i32 %27
}

LLVM IR (-O2):
define i32 @sancus_get_frll(i64 %0, i64 %1, i64 %2, double* writeonly %3) {
%5 = icmp slt i64 %0, %1
%6 = icmp sgt i64 %0, %2
%7 = or i1 %5, %6
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = icmp eq double* %3, null
br i1 %9, label %12, label %10
10: ; preds = %8
%11 = sitofp i64 %0 to double
store double %11, double* %3
br label %12
12: ; preds = %4, %8, %10
%13 = phi i32 [ 1, %10 ], [ 1, %8 ], [ 0, %4 ]
ret i32 %13
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int gettimeofday(struct timeval *tv, void *tz) {
  (void)tz;
  tv->tv_sec = 0;
  tv->tv_usec = 0;
  return 0;
}


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

x86 assembly (clang, -O2):
<gettimeofday>:
xorps  %xmm0,%xmm0
movups %xmm0,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @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 i8*, i8** %4
%6 = load %struct.timeval*, %struct.timeval** %3
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
store i64 0, i64* %7
%8 = load %struct.timeval*, %struct.timeval** %3
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
store i64 0, i64* %9
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @gettimeofday(%struct.timeval* nocapture writeonly %0, i8* nocapture readnone %1) {
%3 = bitcast %struct.timeval* %0 to i8*
ret i32 0
}
int setlogmask_r(int maskpri, struct syslog_data *data) { return 0xff; }


x86 assembly (clang, -O0):
<setlogmask_r>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.syslog_data = type opaque
define i32 @setlogmask_r(i32 %0, %struct.syslog_data* %1) {
%3 = alloca i32
%4 = alloca %struct.syslog_data*
store i32 %0, i32* %3
store %struct.syslog_data* %1, %struct.syslog_data** %4
ret i32 255
}

LLVM IR (-O2):
%struct.syslog_data = type opaque
define i32 @setlogmask_r(i32 %0, %struct.syslog_data* nocapture readnone %1) {
ret i32 255
}
/* Variables and functions */
int percencode(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ readln(char *);
int main() {
  char input[1024] = {'0'};
  readln(input);
  if (percencode(input) == true)
    printf("'%s'", input);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
movb   $0x30,-0x410(%rbp)
lea    -0x410(%rbp),%rdi
call   1050 <readln@plt>
lea    -0x410(%rbp),%rdi
call   1060 <percencode@plt>
cmp    $0x1,%eax
jne    11a0 <main+0x60>
lea    -0x410(%rbp),%rsi
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rbx
mov    $0x400,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
movb   $0x30,(%rsp)
mov    %rbx,%rdi
call   1050 <readln@plt>
mov    %rbx,%rdi
call   1060 <percencode@plt>
cmp    $0x1,%eax
jne    1182 <main+0x42>
lea    0xe86(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"'%s'\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
store i32 0, i32* %1
%3 = bitcast [1024 x i8]* %2 to i8*
%4 = bitcast i8* %3 to <{ i8, [1023 x i8] }>*
%5 = getelementptr inbounds <{ i8, [1023 x i8] }>, <{ i8, [1023 x i8] }>* %4, i32 0, i32 0
store i8 48, i8* %5
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%7 = call i32 @readln(i8* %6)
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%9 = call i32 @percencode(i8* %8)
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %14
11: ; preds = %0
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"'%s'\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
store i8 48, i8* %2
%3 = call i32 @readln(i8* %2)
%4 = call i32 @percencode(i8* %2)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %8
8: ; preds = %6, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t rtp2435_get_ts(uint8_t *header) { return header[0]; }


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

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

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

LLVM IR (-O2):
define i32 @rtp2435_get_ts(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int round_up_div(int, int);
int round_up_by(int n, int d) { return round_up_div(n, d) * n; }


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

x86 assembly (clang, -O2):
<round_up_by>:
push   %rbx
mov    %edi,%ebx
call   1030 <round_up_div@plt>
imul   %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @round_up_by(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @round_up_div(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = mul nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @round_up_by(i32 %0, i32 %1) {
%3 = tail call i32 @round_up_div(i32 %0, i32 %1)
%4 = mul nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ timeSeed();
void init(void) { srand(timeSeed()); }


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <timeSeed@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @init() {
%1 = call i32 (...) @timeSeed()
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 (...) @timeSeed()
%2 = tail call i32 @srand(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
const char *cJSON_Version(void) {
  static char version[15];
  sprintf(version, "%i.%i.%i", 1, 7, 3);
  return version;
}


x86 assembly (clang, -O0):
<cJSON_Version>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f0e(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x1,%edx
mov    $0x7,%ecx
mov    $0x3,%r8d
call   1030 <sprintf@plt>
lea    0x2eeb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cJSON_Version>:
push   %rbx
lea    0x2f11(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
mov    $0x7,%ecx
mov    $0x3,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 7, i32 3)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}

LLVM IR (-O2):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 7, i32 3)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ gsalt;

/* Variables and functions */
int /*<<< orphan*/ bcrypt_initsalt(int /*<<< orphan*/, int /*<<< orphan*/ *,
                                   int);
uint8_t *bcrypt_gensalt(uint8_t log_rounds) {
  static uint8_t gsalt[(7 + (16 * 4 + 2) / 3 + 1)];
  bcrypt_initsalt(log_rounds, gsalt, sizeof(gsalt));
  return gsalt;
}


x86 assembly (clang, -O0):
<bcrypt_gensalt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2f1b(%rip),%rsi
mov    $0x78,%edx
call   1030 <bcrypt_initsalt@plt>
lea    0x2f0a(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcrypt_gensalt>:
push   %rbx
lea    0x2f28(%rip),%rbx
mov    %rbx,%rsi
mov    $0x78,%edx
call   1030 <bcrypt_initsalt@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@bcrypt_gensalt.gsalt = internal global [30 x i32] zeroinitializer
define i32* @bcrypt_gensalt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @bcrypt_initsalt(i32 %3, i32* getelementptr inbounds ([30 x i32], [30 x i32]* @bcrypt_gensalt.gsalt, i64 0, i64 0), i32 120)
ret i32* getelementptr inbounds ([30 x i32], [30 x i32]* @bcrypt_gensalt.gsalt, i64 0, i64 0)
}

LLVM IR (-O2):
@bcrypt_gensalt.gsalt = internal global [30 x i32] zeroinitializer
define i32* @bcrypt_gensalt(i32 %0) {
%2 = tail call i32 @bcrypt_initsalt(i32 %0, i32* getelementptr inbounds ([30 x i32], [30 x i32]* @bcrypt_gensalt.gsalt, i64 0, i64 0), i32 120)
ret i32* getelementptr inbounds ([30 x i32], [30 x i32]* @bcrypt_gensalt.gsalt, i64 0, i64 0)
}
void func_c() {}


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

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

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

LLVM IR (-O2):
define void @func_c() {
ret void
}
/* Variables and functions */
scalar_t__ opa_isdigit(char);
int opa_ishex(char b) {
  return opa_isdigit(b) || (b >= 'A' && b <= 'F') || (b >= 'a' && b <= 'f');
}


x86 assembly (clang, -O0):
<opa_ishex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <opa_isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    117d <opa_ishex+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1158 <opa_ishex+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x46,%ecx
mov    %al,-0x2(%rbp)
jle    117d <opa_ishex+0x6d>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x3(%rbp)
jl     1177 <opa_ishex+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x66,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opa_ishex>:
push   %rbx
mov    %edi,%ebx
call   1030 <opa_isdigit@plt>
test   %rax,%rax
setne  %al
and    $0xdf,%bl
add    $0xbf,%bl
cmp    $0x6,%bl
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @opa_ishex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @opa_isdigit(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %24, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 65
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 70
br i1 %13, label %24, label %14
14: ; preds = %10, %6
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sge i32 %16, 97
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sle i32 %20, 102
br label %22
22: ; preds = %18, %14
%23 = phi i1 [ false, %14 ], [ %21, %18 ]
br label %24
24: ; preds = %22, %10, %1
%25 = phi i1 [ true, %10 ], [ true, %1 ], [ %23, %22 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @opa_ishex(i8 signext %0) {
%2 = tail call i64 @opa_isdigit(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %6, %3
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *strdup(const char *str) {
  size_t length = strlen(str);
  char *result = malloc(length + 1);
  if (!result)
    return NULL;
  memcpy(result, str, length + 1);
  return result;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1172 <strdup+0x42>
movq   $0x0,-0x8(%rbp)
jmp    118f <strdup+0x5f>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x1,%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %rax,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
call   1050 <malloc@plt>
mov    %rax,%r15
test   %rax,%rax
je     1162 <strdup+0x32>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %3)
br label %8
8: ; preds = %1, %6
ret i8* %4
}