xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ putc(unsigned char);
unsigned char getc(void) {
  unsigned char ret;
  while (((*((volatile unsigned long *)0x7F005018)) & 0x7f) == 0)
    ;
  ret = (*((volatile unsigned char *)0x7F005024));
  if ((ret == 0x0d) || (ret == 0x0a)) {
    putc(0x0d);
    putc(0x0a);
  } else {
    putc(ret);
  }
  return ret;
}


x86 assembly (clang, -O0):
<getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7f005018,%eax
mov    (%rax),%rax
and    $0x7f,%rax
cmp    $0x0,%rax
jne    1133 <getc+0x23>
jmp    1118 <getc+0x8>
mov    $0x7f005024,%eax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xd,%eax
je     1157 <getc+0x47>
movzbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    1170 <getc+0x60>
mov    $0xd,%edi
call   1030 <putc@plt>
mov    $0xa,%edi
call   1030 <putc@plt>
jmp    1179 <getc+0x69>
movzbl -0x1(%rbp),%edi
call   1030 <putc@plt>
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getc>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
testq  $0x7f,0x7f005018
je     1120 <getc+0x10>
mov    0x7f005024,%bl
cmp    $0xd,%bl
je     1141 <getc+0x31>
mov    %ebx,%eax
cmp    $0xa,%bl
jne    114d <getc+0x3d>
mov    $0xd,%edi
call   1030 <putc@plt>
mov    $0xa,%al
movzbl %al,%edi
call   1030 <putc@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @getc() {
%1 = alloca i8
br label %2
2: ; preds = %6, %0
%3 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%4 = and i64 %3, 127
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = load volatile i8, i8* inttoptr (i64 2130726948 to i8*)
store i8 %8, i8* %1
%9 = load i8, i8* %1
%10 = zext i8 %9 to i32
%11 = icmp eq i32 %10, 13
br i1 %11, label %16, label %12
12: ; preds = %7
%13 = load i8, i8* %1
%14 = zext i8 %13 to i32
%15 = icmp eq i32 %14, 10
br i1 %15, label %16, label %19
16: ; preds = %12, %7
%17 = call i32 @putc(i8 zeroext 13)
%18 = call i32 @putc(i8 zeroext 10)
br label %22
19: ; preds = %12
%20 = load i8, i8* %1
%21 = call i32 @putc(i8 zeroext %20)
br label %22
22: ; preds = %19, %16
%23 = load i8, i8* %1
ret i8 %23
}

LLVM IR (-O2):
define zeroext i8 @getc() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%3 = and i64 %2, 127
%4 = icmp eq i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i8, i8* inttoptr (i64 2130726948 to i8*)
switch i8 %6, label %9 [
i8 13, label %7
i8 10, label %7
]
7: ; preds = %5, %5
%8 = tail call i32 @putc(i8 zeroext 13)
br label %9
9: ; preds = %5, %7
%10 = phi i8 [ 10, %7 ], [ %6, %5 ]
%11 = tail call i32 @putc(i8 zeroext %10)
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int i;
  int j;
  int r;
  assume(r > i + j);
  while (i > 0) {
    i = i - 1;
    j = j + 1;
  }
  assert(r > i + j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
cmp    %ecx,%eax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1168 <main+0x48>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <main+0x27>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
cmp    %ecx,%eax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
void fn2(p1) { fn1(p1); }


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

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

LLVM IR (-O0):
define void @fn2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @fn1 to i32 (i32, ...)*)(i32 %3)
ret void
}

LLVM IR (-O2):
define void @fn2(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @fn1 to i32 (i32, ...)*)(i32 %0)
ret void
}
int ft_hash(const char *str) {
  int i;
  int hash;
  i = 0;
  hash = 0;
  while (str[i]) {
    hash = (hash << 5) - hash + str[i];
    i++;
  }
  return (hash);
}


