xunge/DecIR huggingface dataset:
unsigned long pop_unsigned_int(const char *source, int num_bits) {
  int long_size = sizeof(unsigned long), i;
  unsigned long result = *(unsigned long *)(source);
  char *result_bytes = (char *)(&result);
  for (i = num_bits / 8; i < long_size; i++)
    result_bytes[i] = 0;
  return result;
}


x86 assembly (clang, -O0):
<pop_unsigned_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x8,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1159 <pop_unsigned_int+0x59>
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1133 <pop_unsigned_int+0x33>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop_unsigned_int>:
push   %rax
mov    (%rdi),%rax
mov    %rax,(%rsp)
lea    0x7(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
cmp    $0x3f,%esi
jg     114b <pop_unsigned_int+0x3b>
sar    $0x3,%ecx
movslq %ecx,%rax
lea    (%rsp,%rax,1),%rdi
cmp    $0x8,%eax
mov    $0x7,%edx
cmovge %eax,%edx
sub    %eax,%edx
add    $0x1,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @pop_unsigned_int(i8* nocapture %0, i32 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = bitcast i8* %0 to i64*
%6 = load i64, i64* %5
store i64 %6, i64* %3
%7 = sdiv i32 %1, 8
%8 = icmp slt i32 %1, 64
br i1 %8, label %9, label %17
9: ; preds = %2
%10 = sext i32 %7 to i64
%11 = getelementptr i8, i8* %4, i64 %10
%12 = call i32 @llvm.smax.i32(i32 %7, i32 7)
%13 = sub nsw i32 %12, %7
%14 = zext i32 %13 to i64
%15 = add nuw nsw i64 %14, 1
%16 = load i64, i64* %3
br label %17
17: ; preds = %9, %2
%18 = phi i64 [ %16, %9 ], [ %6, %2 ]
ret i64 %18
}
/* Variables and functions */
void saveterm() {}


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

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

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

LLVM IR (-O2):
define void @saveterm() {
ret void
}
unsigned char xtime(unsigned char x) {
  return (x << 1) ^ ((x & 0x80) ? 0x1b : 0x00);
}


x86 assembly (clang, -O0):
<xtime>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x1,%eax
movzbl -0x1(%rbp),%esi
and    $0x80,%esi
xor    %ecx,%ecx
mov    $0x1b,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtime>:
lea    (%rdi,%rdi,1),%eax
sar    $0x7,%dil
and    $0x1b,%dil
xor    %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @xtime(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl i32 %4, 1
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = and i32 %7, 128
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 27, i32 0
%12 = xor i32 %5, %11
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @xtime(i8 zeroext %0) {
%2 = shl i8 %0, 1
%3 = icmp slt i8 %0, 0
%4 = select i1 %3, i8 27, i8 0
%5 = xor i8 %4, %2
ret i8 %5
}
/* Variables and functions */
scalar_t__ unit_test_st_aligned_malloc();
scalar_t__ unit_test_st_aligned_realloc();
scalar_t__ unit_test_st_mem_usage();
int run_all_tests() {
  int ret = 0;
  if (unit_test_st_aligned_malloc() != 0) {
    ret = -1;
  }
  if (unit_test_st_aligned_realloc() != 0) {
    ret = -1;
  }
  if (unit_test_st_mem_usage() != 0) {
    ret = -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<run_all_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <unit_test_st_aligned_malloc@plt>
cmp    $0x0,%rax
je     1157 <run_all_tests+0x27>
movl   $0xffffffff,-0x4(%rbp)
mov    $0x0,%al
call   1030 <unit_test_st_aligned_realloc@plt>
cmp    $0x0,%rax
je     116f <run_all_tests+0x3f>
movl   $0xffffffff,-0x4(%rbp)
mov    $0x0,%al
call   1050 <unit_test_st_mem_usage@plt>
cmp    $0x0,%rax
je     1187 <run_all_tests+0x57>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_all_tests>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <unit_test_st_aligned_malloc@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1030 <unit_test_st_aligned_realloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <unit_test_st_mem_usage@plt>
or     %rbx,%rax
xor    %ecx,%ecx
or     %r14,%rax
setne  %cl
neg    %ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @run_all_tests() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @unit_test_st_aligned_malloc()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %5
5: ; preds = %4, %0
%6 = call i64 (...) @unit_test_st_aligned_realloc()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 -1, i32* %1
br label %9
9: ; preds = %8, %5
%10 = call i64 (...) @unit_test_st_mem_usage()
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 -1, i32* %1
br label %13
13: ; preds = %12, %9
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @run_all_tests() {
%1 = tail call i64 (...) @unit_test_st_aligned_malloc()
%2 = icmp ne i64 %1, 0
%3 = tail call i64 (...) @unit_test_st_aligned_realloc()
%4 = icmp ne i64 %3, 0
%5 = tail call i64 (...) @unit_test_st_mem_usage()
%6 = icmp ne i64 %5, 0
%7 = select i1 %6, i1 true, i1 %4
%8 = select i1 %7, i1 true, i1 %2
%9 = sext i1 %8 to i32
ret i32 %9
}
int copy_int(const int _val) { return _val; }


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

x86 assembly (clang, -O2):
<copy_int>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @copy_int(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf(
      "usage: exim_lock [-v] [-q] [-lockfile] [-fcntl] [-flock] [-mbx]\n"
      "       [-retries <n>] [-interval <n>] [-timeout <n>] [-restore-times]\n"
      "       <file name> [command]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [164 x i8] c"usage: exim_lock [-v] [-q] [-lockfile] [-fcntl] [-flock] [-mbx]\0A [-retries <n>] [-interval <n>] [-timeout <n>] [-restore-times]\0A <file name> [command]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [163 x i8] c"usage: exim_lock [-v] [-q] [-lockfile] [-fcntl] [-flock] [-mbx]\0A [-retries <n>] [-interval <n>] [-timeout <n>] [-restore-times]\0A <file name> [command]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([163 x i8], [163 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
void XFillPolygon() {}


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

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

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

LLVM IR (-O2):
define void @XFillPolygon() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SHUT_RDWR;
int /*<<< orphan*/ sendMsgToClient(int, char *);
int /*<<< orphan*/ shutdown(int, int /*<<< orphan*/);
void closeWithMsg(char *str, int clientFD) {
  sendMsgToClient(clientFD, str);
  shutdown(clientFD, SHUT_RDWR);
}


x86 assembly (clang, -O0):
<closeWithMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <sendMsgToClient@plt>
mov    -0xc(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
call   1030 <shutdown@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeWithMsg>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
mov    %ebx,%edi
call   1040 <sendMsgToClient@plt>
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
pop    %rbx
jmp    1030 <shutdown@plt>

LLVM IR (-O0):
@SHUT_RDWR = global i32 0
define void @closeWithMsg(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @sendMsgToClient(i32 %5, i8* %6)
%8 = load i32, i32* %4
%9 = load i32, i32* @SHUT_RDWR
%10 = call i32 @shutdown(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@SHUT_RDWR = global i32 0
define void @closeWithMsg(i8* %0, i32 %1) {
%3 = tail call i32 @sendMsgToClient(i32 %1, i8* %0)
%4 = load i32, i32* @SHUT_RDWR
%5 = tail call i32 @shutdown(i32 %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fini();
int /*<<< orphan*/ init();
int /*<<< orphan*/ test();
int main(void) {
  init();
  test();
  fini();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <init@plt>
xor    %eax,%eax
call   1050 <test@plt>
xor    %eax,%eax
call   1030 <fini@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 (...) @test()
%4 = call i32 (...) @fini()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 (...) @test()
%3 = tail call i32 (...) @fini()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MagSensorHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void MagSensorUpdated() { UAVObjUpdated(MagSensorHandle()); }


x86 assembly (clang, -O0):
<MagSensorUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <MagSensorHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MagSensorUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <MagSensorHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @MagSensorUpdated() {
%1 = call i32 (...) @MagSensorHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @MagSensorUpdated() {
%1 = tail call i32 (...) @MagSensorHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
void PUT32(const unsigned int addr, const unsigned int val) {
  *(volatile unsigned int *)addr = val;
}


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

x86 assembly (clang, -O2):
<PUT32>:
mov    %edi,%eax
mov    %esi,(%rax)
ret

LLVM IR (-O0):
define void @PUT32(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 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @PUT32(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = inttoptr i64 %3 to i32*
store volatile i32 %1, i32* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ c_gibberish_to_english(char *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
void process_file(FILE *fp) {
  char line[(1024)];
  assert(fp != NULL);
  while (fgets(line, (1024), fp) != NULL)
    c_gibberish_to_english(line);
}


x86 assembly (clang, -O0):
<process_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x400,%esi
call   1030 <fgets@plt>
cmp    $0x0,%rax
je     1181 <process_file+0x51>
lea    -0x410(%rbp),%rdi
call   1050 <c_gibberish_to_english@plt>
jmp    1151 <process_file+0x21>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_file>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1040 <assert@plt>
mov    %rsp,%rdi
mov    $0x400,%esi
mov    %r14,%rdx
call   1030 <fgets@plt>
test   %rax,%rax
je     118d <process_file+0x5d>
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1050 <c_gibberish_to_english@plt>
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %r14,%rdx
call   1030 <fgets@plt>
test   %rax,%rax
jne    1170 <process_file+0x40>
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @process_file(i32* %0) {
%2 = alloca i32*
%3 = alloca [1024 x i8]
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
br label %8
8: ; preds = %13, %1
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%10 = load i32*, i32** %2
%11 = call i32* @fgets(i8* %9, i32 1024, i32* %10)
%12 = icmp ne i32* %11, null
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%15 = call i32 @c_gibberish_to_english(i8* %14)
br label %8
16: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @process_file(i32* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = icmp ne i32* %0, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = call i32* @fgets(i8* %3, i32 1024, i32* %0)
%8 = icmp eq i32* %7, null
br i1 %8, label %13, label %9
9: ; preds = %1, %9
%10 = call i32 @c_gibberish_to_english(i8* %3)
%11 = call i32* @fgets(i8* %3, i32 1024, i32* %0)
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %9
13: ; preds = %9, %1
ret void
}
/* Variables and functions */
char *file_to_str(char const *);
int /*<<< orphan*/ ycf_symbol_list_print(char *);
void parse_and_print_symbols(const char *file_name) {
  char *content = file_to_str(file_name);
  ycf_symbol_list_print(content);
}


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

x86 assembly (clang, -O2):
<parse_and_print_symbols>:
push   %rax
call   1030 <file_to_str@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <ycf_symbol_list_print@plt>

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

LLVM IR (-O2):
define void @parse_and_print_symbols(i8* %0) {
%2 = tail call i8* @file_to_str(i8* %0)
%3 = tail call i32 @ycf_symbol_list_print(i8* %2)
ret void
}
/* Variables and functions */
int tracepoint_probe_register(char *, void *);
__attribute__((always_)) int register_trace_mm_page_free_direct(
    void (*probe)(struct page *page, unsigned int order)) {
  return tracepoint_probe_register("mm_page_free_direct", (void *)probe);
}


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

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

LLVM IR (-O0):
%struct.page = type opaque
@.str = [20 x i8] c"mm_page_free_direct\00"
define i32 @register_trace_mm_page_free_direct(void (%struct.page*, i32)* %0) {
%2 = alloca void (%struct.page*, i32)*
store void (%struct.page*, i32)* %0, void (%struct.page*, i32)** %2
%3 = load void (%struct.page*, i32)*, void (%struct.page*, i32)** %2
%4 = bitcast void (%struct.page*, i32)* %3 to i8*
%5 = call i32 @tracepoint_probe_register(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.page = type opaque
@.str = [20 x i8] c"mm_page_free_direct\00"
define i32 @register_trace_mm_page_free_direct(void (%struct.page*, i32)* %0) {
%2 = bitcast void (%struct.page*, i32)* %0 to i8*
%3 = tail call i32 @tracepoint_probe_register(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(int *v, int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("%d ", v[i]);
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <print+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <print+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @print(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printnames_util(char *, char *, int, int /*<<< orphan*/);
int strlen(char *);
void printnames(char num[]) {
  int len = strlen(num);
  char str[len + 1];
  printnames_util(num, str, len, 0);
}


x86 assembly (clang, -O0):
<printnames>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %ecx,%ecx
call   1040 <printnames_util@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printnames>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%ecx
mov    %rsp,%rsi
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%rsi
mov    %rsi,%rsp
mov    %rbx,%rdi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <printnames_util@plt>
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @printnames(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %4
%12 = alloca i8, i64 %10
store i64 %10, i64* %5
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = call i32 @printnames_util(i8* %13, i8* %12, i32 %14, i32 0)
%16 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
define void @printnames(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @printnames_util(i8* %0, i8* %5, i32 %2, i32 0)
ret void
}
void gtk_text_iter_ends_word() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_ends_word() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ japi_setnamedcolor(int, int);
void j_setnamedcolor(int arg0, int arg1) { japi_setnamedcolor(arg0, arg1); }


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

x86 assembly (clang, -O2):
<j_setnamedcolor>:
jmp    1030 <japi_setnamedcolor@plt>

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

LLVM IR (-O2):
define void @j_setnamedcolor(i32 %0, i32 %1) {
%3 = tail call i32 @japi_setnamedcolor(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
size_t strlen(char const *);
int /*<<< orphan*/ twrite(char const *, size_t);
void tputs(const char *s) {
  size_t n;
  n = strlen(s);
  twrite(s, n);
}


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

x86 assembly (clang, -O2):
<tputs>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <twrite@plt>

LLVM IR (-O0):
define void @tputs(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
store i64 %5, i64* %3
%6 = load i8*, i8** %2
%7 = load i64, i64* %3
%8 = call i32 @twrite(i8* %6, i64 %7)
ret void
}

LLVM IR (-O2):
define void @tputs(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = tail call i32 @twrite(i8* %0, i64 %2)
ret void
}
void CFGMR3RemoveValue(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3RemoveValue() {
ret void
}
/* Variables and functions */
int rmdir(char const *);
int UnixVfs_rmdir(const char *zPath) {
  int rc;
  rc = rmdir(zPath);
  return rc == 0 ? 0 : -1;
}


x86 assembly (clang, -O0):
<UnixVfs_rmdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rmdir@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UnixVfs_rmdir>:
push   %rax
call   1030 <rmdir@plt>
neg    %eax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @UnixVfs_rmdir(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @rmdir(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 0, i32 -1
ret i32 %9
}

LLVM IR (-O2):
define i32 @UnixVfs_rmdir(i8* nocapture %0) {
%2 = tail call i32 @rmdir(i8* %0)
%3 = icmp ne i32 %2, 0
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void *malloc(int);
void *checked_malloc(int len) {
  void *p = malloc(len);
  assert(p);
  return p;
}


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

x86 assembly (clang, -O2):
<checked_malloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @checked_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @assert(i8* %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @checked_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = tail call i32 @assert(i8* %2)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ ps();
int main(int argc, char **argv) {
  ps();
  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)
mov    $0x0,%al
call   1030 <ps@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <ps@plt>
xor    %eax,%eax
pop    %rcx
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 = call i32 (...) @ps()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @ps()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int fun_stub_base_3_stub(char a) {
  printf("fun_stub_base_3_stub:a = %d \n", a);
  return a;
}


x86 assembly (clang, -O0):
<fun_stub_base_3_stub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_stub_base_3_stub>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"fun_stub_base_3_stub:a = %d \0A\00"
define i32 @fun_stub_base_3_stub(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [30 x i8] c"fun_stub_base_3_stub:a = %d \0A\00"
define i32 @fun_stub_base_3_stub(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = sext i8 %0 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void skip(char *msg) { puts(msg + 6); }


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

x86 assembly (clang, -O2):
<skip>:
add    $0x6,%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
define void @skip(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 6
%5 = call i32 @puts(i8* %4)
ret void
}

LLVM IR (-O2):
define void @skip(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 6
%3 = tail call i32 @puts(i8* %2)
ret void
}
void i2a_ASN1_OBJECT(void) {}


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

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

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

LLVM IR (-O2):
define void @i2a_ASN1_OBJECT() {
ret void
}
/* Variables and functions */
int *malloc(int);
int /*<<< orphan*/ puts(char *);
scalar_t__ test_lt(void *, void *);
int le_different_allocs() {
  volatile int *x = malloc(sizeof(int));
  volatile int *y = malloc(sizeof(int));
  *x = 12;
  *y = 32;
  if (test_lt((void *)x, (void *)y)) {
    puts("LT!");
  }
  return 1;
}


x86 assembly (clang, -O0):
<le_different_allocs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xc,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x20,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <test_lt@plt>
cmp    $0x0,%rax
je     118b <le_different_allocs+0x5b>
lea    0xe7a(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_different_allocs>:
push   %rbx
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0x4,%edi
call   1050 <malloc@plt>
movl   $0xc,(%rbx)
movl   $0x20,(%rax)
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <test_lt@plt>
test   %rax,%rax
je     1170 <le_different_allocs+0x40>
lea    0xe95(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"LT!\00"
define i32 @le_different_allocs() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* @malloc(i32 4)
store i32* %3, i32** %1
%4 = call i32* @malloc(i32 4)
store i32* %4, i32** %2
%5 = load i32*, i32** %1
store volatile i32 12, i32* %5
%6 = load i32*, i32** %2
store volatile i32 32, i32* %6
%7 = load i32*, i32** %1
%8 = bitcast i32* %7 to i8*
%9 = load i32*, i32** %2
%10 = bitcast i32* %9 to i8*
%11 = call i64 @test_lt(i8* %8, i8* %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %0
ret i32 1
}

LLVM IR (-O2):
@.str = [4 x i8] c"LT!\00"
define i32 @le_different_allocs() {
%1 = tail call i32* @malloc(i32 4)
%2 = tail call i32* @malloc(i32 4)
store volatile i32 12, i32* %1
store volatile i32 32, i32* %2
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i64 @test_lt(i8* %3, i8* %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
ret i32 1
}
/* Variables and functions */
double normalizedRand();
int randUnif(int min, int max) {
  double range = (double)(max - min + 1);
  return (normalizedRand() * range) + min;
}


x86 assembly (clang, -O0):
<randUnif>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <normalizedRand@plt>
movsd  -0x10(%rbp),%xmm2
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randUnif>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
sub    %edi,%esi
add    $0x1,%esi
cvtsi2sd %esi,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <normalizedRand@plt>
cvtsi2sd %ebx,%xmm1
mulsd  0x8(%rsp),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @randUnif(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = sitofp i32 %9 to double
store double %10, double* %5
%11 = call double (...) @normalizedRand()
%12 = load double, double* %5
%13 = load i32, i32* %3
%14 = sitofp i32 %13 to double
%15 = call double @llvm.fmuladd.f64(double %11, double %12, double %14)
%16 = fptosi double %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @randUnif(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = sitofp i32 %4 to double
%6 = tail call double (...) @normalizedRand()
%7 = sitofp i32 %0 to double
%8 = tail call double @llvm.fmuladd.f64(double %6, double %5, double %7)
%9 = fptosi double %8 to i32
ret i32 %9
}
void uproc_protresult_free(struct uproc_protresult *results) { (void)results; }


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

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

LLVM IR (-O0):
%struct.uproc_protresult = type opaque
define void @uproc_protresult_free(%struct.uproc_protresult* %0) {
%2 = alloca %struct.uproc_protresult*
store %struct.uproc_protresult* %0, %struct.uproc_protresult** %2
%3 = load %struct.uproc_protresult*, %struct.uproc_protresult** %2
ret void
}

LLVM IR (-O2):
%struct.uproc_protresult = type opaque
define void @uproc_protresult_free(%struct.uproc_protresult* nocapture %0) {
ret void
}
/* Variables and functions */
int asnReadInteger(long *, int);
int asnReadLength(long *);
int asnReadIntegerL(long *value) {
  long length;
  if (asnReadLength(&length) == -1)
    return -1;
  return asnReadInteger(value, (int)length);
}


x86 assembly (clang, -O0):
<asnReadIntegerL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <asnReadLength@plt>
cmp    $0xffffffff,%eax
jne    114a <asnReadIntegerL+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <asnReadIntegerL+0x3c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    %eax,%esi
call   1040 <asnReadInteger@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asnReadIntegerL>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
call   1030 <asnReadLength@plt>
cmp    $0xffffffff,%eax
je     1145 <asnReadIntegerL+0x25>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
call   1040 <asnReadInteger@plt>
jmp    114a <asnReadIntegerL+0x2a>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @asnReadIntegerL(i64* %0) {
%2 = alloca i32
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
%5 = call i32 @asnReadLength(i64* %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %13
8: ; preds = %1
%9 = load i64*, i64** %3
%10 = load i64, i64* %4
%11 = trunc i64 %10 to i32
%12 = call i32 @asnReadInteger(i64* %9, i32 %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %8, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @asnReadIntegerL(i64* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 @asnReadLength(i64* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i64, i64* %2
%8 = trunc i64 %7 to i32
%9 = call i32 @asnReadInteger(i64* %0, i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ -1, %1 ]
ret i32 %11
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int trailz(uint32_t v) {
  static const int bpm37[] = {32, 0, 1,  26, 2,  23, 27, 0,  3,  16, 24, 30, 28,
                              11, 0, 13, 4,  7,  17, 0,  25, 22, 31, 15, 29, 10,
                              12, 6, 0,  21, 14, 9,  5,  20, 8,  19, 18};
  return bpm37[(-v & v) % 37];
}


x86 assembly (clang, -O0):
<trailz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
and    -0x4(%rbp),%eax
mov    $0x25,%ecx
cltd
idiv   %ecx
movslq %edx,%rcx
lea    0xedf(%rip),%rax
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trailz>:
mov    %edi,%eax
neg    %eax
and    %edi,%eax
cltq
imul   $0xffffffffdd67c8a7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
lea    (%rcx,%rcx,8),%edx
lea    (%rcx,%rdx,4),%ecx
sub    %ecx,%eax
cltq
lea    0xed0(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@trailz.bpm37 = internal constant [37 x i32] [i32 32, i32 0, i32 1, i32 26, i32 2, i32 23, i32 27, i32 0, i32 3, i32 16, i32 24, i32 30, i32 28, i32 11, i32 0, i32 13, i32 4, i32 7, i32 17, i32 0, i32 25, i32 22, i32 31, i32 15, i32 29, i32 10, i32 12, i32 6, i32 0, i32 21, i32 14, i32 9, i32 5, i32 20, i32 8, i32 19, i32 18]
define i32 @trailz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 0, %3
%5 = load i32, i32* %2
%6 = and i32 %4, %5
%7 = srem i32 %6, 37
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [37 x i32], [37 x i32]* @trailz.bpm37, i64 0, i64 %8
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
@trailz.bpm37 = internal unnamed_addr constant [37 x i32] [i32 32, i32 0, i32 1, i32 26, i32 2, i32 23, i32 27, i32 0, i32 3, i32 16, i32 24, i32 30, i32 28, i32 11, i32 0, i32 13, i32 4, i32 7, i32 17, i32 0, i32 25, i32 22, i32 31, i32 15, i32 29, i32 10, i32 12, i32 6, i32 0, i32 21, i32 14, i32 9, i32 5, i32 20, i32 8, i32 19, i32 18]
define i32 @trailz(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = and i32 %2, %0
%4 = srem i32 %3, 37
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [37 x i32], [37 x i32]* @trailz.bpm37, i64 0, i64 %5
%7 = load i32, i32* %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ my_strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void my_puterr(char *str) {
  if (str == NULL)
    return;
  write(2, str, my_strlen(str));
}


x86 assembly (clang, -O0):
<my_puterr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <my_puterr+0x1c>
jmp    115d <my_puterr+0x3d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <my_strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1040 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_puterr>:
test   %rdi,%rdi
je     113e <my_puterr+0x1e>
push   %rbx
mov    %rdi,%rbx
call   1030 <my_strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <write@plt>
ret

LLVM IR (-O0):
define void @my_puterr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = load i8*, i8** %2
%9 = call i32 @my_strlen(i8* %8)
%10 = call i32 @write(i32 2, i8* %7, i32 %9)
br label %11
11: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @my_puterr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @my_strlen(i8* %0)
%5 = tail call i32 @write(i32 2, i8* %0, i32 %4)
br label %6
6: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *smalloc(size_t size) {
  void *p = malloc(size);
  if (p == NULL) {
    fprintf(stderr, "There was not enough space on the heap. "
                    "Aborting.\n");
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<smalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <smalloc+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"There was not enough space on the heap. Aborting.\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @smalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"There was not enough space on the heap. Aborting.\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @smalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
/* Variables and functions */
long long __infer_nondet_long_long_int();
long long int llroundl(long double x) { return __infer_nondet_long_long_int(); }


x86 assembly (clang, -O0):
<llroundl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_long_long_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @llroundl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = call i64 (...) @__infer_nondet_long_long_int()
ret i64 %3
}

LLVM IR (-O2):
define i64 @llroundl(x86_fp80 %0) {
%2 = tail call i64 (...) @__infer_nondet_long_long_int()
ret i64 %2
}
/* Variables and functions */
int adjust(int);
scalar_t__ validate_range(int);
int validate_second(int second, int third) {
  return validate_range(second) && second != adjust(third - 2) &&
         second != adjust(third + 2);
}


x86 assembly (clang, -O0):
<validate_second>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <validate_range@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1189 <validate_second+0x69>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <adjust@plt>
mov    -0x10(%rbp),%ecx
mov    %eax,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x9(%rbp)
je     1189 <validate_second+0x69>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
add    $0x2,%edi
call   1030 <adjust@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_second>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebx
call   1040 <validate_range@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     1156 <validate_second+0x36>
lea    -0x2(%r14),%edi
call   1030 <adjust@plt>
cmp    %ebx,%eax
je     1156 <validate_second+0x36>
add    $0x2,%r14d
mov    %r14d,%edi
call   1030 <adjust@plt>
xor    %ebp,%ebp
cmp    %ebx,%eax
setne  %bpl
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @validate_second(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 = call i64 @validate_range(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %10, 2
%12 = call i32 @adjust(i32 %11)
%13 = icmp ne i32 %9, %12
br i1 %13, label %14, label %20
14: ; preds = %8
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 2
%18 = call i32 @adjust(i32 %17)
%19 = icmp ne i32 %15, %18
br label %20
20: ; preds = %14, %8, %2
%21 = phi i1 [ false, %8 ], [ false, %2 ], [ %19, %14 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @validate_second(i32 %0, i32 %1) {
%3 = tail call i64 @validate_range(i32 %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2
%6 = add nsw i32 %1, -2
%7 = tail call i32 @adjust(i32 %6)
%8 = icmp eq i32 %7, %0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = add nsw i32 %1, 2
%11 = tail call i32 @adjust(i32 %10)
%12 = icmp ne i32 %11, %0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %9, %5, %2
%15 = phi i32 [ 0, %5 ], [ 0, %2 ], [ %13, %9 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ glk_exit();
int /*<<< orphan*/ gms_fatal(char *);
void *realloc(void *, size_t);
void *gms_realloc(void *ptr, size_t size) {
  void *pointer;
  pointer = realloc(ptr, size);
  if (!pointer) {
    gms_fatal("GLK: Out of system memory");
    glk_exit();
  }
  return pointer;
}


x86 assembly (clang, -O0):
<gms_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116f <gms_realloc+0x3f>
lea    0xe9d(%rip),%rdi
call   1030 <gms_fatal@plt>
mov    $0x0,%al
call   1050 <glk_exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gms_realloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1151 <gms_realloc+0x21>
lea    0xebb(%rip),%rdi
call   1030 <gms_fatal@plt>
xor    %eax,%eax
call   1050 <glk_exit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"GLK: Out of system memory\00"
define i8* @gms_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = call i32 @gms_fatal(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (...) @glk_exit()
br label %14
14: ; preds = %11, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [26 x i8] c"GLK: Out of system memory\00"
define noalias i8* @gms_realloc(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 %8
5: ; preds = %2
%6 = tail call i32 @gms_fatal(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @glk_exit()
br label %8
8: ; preds = %5, %2
ret i8* %3
}