xunge/DecIR huggingface dataset:
/* Variables and functions */
int getlet(char *);
int move_or_shoot() {
  int c;
badin:
  c = getlet("SHOOT OR MOVE (S-M)");
  if (c == 'S')
    return (1);
  else if (c == 'M')
    return (0);
  else
    goto badin;
}


x86 assembly (clang, -O0):
<move_or_shoot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getlet@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x53,-0x8(%rbp)
jne    113d <move_or_shoot+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1158 <move_or_shoot+0x48>
cmpl   $0x4d,-0x8(%rbp)
jne    1153 <move_or_shoot+0x43>
movl   $0x0,-0x4(%rbp)
jmp    1158 <move_or_shoot+0x48>
jmp    1118 <move_or_shoot+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_or_shoot>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <getlet@plt>
cmp    $0x4d,%eax
je     1139 <move_or_shoot+0x29>
cmp    $0x53,%eax
jne    1120 <move_or_shoot+0x10>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"SHOOT OR MOVE (S-M)\00"
define i32 @move_or_shoot() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %12, %0
%4 = call i32 @getlet(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 83
br i1 %6, label %7, label %8
7: ; preds = %3
store i32 1, i32* %1
br label %13
8: ; preds = %3
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 77
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 0, i32* %1
br label %13
12: ; preds = %8
br label %3
13: ; preds = %11, %7
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [20 x i8] c"SHOOT OR MOVE (S-M)\00"
define i32 @move_or_shoot() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @getlet(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
switch i32 %2, label %1 [
i32 83, label %3
i32 77, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %3
%5 = phi i32 [ 1, %3 ], [ 0, %1 ]
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int count[4] =
      {
          3,
          2,
      },
      i;
  for (i = 0; i < 4; i++)
    printf("count[%d]=%d\n", i, count[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jge    116b <main+0x5b>
mov    -0x24(%rbp),%esi
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    113c <main+0x2c>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %edx,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.count = [4 x i32] [i32 3, i32 2, i32 0, i32 0]
@.str = [14 x i8] c"count[%d]=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [4 x i32]* %2 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %15, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %13)
br label %15
15: ; preds = %8
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %5
18: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"count[%d]=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 1, i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 2, i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 3, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CopyName(char *);
char *strcat(int /*<<< orphan*/, char *);
char *AppendExt(char *base) { return (strcat(CopyName(base), ".4pi")); }


x86 assembly (clang, -O0):
<AppendExt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <CopyName@plt>
mov    %eax,%edi
lea    0xec2(%rip),%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AppendExt>:
push   %rax
call   1030 <CopyName@plt>
lea    0xed3(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1040 <strcat@plt>

LLVM IR (-O0):
@.str = [5 x i8] c".4pi\00"
define i8* @AppendExt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @CopyName(i8* %3)
%5 = call i8* @strcat(i32 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %5
}

LLVM IR (-O2):
@.str = [5 x i8] c".4pi\00"
define i8* @AppendExt(i8* %0) {
%2 = tail call i32 @CopyName(i8* %0)
%3 = tail call i8* @strcat(i32 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
void test17(int x) {
  switch (x >= 17) {
  case 0:
    return;
  }
  switch ((int)(x <= 17)) {
  case 0:
    return;
  }
}


x86 assembly (clang, -O0):
<test17>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x10,%eax
jg     111d <test17+0x1d>
jmp    1118 <test17+0x18>
jmp    1133 <test17+0x33>
mov    -0x4(%rbp),%eax
sub    $0x12,%eax
jl     1133 <test17+0x33>
jmp    112e <test17+0x2e>
jmp    1133 <test17+0x33>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test17(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 17
%5 = zext i1 %4 to i32
switch i32 %5, label %7 [
i32 0, label %6
]
6: ; preds = %1
br label %12
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp sle i32 %8, 17
%10 = zext i1 %9 to i32
switch i32 %10, label %12 [
i32 0, label %11
]
11: ; preds = %7
br label %12
12: ; preds = %6, %11, %7
ret void
}

LLVM IR (-O2):
define void @test17(i32 %0) {
ret void
}
float SLOW_OperatorDiv(float a, float b) { return a / b; }


x86 assembly (clang, -O0):
<SLOW_OperatorDiv>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SLOW_OperatorDiv>:
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @SLOW_OperatorDiv(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fdiv float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @SLOW_OperatorDiv(float %0, float %1) {
%3 = fdiv float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 0x1234;
  a = (a & 0xf) << 4 | (a & 0xf0) >> 4 | (a & 0xf000) >> 4 | (a & 0x0f00) << 4;
  printf("%x", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1234,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
shl    $0x4,%eax
mov    -0x4(%rbp),%ecx
and    $0xf0,%ecx
sar    $0x4,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xf000,%ecx
sar    $0x4,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xf00,%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2143,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%x\00"
define i32 @main() {
%1 = alloca i32
store i32 4660, i32* %1
%2 = load i32, i32* %1
%3 = and i32 %2, 15
%4 = shl i32 %3, 4
%5 = load i32, i32* %1
%6 = and i32 %5, 240
%7 = ashr i32 %6, 4
%8 = or i32 %4, %7
%9 = load i32, i32* %1
%10 = and i32 %9, 61440
%11 = ashr i32 %10, 4
%12 = or i32 %8, %11
%13 = load i32, i32* %1
%14 = and i32 %13, 3840
%15 = shl i32 %14, 4
%16 = or i32 %12, %15
store i32 %16, i32* %1
%17 = load i32, i32* %1
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 8515)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int64_t;

/* Variables and functions */
scalar_t__ getpksec(int /*<<< orphan*/, int);
long pktime(u_int64_t bandwith, int mtu) {
  return 1000000000 / (long)getpksec(bandwith, mtu);
}


x86 assembly (clang, -O0):
<pktime>:
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 <getpksec@plt>
mov    %rax,%rcx
mov    $0x3b9aca00,%eax
cqto
idiv   %rcx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pktime>:
push   %rax
call   1030 <getpksec@plt>
mov    %rax,%rcx
shr    $0x20,%rax
je     112b <pktime+0x1b>
mov    $0x3b9aca00,%eax
xor    %edx,%edx
idiv   %rcx
pop    %rcx
ret
mov    $0x3b9aca00,%eax
xor    %edx,%edx
div    %ecx
pop    %rcx
ret

LLVM IR (-O0):
define i64 @pktime(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 i64 @getpksec(i32 %5, i32 %6)
%8 = sdiv i64 1000000000, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @pktime(i32 %0, i32 %1) {
%3 = tail call i64 @getpksec(i32 %0, i32 %1)
%4 = sdiv i64 1000000000, %3
ret i64 %4
}
int trailingZeroes(int n) {
  int return_val = 0;
  while (n) {
    return_val += n / 5;
    n /= 5;
  }
  return return_val;
}


x86 assembly (clang, -O0):
<trailingZeroes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113c <trailingZeroes+0x3c>
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <trailingZeroes+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trailingZeroes>:
xor    %eax,%eax
test   %edi,%edi
je     1131 <trailingZeroes+0x31>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rdi
add    %edx,%edi
add    %edi,%eax
add    $0x4,%ecx
cmp    $0x8,%ecx
ja     1110 <trailingZeroes+0x10>
ret

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

LLVM IR (-O2):
define i32 @trailingZeroes(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i32 %5, 5
%7 = add nsw i32 %4, %6
%8 = add i32 %5, 4
%9 = icmp ult i32 %8, 9
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ VirtualizeTimerC__0__Timer__stop(unsigned int);
void PancApp__ResendTimer__stop(void) { VirtualizeTimerC__0__Timer__stop(1U); }


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

x86 assembly (clang, -O2):
<PancApp__ResendTimer__stop>:
mov    $0x1,%edi
jmp    1030 <VirtualizeTimerC__0__Timer__stop@plt>

LLVM IR (-O0):
define void @PancApp__ResendTimer__stop() {
%1 = call i32 @VirtualizeTimerC__0__Timer__stop(i32 1)
ret void
}

LLVM IR (-O2):
define void @PancApp__ResendTimer__stop() {
%1 = tail call i32 @VirtualizeTimerC__0__Timer__stop(i32 1)
ret void
}
void bcf_gt2alleles(int igt, int *a, int *b) {
  int k = 0, dk = 1;
  while (k < igt) {
    dk++;
    k += dk;
  }
  *b = dk - 1;
  *a = igt - k + *b;
}


x86 assembly (clang, -O0):
<bcf_gt2alleles>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1140 <bcf_gt2alleles+0x40>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    111d <bcf_gt2alleles+0x1d>
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sub    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
add    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcf_gt2alleles>:
test   %edi,%edi
jle    111e <bcf_gt2alleles+0x1e>
xor    %eax,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
add    %eax,%ecx
add    $0x2,%ecx
add    $0x1,%eax
cmp    %edi,%ecx
jl     1110 <bcf_gt2alleles+0x10>
jmp    1122 <bcf_gt2alleles+0x22>
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,(%rdx)
sub    %ecx,%edi
add    %eax,%edi
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @bcf_gt2alleles(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
store i32 0, i32* %7
store i32 1, i32* %8
br label %9
9: ; preds = %13, %3
%10 = load i32, i32* %7
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %19
13: ; preds = %9
%14 = load i32, i32* %8
%15 = add nsw i32 %14, 1
store i32 %15, i32* %8
%16 = load i32, i32* %8
%17 = load i32, i32* %7
%18 = add nsw i32 %17, %16
store i32 %18, i32* %7
br label %9
19: ; preds = %9
%20 = load i32, i32* %8
%21 = sub nsw i32 %20, 1
%22 = load i32*, i32** %6
store i32 %21, i32* %22
%23 = load i32, i32* %4
%24 = load i32, i32* %7
%25 = sub nsw i32 %23, %24
%26 = load i32*, i32** %6
%27 = load i32, i32* %26
%28 = add nsw i32 %25, %27
%29 = load i32*, i32** %5
store i32 %28, i32* %29
ret void
}

LLVM IR (-O2):
define void @bcf_gt2alleles(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ 1, %3 ]
%7 = phi i32 [ %9, %5 ], [ 0, %3 ]
%8 = add nuw nsw i32 %6, 1
%9 = add nuw nsw i32 %8, %7
%10 = icmp slt i32 %9, %0
br i1 %10, label %5, label %11
11: ; preds = %5, %3
%12 = phi i32 [ 0, %3 ], [ %9, %5 ]
%13 = phi i32 [ 0, %3 ], [ %6, %5 ]
store i32 %13, i32* %2
%14 = sub i32 %0, %12
%15 = add nsw i32 %14, %13
store i32 %15, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ copyGraphToEOL(char const *, char *);
int /*<<< orphan*/ errmessage1(char *, char const *);
int strlen(char *);
int parseSource(const char *line, char *source) {
  copyGraphToEOL(line + 6 + 1, source);
  if (strlen(source) < 2) {
    errmessage1("Could not parse an SOURCE out of \"%s\"\n", line);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<parseSource>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x6,%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
call   1050 <copyGraphToEOL@plt>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jge    1183 <parseSource+0x53>
mov    -0x10(%rbp),%rsi
lea    0xe8e(%rip),%rdi
call   1040 <errmessage1@plt>
movl   $0x0,-0x4(%rbp)
jmp    118a <parseSource+0x5a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseSource>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x7,%rdi
call   1050 <copyGraphToEOL@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x1,%ecx
jg     1168 <parseSource+0x38>
lea    0xea2(%rip),%rdi
mov    %r14,%rsi
call   1040 <errmessage1@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Could not parse an SOURCE out of \22%s\22\0A\00"
define i32 @parseSource(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 6
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8*, i8** %5
%10 = call i32 @copyGraphToEOL(i8* %8, i8* %9)
%11 = load i8*, i8** %5
%12 = call i32 @strlen(i8* %11)
%13 = icmp slt i32 %12, 2
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = call i32 @errmessage1(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %15)
store i32 0, i32* %3
br label %18
17: ; preds = %2
store i32 1, i32* %3
br label %18
18: ; preds = %17, %14
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [39 x i8] c"Could not parse an SOURCE out of \22%s\22\0A\00"
define i32 @parseSource(i8* %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 7
%4 = tail call i32 @copyGraphToEOL(i8* %3, i8* %1)
%5 = tail call i32 @strlen(i8* %1)
%6 = icmp slt i32 %5, 2
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @errmessage1(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %10
}
/* Variables and functions */
unsigned int _bzhi_u32(unsigned int, int);
unsigned int f12(unsigned int x) { return _bzhi_u32(x, 257); }


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

x86 assembly (clang, -O2):
<f12>:
mov    $0x101,%esi
jmp    1030 <_bzhi_u32@plt>

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

LLVM IR (-O2):
define i32 @f12(i32 %0) {
%2 = tail call i32 @_bzhi_u32(i32 %0, i32 257)
ret i32 %2
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(char *, char, int);
char *my_malloc(size_t len) {
  char *s;
  s = (char *)malloc(sizeof(char) * len);
  if (s == NULL) {
    return NULL;
  }
  memset(s, '\0', sizeof(char) * len);
  return s;
}


x86 assembly (clang, -O0):
<my_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1157 <my_malloc+0x37>
movq   $0x0,-0x8(%rbp)
jmp    1174 <my_malloc+0x54>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
test   %rax,%rax
je     1143 <my_malloc+0x23>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14d,%edx
call   1030 <memset@plt>
jmp    1145 <my_malloc+0x25>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @my_malloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = mul i64 1, %5
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %1
store i8* null, i8** %2
br label %20
13: ; preds = %1
%14 = load i8*, i8** %4
%15 = load i64, i64* %3
%16 = mul i64 1, %15
%17 = trunc i64 %16 to i32
%18 = call i32 @memset(i8* %14, i8 signext 0, i32 %17)
%19 = load i8*, i8** %4
store i8* %19, i8** %2
br label %20
20: ; preds = %13, %12
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
define i8* @my_malloc(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i8*
%5 = icmp eq i64 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @memset(i8* %4, i8 signext 0, i32 %2)
br label %8
8: ; preds = %1, %6
%9 = phi i8* [ %4, %6 ], [ null, %1 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XwcTextListToTextProperty() {
  printf("XwcTextListToTextProperty called\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<XwcTextListToTextProperty>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"XwcTextListToTextProperty called\0A\00"
define i32 @XwcTextListToTextProperty() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [33 x i8] c"XwcTextListToTextProperty called\00"
define i32 @XwcTextListToTextProperty() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double abs(double);
double double_abs(double val) { return abs(val); }


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

x86 assembly (clang, -O2):
<double_abs>:
jmp    1030 <abs@plt>

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

LLVM IR (-O2):
define double @double_abs(double %0) {
%2 = tail call double @abs(double %0)
ret double %2
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int16_t swap_int16(int16_t val) { return (val << 8) | ((val >> 8) & 0xFF); }


x86 assembly (clang, -O0):
<swap_int16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_int16>:
mov    %edi,%ecx
movzbl %ch,%eax
shl    $0x8,%ecx
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @swap_int16(i32 %0) {
%2 = shl i32 %0, 8
%3 = lshr i32 %0, 8
%4 = and i32 %3, 255
%5 = or i32 %4, %2
ret i32 %5
}
int main() {
  void setHolidays();
  setHolidays();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
tail call void (...) @setHolidays()
ret i32 0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dvarmpn(int, double, int, double *, int);
int main() {
  double x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_dvarmpn(N, 4.5, 1, x, stride);
  printf("sample variance: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
movl   $0x4,-0x44(%rbp)
movl   $0x2,-0x48(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%ecx
movsd  0xe93(%rip),%xmm0
mov    $0x1,%esi
call   1050 <stdlib_strided_dvarmpn@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
movsd  0xea5(%rip),%xmm0
mov    %rsp,%rdx
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x2,%ecx
call   1040 <stdlib_strided_dvarmpn@plt>
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [22 x i8] c"sample variance: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x double]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dvarmpn(i32 %6, double 4.500000e+00, i32 1, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [22 x i8] c"sample variance: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dvarmpn(i32 4, double 4.500000e+00, i32 1, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ __glGet_size(int /*<<< orphan*/);
GLint __glGetDoublev_size(GLenum sq) { return __glGet_size(sq); }


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

x86 assembly (clang, -O2):
<__glGetDoublev_size>:
jmp    1030 <__glGet_size@plt>

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

LLVM IR (-O2):
define i32 @__glGetDoublev_size(i32 %0) {
%2 = tail call i32 @__glGet_size(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ outb(unsigned short, char);
void serial_write_text(unsigned short com, char *buffer, int length) {
  while (length--) {
    outb((com), *buffer);
    buffer++;
  }
}


x86 assembly (clang, -O0):
<serial_write_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     115e <serial_write_text+0x4e>
mov    -0x2(%rbp),%cx
mov    -0x10(%rbp),%rax
movzwl %cx,%edi
movsbl (%rax),%esi
call   1030 <outb@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1126 <serial_write_text+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_write_text>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
je     1145 <serial_write_text+0x35>
mov    %rsi,%r14
mov    %edx,%r15d
xor    %ebx,%ebx
movzwl %di,%ebp
cs nopw 0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%esi
mov    %ebp,%edi
call   1030 <outb@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <serial_write_text+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @serial_write_text(i16 zeroext %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %13, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ %2, %3 ]
%7 = phi i8* [ %11, %5 ], [ %1, %3 ]
%8 = add nsw i32 %6, -1
%9 = load i8, i8* %7
%10 = tail call i32 @outb(i16 zeroext %0, i8 signext %9)
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = icmp eq i32 %8, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %3
ret void
}
void handle_36(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_36(i32 %0) {
ret void
}
void rcu_nocb_unlock(struct rcu_data *rdp) {}


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

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

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

LLVM IR (-O2):
%struct.rcu_data = type opaque
define void @rcu_nocb_unlock(%struct.rcu_data* nocapture %0) {
ret void
}
/* Variables and functions */
int strncmp(char *, char *, int);
int Log_compareEntries(char *entry1, char *entry2) {
  int comp = strncmp(&entry1[7], &entry2[7], 19);
  if (comp == 0)
    comp = strncmp(&entry1[1], &entry2[1], 4);
  return comp;
}


x86 assembly (clang, -O0):
<Log_compareEntries>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x7,%rdi
mov    -0x10(%rbp),%rsi
add    $0x7,%rsi
mov    $0x13,%edx
call   1030 <strncmp@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1164 <Log_compareEntries+0x54>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Log_compareEntries>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x7,%rdi
add    $0x7,%rsi
mov    $0x13,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1138 <Log_compareEntries+0x28>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
add    $0x1,%rbx
add    $0x1,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strncmp@plt>

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

LLVM IR (-O2):
define i32 @Log_compareEntries(i8* %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 7
%4 = getelementptr inbounds i8, i8* %1, i64 7
%5 = tail call i32 @strncmp(i8* %3, i8* %4, i32 19)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = getelementptr inbounds i8, i8* %1, i64 1
%10 = tail call i32 @strncmp(i8* %8, i8* %9, i32 4)
br label %11
11: ; preds = %7, %2
%12 = phi i32 [ %10, %7 ], [ %5, %2 ]
ret i32 %12
}
int read_xattrs(void *dir_ent) { return ((unsigned int)0xffffffff); }


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

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

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

LLVM IR (-O2):
define i32 @read_xattrs(i8* nocapture readnone %0) {
ret i32 -1
}
/* Type definitions */
struct section_list {
  int dummy;
};
struct genlist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_pop_back(struct genlist *);
void section_list_pop_back(struct section_list *tthis) {
  genlist_pop_back((struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<section_list_pop_back>:
jmp    1030 <genlist_pop_back@plt>

LLVM IR (-O0):
%struct.section_list = type { i32 }
%struct.genlist = type { i32 }
define void @section_list_pop_back(%struct.section_list* %0) {
%2 = alloca %struct.section_list*
store %struct.section_list* %0, %struct.section_list** %2
%3 = load %struct.section_list*, %struct.section_list** %2
%4 = bitcast %struct.section_list* %3 to %struct.genlist*
%5 = call i32 @genlist_pop_back(%struct.genlist* %4)
ret void
}

LLVM IR (-O2):
%struct.section_list = type { i32 }
%struct.genlist = type { i32 }
define void @section_list_pop_back(%struct.section_list* %0) {
%2 = bitcast %struct.section_list* %0 to %struct.genlist*
%3 = tail call i32 @genlist_pop_back(%struct.genlist* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr, "Usage: %s [options] v1 v2 v3 ...\n", name);
  fprintf(stderr, "For more information type: %s -h \n\n", name);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
lea    0xed8(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xee8(%rip),%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"Usage: %s [options] v1 v2 v3 ...\0A\00"
@.str.1 = [36 x i8] c"For more information type: %s -h \0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Usage: %s [options] v1 v2 v3 ...\0A\00"
@.str.1 = [36 x i8] c"For more information type: %s -h \0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
double prob(double, double, double, double, int, double);
double __ecm_ecmprob(double B1, double B2, double N, double nr, int S) {
  return prob(B1, B2, N, nr, S, 3.134);
}


x86 assembly (clang, -O0):
<__ecm_ecmprob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %edi,-0x24(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
mov    -0x24(%rbp),%edi
movsd  0xeb2(%rip),%xmm4
call   1030 <prob@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ecm_ecmprob>:
movsd  0xee8(%rip),%xmm4
jmp    1030 <prob@plt>

LLVM IR (-O0):
define double @__ecm_ecmprob(double %0, double %1, double %2, double %3, i32 %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i32
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store i32 %4, i32* %10
%11 = load double, double* %6
%12 = load double, double* %7
%13 = load double, double* %8
%14 = load double, double* %9
%15 = load i32, i32* %10
%16 = call double @prob(double %11, double %12, double %13, double %14, i32 %15, double 3.134000e+00)
ret double %16
}

LLVM IR (-O2):
define double @__ecm_ecmprob(double %0, double %1, double %2, double %3, i32 %4) {
%6 = tail call double @prob(double %0, double %1, double %2, double %3, i32 %4, double 3.134000e+00)
ret double %6
}
/* Variables and functions */
float __ocml_ceil_f32(float);
float ceilf(float x) { return __ocml_ceil_f32(x); }


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

x86 assembly (clang, -O2):
<ceilf>:
jmp    1030 <__ocml_ceil_f32@plt>

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

LLVM IR (-O2):
define float @ceilf(float %0) {
%2 = tail call float @__ocml_ceil_f32(float %0)
ret float %2
}
/* Variables and functions */
int rand();
int randmax(int max) {
  int randomnumber;
  randomnumber = rand() % max;
  return randomnumber;
}


x86 assembly (clang, -O0):
<randmax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randmax>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @randmax(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ W_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int lngpio_is_exported(int pin) {
  char path[35];
  snprintf(path, 35, "/sys/class/gpio/gpio%d/direction", pin);
  if (access(path, W_OK) == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<lngpio_is_exported>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%ecx
mov    $0x23,%esi
lea    0xec2(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x30(%rbp),%rdi
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
cmp    $0x0,%rax
jne    116b <lngpio_is_exported+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1172 <lngpio_is_exported+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lngpio_is_exported>:
push   %rbx
sub    $0x30,%rsp
mov    %edi,%ecx
lea    0xed2(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x23,%esi
call   1030 <snprintf@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1040 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"/sys/class/gpio/gpio%d/direction\00"
@W_OK = global i32 0
define i32 @lngpio_is_exported(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [35 x i8]
store i32 %0, i32* %3
%5 = getelementptr inbounds [35 x i8], [35 x i8]* %4, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @snprintf(i8* %5, i32 35, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [35 x i8], [35 x i8]* %4, i64 0, i64 0
%9 = load i32, i32* @W_OK
%10 = call i64 @access(i8* %8, i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 1, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [33 x i8] c"/sys/class/gpio/gpio%d/direction\00"
@W_OK = global i32 0
define i32 @lngpio_is_exported(i32 %0) {
%2 = alloca [35 x i8]
%3 = getelementptr inbounds [35 x i8], [35 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 35, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = load i32, i32* @W_OK
%6 = call i64 @access(i8* %3, i32 %5)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char const *);
int main(int argc, const char *argv[]) {
  int i;
  for (i = 0; i < argc; i++) {
    printf("argv[%d]: %s\n", i, argv[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [14 x i8] c"argv[%d]: %s\0A\00"
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
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i32, i32* %6
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %17)
br label %19
19: ; preds = %11
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"argv[%d]: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int mktemp_internal(char *, int, int, int /*<<< orphan*/);
int mkstemps(char *path, int slen) {
  return (mktemp_internal(path, slen, 1, 0));
}


x86 assembly (clang, -O0):
<mkstemps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <mktemp_internal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkstemps>:
mov    $0x1,%edx
xor    %ecx,%ecx
jmp    1030 <mktemp_internal@plt>

LLVM IR (-O0):
define i32 @mkstemps(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 i32 @mktemp_internal(i8* %5, i32 %6, i32 1, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @mkstemps(i8* %0, i32 %1) {
%3 = tail call i32 @mktemp_internal(i8* %0, i32 %1, i32 1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *strdup(char const *);
void xstrset(char **pdst, const char *src) {
  char *curr = src ? strdup(src) : 0;
  free(*pdst);
  *pdst = curr;
}


x86 assembly (clang, -O0):
<xstrset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114d <xstrset+0x2d>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x20(%rbp)
jmp    1158 <xstrset+0x38>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    1158 <xstrset+0x38>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrset>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %rsi,%rsi
je     1139 <xstrset+0x19>
mov    %rsi,%rdi
call   1040 <strdup@plt>
mov    %rax,%r14
jmp    113c <xstrset+0x1c>
xor    %r14d,%r14d
mov    (%rbx),%rdi
call   1030 <free@plt>
mov    %r14,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @xstrset(i8** nocapture %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i8* @strdup(i8* %1)
br label %6
6: ; preds = %2, %4
%7 = phi i8* [ %5, %4 ], [ null, %2 ]
%8 = load i8*, i8** %0
%9 = tail call i32 @free(i8* %8)
store i8* %7, i8** %0
ret void
}