x86 assembly (clang, -O0):
<ft_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1150 <ft_hash+0x50>
mov    -0x10(%rbp),%eax
shl    $0x5,%eax
sub    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <ft_hash+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <ft_hash+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <ft_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = mul i32 %7, 31
%9 = sext i8 %6 to i32
%10 = add nsw i32 %8, %9
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %16
}
/* Variables and functions */
void *malloc(unsigned long);
int /*<<< orphan*/ runtime_error(char *);
void *mem_alloc(unsigned long size) {
  void *ptr = malloc(size);
  if (!ptr) {
    runtime_error("out of memory");
  }
  return ptr;
}


x86 assembly (clang, -O0):
<mem_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <mem_alloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <runtime_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_alloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <mem_alloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <runtime_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @mem_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @runtime_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ pixel(int, int, char);
void vline(int x, int y1, int y2, char c) {
  int i;
  for (i = y1; i < (y2 + 1); i++) {
    pixel(x, i, c);
  }
}


x86 assembly (clang, -O0):
<vline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    115a <vline+0x4a>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
movsbl -0xd(%rbp),%edx
call   1030 <pixel@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112c <vline+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vline>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jg     1144 <vline+0x34>
mov    %edx,%r15d
mov    %esi,%ebp
mov    %edi,%r14d
add    $0x1,%r15d
movsbl %cl,%ebx
nopw   0x0(%rax,%rax,1)
mov    %r14d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <pixel@plt>
add    $0x1,%ebp
cmp    %ebp,%r15d
jne    1130 <vline+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @vline(i32 %0, i32 %1, i32 %2, i8 signext %3) {
%5 = icmp sgt i32 %1, %2
br i1 %5, label %11, label %6
6: ; preds = %4, %6
%7 = phi i32 [ %9, %6 ], [ %1, %4 ]
%8 = tail call i32 @pixel(i32 %0, i32 %7, i8 signext %3)
%9 = add i32 %7, 1
%10 = icmp eq i32 %7, %2
br i1 %10, label %11, label %6
11: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int /*<<< orphan*/ F_SETOWN;
int O_ASYNC;
int fcntl(int /*<<< orphan*/, int /*<<< orphan*/, ...);
int getpid();
void enable_kbd_signals(void) {
  int flags;
  fcntl(0, F_SETOWN, getpid());
  flags = fcntl(0, F_GETFL);
  fcntl(0, F_SETFL, (flags | O_ASYNC));
}


x86 assembly (clang, -O0):
<enable_kbd_signals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
xor    %edi,%edi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e73(%rip),%rax
mov    (%rax),%esi
mov    -0x4(%rbp),%edx
mov    0x2e57(%rip),%rax
or     (%rax),%edx
xor    %edi,%edi
mov    $0x0,%al
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_kbd_signals>:
push   %rbx
mov    0x2ec8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1040 <getpid@plt>
xor    %edi,%edi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    0x2e81(%rip),%rcx
mov    (%rcx),%esi
mov    0x2e68(%rip),%rcx
or     (%rcx),%eax
xor    %edi,%edi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_SETOWN = global i32 0
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_ASYNC = global i32 0
define void @enable_kbd_signals() {
%1 = alloca i32
%2 = load i32, i32* @F_SETOWN
%3 = call i32 (...) @getpid()
%4 = call i32 (i32, i32, ...) @fcntl(i32 0, i32 %2, i32 %3)
%5 = load i32, i32* @F_GETFL
%6 = call i32 (i32, i32, ...) @fcntl(i32 0, i32 %5)
store i32 %6, i32* %1
%7 = load i32, i32* @F_SETFL
%8 = load i32, i32* %1
%9 = load i32, i32* @O_ASYNC
%10 = or i32 %8, %9
%11 = call i32 (i32, i32, ...) @fcntl(i32 0, i32 %7, i32 %10)
ret void
}

LLVM IR (-O2):
@F_SETOWN = global i32 0
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_ASYNC = global i32 0
define void @enable_kbd_signals() {
%1 = load i32, i32* @F_SETOWN
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 (i32, i32, ...) @fcntl(i32 0, i32 %1, i32 %2)
%4 = load i32, i32* @F_GETFL
%5 = tail call i32 (i32, i32, ...) @fcntl(i32 0, i32 %4)
%6 = load i32, i32* @F_SETFL
%7 = load i32, i32* @O_ASYNC
%8 = or i32 %7, %5
%9 = tail call i32 (i32, i32, ...) @fcntl(i32 0, i32 %6, i32 %8)
ret void
}
unsigned int leftChild(const unsigned int i) { return (2 * i + 1); }


x86 assembly (clang, -O0):
<leftChild>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leftChild>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @leftChild(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 2, %3
%5 = add i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @leftChild(i32 %0) {
%2 = shl i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
void delUser() {}


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

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

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

LLVM IR (-O2):
define void @delUser() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int scanf(char *, int *);
int resume_question(int MAX_DEPTH) {
  int resume = 0;
  int resume_bucket_g = -1;
  if (!resume) {
  } else {
    printf("        Enter the G-Value of the bucket to expand: ");
    int ignore = scanf("%d", &resume_bucket_g);
    if (resume_bucket_g >= MAX_DEPTH) {
      printf("ERROR!! G-value > MAX_DEPTH = %d", MAX_DEPTH);
      exit(1);
    }
  }
  return resume_bucket_g;
}


x86 assembly (clang, -O0):
<resume_question>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1158 <resume_question+0x28>
jmp    11a5 <resume_question+0x75>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jl     11a0 <resume_question+0x70>
mov    -0x4(%rbp),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    11a5 <resume_question+0x75>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [52 x i8] c" Enter the G-Value of the bucket to expand: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [33 x i8] c"ERROR!! G-value > MAX_DEPTH = %d\00"
define i32 @resume_question(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 -1, i32* %4
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %1
br label %20
9: ; preds = %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
store i32 %11, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %2
%14 = icmp sge i32 %12, %13
br i1 %14, label %15, label %19
15: ; preds = %9
%16 = load i32, i32* %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %16)
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %9
br label %20
20: ; preds = %19, %8
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @resume_question(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int rw_test(char const *, int, int, int /*<<< orphan*/, int);
int test_rw_long_exist(const char *file) {
  return rw_test(file, 1024, 5, O_RDWR, 0777);
}


x86 assembly (clang, -O0):
<test_rw_long_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%ecx
mov    $0x400,%esi
mov    $0x5,%edx
mov    $0x1ff,%r8d
call   1030 <rw_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rw_long_exist>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
mov    $0x400,%esi
mov    $0x5,%edx
mov    $0x1ff,%r8d
jmp    1030 <rw_test@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
define i32 @test_rw_long_exist(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_RDWR
%5 = call i32 @rw_test(i8* %3, i32 1024, i32 5, i32 %4, i32 511)
ret i32 %5
}

LLVM IR (-O2):
@O_RDWR = global i32 0
define i32 @test_rw_long_exist(i8* %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @rw_test(i8* %0, i32 1024, i32 5, i32 %2, i32 511)
ret i32 %3
}
int button_down(int button) {
  if (!((*(volatile unsigned int *)0x04000130) & button)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<button_down>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0x4000130,%eax
mov    (%rax),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
jne    1126 <button_down+0x26>
movl   $0x1,-0x4(%rbp)
jmp    112d <button_down+0x2d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<button_down>:
xor    %eax,%eax
and    0x4000130,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @button_down(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load volatile i32, i32* inttoptr (i64 67109168 to i32*)
%5 = load i32, i32* %3
%6 = and i32 %4, %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @button_down(i32 %0) {
%2 = load volatile i32, i32* inttoptr (i64 67109168 to i32*)
%3 = and i32 %2, %0
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int aaip_get_attr_list(char *path, size_t *num_attrs, char ***names,
                       size_t **value_lengths, char ***values, int flag) {
  *num_attrs = 0;
  *names = NULL;
  *value_lengths = NULL;
  *values = NULL;
  return (1);
}


x86 assembly (clang, -O0):
<aaip_get_attr_list>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x28(%rbp),%rax
movq   $0x0,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aaip_get_attr_list>:
movq   $0x0,(%rsi)
movq   $0x0,(%rdx)
movq   $0x0,(%rcx)
movq   $0x0,(%r8)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @aaip_get_attr_list(i8* %0, i64* %1, i8*** %2, i64** %3, i8*** %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i8***
%10 = alloca i64**
%11 = alloca i8***
%12 = alloca i32
store i8* %0, i8** %7
store i64* %1, i64** %8
store i8*** %2, i8**** %9
store i64** %3, i64*** %10
store i8*** %4, i8**** %11
store i32 %5, i32* %12
%13 = load i64*, i64** %8
store i64 0, i64* %13
%14 = load i8***, i8**** %9
store i8** null, i8*** %14
%15 = load i64**, i64*** %10
store i64* null, i64** %15
%16 = load i8***, i8**** %11
store i8** null, i8*** %16
ret i32 1
}

LLVM IR (-O2):
define i32 @aaip_get_attr_list(i8* nocapture readnone %0, i64* nocapture writeonly %1, i8*** nocapture writeonly %2, i64** nocapture writeonly %3, i8*** nocapture writeonly %4, i32 %5) {
store i64 0, i64* %1
store i8** null, i8*** %2
store i64* null, i64** %3
store i8** null, i8*** %4
ret i32 1
}
int fun(int i, int j) {
  if (i == j || j == 0)
    return 1;
  return fun(i - 1, j - 1) + fun(i - 1, j);
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1134 <fun+0x24>
cmpl   $0x0,-0xc(%rbp)
jne    1140 <fun+0x30>
movl   $0x1,-0x4(%rbp)
jmp    116c <fun+0x5c>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <fun@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
call   1030 <fun@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebp
test   %esi,%esi
je     1162 <fun+0x52>
mov    %esi,%r14d
mov    %edi,%ebx
cmp    %esi,%edi
je     1162 <fun+0x52>
lea    -0x1(%r14),%r15d
neg    %r14d
add    $0xffffffff,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
mov    %r15d,%esi
call   1030 <fun@plt>
add    %eax,%ebp
lea    (%r14,%rbx,1),%eax
add    $0xffffffff,%eax
mov    %ebx,%ecx
add    $0xffffffff,%ecx
mov    %ecx,%ebx
cmp    $0xffffffff,%eax
jne    1140 <fun+0x30>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fun(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = icmp eq i32 %0, %1
%5 = or i1 %3, %4
br i1 %5, label %17, label %6
6: ; preds = %2
%7 = add nsw i32 %1, -1
br label %8
8: ; preds = %6, %8
%9 = phi i32 [ %0, %6 ], [ %11, %8 ]
%10 = phi i32 [ 0, %6 ], [ %13, %8 ]
%11 = add nsw i32 %9, -1
%12 = tail call i32 @fun(i32 %11, i32 %7)
%13 = add nsw i32 %12, %10
%14 = icmp eq i32 %11, %1
br i1 %14, label %15, label %8
15: ; preds = %8
%16 = add i32 %13, 1
br label %17
17: ; preds = %15, %2
%18 = phi i32 [ 1, %2 ], [ %16, %15 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int printstring(void *s) {
  printf("%s\n", (char *)s);
  return 0;
}


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

x86 assembly (clang, -O2):
<printstring>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @printstring(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Type definitions */
union bpf_attr {
  void *flags;
  void *value;
  void *key;
  int /*<<< orphan*/ map_fd;
};
typedef void *__u64;
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
void bpf_attr_setup_map_elem(union bpf_attr *attr, __u32 map_fd,
                             void *pointer_to_key, void *pointer_to_value,
                             __u64 flags) {
  attr->map_fd = map_fd;
  attr->key = (__u64)(unsigned long)pointer_to_key;
  attr->value = (__u64)(unsigned long)pointer_to_value;
  attr->flags = flags;
}


x86 assembly (clang, -O0):
<bpf_attr_setup_map_elem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_attr_setup_map_elem>:
mov    %r8,(%rdi)
ret

LLVM IR (-O0):
%union.bpf_attr = type { i8* }
define void @bpf_attr_setup_map_elem(%union.bpf_attr* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca %union.bpf_attr*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store %union.bpf_attr* %0, %union.bpf_attr** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i32, i32* %7
%12 = load %union.bpf_attr*, %union.bpf_attr** %6
%13 = bitcast %union.bpf_attr* %12 to i32*
store i32 %11, i32* %13
%14 = load i8*, i8** %8
%15 = ptrtoint i8* %14 to i64
%16 = inttoptr i64 %15 to i8*
%17 = load %union.bpf_attr*, %union.bpf_attr** %6
%18 = bitcast %union.bpf_attr* %17 to i8**
store i8* %16, i8** %18
%19 = load i8*, i8** %9
%20 = ptrtoint i8* %19 to i64
%21 = inttoptr i64 %20 to i8*
%22 = load %union.bpf_attr*, %union.bpf_attr** %6
%23 = bitcast %union.bpf_attr* %22 to i8**
store i8* %21, i8** %23
%24 = load i8*, i8** %10
%25 = load %union.bpf_attr*, %union.bpf_attr** %6
%26 = bitcast %union.bpf_attr* %25 to i8**
store i8* %24, i8** %26
ret void
}

LLVM IR (-O2):
%union.bpf_attr = type { i8* }
define void @bpf_attr_setup_map_elem(%union.bpf_attr* nocapture writeonly %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* %4) {
%6 = getelementptr %union.bpf_attr, %union.bpf_attr* %0, i64 0, i32 0
store i8* %4, i8** %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ port_byte_out(int, unsigned char);
void set_cursor(int offset) {
  offset = offset / 2;
  port_byte_out(0x3D4, 15);
  port_byte_out(0x3D5, (unsigned char)(offset & 0xFF));
  port_byte_out(0x3D4, 14);
  port_byte_out(0x3D5, (unsigned char)((offset >> 8) & 0xFF));
}


x86 assembly (clang, -O0):
<set_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <port_byte_out@plt>
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <port_byte_out@plt>
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <port_byte_out@plt>
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <port_byte_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cursor>:
push   %rbx
mov    %edi,%ebx
shr    $0x1f,%ebx
add    %edi,%ebx
sar    %ebx
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <port_byte_out@plt>
movzbl %bl,%esi
mov    $0x3d5,%edi
call   1030 <port_byte_out@plt>
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <port_byte_out@plt>
movzbl %bh,%esi
mov    $0x3d5,%edi
pop    %rbx
jmp    1030 <port_byte_out@plt>

LLVM IR (-O0):
define void @set_cursor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 2
store i32 %4, i32* %2
%5 = call i32 @port_byte_out(i32 980, i8 zeroext 15)
%6 = load i32, i32* %2
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = call i32 @port_byte_out(i32 981, i8 zeroext %8)
%10 = call i32 @port_byte_out(i32 980, i8 zeroext 14)
%11 = load i32, i32* %2
%12 = ashr i32 %11, 8
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = call i32 @port_byte_out(i32 981, i8 zeroext %14)
ret void
}

LLVM IR (-O2):
define void @set_cursor(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = tail call i32 @port_byte_out(i32 980, i8 zeroext 15)
%4 = trunc i32 %2 to i8
%5 = tail call i32 @port_byte_out(i32 981, i8 zeroext %4)
%6 = tail call i32 @port_byte_out(i32 980, i8 zeroext 14)
%7 = lshr i32 %2, 8
%8 = trunc i32 %7 to i8
%9 = tail call i32 @port_byte_out(i32 981, i8 zeroext %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, ...);
int main() {
  int nNum, *pNum;
  nNum = 10;
  pNum = &nNum;
  printf("nNum = %d, &nNum = %d \n", nNum, (int)&nNum);
  printf("pNum = %d, pNum = %d, &pNum = %d \n", *pNum, (int)pNum, (int)&pNum);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0xa,0x4(%rsp)
lea    0x4(%rsp),%rbx
mov    %rbx,0x8(%rsp)
lea    0xed2(%rip),%rdi
mov    $0xa,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
lea    0x8(%rsp),%rcx
lea    0xecc(%rip),%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"nNum = %d, &nNum = %d \0A\00"
@.str.1 = [35 x i8] c"pNum = %d, pNum = %d, &pNum = %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 10, i32* %1
store i32* %1, i32** %2
%3 = load i32, i32* %1
%4 = ptrtoint i32* %1 to i32
%5 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = load i32*, i32** %2
%9 = ptrtoint i32* %8 to i32
%10 = ptrtoint i32** %2 to i32
%11 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"nNum = %d, &nNum = %d \0A\00"
@.str.1 = [35 x i8] c"pNum = %d, pNum = %d, &pNum = %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32** %2 to i8*
store i32 10, i32* %1
store i32* %1, i32** %2
%5 = ptrtoint i32* %1 to i64
%6 = trunc i64 %5 to i32
%7 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 10, i32 %6)
%8 = load i32, i32* %1
%9 = ptrtoint i32** %2 to i64
%10 = trunc i64 %9 to i32
%11 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %6, i32 %10)
ret i32 0
}
/* Variables and functions */
unsigned int swap32(unsigned int);
unsigned int htonl(unsigned int val) { return swap32(val); }


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

x86 assembly (clang, -O2):
<htonl>:
jmp    1030 <swap32@plt>

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

LLVM IR (-O2):
define i32 @htonl(i32 %0) {
%2 = tail call i32 @swap32(i32 %0)
ret i32 %2
}
/* Variables and functions */
float ceilf(float);
void vec2_ceil(float *dst) {
  dst[0] = ceilf(dst[0]);
  dst[1] = ceilf(dst[1]);
}


x86 assembly (clang, -O0):
<vec2_ceil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <ceilf@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
call   1030 <ceilf@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_ceil>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
movss  %xmm1,0xc(%rsp)
call   1030 <ceilf@plt>
movss  %xmm0,(%rbx)
movss  0xc(%rsp),%xmm0
call   1030 <ceilf@plt>
movss  %xmm0,0x4(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @vec2_ceil(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = call float @llvm.ceil.f32(float %5)
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 0
store float %6, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = call float @llvm.ceil.f32(float %11)
%13 = load float*, float** %2
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
ret void
}

LLVM IR (-O2):
define void @vec2_ceil(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call float @llvm.ceil.f32(float %2)
store float %3, float* %0
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = tail call float @llvm.ceil.f32(float %5)
store float %6, float* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void deallocate(char **array) { free((void *)*array); }


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

x86 assembly (clang, -O2):
<deallocate>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @deallocate(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
ret void
}
void XGetIconSizes() {}


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

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

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

LLVM IR (-O2):
define void @XGetIconSizes() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cap1166_blink_rate(int);
void led_breathe_rate(int p) { cap1166_blink_rate(p); }


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

x86 assembly (clang, -O2):
<led_breathe_rate>:
jmp    1030 <cap1166_blink_rate@plt>

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

LLVM IR (-O2):
define void @led_breathe_rate(i32 %0) {
%2 = tail call i32 @cap1166_blink_rate(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put_bits(int, int, int);
void put_dmv(signed int dmv, signed int id) {
  if (dmv == 0)
    put_bits(0, 1, id);
  else if (dmv > 0)
    put_bits(2, 2, id);
  else
    put_bits(3, 2, id);
}


x86 assembly (clang, -O0):
<put_dmv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113c <put_dmv+0x2c>
mov    -0x8(%rbp),%edx
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <put_bits@plt>
jmp    1171 <put_dmv+0x61>
cmpl   $0x0,-0x4(%rbp)
jle    115a <put_dmv+0x4a>
mov    -0x8(%rbp),%edx
mov    $0x2,%esi
mov    %esi,%edi
call   1030 <put_bits@plt>
jmp    116c <put_dmv+0x5c>
mov    -0x8(%rbp),%edx
mov    $0x3,%edi
mov    $0x2,%esi
call   1030 <put_bits@plt>
jmp    1171 <put_dmv+0x61>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_dmv>:
mov    %esi,%edx
test   %edi,%edi
je     1127 <put_dmv+0x17>
jle    1133 <put_dmv+0x23>
mov    $0x2,%edi
mov    $0x2,%esi
jmp    1030 <put_bits@plt>
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <put_bits@plt>
mov    $0x3,%edi
mov    $0x2,%esi
jmp    1030 <put_bits@plt>

LLVM IR (-O0):
define void @put_dmv(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 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = call i32 @put_bits(i32 0, i32 1, i32 %8)
br label %20
10: ; preds = %2
%11 = load i32, i32* %3
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %4
%15 = call i32 @put_bits(i32 2, i32 2, i32 %14)
br label %19
16: ; preds = %10
%17 = load i32, i32* %4
%18 = call i32 @put_bits(i32 3, i32 2, i32 %17)
br label %19
19: ; preds = %16, %13
br label %20
20: ; preds = %19, %7
ret void
}

LLVM IR (-O2):
define void @put_dmv(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @put_bits(i32 0, i32 1, i32 %1)
br label %12
6: ; preds = %2
%7 = icmp sgt i32 %0, 0
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 @put_bits(i32 2, i32 2, i32 %1)
br label %12
10: ; preds = %6
%11 = tail call i32 @put_bits(i32 3, i32 2, i32 %1)
br label %12
12: ; preds = %8, %10, %4
ret void
}
void MemManage_Handler(void) {
  ;
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @MemManage_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int usage(const char *argv0) {
  fprintf(stderr, "usage: %s filein.rat fileout.pgm [alpha = 3, gamma = 0.7]\n",
          argv0);
  return 1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [59 x i8] c"usage: %s filein.rat fileout.pgm [alpha = 3, gamma = 0.7]\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [59 x i8] c"usage: %s filein.rat fileout.pgm [alpha = 3, gamma = 0.7]\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ disableRawMode(int /*<<< orphan*/);
void editorAtExit(void) { disableRawMode(STDIN_FILENO); }


x86 assembly (clang, -O0):
<editorAtExit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <disableRawMode@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<editorAtExit>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <disableRawMode@plt>

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
define void @editorAtExit() {
%1 = load i32, i32* @STDIN_FILENO
%2 = call i32 @disableRawMode(i32 %1)
ret void
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define void @editorAtExit() {
%1 = load i32, i32* @STDIN_FILENO
%2 = tail call i32 @disableRawMode(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cadena();
int main() {
  cadena();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @cadena()
ret i32 0
}
/* Variables and functions */
int Sys_MonkeyShouldBeSpanked(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Sys_MonkeyShouldBeSpanked() {
ret i32 0
}
void test_fflush() {}


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

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

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

LLVM IR (-O2):
define void @test_fflush() {
ret void
}
/* Variables and functions */
scalar_t__ isdigit(char);
int isxdigit(char c) {
  return isdigit(c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    117d <isxdigit+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1158 <isxdigit+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x66,%ecx
mov    %al,-0x2(%rbp)
jle    117d <isxdigit+0x6d>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1177 <isxdigit+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %al
and    $0xdf,%bl
add    $0xbf,%bl
cmp    $0x6,%bl
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isxdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isdigit(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %24, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 97
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 102
br i1 %13, label %24, label %14
14: ; preds = %10, %6
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sge i32 %16, 65
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sle i32 %20, 70
br label %22
22: ; preds = %18, %14
%23 = phi i1 [ false, %14 ], [ %21, %18 ]
br label %24
24: ; preds = %22, %10, %1
%25 = phi i1 [ true, %10 ], [ true, %1 ], [ %23, %22 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @isxdigit(i8 signext %0) {
%2 = tail call i64 @isdigit(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %6, %3
%8 = zext i1 %7 to i32
ret i32 %8
}
void freeUintMatrix(unsigned int **M, unsigned int ROWS) {
  unsigned int i;
  for (i = 0; i < ROWS; i++)
    free(M[i]);
  free(M);
}


x86 assembly (clang, -O0):
<freeUintMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1150 <freeUintMatrix+0x40>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <freeUintMatrix+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeUintMatrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
je     1142 <freeUintMatrix+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <freeUintMatrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeUintMatrix(i32** nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %0 to i8*
tail call void @free(i8* %14)
ret void
}
void weak_update_Bad() {
  int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
  if (a[0] == 0) {
    a[15] = 1;
  }
}


x86 assembly (clang, -O0):
<weak_update_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xedd(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
cmpl   $0x0,-0x30(%rbp)
jne    113e <weak_update_Bad+0x2e>
movl   $0x1,0xc(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.weak_update_Bad.a = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
define void @weak_update_Bad() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 15
store i32 1, i32* %7
br label %8
8: ; preds = %6, %0
ret void
}

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