xunge/DecIR huggingface dataset:
/* Variables and functions */
int add2(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() { printf("test %d", add2(1, 2)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <add2@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"test %d\00"
define i32 @main() {
%1 = call i32 @add2(i32 1, i32 2)
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"test %d\00"
define i32 @main() {
%1 = tail call i32 @add2(i32 1, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_118() {
  Assert_real((isqrt(118) == 10),
              "/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/stdlib/isqrt.c",
              595, ("Integer square root of 118 should be 10"));
}


x86 assembly (clang, -O0):
<t_sqrt_118>:
push   %rbp
mov    %rsp,%rbp
mov    $0x76,%edi
call   1030 <isqrt@plt>
cmp    $0xa,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x253,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_118>:
push   %rax
mov    $0x76,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xa,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x253,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 118 should be 10\00"
define void @t_sqrt_118() {
%1 = call i32 @isqrt(i32 118)
%2 = icmp eq i32 %1, 10
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 595, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 118 should be 10\00"
define void @t_sqrt_118() {
%1 = tail call i32 @isqrt(i32 118)
%2 = icmp eq i32 %1, 10
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 595, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, long long);
char *_i64toa(int64_t i, char *a, int radix) {
  switch (radix) {
  case 10:
    sprintf(a, "%lld", (long long)i);
    break;
  case 16:
    sprintf(a, "%llx", (long long)i);
    break;
  }
  return a;
}


x86 assembly (clang, -O0):
<_i64toa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0xa,%eax
je     1148 <_i64toa+0x38>
jmp    1137 <_i64toa+0x27>
mov    -0x18(%rbp),%eax
sub    $0x10,%eax
je     1161 <_i64toa+0x51>
jmp    1175 <_i64toa+0x65>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xea9(%rip),%rsi
call   1030 <sprintf@plt>
jmp    1175 <_i64toa+0x65>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe95(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_i64toa>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rax
cmp    $0xa,%edx
je     112a <_i64toa+0x1a>
cmp    $0x10,%edx
jne    113c <_i64toa+0x2c>
lea    0xedd(%rip),%rsi
jmp    1131 <_i64toa+0x21>
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [5 x i8] c"%llx\00"
define i8* @_i64toa(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
switch i32 %7, label %16 [
i32 10, label %8
i32 16, label %12
]
8: ; preds = %3
%9 = load i8*, i8** %5
%10 = load i64, i64* %4
%11 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %10)
br label %16
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = load i64, i64* %4
%15 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %14)
br label %16
16: ; preds = %3, %12, %8
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [5 x i8] c"%llx\00"
define i8* @_i64toa(i64 %0, i8* returned writeonly %1, i32 %2) {
switch i32 %2, label %8 [
i32 10, label %5
i32 16, label %4
]
4: ; preds = %3
br label %5
5: ; preds = %3, %4
%6 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %3 ]
%7 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) %6, i64 %0)
br label %8
8: ; preds = %5, %3
ret i8* %1
}
int fun651() { return 651; }


x86 assembly (clang, -O0):
<fun651>:
push   %rbp
mov    %rsp,%rbp
mov    $0x28b,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun651>:
mov    $0x28b,%eax
ret

LLVM IR (-O0):
define i32 @fun651() {
ret i32 651
}

LLVM IR (-O2):
define i32 @fun651() {
ret i32 651
}
int ft_isalpha(int c) {
  if ((c < 91 && c > 64) || (c < 123 && c > 96))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x5b,-0x8(%rbp)
jge    111b <ft_isalpha+0x1b>
cmpl   $0x40,-0x8(%rbp)
jg     112f <ft_isalpha+0x2f>
cmpl   $0x7b,-0x8(%rbp)
jge    113b <ft_isalpha+0x3b>
cmpl   $0x60,-0x8(%rbp)
jle    113b <ft_isalpha+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <ft_isalpha+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ft_isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int infinity() {
  int sk = 0;
  while (1) {
    sk++;
    printf("WOO");
    if (sk == 1000000) {
      break;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<infinity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0xf4240,-0x4(%rbp)
jne    1146 <infinity+0x36>
jmp    114b <infinity+0x3b>
jmp    111f <infinity+0xf>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<infinity>:
push   %rbp
push   %rbx
push   %rax
mov    $0xf4240,%ebp
lea    0xee1(%rip),%rbx
nop
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1120 <infinity+0x10>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"WOO\00"
define i32 @infinity() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
%3 = add nuw nsw i32 %2, 1
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %3, 1000000
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 1
}
void unsigned_char_and_signed_char_signed_char(unsigned char *LHS,
                                               signed char RHS) {
  (*LHS) &= RHS;
}


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

x86 assembly (clang, -O2):
<unsigned_char_and_signed_char_signed_char>:
and    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @unsigned_char_and_signed_char_signed_char(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = and i8 %3, %1
store i8 %4, i8* %0
ret void
}
/* Type definitions */
struct hash_table {
  int dummy;
};

/* Variables and functions */
int hash_table_contains(struct hash_table *, char const *);
int string_set_contains(struct hash_table *ht, const char *s) {
  return hash_table_contains(ht, s);
}


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

x86 assembly (clang, -O2):
<string_set_contains>:
jmp    1030 <hash_table_contains@plt>

LLVM IR (-O0):
%struct.hash_table = type { i32 }
define i32 @string_set_contains(%struct.hash_table* %0, i8* %1) {
%3 = alloca %struct.hash_table*
%4 = alloca i8*
store %struct.hash_table* %0, %struct.hash_table** %3
store i8* %1, i8** %4
%5 = load %struct.hash_table*, %struct.hash_table** %3
%6 = load i8*, i8** %4
%7 = call i32 @hash_table_contains(%struct.hash_table* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.hash_table = type { i32 }
define i32 @string_set_contains(%struct.hash_table* %0, i8* %1) {
%3 = tail call i32 @hash_table_contains(%struct.hash_table* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xb4() {
  Assert_real((isxdigit(180) == 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_isxdigit.c",
              905, ("isxdigit should be 0 for 0xb4"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xb4>:
push   %rax
mov    $0xb4,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x389,%edx
pop    %rax
jmp    1040 <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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xb4\00"
define void @t_isxdigit_0xb4() {
%1 = call i64 @isxdigit(i32 180)
%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 905, i8* getelementptr inbounds ([30 x i8], [30 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xb4\00"
define void @t_isxdigit_0xb4() {
%1 = tail call i64 @isxdigit(i32 180)
%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 905, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int write(int, void *, int);
int Write(int sockfd, void *buf, int num) {
  int n;
  n = write(sockfd, buf, num);
  if (n == -1) {
    perror("Write");
    exit(1);
  }
  return n;
}


x86 assembly (clang, -O0):
<Write>:
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   1030 <write@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1174 <Write+0x44>
lea    0xe9b(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Write>:
push   %rax
call   1030 <write@plt>
cmp    $0xffffffff,%eax
je     113d <Write+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Write\00"
define i32 @Write(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 @write(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %3
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
@.str = [6 x i8] c"Write\00"
define i32 @Write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret i32 %4
}
void free_cvector(v, nl, nh) long nh, nl;
unsigned char *v;
{ free((char *)(v + nl - 1)); }


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

x86 assembly (clang, -O2):
<free_cvector>:
add    %rsi,%rdi
add    $0xffffffffffffffff,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_cvector(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = getelementptr inbounds i8, i8* %9, i64 -1
ret void
}

LLVM IR (-O2):
define void @free_cvector(i8* nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 %1
%5 = getelementptr inbounds i8, i8* %4, i64 -1
tail call void @free(i8* %5)
ret void
}
/* Type definitions */
struct roff_man {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ man_mparse(struct roff_man const *);
int /*<<< orphan*/ mparse_getkeep(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void man_man(void *arg, const struct roff_man *man) {
  fputs(mparse_getkeep(man_mparse(man)), stdout);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<man_man>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <man_mparse@plt>
mov    %eax,%edi
call   1050 <mparse_getkeep@plt>
mov    %eax,%edi
mov    0x2e77(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<man_man>:
push   %rbx
mov    %rsi,%rdi
call   1040 <man_mparse@plt>
mov    %eax,%edi
call   1050 <mparse_getkeep@plt>
mov    0x2e89(%rip),%rbx
mov    (%rbx),%esi
mov    %eax,%edi
call   1030 <fputs@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1060 <fflush@plt>

LLVM IR (-O0):
%struct.roff_man = type { i32 }
@stdout = global i32 0
define void @man_man(i8* %0, %struct.roff_man* %1) {
%3 = alloca i8*
%4 = alloca %struct.roff_man*
store i8* %0, i8** %3
store %struct.roff_man* %1, %struct.roff_man** %4
%5 = load %struct.roff_man*, %struct.roff_man** %4
%6 = call i32 @man_mparse(%struct.roff_man* %5)
%7 = call i32 @mparse_getkeep(i32 %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fputs(i32 %7, i32 %8)
%10 = load i32, i32* @stdout
%11 = call i32 @fflush(i32 %10)
ret void
}

LLVM IR (-O2):
%struct.roff_man = type { i32 }
@stdout = global i32 0
define void @man_man(i8* nocapture readnone %0, %struct.roff_man* %1) {
%3 = tail call i32 @man_mparse(%struct.roff_man* %1)
%4 = tail call i32 @mparse_getkeep(i32 %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fputs(i32 %4, i32 %5)
%7 = load i32, i32* @stdout
%8 = tail call i32 @fflush(i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atof(char *);
unsigned long float_new(int /*<<< orphan*/);
char *str2cstr(unsigned long);
unsigned long int string_to_f(unsigned long int self) {
  char *ptr;
  ptr = str2cstr(self);
  return float_new(atof(ptr));
}


x86 assembly (clang, -O0):
<string_to_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <str2cstr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
mov    %eax,%edi
call   1050 <float_new@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_to_f>:
push   %rax
call   1040 <str2cstr@plt>
mov    %rax,%rdi
call   1030 <atof@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <float_new@plt>

LLVM IR (-O0):
define i64 @string_to_f(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @str2cstr(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @atof(i8* %6)
%8 = call i64 @float_new(i32 %7)
ret i64 %8
}

LLVM IR (-O2):
define i64 @string_to_f(i64 %0) {
%2 = tail call i8* @str2cstr(i64 %0)
%3 = tail call i32 @atof(i8* %2)
%4 = tail call i64 @float_new(i32 %3)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ uart_tx_byte(unsigned char);
void __console_tx_char(int loglevel, unsigned char byte) {
  if (8 > loglevel) {
    uart_tx_byte(byte);
  }
}


x86 assembly (clang, -O0):
<__console_tx_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    $0x8,%eax
cmp    -0x4(%rbp),%eax
jle    1138 <__console_tx_char+0x28>
movzbl -0x5(%rbp),%edi
call   1030 <uart_tx_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__console_tx_char>:
cmp    $0x7,%edi
jg     111e <__console_tx_char+0xe>
movzbl %sil,%edi
jmp    1030 <uart_tx_byte@plt>
ret

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

LLVM IR (-O2):
define void @__console_tx_char(i32 %0, i8 zeroext %1) {
%3 = icmp slt i32 %0, 8
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @uart_tx_byte(i8 zeroext %1)
br label %6
6: ; preds = %4, %2
ret void
}
void DUMMY_update_parameters(struct frac_struct *a, struct view_struct *b,
                             struct realpal_struct *c, char *d, double *e) {
  return;
}


x86 assembly (clang, -O0):
<DUMMY_update_parameters>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.frac_struct = type opaque
%struct.view_struct = type opaque
%struct.realpal_struct = type opaque
define void @DUMMY_update_parameters(%struct.frac_struct* %0, %struct.view_struct* %1, %struct.realpal_struct* %2, i8* %3, double* %4) {
%6 = alloca %struct.frac_struct*
%7 = alloca %struct.view_struct*
%8 = alloca %struct.realpal_struct*
%9 = alloca i8*
%10 = alloca double*
store %struct.frac_struct* %0, %struct.frac_struct** %6
store %struct.view_struct* %1, %struct.view_struct** %7
store %struct.realpal_struct* %2, %struct.realpal_struct** %8
store i8* %3, i8** %9
store double* %4, double** %10
ret void
}

LLVM IR (-O2):
%struct.frac_struct = type opaque
%struct.view_struct = type opaque
%struct.realpal_struct = type opaque
define void @DUMMY_update_parameters(%struct.frac_struct* nocapture %0, %struct.view_struct* nocapture %1, %struct.realpal_struct* nocapture %2, i8* nocapture %3, double* nocapture %4) {
ret void
}
/* Variables and functions */
int read(int, void *, size_t);
int outside_read(int fd, void *buf, size_t count) {
  return read(fd, buf, count);
}


x86 assembly (clang, -O0):
<outside_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outside_read>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @outside_read(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
void INT_Excep_CAN0_ERS0(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_CAN0_ERS0() {
ret void
}
int FindNonZero(int *ar, int len) {
  int i;
  for (i = 0; i < len; i++) {
    if (ar[i] != 0) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<FindNonZero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    114e <FindNonZero+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     113b <FindNonZero+0x3b>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <FindNonZero+0x55>
jmp    1140 <FindNonZero+0x40>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <FindNonZero+0x12>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FindNonZero>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111f <FindNonZero+0x1f>
mov    %esi,%edx
xor    %ecx,%ecx
nopl   (%rax)
cmpl   $0x0,(%rdi,%rcx,4)
jne    1120 <FindNonZero+0x20>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1110 <FindNonZero+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @FindNonZero(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %11
%7 = phi i64 [ 0, %4 ], [ %12, %11 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %16, label %6
14: ; preds = %6
%15 = trunc i64 %7 to i32
br label %16
16: ; preds = %11, %14, %2
%17 = phi i32 [ -1, %2 ], [ %15, %14 ], [ -1, %11 ]
ret i32 %17
}
void cmx_registry_format_filename(char *filename_buf, const int process_id,
                                  const char *const component_name) {
  sprintf(filename_buf, "cmx.%d.%.*s", process_id, 63, component_name);
}


x86 assembly (clang, -O0):
<cmx_registry_format_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%r8
lea    0xecb(%rip),%rsi
mov    $0x3f,%ecx
mov    $0x0,%al
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmx_registry_format_filename>:
mov    %rdx,%r8
mov    %esi,%edx
lea    0xee4(%rip),%rsi
mov    $0x3f,%ecx
xor    %eax,%eax
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"cmx.%d.%.*s\00"
define void @cmx_registry_format_filename(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %8, i32 63, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"cmx.%d.%.*s\00"
define void @cmx_registry_format_filename(i8* nocapture writeonly %0, i32 %1, i8* %2) {
%4 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1, i32 63, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_ram_command(int);
void sdram_set_command_precharge(void) { set_ram_command(0x2); }


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

x86 assembly (clang, -O2):
<sdram_set_command_precharge>:
mov    $0x2,%edi
jmp    1030 <set_ram_command@plt>

LLVM IR (-O0):
define void @sdram_set_command_precharge() {
%1 = call i32 @set_ram_command(i32 2)
ret void
}

LLVM IR (-O2):
define void @sdram_set_command_precharge() {
%1 = tail call i32 @set_ram_command(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int n, result;
  int factorial(int);
  printf("\nEnter a number: ");
  scanf("%d", &n);
  result = factorial(n);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <factorial@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"\0AEnter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @factorial(i32 %5)
ret i32 0
}
/* Variables and functions */
scalar_t__ ceil(int);
double rand();
int rndgen(int a, int b) {
  double r;
  r = rand() / 2147483648.0;
  return ((int)(ceil((b - a + 1) * r)) + a - 1);
}


x86 assembly (clang, -O0):
<rndgen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
movsd  0xec3(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <ceil@plt>
add    -0x4(%rbp),%eax
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rndgen>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%r14d
xor    %eax,%eax
call   1040 <rand@plt>
mulsd  0xec8(%rip),%xmm0
sub    %r14d,%ebx
add    $0x1,%ebx
cvtsi2sd %ebx,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <ceil@plt>
add    %r14d,%eax
add    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @rndgen(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call double (...) @rand()
%7 = fdiv double %6, 0x41E0000000000000
store double %7, double* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
%11 = add nsw i32 %10, 1
%12 = sitofp i32 %11 to double
%13 = load double, double* %5
%14 = fmul double %12, %13
%15 = fptosi double %14 to i32
%16 = call i64 @ceil(i32 %15)
%17 = trunc i64 %16 to i32
%18 = load i32, i32* %3
%19 = add nsw i32 %17, %18
%20 = sub nsw i32 %19, 1
ret i32 %20
}

LLVM IR (-O2):
define i32 @rndgen(i32 %0, i32 %1) {
%3 = tail call double (...) @rand()
%4 = fmul double %3, 0x3E00000000000000
%5 = sub i32 1, %0
%6 = add i32 %5, %1
%7 = sitofp i32 %6 to double
%8 = fmul double %4, %7
%9 = fptosi double %8 to i32
%10 = tail call i64 @ceil(i32 %9)
%11 = trunc i64 %10 to i32
%12 = add i32 %0, -1
%13 = add i32 %12, %11
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void one() { printf("one"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"one\00"
define void @one() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"one\00"
define void @one() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main() {
  pid_t child_pid;
  child_pid = fork();
  if (child_pid == 0) {
    sleep(60);
  } else {
    printf("parent finished");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1164 <main+0x34>
mov    $0x3c,%edi
call   1040 <sleep@plt>
jmp    1170 <main+0x40>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
je     114b <main+0x1b>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
jmp    1155 <main+0x25>
mov    $0x3c,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"parent finished\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i64 (...) @fork()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @sleep(i32 60)
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"parent finished\00"
define i32 @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @sleep(i32 60)
br label %7
5: ; preds = %0
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret i32 0
}
/* Variables and functions */
int code_table_4_0(unsigned char **);
unsigned char *year_of_model_version_date_location(unsigned char **sec) {
  int pdt;
  unsigned char *p;
  pdt = code_table_4_0(sec);
  switch (pdt) {
  case 60:
  case 61:
    p = sec[4] + 37;
    break;
  default:
    p = NULL;
    break;
  }
  return p;
}


x86 assembly (clang, -O0):
<year_of_model_version_date_location>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <code_table_4_0@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffc4,%eax
sub    $0x1,%eax
ja     1151 <year_of_model_version_date_location+0x41>
jmp    113c <year_of_model_version_date_location+0x2c>
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
add    $0x25,%rax
mov    %rax,-0x18(%rbp)
jmp    1159 <year_of_model_version_date_location+0x49>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<year_of_model_version_date_location>:
push   %rbx
mov    %rdi,%rbx
call   1030 <code_table_4_0@plt>
and    $0xfffffffe,%eax
cmp    $0x3c,%eax
jne    112b <year_of_model_version_date_location+0x1b>
mov    0x20(%rbx),%rax
add    $0x25,%rax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @year_of_model_version_date_location(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
%4 = alloca i8*
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
%6 = call i32 @code_table_4_0(i8** %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
switch i32 %7, label %13 [
i32 60, label %8
i32 61, label %8
]
8: ; preds = %1, %1
%9 = load i8**, i8*** %2
%10 = getelementptr inbounds i8*, i8** %9, i64 4
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i64 37
store i8* %12, i8** %4
br label %14
13: ; preds = %1
store i8* null, i8** %4
br label %14
14: ; preds = %13, %8
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @year_of_model_version_date_location(i8** %0) {
%2 = tail call i32 @code_table_4_0(i8** %0)
%3 = and i32 %2, -2
%4 = icmp eq i32 %3, 60
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = getelementptr inbounds i8*, i8** %0, i64 4
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8, i8* %7, i64 37
br label %9
9: ; preds = %1, %5
%10 = phi i8* [ %8, %5 ], [ null, %1 ]
ret i8* %10
}
/* Type definitions */
struct Node {
  int dummy;
};

/* Variables and functions */
struct Node *createAboveBST(struct Node *);
struct Node *createNode(int);
int /*<<< orphan*/ levelOrderTraversal(struct Node *);
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  struct Node *root = createNode(9);
  root = createAboveBST(root);
  levelOrderTraversal(root);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x9,%edi
call   1040 <createNode@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <createAboveBST@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <levelOrderTraversal@plt>
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x9,%edi
call   1040 <createNode@plt>
mov    %rax,%rdi
call   1050 <createAboveBST@plt>
mov    %rax,%rdi
call   1060 <levelOrderTraversal@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.Node = type { i32 }
@.str = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.Node*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call %struct.Node* @createNode(i32 9)
store %struct.Node* %7, %struct.Node** %6
%8 = load %struct.Node*, %struct.Node** %6
%9 = call %struct.Node* @createAboveBST(%struct.Node* %8)
store %struct.Node* %9, %struct.Node** %6
%10 = load %struct.Node*, %struct.Node** %6
%11 = call i32 @levelOrderTraversal(%struct.Node* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.Node = type { i32 }
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call %struct.Node* @createNode(i32 9)
%4 = tail call %struct.Node* @createAboveBST(%struct.Node* %3)
%5 = tail call i32 @levelOrderTraversal(%struct.Node* %4)
%6 = tail call i32 @putchar(i32 10)
ret i32 0
}
int dbg_check_tnc(struct ubifs_info *c, int extra) { return 0; }


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

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

LLVM IR (-O0):
%struct.ubifs_info = type opaque
define i32 @dbg_check_tnc(%struct.ubifs_info* %0, i32 %1) {
%3 = alloca %struct.ubifs_info*
%4 = alloca i32
store %struct.ubifs_info* %0, %struct.ubifs_info** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.ubifs_info = type opaque
define i32 @dbg_check_tnc(%struct.ubifs_info* nocapture readnone %0, i32 %1) {
ret i32 0
}
void f$$1() { ; }


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

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

LLVM IR (-O0):
define void @"f$$1"() {
ret void
}

LLVM IR (-O2):
define void @"f$$1"() {
ret void
}
/* Type definitions */
struct user_regs_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exec_by_all_variants(int, int *);
void sys_getppid(int variant_count, int *child, struct user_regs_struct *regs) {
  exec_by_all_variants(variant_count, child);
}


x86 assembly (clang, -O0):
<sys_getppid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <exec_by_all_variants@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_getppid>:
jmp    1030 <exec_by_all_variants@plt>

LLVM IR (-O0):
%struct.user_regs_struct = type { i32 }
define void @sys_getppid(i32 %0, i32* %1, %struct.user_regs_struct* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca %struct.user_regs_struct*
store i32 %0, i32* %4
store i32* %1, i32** %5
store %struct.user_regs_struct* %2, %struct.user_regs_struct** %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = call i32 @exec_by_all_variants(i32 %7, i32* %8)
ret void
}

LLVM IR (-O2):
%struct.user_regs_struct = type { i32 }
define void @sys_getppid(i32 %0, i32* %1, %struct.user_regs_struct* nocapture readnone %2) {
%4 = tail call i32 @exec_by_all_variants(i32 %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ native_read_cr3();
int /*<<< orphan*/ native_write_cr3(int /*<<< orphan*/);
__attribute__((always_)) void __native_flush_tlb(void) {
  native_write_cr3(native_read_cr3());
}


x86 assembly (clang, -O0):
<__native_flush_tlb>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <native_read_cr3@plt>
mov    %eax,%edi
call   1040 <native_write_cr3@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__native_flush_tlb>:
push   %rax
xor    %eax,%eax
call   1030 <native_read_cr3@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <native_write_cr3@plt>

LLVM IR (-O0):
define void @__native_flush_tlb() {
%1 = call i32 (...) @native_read_cr3()
%2 = call i32 @native_write_cr3(i32 %1)
ret void
}

LLVM IR (-O2):
define void @__native_flush_tlb() {
%1 = tail call i32 (...) @native_read_cr3()
%2 = tail call i32 @native_write_cr3(i32 %1)
ret void
}
int main() {
  struct a {
    int x;
    int y;
    char z;
  };
  struct b {
    int x;
    int y;
  };
  volatile struct b k;
  volatile struct a *p;
  p = (struct a *)&k;
  p->z = 'q';
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x71,0x8(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.b = type { i32, i32 }
%struct.a = type { i32, i32, i8 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.b
%3 = alloca %struct.a*
store i32 0, i32* %1
%4 = bitcast %struct.b* %2 to %struct.a*
store %struct.a* %4, %struct.a** %3
%5 = load %struct.a*, %struct.a** %3
%6 = getelementptr inbounds %struct.a, %struct.a* %5, i32 0, i32 2
store volatile i8 113, i8* %6
ret i32 0
}

LLVM IR (-O2):
%struct.b = type { i32, i32 }
%struct.a = type { i32, i32, i8 }
define i32 @main() {
ret i32 0
}
int increment() {
  static int i = 1000;
  i++;
  return i;
}


x86 assembly (clang, -O0):
<increment>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f0d(%rip)
mov    0x2f07(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment>:
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
ret

LLVM IR (-O0):
@increment.i = internal global i32 1000
define i32 @increment() {
%1 = load i32, i32* @increment.i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @increment.i
%3 = load i32, i32* @increment.i
ret i32 %3
}

LLVM IR (-O2):
@increment.i = internal unnamed_addr global i32 1000
define i32 @increment() {
%1 = load i32, i32* @increment.i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @increment.i
ret i32 %2
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int strverscmp(int /*<<< orphan*/, int /*<<< orphan*/);
int versionsort(const void *a, const void *b) {
  return strverscmp((*(const struct dirent **)a)->d_name,
                    (*(const struct dirent **)b)->d_name);
}


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

x86 assembly (clang, -O2):
<versionsort>:
mov    (%rdi),%rax
mov    (%rax),%edi
mov    (%rsi),%rax
mov    (%rax),%esi
jmp    1030 <strverscmp@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @versionsort(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 = bitcast i8* %5 to %struct.dirent**
%7 = load %struct.dirent*, %struct.dirent** %6
%8 = getelementptr inbounds %struct.dirent, %struct.dirent* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to %struct.dirent**
%12 = load %struct.dirent*, %struct.dirent** %11
%13 = getelementptr inbounds %struct.dirent, %struct.dirent* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = call i32 @strverscmp(i32 %9, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @versionsort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to %struct.dirent**
%4 = load %struct.dirent*, %struct.dirent** %3
%5 = getelementptr inbounds %struct.dirent, %struct.dirent* %4, i64 0, i32 0
%6 = load i32, i32* %5
%7 = bitcast i8* %1 to %struct.dirent**
%8 = load %struct.dirent*, %struct.dirent** %7
%9 = getelementptr inbounds %struct.dirent, %struct.dirent* %8, i64 0, i32 0
%10 = load i32, i32* %9
%11 = tail call i32 @strverscmp(i32 %6, i32 %10)
ret i32 %11
}
void g_trash_stack_height() {}


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

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

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

LLVM IR (-O2):
define void @g_trash_stack_height() {
ret void
}
char *icl_xz_version(void) { return "5.0.x"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"5.0.x\00"
define i8* @icl_xz_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"5.0.x\00"
define i8* @icl_xz_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int Update(char *, char *, char *);
int HandleSubmitFCRTS(void) {
  return Update("FCRTS", "/local/root/fcrts", "chmod 754 /local/root/fcrts");
}


x86 assembly (clang, -O0):
<HandleSubmitFCRTS>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeee(%rip),%rsi
lea    0xedd(%rip),%rdx
call   1030 <Update@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HandleSubmitFCRTS>:
lea    0xee9(%rip),%rdi
lea    0xef2(%rip),%rsi
lea    0xee1(%rip),%rdx
jmp    1030 <Update@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"FCRTS\00"
@.str.1 = [18 x i8] c"/local/root/fcrts\00"
@.str.2 = [28 x i8] c"chmod 754 /local/root/fcrts\00"
define i32 @HandleSubmitFCRTS() {
%1 = call i32 @Update(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [6 x i8] c"FCRTS\00"
@.str.1 = [18 x i8] c"/local/root/fcrts\00"
@.str.2 = [28 x i8] c"chmod 754 /local/root/fcrts\00"
define i32 @HandleSubmitFCRTS() {
%1 = tail call i32 @Update(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
ret i32 %1
}