xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ init_vm();
int /*<<< orphan*/ load_program(char const *);
int /*<<< orphan*/ run_program();
int main(int argc, const char **argv) {
  if (argc > 1) {
    init_vm();
    load_program(argv[1]);
    run_program();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    116b <main+0x3b>
mov    $0x0,%al
call   1030 <init_vm@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <load_program@plt>
mov    $0x0,%al
call   1040 <run_program@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jl     1151 <main+0x21>
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <init_vm@plt>
mov    0x8(%rbx),%rdi
call   1050 <load_program@plt>
xor    %eax,%eax
call   1040 <run_program@plt>
pop    %rbx
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = tail call i32 (...) @init_vm()
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @load_program(i8* %7)
%9 = tail call i32 (...) @run_program()
br label %10
10: ; preds = %4, %2
ret i32 0
}
/* Variables and functions */
int rand();
int rand_int(int min, int max) {
  if (max - min <= 0) {
    return -1;
  }
  return (rand() % max - min) + min;
}


x86 assembly (clang, -O0):
<rand_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    $0x0,%eax
jg     1139 <rand_int+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <rand_int+0x3f>
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
sub    -0x8(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_int>:
mov    $0xffffffff,%eax
cmp    %edi,%esi
jle    1129 <rand_int+0x19>
push   %rbx
mov    %esi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rand_int(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* %5
%7 = load i32, i32* %4
%8 = sub nsw i32 %6, %7
%9 = icmp sle i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %19
11: ; preds = %2
%12 = call i32 (...) @rand()
%13 = load i32, i32* %5
%14 = srem i32 %12, %13
%15 = load i32, i32* %4
%16 = sub nsw i32 %14, %15
%17 = load i32, i32* %4
%18 = add nsw i32 %16, %17
store i32 %18, i32* %3
br label %19
19: ; preds = %11, %10
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @rand_int(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, %1
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ -1, %2 ]
ret i32 %8
}
int I_NoAppServicesResolveAddress(void *addr) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @I_NoAppServicesResolveAddress(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ crc_accumulate(int /*<<< orphan*/, int /*<<< orphan*/ *);
void crc_accumulate_buffer(uint16_t *crcAccum, const char *pBuffer,
                           uint16_t length) {
  const uint8_t *p = (const uint8_t *)pBuffer;
  while (length--) {
    crc_accumulate(*p++, crcAccum);
  }
}


x86 assembly (clang, -O0):
<crc_accumulate_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     115e <crc_accumulate_buffer+0x4e>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <crc_accumulate@plt>
jmp    112b <crc_accumulate_buffer+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc_accumulate_buffer>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
je     1145 <crc_accumulate_buffer+0x35>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
mov    %r15,%rsi
call   1030 <crc_accumulate@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1130 <crc_accumulate_buffer+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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

/* Variables and functions */
uint8_t *get_rfid_first_device(void) {}


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

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

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

LLVM IR (-O2):
define noalias i32* @get_rfid_first_device() {
ret i32* undef
}
int check_ip_by_mask(unsigned int src, unsigned int dst, unsigned char mask) {
  unsigned int m = ((1 << (mask)) - 1);
  return (src & m) == (dst & m);
}


x86 assembly (clang, -O0):
<check_ip_by_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_ip_by_mask>:
mov    %edx,%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
not    %edx
xor    %esi,%edi
xor    %eax,%eax
test   %edx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @check_ip_by_mask(i32 %0, i32 %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = shl i32 1, %9
%11 = sub nsw i32 %10, 1
store i32 %11, i32* %7
%12 = load i32, i32* %4
%13 = load i32, i32* %7
%14 = and i32 %12, %13
%15 = load i32, i32* %5
%16 = load i32, i32* %7
%17 = and i32 %15, %16
%18 = icmp eq i32 %14, %17
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @check_ip_by_mask(i32 %0, i32 %1, i8 zeroext %2) {
%4 = zext i8 %2 to i32
%5 = shl nsw i32 -1, %4
%6 = xor i32 %5, -1
%7 = xor i32 %1, %0
%8 = and i32 %7, %6
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ hexstrings(unsigned int);
int /*<<< orphan*/ uart_putc(int);
void hexstring(unsigned int d) {
  hexstrings(d);
  uart_putc(0x0D);
  uart_putc(0x0A);
}


x86 assembly (clang, -O0):
<hexstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <hexstrings@plt>
mov    $0xd,%edi
call   1030 <uart_putc@plt>
mov    $0xa,%edi
call   1030 <uart_putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexstring>:
push   %rax
call   1040 <hexstrings@plt>
mov    $0xd,%edi
call   1030 <uart_putc@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <uart_putc@plt>

LLVM IR (-O0):
define void @hexstring(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @hexstrings(i32 %3)
%5 = call i32 @uart_putc(i32 13)
%6 = call i32 @uart_putc(i32 10)
ret void
}

LLVM IR (-O2):
define void @hexstring(i32 %0) {
%2 = tail call i32 @hexstrings(i32 %0)
%3 = tail call i32 @uart_putc(i32 13)
%4 = tail call i32 @uart_putc(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_charsets(int /*<<< orphan*/);
void print_all_charsets(void) { print_charsets(0); }


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

x86 assembly (clang, -O2):
<print_all_charsets>:
xor    %edi,%edi
jmp    1030 <print_charsets@plt>

LLVM IR (-O0):
define void @print_all_charsets() {
%1 = call i32 @print_charsets(i32 0)
ret void
}

LLVM IR (-O2):
define void @print_all_charsets() {
%1 = tail call i32 @print_charsets(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
int handle_1w(int fd) {
  const char *cmd = "1w scan_read\n";
  write(fd, cmd, strlen(cmd));
  return 0;
}


x86 assembly (clang, -O0):
<handle_1w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_1w>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed3(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"1w scan_read\0A\00"
define i32 @handle_1w(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32, i32* %2
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = call i32 @write(i32 %4, i8* %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"1w scan_read\0A\00"
define i32 @handle_1w(i32 %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void serialWriteData(int fd, char *buf, int len) { write(fd, buf, len); }


x86 assembly (clang, -O0):
<serialWriteData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialWriteData>:
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @serialWriteData(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @write(i32 %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @serialWriteData(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
void invarg(const char *msg, const char *arg) {
  fprintf(stderr, "Error: argument \"%s\" is wrong: %s\n", arg, msg);
  exit(-1);
}


x86 assembly (clang, -O0):
<invarg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Error: argument \22%s\22 is wrong: %s\0A\00"
define void @invarg(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Error: argument \22%s\22 is wrong: %s\0A\00"
define void @invarg(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
%5 = tail call i32 @exit(i32 -1)
unreachable
}
void freeMessageParts(char **toFree) {
  int i;
  for (i = 0; i < 500; ++i)
    free(toFree[i]);
  free(toFree);
}


x86 assembly (clang, -O0):
<freeMessageParts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1f4,-0xc(%rbp)
jge    114f <freeMessageParts+0x3f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <freeMessageParts+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeMessageParts>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    $0x1f4,%rbx
jne    1120 <freeMessageParts+0x10>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeMessageParts(i8** nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %6, %2 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
tail call void @free(i8* %5)
%6 = add nuw nsw i64 %3, 1
%7 = icmp eq i64 %6, 500
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = bitcast i8** %0 to i8*
tail call void @free(i8* %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_ptr(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scheme_entry();
int main(void) {
  print_ptr(scheme_entry());
  printf("%c", 0xFF);
  printf("%c", 0x00);
  printf("%c", 0x00);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <scheme_entry@plt>
mov    %eax,%edi
call   1040 <print_ptr@plt>
lea    0xeac(%rip),%rdi
mov    $0xff,%esi
call   1030 <printf@plt>
lea    0xe9b(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xe8d(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <scheme_entry@plt>
mov    %eax,%edi
call   1040 <print_ptr@plt>
lea    0xeba(%rip),%rbx
mov    %rbx,%rdi
mov    $0xff,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ m5_loadsymbol(int /*<<< orphan*/, char *);
int /*<<< orphan*/ strtoul(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ usage();
void do_load_symbol(int argc, char *argv[]) {
  if (argc != 2)
    usage();
  uint64_t addr = strtoul(argv[0], NULL, 0);
  char *symbol = argv[1];
  m5_loadsymbol(addr, symbol);
}


x86 assembly (clang, -O0):
<do_load_symbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
je     1150 <do_load_symbol+0x20>
mov    $0x0,%al
call   1040 <usage@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1050 <strtoul@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1030 <m5_loadsymbol@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_load_symbol>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
je     1140 <do_load_symbol+0x10>
xor    %eax,%eax
call   1040 <usage@plt>
mov    (%rbx),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <strtoul@plt>
mov    0x8(%rbx),%rsi
mov    %eax,%edi
pop    %rbx
jmp    1030 <m5_loadsymbol@plt>

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

LLVM IR (-O2):
define void @do_load_symbol(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %6
6: ; preds = %4, %2
%7 = load i8*, i8** %1
%8 = tail call i32 @strtoul(i8* nocapture %7, i32* null, i32 0)
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @m5_loadsymbol(i32 %8, i8* %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void deserialize_byte(char **f, signed char *n) {
  memcpy(n, *f, sizeof(signed char));
  *f += sizeof(signed char);
}


x86 assembly (clang, -O0):
<deserialize_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deserialize_byte>:
push   %rbx
mov    %rsi,%rax
mov    %rdi,%rbx
mov    (%rdi),%rsi
mov    %rax,%rdi
mov    $0x1,%edx
call   1030 <memcpy@plt>
addq   $0x1,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @deserialize_byte(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = tail call i32 @memcpy(i8* %1, i8* %3, i32 1)
%5 = load i8*, i8** %0
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %6, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void getUser(char *username) { strcpy(username, "noone"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"noone\00"
define void @getUser(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *execname) {
  fprintf(stderr,
          "Usage:\n"
          "  %s: [vh] [-i infile]... [-o outfile]...\n",
          execname);
}


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>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"Usage:\0A %s: [vh] [-i infile]... [-o outfile]...\0A\00"
define void @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 ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"Usage:\0A %s: [vh] [-i infile]... [-o outfile]...\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
void *_xmalloc_inc(size_t, size_t, int);
void *xmalloc0_inc(size_t size, size_t inc) {
  return _xmalloc_inc(size, inc, 1);
}


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

x86 assembly (clang, -O2):
<xmalloc0_inc>:
mov    $0x1,%edx
jmp    1030 <_xmalloc_inc@plt>

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

LLVM IR (-O2):
define i8* @xmalloc0_inc(i64 %0, i64 %1) {
%3 = tail call i8* @_xmalloc_inc(i64 %0, i64 %1, i32 1)
ret i8* %3
}
int decimalDigit(char c) { return ((c >= '0') && (c <= '9')) ? (c - '0') : 0; }


x86 assembly (clang, -O0):
<decimalDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <decimalDigit+0x33>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <decimalDigit+0x33>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <decimalDigit+0x3d>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <decimalDigit+0x3d>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimalDigit>:
lea    -0x30(%rdi),%ecx
lea    -0x30(%rdi),%edx
xor    %eax,%eax
cmp    $0xa,%cl
cmovb  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @decimalDigit(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
%5 = add nsw i32 %2, -48
%6 = select i1 %4, i32 %5, i32 0
ret i32 %6
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ ts_y_origin;
};
typedef TYPE_1__ XGCValues;

/* Variables and functions */
int get_XGCValues_ts_y_origin(void *_p) {
  return (int)((XGCValues *)_p)->ts_y_origin;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XGCValues_ts_y_origin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XGCValues_ts_y_origin(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help_dec() {
  printf("\n Usage: decmars [-options] [inputfile [outputfile]]"
         "\n Supported options:\n"
         " --------------------------------------\n"
         " -n # Num of iterations           (10) \n"
         " -p   Postprocessing image        (Off)\n"
         " -q   Better quality decode       (Off)\n"
         " -i   Iterative decoding          (Off)\n"
         " -r   Output image in raw format  (Off)\n"
         " -d   Display image with xv       (Off)\n"
         " -z # Zoom factor                 (1.0)\n"
         " -h   Display this help \n\n"
         " Default input file : lena.ifs\n"
         " Default output file: lena.dec.pgm\n\n");
}


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

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

LLVM IR (-O0):
@.str = [487 x i8] c"\0A Usage: decmars [-options] [inputfile [outputfile]]\0A Supported options:\0A --------------------------------------\0A -n # Num of iterations (10) \0A -p Postprocessing image (Off)\0A -q Better quality decode (Off)\0A -i Iterative decoding (Off)\0A -r Output image in raw format (Off)\0A -d Display image with xv (Off)\0A -z # Zoom factor (1.0)\0A -h Display this help \0A\0A Default input file : lena.ifs\0A Default output file: lena.dec.pgm\0A\0A\00"
define void @help_dec() {
%1 = call i32 @printf(i8* getelementptr inbounds ([487 x i8], [487 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [486 x i8] c"\0A Usage: decmars [-options] [inputfile [outputfile]]\0A Supported options:\0A --------------------------------------\0A -n # Num of iterations (10) \0A -p Postprocessing image (Off)\0A -q Better quality decode (Off)\0A -i Iterative decoding (Off)\0A -r Output image in raw format (Off)\0A -d Display image with xv (Off)\0A -z # Zoom factor (1.0)\0A -h Display this help \0A\0A Default input file : lena.ifs\0A Default output file: lena.dec.pgm\0A\00"
define void @help_dec() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([486 x i8], [486 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double __nv_rnorm(int, double const *);
double rnorm(int __a, const double *__b) { return __nv_rnorm(__a, __b); }


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

x86 assembly (clang, -O2):
<rnorm>:
jmp    1030 <__nv_rnorm@plt>

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

LLVM IR (-O2):
define double @rnorm(i32 %0, double* %1) {
%3 = tail call double @__nv_rnorm(i32 %0, double* %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ Platform_Halt(int);
int errno;
scalar_t__ ftruncate(long long, long long);
int Platform_Truncate(long long h, long long l) {
  int _o_result;
  if (ftruncate(h, l) < 0) {
    _o_result = errno;
    return _o_result;
  } else {
    _o_result = 0;
    return _o_result;
  }
__retchk:
  Platform_Halt(-3);
  return 0;
  ;
}


x86 assembly (clang, -O0):
<Platform_Truncate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <ftruncate@plt>
cmp    $0x0,%rax
jge    114e <Platform_Truncate+0x3e>
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115b <Platform_Truncate+0x4b>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Platform_Truncate>:
push   %rax
call   1030 <ftruncate@plt>
mov    0x2ec3(%rip),%rcx
sar    $0x3f,%rax
and    (%rcx),%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @Platform_Truncate(i64 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
store i64 %0, i64* %4
store i64 %1, i64* %5
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = call i64 @ftruncate(i64 %7, i64 %8)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* @errno
store i32 %12, i32* %6
%13 = load i32, i32* %6
store i32 %13, i32* %3
br label %18
14: ; preds = %2
store i32 0, i32* %6
%15 = load i32, i32* %6
store i32 %15, i32* %3
br label %18
16: ; No predecessors!
%17 = call i32 @Platform_Halt(i32 -3)
store i32 0, i32* %3
br label %18
18: ; preds = %16, %14, %11
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @Platform_Truncate(i64 %0, i64 %1) {
%3 = tail call i64 @ftruncate(i64 %0, i64 %1)
%4 = icmp slt i64 %3, 0
%5 = load i32, i32* @errno
%6 = select i1 %4, i32 %5, i32 0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t const);
int /*<<< orphan*/ stderr;
void *xrealloc(void *ptr, const size_t size) {
  ptr = realloc(ptr, size);
  if (ptr == NULL) {
    fprintf(stderr, "out of memory\n");
    abort();
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xrealloc>:
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   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1178 <xrealloc+0x48>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rax
call   1050 <realloc@plt>
test   %rax,%rax
je     113d <xrealloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %2
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %2
ret i8* %3
}
/* Variables and functions */
char const *slk_label(int);
const char *wrap_slk_label(int labnum) { return slk_label(labnum); }


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

x86 assembly (clang, -O2):
<wrap_slk_label>:
jmp    1030 <slk_label@plt>

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

LLVM IR (-O2):
define i8* @wrap_slk_label(i32 %0) {
%2 = tail call i8* @slk_label(i32 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_add_ss(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 __attribute__((__target__("sse"))) mm_add_ss_wrap(__m128 a, __m128 b) {
  return _mm_add_ss(a, b);
}


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

x86 assembly (clang, -O2):
<mm_add_ss_wrap>:
jmp    1030 <_mm_add_ss@plt>

LLVM IR (-O0):
define i32 @mm_add_ss_wrap(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 @_mm_add_ss(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @mm_add_ss_wrap(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_add_ss(i32 %0, i32 %1)
ret i32 %3
}
long IS_ERR_OR_NULL(const void *ptr) {
  return !ptr || ((unsigned long)ptr) >= (unsigned long)-4095;
}


x86 assembly (clang, -O0):
<IS_ERR_OR_NULL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1128 <IS_ERR_OR_NULL+0x28>
mov    -0x8(%rbp),%rax
cmp    $0xfffffffffffff001,%rax
setae  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<IS_ERR_OR_NULL>:
test   %rdi,%rdi
sete   %al
cmp    $0xfffffffffffff001,%rdi
setae  %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i64 @IS_ERR_OR_NULL(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = ptrtoint i8* %6 to i64
%8 = icmp uge i64 %7, -4095
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ true, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
%12 = sext i32 %11 to i64
ret i64 %12
}

LLVM IR (-O2):
define i64 @IS_ERR_OR_NULL(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = icmp ugt i8* %0, inttoptr (i64 -4096 to i8*)
%4 = or i1 %2, %3
%5 = zext i1 %4 to i64
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ scores_draw();
void scores_enter(void) { scores_draw(); }


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

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

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

LLVM IR (-O2):
define void @scores_enter() {
%1 = tail call i32 (...) @scores_draw()
ret void
}
int validScreenCoordinate(int xCoord, int yCoord) {
  if ((xCoord < 1024 - 1) && (xCoord > 0) && (yCoord > 0) &&
      (yCoord < 768 - 1)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<validScreenCoordinate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x3ff,-0x8(%rbp)
jge    1144 <validScreenCoordinate+0x44>
cmpl   $0x0,-0x8(%rbp)
jle    1144 <validScreenCoordinate+0x44>
cmpl   $0x0,-0xc(%rbp)
jle    1144 <validScreenCoordinate+0x44>
cmpl   $0x2ff,-0xc(%rbp)
jge    1144 <validScreenCoordinate+0x44>
movl   $0x1,-0x4(%rbp)
jmp    114b <validScreenCoordinate+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<validScreenCoordinate>:
add    $0xffffffff,%edi
cmp    $0x3fe,%edi
setb   %al
add    $0xffffffff,%esi
cmp    $0x2fe,%esi
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @validScreenCoordinate(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = icmp ult i32 %3, 1022
%5 = add i32 %1, -1
%6 = icmp ult i32 %5, 766
%7 = and i1 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
struct ss7 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ss7_message(struct ss7 *, char *, unsigned short);
int((propagation_delay_cntr_dump))(struct ss7 *ss7, int messagetype,
                                   unsigned char *parm, int len) {
  ss7_message(ss7, "\t\t\tDelay: %dms\n",
              (unsigned short)(((parm[0] & 0xff) << 8) | (parm[0] & 0xff)));
  return len;
}


x86 assembly (clang, -O0):
<propagation_delay_cntr_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
and    $0xff,%ecx
or     %ecx,%eax
lea    0xeb1(%rip),%rsi
movzwl %ax,%edx
call   1030 <ss7_message@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<propagation_delay_cntr_dump>:
push   %rbx
mov    %ecx,%ebx
movzbl (%rdx),%eax
mov    %eax,%edx
shl    $0x8,%edx
or     %eax,%edx
lea    0xedc(%rip),%rsi
call   1030 <ss7_message@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ss7 = type { i32 }
@.str = [16 x i8] c"\09\09\09Delay: %dms\0A\00"
define i32 @propagation_delay_cntr_dump(%struct.ss7* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct.ss7*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct.ss7* %0, %struct.ss7** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load %struct.ss7*, %struct.ss7** %5
%10 = load i8*, i8** %7
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = and i32 %13, 255
%15 = shl i32 %14, 8
%16 = load i8*, i8** %7
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = and i32 %19, 255
%21 = or i32 %15, %20
%22 = trunc i32 %21 to i16
%23 = call i32 @ss7_message(%struct.ss7* %9, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i16 zeroext %22)
%24 = load i32, i32* %8
ret i32 %24
}

LLVM IR (-O2):
%struct.ss7 = type { i32 }
@.str = [16 x i8] c"\09\09\09Delay: %dms\0A\00"
define i32 @propagation_delay_cntr_dump(%struct.ss7* %0, i32 %1, i8* nocapture %2, i32 returned %3) {
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %6
%9 = trunc i32 %8 to i16
%10 = tail call i32 @ss7_message(%struct.ss7* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i16 zeroext %9)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int get_key(int /*<<< orphan*/ *, int, int, int, unsigned char *);
int get_RSA2048_dP(FILE *fp, int *key_off, int *key_name_off,
                   unsigned char *RSA2048_dP) {
  return get_key(fp, key_off[5] + 5, key_name_off[6], 128, RSA2048_dP);
}


x86 assembly (clang, -O0):
<get_RSA2048_dP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%esi
add    $0x5,%esi
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%edx
mov    -0x20(%rbp),%r8
mov    $0x80,%ecx
call   1030 <get_key@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_RSA2048_dP>:
mov    %rcx,%r8
mov    0x14(%rsi),%esi
add    $0x5,%esi
mov    0x18(%rdx),%edx
mov    $0x80,%ecx
jmp    1030 <get_key@plt>

LLVM IR (-O0):
define i32 @get_RSA2048_dP(i32* %0, i32* %1, i32* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = getelementptr inbounds i32, i32* %10, i64 5
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 5
%14 = load i32*, i32** %7
%15 = getelementptr inbounds i32, i32* %14, i64 6
%16 = load i32, i32* %15
%17 = load i8*, i8** %8
%18 = call i32 @get_key(i32* %9, i32 %13, i32 %16, i32 128, i8* %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @get_RSA2048_dP(i32* %0, i32* nocapture %1, i32* nocapture %2, i8* %3) {
%5 = getelementptr inbounds i32, i32* %1, i64 5
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 5
%8 = getelementptr inbounds i32, i32* %2, i64 6
%9 = load i32, i32* %8
%10 = tail call i32 @get_key(i32* %0, i32 %7, i32 %9, i32 128, i8* %3)
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
void lock(pthread_mutex_t *lock) {}


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

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

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

LLVM IR (-O2):
define void @lock(i32* nocapture %0) {
ret void
}
/* Type definitions */
struct widget {
  int dummy;
};
struct view {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ setwidget(struct widget *, char const *, char *);
struct widget *view_findwidget(struct view const *, char const *);
void view_setattr(const struct view *view, const char *id, const char *key,
                  char *value) {
  struct widget *widget = view_findwidget(view, id);
  if (!widget)
    return;
  setwidget(widget, key, value);
}


x86 assembly (clang, -O0):
<view_setattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <view_findwidget@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1159 <view_setattr+0x39>
jmp    116a <view_setattr+0x4a>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <setwidget@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<view_setattr>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
call   1040 <view_findwidget@plt>
test   %rax,%rax
je     1149 <view_setattr+0x29>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <setwidget@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.view = type { i32 }
%struct.widget = type { i32 }
define void @view_setattr(%struct.view* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca %struct.view*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca %struct.widget*
store %struct.view* %0, %struct.view** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = load %struct.view*, %struct.view** %5
%11 = load i8*, i8** %6
%12 = call %struct.widget* @view_findwidget(%struct.view* %10, i8* %11)
store %struct.widget* %12, %struct.widget** %9
%13 = load %struct.widget*, %struct.widget** %9
%14 = icmp ne %struct.widget* %13, null
br i1 %14, label %16, label %15
15: ; preds = %4
br label %21
16: ; preds = %4
%17 = load %struct.widget*, %struct.widget** %9
%18 = load i8*, i8** %7
%19 = load i8*, i8** %8
%20 = call i32 @setwidget(%struct.widget* %17, i8* %18, i8* %19)
br label %21
21: ; preds = %16, %15
ret void
}

LLVM IR (-O2):
%struct.view = type { i32 }
%struct.widget = type { i32 }
define void @view_setattr(%struct.view* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call %struct.widget* @view_findwidget(%struct.view* %0, i8* %1)
%6 = icmp eq %struct.widget* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @setwidget(%struct.widget* %5, i8* %2, i8* %3)
br label %9
9: ; preds = %4, %7
ret void
}
void ff_hevc_put_hevc_uni_qpel_v32_10_avx2() {}


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

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

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

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