xunge/DecIR huggingface dataset:
/* Variables and functions */
short oled_write(unsigned long);
short printNumber(unsigned long, int);
short printNumber_UL(unsigned long n, int base) {
  if (base == 0)
    return oled_write(n);
  else
    return printNumber(n, base);
}


x86 assembly (clang, -O0):
<printNumber_UL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    114b <printNumber_UL+0x2b>
mov    -0x10(%rbp),%rdi
call   1030 <oled_write@plt>
mov    %ax,-0x2(%rbp)
jmp    115b <printNumber_UL+0x3b>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <printNumber@plt>
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printNumber_UL>:
test   %esi,%esi
je     1129 <printNumber_UL+0x9>
jmp    1040 <printNumber@plt>
jmp    1030 <oled_write@plt>

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

LLVM IR (-O2):
define signext i16 @printNumber_UL(i64 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call signext i16 @oled_write(i64 %0)
br label %8
6: ; preds = %2
%7 = tail call signext i16 @printNumber(i64 %0, i32 %1)
br label %8
8: ; preds = %6, %4
%9 = phi i16 [ %5, %4 ], [ %7, %6 ]
ret i16 %9
}
/* Type definitions */
struct message {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ do_send_msg(struct message *);
int /*<<< orphan*/ logprintf(char *);
int /*<<< orphan*/ print_message(struct message *);
void __send_msg(struct message *M) {
  logprintf("Resending message...\n");
  print_message(M);
  do_send_msg(M);
}


x86 assembly (clang, -O0):
<__send_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1050 <logprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <print_message@plt>
mov    -0x8(%rbp),%rdi
call   1040 <do_send_msg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__send_msg>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1050 <logprintf@plt>
mov    %rbx,%rdi
call   1030 <print_message@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <do_send_msg@plt>

LLVM IR (-O0):
%struct.message = type { i32 }
@.str = [22 x i8] c"Resending message...\0A\00"
define void @__send_msg(%struct.message* %0) {
%2 = alloca %struct.message*
store %struct.message* %0, %struct.message** %2
%3 = call i32 @logprintf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = load %struct.message*, %struct.message** %2
%5 = call i32 @print_message(%struct.message* %4)
%6 = load %struct.message*, %struct.message** %2
%7 = call i32 @do_send_msg(%struct.message* %6)
ret void
}

LLVM IR (-O2):
%struct.message = type { i32 }
@.str = [22 x i8] c"Resending message...\0A\00"
define void @__send_msg(%struct.message* %0) {
%2 = tail call i32 @logprintf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @print_message(%struct.message* %0)
%4 = tail call i32 @do_send_msg(%struct.message* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int ffsll(int /*<<< orphan*/);
int bitmap64_ffs(int64_t *bitmap) { return ffsll(*bitmap) - 1; }


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

x86 assembly (clang, -O2):
<bitmap64_ffs>:
mov    (%rdi),%eax
bsf    %eax,%ecx
mov    $0xffffffff,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @bitmap64_ffs(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @llvm.cttz.i32(i32 %2, i1 true)
%4 = icmp eq i32 %2, 0
%5 = select i1 %4, i32 -1, i32 %3
ret i32 %5
}
extern int shared_triple(int x) { return x * 3; }


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

x86 assembly (clang, -O2):
<shared_triple>:
lea    (%rdi,%rdi,2),%eax
ret

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

LLVM IR (-O2):
define i32 @shared_triple(i32 %0) {
%2 = mul nsw i32 %0, 3
ret i32 %2
}
/* Variables and functions */
char *file___NativeString_file_realpath___impl(char *);
char *core__file___NativeString___file_realpath(char *self) {
  char *var;
  char *var1;
  var1 = file___NativeString_file_realpath___impl(self);
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


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

x86 assembly (clang, -O2):
<core__file___NativeString___file_realpath>:
jmp    1030 <file___NativeString_file_realpath___impl@plt>

LLVM IR (-O0):
define i8* @core__file___NativeString___file_realpath(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @file___NativeString_file_realpath___impl(i8* %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
store i8* %7, i8** %3
br label %8
8: ; preds = %1
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @core__file___NativeString___file_realpath(i8* %0) {
%2 = tail call i8* @file___NativeString_file_realpath___impl(i8* %0)
ret i8* %2
}
/* Variables and functions */
int strlen(char *);
void zchomp(char *s) {
  int i;
  i = strlen(s) - 1;
  while (i >= 0 && s[i] < 32)
    s[i--] = 0;
}


x86 assembly (clang, -O0):
<zchomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jl     114f <zchomp+0x3f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    115f <zchomp+0x4f>
jmp    117a <zchomp+0x6a>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0xffffffff,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    112b <zchomp+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zchomp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    1147 <zchomp+0x37>
mov    %eax,%eax
add    $0x1,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x2(%rax),%ecx
cmpb   $0x1f,(%rbx,%rcx,1)
jg     1147 <zchomp+0x37>
movb   $0x0,(%rbx,%rcx,1)
add    $0xffffffffffffffff,%rax
cmp    $0x1,%rax
ja     1130 <zchomp+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @zchomp(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %15
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %13
%7 = phi i64 [ %5, %4 ], [ %8, %13 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp slt i8 %11, 32
br i1 %12, label %13, label %15
13: ; preds = %6
store i8 0, i8* %10
%14 = icmp ugt i64 %7, 1
br i1 %14, label %6, label %15
15: ; preds = %6, %13, %1
ret void
}
int push(int *stack, int top, int x) {
  top = top + 1;
  stack[top] = x;
  return top;
}


x86 assembly (clang, -O0):
<push>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<push>:
movslq %esi,%rcx
lea    0x1(%rsi),%eax
mov    %edx,0x4(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define i32 @push(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = add nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i32, i32* %6
%10 = load i32*, i32** %4
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
store i32 %9, i32* %13
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @push(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, 1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
store i32 %2, i32* %6
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int create_socket() { return socket(AF_INET, SOCK_STREAM, 0); }


x86 assembly (clang, -O0):
<create_socket>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_socket>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <socket@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
define i32 @create_socket() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = call i32 @socket(i32 %1, i32 %2, i32 0)
ret i32 %3
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
define i32 @create_socket() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int NSIG;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int /*<<< orphan*/ __sigdelset(int /*<<< orphan*/ *, int);
int sigdelset(sigset_t *set, int signo) {
  if (set == NULL || signo <= 0 || signo >= NSIG) {
    __set_errno(EINVAL);
    return -1;
  }
  __sigdelset(set, signo);
  return 0;
}


x86 assembly (clang, -O0):
<sigdelset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1156 <sigdelset+0x36>
cmpl   $0x0,-0x14(%rbp)
jle    1156 <sigdelset+0x36>
mov    -0x14(%rbp),%eax
mov    0x2e8a(%rip),%rcx
cmp    (%rcx),%eax
jl     1170 <sigdelset+0x50>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1183 <sigdelset+0x63>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <__sigdelset@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigdelset>:
push   %rax
test   %rdi,%rdi
je     113e <sigdelset+0x1e>
test   %esi,%esi
jle    113e <sigdelset+0x1e>
mov    0x2ea7(%rip),%rax
cmp    %esi,(%rax)
jle    113e <sigdelset+0x1e>
call   1040 <__sigdelset@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@NSIG = global i32 0
@EINVAL = global i32 0
define i32 @sigdelset(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32*, i32** %4
%7 = icmp eq i32* %6, null
br i1 %7, label %15, label %8
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp sle i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = load i32, i32* %5
%13 = load i32, i32* @NSIG
%14 = icmp sge i32 %12, %13
br i1 %14, label %15, label %18
15: ; preds = %11, %8, %2
%16 = load i32, i32* @EINVAL
%17 = call i32 @__set_errno(i32 %16)
store i32 -1, i32* %3
br label %22
18: ; preds = %11
%19 = load i32*, i32** %4
%20 = load i32, i32* %5
%21 = call i32 @__sigdelset(i32* %19, i32 %20)
store i32 0, i32* %3
br label %22
22: ; preds = %18, %15
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@NSIG = global i32 0
@EINVAL = global i32 0
define i32 @sigdelset(i32* %0, i32 %1) {
%3 = icmp ne i32* %0, null
%4 = icmp sgt i32 %1, 0
%5 = and i1 %3, %4
%6 = load i32, i32* @NSIG
%7 = icmp sgt i32 %6, %1
%8 = select i1 %5, i1 %7, i1 false
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i32, i32* @EINVAL
%11 = tail call i32 @__set_errno(i32 %10)
br label %14
12: ; preds = %2
%13 = tail call i32 @__sigdelset(i32* %0, i32 %1)
br label %14
14: ; preds = %12, %9
%15 = phi i32 [ -1, %9 ], [ 0, %12 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printArray(int *pt, int size) {
  int i, u;
  for (i = 0; i < size; i++) {
    u = pt[i];
    printf("%d\t", u);
  }
}


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

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <printArray+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 <printArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
define void @printArray(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
}
int gcd(int a, int b) {
  if (a % b == 0) {
    return b;
  }
  return gcd(b, a % b);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1139 <gcd+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114d <gcd+0x3d>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%edx
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %5, %3 ]
%5 = phi i32 [ %1, %2 ], [ %6, %3 ]
%6 = srem i32 %4, %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int volatile uint32_t;

/* Variables and functions */
uint8_t direct_check32(volatile uint32_t *addr, uint32_t dat) {
  return ((*addr & dat) ? 1 : 0);
}


x86 assembly (clang, -O0):
<direct_check32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0xc(%rbp),%eax
and    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<direct_check32>:
mov    %esi,-0x4(%rsp)
mov    (%rdi),%ecx
xor    %eax,%eax
and    -0x4(%rsp),%ecx
setne  %al
ret

LLVM IR (-O0):
define i32 @direct_check32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store volatile i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load volatile i32, i32* %5
%7 = load volatile i32, i32* %4
%8 = and i32 %6, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @direct_check32(i32* %0, i32 %1) {
%3 = alloca i32
store volatile i32 %1, i32* %3
%4 = load volatile i32, i32* %0
%5 = load volatile i32, i32* %3
%6 = and i32 %5, %4
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
struct h2get_hpack_ctx {
  int dummy;
};

/* Variables and functions */
void h2get_hpack_ctx_resize(struct h2get_hpack_ctx *hhc, size_t dyn_size) {
  return;
}


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

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

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

LLVM IR (-O2):
%struct.h2get_hpack_ctx = type { i32 }
define void @h2get_hpack_ctx_resize(%struct.h2get_hpack_ctx* nocapture %0, i64 %1) {
ret void
}
/* Variables and functions */
__attribute__((section(".after_vectors"))) void NMI_Handler(void) {
  while (1) {
  }
}


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

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

LLVM IR (-O0):
define void @NMI_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @NMI_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
struct gdbserv {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gdbserv_input_data_packet(struct gdbserv *, char const *,
                                             int);
int /*<<< orphan*/ log_state(struct gdbserv *, char *);
void gdbserv_fromclient_data(struct gdbserv *gdbserv, const char *buf,
                             int len) {
  log_state(gdbserv, "gdbserv_fromclient_data");
  gdbserv_input_data_packet(gdbserv, buf, len);
}


x86 assembly (clang, -O0):
<gdbserv_fromclient_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1040 <log_state@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <gdbserv_input_data_packet@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdbserv_fromclient_data>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0xecc(%rip),%rsi
call   1040 <log_state@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <gdbserv_input_data_packet@plt>

LLVM IR (-O0):
%struct.gdbserv = type { i32 }
@.str = [24 x i8] c"gdbserv_fromclient_data\00"
define void @gdbserv_fromclient_data(%struct.gdbserv* %0, i8* %1, i32 %2) {
%4 = alloca %struct.gdbserv*
%5 = alloca i8*
%6 = alloca i32
store %struct.gdbserv* %0, %struct.gdbserv** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.gdbserv*, %struct.gdbserv** %4
%8 = call i32 @log_state(%struct.gdbserv* %7, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%9 = load %struct.gdbserv*, %struct.gdbserv** %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @gdbserv_input_data_packet(%struct.gdbserv* %9, i8* %10, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.gdbserv = type { i32 }
@.str = [24 x i8] c"gdbserv_fromclient_data\00"
define void @gdbserv_fromclient_data(%struct.gdbserv* %0, i8* %1, i32 %2) {
%4 = tail call i32 @log_state(%struct.gdbserv* %0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @gdbserv_input_data_packet(%struct.gdbserv* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ X_OK;
int /*<<< orphan*/ access(char *, int /*<<< orphan*/);
int is_inthisdir(char *cmd) {
  if (!access(cmd, X_OK)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_inthisdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0x0,%eax
jne    1143 <is_inthisdir+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <is_inthisdir+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_inthisdir>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@X_OK = global i32 0
define i32 @is_inthisdir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* @X_OK
%6 = call i32 @access(i8* %4, i32 %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@X_OK = global i32 0
define i32 @is_inthisdir(i8* nocapture %0) {
%2 = load i32, i32* @X_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void RTStrmPrintfV(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrmPrintfV() {
ret void
}
int spaceisupper(char ch) { return ch >= 'A' && ch <= 'Z'; }


x86 assembly (clang, -O0):
<spaceisupper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <spaceisupper+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spaceisupper>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @spaceisupper(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @spaceisupper(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
f() {
  float a = 0;
  a += 1;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xeec(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
%2 = alloca float
store float 0.000000e+00, float* %2
%3 = load float, float* %2
%4 = fadd float %3, 1.000000e+00
store float %4, float* %2
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @f() {
ret i32 undef
}
int vlistEncodeXyz(int (*dimorder)[3]) {
  return (*dimorder)[0] * 100 + (*dimorder)[1] * 10 + (*dimorder)[2];
}


x86 assembly (clang, -O0):
<vlistEncodeXyz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x64,(%rax),%eax
mov    -0x8(%rbp),%rcx
imul   $0xa,0x4(%rcx),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
add    0x8(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlistEncodeXyz>:
imul   $0x64,(%rdi),%eax
mov    0x4(%rdi),%ecx
lea    (%rcx,%rcx,4),%ecx
lea    (%rax,%rcx,2),%eax
add    0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @vlistEncodeXyz([3 x i32]* %0) {
%2 = alloca [3 x i32]*
store [3 x i32]* %0, [3 x i32]** %2
%3 = load [3 x i32]*, [3 x i32]** %2
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 100
%7 = load [3 x i32]*, [3 x i32]** %2
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 1
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, 10
%11 = add nsw i32 %6, %10
%12 = load [3 x i32]*, [3 x i32]** %2
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %12, i64 0, i64 2
%14 = load i32, i32* %13
%15 = add nsw i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @vlistEncodeXyz([3 x i32]* nocapture %0) {
%2 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 0, i64 0
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 100
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 0, i64 1
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 10
%8 = add nsw i32 %7, %4
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 0, i64 2
%10 = load i32, i32* %9
%11 = add nsw i32 %8, %10
ret i32 %11
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
int lt(uint16_t a, uint16_t b) {
  if (a != 0 && (a < b || b == 0))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<lt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113c <lt+0x3c>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jl     1130 <lt+0x30>
cmpq   $0x0,-0x18(%rbp)
jne    113c <lt+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <lt+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lt>:
test   %rdi,%rdi
je     1114 <lt+0x14>
mov    $0x1,%eax
cmp    %rsi,%rdi
jl     1116 <lt+0x16>
test   %rsi,%rsi
je     1116 <lt+0x16>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @lt(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = icmp slt i64 %0, %1
%6 = icmp eq i64 %1, 0
%7 = or i1 %5, %6
br i1 %7, label %9, label %8
8: ; preds = %4, %2
br label %9
9: ; preds = %4, %8
%10 = phi i32 [ 0, %8 ], [ 1, %4 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ ENGINE;

/* Variables and functions */
int /*<<< orphan*/ ERR_GMP_error(int, int, char *, int);
int e_gmp_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void)) {
  int to_return = 1;
  switch (cmd) {
  default:
    ERR_GMP_error((100), (100),
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/caidongyun/"
                  "nginx-openresty-windows/refs/heads/master/Ouroboros/"
                  "External/OpenSSL/openssl-1.0.0e/engines/e_gmp.c",
                  249);
    to_return = 0;
    break;
  }
  return to_return;
}


x86 assembly (clang, -O0):
<e_gmp_ctrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    $0x64,%esi
lea    0xec2(%rip),%rdx
mov    $0xf9,%ecx
mov    %esi,%edi
call   1030 <ERR_GMP_error@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_gmp_ctrl>:
push   %rax
lea    0xee8(%rip),%rdx
mov    $0x64,%edi
mov    $0x64,%esi
mov    $0xf9,%ecx
call   1030 <ERR_GMP_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [201 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/caidongyun/nginx-openresty-windows/refs/heads/master/Ouroboros/External/OpenSSL/openssl-1.0.0e/engines/e_gmp.c\00"
define i32 @e_gmp_ctrl(i32* %0, i32 %1, i64 %2, i8* %3, void ()* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i64
%9 = alloca i8*
%10 = alloca void ()*
%11 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store void ()* %4, void ()** %10
store i32 1, i32* %11
%12 = load i32, i32* %7
switch i32 %12, label %13 [
]
13: ; preds = %5
%14 = call i32 @ERR_GMP_error(i32 100, i32 100, i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 249)
store i32 0, i32* %11
br label %15
15: ; preds = %13
%16 = load i32, i32* %11
ret i32 %16
}

LLVM IR (-O2):
@.str = [201 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/caidongyun/nginx-openresty-windows/refs/heads/master/Ouroboros/External/OpenSSL/openssl-1.0.0e/engines/e_gmp.c\00"
define i32 @e_gmp_ctrl(i32* nocapture readnone %0, i32 %1, i64 %2, i8* nocapture readnone %3, void ()* nocapture readnone %4) {
%6 = tail call i32 @ERR_GMP_error(i32 100, i32 100, i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 249)
ret i32 0
}
__attribute__((always_)) void profile_hits(int type, void *ip,
                                           unsigned int nr_hits) {
  return;
}


x86 assembly (clang, -O0):
<profile_hits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @profile_hits(i32 %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
void _remove_keyfiles(void) {
  remove("key1.file");
  remove("key2.file");
}


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

x86 assembly (clang, -O2):
<_remove_keyfiles>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <remove@plt>
lea    0xee6(%rip),%rdi
pop    %rax
jmp    1030 <remove@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"key1.file\00"
@.str.1 = [10 x i8] c"key2.file\00"
define void @_remove_keyfiles() {
%1 = call i32 @remove(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @remove(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"key1.file\00"
@.str.1 = [10 x i8] c"key2.file\00"
define void @_remove_keyfiles() {
%1 = tail call i32 @remove(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @remove(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t bgr233_sz(unsigned width, unsigned height) { return width * height; }


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

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

LLVM IR (-O0):
define i64 @bgr233_sz(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 = mul i32 %5, %6
%8 = zext i32 %7 to i64
ret i64 %8
}

LLVM IR (-O2):
define i64 @bgr233_sz(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
%4 = zext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void shutdown_signals(int signal_fd) { close(signal_fd); }


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

x86 assembly (clang, -O2):
<shutdown_signals>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @shutdown_signals(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
void function_state(char *state) {}


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

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

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

LLVM IR (-O2):
define void @function_state(i8* nocapture %0) {
ret void
}
/* Variables and functions */
double const pow(int, long const);
double ldexp(const double x, const long y) { return x * pow(2, y); }


x86 assembly (clang, -O0):
<ldexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexp>:
push   %rax
mov    %rdi,%rsi
movsd  %xmm0,(%rsp)
mov    $0x2,%edi
call   1030 <pow@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ldexp(double %0, i64 %1) {
%3 = alloca double
%4 = alloca i64
store double %0, double* %3
store i64 %1, i64* %4
%5 = load double, double* %3
%6 = load i64, i64* %4
%7 = call double @pow(i32 2, i64 %6)
%8 = fmul double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @ldexp(double %0, i64 %1) {
%3 = tail call double @pow(i32 2, i64 %1)
%4 = fmul double %3, %0
ret double %4
}
/* Type definitions */
struct nlmsg {
  int dummy;
};

/* Variables and functions */
int nla_put(struct nlmsg *, int, void const *, size_t);
extern int nla_put_buffer(struct nlmsg *nlmsg, int attr, const void *data,
                          size_t size) {
  return nla_put(nlmsg, attr, data, size);
}


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

x86 assembly (clang, -O2):
<nla_put_buffer>:
jmp    1030 <nla_put@plt>

LLVM IR (-O0):
%struct.nlmsg = type { i32 }
define i32 @nla_put_buffer(%struct.nlmsg* %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca %struct.nlmsg*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store %struct.nlmsg* %0, %struct.nlmsg** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load %struct.nlmsg*, %struct.nlmsg** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i32 @nla_put(%struct.nlmsg* %9, i32 %10, i8* %11, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.nlmsg = type { i32 }
define i32 @nla_put_buffer(%struct.nlmsg* %0, i32 %1, i8* %2, i64 %3) {
%5 = tail call i32 @nla_put(%struct.nlmsg* %0, i32 %1, i8* %2, i64 %3)
ret i32 %5
}
/* Variables and functions */
size_t pn_next_power_of_two(size_t value) {
  size_t ret = 1;
  while (ret < value) {
    ret <<= 1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<pn_next_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    112f <pn_next_power_of_two+0x2f>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <pn_next_power_of_two+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pn_next_power_of_two>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rcx,%rax
add    %rcx,%rcx
cmp    %rdi,%rax
jb     1110 <pn_next_power_of_two+0x10>
ret

LLVM IR (-O0):
define i64 @pn_next_power_of_two(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 1, i64* %3
br label %4
4: ; preds = %8, %1
%5 = load i64, i64* %3
%6 = load i64, i64* %2
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i64, i64* %3
%10 = shl i64 %9, 1
store i64 %10, i64* %3
br label %4
11: ; preds = %4
%12 = load i64, i64* %3
ret i64 %12
}

LLVM IR (-O2):
define i64 @pn_next_power_of_two(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 1, %1 ], [ %5, %2 ]
%4 = icmp ult i64 %3, %0
%5 = shl i64 %3, 1
br i1 %4, label %2, label %6
6: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int func_from_executable();
int __attribute__((visibility("default"))) func(void) {
  return func_from_executable();
}


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

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

LLVM IR (-O0):
define i32 @func() {
%1 = call i32 (...) @func_from_executable()
ret i32 %1
}

LLVM IR (-O2):
define i32 @func() {
%1 = tail call i32 (...) @func_from_executable()
ret i32 %1
}
void kmain() {
  gdt_install();
  idt_install();
  isrs_install();
  irq_install();
  keyboard_install();
  __asm__ __volatile__("sti");
  vga_init();
  vga_pushString("FrostOS is currently in alpha development.\nUSE AT YOUR OWN "
                 "RISK!\n\nFor a list of commands, type 'help'.\n\n");
  while (1) {
  }
}


x86 assembly (clang, -O0):
<kmain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <gdt_install@plt>
mov    $0x0,%al
call   1060 <idt_install@plt>
mov    $0x0,%al
call   1070 <isrs_install@plt>
mov    $0x0,%al
call   1030 <irq_install@plt>
mov    $0x0,%al
call   1090 <keyboard_install@plt>
sti
mov    $0x0,%al
call   1040 <vga_init@plt>
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1080 <vga_pushString@plt>
jmp    11ad <kmain+0x3d>

x86 assembly (clang, -O2):
<kmain>:
push   %rax
xor    %eax,%eax
call   1050 <gdt_install@plt>
xor    %eax,%eax
call   1060 <idt_install@plt>
xor    %eax,%eax
call   1070 <isrs_install@plt>
xor    %eax,%eax
call   1030 <irq_install@plt>
xor    %eax,%eax
call   1090 <keyboard_install@plt>
sti
xor    %eax,%eax
call   1040 <vga_init@plt>
lea    0xe5d(%rip),%rdi
xor    %eax,%eax
call   1080 <vga_pushString@plt>
nopw   0x0(%rax,%rax,1)
jmp    11b0 <kmain+0x40>

LLVM IR (-O0):
@.str = [105 x i8] c"FrostOS is currently in alpha development.\0AUSE AT YOUR OWN RISK!\0A\0AFor a list of commands, type 'help'.\0A\0A\00"
define void @kmain() {
%1 = call i32 (...) @gdt_install()
%2 = call i32 (...) @idt_install()
%3 = call i32 (...) @isrs_install()
%4 = call i32 (...) @irq_install()
%5 = call i32 (...) @keyboard_install()
%6 = call i32 (...) @vga_init()
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @vga_pushString to i32 (i8*, ...)*)(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %0, %8
br label %8
}

LLVM IR (-O2):
@.str = [105 x i8] c"FrostOS is currently in alpha development.\0AUSE AT YOUR OWN RISK!\0A\0AFor a list of commands, type 'help'.\0A\0A\00"
define void @kmain() {
%1 = tail call i32 (...) @gdt_install()
%2 = tail call i32 (...) @idt_install()
%3 = tail call i32 (...) @isrs_install()
%4 = tail call i32 (...) @irq_install()
%5 = tail call i32 (...) @keyboard_install()
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
%6 = tail call i32 (...) @vga_init()
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @vga_pushString to i32 (i8*, ...)*)(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %0, %8
br label %8
}
/* Variables and functions */
int next_prime(int p, bool *primes) {
  int i = p + 1;
  while (!(primes[i])) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<next_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1132 <next_prime+0x32>
jmp    1140 <next_prime+0x40>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1114 <next_prime+0x14>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_prime>:
mov    %edi,%eax
movslq %edi,%rcx
lea    (%rsi,%rcx,4),%rcx
add    $0x4,%rcx
nopl   (%rax)
add    $0x1,%eax
cmpl   $0x0,(%rcx)
lea    0x4(%rcx),%rcx
je     1110 <next_prime+0x10>
ret

LLVM IR (-O0):
define i32 @next_prime(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 = add nsw i32 %6, 1
store i32 %7, i32* %5
br label %8
8: ; preds = %16, %2
%9 = load i32*, i32** %4
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
br i1 %15, label %16, label %19
16: ; preds = %8
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %8
19: ; preds = %8
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @next_prime(i32 %0, i32* nocapture %1) {
%3 = sext i32 %0 to i64
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %6, %4 ], [ %3, %2 ]
%6 = add nsw i64 %5, 1
%7 = getelementptr inbounds i32, i32* %1, i64 %6
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %4, label %10
10: ; preds = %4
%11 = trunc i64 %6 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printTest(int, int);
int main() {
  int a = 8;
  int b = 3;
  printTest(a, b);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
mov    $0x3,%esi
call   1030 <printTest@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @printTest(i32 8, i32 3)
ret i32 0
}
void gtk_entry_completion_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_entry_completion_new() {
ret void
}
int max(int a, int b) {
  if (b < a) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %edi,%esi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _MM_SET_ROUNDING_MODE(unsigned int);
void test_MM_SET_ROUNDING_MODE(unsigned int A) { _MM_SET_ROUNDING_MODE(A); }


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

x86 assembly (clang, -O2):
<test_MM_SET_ROUNDING_MODE>:
jmp    1030 <_MM_SET_ROUNDING_MODE@plt>

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

LLVM IR (-O2):
define void @test_MM_SET_ROUNDING_MODE(i32 %0) {
%2 = tail call i32 @_MM_SET_ROUNDING_MODE(i32 %0)
ret void
}