xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int open(char const *, int);
int /*<<< orphan*/ perror(char *);
int xopen(const char *file, int flag) {
  int fd;
  fd = open(file, flag);
  if (fd < 0) {
    perror("Error opening file:");
    exit(1);
  }
  return (fd);
}


x86 assembly (clang, -O0):
<xopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <open@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    116e <xopen+0x3e>
lea    0xea1(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xopen>:
push   %rax
call   1030 <open@plt>
test   %eax,%eax
js     113c <xopen+0xc>
pop    %rcx
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Error opening file:\00"
define i32 @xopen(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @open(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
@.str = [20 x i8] c"Error opening file:\00"
define i32 @xopen(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void function_receive_and_return_void(void) { printf("void -> void\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"void -> void\00"
define void @function_receive_and_return_void() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
void tdefault_post_attach(struct target_ops *self, int arg1) {}


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

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

LLVM IR (-O0):
%struct.target_ops = type opaque
define void @tdefault_post_attach(%struct.target_ops* %0, i32 %1) {
%3 = alloca %struct.target_ops*
%4 = alloca i32
store %struct.target_ops* %0, %struct.target_ops** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.target_ops = type opaque
define void @tdefault_post_attach(%struct.target_ops* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
__attribute__((weak)) int __real_select(int __nfds,
                                        fd_set *__restrict __readfds,
                                        fd_set *__restrict __writefds,
                                        fd_set *__restrict __exceptfds,
                                        struct timeval *__restrict __timeout) {
  return select(__nfds, __readfds, __writefds, __exceptfds, __timeout);
}


x86 assembly (clang, -O0):
<__real_select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <select@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__real_select>:
jmp    1030 <select@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define weak i32 @__real_select(i32 %0, i32* noalias %1, i32* noalias %2, i32* noalias %3, %struct.timeval* noalias %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca %struct.timeval*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store %struct.timeval* %4, %struct.timeval** %10
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = load i32*, i32** %9
%15 = load %struct.timeval*, %struct.timeval** %10
%16 = call i32 @select(i32 %11, i32* %12, i32* %13, i32* %14, %struct.timeval* %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define weak i32 @__real_select(i32 %0, i32* noalias %1, i32* noalias %2, i32* noalias %3, %struct.timeval* noalias %4) {
%6 = tail call i32 @select(i32 %0, i32* %1, i32* %2, i32* %3, %struct.timeval* %4)
ret i32 %6
}
/* Type definitions */
typedef int uid_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
uid_t geteuid(void) {
  printf("geteuid\n");
  return 0x0ddba11;
}


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

x86 assembly (clang, -O2):
<geteuid>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xddba11,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"geteuid\0A\00"
define i32 @geteuid() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 14531089
}

LLVM IR (-O2):
@str = [8 x i8] c"geteuid\00"
define i32 @geteuid() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 14531089
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Bool;

/* Variables and functions */
int /*<<< orphan*/ abort();
Bool safe_XF86VidModeGetViewPort(Display *d, int i, int *x, int *y) { abort(); }


x86 assembly (clang, -O0):
<safe_XF86VidModeGetViewPort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

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

LLVM IR (-O0):
define i32 @safe_XF86VidModeGetViewPort(i32* %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @safe_XF86VidModeGetViewPort(i32* nocapture readnone %0, i32 %1, i32* nocapture readnone %2, i32* nocapture readnone %3) {
%5 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int dup(int);
int open(char *, int /*<<< orphan*/);
int open_devnull(void) {
  static int fd = -1;
  if (fd < 0) {
    fd = open("/dev/null", O_RDWR);
  }
  return dup(fd);
}


x86 assembly (clang, -O0):
<open_devnull>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f05(%rip)
jge    114c <open_devnull+0x2c>
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1040 <open@plt>
mov    %eax,0x2ee4(%rip)
mov    0x2ede(%rip),%edi
call   1030 <dup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_devnull>:
push   %rax
mov    0x2f09(%rip),%edi
test   %edi,%edi
js     1131 <open_devnull+0x11>
pop    %rax
jmp    1030 <dup@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1040 <open@plt>
mov    %eax,%edi
mov    %eax,0x2ee2(%rip)
pop    %rax
jmp    1030 <dup@plt>

LLVM IR (-O0):
@open_devnull.fd = internal global i32 -1
@.str = [10 x i8] c"/dev/null\00"
@O_RDWR = global i32 0
define i32 @open_devnull() {
%1 = load i32, i32* @open_devnull.fd
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @O_RDWR
%5 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 %5, i32* @open_devnull.fd
br label %6
6: ; preds = %3, %0
%7 = load i32, i32* @open_devnull.fd
%8 = call i32 @dup(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@open_devnull.fd = internal unnamed_addr global i32 -1
@.str = [10 x i8] c"/dev/null\00"
@O_RDWR = global i32 0
define i32 @open_devnull() {
%1 = load i32, i32* @open_devnull.fd
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @O_RDWR
%5 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 %5, i32* @open_devnull.fd
br label %6
6: ; preds = %3, %0
%7 = phi i32 [ %5, %3 ], [ %1, %0 ]
%8 = tail call i32 @dup(i32 %7)
ret i32 %8
}
/* Variables and functions */
int errno;
int syscall(int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
            int /*<<< orphan*/, int /*<<< orphan*/);
int getpid() {
  int ret = syscall(31, 0, 0, 0, 0, 0);
  if (ret < 0) {
    errno = -ret;
    return -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<getpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1f,%edi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <syscall@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1158 <getpid+0x48>
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
mov    0x2e96(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <getpid+0x4e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpid>:
push   %rax
mov    $0x1f,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>
test   %eax,%eax
js     112d <getpid+0x1d>
pop    %rcx
ret
neg    %eax
mov    0x2eaa(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @getpid() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @syscall(i32 31, i32 0, i32 0, i32 0, i32 0, i32 0)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %2
%8 = sub nsw i32 0, %7
store i32 %8, i32* @errno
store i32 -1, i32* %1
br label %11
9: ; preds = %0
%10 = load i32, i32* %2
store i32 %10, i32* %1
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @getpid() {
%1 = tail call i32 @syscall(i32 31, i32 0, i32 0, i32 0, i32 0, i32 0)
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = sub nsw i32 0, %1
store i32 %4, i32* @errno
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ -1, %3 ], [ %1, %0 ]
ret i32 %6
}
void foo639(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo639(i32 %0) {
ret void
}
void gl_error(buf) char *buf;
{
  int len = strlen(buf);
  gl_cleanup();
  write(2, buf, len);
  exit(1);
}


x86 assembly (clang, -O0):
<gl_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <gl_cleanup@plt>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x2,%edi
mov    $0x0,%al
call   1030 <write@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<gl_error>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1050 <gl_cleanup@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <write@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
define void @gl_error(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = call i32 (...) @gl_cleanup()
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 2, i8* %8, i32 %9)
unreachable
}

LLVM IR (-O2):
define void @gl_error(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = tail call i32 (...) @gl_cleanup()
%5 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 2, i8* %0, i32 %3)
tail call void @exit(i32 1)
unreachable
}
le(float a, float b) { return a <= b; }


x86 assembly (clang, -O0):
<le>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le>:
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @le(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ole float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @le(float %0, float %1) {
%3 = fcmp ole float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct rt_entry {
  int dummy;
};

/* Variables and functions */
struct rt_entry *clear_entry(struct rt_entry *);
void rt_clear(struct rt_entry *lstentry) {
  while (lstentry)
    lstentry = clear_entry(lstentry);
}


x86 assembly (clang, -O0):
<rt_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1139 <rt_clear+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <clear_entry@plt>
mov    %rax,-0x8(%rbp)
jmp    111c <rt_clear+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_clear>:
push   %rax
test   %rdi,%rdi
je     112d <rt_clear+0x1d>
mov    %rdi,%rax
nopl   0x0(%rax)
mov    %rax,%rdi
call   1030 <clear_entry@plt>
test   %rax,%rax
jne    1120 <rt_clear+0x10>
pop    %rax
ret

LLVM IR (-O0):
%struct.rt_entry = type { i32 }
define void @rt_clear(%struct.rt_entry* %0) {
%2 = alloca %struct.rt_entry*
store %struct.rt_entry* %0, %struct.rt_entry** %2
br label %3
3: ; preds = %6, %1
%4 = load %struct.rt_entry*, %struct.rt_entry** %2
%5 = icmp ne %struct.rt_entry* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load %struct.rt_entry*, %struct.rt_entry** %2
%8 = call %struct.rt_entry* @clear_entry(%struct.rt_entry* %7)
store %struct.rt_entry* %8, %struct.rt_entry** %2
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.rt_entry = type { i32 }
define void @rt_clear(%struct.rt_entry* %0) {
%2 = icmp eq %struct.rt_entry* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = phi %struct.rt_entry* [ %5, %3 ], [ %0, %1 ]
%5 = tail call %struct.rt_entry* @clear_entry(%struct.rt_entry* %4)
%6 = icmp eq %struct.rt_entry* %5, null
br i1 %6, label %7, label %3
7: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void gpio_clear(uint32_t port, uint32_t pin) {
  (*((volatile uint32_t *)(port + 0x18))) |= (1 << (16 + pin));
}


x86 assembly (clang, -O0):
<gpio_clear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
add    $0x10,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x4(%rbp),%eax
add    $0x18,%eax
cltq
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_clear>:
lea    0x10(%rsi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %edi,%rcx
or     %eax,0x18(%rcx)
ret

LLVM IR (-O0):
define void @gpio_clear(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = add nsw i32 16, %5
%7 = shl i32 1, %6
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 24
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
%13 = or i32 %12, %7
store volatile i32 %13, i32* %11
ret void
}

LLVM IR (-O2):
define void @gpio_clear(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 16
%4 = shl nuw i32 1, %3
%5 = add nsw i32 %0, 24
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = or i32 %8, %4
store volatile i32 %9, i32* %7
ret void
}
void printnum(void *number) {
  printf("%s:%d: %s ("
         "%.15g"
         ")\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/joshuapena/cmps012b-wm-w15/refs/heads/"
         "master/mackey/labs/lab9c-voidstar-generic/examples/numberproc.c",
         26, __func__, *(double *)number);
  ;
}


x86 assembly (clang, -O0):
<printnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xed5(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x1a,%edx
lea    0xf95(%rip),%rcx
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printnum>:
movsd  (%rdi),%xmm0
lea    0xee5(%rip),%rdi
lea    0xef1(%rip),%rsi
lea    0xfaa(%rip),%rcx
mov    $0x1a,%edx
mov    $0x1,%al
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"%s:%d: %s (%.15g)\0A\00"
@.str.1 = [192 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/joshuapena/cmps012b-wm-w15/refs/heads/master/mackey/labs/lab9c-voidstar-generic/examples/numberproc.c\00"
@__func__.printnum = [9 x i8] c"printnum\00"
define void @printnum(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to double*
%5 = load double, double* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([192 x i8], [192 x i8]* @.str.1, i64 0, i64 0), i32 26, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.printnum, i64 0, i64 0), double %5)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%s:%d: %s (%.15g)\0A\00"
@.str.1 = [192 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/joshuapena/cmps012b-wm-w15/refs/heads/master/mackey/labs/lab9c-voidstar-generic/examples/numberproc.c\00"
@__func__.printnum = [9 x i8] c"printnum\00"
define void @printnum(i8* nocapture %0) {
%2 = bitcast i8* %0 to double*
%3 = load double, double* %2
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([192 x i8], [192 x i8]* @.str.1, i64 0, i64 0), i32 26, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.printnum, i64 0, i64 0), double %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ Interpolate_2(int /*<<< orphan*/, int, int /*<<< orphan*/,
                                 int, int);
uint32_t Interp5(uint32_t c1, uint32_t c2) {
  return Interpolate_2(c1, 1, c2, 1, 1);
}


x86 assembly (clang, -O0):
<Interp5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x1,%r8d
mov    %r8d,%esi
mov    %r8d,%ecx
call   1030 <Interpolate_2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp5>:
mov    %esi,%edx
mov    $0x1,%esi
mov    $0x1,%ecx
mov    $0x1,%r8d
jmp    1030 <Interpolate_2@plt>

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

LLVM IR (-O2):
define i32 @Interp5(i32 %0, i32 %1) {
%3 = tail call i32 @Interpolate_2(i32 %0, i32 1, i32 %1, i32 1, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ write(char *);
int two() {
  write("2\n");
  return 2;
}


x86 assembly (clang, -O0):
<two>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <write@plt>
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<two>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <write@plt>
mov    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"2\0A\00"
define i32 @two() {
%1 = call i32 @write(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 2
}

LLVM IR (-O2):
@.str = [3 x i8] c"2\0A\00"
define i32 @two() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 2
}
/* Variables and functions */
int putchar(int);
__attribute__((__weak__, __always___)) int softboundcets_putchar(int c) {
  return putchar(c);
}


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

x86 assembly (clang, -O2):
<softboundcets_putchar>:
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_putchar(i32 %0) {
%2 = tail call i32 @putchar(i32 %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) { return islower(c) ? (c & ~0x20) : c; }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113b <toupper+0x2b>
mov    -0x4(%rbp),%eax
and    $0xffffffdf,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <toupper+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
mov    %ebx,%ecx
and    $0xffffffdf,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = and i32 %7, -33
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = and i32 %0, -33
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ot(char *);
immed() { ot("MOV  AX,"); }


x86 assembly (clang, -O0):
<immed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ot@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"MOV AX,\00"
define i32 @immed() {
%1 = alloca i32
%2 = call i32 @ot(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [9 x i8] c"MOV AX,\00"
define i32 @immed() {
%1 = tail call i32 @ot(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void grt_overflow_error(void) { abort(); }


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

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

LLVM IR (-O0):
define void @grt_overflow_error() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @grt_overflow_error() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float);
main() {
  float a, b;
  a = 1.0 / 3.0;
  b = 2.0 / 3.0;
  printf("%.2f %.2f\n", a, b);
  printf("%.3f %.3f\n", a, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xed3(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movss  0xee0(%rip),%xmm0
movss  0xedc(%rip),%xmm1
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
movss  0xec4(%rip),%xmm0
movss  0xec0(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"%.2f %.2f\0A\00"
@.str.1 = [11 x i8] c"%.3f %.3f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float 0x3FD5555560000000, float 0x3FE5555560000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), float 0x3FD5555560000000, float 0x3FE5555560000000)
ret i32 0
}
/* Type definitions */
struct vm_fault {
  int dummy;
};
struct vm_area_struct {
  int dummy;
};

/* Variables and functions */
int drm_do_vm_fault(struct vm_area_struct *, struct vm_fault *);
int drm_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) {
  return drm_do_vm_fault(vma, vmf);
}


x86 assembly (clang, -O0):
<drm_vm_fault>:
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 <drm_do_vm_fault@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drm_vm_fault>:
jmp    1030 <drm_do_vm_fault@plt>

LLVM IR (-O0):
%struct.vm_area_struct = type { i32 }
%struct.vm_fault = type { i32 }
define i32 @drm_vm_fault(%struct.vm_area_struct* %0, %struct.vm_fault* %1) {
%3 = alloca %struct.vm_area_struct*
%4 = alloca %struct.vm_fault*
store %struct.vm_area_struct* %0, %struct.vm_area_struct** %3
store %struct.vm_fault* %1, %struct.vm_fault** %4
%5 = load %struct.vm_area_struct*, %struct.vm_area_struct** %3
%6 = load %struct.vm_fault*, %struct.vm_fault** %4
%7 = call i32 @drm_do_vm_fault(%struct.vm_area_struct* %5, %struct.vm_fault* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.vm_area_struct = type { i32 }
%struct.vm_fault = type { i32 }
define i32 @drm_vm_fault(%struct.vm_area_struct* %0, %struct.vm_fault* %1) {
%3 = tail call i32 @drm_do_vm_fault(%struct.vm_area_struct* %0, %struct.vm_fault* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void objpath_free(void *context) { free(context); }


x86 assembly (clang, -O0):
<objpath_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):
<objpath_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @objpath_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 @objpath_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ USB_WriteEP(int, void *, int /*<<< orphan*/);
void USB_StatusInStage(void) { USB_WriteEP(0x80, (void *)0, 0); }


x86 assembly (clang, -O0):
<USB_StatusInStage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80,%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <USB_WriteEP@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<USB_StatusInStage>:
mov    $0x80,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <USB_WriteEP@plt>

LLVM IR (-O0):
define void @USB_StatusInStage() {
%1 = call i32 @USB_WriteEP(i32 128, i8* null, i32 0)
ret void
}

LLVM IR (-O2):
define void @USB_StatusInStage() {
%1 = tail call i32 @USB_WriteEP(i32 128, i8* null, i32 0)
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int i;
  int x;
  int y;
  i = __VERIFIER_nondet_int();
  x = 0;
  y = 0;
  if (i > 10) {
    x = 1;
  } else {
    y = 1;
  }
  while (x == y) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x8(%rbp)
jle    114d <main+0x3d>
movl   $0x1,-0xc(%rbp)
jmp    1154 <main+0x44>
movl   $0x1,-0x10(%rbp)
jmp    1159 <main+0x49>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    116a <main+0x5a>
jmp    1159 <main+0x49>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testBitmap()
ret i32 0
}
/* Type definitions */
struct pdbg_target {
  int dummy;
};

/* Variables and functions */
int path_target_find(struct pdbg_target *);
struct pdbg_target *path_target_find_next(char const *, int);
struct pdbg_target *path_target_next_class(const char *klass,
                                           struct pdbg_target *prev) {
  int index;
  index = path_target_find(prev);
  return path_target_find_next(klass, index);
}


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

x86 assembly (clang, -O2):
<path_target_next_class>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <path_target_find@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <path_target_find_next@plt>

LLVM IR (-O0):
%struct.pdbg_target = type { i32 }
define %struct.pdbg_target* @path_target_next_class(i8* %0, %struct.pdbg_target* %1) {
%3 = alloca i8*
%4 = alloca %struct.pdbg_target*
%5 = alloca i32
store i8* %0, i8** %3
store %struct.pdbg_target* %1, %struct.pdbg_target** %4
%6 = load %struct.pdbg_target*, %struct.pdbg_target** %4
%7 = call i32 @path_target_find(%struct.pdbg_target* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = load i32, i32* %5
%10 = call %struct.pdbg_target* @path_target_find_next(i8* %8, i32 %9)
ret %struct.pdbg_target* %10
}

LLVM IR (-O2):
%struct.pdbg_target = type { i32 }
define %struct.pdbg_target* @path_target_next_class(i8* %0, %struct.pdbg_target* %1) {
%3 = tail call i32 @path_target_find(%struct.pdbg_target* %1)
%4 = tail call %struct.pdbg_target* @path_target_find_next(i8* %0, i32 %3)
ret %struct.pdbg_target* %4
}
/* Variables and functions */
int /*<<< orphan*/ outl_local(unsigned int, int);
int /*<<< orphan*/ slow_down_io();
__attribute__((always_)) void outl_local_p(unsigned int value, int port) {
  outl_local(value, port);
  slow_down_io();
}


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

x86 assembly (clang, -O2):
<outl_local_p>:
push   %rax
call   1030 <outl_local@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <slow_down_io@plt>

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

LLVM IR (-O2):
define void @outl_local_p(i32 %0, i32 %1) {
%3 = tail call i32 @outl_local(i32 %0, i32 %1)
%4 = tail call i32 (...) @slow_down_io()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glPushMatrix();
extern void zlPush(void) { glPushMatrix(); }


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

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

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

LLVM IR (-O2):
define void @zlPush() {
%1 = tail call i32 (...) @glPushMatrix()
ret void
}
void msg_event(int prio, const char *desc, void *tag1, ...) { ; }


x86 assembly (clang, -O0):
<msg_event>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @msg_event(i32 %0, i8* %1, i8* %2, ...) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @msg_event(i32 %0, i8* nocapture %1, i8* nocapture %2, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int mystrcmp(char *, char *);
  char *s = "Hello";
  char *t = "Hello";
  int diff = mystrcmp(s, t);
  printf("%d\n", diff);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xebf(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <mystrcmp@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rdi,%rsi
call   1030 <mystrcmp@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @mystrcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
void KeccakInitialize() {}


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

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

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

LLVM IR (-O2):
define void @KeccakInitialize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_program();
int /*<<< orphan*/ init();
int main(void) {
  init();
  do_program();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 (...) @do_program()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_exit_daemon() {
  printf("NOT IMPLEMENTED:"
         "pa_context_exit_daemon"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_context_exit_daemon\00"
define i32 @pa_context_exit_daemon() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int main(void) {
  const int x = 0;
  unsigned char *p = (unsigned char *)&x;
  *p = 5;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i32 0, i32* %2
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
store i8 5, i8* %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
gasrint() { ol("ashl\t$-2,r0,r0"); }


x86 assembly (clang, -O0):
<gasrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"ashl\09$-2,r0,r0\00"
define i32 @gasrint() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [15 x i8] c"ashl\09$-2,r0,r0\00"
define i32 @gasrint() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ malloc(int);
void f1(int *x) {
  x = (int *)malloc(sizeof(int));
  *x = 44;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2c,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
movl   $0x2c,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @f1(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
store i32 44, i32* %5
ret void
}

LLVM IR (-O2):
define void @f1(i32* nocapture readnone %0) {
%2 = tail call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32 44, i32* %3
ret void
}
/* Type definitions */
struct suffix_mult {
  int dummy;
};

/* Variables and functions */
unsigned long xstrtoull_range_sfx(char const *, int, unsigned long,
                                  unsigned long, struct suffix_mult const *);
unsigned long xstrtoul_range_sfx(const char *str, int b, unsigned long l,
                                 unsigned long u,
                                 const struct suffix_mult *sfx) {
  return xstrtoull_range_sfx(str, b, l, u, sfx);
}


x86 assembly (clang, -O0):
<xstrtoul_range_sfx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <xstrtoull_range_sfx@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrtoul_range_sfx>:
jmp    1030 <xstrtoull_range_sfx@plt>

LLVM IR (-O0):
%struct.suffix_mult = type { i32 }
define i64 @xstrtoul_range_sfx(i8* %0, i32 %1, i64 %2, i64 %3, %struct.suffix_mult* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i64
%9 = alloca i64
%10 = alloca %struct.suffix_mult*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store %struct.suffix_mult* %4, %struct.suffix_mult** %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i64, i64* %8
%14 = load i64, i64* %9
%15 = load %struct.suffix_mult*, %struct.suffix_mult** %10
%16 = call i64 @xstrtoull_range_sfx(i8* %11, i32 %12, i64 %13, i64 %14, %struct.suffix_mult* %15)
ret i64 %16
}

LLVM IR (-O2):
%struct.suffix_mult = type { i32 }
define i64 @xstrtoul_range_sfx(i8* %0, i32 %1, i64 %2, i64 %3, %struct.suffix_mult* %4) {
%6 = tail call i64 @xstrtoull_range_sfx(i8* %0, i32 %1, i64 %2, i64 %3, %struct.suffix_mult* %4)
ret i64 %6
}
double min(double x, double y) {
  if (x >= y) {
    return y;
  } else {
    return x;
  }
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     112d <min+0x2d>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <min+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
movapd %xmm1,%xmm2
cmplesd %xmm0,%xmm2
andpd  %xmm2,%xmm1
andnpd %xmm0,%xmm2
orpd   %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @min(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp oge double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %5
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %4
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @min(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = select i1 %3, double %1, double %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ sleep(int);
main() {
  int i;
  sleep(5);
  printf("xyz");
  scanf("%d", &i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%edi
call   1050 <sleep@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1050 <sleep@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"xyz\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @sleep(i32 5)
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret i32 0
}
long ivec_index(const int *v, long n, int val) {
  long i;
  for (i = 0; i < n; i++) {
    if (v[i] == val) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<ivec_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    115c <ivec_index+0x5c>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x1c(%rbp),%eax
jne    1146 <ivec_index+0x46>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1164 <ivec_index+0x64>
jmp    114b <ivec_index+0x4b>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1117 <ivec_index+0x17>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivec_index>:
mov    $0xffffffffffffffff,%rax
test   %rsi,%rsi
jle    111e <ivec_index+0x1e>
xor    %ecx,%ecx
xchg   %ax,%ax
cmp    %edx,(%rdi,%rcx,4)
je     111f <ivec_index+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <ivec_index+0x10>
ret
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @ivec_index(i32* nocapture %0, i64 %1, i32 %2) {
%4 = icmp sgt i64 %1, 0
br i1 %4, label %5, label %13
5: ; preds = %3, %10
%6 = phi i64 [ %11, %10 ], [ 0, %3 ]
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, %2
br i1 %9, label %13, label %10
10: ; preds = %5
%11 = add nuw nsw i64 %6, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %13, label %5
13: ; preds = %5, %10, %3
%14 = phi i64 [ -1, %3 ], [ -1, %10 ], [ %6, %5 ]
ret i64 %14
}