xunge/DecIR huggingface dataset:
/* Variables and functions */
int partition(int *, int);
void quick_sort(int *a, int n) {
  int index;
  if (n <= 1)
    return;
  else {
    index = partition(a, n);
    quick_sort(a, index);
    quick_sort(a + index + 1, n - index - 1);
  }
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jg     113e <quick_sort+0x1e>
jmp    117a <quick_sort+0x5a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <partition@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0x4,%rdi
mov    -0xc(%rbp),%esi
sub    -0x10(%rbp),%esi
sub    $0x1,%esi
call   1040 <quick_sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     115f <quick_sort+0x3f>
mov    %esi,%r14d
mov    %rdi,%rbx
nop
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <partition@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <quick_sort@plt>
movslq %ebp,%rax
lea    (%rbx,%rax,4),%rbx
add    $0x4,%rbx
not    %eax
add    %r14d,%eax
mov    %eax,%r14d
cmp    $0x1,%eax
jg     1130 <quick_sort+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @quick_sort(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* %4
%7 = icmp sle i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %24
9: ; preds = %2
%10 = load i32*, i32** %3
%11 = load i32, i32* %4
%12 = call i32 @partition(i32* %10, i32 %11)
store i32 %12, i32* %5
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = load i32*, i32** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = getelementptr inbounds i32, i32* %18, i64 1
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = sub nsw i32 %20, %21
%23 = sub nsw i32 %22, 1
br label %24
24: ; preds = %8, %9
ret void
}

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %12, %4 ], [ %1, %2 ]
%6 = phi i32* [ %10, %4 ], [ %0, %2 ]
%7 = tail call i32 @partition(i32* %6, i32 %5)
tail call void @quick_sort(i32* %6, i32 %7)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 1
%10 = getelementptr inbounds i32, i32* %9, i64 %8
%11 = xor i32 %7, -1
%12 = add i32 %5, %11
%13 = icmp slt i32 %12, 2
br i1 %13, label %14, label %4
14: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int loop_test_process();
int /*<<< orphan*/ read_parameters(int, char **);
int main(int argc, char **argv) {
  pid_t pid[2000];
  int proc;
  int ret;
  read_parameters(argc, argv);
  ret = loop_test_process();
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <read_parameters@plt>
mov    $0x0,%al
call   1030 <loop_test_process@plt>
mov    %eax,-0x1f58(%rbp)
mov    -0x1f58(%rbp),%eax
add    $0x1f60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <read_parameters@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <loop_test_process@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2000 x i32]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 @read_parameters(i32 %9, i8** %10)
%12 = call i32 (...) @loop_test_process()
store i32 %12, i32* %8
%13 = load i32, i32* %8
ret i32 %13
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @read_parameters(i32 %0, i8** %1)
%4 = tail call i32 (...) @loop_test_process()
ret i32 %4
}
int modifyInt(int incoming) { return incoming % 2; }


