xunge/DecIR huggingface dataset:
void __DELETE_org_apache_harmony_niochar_charset_UTF_8(void *me,
                                                       void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_org_apache_harmony_niochar_charset_UTF_8(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_org_apache_harmony_niochar_charset_UTF_8(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void unsigned_char_sub_signed_char_unsigned_char(unsigned char *LHS,
                                                 unsigned char RHS) {
  (*LHS) -= RHS;
}


x86 assembly (clang, -O0):
<unsigned_char_sub_signed_char_unsigned_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
sub    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_char_sub_signed_char_unsigned_char>:
sub    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @unsigned_char_sub_signed_char_unsigned_char(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = sub nsw i32 %9, %6
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
ret void
}

LLVM IR (-O2):
define void @unsigned_char_sub_signed_char_unsigned_char(i8* nocapture %0, i8 zeroext %1) {
%3 = load i8, i8* %0
%4 = sub i8 %3, %1
store i8 %4, i8* %0
ret void
}
/* Variables and functions */
int sqrt(int);
int isPrime(int num) {
  int aux;
  for (aux = 2; aux <= sqrt(num); aux++) {
    if (num % aux == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     116c <isPrime+0x5c>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1159 <isPrime+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1173 <isPrime+0x63>
jmp    115e <isPrime+0x4e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <isPrime+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x2,%ecx
jl     1150 <isPrime+0x40>
mov    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
mov    %ebx,%eax
cltd
idiv   %ebp
test   %edx,%edx
je     114e <isPrime+0x3e>
mov    %ebx,%edi
call   1030 <sqrt@plt>
cmp    %eax,%ebp
jl     1130 <isPrime+0x20>
mov    $0x1,%eax
jmp    1150 <isPrime+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
%3 = icmp slt i32 %2, 2
br i1 %3, label %12, label %8
4: ; preds = %8
%5 = add nuw nsw i32 %9, 1
%6 = tail call i32 @sqrt(i32 %0)
%7 = icmp slt i32 %9, %6
br i1 %7, label %8, label %12
8: ; preds = %1, %4
%9 = phi i32 [ %5, %4 ], [ 2, %1 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %8, %4, %1
%13 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ printf(char *);
void main() {
  fork();
  printf("Novo processo criado!\n");
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Novo processo criado!\0A\00"
define void @main() {
%1 = call i32 (...) @fork()
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"Novo processo criado!\00"
define void @main() {
%1 = tail call i32 (...) @fork()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int aysm_tiling(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  printf("%d\n", aysm_tiling(5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edi
call   1040 <aysm_tiling@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <aysm_tiling@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @aysm_tiling(i32 5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @aysm_tiling(i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void delay() {
  int x;
  int y = 10 + x;
  for (x = 0; x < 100000; x++) {
    y += x;
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x186a0,-0x4(%rbp)
jge    1138 <delay+0x38>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1114 <delay+0x14>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_file;

/* Variables and functions */
int SQLITE_OK;
int /*<<< orphan*/ p_msync();
int scmSync(sqlite3_file *pFile, int flags) {
  p_msync();
  return SQLITE_OK;
}


x86 assembly (clang, -O0):
<scmSync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <p_msync@plt>
mov    0x2ebb(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scmSync>:
push   %rax
xor    %eax,%eax
call   1030 <p_msync@plt>
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@SQLITE_OK = global i32 0
define i32 @scmSync(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 (...) @p_msync()
%6 = load i32, i32* @SQLITE_OK
ret i32 %6
}

LLVM IR (-O2):
@SQLITE_OK = global i32 0
define i32 @scmSync(i32* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @p_msync()
%4 = load i32, i32* @SQLITE_OK
ret i32 %4
}
int tadd_ok(int x, int y) {
  int sum = x + y;
  int neg_over = x < 0 && y < 0 && sum >= 0;
  int pos_over = x >= 0 && y >= 0 && sum < 0;
  return !neg_over && !pos_over;
}


x86 assembly (clang, -O0):
<tadd_ok>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x15(%rbp)
jge    113b <tadd_ok+0x3b>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x15(%rbp)
jge    113b <tadd_ok+0x3b>
cmpl   $0x0,-0xc(%rbp)
setge  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x16(%rbp)
jl     116e <tadd_ok+0x6e>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x16(%rbp)
jl     116e <tadd_ok+0x6e>
cmpl   $0x0,-0xc(%rbp)
setl   %al
mov    %al,-0x16(%rbp)
mov    -0x16(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x17(%rbp)
jne    1194 <tadd_ok+0x94>
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x17(%rbp)
mov    -0x17(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tadd_ok>:
test   %edi,%esi
setns  %al
mov    %esi,%ecx
add    %edi,%ecx
sets   %cl
setns  %dl
or     %al,%cl
or     %edi,%esi
sets   %al
or     %dl,%al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @tadd_ok(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %2
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32, i32* %5
%18 = icmp sge i32 %17, 0
br label %19
19: ; preds = %16, %13, %2
%20 = phi i1 [ false, %13 ], [ false, %2 ], [ %18, %16 ]
%21 = zext i1 %20 to i32
store i32 %21, i32* %6
%22 = load i32, i32* %3
%23 = icmp sge i32 %22, 0
br i1 %23, label %24, label %30
24: ; preds = %19
%25 = load i32, i32* %4
%26 = icmp sge i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load i32, i32* %5
%29 = icmp slt i32 %28, 0
br label %30
30: ; preds = %27, %24, %19
%31 = phi i1 [ false, %24 ], [ false, %19 ], [ %29, %27 ]
%32 = zext i1 %31 to i32
store i32 %32, i32* %7
%33 = load i32, i32* %6
%34 = icmp ne i32 %33, 0
br i1 %34, label %39, label %35
35: ; preds = %30
%36 = load i32, i32* %7
%37 = icmp ne i32 %36, 0
%38 = xor i1 %37, true
br label %39
39: ; preds = %35, %30
%40 = phi i1 [ false, %30 ], [ %38, %35 ]
%41 = zext i1 %40 to i32
ret i32 %41
}

LLVM IR (-O2):
define i32 @tadd_ok(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = and i32 %1, %0
%5 = icmp sgt i32 %4, -1
%6 = icmp slt i32 %3, 0
%7 = select i1 %5, i1 true, i1 %6
%8 = or i32 %1, %0
%9 = icmp slt i32 %8, 0
%10 = icmp sgt i32 %3, -1
%11 = select i1 %9, i1 true, i1 %10
%12 = select i1 %7, i1 %11, i1 false
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int w5100_write_byte(unsigned int, unsigned int);
unsigned w5100_writeSn_byte(unsigned sock, unsigned addr, unsigned data) {
  return w5100_write_byte(0x0400 + sock * 0x0100 + addr, data);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x8,%edi
add    $0x400,%edi
add    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <w5100_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
shl    $0x8,%edi
add    %esi,%edi
add    $0x400,%edi
mov    %edx,%esi
jmp    1030 <w5100_write_byte@plt>

LLVM IR (-O0):
define i32 @w5100_writeSn_byte(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = mul i32 %7, 256
%9 = add i32 1024, %8
%10 = load i32, i32* %5
%11 = add i32 %9, %10
%12 = load i32, i32* %6
%13 = call i32 @w5100_write_byte(i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @w5100_writeSn_byte(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 8
%5 = add i32 %4, 1024
%6 = add i32 %5, %1
%7 = tail call i32 @w5100_write_byte(i32 %6, i32 %2)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ solve_from_stdin();
int /*<<< orphan*/ srand(int);
int time(int /*<<< orphan*/ *);
int main() {
  srand(time(NULL) ^ (int)&main);
  solve_from_stdin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
mov    0x2e97(%rip),%rax
xor    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <solve_from_stdin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
xor    0x2eaa(%rip),%eax
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <solve_from_stdin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @time(i32* null)
%3 = xor i32 %2, ptrtoint (i32 ()* @main to i32)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @solve_from_stdin()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = xor i32 %1, ptrtoint (i32 ()* @main to i32)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @solve_from_stdin()
ret i32 0
}
int matches(const char *fmt, const char *str) {
  while (*fmt) {
    if (*fmt != '#' && *str != *fmt)
      return 0;
    ++fmt;
    ++str;
  }
  return !*str;
}


x86 assembly (clang, -O0):
<matches>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1168 <matches+0x68>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
je     114b <matches+0x4b>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     114b <matches+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    117c <matches+0x7c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <matches+0xc>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<matches>:
xor    %ecx,%ecx
jmp    1114 <matches+0x14>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rcx
movzbl (%rdi,%rcx,1),%eax
cmp    $0x23,%al
je     1110 <matches+0x10>
test   %al,%al
je     1128 <matches+0x28>
cmp    %al,(%rsi,%rcx,1)
je     1110 <matches+0x10>
xor    %eax,%eax
ret
xor    %eax,%eax
cmpb   $0x0,(%rsi,%rcx,1)
sete   %al
ret

LLVM IR (-O0):
define i32 @matches(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 = %24, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %29
10: ; preds = %6
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 35
br i1 %14, label %15, label %24
15: ; preds = %10
%16 = load i8*, i8** %5
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %18, %21
br i1 %22, label %23, label %24
23: ; preds = %15
store i32 0, i32* %3
br label %35
24: ; preds = %15, %10
%25 = load i8*, i8** %4
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %4
%27 = load i8*, i8** %5
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %5
br label %6
29: ; preds = %6
%30 = load i8*, i8** %5
%31 = load i8, i8* %30
%32 = icmp ne i8 %31, 0
%33 = xor i1 %32, true
%34 = zext i1 %33 to i32
store i32 %34, i32* %3
br label %35
35: ; preds = %29, %23
%36 = load i32, i32* %3
ret i32 %36
}

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

/* Variables and functions */
int ftell(int /*<<< orphan*/ *);
int64_t openmpt_stream_file_tell_func(void *stream) {
  FILE *f = 0;
  int64_t retval = 0;
  f = (FILE *)stream;
  if (!f) {
    return -1;
  }
  retval = ftell(f);
  if (retval < 0) {
    return -1;
  }
  return retval;
}


x86 assembly (clang, -O0):
<openmpt_stream_file_tell_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114a <openmpt_stream_file_tell_func+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1172 <openmpt_stream_file_tell_func+0x62>
mov    -0x18(%rbp),%rdi
call   1030 <ftell@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    116c <openmpt_stream_file_tell_func+0x5c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1172 <openmpt_stream_file_tell_func+0x62>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openmpt_stream_file_tell_func>:
test   %rdi,%rdi
je     112c <openmpt_stream_file_tell_func+0x1c>
push   %rax
call   1030 <ftell@plt>
mov    %eax,%ecx
test   %eax,%eax
mov    $0xffffffff,%eax
cmovns %ecx,%eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @openmpt_stream_file_tell_func(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @ftell(i32* %4)
%6 = icmp sgt i32 %5, -1
%7 = select i1 %6, i32 %5, i32 -1
br label %8
8: ; preds = %3, %1
%9 = phi i32 [ -1, %1 ], [ %7, %3 ]
ret i32 %9
}
unsigned long long xchg_64(void *ptr, unsigned long long x) {
  asm volatile("xchgq %0,%1"
               : "=r"(x)
               : "m"(*(volatile unsigned long long *)ptr), "0"(x)
               : "memory");
  return x;
}


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

x86 assembly (clang, -O2):
<xchg_64>:
mov    %rsi,%rax
xchg   %rax,(%rdi)
ret

LLVM IR (-O0):
define i64 @xchg_64(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 = bitcast i8* %5 to i64*
%7 = load i64, i64* %4
%8 = call i64 asm sideeffect "xchgq $0,$1", "=r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i64 %7)
store i64 %8, i64* %4
%9 = load i64, i64* %4
ret i64 %9
}

LLVM IR (-O2):
define i64 @xchg_64(i8* %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
%4 = tail call i64 asm sideeffect "xchgq $0,$1", "=r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %3, i64 %1)
ret i64 %4
}
void getKeysFromCommand(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               77, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<getKeysFromCommand>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4d,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getKeysFromCommand>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x4d,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.getKeysFromCommand = [19 x i8] c"getKeysFromCommand\00"
define void @getKeysFromCommand() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 77, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.getKeysFromCommand, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.getKeysFromCommand = [19 x i8] c"getKeysFromCommand\00"
define void @getKeysFromCommand() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 77, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.getKeysFromCommand, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ munmap(void *, size_t);
void page_free(void *mem, size_t size) { munmap(mem, size); }


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

x86 assembly (clang, -O2):
<page_free>:
jmp    1030 <munmap@plt>

LLVM IR (-O0):
define void @page_free(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 i32 @munmap(i8* %5, i64 %6)
ret void
}

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


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

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

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

LLVM IR (-O2):
define void @cmd_next() {
ret void
}
/* Variables and functions */
int asciitoint(char *, int *, int);
char *proto_get_ascii(char **);
int proto_get_int(char **s, int *val, int base) {
  char *cp;
  int error;
  cp = proto_get_ascii(s);
  if (cp == NULL)
    return (-1);
  error = asciitoint(cp, val, base);
  return (error);
}


x86 assembly (clang, -O0):
<proto_get_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <proto_get_ascii@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1157 <proto_get_int+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <proto_get_int+0x50>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <asciitoint@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proto_get_int>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
call   1040 <proto_get_ascii@plt>
test   %rax,%rax
je     1145 <proto_get_int+0x25>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <asciitoint@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @proto_get_int(i8** %0, i32* %1, i32 %2) {
%4 = tail call i8* @proto_get_ascii(i8** %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @asciitoint(i8* %4, i32* %1, i32 %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
void token_free(char **tok_arr) {
  int i = 0;
  while (tok_arr[i])
    ++i;
  free(tok_arr[i + 1]);
  free(tok_arr);
}


x86 assembly (clang, -O0):
<token_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1144 <token_free+0x34>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <token_free+0x13>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<token_free>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
cmpq   $0x0,(%rbx,%rax,8)
lea    0x1(%rax),%rax
jne    1120 <token_free+0x10>
mov    %eax,%eax
mov    (%rbx,%rax,8),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @token_free(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = add i64 %3, 1
%10 = and i64 %9, 4294967295
%11 = getelementptr inbounds i8*, i8** %0, i64 %10
%12 = load i8*, i8** %11
tail call void @free(i8* %12)
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret void
}
void gtk_paned_add1() {}


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

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

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

LLVM IR (-O2):
define void @gtk_paned_add1() {
ret void
}
int hai_vinto(int n) {
  if (n > 50)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<hai_vinto>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jle    111d <hai_vinto+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1124 <hai_vinto+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hai_vinto>:
xor    %eax,%eax
cmp    $0x33,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @hai_vinto(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 50
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %8
7: ; preds = %1
store i32 1, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @hai_vinto(i32 %0) {
%2 = icmp slt i32 %0, 51
%3 = zext i1 %2 to i32
ret i32 %3
}
void foo078() {}


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

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

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

LLVM IR (-O2):
define void @foo078() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ randomize_fd(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ *xfopen(char *, char *);
int randomize_file(char *infile, char *outfile) {
  FILE *out_fd, *in1_fd, *in2_fd;
  out_fd = xfopen(outfile, "w+");
  in1_fd = xfopen(infile, "r");
  randomize_fd(in1_fd, out_fd);
  fclose(in1_fd);
  fclose(out_fd);
  return 0;
}


x86 assembly (clang, -O0):
<randomize_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <xfopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea4(%rip),%rsi
call   1030 <xfopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <randomize_fd@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomize_file>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rax
mov    %rdi,%r14
lea    0xebe(%rip),%rsi
mov    %rax,%rdi
call   1030 <xfopen@plt>
mov    %rax,%r15
lea    0xeaf(%rip),%rsi
mov    %r14,%rdi
call   1030 <xfopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1050 <randomize_fd@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"w+\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @randomize_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
%9 = call i32* @xfopen(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %9, i32** %5
%10 = load i8*, i8** %3
%11 = call i32* @xfopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %11, i32** %6
%12 = load i32*, i32** %6
%13 = load i32*, i32** %5
%14 = call i32 @randomize_fd(i32* %12, i32* %13)
%15 = load i32*, i32** %6
%16 = call i32 @fclose(i32* %15)
%17 = load i32*, i32** %5
%18 = call i32 @fclose(i32* %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"w+\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @randomize_file(i8* %0, i8* %1) {
%3 = tail call i32* @xfopen(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32* @xfopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @randomize_fd(i32* %4, i32* %3)
%6 = tail call i32 @fclose(i32* %4)
%7 = tail call i32 @fclose(i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, char *, int, char *);
int main() {
  printf("%s %d %s\n", "CIAO", 23, "CIAO", 23, "CIAO");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xedd(%rip),%r9
mov    $0x17,%r8d
mov    %r9,%rsi
mov    %r8d,%edx
mov    %r9,%rcx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xeeb(%rip),%rcx
mov    %rcx,%rsi
mov    $0x17,%edx
mov    $0x17,%r8d
mov    %rcx,%r9
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%s %d %s\0A\00"
@.str.1 = [5 x i8] c"CIAO\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s %d %s\0A\00"
@.str.1 = [5 x i8] c"CIAO\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_main(char *);
int main(void) {
  test_main("/etc/motd");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <test_main@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <test_main@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"/etc/motd\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test_main(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"/etc/motd\00"
define i32 @main() {
%1 = tail call i32 @test_main(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ *keepTryingToOpenDir(char const *, int /*<<< orphan*/);
DIR *openDirOrHang(const char *path) { return keepTryingToOpenDir(path, 0); }


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

x86 assembly (clang, -O2):
<openDirOrHang>:
xor    %esi,%esi
jmp    1030 <keepTryingToOpenDir@plt>

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

LLVM IR (-O2):
define i32* @openDirOrHang(i8* %0) {
%2 = tail call i32* @keepTryingToOpenDir(i8* %0, i32 0)
ret i32* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ mbtowc(int /*<<< orphan*/ *, char *, size_t);
void uninitvar_mbtowc(void) {
  wchar_t *pwc;
  char *pmb;
  size_t max;
  (void)mbtowc(pwc, pmb, max);
}


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

x86 assembly (clang, -O2):
<uninitvar_mbtowc>:
jmp    1030 <mbtowc@plt>

LLVM IR (-O0):
define void @uninitvar_mbtowc() {
%1 = alloca i32*
%2 = alloca i8*
%3 = alloca i64
%4 = load i32*, i32** %1
%5 = load i8*, i8** %2
%6 = load i64, i64* %3
%7 = call i32 @mbtowc(i32* %4, i8* %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @uninitvar_mbtowc() {
%1 = tail call i32 @mbtowc(i32* undef, i8* undef, i64 undef)
ret void
}
unsigned long quantum_memman(long change) {
  static long mem = 0, max = 0;
  mem += change;
  if (mem > max)
    max = mem;
  return mem;
}


x86 assembly (clang, -O0):
<quantum_memman>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    0x2f15(%rip),%rax
mov    %rax,0x2f0e(%rip)
mov    0x2f07(%rip),%rax
cmp    0x2f08(%rip),%rax
jle    113c <quantum_memman+0x3c>
mov    0x2ef3(%rip),%rax
mov    %rax,0x2ef4(%rip)
mov    0x2ee5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quantum_memman>:
mov    %rdi,%rax
add    0x2f1e(%rip),%rax
mov    %rax,0x2f17(%rip)
cmp    0x2f18(%rip),%rax
jle    1121 <quantum_memman+0x21>
mov    %rax,0x2f0f(%rip)
ret

LLVM IR (-O0):
@quantum_memman.mem = internal global i64 0
@quantum_memman.max = internal global i64 0
define i64 @quantum_memman(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* @quantum_memman.mem
%5 = add nsw i64 %4, %3
store i64 %5, i64* @quantum_memman.mem
%6 = load i64, i64* @quantum_memman.mem
%7 = load i64, i64* @quantum_memman.max
%8 = icmp sgt i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i64, i64* @quantum_memman.mem
store i64 %10, i64* @quantum_memman.max
br label %11
11: ; preds = %9, %1
%12 = load i64, i64* @quantum_memman.mem
ret i64 %12
}

LLVM IR (-O2):
@quantum_memman.mem = internal unnamed_addr global i64 0
@quantum_memman.max = internal unnamed_addr global i64 0
define i64 @quantum_memman(i64 %0) {
%2 = load i64, i64* @quantum_memman.mem
%3 = add nsw i64 %2, %0
store i64 %3, i64* @quantum_memman.mem
%4 = load i64, i64* @quantum_memman.max
%5 = icmp sgt i64 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 %3, i64* @quantum_memman.max
br label %7
7: ; preds = %6, %1
ret i64 %3
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
scalar_t__ S_ISFIFO(int /*<<< orphan*/);
scalar_t__ fstat(int /*<<< orphan*/, struct stat *);
int _stdin(void) {
  struct stat st;
  if (fstat(STDIN_FILENO, &st) == 0 && S_ISFIFO(st.st_mode)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<_stdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1040 <fstat@plt>
cmp    $0x0,%rax
jne    1162 <_stdin+0x42>
mov    -0x8(%rbp),%edi
call   1030 <S_ISFIFO@plt>
cmp    $0x0,%rax
je     1162 <_stdin+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1169 <_stdin+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_stdin>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1040 <fstat@plt>
test   %rax,%rax
jne    114e <_stdin+0x2e>
mov    (%rsp),%edi
call   1030 <S_ISFIFO@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     114e <_stdin+0x2e>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@STDIN_FILENO = global i32 0
define i32 @_stdin() {
%1 = alloca i32
%2 = alloca %struct.stat
%3 = load i32, i32* @STDIN_FILENO
%4 = call i64 @fstat(i32 %3, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISFIFO(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %6
store i32 1, i32* %1
br label %13
12: ; preds = %6, %0
store i32 0, i32* %1
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@STDIN_FILENO = global i32 0
define i32 @_stdin() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = load i32, i32* @STDIN_FILENO
%4 = call i64 @fstat(i32 %3, %struct.stat* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i64 @S_ISFIFO(i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %6, %0
br label %12
12: ; preds = %6, %11
%13 = phi i32 [ 0, %11 ], [ 1, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ cstore(int, int /*<<< orphan*/);
void init() {
  int x;
  for (x = 0; x < 0x100; x++)
    cstore(x, 0);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1144 <init+0x34>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <cstore@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <init+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <cstore@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <init+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @init() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 256
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @cstore(i32 %6, i32 0)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @init() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @cstore(i32 %2, i32 0)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
/* Variables and functions */
scalar_t__ strtok(char *, char const *);
int getNbTokens(char *list, const char *sep) {
  int nbTokens = 0;
  char *elem;
  elem = (char *)strtok(list, sep);
  while (elem) {
    nbTokens++;
    elem = (char *)strtok(NULL, sep);
  }
  return nbTokens;
}


x86 assembly (clang, -O0):
<getNbTokens>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1162 <getNbTokens+0x52>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <strtok@plt>
mov    %rax,-0x20(%rbp)
jmp    1138 <getNbTokens+0x28>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNbTokens>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <strtok@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1142 <getNbTokens+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebx
xor    %edi,%edi
mov    %r14,%rsi
call   1030 <strtok@plt>
test   %rax,%rax
jne    1130 <getNbTokens+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @getNbTokens(i8* %0, i8* nocapture %1) {
%3 = tail call i64 @strtok(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %7, %5 ], [ 0, %2 ]
%7 = add nuw nsw i32 %6, 1
%8 = tail call i64 @strtok(i8* null, i8* %1)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
%11 = phi i32 [ 0, %2 ], [ %7, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void help(const char *prg) {
  fprintf(stderr,
          "Usage: %s [OPTIONS] FILE [ARGS...]\n"
          "Truncates file and writes arguments to it.\n\n"
          "OPTIONS\n"
          "\t-n\tAppend a newline to each argument\n"
          "\t-a\tAppend instead of truncate\n",
          prg);
  exit(1);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [157 x i8] c"Usage: %s [OPTIONS] FILE [ARGS...]\0ATruncates file and writes arguments to it.\0A\0AOPTIONS\0A\09-n\09Append a newline to each argument\0A\09-a\09Append instead of truncate\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [157 x i8] c"Usage: %s [OPTIONS] FILE [ARGS...]\0ATruncates file and writes arguments to it.\0A\0AOPTIONS\0A\09-n\09Append a newline to each argument\0A\09-a\09Append instead of truncate\0A\00"
define void @help(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ result;

/* Variables and functions */
int /*<<< orphan*/ sysctlbyname(char *, unsigned int *, size_t *,
                                int /*<<< orphan*/ *, int /*<<< orphan*/);
unsigned int intFromSysctlByName(char *name) {
  unsigned int result = 0;
  size_t length = sizeof(result);
  sysctlbyname(name, &result, &length, NULL, 0);
  return result;
}


x86 assembly (clang, -O0):
<intFromSysctlByName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movq   $0x4,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1030 <sysctlbyname@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intFromSysctlByName>:
sub    $0x18,%rsp
movl   $0x0,0xc(%rsp)
movq   $0x4,0x10(%rsp)
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <sysctlbyname@plt>
mov    0xc(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @intFromSysctlByName(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
store i8* %0, i8** %2
store i32 0, i32* %3
store i64 4, i64* %4
%5 = load i8*, i8** %2
%6 = call i32 @sysctlbyname(i8* %5, i32* %3, i64* %4, i32* null, i32 0)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @intFromSysctlByName(i8* %0) {
%2 = alloca i32
%3 = alloca i64
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = bitcast i64* %3 to i8*
store i64 4, i64* %3
%6 = call i32 @sysctlbyname(i8* %0, i32* %2, i64* %3, i32* null, i32 0)
%7 = load i32, i32* %2
ret i32 %7
}