xunge/DecIR huggingface dataset:
void rpush() {
  asm volatile("leaq 0x01234567(%%rip), %%rax\n\t"
               "pushq %%rax\n\t" ::
                   :);
}


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

x86 assembly (clang, -O2):
<rpush>:
lea    0x1234567(%rip),%rax
push   %rax
ret

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

LLVM IR (-O2):
define void @rpush() {
tail call void asm sideeffect "leaq 0x01234567(%rip), %rax\0A\09pushq %rax\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int close(int fd) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @close(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lprcat(char *);
void iopts(void) { lprcat(", or (i) ignore it? "); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c", or (i) ignore it? \00"
define void @iopts() {
%1 = call i32 @lprcat(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c", or (i) ignore it? \00"
define void @iopts() {
%1 = tail call i32 @lprcat(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void free_memory(int *mem) { free(mem); }


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

x86 assembly (clang, -O2):
<free_memory>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_memory(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ err_sys(char *);
int read(int, void *, size_t);
ssize_t Read(int fd, void *ptr, size_t nbytes) {
  ssize_t n;
  if ((n = read(fd, ptr, nbytes)) == -1)
    err_sys("read error");
  return (n);
}


x86 assembly (clang, -O0):
<Read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <read@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
jne    115b <Read+0x3b>
lea    0xeaa(%rip),%rdi
call   1030 <err_sys@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Read>:
push   %rbx
call   1040 <read@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1139 <Read+0x19>
lea    0xecc(%rip),%rdi
call   1030 <err_sys@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"read error\00"
define i32 @Read(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @err_sys(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assume(char *);
int /*<<< orphan*/ free(char *);
char *malloc(int);
void really(void) {
  int i;
  char *p = malloc(10);
  __ESBMC_assume(p);
  for (i = 0; i < 1; i++)
    p[i] = 'z';
  free(p);
  p = malloc(10);
  __ESBMC_assume(p);
  p[2] = 'z';
  free(p);
}


x86 assembly (clang, -O0):
<really>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <__ESBMC_assume@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    117a <really+0x4a>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movb   $0x7a,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <really+0x26>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <__ESBMC_assume@plt>
mov    -0x10(%rbp),%rax
movb   $0x7a,0x2(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<really>:
push   %rbx
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <__ESBMC_assume@plt>
movb   $0x7a,(%rbx)
mov    %rbx,%rdi
call   1030 <free@plt>
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <__ESBMC_assume@plt>
movb   $0x7a,0x2(%rbx)
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @really() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call i32 @__ESBMC_assume(i8* %1)
store i8 122, i8* %1
%3 = tail call i32 @free(i8* %1)
%4 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%5 = tail call i32 @__ESBMC_assume(i8* %4)
%6 = getelementptr inbounds i8, i8* %4, i64 2
store i8 122, i8* %6
%7 = tail call i32 @free(i8* %4)
ret void
}
/* Type definitions */
typedef unsigned int uint;

/* Variables and functions */
int /*<<< orphan*/ isdigit(char);
uint declen(char *str) {
  unsigned int sum = 0;
  while (1) {
    char chh = *str;
    if (!isdigit(chh))
      break;
    str++;
    sum++;
  }
  return (sum);
}


x86 assembly (clang, -O0):
<declen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1143 <declen+0x33>
jmp    115d <declen+0x4d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <declen+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<declen>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0xffffffff,%ebp
nopl   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <isdigit@plt>
add    $0x1,%rbx
add    $0x1,%ebp
test   %eax,%eax
jne    1120 <declen+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @declen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8
store i8* %0, i8** %2
store i32 0, i32* %3
br label %5
5: ; preds = %1, %12
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
store i8 %7, i8* %4
%8 = load i8, i8* %4
%9 = call i32 @isdigit(i8 signext %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %5
br label %17
12: ; preds = %5
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %2
%15 = load i32, i32* %3
%16 = add i32 %15, 1
store i32 %16, i32* %3
br label %5
17: ; preds = %11
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @declen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %9, %2 ]
%4 = phi i8* [ %0, %1 ], [ %8, %2 ]
%5 = load i8, i8* %4
%6 = tail call i32 @isdigit(i8 signext %5)
%7 = icmp eq i32 %6, 0
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = add i32 %3, 1
br i1 %7, label %10, label %2
10: ; preds = %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int wp_log2(int /*<<< orphan*/);
int wp_log2s(int32_t value) {
  return (value < 0) ? -wp_log2(-value) : wp_log2(value);
}


x86 assembly (clang, -O0):
<wp_log2s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    113d <wp_log2s+0x2d>
xor    %edi,%edi
sub    -0x4(%rbp),%edi
call   1030 <wp_log2@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    1148 <wp_log2s+0x38>
mov    -0x4(%rbp),%edi
call   1030 <wp_log2@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wp_log2s>:
test   %edi,%edi
js     1119 <wp_log2s+0x9>
jmp    1030 <wp_log2@plt>
push   %rax
neg    %edi
call   1030 <wp_log2@plt>
neg    %eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @wp_log2s(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sub nsw i32 0, %0
%5 = tail call i32 @wp_log2(i32 %4)
%6 = sub nsw i32 0, %5
br label %9
7: ; preds = %1
%8 = tail call i32 @wp_log2(i32 %0)
br label %9
9: ; preds = %7, %3
%10 = phi i32 [ %6, %3 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x4c() {
  Assert_real((isbdigit(76) == 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_isbdigit.c",
              385, ("isbdigit should be 0 for L"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x4c>:
push   %rax
mov    $0x4c,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x181,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for L\00"
define void @t_isbdigit_0x4c() {
%1 = call i64 @isbdigit(i32 76)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 385, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for L\00"
define void @t_isbdigit_0x4c() {
%1 = tail call i64 @isbdigit(i32 76)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 385, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int ultra = 0, super = 0;
  while (super < 5) {
    super++;
    ++ultra;
    printf("super = %d, ultra = %d \n", super, ultra);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1160 <main+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"super = %d, ultra = %d \0A\00"
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 = %7, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
br label %4
15: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"super = %d, ultra = %d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 1, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 2, i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 3, i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 4, i32 4)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 5, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void hash_free(void *hash) { free(hash); }


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

x86 assembly (clang, -O2):
<hash_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @hash_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void write_footer(FILE *stream) {
  fprintf(stream, "grestore\t%% Restore previous graphic state\n");
}


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

x86 assembly (clang, -O2):
<write_footer>:
lea    0xee9(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"grestore\09%% Restore previous graphic state\0A\00"
define void @write_footer(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"grestore\09%% Restore previous graphic state\0A\00"
define void @write_footer(i32* nocapture %0) {
%2 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *, char *);
void panic(char *str) {
  printk("Kernel panic:%s\n", str);
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printk@plt>
jmp    112c <panic+0x1c>

x86 assembly (clang, -O2):
<panic>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printk@plt>
jmp    1120 <panic+0x10>

LLVM IR (-O0):
@.str = [17 x i8] c"Kernel panic:%s\0A\00"
define void @panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printk(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %5
5: ; preds = %5, %1
br label %5
}

LLVM IR (-O2):
@.str = [17 x i8] c"Kernel panic:%s\0A\00"
define void @panic(i8* %0) {
%2 = tail call i32 @printk(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %3
3: ; preds = %3, %1
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ handle_POLL(int /*<<< orphan*/);
int gen_POLL(void) {
  handle_POLL(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @gen_POLL() {
%1 = tail call i32 @handle_POLL(i32 0)
ret i32 0
}
/* Variables and functions */
int createQueryURL(char const *, int, char const *, char *, int, char const **,
                   char const **, char **);
int createUrlForGetFileStatus(const char *host, int nnPort, const char *path,
                              const char *user, char **url) {
  const char *userPara = "user.name";
  return createQueryURL(host, nnPort, path, "GETFILESTATUS", 1, &userPara,
                        &user, url);
}


x86 assembly (clang, -O0):
<createUrlForGetFileStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
lea    0xece(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rax
lea    0xebe(%rip),%rcx
mov    $0x1,%r8d
lea    -0x30(%rbp),%r9
lea    -0x20(%rbp),%r10
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <createQueryURL@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createUrlForGetFileStatus>:
sub    $0x18,%rsp
mov    %r8,%rax
mov    %rcx,0x10(%rsp)
lea    0xedd(%rip),%rcx
mov    %rcx,0x8(%rsp)
lea    0x10(%rsp),%r10
lea    0xed6(%rip),%rcx
lea    0x8(%rsp),%r9
mov    $0x1,%r8d
push   %rax
push   %r10
call   1030 <createQueryURL@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"user.name\00"
@.str.1 = [14 x i8] c"GETFILESTATUS\00"
define i32 @createUrlForGetFileStatus(i8* %0, i32 %1, i8* %2, i8* %3, i8** %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8**
%11 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8** %4, i8*** %10
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %11
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = load i8*, i8** %8
%15 = load i8**, i8*** %10
%16 = call i32 @createQueryURL(i8* %12, i32 %13, i8* %14, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 1, i8** %11, i8** %9, i8** %15)
ret i32 %16
}

LLVM IR (-O2):
@.str = [10 x i8] c"user.name\00"
@.str.1 = [14 x i8] c"GETFILESTATUS\00"
define i32 @createUrlForGetFileStatus(i8* %0, i32 %1, i8* %2, i8* %3, i8** %4) {
%6 = alloca i8*
%7 = alloca i8*
store i8* %3, i8** %6
%8 = bitcast i8** %7 to i8*
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %7
%9 = call i32 @createQueryURL(i8* %0, i32 %1, i8* %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 1, i8** %7, i8** %6, i8** %4)
ret i32 %9
}
void glGetAttachedShaders(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetAttachedShaders() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int read_dobldobl_start_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(233, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<read_dobldobl_start_system>:
mov    $0xe9,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @read_dobldobl_start_system() {
%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 233, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @read_dobldobl_start_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 233, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void clntudp_abort(void) {}


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

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

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

LLVM IR (-O2):
define void @clntudp_abort() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NEG();
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_ED_0x7c(void) {
  NEG();
  T_WAIT_UNTIL(4);
  return;
}


x86 assembly (clang, -O0):
<op_ED_0x7c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <NEG@plt>
mov    $0x4,%edi
call   1030 <T_WAIT_UNTIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_ED_0x7c>:
push   %rax
xor    %eax,%eax
call   1040 <NEG@plt>
mov    $0x4,%edi
pop    %rax
jmp    1030 <T_WAIT_UNTIL@plt>

LLVM IR (-O0):
define void @op_ED_0x7c() {
%1 = call i32 (...) @NEG()
%2 = call i32 @T_WAIT_UNTIL(i32 4)
ret void
}

LLVM IR (-O2):
define void @op_ED_0x7c() {
%1 = tail call i32 (...) @NEG()
%2 = tail call i32 @T_WAIT_UNTIL(i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int SensorActError(char *str) {
  fprintf(stderr, "%s\n", str);
  fprintf(stderr, "%s\n", "Exiting...");
  exit(1);
}


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

x86 assembly (clang, -O2):
<SensorActError>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rdx
mov    0x2eb2(%rip),%rbx
mov    (%rbx),%edi
lea    0xec9(%rip),%r14
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xebc(%rip),%rdx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [11 x i8] c"Exiting...\00"
define i32 @SensorActError(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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [11 x i8] c"Exiting...\00"
define i32 @SensorActError(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}
char *strchr(char *s, const int c) {
  if (!s)
    return ((void *)0);
  while (*s++)
    if (*s == c)
      return s;
  return ((void *)0);
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1123 <strchr+0x23>
movq   $0x0,-0x8(%rbp)
jmp    116a <strchr+0x6a>
jmp    1128 <strchr+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
je     1162 <strchr+0x62>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    115d <strchr+0x5d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116a <strchr+0x6a>
jmp    1128 <strchr+0x28>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
test   %rdi,%rdi
je     1121 <strchr+0x21>
mov    %rdi,%rax
mov    (%rdi),%cl
nopw   0x0(%rax,%rax,1)
test   %cl,%cl
je     1121 <strchr+0x21>
movsbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    %esi,%ecx
jne    1110 <strchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = load i8, i8* %0
br label %6
6: ; preds = %4, %11
%7 = phi i8 [ %5, %4 ], [ %12, %11 ]
%8 = phi i8* [ %0, %4 ], [ %9, %11 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = icmp eq i8 %7, 0
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = load i8, i8* %9
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, %1
br i1 %14, label %15, label %6
15: ; preds = %6, %11, %2
%16 = phi i8* [ null, %2 ], [ null, %6 ], [ %9, %11 ]
ret i8* %16
}
void makekey(key, name, domain) register char *key;
register char *name;
register char *domain;
{
  while ((*key++ = *name++))
    ;
  *(key - 1) = '.';
  while ((*key++ = *domain++))
    ;
}


x86 assembly (clang, -O0):
<makekey>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113f <makekey+0x3f>
jmp    1110 <makekey+0x10>
mov    -0x8(%rbp),%rax
movb   $0x2e,-0x1(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1176 <makekey+0x76>
jmp    1147 <makekey+0x47>
pop    %rbp
ret

x86 assembly (clang, -O2):
<makekey>:
movzbl (%rsi),%eax
add    $0x1,%rsi
mov    %al,(%rdi)
add    $0x1,%rdi
test   %al,%al
jne    1100 <makekey>
movb   $0x2e,-0x1(%rdi)
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
movzbl (%rdx,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1120 <makekey+0x20>
ret

LLVM IR (-O0):
define void @makekey(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
br label %7
7: ; preds = %14, %3
%8 = load i8*, i8** %5
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %5
%10 = load i8, i8* %8
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %4
store i8 %10, i8* %11
%13 = icmp ne i8 %10, 0
br i1 %13, label %14, label %15
14: ; preds = %7
br label %7
15: ; preds = %7
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 -1
store i8 46, i8* %17
br label %18
18: ; preds = %25, %15
%19 = load i8*, i8** %6
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %6
%21 = load i8, i8* %19
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %4
store i8 %21, i8* %22
%24 = icmp ne i8 %21, 0
br i1 %24, label %25, label %26
25: ; preds = %18
br label %18
26: ; preds = %18
ret void
}

LLVM IR (-O2):
define void @makekey(i8* nocapture writeonly %0, i8* nocapture %1, i8* nocapture %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i8* [ %0, %3 ], [ %9, %4 ]
%6 = phi i8* [ %1, %3 ], [ %7, %4 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %6
%9 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %8, i8* %5
%10 = icmp eq i8 %8, 0
br i1 %10, label %11, label %4
11: ; preds = %4
store i8 46, i8* %5
br label %12
12: ; preds = %12, %11
%13 = phi i8* [ %9, %11 ], [ %17, %12 ]
%14 = phi i8* [ %2, %11 ], [ %15, %12 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %14
%17 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %16, i8* %13
%18 = icmp eq i8 %16, 0
br i1 %18, label %19, label %12
19: ; preds = %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ update_pf_paramsLP_par(int, int /*<<< orphan*/ *);
void update_pf_paramsLP(int length) { update_pf_paramsLP_par(length, NULL); }


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

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

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

LLVM IR (-O2):
define void @update_pf_paramsLP(i32 %0) {
%2 = tail call i32 @update_pf_paramsLP_par(i32 %0, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned int);
void mov_reg32_preg32(unsigned int reg1, unsigned int reg2) {
  put8(0x8B);
  put8((reg1 << 3) | reg2);
}


x86 assembly (clang, -O0):
<mov_reg32_preg32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x8b,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     -0x8(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_reg32_preg32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x8b,%edi
call   1030 <put8@plt>
shl    $0x3,%ebp
or     %ebx,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @mov_reg32_preg32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 139)
%6 = load i32, i32* %3
%7 = shl i32 %6, 3
%8 = load i32, i32* %4
%9 = or i32 %7, %8
%10 = call i32 @put8(i32 %9)
ret void
}

LLVM IR (-O2):
define void @mov_reg32_preg32(i32 %0, i32 %1) {
%3 = tail call i32 @put8(i32 139)
%4 = shl i32 %0, 3
%5 = or i32 %4, %1
%6 = tail call i32 @put8(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_screen();
int /*<<< orphan*/ gdt_install();
void kmain(void) {
  clear_screen();
  gdt_install();
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<kmain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <clear_screen@plt>
mov    $0x0,%al
call   1030 <gdt_install@plt>
jmp    1132 <kmain+0x12>

x86 assembly (clang, -O2):
<kmain>:
push   %rax
xor    %eax,%eax
call   1040 <clear_screen@plt>
xor    %eax,%eax
call   1030 <gdt_install@plt>
nop
jmp    1130 <kmain+0x10>

LLVM IR (-O0):
define void @kmain() {
%1 = call i32 (...) @clear_screen()
%2 = call i32 (...) @gdt_install()
br label %3
3: ; preds = %3, %0
br label %3
}

LLVM IR (-O2):
define void @kmain() {
%1 = tail call i32 (...) @clear_screen()
%2 = tail call i32 (...) @gdt_install()
br label %3
3: ; preds = %3, %0
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ foo(float, int, int);
int main() {
  foo(11.4f, 25, 60);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xec9(%rip),%xmm0
mov    $0x19,%edi
mov    $0x3c,%esi
call   1030 <foo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xed7(%rip),%xmm0
mov    $0x19,%edi
mov    $0x3c,%esi
call   1030 <foo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(float 0x4026CCCCC0000000, i32 25, i32 60)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(float 0x4026CCCCC0000000, i32 25, i32 60)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int crlf(char *);
int nl(char);
int eol(char *s) { return crlf(s) | nl(s[0]) | !s[0]; }


x86 assembly (clang, -O0):
<eol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <crlf@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <nl@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
cmpb   $0x0,(%rcx)
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eol>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <crlf@plt>
mov    %eax,%ebp
movsbl (%rbx),%edi
call   1030 <nl@plt>
or     %ebp,%eax
xor    %ecx,%ecx
cmpb   $0x0,(%rbx)
sete   %cl
or     %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @eol(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @crlf(i8* %3)
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = call i32 @nl(i8 signext %7)
%9 = or i32 %4, %8
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
%14 = xor i1 %13, true
%15 = zext i1 %14 to i32
%16 = or i32 %9, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @eol(i8* %0) {
%2 = tail call i32 @crlf(i8* %0)
%3 = load i8, i8* %0
%4 = tail call i32 @nl(i8 signext %3)
%5 = or i32 %4, %2
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
%8 = zext i1 %7 to i32
%9 = or i32 %5, %8
ret i32 %9
}
unsigned char zigzagdec8(unsigned short x) { return x >> 1 ^ -(x & 1); }


x86 assembly (clang, -O0):
<zigzagdec8>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x1,%eax
movzwl -0x2(%rbp),%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zigzagdec8>:
mov    %edi,%eax
shr    %eax
and    $0x1,%edi
neg    %edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @zigzagdec8(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 1
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = and i32 %7, 1
%9 = sub nsw i32 0, %8
%10 = xor i32 %5, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @zigzagdec8(i16 zeroext %0) {
%2 = lshr i16 %0, 1
%3 = and i16 %0, 1
%4 = sub nsw i16 0, %3
%5 = xor i16 %2, %4
%6 = trunc i16 %5 to i8
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_usage(char *appname) {
  printf("Usage: %s -l ADDR -p PORT\n", appname);
}


x86 assembly (clang, -O0):
<print_usage>:
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):
<print_usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [27 x i8] c"Usage: %s -l ADDR -p PORT\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int pthread_cond_signal(pthread_cond_t *cond) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_cond_signal(i32* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int rat_lib_regex_match(char const *, char const *);
int rat_ractl_rm(const char *regex, const char *str) {
  return rat_lib_regex_match(regex, str);
}


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

x86 assembly (clang, -O2):
<rat_ractl_rm>:
jmp    1030 <rat_lib_regex_match@plt>

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

LLVM IR (-O2):
define i32 @rat_ractl_rm(i8* %0, i8* %1) {
%3 = tail call i32 @rat_lib_regex_match(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
double atof(char *);
double CDoubleChars(char *Sorc) { return atof(Sorc); }


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

x86 assembly (clang, -O2):
<CDoubleChars>:
jmp    1030 <atof@plt>

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

LLVM IR (-O2):
define double @CDoubleChars(i8* nocapture %0) {
%2 = tail call double @atof(i8* %0)
ret double %2
}
/* Variables and functions */
char *get_end_of_slashes_with_end(char const *const, char const *const);
bool component_is_a_directory(const char *__attribute__((nonnull))
                              const component_end,
                              const char *__attribute__((nonnull))
                              const path_end) {
  const char *const end = get_end_of_slashes_with_end(component_end, path_end);
  return (end != NULL);
}


x86 assembly (clang, -O0):
<component_is_a_directory>:
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 <get_end_of_slashes_with_end@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<component_is_a_directory>:
push   %rax
call   1030 <get_end_of_slashes_with_end@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @component_is_a_directory(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @get_end_of_slashes_with_end(i8* %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
ret i32 %11
}

LLVM IR (-O2):
define i32 @component_is_a_directory(i8* %0, i8* %1) {
%3 = tail call i8* @get_end_of_slashes_with_end(i8* %0, i8* %1)
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(char *, int, size_t, int /*<<< orphan*/ *);
void save_file(char *data, size_t siz, char *filename) {
  FILE *f = fopen(filename, "w+");
  fwrite(data, sizeof(char), siz, f);
  fclose(f);
}


x86 assembly (clang, -O0):
<save_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
call   1050 <fwrite@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_file>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xebe(%rip),%rsi
mov    %rdx,%rdi
call   1040 <fopen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    $0x1,%esi
mov    %r14,%rdx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"w+\00"
define void @save_file(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %9, i32** %7
%10 = load i8*, i8** %4
%11 = load i64, i64* %5
%12 = load i32*, i32** %7
%13 = call i32 @fwrite(i8* %10, i32 1, i64 %11, i32* %12)
%14 = load i32*, i32** %7
%15 = call i32 @fclose(i32* %14)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"w+\00"
define void @save_file(i8* nocapture %0, i64 %1, i8* nocapture %2) {
%4 = tail call i32* @fopen(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fwrite(i8* %0, i32 1, i64 %1, i32* %4)
%6 = tail call i32 @fclose(i32* %4)
ret void
}
int ld_gt_cr1(long double a1) { return (((100) > (a1))); }


x86 assembly (clang, -O0):
<ld_gt_cr1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_gt_cr1>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
seta   %al
ret

LLVM IR (-O0):
define i32 @ld_gt_cr1(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp ogt x86_fp80 0xK4005C800000000000000, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ld_gt_cr1(x86_fp80 %0) {
%2 = fcmp olt x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int nvidia_mcp_gpio_set(int, int);
int nvidia_mcp_gpio2_raise(void) { return nvidia_mcp_gpio_set(0x02, 1); }


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

x86 assembly (clang, -O2):
<nvidia_mcp_gpio2_raise>:
mov    $0x2,%edi
mov    $0x1,%esi
jmp    1030 <nvidia_mcp_gpio_set@plt>

LLVM IR (-O0):
define i32 @nvidia_mcp_gpio2_raise() {
%1 = call i32 @nvidia_mcp_gpio_set(i32 2, i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @nvidia_mcp_gpio2_raise() {
%1 = tail call i32 @nvidia_mcp_gpio_set(i32 2, i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ eFree(char *);
int /*<<< orphan*/ inputS(char *, char *);
char *popString();
int /*<<< orphan*/ pushStringCopy(char *);
int /*<<< orphan*/ strcpy(char *, char *);
void basInputs() {
  char *txt;
  char *request;
  char defs[255];
  txt = popString();
  strcpy(defs, txt);
  request = popString();
  inputS(request, defs);
  pushStringCopy(defs);
  eFree(txt);
}


x86 assembly (clang, -O0):
<basInputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    $0x0,%al
call   1050 <popString@plt>
mov    %rax,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    $0x0,%al
call   1050 <popString@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1060 <inputS@plt>
lea    -0x110(%rbp),%rdi
call   1070 <pushStringCopy@plt>
mov    -0x8(%rbp),%rdi
call   1040 <eFree@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basInputs>:
push   %r14
push   %rbx
sub    $0x108,%rsp
xor    %eax,%eax
call   1050 <popString@plt>
mov    %rax,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
call   1050 <popString@plt>
mov    %rax,%rdi
mov    %r14,%rsi
call   1060 <inputS@plt>
mov    %r14,%rdi
call   1070 <pushStringCopy@plt>
mov    %rbx,%rdi
call   1040 <eFree@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @basInputs() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca [255 x i8]
%4 = call i8* (...) @popString()
store i8* %4, i8** %1
%5 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %1
%7 = call i32 @strcpy(i8* %5, i8* %6)
%8 = call i8* (...) @popString()
store i8* %8, i8** %2
%9 = load i8*, i8** %2
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%11 = call i32 @inputS(i8* %9, i8* %10)
%12 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%13 = call i32 @pushStringCopy(i8* %12)
%14 = load i8*, i8** %1
%15 = call i32 @eFree(i8* %14)
ret void
}

LLVM IR (-O2):
define void @basInputs() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%3 = tail call i8* (...) @popString()
%4 = call i32 @strcpy(i8* %2, i8* %3)
%5 = call i8* (...) @popString()
%6 = call i32 @inputS(i8* %5, i8* %2)
%7 = call i32 @pushStringCopy(i8* %2)
%8 = call i32 @eFree(i8* %3)
ret void
}