xunge/DecIR huggingface dataset:
/* Variables and functions */
int integerPower(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
void main(void) {
  int base, exponent;
  scanf("%d %d", &base, &exponent);
  printf("%d", integerPower(base, exponent));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <integerPower@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <integerPower@plt>
lea    0xeab(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @integerPower(i32 %4, i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @integerPower(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret void
}
/* Variables and functions */
char *strchr(char *, char);
int ui_cmd_argcnt(char *str, int num) {
  while (1) {
    str = strchr(str, ' ');
    if (str) {
      ++str;
      --num;
    } else {
      break;
    }
  }
  return num == 1 ? 1 : 0;
}


x86 assembly (clang, -O0):
<ui_cmd_argcnt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
call   1030 <strchr@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1156 <ui_cmd_argcnt+0x46>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    115b <ui_cmd_argcnt+0x4b>
jmp    1160 <ui_cmd_argcnt+0x50>
jmp    111f <ui_cmd_argcnt+0xf>
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ui_cmd_argcnt>:
push   %rbx
mov    %esi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x20,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     113b <ui_cmd_argcnt+0x2b>
add    $0x1,%rax
add    $0xffffffff,%ebx
mov    %rax,%rdi
jmp    1120 <ui_cmd_argcnt+0x10>
xor    %eax,%eax
cmp    $0x1,%ebx
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ui_cmd_argcnt(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 32)
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %3, %2 ]
%7 = phi i32 [ %9, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = add nsw i32 %7, -1
%10 = tail call i8* @strchr(i8* dereferenceable(1) %8, i8 signext 32)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i32 [ %1, %2 ], [ %9, %5 ]
%14 = icmp eq i32 %13, 1
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void vt100_cursor_load(void) {
  printf("\x1B[u");
  fflush(stdout);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"\1B[u\00"
@stdout = global i32 0
define void @vt100_cursor_load() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[u\00"
@stdout = global i32 0
define void @vt100_cursor_load() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
int test_imm_A9uint32_reg(unsigned int val) {
  return ((val) & (0xA9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A9uint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 169
%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_A9uint32_reg(i32 %0) {
%2 = and i32 %0, 169
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ complement_dna(char *);
int /*<<< orphan*/ complement_rna(char *);
scalar_t__ is_dna(char *);
scalar_t__ is_rna(char *);
void complement_nuc(char *seq) {
  if (is_dna(seq)) {
    complement_dna(seq);
  } else if (is_rna(seq)) {
    complement_rna(seq);
  } else {
    abort();
  }
}


x86 assembly (clang, -O0):
<complement_nuc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <is_dna@plt>
cmp    $0x0,%rax
je     117d <complement_nuc+0x2d>
mov    -0x8(%rbp),%rdi
call   1040 <complement_dna@plt>
jmp    11aa <complement_nuc+0x5a>
mov    -0x8(%rbp),%rdi
call   1070 <is_rna@plt>
cmp    $0x0,%rax
je     119e <complement_nuc+0x4e>
mov    -0x8(%rbp),%rdi
call   1050 <complement_rna@plt>
jmp    11a5 <complement_nuc+0x55>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11aa <complement_nuc+0x5a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<complement_nuc>:
push   %rbx
mov    %rdi,%rbx
call   1060 <is_dna@plt>
test   %rax,%rax
je     1167 <complement_nuc+0x17>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <complement_dna@plt>
mov    %rbx,%rdi
call   1070 <is_rna@plt>
test   %rax,%rax
je     117d <complement_nuc+0x2d>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <complement_rna@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @complement_nuc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @is_dna(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @complement_dna(i8* %7)
br label %19
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i64 @is_rna(i8* %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i8*, i8** %2
%15 = call i32 @complement_rna(i8* %14)
br label %18
16: ; preds = %9
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %13
br label %19
19: ; preds = %18, %6
ret void
}

LLVM IR (-O2):
define void @complement_nuc(i8* %0) {
%2 = tail call i64 @is_dna(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @complement_dna(i8* %0)
br label %13
6: ; preds = %1
%7 = tail call i64 @is_rna(i8* %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @complement_rna(i8* %0)
br label %13
11: ; preds = %6
%12 = tail call i32 (...) @abort()
unreachable
13: ; preds = %9, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int u2mfn_get_last_mfn_with_fd(int fd, int *mfn) {
  *mfn = ioctl(fd, _IO(0xf5, 2), 0);
  if (*mfn == -1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<u2mfn_get_last_mfn_with_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0xf5,%edi
mov    $0x2,%esi
call   1030 <_IO@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <ioctl@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    1171 <u2mfn_get_last_mfn_with_fd+0x51>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <u2mfn_get_last_mfn_with_fd+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u2mfn_get_last_mfn_with_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0xf5,%edi
mov    $0x2,%esi
call   1030 <_IO@plt>
mov    %ebp,%edi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <ioctl@plt>
mov    %eax,(%rbx)
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @u2mfn_get_last_mfn_with_fd(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
%6 = load i32, i32* %4
%7 = call i32 @_IO(i32 245, i32 2)
%8 = call i32 @ioctl(i32 %6, i32 %7, i32 0)
%9 = load i32*, i32** %5
store i32 %8, i32* %9
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @u2mfn_get_last_mfn_with_fd(i32 %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @_IO(i32 245, i32 2)
%4 = tail call i32 @ioctl(i32 %0, i32 %3, i32 0)
store i32 %4, i32* %1
%5 = icmp eq i32 %4, -1
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int equation_of_time(int);
int standard_time(int lat, int day, double longitude, double long_std) {
  return lat - (int)(240.0 * (long_std - longitude)) - equation_of_time(day);
}


x86 assembly (clang, -O0):
<standard_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    -0x4(%rbp),%eax
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  0xec3(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <equation_of_time@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
sub    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standard_time>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
subsd  %xmm0,%xmm1
mulsd  0xedf(%rip),%xmm1
cvttsd2si %xmm1,%ebp
mov    %esi,%edi
call   1030 <equation_of_time@plt>
add    %ebp,%eax
sub    %eax,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @standard_time(i32 %0, i32 %1, double %2, double %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca double
store i32 %0, i32* %5
store i32 %1, i32* %6
store double %2, double* %7
store double %3, double* %8
%9 = load i32, i32* %5
%10 = load double, double* %8
%11 = load double, double* %7
%12 = fsub double %10, %11
%13 = fmul double 2.400000e+02, %12
%14 = fptosi double %13 to i32
%15 = sub nsw i32 %9, %14
%16 = load i32, i32* %6
%17 = call i32 @equation_of_time(i32 %16)
%18 = sub nsw i32 %15, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @standard_time(i32 %0, i32 %1, double %2, double %3) {
%5 = fsub double %3, %2
%6 = fmul double %5, 2.400000e+02
%7 = fptosi double %6 to i32
%8 = tail call i32 @equation_of_time(i32 %1)
%9 = add i32 %8, %7
%10 = sub i32 %0, %9
ret i32 %10
}
double sqroot(double square) {
  double root = square / 3;
  int i;
  if (square <= 0)
    return 0;
  for (i = 0; i < 32; i++) {
    root += square / root;
    root /= 2;
  }
  return root;
}


x86 assembly (clang, -O0):
<sqroot>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     113a <sqroot+0x3a>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118d <sqroot+0x8d>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x20,-0x1c(%rbp)
jge    1183 <sqroot+0x83>
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe9c(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1141 <sqroot+0x41>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqroot>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    1155 <sqroot+0x55>
movapd %xmm0,%xmm1
divsd  0xeea(%rip),%xmm1
mov    $0x20,%eax
movsd  0xee5(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movapd %xmm0,%xmm3
divsd  %xmm1,%xmm3
addsd  %xmm1,%xmm3
mulsd  %xmm2,%xmm3
movapd %xmm0,%xmm1
divsd  %xmm3,%xmm1
addsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm1
add    $0xfffffffe,%eax
jne    1130 <sqroot+0x30>
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sqroot(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %3
%6 = load double, double* %3
%7 = fdiv double %6, 3.000000e+00
store double %7, double* %4
%8 = load double, double* %3
%9 = fcmp ole double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %1
store double 0.000000e+00, double* %2
br label %28
11: ; preds = %1
store i32 0, i32* %5
br label %12
12: ; preds = %23, %11
%13 = load i32, i32* %5
%14 = icmp slt i32 %13, 32
br i1 %14, label %15, label %26
15: ; preds = %12
%16 = load double, double* %3
%17 = load double, double* %4
%18 = fdiv double %16, %17
%19 = load double, double* %4
%20 = fadd double %19, %18
store double %20, double* %4
%21 = load double, double* %4
%22 = fdiv double %21, 2.000000e+00
store double %22, double* %4
br label %23
23: ; preds = %15
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %12
26: ; preds = %12
%27 = load double, double* %4
store double %27, double* %2
br label %28
28: ; preds = %26, %10
%29 = load double, double* %2
ret double %29
}

LLVM IR (-O2):
define double @sqroot(double %0) {
%2 = fcmp ugt double %0, 0.000000e+00
br i1 %2, label %3, label %16
3: ; preds = %1
%4 = fdiv double %0, 3.000000e+00
br label %5
5: ; preds = %5, %3
%6 = phi i32 [ 0, %3 ], [ %14, %5 ]
%7 = phi double [ %4, %3 ], [ %13, %5 ]
%8 = fdiv double %0, %7
%9 = fadd double %7, %8
%10 = fmul double %9, 5.000000e-01
%11 = fdiv double %0, %10
%12 = fadd double %10, %11
%13 = fmul double %12, 5.000000e-01
%14 = add nuw nsw i32 %6, 2
%15 = icmp eq i32 %14, 32
br i1 %15, label %16, label %5
16: ; preds = %5, %1
%17 = phi double [ 0.000000e+00, %1 ], [ %13, %5 ]
ret double %17
}
int shape_tria3(double *L, double *N) {
  N[0] = L[0];
  N[1] = L[1];
  N[2] = 1.0 - L[0] - L[1];
  return 0;
}


x86 assembly (clang, -O0):
<shape_tria3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0xec6(%rip),%xmm0
subsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shape_tria3>:
movsd  (%rdi),%xmm0
movsd  %xmm0,(%rsi)
movsd  0x8(%rdi),%xmm0
movsd  %xmm0,0x8(%rsi)
movsd  0xee6(%rip),%xmm0
subsd  (%rdi),%xmm0
subsd  0x8(%rdi),%xmm0
movsd  %xmm0,0x10(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @shape_tria3(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
store double %7, double* %9
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
%13 = load double*, double** %4
%14 = getelementptr inbounds double, double* %13, i64 1
store double %12, double* %14
%15 = load double*, double** %3
%16 = getelementptr inbounds double, double* %15, i64 0
%17 = load double, double* %16
%18 = fsub double 1.000000e+00, %17
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = fsub double %18, %21
%23 = load double*, double** %4
%24 = getelementptr inbounds double, double* %23, i64 2
store double %22, double* %24
ret i32 0
}

LLVM IR (-O2):
define i32 @shape_tria3(double* nocapture %0, double* nocapture writeonly %1) {
%3 = load double, double* %0
store double %3, double* %1
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %1, i64 1
store double %5, double* %6
%7 = load double, double* %0
%8 = fsub double 1.000000e+00, %7
%9 = load double, double* %4
%10 = fsub double %8, %9
%11 = getelementptr inbounds double, double* %1, i64 2
store double %10, double* %11
ret i32 0
}
/* Variables and functions */
scalar_t__ __VERIFIER_nondet_int();
int /*<<< orphan*/ foo(int, int);
void bar(int x) {
  if (__VERIFIER_nondet_int())
    foo(x, 3);
  else
    foo(x, 4);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%rax
je     114e <bar+0x2e>
mov    -0x4(%rbp),%edi
mov    $0x3,%esi
call   1040 <foo@plt>
jmp    115b <bar+0x3b>
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
call   1040 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x1,%rax
mov    $0x3,%esi
adc    $0x0,%esi
mov    %ebx,%edi
pop    %rbx
jmp    1040 <foo@plt>

LLVM IR (-O0):
define void @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @__VERIFIER_nondet_int()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @foo(i32 %6, i32 3)
br label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @foo(i32 %9, i32 4)
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
define void @bar(i32 %0) {
%2 = tail call i64 (...) @__VERIFIER_nondet_int()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 4, i32 3
%5 = tail call i32 @foo(i32 %0, i32 %4)
ret void
}
int average(int num1, int num2, int num3) { return (num1 + num2 + num3) / 3; }


x86 assembly (clang, -O0):
<average>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<average>:
add    %esi,%edi
add    %edx,%edi
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @average(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
%12 = sdiv i32 %11, 3
ret i32 %12
}

LLVM IR (-O2):
define i32 @average(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
%6 = sdiv i32 %5, 3
ret i32 %6
}
void verify_locked(struct dentry *d) {}


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

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

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

LLVM IR (-O2):
%struct.dentry = type opaque
define void @verify_locked(%struct.dentry* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void display_help(void) {
  printf("Usage: nanddump [OPTIONS] MTD-device\n"
         "Dumps the contents of a nand mtd partition.\n"
         "\n"
         "           --help	        display this help and exit\n"
         "           --version	        output version information and exit\n"
         "-f file    --file=file          dump to file\n"
         "-i         --ignoreerrors       ignore errors\n"
         "-l length  --length=length      length\n"
         "-n         --noecc              read without error correction\n"
         "-o         --omitoob            omit oob data\n"
         "-b         --omitbad            omit bad blocks from the dump\n"
         "-p         --prettyprint        print nice (hexdump)\n"
         "-s addr    --startaddress=addr  start address\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [600 x i8] c"Usage: nanddump [OPTIONS] MTD-device\0ADumps the contents of a nand mtd partition.\0A\0A --help\09 display this help and exit\0A --version\09 output version information and exit\0A-f file --file=file dump to file\0A-i --ignoreerrors ignore errors\0A-l length --length=length length\0A-n --noecc read without error correction\0A-o --omitoob omit oob data\0A-b --omitbad omit bad blocks from the dump\0A-p --prettyprint print nice (hexdump)\0A-s addr --startaddress=addr start address\0A\00"
define void @display_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([600 x i8], [600 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [599 x i8] c"Usage: nanddump [OPTIONS] MTD-device\0ADumps the contents of a nand mtd partition.\0A\0A --help\09 display this help and exit\0A --version\09 output version information and exit\0A-f file --file=file dump to file\0A-i --ignoreerrors ignore errors\0A-l length --length=length length\0A-n --noecc read without error correction\0A-o --omitoob omit oob data\0A-b --omitbad omit bad blocks from the dump\0A-p --prettyprint print nice (hexdump)\0A-s addr --startaddress=addr start address\00"
define void @display_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([599 x i8], [599 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strlwr(char *);
main() {
  char *str;
  printf("enter your string:");
  gets(str);
  printf("\nyour string in lower case is :");
  strlwr(str);
  puts(str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <gets@plt>
lea    0xeaf(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlwr@plt>
mov    -0x8(%rbp),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1050 <printf@plt>
call   1060 <gets@plt>
lea    0xeba(%rip),%rdi
call   1050 <printf@plt>
call   1030 <strlwr@plt>
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"enter your string:\00"
@.str.1 = [32 x i8] c"\0Ayour string in lower case is :\00"
define i32 @main() {
%1 = alloca i8*
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = load i8*, i8** %1
%4 = call i32 @gets(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8*, i8** %1
%7 = call i32 @strlwr(i8* %6)
%8 = load i8*, i8** %1
%9 = call i32 @puts(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"enter your string:\00"
@.str.1 = [32 x i8] c"\0Ayour string in lower case is :\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @gets(i8* undef)
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @strlwr(i8* undef)
%5 = tail call i32 @puts(i8* dereferenceable(1) undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
void foo(int n) {
  for (int i = 0; i < n; i++)
    bar(i);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1144 <foo+0x34>
mov    -0x8(%rbp),%edi
call   1030 <bar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <foo+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    112e <foo+0x1e>
mov    %edi,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <bar@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <foo+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @bar(i32 %5)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
void calculate_movement_from_squares(struct global_win1 *gwin) {}


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

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

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

LLVM IR (-O2):
%struct.global_win1 = type opaque
define void @calculate_movement_from_squares(%struct.global_win1* nocapture %0) {
ret void
}
unsigned long __get_ebp(void) { __asm__("movl %ebp, %eax"); }


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

x86 assembly (clang, -O2):
<__get_ebp>:
mov    %ebp,%eax
ret

LLVM IR (-O0):
define i64 @__get_ebp() {
%1 = alloca i64
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @__get_ebp() {
tail call void asm sideeffect "movl %ebp, %eax", "~{dirflag},~{fpsr},~{flags}"()
ret i64 undef
}
/* Variables and functions */
int handle_ptr(void *ret) {
  if (ret == NULL) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<handle_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <handle_ptr+0x1f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1126 <handle_ptr+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_ptr>:
cmp    $0x1,%rdi
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @handle_ptr(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @handle_ptr(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = sext i1 %2 to i32
ret i32 %3
}
void printchar(char **str, int c) {
  extern int board_putchar(char c);
  if (str) {
    **str = c;
    ++(*str);
  } else
    (void)board_putchar(c);
}


x86 assembly (clang, -O0):
<printchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <printchar+0x3b>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1156 <printchar+0x46>
mov    -0xc(%rbp),%eax
movsbl %al,%edi
call   1030 <board_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printchar>:
test   %rdi,%rdi
je     1120 <printchar+0x10>
mov    (%rdi),%rax
mov    %sil,(%rax)
addq   $0x1,(%rdi)
ret
movsbl %sil,%edi
jmp    1030 <board_putchar@plt>

LLVM IR (-O0):
define void @printchar(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 = icmp ne i8** %5, null
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i8
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
store i8 %9, i8* %11
%12 = load i8**, i8*** %3
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %12
br label %19
15: ; preds = %2
%16 = load i32, i32* %4
%17 = trunc i32 %16 to i8
%18 = call i32 @board_putchar(i8 signext %17)
br label %19
19: ; preds = %15, %7
ret void
}

LLVM IR (-O2):
define void @printchar(i8** %0, i32 %1) {
%3 = icmp eq i8** %0, null
%4 = trunc i32 %1 to i8
br i1 %3, label %9, label %5
5: ; preds = %2
%6 = load i8*, i8** %0
store i8 %4, i8* %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
br label %11
9: ; preds = %2
%10 = tail call i32 @board_putchar(i8 signext %4)
br label %11
11: ; preds = %9, %5
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool pes_has_dts(const uint8_t *p_pes) { return (p_pes[7] & 0xc0) == 0xc0; }


x86 assembly (clang, -O0):
<pes_has_dts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%eax
and    $0xc0,%eax
cmp    $0xc0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pes_has_dts>:
mov    0x1c(%rdi),%ecx
not    %ecx
xor    %eax,%eax
test   $0xc0,%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @pes_has_dts(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 7
%5 = load i32, i32* %4
%6 = and i32 %5, 192
%7 = icmp eq i32 %6, 192
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @pes_has_dts(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 7
%3 = load i32, i32* %2
%4 = and i32 %3, 192
%5 = icmp eq i32 %4, 192
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int dowork();
int main(int argc, char *argv[]) { return dowork(); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @dowork()
ret i32 %3
}
/* Variables and functions */
int max(int, int);
int height(int *tree, int node) {
  if (tree[node] == -1)
    return -1;
  else
    return 1 + max(height(tree, node * 2 + 1), height(tree, node * 2 + 2));
}


x86 assembly (clang, -O0):
<height>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
jne    114d <height+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1184 <height+0x64>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
shl    $0x1,%esi
add    $0x1,%esi
call   1040 <height@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
shl    $0x1,%esi
add    $0x2,%esi
call   1040 <height@plt>
mov    -0x18(%rbp),%edi
mov    %eax,%esi
call   1030 <max@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<height>:
push   %rbp
push   %r14
push   %rbx
movslq %esi,%rax
cmpl   $0xffffffff,(%rdi,%rax,4)
je     115b <height+0x3b>
mov    %esi,%ebx
mov    %rdi,%r14
lea    (%rbx,%rbx,1),%esi
add    $0x1,%esi
call   1040 <height@plt>
mov    %eax,%ebp
lea    (%rbx,%rbx,1),%esi
add    $0x2,%esi
mov    %r14,%rdi
call   1040 <height@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <max@plt>
add    $0x1,%eax
jmp    1160 <height+0x40>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @height(i32* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %2, %9
%8 = phi i32 [ %16, %9 ], [ -1, %2 ]
ret i32 %8
9: ; preds = %2
%10 = shl nsw i32 %1, 1
%11 = or i32 %10, 1
%12 = tail call i32 @height(i32* %0, i32 %11)
%13 = add nsw i32 %10, 2
%14 = tail call i32 @height(i32* %0, i32 %13)
%15 = tail call i32 @max(i32 %12, i32 %14)
%16 = add nsw i32 %15, 1
br label %7
}
int main() {
  int data1 = 10;
  int data2 = 20;
  __asm__ __volatile__("imull %1, %0" : "=r"(data2) : "r"(data1), "0"(data2));
  printf("The result is %d\n", data2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 asm sideeffect "imull $1, $0", "=r,r,0,~{dirflag},~{fpsr},~{flags}"(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = tail call i32 asm sideeffect "imull $1, $0", "=r,r,0,~{dirflag},~{fpsr},~{flags}"(i32 10, i32 20)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void av_parse_cpu_flags() {}


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

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

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

LLVM IR (-O2):
define void @av_parse_cpu_flags() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int *);
void mikado(int bah) {
  int pooh = 10;
  printf("In mikado(), pooh = %d and &pooh = %p\n", pooh, &pooh);
  printf("In mikado(), bah = %d and &bah = %p\n", bah, &bah);
}


x86 assembly (clang, -O0):
<mikado>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed4(%rip),%rdi
lea    -0x8(%rbp),%rdx
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xee8(%rip),%rdi
lea    -0x4(%rbp),%rdx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mikado>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %edi,0xc(%rsp)
movl   $0xa,0x8(%rsp)
lea    0xed6(%rip),%rdi
lea    0x8(%rsp),%rdx
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
lea    0xc(%rsp),%rdx
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"In mikado(), pooh = %d and &pooh = %p\0A\00"
@.str.1 = [37 x i8] c"In mikado(), bah = %d and &bah = %p\0A\00"
define void @mikado(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 10, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %4, i32* %3)
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32* %2)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"In mikado(), pooh = %d and &pooh = %p\0A\00"
@.str.1 = [37 x i8] c"In mikado(), bah = %d and &bah = %p\0A\00"
define void @mikado(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = bitcast i32* %3 to i8*
store i32 10, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 10, i32* %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32* %2)
ret void
}
/* Variables and functions */
int _isxdigit(int);
int isxdigit(int c) { return _isxdigit(c); }


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

x86 assembly (clang, -O2):
<isxdigit>:
jmp    1030 <_isxdigit@plt>

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

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = tail call i32 @_isxdigit(i32 %0)
ret i32 %2
}
void foo4e() {}


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

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

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

LLVM IR (-O2):
define void @foo4e() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x6e() {
  Assert_real((isspace(110) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              555, ("isspace should be 0 for n"));
}


x86 assembly (clang, -O0):
<t_isspace_0x6e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6e,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x22b,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0x6e>:
push   %rax
mov    $0x6e,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x22b,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for n\00"
define void @t_isspace_0x6e() {
%1 = call i64 @isspace(i32 110)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 555, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for n\00"
define void @t_isspace_0x6e() {
%1 = tail call i64 @isspace(i32 110)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 555, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int open(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int main() {
  int fd = open("hello", O_RDONLY, 0666);
  if (fd < 0) {
    perror("open error");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
mov    $0x1b6,%edx
call   1030 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1162 <main+0x42>
lea    0xea9(%rip),%rdi
call   1040 <perror@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
mov    $0x1b6,%edx
call   1030 <open@plt>
test   %eax,%eax
js     1143 <main+0x23>
xor    %eax,%eax
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
jmp    113f <main+0x1f>

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@O_RDONLY = global i32 0
@.str.1 = [11 x i8] c"open error\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @O_RDONLY
%4 = call i32 @open(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3, i32 438)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@O_RDONLY = global i32 0
@.str.1 = [11 x i8] c"open error\00"
define i32 @main() {
%1 = load i32, i32* @O_RDONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1, i32 438)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret i32 0
}
int __test() {
  int x = 3;
  return !x;
}


x86 assembly (clang, -O0):
<__test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__test() {
%1 = alloca i32
store i32 3, i32* %1
%2 = load i32, i32* %1
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @__test() {
ret i32 0
}
/* Variables and functions */
int ASN1_TIME_set_string(int /*<<< orphan*/ *, char const *);
int check_time_format(const char *str) {
  return ASN1_TIME_set_string(NULL, str);
}


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

x86 assembly (clang, -O2):
<check_time_format>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <ASN1_TIME_set_string@plt>

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

LLVM IR (-O2):
define i32 @check_time_format(i8* %0) {
%2 = tail call i32 @ASN1_TIME_set_string(i32* null, i8* %0)
ret i32 %2
}
/* Type definitions */
typedef double clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
double diffclock(clock_t clock1, clock_t clock2) {
  double diffticks = clock1 - clock2;
  double diffms = diffticks / CLOCKS_PER_SEC;
  return diffms;
}


x86 assembly (clang, -O0):
<diffclock>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    0x2ebf(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<diffclock>:
subsd  %xmm1,%xmm0
mov    0x2edd(%rip),%rax
divsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @diffclock(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fsub double %7, %8
store double %9, double* %5
%10 = load double, double* %5
%11 = load double, double* @CLOCKS_PER_SEC
%12 = fdiv double %10, %11
store double %12, double* %6
%13 = load double, double* %6
ret double %13
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @diffclock(double %0, double %1) {
%3 = fsub double %0, %1
%4 = load double, double* @CLOCKS_PER_SEC
%5 = fdiv double %3, %4
ret double %5
}