xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void foo() {
  int i;
  int x;
#pragma omp parallel for private(i) lastprivate(x)
  for (i = 0; i <= 99; i += 1) {
    x = i;
  }
  printf("x=%d", x);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x63,-0x4(%rbp)
jg     113d <foo+0x2d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <foo+0xf>
mov    -0x8(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0xee9(%rip),%rdi
mov    $0x63,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"x=%d\00"
define void @foo() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 99)
ret void
}
/* Variables and functions */
scalar_t__ strlen(char *);
int length(char *s) { return (int)strlen(s); }


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

x86 assembly (clang, -O2):
<length>:
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @length(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @length(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
int hashfunct(char str[], int hash_size) {
  int hashval;
  int locstr;
  hashval = 0;
  locstr = 0;
  while (str[locstr]) {
    hashval = (hashval << 1) + (unsigned char)str[locstr++];
    hashval %= hash_size;
  }
  return hashval;
}


x86 assembly (clang, -O0):
<hashfunct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115d <hashfunct+0x5d>
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    -0x8(%rbp),%rcx
mov    -0x14(%rbp),%edx
mov    %edx,%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
jmp    1119 <hashfunct+0x19>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashfunct>:
mov    (%rdi),%al
test   %al,%al
je     1127 <hashfunct+0x27>
add    $0x1,%rdi
xor    %edx,%edx
nopl   0x0(%rax)
movzbl %al,%eax
lea    (%rax,%rdx,2),%eax
cltd
idiv   %esi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hashfunct+0x10>
mov    %edx,%eax
ret
xor    %edx,%edx
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hashfunct(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = phi i8 [ %15, %5 ], [ %3, %2 ]
%8 = phi i32 [ %13, %5 ], [ 0, %2 ]
%9 = shl i32 %8, 1
%10 = add nuw nsw i64 %6, 1
%11 = zext i8 %7 to i32
%12 = add nsw i32 %9, %11
%13 = srem i32 %12, %1
%14 = getelementptr inbounds i8, i8* %0, i64 %10
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %5, %2
%18 = phi i32 [ 0, %2 ], [ %13, %5 ]
ret i32 %18
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t distance_uint32(uint32_t a, uint32_t b) {
  uint32_t diff;
  diff = a - b;
  if (diff > 0x80000000)
    diff = -diff;
  return diff;
}


x86 assembly (clang, -O0):
<distance_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x80000000,-0xc(%rbp)
jbe    1128 <distance_uint32+0x28>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance_uint32>:
sub    %esi,%edi
mov    %edi,%eax
neg    %eax
cmp    $0x80000001,%edi
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @distance_uint32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ugt i32 %9, -2147483648
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* %5
%13 = sub nsw i32 0, %12
store i32 %13, i32* %5
br label %14
14: ; preds = %11, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @distance_uint32(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = icmp ugt i32 %3, -2147483648
%5 = sub nsw i32 0, %3
%6 = select i1 %4, i32 %5, i32 %3
ret i32 %6
}
int llmnr_timer(struct endpoint *ep) { return 0; }


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

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

LLVM IR (-O0):
%struct.endpoint = type opaque
define i32 @llmnr_timer(%struct.endpoint* %0) {
%2 = alloca %struct.endpoint*
store %struct.endpoint* %0, %struct.endpoint** %2
ret i32 0
}

LLVM IR (-O2):
%struct.endpoint = type opaque
define i32 @llmnr_timer(%struct.endpoint* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int sscanf(int /*<<< orphan*/, char *, int *, int *, char *);
int track_loadtrackaudio_filter(const struct dirent *d) {
  int song_n, track_n;
  char c;
  if (sscanf(d->d_name, "song%d_%d.raw", &song_n, &track_n, &c) == 2)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<track_loadtrackaudio_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x19(%rbp),%r8
call   1030 <sscanf@plt>
cmp    $0x2,%eax
jne    114f <track_loadtrackaudio_filter+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <track_loadtrackaudio_filter+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<track_loadtrackaudio_filter>:
sub    $0x18,%rsp
mov    (%rdi),%edi
lea    0xee3(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xf(%rsp),%r8
call   1030 <sscanf@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
sete   %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
%struct.dirent = type { i32 }
@.str = [14 x i8] c"song%d_%d.raw\00"
define i32 @track_loadtrackaudio_filter(%struct.dirent* nocapture %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @sscanf(i32 %8, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i8* %4)
%10 = icmp eq i32 %9, 2
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
struct obstack {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *__newstream();
int /*<<< orphan*/ init_obstream(int /*<<< orphan*/ *, struct obstack *);
FILE *open_obstack_stream(struct obstack *obstack) {
  FILE *stream;
  stream = __newstream();
  if (stream == NULL)
    return NULL;
  init_obstream(stream, obstack);
  return stream;
}


x86 assembly (clang, -O0):
<open_obstack_stream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <__newstream@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114f <open_obstack_stream+0x2f>
movq   $0x0,-0x8(%rbp)
jmp    1164 <open_obstack_stream+0x44>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <init_obstream@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_obstack_stream>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <__newstream@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <open_obstack_stream+0x21>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <init_obstream@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.obstack = type { i32 }
define i32* @open_obstack_stream(%struct.obstack* %0) {
%2 = tail call i32* (...) @__newstream()
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @init_obstream(i32* %2, %struct.obstack* %0)
br label %6
6: ; preds = %1, %4
ret i32* %2
}
/* Variables and functions */
scalar_t__ EBADF;
int /*<<< orphan*/ F_GETFL;
scalar_t__ errno;
int fcntl(int, int /*<<< orphan*/);
int is_valid_fd(int fd) {
  int res = fcntl(fd, F_GETFL);
  return res != -1 || errno != EBADF;
}


x86 assembly (clang, -O0):
<is_valid_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0xffffffff,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jne    1158 <is_valid_fd+0x48>
mov    0x2e9b(%rip),%rax
mov    (%rax),%rax
mov    0x2e81(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_fd>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
setne  %al
mov    0x2eb4(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2e9a(%rip),%rdx
cmp    (%rdx),%rcx
setne  %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@errno = global i64 0
@EBADF = global i64 0
define i32 @is_valid_fd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, -1
br i1 %8, label %13, label %9
9: ; preds = %1
%10 = load i64, i64* @errno
%11 = load i64, i64* @EBADF
%12 = icmp ne i64 %10, %11
br label %13
13: ; preds = %9, %1
%14 = phi i1 [ true, %1 ], [ %12, %9 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@errno = global i64 0
@EBADF = global i64 0
define i32 @is_valid_fd(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2)
%4 = icmp ne i32 %3, -1
%5 = load i64, i64* @errno
%6 = load i64, i64* @EBADF
%7 = icmp ne i64 %5, %6
%8 = select i1 %4, i1 true, i1 %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ meta_accept_payment(int *, int *, int, char *);
int *safe_malloc(int);
void accept_payment_abort_returns_neg1(int stats[3]) {
  int *cb;
  cb = safe_malloc(sizeof(*cb) * 8);
  meta_accept_payment(stats, cb, -1,
                      "  -Abort (press enter or ctrl-d at the prompt)...");
  free(cb);
}


x86 assembly (clang, -O0):
<accept_payment_abort_returns_neg1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x20,%edi
call   1040 <safe_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xffffffff,%edx
lea    0xea2(%rip),%rcx
call   1050 <meta_accept_payment@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accept_payment_abort_returns_neg1>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x20,%edi
call   1040 <safe_malloc@plt>
mov    %rax,%rbx
lea    0xeb5(%rip),%rcx
mov    %r14,%rdi
mov    %rax,%rsi
mov    $0xffffffff,%edx
call   1050 <meta_accept_payment@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [50 x i8] c" -Abort (press enter or ctrl-d at the prompt)...\00"
define void @accept_payment_abort_returns_neg1(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = call i32* @safe_malloc(i32 32)
store i32* %4, i32** %3
%5 = load i32*, i32** %2
%6 = load i32*, i32** %3
%7 = call i32 @meta_accept_payment(i32* %5, i32* %6, i32 -1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%8 = load i32*, i32** %3
%9 = call i32 @free(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c" -Abort (press enter or ctrl-d at the prompt)...\00"
define void @accept_payment_abort_returns_neg1(i32* %0) {
%2 = tail call i32* @safe_malloc(i32 32)
%3 = tail call i32 @meta_accept_payment(i32* %0, i32* %2, i32 -1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @free(i32* %2)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t ivory_serialize_unpack_prim_2_le(const uint8_t *src) {
  return (((uint16_t)src[0] << 0) | ((uint16_t)src[1] << 8));
}


x86 assembly (clang, -O0):
<ivory_serialize_unpack_prim_2_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x0,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_unpack_prim_2_le>:
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ivory_serialize_unpack_prim_2_le(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 0
%8 = load i64*, i64** %2
%9 = getelementptr inbounds i64, i64* %8, i64 1
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 8
%13 = or i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @ivory_serialize_unpack_prim_2_le(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
void xmlvm_unimplemented_native_method() {
  XMLVM_ERROR(
      "Unimplemented native method",
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/chukong/sdkbox-facebook-sample-v2/refs/heads/"
      "master/DR/external/emscripten/tests/nbody-java/xmlvm.c",
      __FUNCTION__, 557);
}


x86 assembly (clang, -O0):
<xmlvm_unimplemented_native_method>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xefa(%rip),%rsi
lea    0xfb1(%rip),%rdx
mov    $0x22d,%ecx
mov    $0x0,%al
call   1030 <XMLVM_ERROR@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlvm_unimplemented_native_method>:
lea    0xee9(%rip),%rdi
lea    0xefe(%rip),%rsi
lea    0xfb5(%rip),%rdx
mov    $0x22d,%ecx
xor    %eax,%eax
jmp    1030 <XMLVM_ERROR@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Unimplemented native method\00"
@.str.1 = [190 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/chukong/sdkbox-facebook-sample-v2/refs/heads/master/DR/external/emscripten/tests/nbody-java/xmlvm.c\00"
@__FUNCTION__.xmlvm_unimplemented_native_method = [34 x i8] c"xmlvm_unimplemented_native_method\00"
define void @xmlvm_unimplemented_native_method() {
%1 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @XMLVM_ERROR to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([190 x i8], [190 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @__FUNCTION__.xmlvm_unimplemented_native_method, i64 0, i64 0), i32 557)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Unimplemented native method\00"
@.str.1 = [190 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/chukong/sdkbox-facebook-sample-v2/refs/heads/master/DR/external/emscripten/tests/nbody-java/xmlvm.c\00"
@__FUNCTION__.xmlvm_unimplemented_native_method = [34 x i8] c"xmlvm_unimplemented_native_method\00"
define void @xmlvm_unimplemented_native_method() {
%1 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @XMLVM_ERROR to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([190 x i8], [190 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @__FUNCTION__.xmlvm_unimplemented_native_method, i64 0, i64 0), i32 557)
ret void
}
/* Type definitions */
struct gamestate {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ aligned_free(struct gamestate *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ hash_tt_destroy_table();
void destroy_game_state(struct gamestate *state) {
  assert(state != NULL);
  hash_tt_destroy_table();
  aligned_free(state);
}


x86 assembly (clang, -O0):
<destroy_game_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x0,%al
call   1050 <hash_tt_destroy_table@plt>
mov    -0x8(%rbp),%rdi
call   1030 <aligned_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_game_state>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
xor    %eax,%eax
call   1050 <hash_tt_destroy_table@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <aligned_free@plt>

LLVM IR (-O0):
%struct.gamestate = type { i32 }
define void @destroy_game_state(%struct.gamestate* %0) {
%2 = alloca %struct.gamestate*
store %struct.gamestate* %0, %struct.gamestate** %2
%3 = load %struct.gamestate*, %struct.gamestate** %2
%4 = icmp ne %struct.gamestate* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = call i32 (...) @hash_tt_destroy_table()
%8 = load %struct.gamestate*, %struct.gamestate** %2
%9 = call i32 @aligned_free(%struct.gamestate* %8)
ret void
}

LLVM IR (-O2):
%struct.gamestate = type { i32 }
define void @destroy_game_state(%struct.gamestate* %0) {
%2 = icmp ne %struct.gamestate* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 (...) @hash_tt_destroy_table()
%6 = tail call i32 @aligned_free(%struct.gamestate* %0)
ret void
}
void lerrif(msg, arg) const char msg[];
int arg;
{
  char errmsg[2048];
  (void)sprintf(errmsg, msg, arg);
  flexerror(errmsg);
}


x86 assembly (clang, -O0):
<lerrif>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x810(%rbp),%rdi
mov    $0x0,%al
call   1030 <flexerror@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerrif>:
push   %rbx
sub    $0x800,%rsp
mov    %esi,%edx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <flexerror@plt>
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @lerrif(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [2048 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* %7, i32 %8)
%10 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @flexerror to i32 (i8*, ...)*)(i8* %10)
ret void
}

LLVM IR (-O2):
define void @lerrif(i8* nocapture %0, i32 %1) {
%3 = alloca [2048 x i8]
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) %0, i32 %1)
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @flexerror to i32 (i8*, ...)*)(i8* %4)
ret void
}
/* Variables and functions */
void free(void *);
void __rehash_dealloc(void *cc, void *mem) { return free(mem); }


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

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

LLVM IR (-O0):
define void @__rehash_dealloc(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
ret void
}

LLVM IR (-O2):
define void @__rehash_dealloc(i8* nocapture readnone %0, i8* nocapture %1) {
tail call void @free(i8* %1)
ret void
}
/* Type definitions */
struct ebpt_node {
  int dummy;
};
struct eb_root {
  int dummy;
};
struct eb64_node {
  int dummy;
};
struct eb32_node {
  int dummy;
};

/* Variables and functions */
scalar_t__ eb32_insert(struct eb_root *, struct eb32_node *);
scalar_t__ eb64_insert(struct eb_root *, struct eb64_node *);
struct ebpt_node *ebpt_insert(struct eb_root *root, struct ebpt_node *new) {
  if (sizeof(void *) == 4)
    return (struct ebpt_node *)eb32_insert(root, (struct eb32_node *)new);
  else
    return (struct ebpt_node *)eb64_insert(root, (struct eb64_node *)new);
}


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

x86 assembly (clang, -O2):
<ebpt_insert>:
jmp    1030 <eb64_insert@plt>

LLVM IR (-O0):
%struct.eb_root = type { i32 }
%struct.ebpt_node = type { i32 }
%struct.eb64_node = type { i32 }
define %struct.ebpt_node* @ebpt_insert(%struct.eb_root* %0, %struct.ebpt_node* %1) {
%3 = alloca %struct.eb_root*
%4 = alloca %struct.ebpt_node*
store %struct.eb_root* %0, %struct.eb_root** %3
store %struct.ebpt_node* %1, %struct.ebpt_node** %4
%5 = load %struct.eb_root*, %struct.eb_root** %3
%6 = load %struct.ebpt_node*, %struct.ebpt_node** %4
%7 = bitcast %struct.ebpt_node* %6 to %struct.eb64_node*
%8 = call i64 @eb64_insert(%struct.eb_root* %5, %struct.eb64_node* %7)
%9 = inttoptr i64 %8 to %struct.ebpt_node*
ret %struct.ebpt_node* %9
}

LLVM IR (-O2):
%struct.eb_root = type { i32 }
%struct.ebpt_node = type { i32 }
%struct.eb64_node = type { i32 }
define %struct.ebpt_node* @ebpt_insert(%struct.eb_root* %0, %struct.ebpt_node* %1) {
%3 = bitcast %struct.ebpt_node* %1 to %struct.eb64_node*
%4 = tail call i64 @eb64_insert(%struct.eb_root* %0, %struct.eb64_node* %3)
%5 = inttoptr i64 %4 to %struct.ebpt_node*
ret %struct.ebpt_node* %5
}
int cmp_long(const void *aa, const void *bb) {
  const long *a = aa, *b = bb;
  return (*a < *b) ? -1 : (*a > *b);
}


x86 assembly (clang, -O0):
<cmp_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%rax
jge    113d <cmp_long+0x3d>
mov    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1156 <cmp_long+0x56>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_long>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_long(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i64*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
store i64* %8, i64** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i64*
store i64* %10, i64** %6
%11 = load i64*, i64** %5
%12 = load i64, i64* %11
%13 = load i64*, i64** %6
%14 = load i64, i64* %13
%15 = icmp slt i64 %12, %14
br i1 %15, label %16, label %17
16: ; preds = %2
br label %24
17: ; preds = %2
%18 = load i64*, i64** %5
%19 = load i64, i64* %18
%20 = load i64*, i64** %6
%21 = load i64, i64* %20
%22 = icmp sgt i64 %19, %21
%23 = zext i1 %22 to i32
br label %24
24: ; preds = %17, %16
%25 = phi i32 [ -1, %16 ], [ %23, %17 ]
ret i32 %25
}

LLVM IR (-O2):
define i32 @cmp_long(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
%8 = icmp sgt i64 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void CalibrationManager_Initialize(void) {}


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

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

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

LLVM IR (-O2):
define void @CalibrationManager_Initialize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int main(int argc, char *argv[]) {
  char *s1, *s2;
  s1 = (char *)malloc(sizeof(char) * 20);
  s2 = (char *)malloc(sizeof(char) * 40);
  free(s2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@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**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i64 @malloc(i32 20)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %6
%10 = call i64 @malloc(i32 40)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = call i32 @free(i8* %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 20)
%4 = tail call i64 @malloc(i32 40)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @free(i8* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
swapstk() { ol("mov.l\t(%sp)+,%d2\nmov.l\t%d0,-(%sp)\nmov.l\t%d2,%d0"); }


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"mov.l\09(%sp)+,%d2\0Amov.l\09%d0,-(%sp)\0Amov.l\09%d2,%d0\00"
define i32 @swapstk() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [48 x i8] c"mov.l\09(%sp)+,%d2\0Amov.l\09%d0,-(%sp)\0Amov.l\09%d2,%d0\00"
define i32 @swapstk() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
long long zuus() { return 0x00007fff7fffffffLL; }


x86 assembly (clang, -O0):
<zuus>:
push   %rbp
mov    %rsp,%rbp
movabs $0x7fff7fffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zuus>:
movabs $0x7fff7fffffff,%rax
ret

LLVM IR (-O0):
define i64 @zuus() {
ret i64 140735340871679
}

LLVM IR (-O2):
define i64 @zuus() {
ret i64 140735340871679
}
/* Variables and functions */
double atan2(double, double);
double Datan2(double x, double y) { return atan2(x, y); }


x86 assembly (clang, -O0):
<Datan2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <atan2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Datan2>:
jmp    1030 <atan2@plt>

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

LLVM IR (-O2):
define double @Datan2(double %0, double %1) {
%3 = tail call double @atan2(double %0, double %1)
ret double %3
}
void proc_exit() {}


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

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

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

LLVM IR (-O2):
define void @proc_exit() {
ret void
}
int rightrot(int x, int n) {
  int temp = ~0;
  int i;
  temp = ~(temp << n);
  temp = temp & x;
  for (int j = 1, i = 1; j <= x - 1; i++)
    j *= 2;
  for (i; i - n > 0; i--)
    temp *= 2;
  x = temp + (x >> n);
}


x86 assembly (clang, -O0):
<rightrot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     115e <rightrot+0x5e>
mov    -0x18(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1136 <rightrot+0x36>
mov    -0x14(%rbp),%eax
sub    -0xc(%rbp),%eax
cmp    $0x0,%eax
jle    1184 <rightrot+0x84>
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    115e <rightrot+0x5e>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rightrot(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 -1, i32* %6
%10 = load i32, i32* %6
%11 = load i32, i32* %5
%12 = shl i32 %10, %11
%13 = xor i32 %12, -1
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %4
%16 = and i32 %14, %15
store i32 %16, i32* %6
store i32 1, i32* %8
store i32 1, i32* %9
br label %17
17: ; preds = %25, %2
%18 = load i32, i32* %8
%19 = load i32, i32* %4
%20 = sub nsw i32 %19, 1
%21 = icmp sle i32 %18, %20
br i1 %21, label %22, label %28
22: ; preds = %17
%23 = load i32, i32* %8
%24 = mul nsw i32 %23, 2
store i32 %24, i32* %8
br label %25
25: ; preds = %22
%26 = load i32, i32* %9
%27 = add nsw i32 %26, 1
store i32 %27, i32* %9
br label %17
28: ; preds = %17
%29 = load i32, i32* %7
br label %30
30: ; preds = %38, %28
%31 = load i32, i32* %7
%32 = load i32, i32* %5
%33 = sub nsw i32 %31, %32
%34 = icmp sgt i32 %33, 0
br i1 %34, label %35, label %41
35: ; preds = %30
%36 = load i32, i32* %6
%37 = mul nsw i32 %36, 2
store i32 %37, i32* %6
br label %38
38: ; preds = %35
%39 = load i32, i32* %7
%40 = add nsw i32 %39, -1
store i32 %40, i32* %7
br label %30
41: ; preds = %30
%42 = load i32, i32* %6
%43 = load i32, i32* %4
%44 = load i32, i32* %5
%45 = ashr i32 %43, %44
%46 = add nsw i32 %42, %45
store i32 %46, i32* %4
%47 = load i32, i32* %3
ret i32 %47
}

LLVM IR (-O2):
define i32 @rightrot(i32 %0, i32 %1) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int gob_encode_int64(char *, size_t, int /*<<< orphan*/);
int gob_encode_type(char *buf, size_t buf_size, int id) {
  return gob_encode_int64(buf, buf_size, (int64_t)id);
}


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

x86 assembly (clang, -O2):
<gob_encode_type>:
jmp    1030 <gob_encode_int64@plt>

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

LLVM IR (-O2):
define i32 @gob_encode_type(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 @gob_encode_int64(i8* %0, i64 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ int80(int, void **, int, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
void *malloc(int bytes) {
  void *address;
  int80(1, &address, bytes, 0, 0, 0);
  return address;
}


x86 assembly (clang, -O0):
<malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x1,%edi
lea    -0x10(%rbp),%rsi
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <int80@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc>:
push   %rax
mov    %edi,%edx
mov    %rsp,%rsi
mov    $0x1,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <int80@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @malloc(i32 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @int80(i32 1, i8** %2, i32 %0, i32 0, i32 0, i32 0)
%5 = load i8*, i8** %2
ret i8* %5
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *, char *);
char *trafficd_ctime(int);
int main(int argc, const char *argv[]) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  printf("%s %s\n", ctime(&tv.tv_sec), trafficd_ctime(1413378269));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <gettimeofday@plt>
lea    -0x18(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x20(%rbp)
mov    $0x543e70dd,%edi
call   1060 <trafficd_ctime@plt>
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <gettimeofday@plt>
mov    %rbx,%rdi
call   1030 <ctime@plt>
mov    %rax,%rbx
mov    $0x543e70dd,%edi
call   1060 <trafficd_ctime@plt>
lea    0xe90(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
@.str = [7 x i8] c"%s %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.timeval
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @gettimeofday(%struct.timeval* %6, i32* null)
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%9 = call i8* @ctime(i32* %8)
%10 = call i8* @trafficd_ctime(i32 1413378269)
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@.str = [7 x i8] c"%s %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%7 = call i8* @ctime(i32* %6)
%8 = call i8* @trafficd_ctime(i32 1413378269)
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
int numa_num_configured_cpus();
void *je_malloc(size_t size) {
  if (size == (sizeof(unsigned int) * numa_num_configured_cpus())) {
    return malloc(size);
  } else {
    return NULL;
  }
}


x86 assembly (clang, -O0):
<je_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <numa_num_configured_cpus@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
cmp    %rcx,%rax
jne    1163 <je_malloc+0x43>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
jmp    116b <je_malloc+0x4b>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<je_malloc>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <numa_num_configured_cpus@plt>
cltq
shl    $0x2,%rax
cmp    %rbx,%rax
jne    113f <je_malloc+0x1f>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <malloc@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @je_malloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = call i32 (...) @numa_num_configured_cpus()
%6 = sext i32 %5 to i64
%7 = mul i64 4, %6
%8 = icmp eq i64 %4, %7
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i64, i64* %3
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %2
br label %13
12: ; preds = %1
store i8* null, i8** %2
br label %13
13: ; preds = %12, %9
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @je_malloc(i64 %0) {
%2 = tail call i32 (...) @numa_num_configured_cpus()
%3 = sext i32 %2 to i64
%4 = shl nsw i64 %3, 2
%5 = icmp eq i64 %4, %0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i8* @malloc(i64 %0)
br label %8
8: ; preds = %1, %6
%9 = phi i8* [ %7, %6 ], [ null, %1 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int zclose(void *zs) {
  free(zs);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @zclose(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int const);
void displayNums(const int numbers[]) {
  int i;
  for (i = 0; i < 4; i++) {
    printf("Nums[%i] = %i\n", i, numbers[i]);
  }
}


x86 assembly (clang, -O0):
<displayNums>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1155 <displayNums+0x45>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <displayNums+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayNums>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%edx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    0x4(%rbx),%edx
mov    %r14,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    0x8(%rbx),%edx
mov    %r14,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    0xc(%rbx),%edx
mov    %r14,%rdi
mov    $0x3,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"Nums[%i] = %i\0A\00"
define void @displayNums(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 0, i32 %2)
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 1, i32 %5)
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 2, i32 %8)
%10 = getelementptr inbounds i32, i32* %0, i64 3
%11 = load i32, i32* %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 3, i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, char *);
void yahoo_wr_init(const char *fname) {
  fatal("Writing file of type %s is not supported\n", "yahoo");
}


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

x86 assembly (clang, -O2):
<yahoo_wr_init>:
lea    0xee9(%rip),%rdi
lea    0xf0c(%rip),%rsi
jmp    1030 <fatal@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Writing file of type %s is not supported\0A\00"
@.str.1 = [6 x i8] c"yahoo\00"
define void @yahoo_wr_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @fatal(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"Writing file of type %s is not supported\0A\00"
@.str.1 = [6 x i8] c"yahoo\00"
define void @yahoo_wr_init(i8* nocapture readnone %0) {
%2 = tail call i32 @fatal(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void I_UpdateNoBlit(void) {}


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

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

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

LLVM IR (-O2):
define void @I_UpdateNoBlit() {
ret void
}
unsigned char f63(unsigned char x, int y) {
  return (x << (8 * sizeof(unsigned char) - y)) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f63>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
movslq -0x8(%rbp),%rdx
mov    $0x8,%ecx
sub    %rdx,%rcx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f63>:
mov    $0x8,%cl
sub    %sil,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f63(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = sub i64 8, %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %6, %10
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = load i32, i32* %4
%15 = ashr i32 %13, %14
%16 = xor i32 %11, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @f63(i8 zeroext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = sub i32 8, %1
%5 = shl i32 %3, %4
%6 = lshr i32 %3, %1
%7 = xor i32 %5, %6
%8 = trunc i32 %7 to i8
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ net_connect(char *, char *);
void irc_connect(char *address, char *port) { net_connect(address, port); }


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

x86 assembly (clang, -O2):
<irc_connect>:
jmp    1030 <net_connect@plt>

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

LLVM IR (-O2):
define void @irc_connect(i8* %0, i8* %1) {
%3 = tail call i32 @net_connect(i8* %0, i8* %1)
ret void
}