x86 assembly (clang, -O0):
<modifyInt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modifyInt>:
mov    %edi,%eax
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @modifyInt(i32 %0) {
%2 = srem i32 %0, 2
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ subunit_send_event(char *, char const *const,
                                      char const *const);
void subunit_test_fail(char const *const name, char const *const error) {
  subunit_send_event("failure", name, error);
}


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

x86 assembly (clang, -O2):
<subunit_test_fail>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <subunit_send_event@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"failure\00"
define void @subunit_test_fail(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @subunit_send_event(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"failure\00"
define void @subunit_test_fail(i8* %0, i8* %1) {
%3 = tail call i32 @subunit_send_event(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(unsigned char *);
unsigned int arithmetic_byte_subtract(unsigned char a, unsigned char b,
                                      unsigned char *p_result) {
  assert(p_result);
  unsigned int err_code = 0;
  if (!p_result) {
    err_code = 2;
    goto end;
  }
  *p_result = (a - b);
end:
  return err_code;
}


x86 assembly (clang, -O0):
<arithmetic_byte_subtract>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114f <arithmetic_byte_subtract+0x3f>
movl   $0x2,-0x14(%rbp)
jmp    1161 <arithmetic_byte_subtract+0x51>
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
sub    %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arithmetic_byte_subtract>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %edi,%ebp
mov    %rdx,%rdi
call   1030 <assert@plt>
test   %rbx,%rbx
je     1133 <arithmetic_byte_subtract+0x23>
sub    %r14b,%bpl
mov    %bpl,(%rbx)
xor    %eax,%eax
jmp    1138 <arithmetic_byte_subtract+0x28>
mov    $0x2,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @arithmetic_byte_subtract(i8 zeroext %0, i8 zeroext %1, i8* %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8*
%7 = alloca i32
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = call i32 @assert(i8* %8)
store i32 0, i32* %7
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %13, label %12
12: ; preds = %3
store i32 2, i32* %7
br label %21
13: ; preds = %3
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = sub nsw i32 %15, %17
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %6
store i8 %19, i8* %20
br label %21
21: ; preds = %13, %12
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @arithmetic_byte_subtract(i8 zeroext %0, i8 zeroext %1, i8* %2) {
%4 = tail call i32 @assert(i8* %2)
%5 = icmp eq i8* %2, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = sub i8 %0, %1
store i8 %7, i8* %2
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ 0, %6 ], [ 2, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ putbyte(unsigned char);
void threebyte(unsigned long co) {
  putbyte((unsigned char)((co >> 16) & 0xff));
  putbyte((unsigned char)((co >> 8) & 0xff));
  putbyte((unsigned char)(co & 0xff));
}


x86 assembly (clang, -O0):
<threebyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
movzbl %al,%edi
call   1030 <putbyte@plt>
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
movzbl %al,%edi
call   1030 <putbyte@plt>
mov    -0x8(%rbp),%rax
and    $0xff,%rax
movzbl %al,%edi
call   1030 <putbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<threebyte>:
push   %rbx
mov    %rdi,%rbx
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
call   1030 <putbyte@plt>
movzbl %bh,%edi
call   1030 <putbyte@plt>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <putbyte@plt>

LLVM IR (-O0):
define void @threebyte(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 255
%6 = trunc i64 %5 to i8
%7 = call i32 @putbyte(i8 zeroext %6)
%8 = load i64, i64* %2
%9 = lshr i64 %8, 8
%10 = and i64 %9, 255
%11 = trunc i64 %10 to i8
%12 = call i32 @putbyte(i8 zeroext %11)
%13 = load i64, i64* %2
%14 = and i64 %13, 255
%15 = trunc i64 %14 to i8
%16 = call i32 @putbyte(i8 zeroext %15)
ret void
}

LLVM IR (-O2):
define void @threebyte(i64 %0) {
%2 = lshr i64 %0, 16
%3 = trunc i64 %2 to i8
%4 = tail call i32 @putbyte(i8 zeroext %3)
%5 = lshr i64 %0, 8
%6 = trunc i64 %5 to i8
%7 = tail call i32 @putbyte(i8 zeroext %6)
%8 = trunc i64 %0 to i8
%9 = tail call i32 @putbyte(i8 zeroext %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
main() {
  assert(10 * 2 + '2' - '0' == 22);
  assert(1 - 2 + 3 == 2);
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @assert(i32 1)
%2 = call i32 @assert(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
unsigned int sis32toh(unsigned int val) { return val; }


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

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

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

LLVM IR (-O2):
define i32 @sis32toh(i32 returned %0) {
ret i32 %0
}
char reader_next(char **str) {
  str++;
  char c = **str;
  return c;
}


x86 assembly (clang, -O0):
<reader_next>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reader_next>:
mov    0x8(%rdi),%rax
mov    (%rax),%al
ret

LLVM IR (-O0):
define signext i8 @reader_next(i8** %0) {
%2 = alloca i8**
%3 = alloca i8
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i32 1
store i8** %5, i8*** %2
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
%8 = load i8, i8* %7
store i8 %8, i8* %3
%9 = load i8, i8* %3
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @reader_next(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
ret i8 %4
}
__attribute__((always_)) void acpi_noirq_set(void) {}


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

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

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

LLVM IR (-O2):
define void @acpi_noirq_set() {
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ pr_mask(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int main(int argc, char **argv) {
  char str[128];
  sprintf(str, "signal mask for process: %d\n", getpid());
  pr_mask(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x98(%rbp),%rdi
mov    %eax,%edx
lea    0xe92(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x90(%rbp),%rdi
call   1040 <pr_mask@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeba(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %eax,%edx
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <pr_mask@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"signal mask for process: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [128 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%8 = call i32 (...) @getpid()
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%11 = call i32 @pr_mask(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"signal mask for process: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = tail call i32 (...) @getpid()
%6 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @pr_mask(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_int(int signo) { printf("interrupt%% \n"); }


x86 assembly (clang, -O0):
<sig_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"interrupt%% \0A\00"
define void @sig_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"interrupt%% \0A\00"
define void @sig_int(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
void ShowPauseExit(void) {
  printf("Press return to exit.\n");
  getchar();
}


x86 assembly (clang, -O0):
<ShowPauseExit>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShowPauseExit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Press return to exit.\0A\00"
define void @ShowPauseExit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"Press return to exit.\00"
define void @ShowPauseExit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ setenv(char *, char *, int);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
void curses_init() {
  setenv("TERM", "vt100", 1);
  setlocale(LC_ALL, "");
  initscr();
}


x86 assembly (clang, -O0):
<curses_init>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
lea    0xec3(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1050 <setlocale@plt>
mov    $0x0,%al
call   1040 <initscr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<curses_init>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec6(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1050 <setlocale@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <initscr@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"TERM\00"
@.str.1 = [6 x i8] c"vt100\00"
@LC_ALL = global i32 0
@.str.2 = [1 x i8] zeroinitializer
define void @curses_init() {
%1 = call i32 @setenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 1)
%2 = load i32, i32* @LC_ALL
%3 = call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 (...) @initscr()
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"TERM\00"
@.str.1 = [6 x i8] c"vt100\00"
@LC_ALL = global i32 0
@.str.2 = [1 x i8] zeroinitializer
define void @curses_init() {
%1 = tail call i32 @setenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 1)
%2 = load i32, i32* @LC_ALL
%3 = tail call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (...) @initscr()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nokia_lcd_clear();
int /*<<< orphan*/ nokia_lcd_render();
int /*<<< orphan*/ nokia_lcd_set_cursor(int /*<<< orphan*/, int);
int /*<<< orphan*/ nokia_lcd_write_string(char *, int);
int /*<<< orphan*/ snake_show_score();
void print_win() {
  nokia_lcd_clear();
  nokia_lcd_set_cursor(0, 15);
  snake_show_score();
  nokia_lcd_write_string("You win", 2);
  nokia_lcd_render();
}


x86 assembly (clang, -O0):
<print_win>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <nokia_lcd_clear@plt>
xor    %edi,%edi
mov    $0xf,%esi
call   1050 <nokia_lcd_set_cursor@plt>
mov    $0x0,%al
call   1030 <snake_show_score@plt>
lea    0xe8b(%rip),%rdi
mov    $0x2,%esi
call   1070 <nokia_lcd_write_string@plt>
mov    $0x0,%al
call   1040 <nokia_lcd_render@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_win>:
push   %rax
xor    %eax,%eax
call   1060 <nokia_lcd_clear@plt>
xor    %edi,%edi
mov    $0xf,%esi
call   1050 <nokia_lcd_set_cursor@plt>
xor    %eax,%eax
call   1030 <snake_show_score@plt>
lea    0xe8e(%rip),%rdi
mov    $0x2,%esi
call   1070 <nokia_lcd_write_string@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <nokia_lcd_render@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"You win\00"
define void @print_win() {
%1 = call i32 (...) @nokia_lcd_clear()
%2 = call i32 @nokia_lcd_set_cursor(i32 0, i32 15)
%3 = call i32 (...) @snake_show_score()
%4 = call i32 @nokia_lcd_write_string(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 2)
%5 = call i32 (...) @nokia_lcd_render()
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"You win\00"
define void @print_win() {
%1 = tail call i32 (...) @nokia_lcd_clear()
%2 = tail call i32 @nokia_lcd_set_cursor(i32 0, i32 15)
%3 = tail call i32 (...) @snake_show_score()
%4 = tail call i32 @nokia_lcd_write_string(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 2)
%5 = tail call i32 (...) @nokia_lcd_render()
ret void
}
void g_node_max_height() {}


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

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

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

LLVM IR (-O2):
define void @g_node_max_height() {
ret void
}
/* Variables and functions */
memint() {
  int x, *p;
  &x, &p;
  x = *p++;
  x = *++p;
  x = *p--;
  x = *--p;
}


x86 assembly (clang, -O0):
<memint>:
push   %rbp
mov    %rsp,%rbp
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x4(%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x10(%rbp)
mov    -0x4(%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @memint() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i32 1
store i32* %5, i32** %3
%6 = load i32, i32* %4
store i32 %6, i32* %2
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i32 1
store i32* %8, i32** %3
%9 = load i32, i32* %8
store i32 %9, i32* %2
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i32 -1
store i32* %11, i32** %3
%12 = load i32, i32* %10
store i32 %12, i32* %2
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i32 -1
store i32* %14, i32** %3
%15 = load i32, i32* %14
store i32 %15, i32* %2
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @memint() {
ret i32 undef
}
void rop3_186_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = T & stk3;
  stk1 = *D | stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_186_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_186_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = and i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = and i32 %28, %31
%33 = load i8, i8* %6
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = load i8*, i8** %4
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = and i32 %39, %41
%43 = or i32 %36, %42
%44 = load i8*, i8** %4
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = load i8, i8* %6
%48 = zext i8 %47 to i32
%49 = and i32 %46, %48
%50 = or i32 %43, %49
%51 = trunc i32 %50 to i8
%52 = load i8*, i8** %4
store i8 %51, i8* %52
ret void
}

LLVM IR (-O2):
define void @rop3_186_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
void FreeMatrixDouble(double **in) {
  free(in[0]);
  free(in);
}


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

x86 assembly (clang, -O2):
<FreeMatrixDouble>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @FreeMatrixDouble(double** %0) {
%2 = alloca double**
store double** %0, double*** %2
%3 = load double**, double*** %2
%4 = getelementptr inbounds double*, double** %3, i64 0
%5 = load double*, double** %4
%6 = bitcast double* %5 to i8*
%7 = load double**, double*** %2
%8 = bitcast double** %7 to i8*
ret void
}

LLVM IR (-O2):
define void @FreeMatrixDouble(double** nocapture %0) {
%2 = bitcast double** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast double** %0 to i8*
tail call void @free(i8* %4)
ret void
}
unsigned short get_fs_word(const unsigned short *addr) {
  unsigned short _v;
  __asm__("movw %%fs:%1,%0" : "=r"(_v) : "m"(*addr));
  return _v;
}


x86 assembly (clang, -O0):
<get_fs_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %fs:(%rax),%ax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fs_word>:
mov    %fs:(%rdi),%ax
ret

LLVM IR (-O0):
define zeroext i16 @get_fs_word(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
store i16* %0, i16** %2
%4 = load i16*, i16** %2
%5 = call i16 asm "movw %fs:$1,$0", "=r,*m,~{dirflag},~{fpsr},~{flags}"(i16* elementtype(i16) %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @get_fs_word(i16* %0) {
%2 = tail call i16 asm "movw %fs:$1,$0", "=r,*m,~{dirflag},~{fpsr},~{flags}"(i16* elementtype(i16) %0)
ret i16 %2
}
unsigned int f12(unsigned int x, int y __attribute__((unused))) {
  return (x << ((-1) & (8 * sizeof(unsigned int) - 1))) | (x >> 1);
}


x86 assembly (clang, -O0):
<f12>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1f,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f12(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 = shl i32 %5, 31
%7 = load i32, i32* %3
%8 = lshr i32 %7, 1
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f12(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 31)
ret i32 %3
}
/* Variables and functions */
void free(void *ptr) {
  if (ptr != NULL) {
    void *node = ptr - 20;
    ((int *)node)[0] = ((int *)node)[3] + 8;
  }
}


x86 assembly (clang, -O0):
<free>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112f <free+0x2f>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffec,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%ecx
add    $0x8,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<free>:
test   %rdi,%rdi
je     110e <free+0xe>
mov    -0x8(%rdi),%eax
add    $0x8,%eax
mov    %eax,-0x14(%rdi)
ret

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

LLVM IR (-O2):
define void @free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = getelementptr i8, i8* %0, i64 -20
%5 = bitcast i8* %4 to i32*
%6 = getelementptr i8, i8* %0, i64 -8
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 8
store i32 %9, i32* %5
br label %10
10: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int screen_id;

/* Variables and functions */
int /*<<< orphan*/ SendChar(int);
void SetScreen(unsigned short int screen_id) {
  SendChar((0XEE) & 0xFF);
  SendChar((0xB1) & 0xFF);
  SendChar((0x00) & 0xFF);
  SendChar(((screen_id) >> 8) & 0xFF);
  SendChar((screen_id)&0xFF);
  SendChar((((0XFFFCFFFF) >> 16) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) >> 16) & 0xFF);
  SendChar((((0XFFFCFFFF) & 0xFFFF) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) & 0xFFFF) & 0xFF);
}


x86 assembly (clang, -O0):
<SetScreen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0xb1,%edi
call   1030 <SendChar@plt>
xor    %edi,%edi
call   1030 <SendChar@plt>
movzwl -0x2(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
movzwl -0x2(%rbp),%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetScreen>:
push   %rbx
mov    %edi,%ebx
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0xb1,%edi
call   1030 <SendChar@plt>
xor    %edi,%edi
call   1030 <SendChar@plt>
mov    %ebx,%edi
shr    $0x8,%edi
call   1030 <SendChar@plt>
movzbl %bl,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
pop    %rbx
jmp    1030 <SendChar@plt>

LLVM IR (-O0):
define void @SetScreen(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call i32 @SendChar(i32 238)
%4 = call i32 @SendChar(i32 177)
%5 = call i32 @SendChar(i32 0)
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = ashr i32 %7, 8
%9 = and i32 %8, 255
%10 = call i32 @SendChar(i32 %9)
%11 = load i16, i16* %2
%12 = zext i16 %11 to i32
%13 = and i32 %12, 255
%14 = call i32 @SendChar(i32 %13)
%15 = call i32 @SendChar(i32 255)
%16 = call i32 @SendChar(i32 252)
%17 = call i32 @SendChar(i32 255)
%18 = call i32 @SendChar(i32 255)
ret void
}

LLVM IR (-O2):
define void @SetScreen(i16 zeroext %0) {
%2 = tail call i32 @SendChar(i32 238)
%3 = tail call i32 @SendChar(i32 177)
%4 = tail call i32 @SendChar(i32 0)
%5 = zext i16 %0 to i32
%6 = lshr i32 %5, 8
%7 = tail call i32 @SendChar(i32 %6)
%8 = and i32 %5, 255
%9 = tail call i32 @SendChar(i32 %8)
%10 = tail call i32 @SendChar(i32 255)
%11 = tail call i32 @SendChar(i32 252)
%12 = tail call i32 @SendChar(i32 255)
%13 = tail call i32 @SendChar(i32 255)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ make_filename(long, char *, char *);
long umfpack_zi_save_symbolic(void *, char *);
void umf4zssym(void **Symbolic, long *filenum, long *status) {
  char filename[200];
  make_filename(*filenum, "s", filename);
  *status = umfpack_zi_save_symbolic(*Symbolic, filename);
}


x86 assembly (clang, -O0):
<umf4zssym>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    -0xe0(%rbp),%rdx
lea    0xeb4(%rip),%rsi
call   1030 <make_filename@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    -0xe0(%rbp),%rsi
call   1040 <umfpack_zi_save_symbolic@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umf4zssym>:
push   %r15
push   %r14
push   %rbx
sub    $0xd0,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
mov    (%rsi),%rdi
lea    0xec4(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdx
call   1030 <make_filename@plt>
mov    (%rbx),%rdi
mov    %r15,%rsi
call   1040 <umfpack_zi_save_symbolic@plt>
mov    %rax,(%r14)
add    $0xd0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"s\00"
define void @umf4zssym(i8** %0, i64* %1, i64* %2) {
%4 = alloca i8**
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca [200 x i8]
store i8** %0, i8*** %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%8 = load i64*, i64** %5
%9 = load i64, i64* %8
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%11 = call i32 @make_filename(i64 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i8**, i8*** %4
%13 = load i8*, i8** %12
%14 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%15 = call i64 @umfpack_zi_save_symbolic(i8* %13, i8* %14)
%16 = load i64*, i64** %6
store i64 %15, i64* %16
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"s\00"
define void @umf4zssym(i8** nocapture %0, i64* nocapture %1, i64* nocapture writeonly %2) {
%4 = alloca [200 x i8]
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%6 = load i64, i64* %1
%7 = call i32 @make_filename(i64 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %5)
%8 = load i8*, i8** %0
%9 = call i64 @umfpack_zi_save_symbolic(i8* %8, i8* %5)
store i64 %9, i64* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ ShreyasAcquired(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int pthread_mutex_lock(int /*<<< orphan*/ *);
char *strerror(int);
void ShreyasLock(pthread_mutex_t *m) {
  int err = pthread_mutex_lock(m);
  if (err == 0) {
    ShreyasAcquired(m);
  } else if (err != 0) {
    printf("lock was NOT successful,error: %s\n", strerror(err));
  }
}


x86 assembly (clang, -O0):
<ShreyasLock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <pthread_mutex_lock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1170 <ShreyasLock+0x30>
mov    -0x8(%rbp),%rdi
call   1040 <ShreyasAcquired@plt>
jmp    1196 <ShreyasLock+0x56>
cmpl   $0x0,-0xc(%rbp)
je     1191 <ShreyasLock+0x51>
mov    -0xc(%rbp),%edi
call   1050 <strerror@plt>
mov    %rax,%rsi
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
jmp    1196 <ShreyasLock+0x56>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShreyasLock>:
push   %rbx
mov    %rdi,%rbx
call   1060 <pthread_mutex_lock@plt>
test   %eax,%eax
je     1164 <ShreyasLock+0x24>
mov    %eax,%edi
call   1050 <strerror@plt>
lea    0xea5(%rip),%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <ShreyasAcquired@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"lock was NOT successful,error: %s\0A\00"
define void @ShreyasLock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_mutex_lock(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32*, i32** %2
%10 = call i32 @ShreyasAcquired(i32* %9)
br label %19
11: ; preds = %1
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* %3
%16 = call i8* @strerror(i32 %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %14, %11
br label %19
19: ; preds = %18, %8
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"lock was NOT successful,error: %s\0A\00"
define void @ShreyasLock(i32* %0) {
%2 = tail call i32 @pthread_mutex_lock(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @ShreyasAcquired(i32* %0)
br label %9
6: ; preds = %1
%7 = tail call i8* @strerror(i32 %2)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ adainit();
int /*<<< orphan*/ challenge_PI_any_one();
int /*<<< orphan*/ challenge_PI_run();
int /*<<< orphan*/ challenge_initStates();
int main() {
  adainit();
  challenge_initStates();
  challenge_PI_run();
  challenge_PI_run();
  challenge_PI_any_one();
  challenge_PI_run();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <adainit@plt>
xor    %eax,%eax
call   1060 <challenge_initStates@plt>
xor    %eax,%eax
call   1030 <challenge_PI_run@plt>
xor    %eax,%eax
call   1030 <challenge_PI_run@plt>
xor    %eax,%eax
call   1040 <challenge_PI_any_one@plt>
xor    %eax,%eax
call   1030 <challenge_PI_run@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @adainit()
%3 = call i32 (...) @challenge_initStates()
%4 = call i32 (...) @challenge_PI_run()
%5 = call i32 (...) @challenge_PI_run()
%6 = call i32 (...) @challenge_PI_any_one()
%7 = call i32 (...) @challenge_PI_run()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @adainit()
%2 = tail call i32 (...) @challenge_initStates()
%3 = tail call i32 (...) @challenge_PI_run()
%4 = tail call i32 (...) @challenge_PI_run()
%5 = tail call i32 (...) @challenge_PI_any_one()
%6 = tail call i32 (...) @challenge_PI_run()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ buff;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
int check_module(void) {
  FILE *fd = popen("lsmod | grep kgloom", "r");
  int loaded = 0;
  char buff[16];
  if (fread(buff, 1, sizeof(buff), fd) > 0)
    loaded = 1;
  pclose(fd);
  return loaded;
}


x86 assembly (clang, -O0):
<check_module>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
lea    0xece(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x10,%edx
call   1030 <fread@plt>
cmp    $0x0,%rax
jle    117e <check_module+0x4e>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pclose@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_module>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
lea    0xec3(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,%rbx
mov    %rsp,%rdi
mov    $0x1,%esi
mov    $0x10,%edx
mov    %rax,%rcx
call   1030 <fread@plt>
xor    %ebp,%ebp
test   %rax,%rax
setg   %bpl
mov    %rbx,%rdi
call   1040 <pclose@plt>
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"lsmod | grep kgloom\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @check_module() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca [16 x i8]
%4 = call i32* @popen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %1
store i32 0, i32* %2
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%6 = load i32*, i32** %1
%7 = call i64 @fread(i8* %5, i32 1, i32 16, i32* %6)
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 1, i32* %2
br label %10
10: ; preds = %9, %0
%11 = load i32*, i32** %1
%12 = call i32 @pclose(i32* %11)
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [20 x i8] c"lsmod | grep kgloom\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @check_module() {
%1 = alloca [16 x i8]
%2 = tail call i32* @popen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%4 = call i64 @fread(i8* %3, i32 1, i32 16, i32* %2)
%5 = icmp sgt i64 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @pclose(i32* %2)
ret i32 %6
}
int Max(int i, int j) {
  if (i > j) {
    return i;
  } else {
    return j;
  }
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<Max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    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    %esi,%edi
cmovg  %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* %4
%7 = load i32, i32* %5
%8 = icmp sgt 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 sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ GIT_UNUSED(unsigned int *);
int git_mutex_lock(unsigned int *mutex) {
  GIT_UNUSED(mutex);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @git_mutex_lock(i32* %0) {
%2 = tail call i32 @GIT_UNUSED(i32* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x5f() {
  Assert_real((isodigit(95) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              480, ("isodigit should be 0 for _"));
}


x86 assembly (clang, -O0):
<t_isodigit_0x5f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5f,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x1e0,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0x5f>:
push   %rax
mov    $0x5f,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x1e0,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for _\00"
define void @t_isodigit_0x5f() {
%1 = call i64 @isodigit(i32 95)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 480, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for _\00"
define void @t_isodigit_0x5f() {
%1 = tail call i64 @isodigit(i32 95)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 480, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ seqContinue();
void handleExtContinue() { seqContinue(); }


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

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

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

LLVM IR (-O2):
define void @handleExtContinue() {
%1 = tail call i32 (...) @seqContinue()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int openat_(int, char const *, int);
int /*<<< orphan*/ printf(char *, int, char const *);
int openat_or_die(int dfd, const char *path, int flags) {
  int fd = openat_(dfd, path, flags);
  if (fd < 0) {
    printf("Failed to openat(%d, '%s'); "
           "check prerequisites are available\n",
           dfd, path);
    exit(1);
  }
  return fd;
}


x86 assembly (clang, -O0):
<openat_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <openat_@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    117b <openat_or_die+0x4b>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openat_or_die>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <openat_@plt>
test   %eax,%eax
js     1148 <openat_or_die+0x18>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xeb1(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [63 x i8] c"Failed to openat(%d, '%s'); check prerequisites are available\0A\00"
define i32 @openat_or_die(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @openat_(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %3
%15 = load i32, i32* %4
%16 = load i8*, i8** %5
%17 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %15, i8* %16)
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %3
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
@.str = [63 x i8] c"Failed to openat(%d, '%s'); check prerequisites are available\0A\00"
define i32 @openat_or_die(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @openat_(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret i32 %4
}