xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void *realloc(void *, size_t);
void *safe_realloc(void *ptr, size_t size) {
  ptr = realloc(ptr, size);
  if (ptr == NULL) {
    perror("safe realloc failed.");
    exit(EXIT_FAILURE);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<safe_realloc>:
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 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1176 <safe_realloc+0x46>
lea    0xe9d(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_realloc>:
push   %rax
call   1030 <realloc@plt>
test   %rax,%rax
je     113d <safe_realloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"safe realloc failed.\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @safe_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret i8* %3
}
void outb(unsigned long port, unsigned char val) {
  *(volatile unsigned char *)((0xfffffc0000000000UL + 0x8900000000UL) + port) =
      val;
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
movabs $0xfffffc8900000000,%rax
fc ff ff
add    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb>:
movabs $0xfffffc8900000000,%rax
fc ff ff
mov    %sil,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @outb(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i64, i64* %3
%7 = add i64 -3809635991552, %6
%8 = inttoptr i64 %7 to i8*
store volatile i8 %5, i8* %8
ret void
}

LLVM IR (-O2):
define void @outb(i64 %0, i8 zeroext %1) {
%3 = add i64 %0, -3809635991552
%4 = inttoptr i64 %3 to i8*
store volatile i8 %1, i8* %4
ret void
}
void foo(int n, char *restrict src, char *restrict dst) {
  while (n-- > 0)
    *dst++ = *src++;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    114a <foo+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    110f <foo+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edi,%edi
jle    1126 <foo+0x16>
push   %rax
mov    %edi,%eax
mov    %rdx,%rdi
mov    %rax,%rdx
call   1030 <memcpy@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @foo(i32 %0, i8* noalias nocapture %1, i8* noalias nocapture writeonly %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: egg [-b beeps] [-d seconds] [-h hours] [-m "
                        "minutes] [-s seconds] [-t time] [-v]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [88 x i8] c"usage: egg [-b beeps] [-d seconds] [-h hours] [-m minutes] [-s seconds] [-t time] [-v]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [88 x i8] c"usage: egg [-b beeps] [-d seconds] [-h hours] [-m minutes] [-s seconds] [-t time] [-v]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ CLEAR_TDI();
int /*<<< orphan*/ SET_TDI();
void bit_in_tms(uint8_t byte, int length, char *in, int tdi) {
  if (tdi == 1)
    SET_TDI();
  else
    CLEAR_TDI();
}


x86 assembly (clang, -O0):
<bit_in_tms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    114b <bit_in_tms+0x2b>
mov    $0x0,%al
call   1030 <SET_TDI@plt>
jmp    1152 <bit_in_tms+0x32>
mov    $0x0,%al
call   1040 <CLEAR_TDI@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_in_tms>:
xor    %eax,%eax
cmp    $0x1,%ecx
jne    112c <bit_in_tms+0xc>
jmp    1030 <SET_TDI@plt>
jmp    1040 <CLEAR_TDI@plt>

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

LLVM IR (-O2):
define void @bit_in_tms(i32 %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
%5 = icmp eq i32 %3, 1
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 (...) @SET_TDI()
br label %10
8: ; preds = %4
%9 = tail call i32 (...) @CLEAR_TDI()
br label %10
10: ; preds = %8, %6
ret void
}
/* Variables and functions */
int strcasecmp(char *, char *);
void strcasecmp_2() {
  char *x = "abc";
  char *y = "Bcd";
  if (strcasecmp(x, y) != -1)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strcasecmp_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0xffffffff,%eax
je     1144 <strcasecmp_2+0x34>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"Bcd\00"
define void @strcasecmp_2() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strcasecmp(i8* %3, i8* %4)
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i8, i8* null
br label %9
9: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
define void @strcasecmp_2() {
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ die(int, char *);
void *ecalloc(size_t nmemb, size_t size) {
  void *p;
  if (!(p = calloc(nmemb, size)))
    die(1, "calloc:");
  return p;
}


x86 assembly (clang, -O0):
<ecalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    115c <ecalloc+0x3c>
mov    $0x1,%edi
lea    0xea9(%rip),%rsi
call   1040 <die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecalloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <ecalloc+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"calloc:\00"
define noalias i8* @ecalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ no_ret();
void unreachable_null_no_return_ok_FP() {
  int *p = NULL;
  if (p == NULL) {
    no_ret();
  }
  *p = 42;
}


x86 assembly (clang, -O0):
<unreachable_null_no_return_ok_FP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1132 <unreachable_null_no_return_ok_FP+0x22>
mov    $0x0,%al
call   1030 <no_ret@plt>
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @unreachable_null_no_return_ok_FP() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = load i32*, i32** %1
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @no_ret()
br label %6
6: ; preds = %4, %0
%7 = load i32*, i32** %1
store i32 42, i32* %7
ret void
}

LLVM IR (-O2):
define void @unreachable_null_no_return_ok_FP() {
%1 = tail call i32 (...) @no_ret()
unreachable
}
/* Variables and functions */
scalar_t__ is_prime_mr(size_t);
int next_prime(int x) {
  x++;
  while (1) {
    if (is_prime_mr((size_t)x)) {
      return x;
    }
    x++;
  }
}


x86 assembly (clang, -O0):
<next_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
movslq -0x4(%rbp),%rdi
call   1030 <is_prime_mr@plt>
cmp    $0x0,%rax
je     1140 <next_prime+0x30>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <next_prime+0x14>

x86 assembly (clang, -O2):
<next_prime>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
movslq %edi,%rbx
add    $0x1,%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <is_prime_mr@plt>
add    $0x1,%ebp
add    $0x1,%rbx
test   %rax,%rax
je     1120 <next_prime+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @next_prime(i32 %0) {
%2 = sext i32 %0 to i64
br label %3
3: ; preds = %3, %1
%4 = phi i64 [ %5, %3 ], [ %2, %1 ]
%5 = add nsw i64 %4, 1
%6 = tail call i64 @is_prime_mr(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %3, label %8
8: ; preds = %3
%9 = trunc i64 %5 to i32
ret i32 %9
}
void packInt32(unsigned char *buffer, unsigned int value) {
  buffer[0] = value;
  buffer[1] = value >> 8;
  buffer[2] = value >> 16;
  buffer[3] = value >> 24;
}


x86 assembly (clang, -O0):
<packInt32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<packInt32>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @packInt32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = trunc i32 %5 to i8
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 %6, i8* %8
%9 = load i32, i32* %4
%10 = lshr i32 %9, 8
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8 %11, i8* %13
%14 = load i32, i32* %4
%15 = lshr i32 %14, 16
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 2
store i8 %16, i8* %18
%19 = load i32, i32* %4
%20 = lshr i32 %19, 24
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 3
store i8 %21, i8* %23
ret void
}

LLVM IR (-O2):
define void @packInt32(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
int _lseek(int file, int ptr, int dir) {
  return 0;
  file = file;
  ptr = ptr;
  dir = dir;
}


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

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

LLVM IR (-O0):
define i32 @_lseek(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
ret i32 0
}

LLVM IR (-O2):
define i32 @_lseek(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
float _Complex div_float_rc(float a, float _Complex b) { return a / b; }


x86 assembly (clang, -O0):
<div_float_rc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movlpd %xmm1,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x10(%rbp),%xmm2
movss  -0xc(%rbp),%xmm3
xorps  %xmm1,%xmm1
call   1150 <__divsc3>
movlpd %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret
nopl   (%rax)

x86 assembly (clang, -O2):
<div_float_rc>:
movaps %xmm1,%xmm2
movaps %xmm1,%xmm3
shufps $0x55,%xmm1,%xmm3
xorps  %xmm1,%xmm1
jmp    1120 <__divsc3>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)

LLVM IR (-O0):
define <2 x float> @div_float_rc(float %0, <2 x float> %1) {
%3 = alloca { float, float }
%4 = alloca { float, float }
%5 = alloca float
%6 = alloca { float, float }
%7 = bitcast { float, float }* %4 to <2 x float>*
store <2 x float> %1, <2 x float>* %7
store float %0, float* %5
%8 = load float, float* %5
%9 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%10 = load float, float* %9
%11 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
%12 = load float, float* %11
%13 = call <2 x float> @__divsc3(float %8, float 0.000000e+00, float %10, float %12)
%14 = bitcast { float, float }* %6 to <2 x float>*
store <2 x float> %13, <2 x float>* %14
%15 = getelementptr inbounds { float, float }, { float, float }* %6, i32 0, i32 0
%16 = load float, float* %15
%17 = getelementptr inbounds { float, float }, { float, float }* %6, i32 0, i32 1
%18 = load float, float* %17
%19 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%20 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
store float %16, float* %19
store float %18, float* %20
%21 = bitcast { float, float }* %3 to <2 x float>*
%22 = load <2 x float>, <2 x float>* %21
ret <2 x float> %22
}

LLVM IR (-O2):
define <2 x float> @div_float_rc(float %0, <2 x float> %1) {
%3 = extractelement <2 x float> %1, i64 0
%4 = extractelement <2 x float> %1, i64 1
%5 = tail call <2 x float> @__divsc3(float %0, float 0.000000e+00, float %3, float %4)
ret <2 x float> %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
void printList(int *nums, int numsSize) {
  size_t i;
  for (i = 0; i < numsSize; i++) {
    printf("%4d", nums[i]);
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<printList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmp    %rcx,%rax
jae    1170 <printList+0x50>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1137 <printList+0x17>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printList>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1155 <printList+0x35>
mov    %rdi,%r15
movslq %esi,%r12
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printList+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%4d\00"
define void @printList(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = sext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %11, %6 ], [ 0, %4 ]
%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 i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i8 signext 10)
ret void
}
void bar() {
  printf("%s %s\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/geminy/aidear/refs/heads/master/snippets/"
         "makefile/gnumake/gcc/test.c",
         __func__);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee5(%rip),%rsi
lea    0xf7d(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
lea    0xee9(%rip),%rdi
lea    0xee9(%rip),%rsi
lea    0xf81(%rip),%rdx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [159 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/geminy/aidear/refs/heads/master/snippets/makefile/gnumake/gcc/test.c\00"
@__func__.bar = [4 x i8] c"bar\00"
define void @bar() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.bar, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [159 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/geminy/aidear/refs/heads/master/snippets/makefile/gnumake/gcc/test.c\00"
@__func__.bar = [4 x i8] c"bar\00"
define void @bar() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.bar, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_ready();
int /*<<< orphan*/ new_prefix(char const *);
void picosat_set_prefix(const char *str) {
  check_ready();
  new_prefix(str);
}


x86 assembly (clang, -O0):
<picosat_set_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <check_ready@plt>
mov    -0x8(%rbp),%rdi
call   1040 <new_prefix@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<picosat_set_prefix>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <check_ready@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <new_prefix@plt>

LLVM IR (-O0):
define void @picosat_set_prefix(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @check_ready()
%4 = load i8*, i8** %2
%5 = call i32 @new_prefix(i8* %4)
ret void
}

LLVM IR (-O2):
define void @picosat_set_prefix(i8* %0) {
%2 = tail call i32 (...) @check_ready()
%3 = tail call i32 @new_prefix(i8* %0)
ret void
}
int strleftcmp(const char *base, const char *full) {
  while (*base) {
    if (*base != *full)
      return *base - *full;
    base++;
    full++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<strleftcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1164 <strleftcmp+0x64>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1147 <strleftcmp+0x47>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    116b <strleftcmp+0x6b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <strleftcmp+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strleftcmp>:
mov    (%rdi),%al
test   %al,%al
je     1125 <strleftcmp+0x25>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movsbl (%rsi,%rcx,1),%edx
cmp    %dl,%al
jne    1128 <strleftcmp+0x28>
movzbl 0x1(%rdi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <strleftcmp+0x10>
xor    %eax,%eax
ret
movsbl %al,%eax
sub    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @strleftcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %20, label %5
5: ; preds = %2, %15
%6 = phi i8 [ %18, %15 ], [ %3, %2 ]
%7 = phi i8* [ %17, %15 ], [ %1, %2 ]
%8 = phi i8* [ %16, %15 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %15, label %11
11: ; preds = %5
%12 = sext i8 %9 to i32
%13 = sext i8 %6 to i32
%14 = sub nsw i32 %13, %12
br label %20
15: ; preds = %5
%16 = getelementptr inbounds i8, i8* %8, i64 1
%17 = getelementptr inbounds i8, i8* %7, i64 1
%18 = load i8, i8* %16
%19 = icmp eq i8 %18, 0
br i1 %19, label %20, label %5
20: ; preds = %15, %2, %11
%21 = phi i32 [ %14, %11 ], [ 0, %2 ], [ 0, %15 ]
ret i32 %21
}
int cmp_int(const int item1, const int item2) { return item1 - item2; }


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

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

LLVM IR (-O0):
define i32 @cmp_int(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 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @cmp_int(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
const char *ftrunc_get_title(void) { return "Truncate a large test file"; }


x86 assembly (clang, -O0):
<ftrunc_get_title>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftrunc_get_title>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Truncate a large test file\00"
define i8* @ftrunc_get_title() {
ret i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [27 x i8] c"Truncate a large test file\00"
define i8* @ftrunc_get_title() {
ret i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0)
}
void test() {
  printf("%s:%d %s()\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/fengbohello/practice/refs/heads/master/"
         "clang/attribute/weak_fun/libfun.c",
         21, __func__);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeea(%rip),%rsi
mov    $0x15,%edx
lea    0xf81(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x15,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%s:%d %s()\0A\00"
@.str.1 = [163 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fengbohello/practice/refs/heads/master/clang/attribute/weak_fun/libfun.c\00"
@__func__.test = [5 x i8] c"test\00"
define void @test() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.1, i64 0, i64 0), i32 21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.test, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s:%d %s()\0A\00"
@.str.1 = [163 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fengbohello/practice/refs/heads/master/clang/attribute/weak_fun/libfun.c\00"
@__func__.test = [5 x i8] c"test\00"
define void @test() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.1, i64 0, i64 0), i32 21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.test, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/, char const *, size_t);
int /*<<< orphan*/ sbuf_grab(struct sbuf *, size_t);
size_t strlen(char const *);
extern void sbuf_puts(struct sbuf *sb, const char *s) {
  size_t len = strlen(s);
  memcpy(sbuf_grab(sb, len), s, len);
}


x86 assembly (clang, -O0):
<sbuf_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <sbuf_grab@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbuf_puts>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <sbuf_grab@plt>
mov    %eax,%edi
mov    %r15,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <memcpy@plt>

LLVM IR (-O0):
%struct.sbuf = type { i32 }
define void @sbuf_puts(%struct.sbuf* %0, i8* %1) {
%3 = alloca %struct.sbuf*
%4 = alloca i8*
%5 = alloca i64
store %struct.sbuf* %0, %struct.sbuf** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i64 @strlen(i8* %6)
store i64 %7, i64* %5
%8 = load %struct.sbuf*, %struct.sbuf** %3
%9 = load i64, i64* %5
%10 = call i32 @sbuf_grab(%struct.sbuf* %8, i64 %9)
%11 = load i8*, i8** %4
%12 = load i64, i64* %5
%13 = call i32 @memcpy(i32 %10, i8* %11, i64 %12)
ret void
}

LLVM IR (-O2):
%struct.sbuf = type { i32 }
define void @sbuf_puts(%struct.sbuf* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i32 @sbuf_grab(%struct.sbuf* %0, i64 %3)
%5 = tail call i32 @memcpy(i32 %4, i8* %1, i64 %3)
ret void
}
/* Variables and functions */
char *GetPath();
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ unlink(char *);
void UnlockSession(char *session_name) {
  char *path;
  char lock_file[1024];
  path = GetPath();
  sprintf(lock_file, "%s/.XSMlock-%s", path, session_name);
  unlink(lock_file);
}


x86 assembly (clang, -O0):
<UnlockSession>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <GetPath@plt>
mov    %rax,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xea0(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1030 <unlink@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UnlockSession>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <GetPath@plt>
lea    0xeb5(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rax,%rdx
mov    %rbx,%rcx
call   1050 <sprintf@plt>
mov    %r14,%rdi
call   1030 <unlink@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%s/.XSMlock-%s\00"
define void @UnlockSession(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [1024 x i8]
store i8* %0, i8** %2
%5 = call i8* (...) @GetPath()
store i8* %5, i8** %3
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %2
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%11 = call i32 @unlink(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s/.XSMlock-%s\00"
define void @UnlockSession(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = tail call i8* (...) @GetPath()
%5 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %0)
%6 = call i32 @unlink(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cmd_usage_prompt(void) { printf("usage: mdp prompt [-hE]\n"); }


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

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

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

LLVM IR (-O2):
@str = [24 x i8] c"usage: mdp prompt [-hE]\00"
define void @cmd_usage_prompt() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ GPU_writeDataMem(scalar_t__ *, int);
void GPU_writeData(uint32_t gdata) {
  do {
    *((uint32_t *)&gdata) = ((uint32_t)gdata);
  } while (0);
  GPU_writeDataMem(&gdata, 1);
}


x86 assembly (clang, -O0):
<GPU_writeData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <GPU_writeDataMem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPU_writeData>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
call   1030 <GPU_writeDataMem@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @GPU_writeData(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %1
%4 = load i64, i64* %2
store i64 %4, i64* %2
br label %5
5: ; preds = %3
%6 = call i32 @GPU_writeDataMem(i64* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @GPU_writeData(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @GPU_writeDataMem(i64* %2, i32 1)
ret void
}
/* Variables and functions */
int rom_present(char *);
int tvga8900b_available(void) {
  return rom_present(L"roms/video/tvga/tvga8900B.VBI");
}


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

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

LLVM IR (-O0):
@.str = [30 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 116, i32 118, i32 103, i32 97, i32 47, i32 116, i32 118, i32 103, i32 97, i32 56, i32 57, i32 48, i32 48, i32 66, i32 46, i32 86, i32 66, i32 73, i32 0]
define i32 @tvga8900b_available() {
%1 = call i32 @rom_present(i8* bitcast ([30 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [30 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 116, i32 118, i32 103, i32 97, i32 47, i32 116, i32 118, i32 103, i32 97, i32 56, i32 57, i32 48, i32 48, i32 66, i32 46, i32 86, i32 66, i32 73, i32 0]
define i32 @tvga8900b_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([30 x i32]* @.str to i8*))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void *malloc(size_t);
void *realloc(void *, size_t);
void *allocate(void *mem, size_t size) {
  mem = mem == 0 ? malloc(size) : realloc(mem, size);
  if (mem == 0)
    fatal("malloc()");
  return mem;
}


x86 assembly (clang, -O0):
<allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115d <allocate+0x2d>
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
jmp    116e <allocate+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    118d <allocate+0x5d>
lea    0xe78(%rip),%rdi
call   1050 <fatal@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate>:
push   %rbx
test   %rdi,%rdi
je     113d <allocate+0xd>
call   1040 <realloc@plt>
jmp    1145 <allocate+0x15>
mov    %rsi,%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1159 <allocate+0x29>
lea    0xeac(%rip),%rdi
call   1050 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"malloc()\00"
define i8* @allocate(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i64, i64* %4
%9 = call i8* @malloc(i64 %8)
br label %14
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i8* @realloc(i8* %11, i64 %12)
br label %14
14: ; preds = %10, %7
%15 = phi i8* [ %9, %7 ], [ %13, %10 ]
store i8* %15, i8** %3
%16 = load i8*, i8** %3
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 @fatal(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %18, %14
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
@.str = [9 x i8] c"malloc()\00"
define i8* @allocate(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i8* @malloc(i64 %1)
br label %8
6: ; preds = %2
%7 = tail call i8* @realloc(i8* %0, i64 %1)
br label %8
8: ; preds = %6, %4
%9 = phi i8* [ %5, %4 ], [ %7, %6 ]
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 @fatal(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %8
ret i8* %9
}
void free2darray(int **arr, int height) {
  int i;
  for (i = 0; i < height; i++) {
    free(arr[i]);
  }
  free(arr);
}


x86 assembly (clang, -O0):
<free2darray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free2darray+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free2darray+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free2darray>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free2darray+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free2darray+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free2darray(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 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %0 to i8*
tail call void @free(i8* %14)
ret void
}
void gtk_image_menu_item_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_image_menu_item_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
void deadly_handler(int signum) {
  kill(0, SIGTERM);
  sleep(1);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<deadly_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
call   1030 <kill@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<deadly_handler>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
call   1030 <kill@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@SIGTERM = global i32 0
@EXIT_FAILURE = global i32 0
define void @deadly_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGTERM
%4 = call i32 @kill(i32 0, i32 %3)
%5 = call i32 @sleep(i32 1)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@SIGTERM = global i32 0
@EXIT_FAILURE = global i32 0
define void @deadly_handler(i32 %0) {
%2 = load i32, i32* @SIGTERM
%3 = tail call i32 @kill(i32 0, i32 %2)
%4 = tail call i32 @sleep(i32 1)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
int check_addition_overflow_Good(unsigned int x, unsigned int y) {
  if (((unsigned int)-1) - x < y) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<check_addition_overflow_Good>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%eax
sub    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1127 <check_addition_overflow_Good+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <check_addition_overflow_Good+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_addition_overflow_Good>:
xor    %eax,%eax
add    %esi,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @check_addition_overflow_Good(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 = sub i32 -1, %6
%8 = load i32, i32* %5
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @check_addition_overflow_Good(i32 %0, i32 %1) {
%3 = xor i32 %0, -1
%4 = icmp ult i32 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int post_event(int);
int rig_quit() { return post_event(1); }


x86 assembly (clang, -O0):
<rig_quit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <post_event@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rig_quit>:
mov    $0x1,%edi
jmp    1030 <post_event@plt>

LLVM IR (-O0):
define i32 @rig_quit() {
%1 = call i32 @post_event(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @rig_quit() {
%1 = tail call i32 @post_event(i32 1)
ret i32 %1
}
/* Variables and functions */
int do_partition_last_element(int *, int, int);
void Qsort(int *a, int start, int end) {
  int index;
  if (start >= end)
    return;
  index = do_partition_last_element(a, start, end);
  Qsort(a, start, index - 1);
  Qsort(a, index + 1, end);
}


x86 assembly (clang, -O0):
<Qsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1143 <Qsort+0x23>
jmp    1179 <Qsort+0x59>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <do_partition_last_element@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <Qsort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <Qsort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Qsort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <Qsort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <do_partition_last_element@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <Qsort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <Qsort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @Qsort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp sge i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
br label %25
12: ; preds = %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @do_partition_last_element(i32* %13, i32 %14, i32 %15)
store i32 %16, i32* %7
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
%21 = load i32*, i32** %4
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %6
br label %25
25: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @Qsort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @do_partition_last_element(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @Qsort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
void arm64_apply_bp_hardening(void) {}


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

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

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

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


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

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

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

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