xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
int error(char *error) {
  puts("Content-type: text/html\n");
  puts("An error occurred:");
  puts(error);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Content-type: text/html\0A\00"
@.str.1 = [19 x i8] c"An error occurred:\00"
define i32 @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 @puts(i8* %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"Content-type: text/html\0A\00"
@.str.1 = [19 x i8] c"An error occurred:\00"
define i32 @error(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) %0)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct kvm_sregs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ KVM_GET_SREGS;
int ioctl(int, int /*<<< orphan*/, struct kvm_sregs *);
int kvm_get_sregs(int fd, struct kvm_sregs *sregs) {
  return ioctl(fd, KVM_GET_SREGS, sregs);
}


x86 assembly (clang, -O0):
<kvm_get_sregs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kvm_get_sregs>:
mov    %rsi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
%struct.kvm_sregs = type { i32 }
@KVM_GET_SREGS = global i32 0
define i32 @kvm_get_sregs(i32 %0, %struct.kvm_sregs* %1) {
%3 = alloca i32
%4 = alloca %struct.kvm_sregs*
store i32 %0, i32* %3
store %struct.kvm_sregs* %1, %struct.kvm_sregs** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @KVM_GET_SREGS
%7 = load %struct.kvm_sregs*, %struct.kvm_sregs** %4
%8 = call i32 @ioctl(i32 %5, i32 %6, %struct.kvm_sregs* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.kvm_sregs = type { i32 }
@KVM_GET_SREGS = global i32 0
define i32 @kvm_get_sregs(i32 %0, %struct.kvm_sregs* %1) {
%3 = load i32, i32* @KVM_GET_SREGS
%4 = tail call i32 @ioctl(i32 %0, i32 %3, %struct.kvm_sregs* %1)
ret i32 %4
}
int main() {
  int a = 0;
  for (int i = 0; i < 1000; i++) {
    if (a > 500) {
      a += i;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    114f <main+0x4f>
cmpl   $0x1f4,-0x8(%rbp)
jle    113c <main+0x3c>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <main+0x41>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
puts(s) register char *s;
{
  register c;
  while (c = *s++)
    putchar(c);
  return (putchar('\n'));
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1149 <puts+0x39>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1030 <putchar@plt>
jmp    111c <puts+0xc>
mov    $0xa,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1135 <puts+0x25>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
mov    $0xa,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define i32 @puts(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
br label %4
4: ; preds = %10, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
store i32 %8, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load i32, i32* %3
%12 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %11)
br label %4
13: ; preds = %4
%14 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 10)
ret i32 %14
}

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 10)
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ modificarCalendario(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ mostrarCalendarioMes(int /*<<< orphan*/ *, char *, int,
                                        char *);
int main() {
  FILE *fich_calendar = NULL;
  modificarCalendario(fich_calendar, 1, 2017);
  mostrarCalendarioMes(fich_calendar, "Boby", 1, "2017");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x7e1,%edx
call   1030 <modificarCalendario@plt>
mov    -0x10(%rbp),%rdi
lea    0xeab(%rip),%rsi
mov    $0x1,%edx
lea    0xea4(%rip),%rcx
call   1040 <mostrarCalendarioMes@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x7e1,%edx
call   1030 <modificarCalendario@plt>
lea    0xec7(%rip),%rsi
lea    0xec5(%rip),%rcx
xor    %edi,%edi
mov    $0x1,%edx
call   1040 <mostrarCalendarioMes@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"Boby\00"
@.str.1 = [5 x i8] c"2017\00"
define i32 @main() {
%1 = tail call i32 @modificarCalendario(i32* null, i32 1, i32 2017)
%2 = tail call i32 @mostrarCalendarioMes(i32* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void hello(char *name) { printf("Hello %s\n", name); }


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

x86 assembly (clang, -O2):
<hello>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"Hello %s\0A\00"
define void @hello(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int ordenado(int n, int *v) {
  if (n <= 1)
    return 1;
  int a = v[n - 1] > v[n - 2] && ordenado(n - 1, v);
  return a;
}


x86 assembly (clang, -O0):
<ordenado>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1135 <ordenado+0x25>
movl   $0x1,-0x4(%rbp)
jmp    1189 <ordenado+0x79>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
movslq %eax,%rsi
xor    %eax,%eax
cmp    (%rdx,%rsi,4),%ecx
mov    %al,-0x15(%rbp)
jle    1178 <ordenado+0x68>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
call   1030 <ordenado@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ordenado>:
push   %rax
mov    $0x1,%eax
cmp    $0x2,%edi
jl     113b <ordenado+0x2b>
lea    -0x1(%rdi),%ecx
mov    (%rsi,%rcx,4),%edx
add    $0xfffffffe,%edi
xor    %eax,%eax
cmp    (%rsi,%rdi,4),%edx
jle    113b <ordenado+0x2b>
mov    %ecx,%edi
call   1030 <ordenado@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ordenado(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
%7 = load i32, i32* %4
%8 = icmp sle i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %34
10: ; preds = %2
%11 = load i32*, i32** %5
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %11, i64 %14
%16 = load i32, i32* %15
%17 = load i32*, i32** %5
%18 = load i32, i32* %4
%19 = sub nsw i32 %18, 2
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %17, i64 %20
%22 = load i32, i32* %21
%23 = icmp sgt i32 %16, %22
br i1 %23, label %24, label %30
24: ; preds = %10
%25 = load i32, i32* %4
%26 = sub nsw i32 %25, 1
%27 = load i32*, i32** %5
%28 = call i32 @ordenado(i32 %26, i32* %27)
%29 = icmp ne i32 %28, 0
br label %30
30: ; preds = %24, %10
%31 = phi i1 [ false, %10 ], [ %29, %24 ]
%32 = zext i1 %31 to i32
store i32 %32, i32* %6
%33 = load i32, i32* %6
store i32 %33, i32* %3
br label %34
34: ; preds = %30, %9
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @ordenado(i32 %0, i32* nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = add nsw i32 %0, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %1, i64 %6
%8 = load i32, i32* %7
%9 = add nsw i32 %0, -2
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = icmp sgt i32 %8, %12
br i1 %13, label %16, label %14
14: ; preds = %2, %4, %16
%15 = phi i32 [ %19, %16 ], [ 1, %2 ], [ 0, %4 ]
ret i32 %15
16: ; preds = %4
%17 = tail call i32 @ordenado(i32 %5, i32* %1)
%18 = icmp ne i32 %17, 0
%19 = zext i1 %18 to i32
br label %14
}
void MM_ShowMemory() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x02\00"
define void @t_isalnum_0x02() {
%1 = tail call i64 @isalnum(i32 2)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 15, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_FDuint8_reg(unsigned char val) {
  return ((val) & (-0xFD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FDuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff03,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_FDuint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -253
%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_FDuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 3
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ VIDEC_HEADER_EXT_GET_KEYFRAME(void const *);
unsigned short VIDEC_HEADER_EXT_GET_LEN(const void *p) {
  if (VIDEC_HEADER_EXT_GET_KEYFRAME(p)) {
    return 16;
  }
  return 8;
}


x86 assembly (clang, -O0):
<VIDEC_HEADER_EXT_GET_LEN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <VIDEC_HEADER_EXT_GET_KEYFRAME@plt>
cmp    $0x0,%rax
je     113a <VIDEC_HEADER_EXT_GET_LEN+0x2a>
movw   $0x10,-0x2(%rbp)
jmp    1140 <VIDEC_HEADER_EXT_GET_LEN+0x30>
movw   $0x8,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIDEC_HEADER_EXT_GET_LEN>:
push   %rax
call   1030 <VIDEC_HEADER_EXT_GET_KEYFRAME@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0x8(,%rcx,8),%eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @VIDEC_HEADER_EXT_GET_LEN(i8* %0) {
%2 = alloca i16
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @VIDEC_HEADER_EXT_GET_KEYFRAME(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i16 16, i16* %2
br label %9
8: ; preds = %1
store i16 8, i16* %2
br label %9
9: ; preds = %8, %7
%10 = load i16, i16* %2
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @VIDEC_HEADER_EXT_GET_LEN(i8* %0) {
%2 = tail call i64 @VIDEC_HEADER_EXT_GET_KEYFRAME(i8* %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i16 8, i16 16
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ parse_alias(char *);
int /*<<< orphan*/ show_aliases();
char *skipspace(char *);
void cmd_alias(char *arg) {
  arg = skipspace(arg);
  if (!*arg)
    show_aliases();
  else
    parse_alias(arg);
}


x86 assembly (clang, -O0):
<cmd_alias>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <skipspace@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1162 <cmd_alias+0x32>
mov    $0x0,%al
call   1030 <show_aliases@plt>
jmp    116b <cmd_alias+0x3b>
mov    -0x8(%rbp),%rdi
call   1040 <parse_alias@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_alias>:
push   %rax
call   1050 <skipspace@plt>
cmpb   $0x0,(%rax)
je     1144 <cmd_alias+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1040 <parse_alias@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <show_aliases@plt>

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

LLVM IR (-O2):
define void @cmd_alias(i8* %0) {
%2 = tail call i8* @skipspace(i8* %0)
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @show_aliases()
br label %9
7: ; preds = %1
%8 = tail call i32 @parse_alias(i8* %2)
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
scalar_t__ klock_getT2();
int getTIssue(int x) {
  int *a, *b;
  if (x > 20) {
    a = (int *)klock_getT2();
    *b = 92;
  } else {
    *a = 49;
    b = (int *)klock_getT2();
  }
  int c = *a - *b;
  return c;
}


x86 assembly (clang, -O0):
<getTIssue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x14,-0x4(%rbp)
jle    113f <getTIssue+0x2f>
mov    $0x0,%al
call   1030 <klock_getT2@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x5c,(%rax)
jmp    1154 <getTIssue+0x44>
mov    -0x10(%rbp),%rax
movl   $0x31,(%rax)
mov    $0x0,%al
call   1030 <klock_getT2@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
sub    (%rcx),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTIssue>:
push   %rax
xor    %eax,%eax
call   1030 <klock_getT2@plt>

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

LLVM IR (-O2):
define i32 @getTIssue(i32 %0) {
%2 = icmp sgt i32 %0, 20
tail call void @llvm.assume(i1 %2)
%3 = tail call i64 (...) @klock_getT2()
unreachable
}
int compareInts(void *value1, void *value2) {
  int *intPtr1, *intPtr2;
  intPtr1 = (int *)value1;
  intPtr2 = (int *)value2;
  return (*intPtr1 - *intPtr2);
}


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

x86 assembly (clang, -O2):
<compareInts>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compareInts(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @compareInts(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char *, struct stat *);
int file_exists(char *filename) {
  struct stat st;
  int result = stat(filename, &st);
  return result;
}


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

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @stat(i8* %5, %struct.stat* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
ret i32 %4
}
hboxfit_(l, h, nchars) float *l, *h;
int *nchars;
{ hboxfit(*l, *h, *nchars); }


x86 assembly (clang, -O0):
<hboxfit_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
mov    $0x2,%al
call   1030 <hboxfit@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hboxfit_>:
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%rsi),%xmm1
cvtss2sd %xmm1,%xmm1
mov    (%rdx),%edi
mov    $0x2,%al
jmp    1030 <hboxfit@plt>

LLVM IR (-O0):
define i32 @hboxfit_(float* %0, float* %1, i32* %2) {
%4 = alloca i32
%5 = alloca float*
%6 = alloca float*
%7 = alloca i32*
store float* %0, float** %5
store float* %1, float** %6
store i32* %2, i32** %7
%8 = load float*, float** %5
%9 = load float, float* %8
%10 = fpext float %9 to double
%11 = load float*, float** %6
%12 = load float, float* %11
%13 = fpext float %12 to double
%14 = load i32*, i32** %7
%15 = load i32, i32* %14
%16 = call i32 (double, double, i32, ...) bitcast (i32 (...)* @hboxfit to i32 (double, double, i32, ...)*)(double %10, double %13, i32 %15)
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @hboxfit_(float* nocapture %0, float* nocapture %1, i32* nocapture %2) {
%4 = load float, float* %0
%5 = fpext float %4 to double
%6 = load float, float* %1
%7 = fpext float %6 to double
%8 = load i32, i32* %2
%9 = tail call i32 (double, double, i32, ...) bitcast (i32 (...)* @hboxfit to i32 (double, double, i32, ...)*)(double %5, double %7, i32 %8)
ret i32 undef
}
unsigned long long int
unsignedlonglongint_ignoring_signedchar(unsigned long long int x,
                                        signed char y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedlonglongint_ignoring_signedchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedlonglongint_ignoring_signedchar>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @unsignedlonglongint_ignoring_signedchar(i64 %0, i8 signext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlonglongint_ignoring_signedchar(i64 returned %0, i8 signext %1) {
ret i64 %0
}
/* Variables and functions */
double sqrt(double);
double circle_equation(double x) {
  return 0.5 - sqrt(0.25 - ((x - 0.5) * (x - 0.5)));
}


x86 assembly (clang, -O0):
<circle_equation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xec5(%rip),%xmm2
subsd  %xmm2,%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xea6(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xe8a(%rip),%xmm0
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circle_equation>:
push   %rax
movapd %xmm0,%xmm1
addsd  0xee3(%rip),%xmm1
mulsd  %xmm1,%xmm1
movsd  0xedf(%rip),%xmm0
subsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     113d <circle_equation+0x2d>
sqrtsd %xmm0,%xmm0
jmp    1142 <circle_equation+0x32>
call   1030 <sqrt@plt>
movsd  0xec6(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @circle_equation(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 5.000000e-01
%5 = load double, double* %2
%6 = fsub double %5, 5.000000e-01
%7 = fneg double %4
%8 = call double @llvm.fmuladd.f64(double %7, double %6, double 2.500000e-01)
%9 = call double @sqrt(double %8)
%10 = fsub double 5.000000e-01, %9
ret double %10
}

LLVM IR (-O2):
define double @circle_equation(double %0) {
%2 = fadd double %0, -5.000000e-01
%3 = fneg double %2
%4 = tail call double @llvm.fmuladd.f64(double %3, double %2, double 2.500000e-01)
%5 = tail call double @sqrt(double %4)
%6 = fsub double 5.000000e-01, %5
ret double %6
}
/* Variables and functions */
scalar_t__ getline_(char *, int);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ remove_(char *);
int main() {
  char line[256];
  while (getline_(line, 256) > 0) {
    if (remove_(line) > 0)
      printf("%s", line);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
mov    $0x100,%esi
call   1050 <getline_@plt>
cmp    $0x0,%rax
jle    118b <main+0x5b>
lea    -0x110(%rbp),%rdi
call   1040 <remove_@plt>
cmp    $0x0,%rax
jle    1186 <main+0x56>
lea    -0x110(%rbp),%rsi
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <main+0x12>
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rsp,%rdi
mov    $0x100,%esi
call   1050 <getline_@plt>
test   %rax,%rax
jle    118c <main+0x5c>
mov    %rsp,%rbx
lea    0xeaa(%rip),%r14
jmp    1172 <main+0x42>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x100,%esi
call   1050 <getline_@plt>
test   %rax,%rax
jle    118c <main+0x5c>
mov    %rbx,%rdi
call   1040 <remove_@plt>
test   %rax,%rax
jle    1160 <main+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1160 <main+0x30>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %14, %0
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = call i64 @getline_(i8* %4, i32 256)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %3
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%9 = call i64 @remove_(i8* %8)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %7
br label %3
15: ; preds = %3
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i64 @getline_(i8* %2, i32 256)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = call i64 @remove_(i8* %2)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i64 @getline_(i8* %2, i32 256)
%12 = icmp sgt i64 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
void dobutts(union { int meter; } m) { printf("%d", m.meter); }


x86 assembly (clang, -O0):
<dobutts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dobutts>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
%union.anon = type { i32 }
@.str = [3 x i8] c"%d\00"
define void @dobutts(i32 %0) {
%2 = alloca %union.anon
%3 = getelementptr inbounds %union.anon, %union.anon* %2, i32 0, i32 0
store i32 %0, i32* %3
%4 = bitcast %union.anon* %2 to i32*
%5 = load i32, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @dobutts(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
struct drm_scatter_gather {
  int dummy;
};
struct drm_file {
  int dummy;
};
struct drm_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ DRM_DEBUG(char *);
int drm_sg_alloc(struct drm_device *, struct drm_scatter_gather *);
int drm_sg_alloc_ioctl(struct drm_device *dev, void *data,
                       struct drm_file *file_priv) {
  struct drm_scatter_gather *request = data;
  DRM_DEBUG("\n");
  return (drm_sg_alloc(dev, request));
}


x86 assembly (clang, -O0):
<drm_sg_alloc_ioctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    0xebd(%rip),%rdi
call   1040 <DRM_DEBUG@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <drm_sg_alloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drm_sg_alloc_ioctl>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1040 <DRM_DEBUG@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <drm_sg_alloc@plt>

LLVM IR (-O0):
%struct.drm_device = type { i32 }
%struct.drm_file = type { i32 }
%struct.drm_scatter_gather = type { i32 }
@.str = [2 x i8] c"\0A\00"
define i32 @drm_sg_alloc_ioctl(%struct.drm_device* %0, i8* %1, %struct.drm_file* %2) {
%4 = alloca %struct.drm_device*
%5 = alloca i8*
%6 = alloca %struct.drm_file*
%7 = alloca %struct.drm_scatter_gather*
store %struct.drm_device* %0, %struct.drm_device** %4
store i8* %1, i8** %5
store %struct.drm_file* %2, %struct.drm_file** %6
%8 = load i8*, i8** %5
%9 = bitcast i8* %8 to %struct.drm_scatter_gather*
store %struct.drm_scatter_gather* %9, %struct.drm_scatter_gather** %7
%10 = call i32 @DRM_DEBUG(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = load %struct.drm_device*, %struct.drm_device** %4
%12 = load %struct.drm_scatter_gather*, %struct.drm_scatter_gather** %7
%13 = call i32 @drm_sg_alloc(%struct.drm_device* %11, %struct.drm_scatter_gather* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.drm_device = type { i32 }
%struct.drm_file = type { i32 }
%struct.drm_scatter_gather = type { i32 }
@.str = [2 x i8] c"\0A\00"
define i32 @drm_sg_alloc_ioctl(%struct.drm_device* %0, i8* %1, %struct.drm_file* nocapture readnone %2) {
%4 = bitcast i8* %1 to %struct.drm_scatter_gather*
%5 = tail call i32 @DRM_DEBUG(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @drm_sg_alloc(%struct.drm_device* %0, %struct.drm_scatter_gather* %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_pop_af(void) { op_write1(0xf1); }


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

x86 assembly (clang, -O2):
<op_enc_pop_af>:
mov    $0xf1,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_pop_af() {
%1 = call i32 @op_write1(i32 241)
ret void
}

LLVM IR (-O2):
define void @op_enc_pop_af() {
%1 = tail call i32 @op_write1(i32 241)
ret void
}
int op_shl(int a, int b) { return a << b; }


x86 assembly (clang, -O0):
<op_shl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_shl>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @op_shl(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void uDMAErrorStatusClear(void) { (*((volatile uint32_t *)(0x400FF04C))) = 1; }


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

x86 assembly (clang, -O2):
<uDMAErrorStatusClear>:
movl   $0x1,0x400ff04c
ret

LLVM IR (-O0):
define void @uDMAErrorStatusClear() {
store volatile i32 1, i32* inttoptr (i64 1074786380 to i32*)
ret void
}

LLVM IR (-O2):
define void @uDMAErrorStatusClear() {
store volatile i32 1, i32* inttoptr (i64 1074786380 to i32*)
ret void
}
unsigned long get32bit(unsigned char *buf) {
  return (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | (buf[3]);
}


x86 assembly (clang, -O0):
<get32bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<get32bit>:
movzbl (%rdi),%eax
shl    $0x18,%eax
movzbl 0x1(%rdi),%ecx
shl    $0x10,%rcx
cltq
or     %rcx,%rax
movzbl 0x2(%rdi),%ecx
shl    $0x8,%rcx
or     %rax,%rcx
movzbl 0x3(%rdi),%eax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @get32bit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = or i32 %19, %23
%25 = sext i32 %24 to i64
ret i64 %25
}

LLVM IR (-O2):
define i64 @get32bit(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
%19 = sext i32 %18 to i64
ret i64 %19
}
/* Variables and functions */
int /*<<< orphan*/ write_log();
int main() {
  write_log();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @write_log()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int f2(int a) {
  char *str = "hello, testsuite";
  puts(str);
  return ++a;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
add    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"hello, testsuite\00"
define i32 @f2(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @puts(i8* %4)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@.str = [17 x i8] c"hello, testsuite\00"
define i32 @f2(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = add nsw i32 %0, 1
ret i32 %3
}
int Seccomp_isWorking() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Seccomp_isWorking() {
ret i32 0
}
unsigned char bin2bcd(unsigned char x) {
  return ((((x) / 10) << 4) + (x) % 10);
}


x86 assembly (clang, -O0):
<bin2bcd>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
shl    $0x4,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
add    %edx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bin2bcd>:
mov    %edi,%eax
imul   $0xcd,%edi,%ecx
shr    $0xb,%ecx
mov    %ecx,%edx
shl    $0x4,%dl
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
or     %dl,%al
ret

LLVM IR (-O0):
define zeroext i8 @bin2bcd(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = sdiv i32 %4, 10
%6 = shl i32 %5, 4
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = srem i32 %8, 10
%10 = add nsw i32 %6, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @bin2bcd(i8 zeroext %0) {
%2 = udiv i8 %0, 10
%3 = shl i8 %2, 4
%4 = urem i8 %0, 10
%5 = or i8 %3, %4
ret i8 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
int streamoutput(char *buf, int sze, void *data) {
  FILE *outp;
  outp = (FILE *)data;
  fwrite(buf, sze, 1, outp);
  return 0;
}


x86 assembly (clang, -O0):
<streamoutput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fwrite@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<streamoutput>:
push   %rax
mov    %rdx,%rcx
mov    $0x1,%edx
call   1030 <fwrite@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @streamoutput(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %7
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = load i32*, i32** %7
%13 = call i32 @fwrite(i8* %10, i32 %11, i32 1, i32* %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @streamoutput(i8* nocapture %0, i32 %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32*
%5 = tail call i32 @fwrite(i8* %0, i32 %1, i32 1, i32* %4)
ret i32 0
}
/* Variables and functions */
double sqrt(double);
double mag(double v[3]) {
  return sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
}


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

x86 assembly (clang, -O2):
<mag>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1141 <mag+0x31>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @mag(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fmul double %11, %14
%16 = call double @llvm.fmuladd.f64(double %5, double %8, double %15)
%17 = load double*, double** %2
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = call double @llvm.fmuladd.f64(double %19, double %22, double %16)
%24 = call double @sqrt(double %23)
ret double %24
}

LLVM IR (-O2):
define double @mag(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %6)
%10 = tail call double @sqrt(double %9)
ret double %10
}
int _check_size(int x) {
  if (x % 2 == 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<_check_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1127 <_check_size+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <_check_size+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_size>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
and    $0xfffffffe,%eax
sub    %eax,%edi
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @_check_size(i32 %0) {
%2 = srem i32 %0, 2
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
void foo131() {}


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

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

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

LLVM IR (-O2):
define void @foo131() {
ret void
}
int graphPtscotch() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @graphPtscotch() {
ret i32 0
}
void kolibri_set_scroll(struct gui_window *g, int sx, int sy) {}


x86 assembly (clang, -O0):
<kolibri_set_scroll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.gui_window = type opaque
define void @kolibri_set_scroll(%struct.gui_window* %0, i32 %1, i32 %2) {
%4 = alloca %struct.gui_window*
%5 = alloca i32
%6 = alloca i32
store %struct.gui_window* %0, %struct.gui_window** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.gui_window = type opaque
define void @kolibri_set_scroll(%struct.gui_window* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_int(int d) { printf("%4d", d); }


x86 assembly (clang, -O0):
<print_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_int>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%4d\00"
define void @print_int(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int main(int argc, char *argv[]) {
  argv[0] = "Hello.\n";
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0xee3(%rip),%rcx
mov    %rcx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xef9(%rip),%rax
mov    %rax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Hello.\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 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %7
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"Hello.\0A\00"
define i32 @main(i32 %0, i8** nocapture writeonly %1) {
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %1
ret i32 0
}