xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ glColor3f(float, float, float);
void armorColorScale(float f) {
  float mf = 1 - f;
  float r = 1 - mf * mf;
  float g = f * f * f;
  float b = mf * mf * mf * mf;
  glColor3f(r, g, b);
}


x86 assembly (clang, -O0):
<armorColorScale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm1,%xmm0
movss  0xeae(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
call   1030 <glColor3f@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<armorColorScale>:
movss  0xee8(%rip),%xmm3
movaps %xmm3,%xmm4
subss  %xmm0,%xmm4
movaps %xmm4,%xmm2
mulss  %xmm4,%xmm2
subss  %xmm2,%xmm3
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm4,%xmm2
mulss  %xmm4,%xmm2
movaps %xmm3,%xmm0
jmp    1030 <glColor3f@plt>

LLVM IR (-O0):
define void @armorColorScale(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %2
%7 = load float, float* %2
%8 = fsub float 1.000000e+00, %7
store float %8, float* %3
%9 = load float, float* %3
%10 = load float, float* %3
%11 = fneg float %9
%12 = call float @llvm.fmuladd.f32(float %11, float %10, float 1.000000e+00)
store float %12, float* %4
%13 = load float, float* %2
%14 = load float, float* %2
%15 = fmul float %13, %14
%16 = load float, float* %2
%17 = fmul float %15, %16
store float %17, float* %5
%18 = load float, float* %3
%19 = load float, float* %3
%20 = fmul float %18, %19
%21 = load float, float* %3
%22 = fmul float %20, %21
%23 = load float, float* %3
%24 = fmul float %22, %23
store float %24, float* %6
%25 = load float, float* %4
%26 = load float, float* %5
%27 = load float, float* %6
%28 = call i32 @glColor3f(float %25, float %26, float %27)
ret void
}

LLVM IR (-O2):
define void @armorColorScale(float %0) {
%2 = fsub float 1.000000e+00, %0
%3 = fneg float %2
%4 = tail call float @llvm.fmuladd.f32(float %3, float %2, float 1.000000e+00)
%5 = fmul float %0, %0
%6 = fmul float %5, %0
%7 = fmul float %2, %2
%8 = fmul float %2, %7
%9 = fmul float %2, %8
%10 = tail call i32 @glColor3f(float %4, float %6, float %9)
ret void
}
int test_imm_D8int32_reg(int val) { return ((val) & (0xD8 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_D8int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xd8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_D8int32_reg(i32 %0) {
%2 = and i32 %0, 216
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void mstrcat(char *s, char *t) {
  while (*s)
    s++;
  while ((*s++ = *t++)) {
    ;
  }
}


x86 assembly (clang, -O0):
<mstrcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112a <mstrcat+0x2a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <mstrcat+0xc>
jmp    112f <mstrcat+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     115e <mstrcat+0x5e>
jmp    112f <mstrcat+0x2f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mstrcat>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <mstrcat>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,-0x1(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <mstrcat+0x10>
ret

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

LLVM IR (-O2):
define void @mstrcat(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %4, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128InterruptPinP__7__IrqSignal__fired();
void HplAtm128InterruptSigP__IntSig7__fired(void) {
  HplAtm128InterruptPinP__7__IrqSignal__fired();
}


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

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

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

LLVM IR (-O2):
define void @HplAtm128InterruptSigP__IntSig7__fired() {
%1 = tail call i32 (...) @HplAtm128InterruptPinP__7__IrqSignal__fired()
ret void
}
long int f5(int x) { return ~(1ULL << (x & 0x3f)); }


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3f,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
xor    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
mov    %edi,%ecx
mov    $0xfffffffffffffffe,%rax
rol    %cl,%rax
ret

LLVM IR (-O0):
define i64 @f5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 63
%5 = zext i32 %4 to i64
%6 = shl i64 1, %5
%7 = xor i64 %6, -1
ret i64 %7
}

LLVM IR (-O2):
define i64 @f5(i32 %0) {
%2 = and i32 %0, 63
%3 = zext i32 %2 to i64
%4 = shl nuw i64 1, %3
%5 = xor i64 %4, -1
ret i64 %5
}
/* Variables and functions */
scalar_t__ game_init(int, char **);
int /*<<< orphan*/ game_shutdown();
int /*<<< orphan*/ game_update();
int main(int argc, char **argv) {
  int ret = 0;
  if (game_init(argc, argv)) {
    if (!game_update()) {
      ret = 2;
    }
    if (!game_shutdown()) {
      ret = 3;
    }
  } else {
    ret = 1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <game_init@plt>
cmp    $0x0,%rax
je     1196 <main+0x66>
mov    $0x0,%al
call   1050 <game_update@plt>
cmp    $0x0,%eax
jne    117a <main+0x4a>
movl   $0x2,-0x14(%rbp)
mov    $0x0,%al
call   1040 <game_shutdown@plt>
cmp    $0x0,%eax
jne    1191 <main+0x61>
movl   $0x3,-0x14(%rbp)
jmp    119d <main+0x6d>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1030 <game_init@plt>
test   %rax,%rax
je     115e <main+0x2e>
xor    %eax,%eax
call   1050 <game_update@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
add    %ebx,%ebx
xor    %eax,%eax
call   1040 <game_shutdown@plt>
test   %eax,%eax
mov    $0x3,%eax
cmovne %ebx,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i64 @game_init(i32 %0, i8** %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = tail call i32 (...) @game_update()
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 2, i32 0
%9 = tail call i32 (...) @game_shutdown()
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i32 3, i32 %8
br label %12
12: ; preds = %5, %2
%13 = phi i32 [ 1, %2 ], [ %11, %5 ]
ret i32 %13
}
int ft_sqrt(int nb) {
  int i;
  i = -1;
  while (++i < nb)
    if (i * i == nb)
      return (i);
  return (0);
}


x86 assembly (clang, -O0):
<ft_sqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmp    -0x8(%rbp),%eax
jge    1140 <ft_sqrt+0x40>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    113b <ft_sqrt+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <ft_sqrt+0x47>
jmp    110e <ft_sqrt+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_sqrt>:
xor    %eax,%eax
test   %edi,%edi
mov    $0x0,%edx
cmovg  %edi,%edx
xor    %ecx,%ecx
xchg   %ax,%ax
cmp    %ecx,%edx
je     1125 <ft_sqrt+0x25>
mov    %ecx,%esi
imul   %ecx,%esi
add    $0x1,%ecx
cmp    %edi,%esi
jne    1110 <ft_sqrt+0x10>
add    $0xffffffff,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ft_sqrt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 -1, i32* %4
br label %5
5: ; preds = %18, %1
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
store i32 %7, i32* %4
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %5
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = mul nsw i32 %11, %12
%14 = load i32, i32* %3
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = load i32, i32* %4
store i32 %17, i32* %2
br label %20
18: ; preds = %10
br label %5
19: ; preds = %5
store i32 0, i32* %2
br label %20
20: ; preds = %19, %16
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @ft_sqrt(i32 %0) {
%2 = call i32 @llvm.smax.i32(i32 %0, i32 0)
%3 = add nsw i32 %2, -1
br label %4
4: ; preds = %8, %1
%5 = phi i32 [ -1, %1 ], [ %6, %8 ]
%6 = add nsw i32 %5, 1
%7 = icmp eq i32 %5, %3
br i1 %7, label %11, label %8
8: ; preds = %4
%9 = mul nsw i32 %6, %6
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %4
11: ; preds = %4, %8
%12 = phi i32 [ %6, %8 ], [ 0, %4 ]
ret i32 %12
}
int make_set(int i, int *pp) {
  pp[i] = i;
  return i;
}


x86 assembly (clang, -O0):
<make_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_set>:
movslq %edi,%rax
mov    %eax,(%rsi,%rax,4)
ret

LLVM IR (-O0):
define i32 @make_set(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 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
store i32 %5, i32* %9
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @make_set(i32 returned %0, i32* nocapture writeonly %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds i32, i32* %1, i64 %3
store i32 %0, i32* %4
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ foo();
int test1(int i) {
  foo();
  bar();
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @foo()
%5 = call i32 (...) @bar()
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @test1(i32 %0) {
%2 = tail call i32 (...) @foo()
%3 = tail call i32 (...) @bar()
ret i32 undef
}
int intSqrt(int x) {
  long g = x;
  while (g * g > x)
    g = (g + x / g) / 2;
  return g;
}


x86 assembly (clang, -O0):
<intSqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
cmp    %rcx,%rax
jle    1154 <intSqrt+0x54>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movslq -0x4(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
jmp    110f <intSqrt+0xf>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intSqrt>:
movslq %edi,%rcx
mov    %rcx,%rax
imul   %rcx,%rax
cmp    %rcx,%rax
jle    1158 <intSqrt+0x58>
mov    %rcx,%rsi
jmp    1144 <intSqrt+0x44>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rcx,%rax
cqto
idiv   %rsi
add    %rsi,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
add    %rax,%rsi
sar    %rsi
mov    %rsi,%rax
imul   %rsi,%rax
cmp    %rcx,%rax
jle    115b <intSqrt+0x5b>
mov    %rcx,%rax
or     %rsi,%rax
shr    $0x20,%rax
jne    1120 <intSqrt+0x20>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
jmp    1128 <intSqrt+0x28>
mov    %rcx,%rsi
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @intSqrt(i32 %0) {
%2 = sext i32 %0 to i64
%3 = mul nsw i64 %2, %2
%4 = icmp sgt i64 %3, %2
br i1 %4, label %5, label %12
5: ; preds = %1, %5
%6 = phi i64 [ %9, %5 ], [ %2, %1 ]
%7 = sdiv i64 %2, %6
%8 = add nsw i64 %7, %6
%9 = sdiv i64 %8, 2
%10 = mul nsw i64 %9, %9
%11 = icmp sgt i64 %10, %2
br i1 %11, label %5, label %12
12: ; preds = %5, %1
%13 = phi i64 [ %2, %1 ], [ %9, %5 ]
%14 = trunc i64 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ HTS_error(int, char *);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *HTS_calloc(const size_t num, const size_t size) {
  size_t n = num * size;
  void *mem = (void *)malloc(n);
  memset(mem, 0, n);
  if (mem == NULL)
    HTS_error(1, "HTS_calloc: Cannot allocate memory.\n");
  return mem;
}


x86 assembly (clang, -O0):
<HTS_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
cmpq   $0x0,-0x20(%rbp)
jne    1185 <HTS_calloc+0x55>
mov    $0x1,%edi
lea    0xe80(%rip),%rsi
call   1050 <HTS_error@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HTS_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
test   %r14,%r14
jne    1169 <HTS_calloc+0x39>
lea    0xea1(%rip),%rsi
mov    $0x1,%edi
call   1050 <HTS_error@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [37 x i8] c"HTS_calloc: Cannot allocate memory.\0A\00"
define i8* @HTS_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = mul i64 %7, %8
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = call i64 @malloc(i64 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = load i64, i64* %5
%15 = call i32 @memset(i8* %13, i32 0, i64 %14)
%16 = load i8*, i8** %6
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = call i32 @HTS_error(i32 1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %18, %2
%21 = load i8*, i8** %6
ret i8* %21
}

LLVM IR (-O2):
@.str = [37 x i8] c"HTS_calloc: Cannot allocate memory.\0A\00"
define i8* @HTS_calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @memset(i8* %5, i32 0, i64 %3)
%7 = icmp eq i64 %4, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @HTS_error(i32 1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret i8* %5
}
int mdp4_lcdc_off(struct platform_device *pdev) { return 0; }


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

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

LLVM IR (-O0):
%struct.platform_device = type opaque
define i32 @mdp4_lcdc_off(%struct.platform_device* %0) {
%2 = alloca %struct.platform_device*
store %struct.platform_device* %0, %struct.platform_device** %2
ret i32 0
}

LLVM IR (-O2):
%struct.platform_device = type opaque
define i32 @mdp4_lcdc_off(%struct.platform_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
scalar_t__ ulckpwdf();
int unlock_files() {
  if (ulckpwdf() != 0) {
    fprintf(stderr, "Error unlocking files: %s\n", strerror(errno));
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<unlock_files>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ulckpwdf@plt>
cmp    $0x0,%rax
je     1181 <unlock_files+0x51>
mov    0x2e90(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x8(%rbp),%edi
mov    %rax,%rdx
lea    0xe90(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1188 <unlock_files+0x58>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlock_files>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <ulckpwdf@plt>
test   %rax,%rax
je     116b <unlock_files+0x3b>
mov    0x2e98(%rip),%rax
mov    (%rax),%ebp
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xea1(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
jmp    1170 <unlock_files+0x40>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Error unlocking files: %s\0A\00"
@errno = global i32 0
define i32 @unlock_files() {
%1 = alloca i32
%2 = call i64 (...) @ulckpwdf()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = load i32, i32* @stderr
%6 = load i32, i32* @errno
%7 = call i8* @strerror(i32 %6)
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %7)
store i32 0, i32* %1
br label %10
9: ; preds = %0
store i32 1, i32* %1
br label %10
10: ; preds = %9, %4
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Error unlocking files: %s\0A\00"
@errno = global i32 0
define i32 @unlock_files() {
%1 = tail call i64 (...) @ulckpwdf()
%2 = icmp eq i64 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
%7 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %0, %3
%9 = phi i32 [ 0, %3 ], [ 1, %0 ]
ret i32 %9
}
char getZeroflag(char flags[]) { return flags[8 - 2]; }


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

x86 assembly (clang, -O2):
<getZeroflag>:
mov    0x6(%rdi),%al
ret

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

LLVM IR (-O2):
define signext i8 @getZeroflag(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 6
%3 = load i8, i8* %2
ret i8 %3
}
int uart1GetchBlock(void) {
  while (!((*((volatile unsigned char *)0xE0010014)) & (1 << 0)))
    ;
  return (*((volatile unsigned char *)0xE0010000));
}


x86 assembly (clang, -O0):
<uart1GetchBlock>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <uart1GetchBlock+0x9>
mov    $0xe0010014,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112b <uart1GetchBlock+0x2b>
jmp    1130 <uart1GetchBlock+0x30>
jmp    1109 <uart1GetchBlock+0x9>
mov    $0xe0010000,%eax
mov    (%rax),%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart1GetchBlock>:
mov    $0xe0010000,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testb  $0x1,0x14(%rax)
je     1110 <uart1GetchBlock+0x10>
movzbl (%rax),%eax
ret

LLVM IR (-O0):
define i32 @uart1GetchBlock() {
br label %1
1: ; preds = %7, %0
%2 = load volatile i8, i8* inttoptr (i64 3758161940 to i8*)
%3 = zext i8 %2 to i32
%4 = and i32 %3, 1
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %7, label %8
7: ; preds = %1
br label %1
8: ; preds = %1
%9 = load volatile i8, i8* inttoptr (i64 3758161920 to i8*)
%10 = zext i8 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @uart1GetchBlock() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i8, i8* inttoptr (i64 3758161940 to i8*)
%3 = and i8 %2, 1
%4 = icmp eq i8 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i8, i8* inttoptr (i64 3758161920 to i8*)
%7 = zext i8 %6 to i32
ret i32 %7
}
int test_imm_18int8_mem(signed char *val) {
  return ((*val) & (-0x18 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_18int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffffe8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_18int8_mem>:
testb  $0xe8,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_18int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -24
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct addrinfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
void ai_free(struct addrinfo **const ai) {
  assert(ai != NULL);
  if (*ai != NULL)
    freeaddrinfo(*ai);
}


x86 assembly (clang, -O0):
<ai_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1158 <ai_free+0x38>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1040 <freeaddrinfo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ai_free>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%rdi
test   %rdi,%rdi
je     1140 <ai_free+0x20>
pop    %rbx
jmp    1040 <freeaddrinfo@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.addrinfo = type { i32 }
define void @ai_free(%struct.addrinfo** %0) {
%2 = alloca %struct.addrinfo**
store %struct.addrinfo** %0, %struct.addrinfo*** %2
%3 = load %struct.addrinfo**, %struct.addrinfo*** %2
%4 = icmp ne %struct.addrinfo** %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load %struct.addrinfo**, %struct.addrinfo*** %2
%8 = load %struct.addrinfo*, %struct.addrinfo** %7
%9 = icmp ne %struct.addrinfo* %8, null
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load %struct.addrinfo**, %struct.addrinfo*** %2
%12 = load %struct.addrinfo*, %struct.addrinfo** %11
%13 = call i32 @freeaddrinfo(%struct.addrinfo* %12)
br label %14
14: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
%struct.addrinfo = type { i32 }
define void @ai_free(%struct.addrinfo** %0) {
%2 = icmp ne %struct.addrinfo** %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load %struct.addrinfo*, %struct.addrinfo** %0
%6 = icmp eq %struct.addrinfo* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @freeaddrinfo(%struct.addrinfo* %5)
br label %9
9: ; preds = %7, %1
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef unsigned long socklen_t;

/* Variables and functions */
int __socketcall(int, unsigned long *);
int __libc_connect(int sockfd, const struct sockaddr *saddr,
                   socklen_t addrlen) {
  unsigned long args[3];
  args[0] = sockfd;
  args[1] = (unsigned long)saddr;
  args[2] = addrlen;
  return __socketcall(3, args);
}


x86 assembly (clang, -O0):
<__libc_connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x30(%rbp),%rsi
mov    $0x3,%edi
call   1030 <__socketcall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__libc_connect>:
sub    $0x18,%rsp
movslq %edi,%rax
mov    %rax,(%rsp)
mov    %rsi,0x8(%rsp)
mov    %rdx,0x10(%rsp)
mov    %rsp,%rsi
mov    $0x3,%edi
call   1030 <__socketcall@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @__libc_connect(i32 %0, %struct.sockaddr* %1, i64 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i64
%7 = alloca [3 x i64]
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 0
store i64 %9, i64* %10
%11 = load %struct.sockaddr*, %struct.sockaddr** %5
%12 = ptrtoint %struct.sockaddr* %11 to i64
%13 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 1
store i64 %12, i64* %13
%14 = load i64, i64* %6
%15 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 2
store i64 %14, i64* %15
%16 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 0
%17 = call i32 @__socketcall(i32 3, i64* %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @__libc_connect(i32 %0, %struct.sockaddr* %1, i64 %2) {
%4 = alloca [3 x i64]
%5 = bitcast [3 x i64]* %4 to i8*
%6 = sext i32 %0 to i64
%7 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 0
store i64 %6, i64* %7
%8 = ptrtoint %struct.sockaddr* %1 to i64
%9 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 1
store i64 %8, i64* %9
%10 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 2
store i64 %2, i64* %10
%11 = call i32 @__socketcall(i32 3, i64* %7)
ret i32 %11
}
/* Variables and functions */
size_t EVP_MAX_IV_LENGTH;
size_t EVP_MAX_MD_SIZE;
size_t el_aes256_encrypt_output_len(size_t plain_data_len) {
  return (plain_data_len | 0xf) + 1 + EVP_MAX_MD_SIZE + EVP_MAX_IV_LENGTH;
}


x86 assembly (clang, -O0):
<el_aes256_encrypt_output_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
or     $0xf,%rax
add    $0x1,%rax
mov    0x2ec5(%rip),%rcx
add    (%rcx),%rax
mov    0x2ec3(%rip),%rcx
add    (%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<el_aes256_encrypt_output_len>:
or     $0xf,%rdi
mov    0x2ed5(%rip),%rax
add    (%rax),%rdi
mov    0x2ed3(%rip),%rax
mov    (%rax),%rax
add    %rdi,%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
@EVP_MAX_MD_SIZE = global i64 0
@EVP_MAX_IV_LENGTH = global i64 0
define i64 @el_aes256_encrypt_output_len(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = or i64 %3, 15
%5 = add i64 %4, 1
%6 = load i64, i64* @EVP_MAX_MD_SIZE
%7 = add i64 %5, %6
%8 = load i64, i64* @EVP_MAX_IV_LENGTH
%9 = add i64 %7, %8
ret i64 %9
}

LLVM IR (-O2):
@EVP_MAX_MD_SIZE = global i64 0
@EVP_MAX_IV_LENGTH = global i64 0
define i64 @el_aes256_encrypt_output_len(i64 %0) {
%2 = or i64 %0, 15
%3 = add i64 %2, 1
%4 = load i64, i64* @EVP_MAX_MD_SIZE
%5 = add i64 %3, %4
%6 = load i64, i64* @EVP_MAX_IV_LENGTH
%7 = add i64 %5, %6
ret i64 %7
}
void XtCvtIntToUnsignedChar() {}


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

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

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

LLVM IR (-O2):
define void @XtCvtIntToUnsignedChar() {
ret void
}
int mdp_get_bytes_per_pixel(int format) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @mdp_get_bytes_per_pixel(i32 %0) {
ret i32 -1
}
/* Variables and functions */
float abs(float value) {
  if (value > 0)
    return value;
  else
    return value * -1;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1129 <abs+0x29>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113b <abs+0x3b>
movss  0xecf(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
movaps 0xef9(%rip),%xmm1
xorps  %xmm0,%xmm1
xorps  %xmm2,%xmm2
cmpltss %xmm0,%xmm2
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @abs(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp ogt float %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load float, float* %3
store float %7, float* %2
br label %11
8: ; preds = %1
%9 = load float, float* %3
%10 = fmul float %9, -1.000000e+00
store float %10, float* %2
br label %11
11: ; preds = %8, %6
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
define float @abs(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %0, float %3
ret float %4
}
void g_source_get_current_time() {}


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

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

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

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

/* Variables and functions */
unsigned char *mem_copy_dword2vect_little(unsigned char *,
                                          int /*<<< orphan*/ const);
unsigned char *arch_mem_copy_dword2vect_little(unsigned char *v,
                                               const uint32_t dword) {
  return mem_copy_dword2vect_little(v, dword);
}


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

x86 assembly (clang, -O2):
<arch_mem_copy_dword2vect_little>:
jmp    1030 <mem_copy_dword2vect_little@plt>

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

LLVM IR (-O2):
define i8* @arch_mem_copy_dword2vect_little(i8* %0, i32 %1) {
%3 = tail call i8* @mem_copy_dword2vect_little(i8* %0, i32 %1)
ret i8* %3
}
int snd_info_card_register(struct snd_card *card) { return 0; }


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

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

LLVM IR (-O0):
%struct.snd_card = type opaque
define i32 @snd_info_card_register(%struct.snd_card* %0) {
%2 = alloca %struct.snd_card*
store %struct.snd_card* %0, %struct.snd_card** %2
ret i32 0
}

LLVM IR (-O2):
%struct.snd_card = type opaque
define i32 @snd_info_card_register(%struct.snd_card* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ epoll25(struct __test_metadata *);
void wrapper_epoll25(struct __test_metadata *_metadata,
                     struct __fixture_variant_metadata *variant) {
  epoll25(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_epoll25>:
jmp    1030 <epoll25@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll25(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @epoll25(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll25(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @epoll25(%struct.__test_metadata* %0)
ret void
}
int test_imm_4Duint8_mem(unsigned char *val) {
  return ((*val) & (-0x4D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Duint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffffb3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Duint8_mem>:
testb  $0xb3,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_4Duint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -77
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void g_param_spec_get_nick() {}


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

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

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

LLVM IR (-O2):
define void @g_param_spec_get_nick() {
ret void
}
int *f(int *ptr) { return ptr; }


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

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

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

LLVM IR (-O2):
define i32* @f(i32* readnone returned %0) {
ret i32* %0
}
/* Variables and functions */
double stress_funccall_double_1(double const);
double stress_funcdeep_double_4(double const, double const, double const,
                                double const);
double __attribute__((no))
stress_funcdeep_double_5(const double a, const double b, const double c,
                         const double d, const double e) {
  return stress_funcdeep_double_4(e, d, c, b) + stress_funccall_double_1(a);
}


x86 assembly (clang, -O0):
<stress_funcdeep_double_5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm3
call   1040 <stress_funcdeep_double_4@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <stress_funccall_double_1@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_funcdeep_double_5>:
sub    $0x18,%rsp
movaps %xmm1,%xmm5
movsd  %xmm0,0x10(%rsp)
movaps %xmm4,%xmm0
movaps %xmm3,%xmm1
movaps %xmm5,%xmm3
call   1040 <stress_funcdeep_double_4@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <stress_funccall_double_1@plt>
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @stress_funcdeep_double_5(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %10
%12 = load double, double* %9
%13 = load double, double* %8
%14 = load double, double* %7
%15 = call double @stress_funcdeep_double_4(double %11, double %12, double %13, double %14)
%16 = load double, double* %6
%17 = call double @stress_funccall_double_1(double %16)
%18 = fadd double %15, %17
ret double %18
}

LLVM IR (-O2):
define double @stress_funcdeep_double_5(double %0, double %1, double %2, double %3, double %4) {
%6 = tail call double @stress_funcdeep_double_4(double %4, double %3, double %2, double %1)
%7 = tail call double @stress_funccall_double_1(double %0)
%8 = fadd double %6, %7
ret double %8
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, char, size_t);
void *calloc(size_t n, size_t m) {
  n *= m;
  void *ptr = malloc(n);
  if (ptr != NULL)
    memset(ptr, '\0', n);
  return ptr;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1164 <calloc+0x44>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <calloc+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = mul i64 %7, %6
store i64 %8, i64* %3
%9 = load i64, i64* %3
%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 %13, label %17
13: ; preds = %2
%14 = load i8*, i8** %5
%15 = load i64, i64* %3
%16 = call i32 @memset(i8* %14, i8 signext 0, i64 %15)
br label %17
17: ; preds = %13, %2
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i8 signext 0, i64 %3)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
/* Variables and functions */
int pow(int, int);
int score(int vowel_group_length) {
  return vowel_group_length == 0
             ? 0
             : vowel_group_length * pow(2, vowel_group_length);
}


x86 assembly (clang, -O0):
<score>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112f <score+0x1f>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    114d <score+0x3d>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<score>:
test   %edi,%edi
je     1128 <score+0x18>
push   %rbx
mov    %edi,%ebx
mov    $0x2,%edi
mov    %ebx,%esi
call   1030 <pow@plt>
imul   %ebx,%eax
pop    %rbx
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @score(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @pow(i32 2, i32 %0)
%5 = mul nsw i32 %4, %0
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int func1(int);
int func5(int a) { return a + func1(a); }


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

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

LLVM IR (-O0):
define i32 @func5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @func1(i32 %4)
%6 = add nsw i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @func5(i32 %0) {
%2 = tail call i32 @func1(i32 %0)
%3 = add nsw i32 %2, %0
ret i32 %3
}
/* Variables and functions */
unsigned char _a64_inb(unsigned short);
int /*<<< orphan*/ _a64_outb(unsigned short, unsigned char);
void i8259pic_set_mask(int bit) {
  unsigned short port = 0x21;
  if (bit > 7) {
    port = 0xA1;
    bit -= 8;
  }
  unsigned char mask = _a64_inb(port);
  _a64_outb(port, mask & ~(1 << bit));
}


x86 assembly (clang, -O0):
<i8259pic_set_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movw   $0x21,-0x6(%rbp)
cmpl   $0x7,-0x4(%rbp)
jle    114a <i8259pic_set_mask+0x2a>
movw   $0xa1,-0x6(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x8,%eax
mov    %eax,-0x4(%rbp)
movzwl -0x6(%rbp),%edi
call   1030 <_a64_inb@plt>
mov    %al,-0x7(%rbp)
mov    -0x6(%rbp),%ax
mov    %ax,-0xa(%rbp)
movzbl -0x7(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0xa(%rbp),%cx
xor    $0xffffffff,%edx
and    %edx,%eax
movzwl %cx,%edi
movzbl %al,%esi
call   1040 <_a64_outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i8259pic_set_mask>:
push   %rbp
push   %rbx
push   %rax
lea    -0x8(%rdi),%eax
xor    %ebx,%ebx
cmp    $0x8,%edi
setge  %bl
movzbl %al,%ebp
cmovl  %edi,%ebp
shl    $0x7,%ebx
or     $0x21,%ebx
mov    %ebx,%edi
call   1030 <_a64_inb@plt>
mov    $0x1,%edx
mov    %ebp,%ecx
shl    %cl,%edx
not    %dl
and    %al,%dl
movzbl %dl,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <_a64_outb@plt>

LLVM IR (-O0):
define void @i8259pic_set_mask(i32 %0) {
%2 = alloca i32
%3 = alloca i16
%4 = alloca i8
store i32 %0, i32* %2
store i16 33, i16* %3
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 7
br i1 %6, label %7, label %10
7: ; preds = %1
store i16 161, i16* %3
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 8
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %1
%11 = load i16, i16* %3
%12 = call zeroext i8 @_a64_inb(i16 zeroext %11)
store i8 %12, i8* %4
%13 = load i16, i16* %3
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
%16 = load i32, i32* %2
%17 = shl i32 1, %16
%18 = xor i32 %17, -1
%19 = and i32 %15, %18
%20 = trunc i32 %19 to i8
%21 = call i32 @_a64_outb(i16 zeroext %13, i8 zeroext %20)
ret void
}

LLVM IR (-O2):
define void @i8259pic_set_mask(i32 %0) {
%2 = icmp sgt i32 %0, 7
%3 = add nsw i32 %0, -8
%4 = select i1 %2, i16 161, i16 33
%5 = select i1 %2, i32 %3, i32 %0
%6 = tail call zeroext i8 @_a64_inb(i16 zeroext %4)
%7 = shl nuw i32 1, %5
%8 = trunc i32 %7 to i8
%9 = xor i8 %8, -1
%10 = and i8 %6, %9
%11 = tail call i32 @_a64_outb(i16 zeroext %4, i8 zeroext %10)
ret void
}
int test_imm_EBuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xEB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EBuint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0xeb,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_EBuint64_midword_mem>:
testb  $0xeb,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_EBuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 15400960
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}