xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char *, char *);
int isSupported(char *type) {
  if (!strcasecmp(type, "SPRITE"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isSupported>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1141 <isSupported+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <isSupported+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSupported>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"SPRITE\00"
define i32 @isSupported(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strcasecmp(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [7 x i8] c"SPRITE\00"
define i32 @isSupported(i8* nocapture %0) {
%2 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void PEM_write_bio(void) {}


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

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

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

LLVM IR (-O2):
define void @PEM_write_bio() {
ret void
}
/* Variables and functions */
int get_mdterm();
void md_draw_big_point(int x, int y) {
  switch (get_mdterm()) {}
}


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

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

LLVM IR (-O0):
define void @md_draw_big_point(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @get_mdterm()
switch i32 %5, label %6 [
]
6: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @md_draw_big_point(i32 %0, i32 %1) {
%3 = tail call i32 (...) @get_mdterm()
ret void
}
/* Variables and functions */
int exp(double);
double damping_fermi(double r, double beta, double a) {
  return 1. / (1. + exp(-a * (r / beta - 1)));
}


x86 assembly (clang, -O0):
<damping_fermi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x8(%rbp),%xmm1
divsd  -0x10(%rbp),%xmm1
movsd  0xeab(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe92(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe86(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<damping_fermi>:
push   %rax
xorpd  0xee7(%rip),%xmm2
divsd  %xmm1,%xmm0
addsd  0xeeb(%rip),%xmm0
mulsd  %xmm2,%xmm0
call   1030 <exp@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xedb(%rip),%xmm0
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @damping_fermi(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = fneg double %7
%9 = load double, double* %4
%10 = load double, double* %5
%11 = fdiv double %9, %10
%12 = fsub double %11, 1.000000e+00
%13 = fmul double %8, %12
%14 = call i32 @exp(double %13)
%15 = sitofp i32 %14 to double
%16 = fadd double 1.000000e+00, %15
%17 = fdiv double 1.000000e+00, %16
ret double %17
}

LLVM IR (-O2):
define double @damping_fermi(double %0, double %1, double %2) {
%4 = fneg double %2
%5 = fdiv double %0, %1
%6 = fadd double %5, -1.000000e+00
%7 = fmul double %6, %4
%8 = tail call i32 @exp(double %7)
%9 = sitofp i32 %8 to double
%10 = fadd double %9, 1.000000e+00
%11 = fdiv double 1.000000e+00, %10
ret double %11
}
int main() {
  int x = 0;
  return 1 && x == 4;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ free(char *);
scalar_t__ remove(char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void misc_free_temp_dev(char *device) {
  if (remove(device)) {
    fprintf(stderr,
            "Warning: Could not remove "
            "temporary file %s: %s",
            device, strerror(errno));
  }
  free(device);
}


x86 assembly (clang, -O0):
<misc_free_temp_dev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <remove@plt>
cmp    $0x0,%rax
je     1197 <misc_free_temp_dev+0x57>
mov    0x2e7a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xe6e(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<misc_free_temp_dev>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <remove@plt>
test   %rax,%rax
je     117b <misc_free_temp_dev+0x3b>
mov    0x2e89(%rip),%rax
mov    (%rax),%ebp
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe92(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1050 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"Warning: Could not remove temporary file %s: %s\00"
@errno = global i32 0
define void @misc_free_temp_dev(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @remove(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %2
%9 = load i32, i32* @errno
%10 = call i8* @strerror(i32 %9)
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %10)
br label %12
12: ; preds = %6, %1
%13 = load i8*, i8** %2
%14 = call i32 @free(i8* %13)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"Warning: Could not remove temporary file %s: %s\00"
@errno = global i32 0
define void @misc_free_temp_dev(i8* %0) {
%2 = tail call i64 @remove(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = load i32, i32* @errno
%7 = tail call i8* @strerror(i32 %6)
%8 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %7)
br label %9
9: ; preds = %4, %1
%10 = tail call i32 @free(i8* %0)
ret void
}
void test3(void) {
  extern double foo3;
  extern double bar3(double);
  extern double baz3;
}


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

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

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

LLVM IR (-O2):
define void @test3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TOH(int, char, char, char);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  printf("\nEnter number of plates:");
  scanf("%d", &num);
  TOH(num - 1, 'A', 'B', 'C');
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
call   1040 <TOH@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
add    $0xffffffff,%edi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
call   1040 <TOH@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\0AEnter number of plates:\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = sub nsw i32 %5, 1
%7 = call i32 @TOH(i32 %6, i8 signext 65, i8 signext 66, i8 signext 67)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"\0AEnter number of plates:\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, -1
%7 = call i32 @TOH(i32 %6, i8 signext 65, i8 signext 66, i8 signext 67)
ret i32 0
}
char *itoa(int i) {
  static char b[10] = "########";
  register char *p;
  p = &b[8];
  do
    *p-- = i % 10 + '0';
  while (i /= 10);
  return (++p);
}


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0x2f12(%rip),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jne    1116 <itoa+0x16>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
lea    0x2f22(%rip),%rax
nopw   0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
add    $0x30,%sil
mov    %sil,-0x1(%rax)
add    $0xffffffffffffffff,%rax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <itoa+0x10>
ret

LLVM IR (-O0):
@itoa.b = internal global [10 x i8] c"########\00\00"
define i8* @itoa(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @itoa.b, i64 0, i64 8), i8** %3
br label %4
4: ; preds = %11, %1
%5 = load i32, i32* %2
%6 = srem i32 %5, 10
%7 = add nsw i32 %6, 48
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 -1
store i8* %10, i8** %3
store i8 %8, i8* %9
br label %11
11: ; preds = %4
%12 = load i32, i32* %2
%13 = sdiv i32 %12, 10
store i32 %13, i32* %2
%14 = icmp ne i32 %13, 0
br i1 %14, label %4, label %15
15: ; preds = %11
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@itoa.b = internal global [10 x i8] c"########\00\00"
define i8* @itoa(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %9, %2 ]
%4 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @itoa.b, i64 0, i64 8), %1 ], [ %8, %2 ]
%5 = srem i32 %3, 10
%6 = trunc i32 %5 to i8
%7 = add nsw i8 %6, 48
%8 = getelementptr inbounds i8, i8* %4, i64 -1
store i8 %7, i8* %4
%9 = sdiv i32 %3, 10
%10 = add i32 %3, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %2
12: ; preds = %2
ret i8* %4
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x;
  x = __VERIFIER_nondet_int();
  while (x >= 0) {
    if (__VERIFIER_nondet_int() != 0) {
      x = x - 1;
    } else {
      x = x + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     115f <main+0x4f>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     1151 <main+0x41>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115a <main+0x4a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
js     1132 <main+0x22>
mov    %eax,%ebx
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
neg    %eax
sbb    %eax,%eax
or     $0x1,%eax
add    %eax,%ebx
jns    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp sgt i32 %1, -1
br i1 %2, label %3, label %10
3: ; preds = %0, %3
%4 = phi i32 [ %8, %3 ], [ %1, %0 ]
%5 = tail call i32 (...) @__VERIFIER_nondet_int()
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 1, i32 -1
%8 = add nsw i32 %7, %4
%9 = icmp sgt i32 %8, -1
br i1 %9, label %3, label %10
10: ; preds = %3, %0
ret i32 0
}
int is_final(char x) { return ((x == '\n') || (x == '\0')); }


x86 assembly (clang, -O0):
<is_final>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     1129 <is_final+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_final>:
cmp    $0xa,%dil
sete   %al
test   %dil,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_final(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 10
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_final(i8 signext %0) {
%2 = icmp eq i8 %0, 10
%3 = icmp eq i8 %0, 0
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
char *getlogin();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *login = getlogin();
  if (login) {
    printf("%s\n", login);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getlogin@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1155 <main+0x35>
mov    -0x10(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getlogin@plt>
test   %rax,%rax
je     113c <main+0x1c>
lea    0xecc(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* (...) @getlogin()
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %6, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @getlogin()
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Type definitions */
struct mscabd_cabinet {
  int dummy;
};
struct mscab_decompressor {
  int dummy;
};

/* Variables and functions */
int cabd_merge(struct mscab_decompressor *, struct mscabd_cabinet *,
               struct mscabd_cabinet *);
int cabd_append(struct mscab_decompressor *base, struct mscabd_cabinet *cab,
                struct mscabd_cabinet *nextcab) {
  return cabd_merge(base, cab, nextcab);
}


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

x86 assembly (clang, -O2):
<cabd_append>:
jmp    1030 <cabd_merge@plt>

LLVM IR (-O0):
%struct.mscab_decompressor = type { i32 }
%struct.mscabd_cabinet = type { i32 }
define i32 @cabd_append(%struct.mscab_decompressor* %0, %struct.mscabd_cabinet* %1, %struct.mscabd_cabinet* %2) {
%4 = alloca %struct.mscab_decompressor*
%5 = alloca %struct.mscabd_cabinet*
%6 = alloca %struct.mscabd_cabinet*
store %struct.mscab_decompressor* %0, %struct.mscab_decompressor** %4
store %struct.mscabd_cabinet* %1, %struct.mscabd_cabinet** %5
store %struct.mscabd_cabinet* %2, %struct.mscabd_cabinet** %6
%7 = load %struct.mscab_decompressor*, %struct.mscab_decompressor** %4
%8 = load %struct.mscabd_cabinet*, %struct.mscabd_cabinet** %5
%9 = load %struct.mscabd_cabinet*, %struct.mscabd_cabinet** %6
%10 = call i32 @cabd_merge(%struct.mscab_decompressor* %7, %struct.mscabd_cabinet* %8, %struct.mscabd_cabinet* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.mscab_decompressor = type { i32 }
%struct.mscabd_cabinet = type { i32 }
define i32 @cabd_append(%struct.mscab_decompressor* %0, %struct.mscabd_cabinet* %1, %struct.mscabd_cabinet* %2) {
%4 = tail call i32 @cabd_merge(%struct.mscab_decompressor* %0, %struct.mscabd_cabinet* %1, %struct.mscabd_cabinet* %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
const char *sdp_event_query_rfcomm_service_get_name(const uint8_t *event) {
  return (const char *)&event[3];
}


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

x86 assembly (clang, -O2):
<sdp_event_query_rfcomm_service_get_name>:
lea    0xc(%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @sdp_event_query_rfcomm_service_get_name(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = bitcast i32* %2 to i8*
ret i8* %3
}
int add_backslash_escaped_to_buf(char *buf, char c) {
  buf[0] = '\\';
  buf[1] = c;
  return 2;
}


x86 assembly (clang, -O0):
<add_backslash_escaped_to_buf>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x5c,(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_backslash_escaped_to_buf>:
movb   $0x5c,(%rdi)
mov    %sil,0x1(%rdi)
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @add_backslash_escaped_to_buf(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 92, i8* %6
%7 = load i8, i8* %4
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %7, i8* %9
ret i32 2
}

LLVM IR (-O2):
define i32 @add_backslash_escaped_to_buf(i8* nocapture writeonly %0, i8 signext %1) {
store i8 92, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %1, i8* %3
ret i32 2
}
/* Variables and functions */
unsigned char *cdel_decode_base2_string(char *in_string, size_t *data_length,
                                        int *error) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @cdel_decode_base2_string(i8* nocapture readnone %0, i64* nocapture readnone %1, i32* nocapture readnone %2) {
ret i8* undef
}
void av_spherical_projection_name() {}


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

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

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

LLVM IR (-O2):
define void @av_spherical_projection_name() {
ret void
}
double QDIAGF(int i) { return i - (16 / 2); }


x86 assembly (clang, -O0):
<QDIAGF>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x8,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<QDIAGF>:
add    $0xfffffff8,%edi
cvtsi2sd %edi,%xmm0
ret

LLVM IR (-O0):
define double @QDIAGF(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 8
%5 = sitofp i32 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @QDIAGF(i32 %0) {
%2 = add nsw i32 %0, -8
%3 = sitofp i32 %2 to double
ret double %3
}
void fault_isr(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<fault_isr>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <fault_isr+0x9>
jmp    1109 <fault_isr+0x9>

x86 assembly (clang, -O2):
<fault_isr>:
jmp    1100 <fault_isr>

LLVM IR (-O0):
define void @fault_isr() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @fault_isr() {
br label %1
1: ; preds = %0, %1
br label %1
}
unsigned default_hash(const void *k) {
  unsigned n = (unsigned)k;
  n ^= n >> 12;
  n ^= n << 25;
  n ^= n >> 27;
  n *= 2685821657736338717;
  return n;
}


x86 assembly (clang, -O0):
<default_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0xc,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x19,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x1b,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
movabs $0x2545f4914f6cdd1d,%rcx
f4 45 25
imul   %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_hash>:
mov    %edi,%eax
shr    $0xc,%eax
xor    %edi,%eax
mov    %eax,%ecx
shl    $0x19,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    $0x1b,%eax
xor    %ecx,%eax
imul   $0x4f6cdd1d,%eax,%eax
ret

LLVM IR (-O0):
define i32 @default_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = lshr i32 %6, 12
%8 = load i32, i32* %3
%9 = xor i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = shl i32 %10, 25
%12 = load i32, i32* %3
%13 = xor i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = lshr i32 %14, 27
%16 = load i32, i32* %3
%17 = xor i32 %16, %15
store i32 %17, i32* %3
%18 = load i32, i32* %3
%19 = zext i32 %18 to i64
%20 = mul nsw i64 %19, 2685821657736338717
%21 = trunc i64 %20 to i32
store i32 %21, i32* %3
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @default_hash(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = lshr i32 %3, 12
%5 = xor i32 %4, %3
%6 = shl i32 %5, 25
%7 = xor i32 %6, %5
%8 = lshr i32 %7, 27
%9 = xor i32 %8, %7
%10 = mul i32 %9, 1332534557
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ rt_term();
void __attribute__((destructor)) libmatrixstore_fini(void) { rt_term(); }


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

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

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @libmatrixstore_fini, i8* null }]
define void @libmatrixstore_fini() {
%1 = call i32 (...) @rt_term()
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @libmatrixstore_fini, i8* null }]
define void @libmatrixstore_fini() {
%1 = tail call i32 (...) @rt_term()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ screenshot_init(char *);
void InitScreenshotX11(void) { screenshot_init(".xpm"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c".xpm\00"
define void @InitScreenshotX11() {
%1 = call i32 @screenshot_init(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c".xpm\00"
define void @InitScreenshotX11() {
%1 = tail call i32 @screenshot_init(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void ble_rsp_system_hello(const void *nul) {}


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

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

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

LLVM IR (-O2):
define void @ble_rsp_system_hello(i8* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *, int *);
int main() {
  int num1, num2;
  while (scanf("%d%d", &num1, &num2) != EOF)
    printf("%d\n", num1 + num2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%rax
je     116a <main+0x4a>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
mov    0x2e9e(%rip),%r13
cmp    0x0(%r13),%rax
je     1194 <main+0x74>
lea    0xeae(%rip),%r14
lea    0xea2(%rip),%r15
lea    0xc(%rsp),%r12
lea    0x8(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    0x8(%rsp),%esi
add    0xc(%rsp),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
cmp    0x0(%r13),%rax
jne    1170 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %16, label %8
8: ; preds = %0, %8
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %10, %9
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%14 = load i64, i64* @EOF
%15 = icmp eq i64 %13, %14
br i1 %15, label %16, label %8
16: ; preds = %8, %0
ret i32 0
}
int test_imm_D5int8_mem(signed char *val) {
  return ((*val) & (-0xD5 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D5int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff2b,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D5int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -213
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ tmp;

/* Variables and functions */
int /*<<< orphan*/ parseutils_buf2str(char *, char const *, size_t);
double strtod(char *, int /*<<< orphan*/ *);
int parseutils_buf2double(double *out, const char *buf, size_t len) {
  char tmp[30];
  if (len >= sizeof(tmp))
    return -1;
  parseutils_buf2str(tmp, buf, len);
  *out = strtod(tmp, NULL);
  return 0;
}


x86 assembly (clang, -O0):
<parseutils_buf2double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x1e,-0x20(%rbp)
jb     114b <parseutils_buf2double+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <parseutils_buf2double+0x58>
lea    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <parseutils_buf2str@plt>
lea    -0x40(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <strtod@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseutils_buf2double>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    $0xffffffff,%ebx
cmp    $0x1d,%rdx
ja     1153 <parseutils_buf2double+0x33>
mov    %rdi,%r14
mov    %rsp,%r15
mov    %r15,%rdi
call   1030 <parseutils_buf2str@plt>
xor    %ebx,%ebx
mov    %r15,%rdi
xor    %esi,%esi
call   1040 <strtod@plt>
movsd  %xmm0,(%r14)
mov    %ebx,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @parseutils_buf2double(double* %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca [30 x i8]
store double* %0, double** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%9 = load i64, i64* %7
%10 = icmp uge i64 %9, 30
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 -1, i32* %4
br label %20
12: ; preds = %3
%13 = getelementptr inbounds [30 x i8], [30 x i8]* %8, i64 0, i64 0
%14 = load i8*, i8** %6
%15 = load i64, i64* %7
%16 = call i32 @parseutils_buf2str(i8* %13, i8* %14, i64 %15)
%17 = getelementptr inbounds [30 x i8], [30 x i8]* %8, i64 0, i64 0
%18 = call double @strtod(i8* %17, i32* null)
%19 = load double*, double** %5
store double %18, double* %19
store i32 0, i32* %4
br label %20
20: ; preds = %12, %11
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @parseutils_buf2double(double* nocapture writeonly %0, i8* %1, i64 %2) {
%4 = alloca [30 x i8]
%5 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%6 = icmp ugt i64 %2, 29
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = call i32 @parseutils_buf2str(i8* %5, i8* %1, i64 %2)
%9 = call double @strtod(i8* nocapture %5, i32* null)
store double %9, double* %0
br label %10
10: ; preds = %3, %7
%11 = phi i32 [ 0, %7 ], [ -1, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ drv_RB_command(int, int);
void drv_RB_clear(void) { drv_RB_command(0x01, 1680); }


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

x86 assembly (clang, -O2):
<drv_RB_clear>:
mov    $0x1,%edi
mov    $0x690,%esi
jmp    1030 <drv_RB_command@plt>

LLVM IR (-O0):
define void @drv_RB_clear() {
%1 = call i32 @drv_RB_command(i32 1, i32 1680)
ret void
}

LLVM IR (-O2):
define void @drv_RB_clear() {
%1 = tail call i32 @drv_RB_command(i32 1, i32 1680)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int password;
  for (int i = 0; i > 5; i++) {
    scanf("%d", &password);
    if (password == 1488) {
      printf("accepted\n");
      return 0;
    } else {
      printf("incorrect password\n");
    }
    printf("denied\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jle    119b <main+0x7b>
lea    0xeb9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x5d0,-0x8(%rbp)
jne    1175 <main+0x55>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11a2 <main+0x82>
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"accepted\0A\00"
@.str.2 = [20 x i8] c"incorrect password\0A\00"
@.str.3 = [8 x i8] c"denied\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %17, %0
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 5
br i1 %6, label %7, label %20
7: ; preds = %4
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 1488
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %21
13: ; preds = %7
%14 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13
%16 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %15
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %4
20: ; preds = %4
store i32 0, i32* %1
br label %21
21: ; preds = %20, %11
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
double dstrb_beta_variance(const double a, const double b) {
  const double c = a + b;
  return (a * b) / (c * c * (c + 1));
}


x86 assembly (clang, -O0):
<dstrb_beta_variance>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
addsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dstrb_beta_variance>:
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm0
movapd %xmm2,%xmm1
mulsd  %xmm2,%xmm1
addsd  0xee4(%rip),%xmm2
mulsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dstrb_beta_variance(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fadd double %6, %7
store double %8, double* %5
%9 = load double, double* %3
%10 = load double, double* %4
%11 = fmul double %9, %10
%12 = load double, double* %5
%13 = load double, double* %5
%14 = fmul double %12, %13
%15 = load double, double* %5
%16 = fadd double %15, 1.000000e+00
%17 = fmul double %14, %16
%18 = fdiv double %11, %17
ret double %18
}

LLVM IR (-O2):
define double @dstrb_beta_variance(double %0, double %1) {
%3 = fadd double %0, %1
%4 = fmul double %0, %1
%5 = fmul double %3, %3
%6 = fadd double %3, 1.000000e+00
%7 = fmul double %5, %6
%8 = fdiv double %4, %7
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ mpf_t;

/* Variables and functions */
int /*<<< orphan*/ mpf_clear(int /*<<< orphan*/);
int /*<<< orphan*/ mpf_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpf_neg(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpf_set_ui(int /*<<< orphan*/, unsigned int);
int /*<<< orphan*/ mpf_sqrt(int /*<<< orphan*/, int /*<<< orphan*/);
void a_bound_n(mpf_t b_n, unsigned int n) {
  mpf_t en, sq_en;
  mpf_init(en);
  mpf_init(sq_en);
  mpf_set_ui(en, n + 1);
  mpf_sqrt(sq_en, en);
  mpf_neg(en, sq_en);
  mpf_clear(en);
  mpf_clear(sq_en);
}


x86 assembly (clang, -O0):
<a_bound_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <mpf_init@plt>
mov    -0x10(%rbp),%edi
call   1050 <mpf_init@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
call   1070 <mpf_set_ui@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <mpf_sqrt@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <mpf_neg@plt>
mov    -0xc(%rbp),%edi
call   1060 <mpf_clear@plt>
mov    -0x10(%rbp),%edi
call   1060 <mpf_clear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_bound_n>:
push   %rbx
mov    %esi,%ebx
call   1050 <mpf_init@plt>
call   1050 <mpf_init@plt>
add    $0x1,%ebx
mov    %ebx,%esi
call   1070 <mpf_set_ui@plt>
call   1030 <mpf_sqrt@plt>
call   1040 <mpf_neg@plt>
call   1060 <mpf_clear@plt>
pop    %rbx
jmp    1060 <mpf_clear@plt>

LLVM IR (-O0):
define void @a_bound_n(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %5
%8 = call i32 @mpf_init(i32 %7)
%9 = load i32, i32* %6
%10 = call i32 @mpf_init(i32 %9)
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = add i32 %12, 1
%14 = call i32 @mpf_set_ui(i32 %11, i32 %13)
%15 = load i32, i32* %6
%16 = load i32, i32* %5
%17 = call i32 @mpf_sqrt(i32 %15, i32 %16)
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = call i32 @mpf_neg(i32 %18, i32 %19)
%21 = load i32, i32* %5
%22 = call i32 @mpf_clear(i32 %21)
%23 = load i32, i32* %6
%24 = call i32 @mpf_clear(i32 %23)
ret void
}

LLVM IR (-O2):
define void @a_bound_n(i32 %0, i32 %1) {
%3 = tail call i32 @mpf_init(i32 undef)
%4 = tail call i32 @mpf_init(i32 undef)
%5 = add i32 %1, 1
%6 = tail call i32 @mpf_set_ui(i32 undef, i32 %5)
%7 = tail call i32 @mpf_sqrt(i32 undef, i32 undef)
%8 = tail call i32 @mpf_neg(i32 undef, i32 undef)
%9 = tail call i32 @mpf_clear(i32 undef)
%10 = tail call i32 @mpf_clear(i32 undef)
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void set_time_start(struct timeval *tv) { gettimeofday(tv, NULL); }


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

x86 assembly (clang, -O2):
<set_time_start>:
xor    %esi,%esi
jmp    1030 <gettimeofday@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @set_time_start(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @set_time_start(%struct.timeval* nocapture %0) {
%2 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
ret void
}
/* Variables and functions */
char getch();
char tolower(char);
char getChoice() {
  char choice;
  do {
    choice = getch();
    choice = tolower(choice);
  } while (choice != 'y' && choice != 'n');
  return choice;
}


x86 assembly (clang, -O0):
<getChoice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getch@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x79,%ecx
mov    %al,-0x2(%rbp)
je     115d <getChoice+0x3d>
movsbl -0x1(%rbp),%eax
cmp    $0x6e,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    1128 <getChoice+0x8>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getChoice>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getch@plt>
movsbl %al,%edi
call   1030 <tolower@plt>
cmp    $0x79,%al
je     1147 <getChoice+0x27>
cmp    $0x6e,%al
jne    1130 <getChoice+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @getChoice() {
%1 = alloca i8
br label %2
2: ; preds = %14, %0
%3 = call signext i8 (...) @getch()
store i8 %3, i8* %1
%4 = load i8, i8* %1
%5 = call signext i8 @tolower(i8 signext %4)
store i8 %5, i8* %1
br label %6
6: ; preds = %2
%7 = load i8, i8* %1
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 121
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %1
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 110
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ false, %6 ], [ %13, %10 ]
br i1 %15, label %2, label %16
16: ; preds = %14
%17 = load i8, i8* %1
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @getChoice() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getch()
%3 = tail call signext i8 @tolower(i8 signext %2)
switch i8 %3, label %1 [
i8 121, label %4
i8 110, label %4
]
4: ; preds = %1, %1
ret i8 %3
}
char num_to_char(char z) {
  if (z == 0)
    return (char)'A';
  if (z == 1)
    return (char)'C';
  if (z == 2)
    return (char)'G';
  if (z == 3)
    return (char)'T';
  return (char)'N';
}


x86 assembly (clang, -O0):
<num_to_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
jne    1120 <num_to_char+0x20>
movb   $0x41,-0x1(%rbp)
jmp    1166 <num_to_char+0x66>
movsbl -0x2(%rbp),%eax
cmp    $0x1,%eax
jne    1136 <num_to_char+0x36>
movb   $0x43,-0x1(%rbp)
jmp    1166 <num_to_char+0x66>
movsbl -0x2(%rbp),%eax
cmp    $0x2,%eax
jne    114c <num_to_char+0x4c>
movb   $0x47,-0x1(%rbp)
jmp    1166 <num_to_char+0x66>
movsbl -0x2(%rbp),%eax
cmp    $0x3,%eax
jne    1162 <num_to_char+0x62>
movb   $0x54,-0x1(%rbp)
jmp    1166 <num_to_char+0x66>
movb   $0x4e,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_to_char>:
lea    0x0(,%rdi,8),%ecx
mov    $0x54474341,%edx
shr    %cl,%edx
cmp    $0x4,%dil
mov    $0x4e,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @num_to_char(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 65, i8* %2
br label %24
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 67, i8* %2
br label %24
13: ; preds = %8
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 2
br i1 %16, label %17, label %18
17: ; preds = %13
store i8 71, i8* %2
br label %24
18: ; preds = %13
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 3
br i1 %21, label %22, label %23
22: ; preds = %18
store i8 84, i8* %2
br label %24
23: ; preds = %18
store i8 78, i8* %2
br label %24
24: ; preds = %23, %22, %17, %12, %7
%25 = load i8, i8* %2
ret i8 %25
}

LLVM IR (-O2):
define signext i8 @num_to_char(i8 signext %0) {
%2 = icmp ult i8 %0, 4
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 3
%5 = lshr i32 1413956417, %4
%6 = trunc i32 %5 to i8
%7 = select i1 %2, i8 %6, i8 78
ret i8 %7
}
/* Variables and functions */
int __builtin_nyuzi_read_control_reg(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int, int);
void fault_handler(void) {
  printf("FAULT %d addr %08x pc %08x\n", __builtin_nyuzi_read_control_reg(3),
         __builtin_nyuzi_read_control_reg(5),
         __builtin_nyuzi_read_control_reg(2));
  exit(0);
}


x86 assembly (clang, -O0):
<fault_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
call   1040 <__builtin_nyuzi_read_control_reg@plt>
mov    %eax,-0x8(%rbp)
mov    $0x5,%edi
call   1040 <__builtin_nyuzi_read_control_reg@plt>
mov    %eax,-0x4(%rbp)
mov    $0x2,%edi
call   1040 <__builtin_nyuzi_read_control_reg@plt>
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    %eax,%ecx
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<fault_handler>:
push   %rbp
push   %rbx
push   %rax
mov    $0x3,%edi
call   1040 <__builtin_nyuzi_read_control_reg@plt>
mov    %eax,%ebx
mov    $0x5,%edi
call   1040 <__builtin_nyuzi_read_control_reg@plt>
mov    %eax,%ebp
mov    $0x2,%edi
call   1040 <__builtin_nyuzi_read_control_reg@plt>
lea    0xea4(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"FAULT %d addr %08x pc %08x\0A\00"
define void @fault_handler() {
%1 = call i32 @__builtin_nyuzi_read_control_reg(i32 3)
%2 = call i32 @__builtin_nyuzi_read_control_reg(i32 5)
%3 = call i32 @__builtin_nyuzi_read_control_reg(i32 2)
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [28 x i8] c"FAULT %d addr %08x pc %08x\0A\00"
define void @fault_handler() {
%1 = tail call i32 @__builtin_nyuzi_read_control_reg(i32 3)
%2 = tail call i32 @__builtin_nyuzi_read_control_reg(i32 5)
%3 = tail call i32 @__builtin_nyuzi_read_control_reg(i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3)
%5 = tail call i32 @exit(i32 0)
unreachable
}