xunge/DecIR huggingface dataset:
__attribute__((no, noclone)) int foo(int x) {
  if (x < 4096 + 8 || x >= 4096 + 256 + 8)
    return -1;
  char buf[5];
  int n = __builtin_snprintf(buf, sizeof buf, "%hhd", x + 1);
  __builtin_printf("\"%hhd\" => %i\n", x + 1, n);
  return n;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1008,-0x8(%rbp)
jl     1145 <foo+0x25>
cmpl   $0x1108,-0x8(%rbp)
jl     1151 <foo+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    118e <foo+0x6e>
lea    -0xd(%rbp),%rdi
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    $0x5,%esi
lea    0xe99(%rip),%rdx
mov    $0x0,%al
call   1040 <snprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0x14(%rbp),%edx
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    -0x1108(%rbx),%eax
mov    $0xffffffff,%ebp
cmp    $0xffffff00,%eax
jb     1168 <foo+0x48>
add    $0x1,%ebx
lea    0xebf(%rip),%rdx
lea    0x3(%rsp),%rdi
mov    $0x5,%esi
mov    %ebx,%ecx
xor    %eax,%eax
call   1040 <snprintf@plt>
mov    %eax,%ebp
lea    0xea8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%hhd\00"
@.str.1 = [14 x i8] c"\22%hhd\22 => %i\0A\00"
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [5 x i8]
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 4104
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp sge i32 %9, 4360
br i1 %10, label %11, label %12
11: ; preds = %8, %1
store i32 -1, i32* %2
br label %22
12: ; preds = %8
%13 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
%16 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %13, i64 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %15)
store i32 %16, i32* %5
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
%19 = load i32, i32* %5
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %18, i32 %19)
%21 = load i32, i32* %5
store i32 %21, i32* %2
br label %22
22: ; preds = %12, %11
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
@.str = [5 x i8] c"%hhd\00"
@.str.1 = [14 x i8] c"\22%hhd\22 => %i\0A\00"
define i32 @foo(i32 %0) {
%2 = alloca [5 x i8]
%3 = add i32 %0, -4360
%4 = icmp ult i32 %3, -256
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%7 = add nuw nsw i32 %0, 1
%8 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %6, i64 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %8, %5 ], [ -1, %1 ]
ret i32 %11
}
void gtk_text_child_anchor_get_deleted() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_child_anchor_get_deleted() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ test_path_set_add();
int /*<<< orphan*/ test_path_set_alloc();
int main(int argc, char *argv[]) {
  test_path_set_alloc();
  test_path_set_add();
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_path_set_alloc@plt>
xor    %eax,%eax
call   1030 <test_path_set_add@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 (...) @test_path_set_alloc()
%7 = call i32 (...) @test_path_set_add()
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_path_set_alloc()
%4 = tail call i32 (...) @test_path_set_add()
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ gmx_nmtraj(int, char **);
int main(int argc, char *argv[]) {
  gmx_nmtraj(argc, argv);
  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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gmx_nmtraj@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_nmtraj(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int f(int);
int main() {
  int i, x = 0;
  for (i = 0; i < 5; ++i) {
    x = f(i) + i + x;
  }
#pragma omp taskwait
  assert(x == 25);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1166 <main+0x46>
mov    -0x8(%rbp),%edi
call   1030 <f@plt>
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
cmpl   $0x19,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
call   1030 <f@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <f@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x2,%edi
call   1030 <f@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    $0x3,%edi
call   1030 <f@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x4,%edi
call   1030 <f@plt>
add    %ebp,%eax
xor    %edi,%edi
cmp    $0xf,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 0)
%2 = tail call i32 @f(i32 1)
%3 = add i32 %1, 1
%4 = add i32 %3, %2
%5 = tail call i32 @f(i32 2)
%6 = add i32 %4, 2
%7 = add i32 %6, %5
%8 = tail call i32 @f(i32 3)
%9 = add i32 %7, 3
%10 = add i32 %9, %8
%11 = tail call i32 @f(i32 4)
%12 = add i32 %10, 4
%13 = add i32 %12, %11
%14 = icmp eq i32 %13, 25
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void finit() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @finit() {
%1 = tail call i32 (...) @endwin()
ret void
}
int do_393() { return 393; }


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

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

LLVM IR (-O0):
define i32 @do_393() {
ret i32 393
}

LLVM IR (-O2):
define i32 @do_393() {
ret i32 393
}
void SIO1writeBaud32(unsigned long val) {}


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

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

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

LLVM IR (-O2):
define void @SIO1writeBaud32(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ keyfile_close();
int /*<<< orphan*/ stderr;
void main_shutdown(const char *errmsg) {
  fprintf(stderr, "Shutting down. Reason: %s\n", errmsg);
  keyfile_close();
  exit(1);
}


x86 assembly (clang, -O0):
<main_shutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <keyfile_close@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main_shutdown>:
push   %rax
mov    %rdi,%rdx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <keyfile_close@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Shutting down. Reason: %s\0A\00"
define void @main_shutdown(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 ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @keyfile_close()
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Shutting down. Reason: %s\0A\00"
define void @main_shutdown(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @keyfile_close()
%5 = tail call i32 @exit(i32 1)
unreachable
}
unsigned long local_save_flags(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @local_save_flags() {
ret i64 0
}

LLVM IR (-O2):
define i64 @local_save_flags() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ print_pyramid(int);
int main() {
  print_pyramid(5);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print_pyramid(i32 5)
ret i32 0
}
void HibernateClockSelect(unsigned long ulClockInput) {

  ;
  (*((volatile unsigned long *)(0x400FC010))) =
      ulClockInput |
      ((*((volatile unsigned long *)(0x400FC010))) & ~0x00000004);
}


x86 assembly (clang, -O0):
<HibernateClockSelect>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400fc010,%eax
mov    (%rax),%rax
and    $0xfffffffffffffffb,%rax
or     %rax,%rcx
mov    $0x400fc010,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateClockSelect>:
mov    0x400fc010,%rax
40
and    $0xfffffffffffffffb,%rax
or     %rdi,%rax
mov    %rax,0x400fc010
40
ret

LLVM IR (-O0):
define void @HibernateClockSelect(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%5 = and i64 %4, -5
%6 = or i64 %3, %5
store volatile i64 %6, i64* inttoptr (i64 1074774032 to i64*)
ret void
}

LLVM IR (-O2):
define void @HibernateClockSelect(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%3 = and i64 %2, -5
%4 = or i64 %3, %0
store volatile i64 %4, i64* inttoptr (i64 1074774032 to i64*)
ret void
}
/* Variables and functions */
scalar_t__ rand();
double genDouble() {
  double x;
  x = (double)rand() / 10000;
  return x;
}


x86 assembly (clang, -O0):
<genDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0xed4(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genDouble>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
divsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @genDouble() {
%1 = alloca double
%2 = call i64 (...) @rand()
%3 = sitofp i64 %2 to double
%4 = fdiv double %3, 1.000000e+04
store double %4, double* %1
%5 = load double, double* %1
ret double %5
}

LLVM IR (-O2):
define double @genDouble() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = fdiv double %2, 1.000000e+04
ret double %3
}
/* Type definitions */
struct trb_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *trb_delete(struct trb_table *, void *);
void *(trb_assert_delete)(struct trb_table *table, void *item) {
  void *p = trb_delete(table, item);
  assert(p != NULL);
  return p;
}


x86 assembly (clang, -O0):
<trb_assert_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <trb_delete@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trb_assert_delete>:
push   %rbx
call   1030 <trb_delete@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.trb_table = type { i32 }
define i8* @trb_assert_delete(%struct.trb_table* %0, i8* %1) {
%3 = alloca %struct.trb_table*
%4 = alloca i8*
%5 = alloca i8*
store %struct.trb_table* %0, %struct.trb_table** %3
store i8* %1, i8** %4
%6 = load %struct.trb_table*, %struct.trb_table** %3
%7 = load i8*, i8** %4
%8 = call i8* @trb_delete(%struct.trb_table* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
%struct.trb_table = type { i32 }
define i8* @trb_assert_delete(%struct.trb_table* %0, i8* %1) {
%3 = tail call i8* @trb_delete(%struct.trb_table* %0, i8* %1)
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ kattach_sysexec(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
void kattach_net_linkup(char *devname) {
  char lcmd[255];
  sprintf(lcmd, "%s%s link set %s up", "/kaos/core/busybox/bin/", "ip",
          devname);
  kattach_sysexec(lcmd);
  return;
}


x86 assembly (clang, -O0):
<kattach_net_linkup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%r8
lea    0xebf(%rip),%rsi
lea    0xecc(%rip),%rdx
lea    0xedd(%rip),%rcx
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <kattach_sysexec@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kattach_net_linkup>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%r8
lea    0xece(%rip),%rsi
lea    0xedb(%rip),%rdx
lea    0xeec(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <kattach_sysexec@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"%s%s link set %s up\00"
@.str.1 = [24 x i8] c"/kaos/core/busybox/bin/\00"
@.str.2 = [3 x i8] c"ip\00"
define void @kattach_net_linkup(i8* %0) {
%2 = alloca i8*
%3 = alloca [255 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%8 = call i32 @kattach_sysexec(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"%s%s link set %s up\00"
@.str.1 = [24 x i8] c"/kaos/core/busybox/bin/\00"
@.str.2 = [3 x i8] c"ip\00"
define void @kattach_net_linkup(i8* %0) {
%2 = alloca [255 x i8]
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%5 = call i32 @kattach_sysexec(i8* %3)
ret void
}
void strtoupper(dst, src) char *dst, *src;
{
  for (; *src; src++)
    *dst++ = toupper(*src);
  *dst = '\0';
}


x86 assembly (clang, -O0):
<strtoupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115d <strtoupper+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <strtoupper+0x10>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoupper>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rsi),%al
test   %al,%al
je     114a <strtoupper+0x3a>
mov    %rsi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,(%r14)
add    $0x1,%r14
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strtoupper+0x20>
movb   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @strtoupper(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %14, %5 ], [ %3, %2 ]
%7 = phi i8* [ %13, %5 ], [ %1, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = tail call i32 @toupper(i32 %9)
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %11, i8* %8
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i8* [ %0, %2 ], [ %12, %5 ]
store i8 0, i8* %17
ret void
}
/* Variables and functions */
int rand();
float getRand() { return rand() % 10; }


x86 assembly (clang, -O0):
<getRand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
cvtsi2ss %edx,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRand>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @getRand() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 10
%3 = sitofp i32 %2 to float
ret float %3
}

LLVM IR (-O2):
define float @getRand() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 10
%3 = sitofp i32 %2 to float
ret float %3
}
void int_memory_manager_init() {}


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

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

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

LLVM IR (-O2):
define void @int_memory_manager_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ str_qsort(char **, int /*<<< orphan*/, int);
void alphabetize(char *text[], int nlines) { str_qsort(text, 0, nlines); }


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

x86 assembly (clang, -O2):
<alphabetize>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <str_qsort@plt>

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

LLVM IR (-O2):
define void @alphabetize(i8** %0, i32 %1) {
%3 = tail call i32 @str_qsort(i8** %0, i32 0, i32 %1)
ret void
}
OP(dd, ee) { op_ee(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_ee()
ret i32 undef
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void configureIeeePatch(void) {
  uint8_t *pPatchTab = (uint8_t *)(0x21000000 + 0x033C);
  uint32_t *pIrqPatch = (uint32_t *)(0x21000000 + 0x03AC);
  pPatchTab[5] = 0;
  pPatchTab[52] = 1;
  pPatchTab[103] = 2;
  pPatchTab[60] = 3;
  pPatchTab[38] = 4;
  pIrqPatch[1] = 0x21000449;
  pIrqPatch[9] = 0x21000489;
}


x86 assembly (clang, -O0):
<configureIeeePatch>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2100033c,%eax
mov    %rax,-0x8(%rbp)
mov    $0x210003ac,%eax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,0x14(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0xd0(%rax)
mov    -0x8(%rbp),%rax
movl   $0x2,0x19c(%rax)
mov    -0x8(%rbp),%rax
movl   $0x3,0xf0(%rax)
mov    -0x8(%rbp),%rax
movl   $0x4,0x98(%rax)
mov    -0x10(%rbp),%rax
movl   $0x21000449,0x4(%rax)
mov    -0x10(%rbp),%rax
movl   $0x21000489,0x24(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<configureIeeePatch>:
movl   $0x0,0x21000350
movl   $0x1,0x2100040c
movl   $0x2,0x210004d8
movl   $0x3,0x2100042c
movl   $0x4,0x210003d4
movl   $0x21000449,0x210003b0
movl   $0x21000489,0x210003d0
ret

LLVM IR (-O0):
define void @configureIeeePatch() {
%1 = alloca i32*
%2 = alloca i32*
store i32* inttoptr (i64 553648956 to i32*), i32** %1
store i32* inttoptr (i64 553649068 to i32*), i32** %2
%3 = load i32*, i32** %1
%4 = getelementptr inbounds i32, i32* %3, i64 5
store i32 0, i32* %4
%5 = load i32*, i32** %1
%6 = getelementptr inbounds i32, i32* %5, i64 52
store i32 1, i32* %6
%7 = load i32*, i32** %1
%8 = getelementptr inbounds i32, i32* %7, i64 103
store i32 2, i32* %8
%9 = load i32*, i32** %1
%10 = getelementptr inbounds i32, i32* %9, i64 60
store i32 3, i32* %10
%11 = load i32*, i32** %1
%12 = getelementptr inbounds i32, i32* %11, i64 38
store i32 4, i32* %12
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 553649225, i32* %14
%15 = load i32*, i32** %2
%16 = getelementptr inbounds i32, i32* %15, i64 9
store i32 553649289, i32* %16
ret void
}

LLVM IR (-O2):
define void @configureIeeePatch() {
store i32 0, i32* inttoptr (i64 553648976 to i32*)
store i32 1, i32* inttoptr (i64 553649164 to i32*)
store i32 2, i32* inttoptr (i64 553649368 to i32*)
store i32 3, i32* inttoptr (i64 553649196 to i32*)
store i32 4, i32* inttoptr (i64 553649108 to i32*)
store i32 553649225, i32* inttoptr (i64 553649072 to i32*)
store i32 553649289, i32* inttoptr (i64 553649104 to i32*)
ret void
}
/* Type definitions */
struct ipv6hdr {
  int dummy;
};
typedef int __be32;

/* Variables and functions */
int ___constant_swab32(int);
__be32 ip6_flowlabel(const struct ipv6hdr *hdr) {
  return *(__be32 *)hdr & ___constant_swab32(0x000FFFFF);
}


x86 assembly (clang, -O0):
<ip6_flowlabel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfffff,%edi
call   1030 <___constant_swab32@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip6_flowlabel>:
push   %rbx
mov    (%rdi),%ebx
mov    $0xfffff,%edi
call   1030 <___constant_swab32@plt>
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ipv6hdr = type { i32 }
define i32 @ip6_flowlabel(%struct.ipv6hdr* %0) {
%2 = alloca %struct.ipv6hdr*
store %struct.ipv6hdr* %0, %struct.ipv6hdr** %2
%3 = load %struct.ipv6hdr*, %struct.ipv6hdr** %2
%4 = bitcast %struct.ipv6hdr* %3 to i32*
%5 = load i32, i32* %4
%6 = call i32 @___constant_swab32(i32 1048575)
%7 = and i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
%struct.ipv6hdr = type { i32 }
define i32 @ip6_flowlabel(%struct.ipv6hdr* nocapture %0) {
%2 = getelementptr %struct.ipv6hdr, %struct.ipv6hdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @___constant_swab32(i32 1048575)
%5 = and i32 %4, %3
ret i32 %5
}
void removeNthFromEndMain(void) {}


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

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

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

LLVM IR (-O2):
define void @removeNthFromEndMain() {
ret void
}
int test_imm_F1uint16_reg(unsigned short val) {
  return ((val) & (-0xF1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F1uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff0f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F1uint16_reg>:
test   $0xff0f,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F1uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -241
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
char DIGIT_TO_CHAR(int DIGIT) {
  char CH;
  if (9 >= DIGIT)
    CH = DIGIT + '0';
  else
    CH = DIGIT - 10 + 'A';
  return CH;
}


x86 assembly (clang, -O0):
<DIGIT_TO_CHAR>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x9,%eax
cmp    -0x4(%rbp),%eax
jl     1123 <DIGIT_TO_CHAR+0x23>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x5(%rbp)
jmp    112f <DIGIT_TO_CHAR+0x2f>
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DIGIT_TO_CHAR>:
cmp    $0xa,%edi
mov    $0x30,%ecx
mov    $0x37,%eax
cmovl  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @DIGIT_TO_CHAR(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sge i32 9, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 48
%9 = trunc i32 %8 to i8
store i8 %9, i8* %3
br label %15
10: ; preds = %1
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 10
%13 = add nsw i32 %12, 65
%14 = trunc i32 %13 to i8
store i8 %14, i8* %3
br label %15
15: ; preds = %10, %6
%16 = load i8, i8* %3
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @DIGIT_TO_CHAR(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = select i1 %2, i8 48, i8 55
%5 = add i8 %4, %3
ret i8 %5
}
int ackermann(int m, int n) {
  if (m == 0)
    return n + 1;
  if (n == 0)
    return ackermann(m - 1, 1);
  return ackermann(m - 1, ackermann(m, n - 1));
}


x86 assembly (clang, -O0):
<ackermann>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1136 <ackermann+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    117c <ackermann+0x6c>
cmpl   $0x0,-0xc(%rbp)
jne    1158 <ackermann+0x48>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    $0x1,%esi
call   1030 <ackermann@plt>
mov    %eax,-0x4(%rbp)
jmp    117c <ackermann+0x6c>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <ackermann@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <ackermann@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ackermann>:
push   %rbx
mov    %esi,%eax
test   %edi,%edi
je     113f <ackermann+0x2f>
mov    %edi,%ebx
jmp    112a <ackermann+0x1a>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%eax
add    $0xffffffff,%ebx
je     113f <ackermann+0x2f>
test   %eax,%eax
je     1120 <ackermann+0x10>
add    $0xffffffff,%eax
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <ackermann@plt>
add    $0xffffffff,%ebx
jne    112a <ackermann+0x1a>
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ackermann(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 eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %26
11: ; preds = %2
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 1
%17 = call i32 @ackermann(i32 %16, i32 1)
store i32 %17, i32* %3
br label %26
18: ; preds = %11
%19 = load i32, i32* %4
%20 = sub nsw i32 %19, 1
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = sub nsw i32 %22, 1
%24 = call i32 @ackermann(i32 %21, i32 %23)
%25 = call i32 @ackermann(i32 %20, i32 %24)
store i32 %25, i32* %3
br label %26
26: ; preds = %18, %14, %8
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @ackermann(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %11, %2
%5 = phi i32 [ %1, %2 ], [ %12, %11 ]
%6 = add nsw i32 %5, 1
ret i32 %6
7: ; preds = %2, %11
%8 = phi i32 [ %12, %11 ], [ %1, %2 ]
%9 = phi i32 [ %13, %11 ], [ %0, %2 ]
%10 = icmp eq i32 %8, 0
br i1 %10, label %11, label %15
11: ; preds = %7, %15
%12 = phi i32 [ %17, %15 ], [ 1, %7 ]
%13 = add nsw i32 %9, -1
%14 = icmp eq i32 %13, 0
br i1 %14, label %4, label %7
15: ; preds = %7
%16 = add nsw i32 %8, -1
%17 = tail call i32 @ackermann(i32 %9, i32 %16)
br label %11
}
/* Type definitions */
typedef int /*<<< orphan*/ text;

/* Variables and functions */
int /*<<< orphan*/ Com_sprintf(char *, int, char *, char *);
const char *G_GetStripEdString(char *refSection, char *refName) {
  static char text[1024] = {0};
  Com_sprintf(text, sizeof(text), "@@@%s", refName);
  return text;
}


x86 assembly (clang, -O0):
<G_GetStripEdString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    0x2f15(%rip),%rdi
mov    $0x400,%esi
lea    0xec9(%rip),%rdx
call   1030 <Com_sprintf@plt>
lea    0x2efd(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G_GetStripEdString>:
push   %rbx
mov    %rsi,%rcx
lea    0x2f25(%rip),%rbx
lea    0xede(%rip),%rdx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1030 <Com_sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@G_GetStripEdString.text = internal global [1024 x i8] zeroinitializer
@.str = [6 x i8] c"@@@%s\00"
define i8* @G_GetStripEdString(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @Com_sprintf(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @G_GetStripEdString.text, i64 0, i64 0), i32 1024, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @G_GetStripEdString.text, i64 0, i64 0)
}

LLVM IR (-O2):
@G_GetStripEdString.text = internal global [1024 x i8] zeroinitializer
@.str = [6 x i8] c"@@@%s\00"
define i8* @G_GetStripEdString(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @Com_sprintf(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @G_GetStripEdString.text, i64 0, i64 0), i32 1024, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @G_GetStripEdString.text, i64 0, i64 0)
}
void XDefaultVisual() {}


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

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

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

LLVM IR (-O2):
define void @XDefaultVisual() {
ret void
}
/* Variables and functions */
int gera_primo();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = gera_primo();
  printf("%d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <gera_primo@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebd(%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 <gera_primo@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ hd44780_function_set(int, int /*<<< orphan*/,
                                        int /*<<< orphan*/);
int /*<<< orphan*/ hd44780_ll_init_function_set();
int8_t hd44780_init(uint8_t display_is_2line, uint8_t display_font_5x11) {
  hd44780_ll_init_function_set();
  return (hd44780_function_set(1, display_is_2line, display_font_5x11));
}


x86 assembly (clang, -O0):
<hd44780_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <hd44780_ll_init_function_set@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x1,%edi
call   1030 <hd44780_function_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hd44780_init>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <hd44780_ll_init_function_set@plt>
mov    $0x1,%edi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <hd44780_function_set@plt>

LLVM IR (-O0):
define i32 @hd44780_init(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @hd44780_ll_init_function_set()
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @hd44780_function_set(i32 1, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @hd44780_init(i32 %0, i32 %1) {
%3 = tail call i32 (...) @hd44780_ll_init_function_set()
%4 = tail call i32 @hd44780_function_set(i32 1, i32 %0, i32 %1)
ret i32 %4
}
void ff_hevc_put_hevc_bi_w_epel_hv48_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_hv48_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ warnx(char *);
void zeroerror(void) { warnx("unit reduces to zero"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"unit reduces to zero\00"
define void @zeroerror() {
%1 = call i32 @warnx(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"unit reduces to zero\00"
define void @zeroerror() {
%1 = tail call i32 @warnx(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void mpFail(char *msg) {
  perror(msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<mpFail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<mpFail>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @mpFail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @mpFail(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int create_homotopy(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(152, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<create_homotopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x98,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_homotopy>:
mov    $0x98,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @create_homotopy() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 152, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @create_homotopy() {
%1 = tail call i32 @_ada_use_c2phc(i32 152, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ draw();
int /*<<< orphan*/ init();
int /*<<< orphan*/ load(char *);
int /*<<< orphan*/ run();
int main(int argc, char **argv) {
  init();
  load(argv[1]);
  draw();
  run();
  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)
mov    $0x0,%al
call   1050 <init@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <load@plt>
mov    $0x0,%al
call   1030 <draw@plt>
mov    $0x0,%al
call   1040 <run@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1050 <init@plt>
mov    0x8(%rbx),%rdi
call   1060 <load@plt>
xor    %eax,%eax
call   1030 <draw@plt>
xor    %eax,%eax
call   1040 <run@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @init()
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @load(i8* %9)
%11 = call i32 (...) @draw()
%12 = call i32 (...) @run()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @init()
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @load(i8* %5)
%7 = tail call i32 (...) @draw()
%8 = tail call i32 (...) @run()
ret i32 0
}
int syscall_thread_exit(void) {
  int a;
  __asm__ __volatile__("int $0x80" : "=a"(a) : "0"(0));
  return a;
}


x86 assembly (clang, -O0):
<syscall_thread_exit>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
int    $0x80
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall_thread_exit>:
xor    %eax,%eax
int    $0x80
ret

LLVM IR (-O0):
define i32 @syscall_thread_exit() {
%1 = alloca i32
%2 = call i32 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i32 0)
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @syscall_thread_exit() {
%1 = tail call i32 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int sancus_drl(long v, long a, long b) {
  assert((v >= a) && (v <= b));
  return (int)v;
}


x86 assembly (clang, -O0):
<sancus_drl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jl     1145 <sancus_drl+0x35>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
setle  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_drl>:
push   %rbx
mov    %rdi,%rbx
cmp    %rsi,%rdi
setge  %al
cmp    %rdx,%rdi
setle  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sancus_drl(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = icmp sge i64 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i64, i64* %4
%12 = load i64, i64* %6
%13 = icmp sle i64 %11, %12
br label %14
14: ; preds = %10, %3
%15 = phi i1 [ false, %3 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i64, i64* %4
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @sancus_drl(i64 %0, i64 %1, i64 %2) {
%4 = icmp sge i64 %0, %1
%5 = icmp sle i64 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = trunc i64 %0 to i32
ret i32 %9
}
/* Type definitions */
struct inhalt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close(struct inhalt *);
void close_plotter(struct inhalt *data) { close(data); }


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

x86 assembly (clang, -O2):
<close_plotter>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
%struct.inhalt = type { i32 }
define void @close_plotter(%struct.inhalt* %0) {
%2 = tail call i32 @close(%struct.inhalt* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void close_files(FILE *input, FILE *output) {
  fclose(input);
  fclose(output);
}


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

x86 assembly (clang, -O2):
<close_files>:
push   %rbx
mov    %rsi,%rbx
call   1030 <fclose@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @close_files(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @fclose(i32* %0)
%4 = tail call i32 @fclose(i32* %1)
ret void
}
const char *knh_getSystemEncoding(void) { return "UTF-8"; }


x86 assembly (clang, -O0):
<knh_getSystemEncoding>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<knh_getSystemEncoding>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"UTF-8\00"
define i8* @knh_getSystemEncoding() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"UTF-8\00"
define i8* @knh_getSystemEncoding() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
__attribute__((always_)) void check_trace_callback_type_kmem_cache_free(
    void (*cb)(void *__data, unsigned long call_site, const void *ptr)) {}


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

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

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

LLVM IR (-O2):
define void @check_trace_callback_type_kmem_cache_free(void (i8*, i64, i8*)* nocapture %0) {
ret void
}
int dotOmit() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @dotOmit() {
ret i32 1
}