xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ IntEnable(int);
int /*<<< orphan*/ IntRegister(int, void (*)());
void ComparatorIntRegister(unsigned long ulBase, unsigned long ulComp,
                           void (*pfnHandler)(void)) {
  ;
  ;
  IntRegister(41 + ulComp, pfnHandler);
  IntEnable(41 + ulComp);
  (*((volatile unsigned long *)(ulBase + 0x00000008))) |= 1 << ulComp;
}


x86 assembly (clang, -O0):
<ComparatorIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x29,%rax
mov    %eax,%edi
mov    -0x18(%rbp),%rsi
call   1040 <IntRegister@plt>
mov    -0x10(%rbp),%rax
add    $0x29,%rax
mov    %eax,%edi
call   1030 <IntEnable@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rdx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x8(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComparatorIntRegister>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0x29(%rsi),%ebp
mov    %ebp,%edi
mov    %rdx,%rsi
call   1040 <IntRegister@plt>
mov    %ebp,%edi
call   1030 <IntEnable@plt>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
cltq
or     %rax,0x8(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @ComparatorIntRegister(i64 %0, i64 %1, void ()* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca void ()*
store i64 %0, i64* %4
store i64 %1, i64* %5
store void ()* %2, void ()** %6
%7 = load i64, i64* %5
%8 = add i64 41, %7
%9 = trunc i64 %8 to i32
%10 = load void ()*, void ()** %6
%11 = bitcast void ()* %10 to void (...)*
%12 = call i32 @IntRegister(i32 %9, void (...)* %11)
%13 = load i64, i64* %5
%14 = add i64 41, %13
%15 = trunc i64 %14 to i32
%16 = call i32 @IntEnable(i32 %15)
%17 = load i64, i64* %5
%18 = trunc i64 %17 to i32
%19 = shl i32 1, %18
%20 = sext i32 %19 to i64
%21 = load i64, i64* %4
%22 = add i64 %21, 8
%23 = inttoptr i64 %22 to i64*
%24 = load volatile i64, i64* %23
%25 = or i64 %24, %20
store volatile i64 %25, i64* %23
ret void
}

LLVM IR (-O2):
define void @ComparatorIntRegister(i64 %0, i64 %1, void ()* %2) {
%4 = trunc i64 %1 to i32
%5 = add i32 %4, 41
%6 = bitcast void ()* %2 to void (...)*
%7 = tail call i32 @IntRegister(i32 %5, void (...)* %6)
%8 = tail call i32 @IntEnable(i32 %5)
%9 = shl nuw i32 1, %4
%10 = sext i32 %9 to i64
%11 = add i64 %0, 8
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = or i64 %13, %10
store volatile i64 %14, i64* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
int _remove_source_object(void *data, void *extra) {
  int result = -1;
  ((void)(extra));
  do {
    ((void)(data));
    assert(data);
  } while (0);
  return result;
}


x86 assembly (clang, -O0):
<_remove_source_object>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_remove_source_object>:
push   %rax
call   1030 <assert@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_remove_source_object(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 -1, i32* %5
%6 = load i8*, i8** %4
br label %7
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @assert(i8* %9)
br label %11
11: ; preds = %7
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @_remove_source_object(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @assert(i8* %0)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *s) {
  fprintf(stderr,
          "Usage: %s {-e VAR[=VAL] | [-t SECONDS] "
          "{0|1|2|3|4|5|6|S|s|Q|q|A|a|B|b|C|c|U|u}}\n",
          s);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [81 x i8] c"Usage: %s {-e VAR[=VAL] | [-t SECONDS] {0|1|2|3|4|5|6|S|s|Q|q|A|a|B|b|C|c|U|u}}\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [81 x i8] c"Usage: %s {-e VAR[=VAL] | [-t SECONDS] {0|1|2|3|4|5|6|S|s|Q|q|A|a|B|b|C|c|U|u}}\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double fmod(double, double);
double aa_fmodulo(double a, double b) { return fmod(fmod(a, b) + b, b); }


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

x86 assembly (clang, -O2):
<aa_fmodulo>:
push   %rax
movsd  %xmm1,(%rsp)
call   1030 <fmod@plt>
movsd  (%rsp),%xmm1
addsd  %xmm1,%xmm0
pop    %rax
jmp    1030 <fmod@plt>

LLVM IR (-O0):
define double @aa_fmodulo(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 = load double, double* %4
%7 = call double @fmod(double %5, double %6)
%8 = load double, double* %4
%9 = fadd double %7, %8
%10 = load double, double* %4
%11 = call double @fmod(double %9, double %10)
ret double %11
}

LLVM IR (-O2):
define double @aa_fmodulo(double %0, double %1) {
%3 = tail call double @fmod(double %0, double %1)
%4 = fadd double %3, %1
%5 = tail call double @fmod(double %4, double %1)
ret double %5
}
int test_imm_1Bint32_reg(int val) { return ((val) & (0x1B << 0)) ? -20 : -40; }


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

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

LLVM IR (-O0):
define i32 @test_imm_1Bint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 27
%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_1Bint32_reg(i32 %0) {
%2 = and i32 %0, 27
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, d1, d2, d1old;
  x = __VERIFIER_nondet_int();
  d1 = __VERIFIER_nondet_int();
  d2 = __VERIFIER_nondet_int();
  while (x >= 0) {
    x = x - d1;
    d1old = d1;
    d1 = d2 + 1;
    d2 = d1old + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     116d <main+0x5d>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113d <main+0x2d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int h_i, h_f;
  scanf(" %d %d", &h_i, &h_f);
  if (h_i < h_f)
    printf("O JOGO DUROU %d HORA(S)\n", h_f - h_i);
  else
    printf("O JOGO DUROU %d HORA(S)\n", (24 - h_i) + h_f);
  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    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1166 <main+0x46>
mov    -0xc(%rbp),%esi
sub    -0x8(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    117d <main+0x5d>
mov    $0x18,%esi
sub    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    (%rsp),%ecx
xor    %edx,%edx
cmp    %eax,%ecx
mov    $0x18,%esi
cmovg  %edx,%esi
sub    %eax,%esi
add    %ecx,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c" %d %d\00"
@.str.1 = [25 x i8] c"O JOGO DUROU %d HORA(S)\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 i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, %6
%9 = select i1 %8, i32 0, i32 24
%10 = sub i32 %9, %6
%11 = add i32 %7, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}
/* Variables and functions */
int printf(char *, long double);
int print_long_double(long double v) { return printf("%Lf", v); }


x86 assembly (clang, -O0):
<print_long_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%Lf\00"
define i32 @print_long_double(x86_fp80 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), x86_fp80 %0)
ret i32 %2
}
void ktsan_preempt_add(int value) {}


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

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

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

LLVM IR (-O2):
define void @ktsan_preempt_add(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("#define SHUT_RD 0\n");
  printf("#define SHUT_WR 1\n");
  printf("#define SHUT_RDWR 2\n");
  return 0;
}


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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"#define SHUT_RD 0\0A\00"
@.str.1 = [19 x i8] c"#define SHUT_WR 1\0A\00"
@.str.2 = [21 x i8] c"#define SHUT_RDWR 2\0A\00"
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 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"#define SHUT_RD 0\00"
@str.3 = [18 x i8] c"#define SHUT_WR 1\00"
@str.4 = [20 x i8] c"#define SHUT_RDWR 2\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
__typeof__(iscntrl(1)) test_iscntrl_19(void) { return iscntrl(1); }


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

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

LLVM IR (-O0):
define i32 @test_iscntrl_19() {
%1 = call i32 @iscntrl(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_iscntrl_19() {
%1 = tail call i32 @iscntrl(i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
int f() {
  int val;
  val = 1;
  printf("location of stack: %p\n", &val);
  return val;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <printf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"location of stack: %p\0A\00"
define i32 @f() {
%1 = alloca i32
store i32 1, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [23 x i8] c"location of stack: %p\0A\00"
define i32 @f() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
/* Type definitions */
struct device {
  int dummy;
};

/* Variables and functions */
int ENODEV;
int iommu_device_group(struct device *dev, unsigned int *groupid) {
  return -ENODEV;
}


x86 assembly (clang, -O0):
<iommu_device_group>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iommu_device_group>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.device = type { i32 }
@ENODEV = global i32 0
define i32 @iommu_device_group(%struct.device* %0, i32* %1) {
%3 = alloca %struct.device*
%4 = alloca i32*
store %struct.device* %0, %struct.device** %3
store i32* %1, i32** %4
%5 = load i32, i32* @ENODEV
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
%struct.device = type { i32 }
@ENODEV = global i32 0
define i32 @iommu_device_group(%struct.device* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @ENODEV
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void LCDRasterDisable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000028))) &= ~0x00000001;
}


x86 assembly (clang, -O0):
<LCDRasterDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x28,%eax
cltq
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDRasterDisable>:
movslq %edi,%rax
andl   $0xfffffffe,0x28(%rax)
ret

LLVM IR (-O0):
define void @LCDRasterDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 40
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -2
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @LCDRasterDisable(i32 %0) {
%2 = add nsw i32 %0, 40
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, -2
store volatile i32 %6, i32* %4
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void main() {
  int32_t a[10];
  a[0] = 0;
  a[1] = 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x30(%rbp)
movl   $0x1,-0x2c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca [10 x i32]
%2 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
store i32 0, i32* %2
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
store i32 1, i32* %3
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void set_usage() { printf("Usage: set { interface } \n"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"Usage: set { interface } \0A\00"
define void @set_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"Usage: set { interface } \00"
define void @set_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double expf(double);
double exp(double arg) { return expf(arg); }


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

x86 assembly (clang, -O2):
<exp>:
jmp    1030 <expf@plt>

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

LLVM IR (-O2):
define double @exp(double %0) {
%2 = tail call double @expf(double %0)
ret double %2
}
int do_348() { return 348; }


x86 assembly (clang, -O0):
<do_348>:
push   %rbp
mov    %rsp,%rbp
mov    $0x15c,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_348() {
ret i32 348
}

LLVM IR (-O2):
define i32 @do_348() {
ret i32 348
}
/* Variables and functions */
int /*<<< orphan*/ handle_48(int /*<<< orphan*/);
int gen_48(void) {
  handle_48(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_48>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_48@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_48() {
%1 = call i32 @handle_48(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_48() {
%1 = tail call i32 @handle_48(i32 0)
ret i32 0
}
/* Variables and functions */
char *doit2();
int /*<<< orphan*/ free(char *);
void pr6069() {
  char *buf = doit2();
  free(buf);
}


x86 assembly (clang, -O0):
<pr6069>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <doit2@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr6069>:
push   %rax
xor    %eax,%eax
call   1040 <doit2@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @pr6069() {
%1 = alloca i8*
%2 = call i8* (...) @doit2()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @pr6069() {
%1 = tail call i8* (...) @doit2()
%2 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_code_PIC24(unsigned long, unsigned char *, char, char,
                                    int, int);
void write_code_P24FJ(unsigned long address, unsigned char *data,
                      char blocksize, char lastblock) {
  write_code_PIC24(address, data, blocksize, lastblock, 0x4001, 64 * 3);
}


x86 assembly (clang, -O0):
<write_code_P24FJ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %al,-0x12(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x11(%rbp),%al
mov    $0x4001,%r8d
mov    $0xc0,%r9d
movsbl %al,%edx
movsbl -0x12(%rbp),%ecx
call   1030 <write_code_PIC24@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_code_P24FJ>:
mov    $0x4001,%r8d
mov    $0xc0,%r9d
jmp    1030 <write_code_PIC24@plt>

LLVM IR (-O0):
define void @write_code_P24FJ(i64 %0, i8* %1, i8 signext %2, i8 signext %3) {
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i8
store i64 %0, i64* %5
store i8* %1, i8** %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = load i64, i64* %5
%10 = load i8*, i8** %6
%11 = load i8, i8* %7
%12 = load i8, i8* %8
%13 = call i32 @write_code_PIC24(i64 %9, i8* %10, i8 signext %11, i8 signext %12, i32 16385, i32 192)
ret void
}

LLVM IR (-O2):
define void @write_code_P24FJ(i64 %0, i8* %1, i8 signext %2, i8 signext %3) {
%5 = tail call i32 @write_code_PIC24(i64 %0, i8* %1, i8 signext %2, i8 signext %3, i32 16385, i32 192)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t crc32cInit() { return 0xFFFFFFFF; }


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

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

LLVM IR (-O0):
define i32 @crc32cInit() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @crc32cInit() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void foo1(unsigned int a) {
  if (a & 1)
    goto heaven;
  if (a & 4)
    goto heaven;
  return;
heaven:
  bar();
}


x86 assembly (clang, -O0):
<foo1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     112f <foo1+0x1f>
jmp    1148 <foo1+0x38>
mov    -0x4(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1143 <foo1+0x33>
jmp    1148 <foo1+0x38>
jmp    114f <foo1+0x3f>
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo1>:
test   $0x5,%dil
je     111d <foo1+0xd>
xor    %eax,%eax
jmp    1030 <bar@plt>
ret

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

LLVM IR (-O2):
define void @foo1(i32 %0) {
%2 = and i32 %0, 5
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @bar()
br label %6
6: ; preds = %1, %4
ret void
}
void get_shift_and_mask(int value, int *shift, int *mask, int init_shift) {
  *mask = 0;
  *shift = init_shift;
  while (value > 1) {
    (*shift)++;
    value >>= 1;
    *mask = (*mask << 1) | 1;
  }
}


x86 assembly (clang, -O0):
<get_shift_and_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
cmpl   $0x1,-0x4(%rbp)
jle    115a <get_shift_and_mask+0x5a>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
shl    $0x1,%ecx
or     $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    1125 <get_shift_and_mask+0x25>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_shift_and_mask>:
movl   $0x0,(%rdx)
mov    %ecx,(%rsi)
cmp    $0x2,%edi
jl     1145 <get_shift_and_mask+0x45>
add    $0x1,%ecx
mov    %ecx,(%rsi)
mov    (%rdx),%eax
add    %eax,%eax
add    $0x1,%eax
mov    %eax,(%rdx)
cmp    $0x4,%edi
jb     1145 <get_shift_and_mask+0x45>
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
shr    %eax
addl   $0x1,(%rsi)
mov    (%rdx),%ecx
add    %ecx,%ecx
add    $0x1,%ecx
mov    %ecx,(%rdx)
cmp    $0x7,%edi
mov    %eax,%edi
ja     1130 <get_shift_and_mask+0x30>
ret

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

LLVM IR (-O2):
define void @get_shift_and_mask(i32 %0, i32* nocapture %1, i32* nocapture %2, i32 %3) {
store i32 0, i32* %2
store i32 %3, i32* %1
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %21
6: ; preds = %4
%7 = add nsw i32 %3, 1
store i32 %7, i32* %1
%8 = load i32, i32* %2
%9 = shl i32 %8, 1
%10 = or i32 %9, 1
store i32 %10, i32* %2
%11 = icmp ugt i32 %0, 3
br i1 %11, label %12, label %21
12: ; preds = %6, %12
%13 = phi i32 [ %14, %12 ], [ %0, %6 ]
%14 = lshr i32 %13, 1
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
%17 = load i32, i32* %2
%18 = shl i32 %17, 1
%19 = or i32 %18, 1
store i32 %19, i32* %2
%20 = icmp ugt i32 %13, 7
br i1 %20, label %12, label %21
21: ; preds = %12, %6, %4
ret void
}
void RTSha256Digest(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSha256Digest() {
ret void
}
void TransposeUV() {}


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

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

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

LLVM IR (-O2):
define void @TransposeUV() {
ret void
}
int tolower(int chr) {
  return (chr >= (int)'A' && chr <= (int)'Z') ? (chr + 32) : (chr);
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1129 <tolower+0x29>
cmpl   $0x5a,-0x4(%rbp)
jg     1129 <tolower+0x29>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <tolower+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 32
br label %13
11: ; preds = %5, %1
%12 = load i32, i32* %2
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
long double fdiml(long double x, long double y) {
  return (x > y) ? (x - y) : 0;
}


x86 assembly (clang, -O0):
<fdiml>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    1137 <fdiml+0x37>
jmp    1127 <fdiml+0x27>
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fsubrp %st,%st(1)
fstpt  -0x2c(%rbp)
jmp    1141 <fdiml+0x41>
fldz
fstpt  -0x2c(%rbp)
jmp    1141 <fdiml+0x41>
fldt   -0x2c(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdiml>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fucomi %st(1),%st
fsubp  %st,%st(1)
fldz
fcmovnbe %st(1),%st
fstp   %st(1)
ret

LLVM IR (-O0):
define x86_fp80 @fdiml(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fcmp ogt x86_fp80 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load x86_fp80, x86_fp80* %3
%10 = load x86_fp80, x86_fp80* %4
%11 = fsub x86_fp80 %9, %10
br label %13
12: ; preds = %2
br label %13
13: ; preds = %12, %8
%14 = phi x86_fp80 [ %11, %8 ], [ 0xK00000000000000000000, %12 ]
ret x86_fp80 %14
}

LLVM IR (-O2):
define x86_fp80 @fdiml(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp ogt x86_fp80 %0, %1
%4 = fsub x86_fp80 %0, %1
%5 = select i1 %3, x86_fp80 %4, x86_fp80 0xK00000000000000000000
ret x86_fp80 %5
}
/* Variables and functions */
int EOF;
int getchar();
void getlines(char lines[]) {
  int i, c;
  for (i = 0; (i < 1000 - 1) && ((c = getchar()) != EOF); i++) {
    lines[i] = c;
  }
}


x86 assembly (clang, -O0):
<getlines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x3e7,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jge    114e <getlines+0x3e>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x10(%rbp)
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115e <getlines+0x4e>
jmp    117c <getlines+0x6c>
mov    -0x10(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <getlines+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlines>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
mov    0x2ec9(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    (%r14),%eax
je     114d <getlines+0x3d>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    $0x3e7,%rbx
jne    1130 <getlines+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @getlines(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %5
5: ; preds = %21, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 999
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = call i32 (...) @getchar()
store i32 %9, i32* %4
%10 = load i32, i32* @EOF
%11 = icmp ne i32 %9, %10
br label %12
12: ; preds = %8, %5
%13 = phi i1 [ false, %5 ], [ %11, %8 ]
br i1 %13, label %14, label %24
14: ; preds = %12
%15 = load i32, i32* %4
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %2
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
store i8 %16, i8* %20
br label %21
21: ; preds = %14
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %5
24: ; preds = %12
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @getlines(i8* nocapture writeonly %0) {
br label %2
2: ; preds = %1, %7
%3 = phi i64 [ 0, %1 ], [ %10, %7 ]
%4 = tail call i32 (...) @getchar()
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %4, %5
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = trunc i32 %4 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 %8, i8* %9
%10 = add nuw nsw i64 %3, 1
%11 = icmp eq i64 %10, 999
br i1 %11, label %12, label %2
12: ; preds = %7, %2
ret void
}
int DxytoDir(int dx, int dy) {
  if ((dx < -1) || (dx > 1) || (dy < -1) || (dy > 1)) {
    return -1;
  }
  static int dtodir[3][3] = {{2, 2, 2}, {1, 0, 3}, {0, 0, 0}};
  return dtodir[dx + 1][dy + 1];
}


x86 assembly (clang, -O0):
<DxytoDir>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jl     1132 <DxytoDir+0x32>
cmpl   $0x1,-0x8(%rbp)
jg     1132 <DxytoDir+0x32>
cmpl   $0xffffffff,-0xc(%rbp)
jl     1132 <DxytoDir+0x32>
cmpl   $0x1,-0xc(%rbp)
jle    113e <DxytoDir+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <DxytoDir+0x64>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    0x2ee2(%rip),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DxytoDir>:
lea    -0x2(%rdi),%ecx
mov    $0xffffffff,%eax
cmp    $0xfffffffd,%ecx
jb     112d <DxytoDir+0x2d>
lea    -0x2(%rsi),%ecx
cmp    $0xfffffffd,%ecx
jb     112d <DxytoDir+0x2d>
add    $0x1,%edi
add    $0x1,%esi
lea    (%rdi,%rdi,2),%rax
lea    0xeda(%rip),%rcx
lea    (%rcx,%rax,4),%rax
mov    (%rax,%rsi,4),%eax
ret

LLVM IR (-O0):
@DxytoDir.dtodir = internal global [3 x [3 x i32]] [[3 x i32] [i32 2, i32 2, i32 2], [3 x i32] [i32 1, i32 0, i32 3], [3 x i32] zeroinitializer]
define i32 @DxytoDir(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 = icmp slt i32 %6, -1
br i1 %7, label %17, label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 1
br i1 %10, label %17, label %11
11: ; preds = %8
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, -1
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = load i32, i32* %5
%16 = icmp sgt i32 %15, 1
br i1 %16, label %17, label %18
17: ; preds = %14, %11, %8, %2
store i32 -1, i32* %3
br label %28
18: ; preds = %14
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* @DxytoDir.dtodir, i64 0, i64 %21
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [3 x i32], [3 x i32]* %22, i64 0, i64 %25
%27 = load i32, i32* %26
store i32 %27, i32* %3
br label %28
28: ; preds = %18, %17
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
@DxytoDir.dtodir = internal unnamed_addr constant [3 x [3 x i32]] [[3 x i32] [i32 2, i32 2, i32 2], [3 x i32] [i32 1, i32 0, i32 3], [3 x i32] zeroinitializer]
define i32 @DxytoDir(i32 %0, i32 %1) {
%3 = add i32 %0, -2
%4 = icmp ult i32 %3, -3
%5 = add i32 %1, -2
%6 = icmp ult i32 %5, -3
%7 = or i1 %4, %6
br i1 %7, label %15, label %8
8: ; preds = %2
%9 = add nsw i32 %0, 1
%10 = zext i32 %9 to i64
%11 = add nsw i32 %1, 1
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* @DxytoDir.dtodir, i64 0, i64 %10, i64 %12
%14 = load i32, i32* %13
br label %15
15: ; preds = %2, %8
%16 = phi i32 [ %14, %8 ], [ -1, %2 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  printf("a=%d; b=%d; c=%d", 1, 2, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"a=%d; b=%d; c=%d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"a=%d; b=%d; c=%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ binary_search(int);
main() { binary_search(8); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <binary_search@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
call   1030 <binary_search@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @binary_search(i32 8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @binary_search(i32 8)
ret i32 0
}
/* Type definitions */
struct flashctx {
  int dummy;
};
typedef int /*<<< orphan*/ cmd;

/* Variables and functions */
int spi_send_command(struct flashctx *, int, int /*<<< orphan*/,
                     unsigned char const *, int /*<<< orphan*/ *);
int spi_write_disable(struct flashctx *flash) {
  static const unsigned char cmd[0x01] = {0x04};
  return spi_send_command(flash, sizeof(cmd), 0, cmd, NULL);
}


x86 assembly (clang, -O0):
<spi_write_disable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
xor    %edx,%edx
lea    0xed2(%rip),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <spi_send_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_write_disable>:
lea    0xee9(%rip),%rcx
mov    $0x1,%esi
xor    %edx,%edx
xor    %r8d,%r8d
jmp    1030 <spi_send_command@plt>

LLVM IR (-O0):
%struct.flashctx = type { i32 }
@spi_write_disable.cmd = internal constant [1 x i8] c"\04"
define i32 @spi_write_disable(%struct.flashctx* %0) {
%2 = alloca %struct.flashctx*
store %struct.flashctx* %0, %struct.flashctx** %2
%3 = load %struct.flashctx*, %struct.flashctx** %2
%4 = call i32 @spi_send_command(%struct.flashctx* %3, i32 1, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @spi_write_disable.cmd, i64 0, i64 0), i32* null)
ret i32 %4
}

LLVM IR (-O2):
%struct.flashctx = type { i32 }
@spi_write_disable.cmd = internal constant [1 x i8] c"\04"
define i32 @spi_write_disable(%struct.flashctx* %0) {
%2 = tail call i32 @spi_send_command(%struct.flashctx* %0, i32 1, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @spi_write_disable.cmd, i64 0, i64 0), i32* null)
ret i32 %2
}
/* Variables and functions */
int execve(char const *, char *const *, char *const *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void Execve(const char *filename, char *const *argv, char *const *envp) {
  if (execve(filename, argv, envp) == -1) {
    printf("%s: Command not found\n", filename);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<Execve>:
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   1040 <execve@plt>
cmp    $0xffffffff,%eax
jne    116e <Execve+0x3e>
mov    -0x8(%rbp),%rsi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<Execve>:
push   %rbx
mov    %rdi,%rbx
call   1040 <execve@plt>
cmp    $0xffffffff,%eax
jne    114d <Execve+0x1d>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"%s: Command not found\0A\00"
define void @Execve(i8* %0, i8** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = load i8**, i8*** %6
%10 = call i32 @execve(i8* %7, i8** %8, i8** %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = load i8*, i8** %4
%14 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %12, %3
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"%s: Command not found\0A\00"
define void @Execve(i8* %0, i8** %1, i8** %2) {
%4 = tail call i32 @execve(i8* %0, i8** %1, i8** %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
char *stdc_44796E5C(int);
char *strerror(int errnum) { return stdc_44796E5C(errnum); }


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

x86 assembly (clang, -O2):
<strerror>:
jmp    1030 <stdc_44796E5C@plt>

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

LLVM IR (-O2):
define i8* @strerror(i32 %0) {
%2 = tail call i8* @stdc_44796E5C(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void description() {
  fprintf(stdout, "\x1b[33m"
                  "Description: "
                  "\x1b[0m");
  fprintf(stdout, "Write here what you want to be your project description."
                  "Observe that you can break a string inside a fprintf\n");
}


x86 assembly (clang, -O0):
<description>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<description>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee8(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [23 x i8] c"\1B[33mDescription: \1B[0m\00"
@.str.1 = [110 x i8] c"Write here what you want to be your project description.Observe that you can break a string inside a fprintf\0A\00"
define void @description() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [23 x i8] c"\1B[33mDescription: \1B[0m\00"
@.str.1 = [110 x i8] c"Write here what you want to be your project description.Observe that you can break a string inside a fprintf\0A\00"
define void @description() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ strlen(char *);
int tailleChaine(char chaine[]) { return (int)strlen(chaine); }


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

x86 assembly (clang, -O2):
<tailleChaine>:
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @tailleChaine(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @tailleChaine(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
int x15_setup() { return 0; }


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

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

LLVM IR (-O0):
define i32 @x15_setup() {
ret i32 0
}

LLVM IR (-O2):
define i32 @x15_setup() {
ret i32 0
}
/* Type definitions */
struct oscap_string_iterator {
  int dummy;
};
struct oscap_iterator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ oscap_iterator_free(struct oscap_iterator *);
void oscap_string_iterator_free(struct oscap_string_iterator *it) {
  oscap_iterator_free(((struct oscap_iterator *)(it)));
}


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

x86 assembly (clang, -O2):
<oscap_string_iterator_free>:
jmp    1030 <oscap_iterator_free@plt>

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

LLVM IR (-O2):
%struct.oscap_string_iterator = type { i32 }
%struct.oscap_iterator = type { i32 }
define void @oscap_string_iterator_free(%struct.oscap_string_iterator* %0) {
%2 = bitcast %struct.oscap_string_iterator* %0 to %struct.oscap_iterator*
%3 = tail call i32 @oscap_iterator_free(%struct.oscap_iterator* %2)
ret void
}