xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int tr_mfa2aln_usage() {
  fprintf(stderr, "Usage: treebest mfa2aln [-n] <fasta_align>\n");
  return 1;
}


x86 assembly (clang, -O0):
<tr_mfa2aln_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tr_mfa2aln_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"Usage: treebest mfa2aln [-n] <fasta_align>\0A\00"
define i32 @tr_mfa2aln_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"Usage: treebest mfa2aln [-n] <fasta_align>\0A\00"
define i32 @tr_mfa2aln_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int foo(int, int, int, int, int, int);
int main() {
  int a, b, c, d, e, f, g, h, i;
  a = b = c = d = e = f = 5;
  return foo(a, b, c, d, e, f);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x1c(%rbp)
movl   $0x5,-0x18(%rbp)
movl   $0x5,-0x14(%rbp)
movl   $0x5,-0x10(%rbp)
movl   $0x5,-0xc(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
call   1030 <foo@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%edi
mov    $0x5,%esi
mov    $0x5,%edx
mov    $0x5,%ecx
mov    $0x5,%r8d
mov    $0x5,%r9d
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 5, i32 5, i32 5, i32 5, i32 5, i32 5)
ret i32 %1
}
void INT_Excep_SCI3_ERI3(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCI3_ERI3() {
ret void
}
int c062(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @c062() {
ret i32 0
}

LLVM IR (-O2):
define i32 @c062() {
ret i32 0
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ exit(int);
void cmd_exit(int argc, char **argv) {
  int status = 0;
  if (argc > 1) {
    status = atoi(argv[1]);
  }
  exit(status);
}


x86 assembly (clang, -O0):
<cmd_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1150 <cmd_exit+0x30>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<cmd_exit>:
push   %rax
mov    %edi,%eax
xor    %edi,%edi
cmp    $0x2,%eax
jl     1135 <cmd_exit+0x15>
mov    0x8(%rsi),%rdi
call   1030 <atoi@plt>
mov    %eax,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @cmd_exit(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
store i32 %12, i32* %5
br label %13
13: ; preds = %8, %2
%14 = load i32, i32* %5
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
define void @cmd_exit(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ %7, %4 ], [ 0, %2 ]
%10 = tail call i32 @exit(i32 %9)
unreachable
}
/* Variables and functions */
long sd(long);
long seq(long n) {
  if (n == 0)
    return 1;
  long res = 1;
  for (long i = 1, prev = 1; i < n; i++) {
    res = prev + sd(prev);
    prev = res;
  }
  return res;
}


x86 assembly (clang, -O0):
<seq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <seq+0x24>
movq   $0x1,-0x8(%rbp)
jmp    119a <seq+0x8a>
movq   $0x1,-0x18(%rbp)
movq   $0x1,-0x20(%rbp)
movq   $0x1,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1192 <seq+0x82>
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <sd@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    114c <seq+0x3c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
cmp    $0x2,%rdi
jl     1141 <seq+0x31>
mov    %rdi,%r14
add    $0xffffffffffffffff,%r14
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <sd@plt>
add    %rax,%rbx
add    $0xffffffffffffffff,%r14
jne    1130 <seq+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @seq(i64 %0) {
%2 = icmp sgt i64 %0, 1
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i64 [ %7, %3 ], [ 1, %1 ]
%5 = phi i64 [ %8, %3 ], [ 1, %1 ]
%6 = tail call i64 @sd(i64 %4)
%7 = add nsw i64 %6, %4
%8 = add nuw nsw i64 %5, 1
%9 = icmp eq i64 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i64 [ 1, %1 ], [ %7, %3 ]
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char);
char *son(char *p) {
  while (p && *p && !isspace(*p))
    p++;
  return (p);
}


x86 assembly (clang, -O0):
<son>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1158 <son+0x48>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1158 <son+0x48>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1168 <son+0x58>
jmp    1179 <son+0x69>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <son+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<son>:
push   %rbx
test   %rdi,%rdi
je     113a <son+0x2a>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     113c <son+0x2c>
nop
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    113c <son+0x2c>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <son+0x10>
jmp    113c <son+0x2c>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @son(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %19, %1
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %17
6: ; preds = %3
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %6
%12 = load i8*, i8** %2
%13 = load i8, i8* %12
%14 = call i32 @isspace(i8 signext %13)
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
br label %17
17: ; preds = %11, %6, %3
%18 = phi i1 [ false, %6 ], [ false, %3 ], [ %16, %11 ]
br i1 %18, label %19, label %22
19: ; preds = %17
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %2
br label %3
22: ; preds = %17
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
define i8* @son(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = tail call i32 @isspace(i8 signext %7)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %6, %3, %1
%16 = phi i8* [ null, %1 ], [ %0, %3 ], [ %8, %6 ], [ %12, %11 ]
ret i8* %16
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "df"
        " [-k][-P][file...]\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Usage: df [-k][-P][file...]\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [29 x i8] c"Usage: df [-k][-P][file...]\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
struct bwb_line *bwb_CASE_IS(struct bwb_line *l) {
  bwx_DEBUG(__FUNCTION__);
  return bwb_CASE_IF(l);
}


x86 assembly (clang, -O0):
<bwb_CASE_IS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <bwx_DEBUG@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <bwb_CASE_IF@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwb_CASE_IS>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <bwx_DEBUG@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <bwb_CASE_IF@plt>
cltq
pop    %rbx
ret

LLVM IR (-O0):
%struct.bwb_line = type opaque
@__FUNCTION__.bwb_CASE_IS = [12 x i8] c"bwb_CASE_IS\00"
define %struct.bwb_line* @bwb_CASE_IS(%struct.bwb_line* %0) {
%2 = alloca %struct.bwb_line*
store %struct.bwb_line* %0, %struct.bwb_line** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.bwb_CASE_IS, i64 0, i64 0))
%4 = load %struct.bwb_line*, %struct.bwb_line** %2
%5 = call i32 (%struct.bwb_line*, ...) bitcast (i32 (...)* @bwb_CASE_IF to i32 (%struct.bwb_line*, ...)*)(%struct.bwb_line* %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to %struct.bwb_line*
ret %struct.bwb_line* %7
}

LLVM IR (-O2):
%struct.bwb_line = type opaque
@__FUNCTION__.bwb_CASE_IS = [12 x i8] c"bwb_CASE_IS\00"
define %struct.bwb_line* @bwb_CASE_IS(%struct.bwb_line* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.bwb_CASE_IS, i64 0, i64 0))
%3 = tail call i32 (%struct.bwb_line*, ...) bitcast (i32 (...)* @bwb_CASE_IF to i32 (%struct.bwb_line*, ...)*)(%struct.bwb_line* %0)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to %struct.bwb_line*
ret %struct.bwb_line* %5
}
/* Variables and functions */
int /*<<< orphan*/ fooA(int *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  int x = 20;
  printf("The address of x is  %p\n", (int *)&x);
  fooA(&x);
  printf("The value of x is %i\n", x);
  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)
movl   $0x14,-0x14(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x14(%rbp),%rdi
call   1040 <fooA@plt>
mov    -0x14(%rbp),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x14,0xc(%rsp)
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <fooA@plt>
mov    0xc(%rsp),%esi
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"The address of x is %p\0A\00"
@.str.1 = [22 x i8] c"The value of x is %i\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 20, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32* %6)
%8 = call i32 @fooA(i32* %6)
%9 = load i32, i32* %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"The address of x is %p\0A\00"
@.str.1 = [22 x i8] c"The value of x is %i\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 20, i32* %3
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = call i32 @fooA(i32* %3)
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ greet(char const *);
int main() {
  const char *name = "DevFest";
  greet(name);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"DevFest\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @greet(i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"DevFest\00"
define i32 @main() {
%1 = tail call i32 @greet(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ send_event;
};
typedef TYPE_1__ XKeymapEvent;

/* Variables and functions */
int get_XKeymapEvent_send_event(void *_p) {
  return (int)((XKeymapEvent *)_p)->send_event;
}


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

x86 assembly (clang, -O2):
<get_XKeymapEvent_send_event>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XKeymapEvent_send_event(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XKeymapEvent_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void omap_hsmmc_late_init(struct omap2_hsmmc_info *info) {}


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

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

LLVM IR (-O0):
%struct.omap2_hsmmc_info = type opaque
define void @omap_hsmmc_late_init(%struct.omap2_hsmmc_info* %0) {
%2 = alloca %struct.omap2_hsmmc_info*
store %struct.omap2_hsmmc_info* %0, %struct.omap2_hsmmc_info** %2
ret void
}

LLVM IR (-O2):
%struct.omap2_hsmmc_info = type opaque
define void @omap_hsmmc_late_init(%struct.omap2_hsmmc_info* nocapture %0) {
ret void
}
/* Variables and functions */
void *calloc(size_t, int);
void *malloc(size_t);
void *default_alloc(size_t size, int zero, void *user_data) {
  return zero ? calloc(size, 1) : malloc(size);
}


x86 assembly (clang, -O0):
<default_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1154 <default_alloc+0x34>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x20(%rbp)
jmp    1161 <default_alloc+0x41>
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_alloc>:
test   %esi,%esi
je     112e <default_alloc+0xe>
mov    $0x1,%esi
jmp    1030 <calloc@plt>
jmp    1040 <malloc@plt>

LLVM IR (-O0):
define i8* @default_alloc(i64 %0, i32 %1, i8* %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i8*
store i64 %0, i64* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i64, i64* %4
%11 = call i8* @calloc(i64 %10, i32 1)
br label %15
12: ; preds = %3
%13 = load i64, i64* %4
%14 = call i8* @malloc(i64 %13)
br label %15
15: ; preds = %12, %9
%16 = phi i8* [ %11, %9 ], [ %14, %12 ]
ret i8* %16
}

LLVM IR (-O2):
define i8* @default_alloc(i64 %0, i32 %1, i8* nocapture readnone %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i8* @calloc(i64 %0, i32 1)
br label %9
7: ; preds = %3
%8 = tail call i8* @malloc(i64 %0)
br label %9
9: ; preds = %7, %5
%10 = phi i8* [ %6, %5 ], [ %8, %7 ]
ret i8* %10
}
void __assert(const char *file, int line, const char *failedexpr) {}


x86 assembly (clang, -O0):
<__assert>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @__assert(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
ret void
}

LLVM IR (-O2):
define void @__assert(i8* nocapture %0, i32 %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _sys_printf(char *);
int /*<<< orphan*/ _sys_set_pg0_paging();
int /*<<< orphan*/ _sys_set_pg1_paging();
int /*<<< orphan*/ start_kernel();
void startup_32(void) {
  _sys_printf(" hello world\n");
  _sys_set_pg0_paging();
  _sys_set_pg1_paging();
  start_kernel();
}


x86 assembly (clang, -O0):
<startup_32>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1060 <_sys_printf@plt>
mov    $0x0,%al
call   1050 <_sys_set_pg0_paging@plt>
mov    $0x0,%al
call   1030 <_sys_set_pg1_paging@plt>
mov    $0x0,%al
call   1040 <start_kernel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<startup_32>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1060 <_sys_printf@plt>
xor    %eax,%eax
call   1050 <_sys_set_pg0_paging@plt>
xor    %eax,%eax
call   1030 <_sys_set_pg1_paging@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <start_kernel@plt>

LLVM IR (-O0):
@.str = [14 x i8] c" hello world\0A\00"
define void @startup_32() {
%1 = call i32 @_sys_printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @_sys_set_pg0_paging()
%3 = call i32 (...) @_sys_set_pg1_paging()
%4 = call i32 (...) @start_kernel()
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c" hello world\0A\00"
define void @startup_32() {
%1 = tail call i32 @_sys_printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @_sys_set_pg0_paging()
%3 = tail call i32 (...) @_sys_set_pg1_paging()
%4 = tail call i32 (...) @start_kernel()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void ticket_destroy(volatile uint32_t *lock) {}


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

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

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

LLVM IR (-O2):
define void @ticket_destroy(i32* nocapture %0) {
ret void
}
void etext(void) {}


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

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

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

LLVM IR (-O2):
define void @etext() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Car_AxlesClear(int /*<<< orphan*/);
int /*<<< orphan*/ Car_Get(int);
void Car_CarAxlesClear(int carnum) { Car_AxlesClear(Car_Get(carnum)); }


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

x86 assembly (clang, -O2):
<Car_CarAxlesClear>:
push   %rax
call   1040 <Car_Get@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <Car_AxlesClear@plt>

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

LLVM IR (-O2):
define void @Car_CarAxlesClear(i32 %0) {
%2 = tail call i32 @Car_Get(i32 %0)
%3 = tail call i32 @Car_AxlesClear(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ bar();
int /*<<< orphan*/ foo();
char *malloc(int);
int main(void) {
  int i;
  char *a = malloc(1000000 * sizeof(char));
  for (i = 0; i <= 1000000; i++) {
    foo();
    a[i] = 0;
    bar();
  }
  a = (char *)177;
  _exit(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xf4240,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xf4240,-0x8(%rbp)
jg     1199 <main+0x59>
mov    $0x0,%al
call   1060 <foo@plt>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    $0x0,%al
call   1040 <bar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1164 <main+0x24>
mov    $0xb1,%eax
mov    %rax,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xf4241,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <foo@plt>
xor    %eax,%eax
call   1040 <bar@plt>
add    $0xffffffff,%ebx
jne    1140 <main+0x10>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i8* @malloc(i32 1000000)
store i8* %4, i8** %3
store i32 0, i32* %2
br label %5
5: ; preds = %15, %0
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 1000000
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = call i32 (...) @foo()
%10 = load i8*, i8** %3
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
store i8 0, i8* %13
%14 = call i32 (...) @bar()
br label %15
15: ; preds = %8
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %5
18: ; preds = %5
store i8* inttoptr (i64 177 to i8*), i8** %3
%19 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 (...) @foo()
%4 = tail call i32 (...) @bar()
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 1000001
br i1 %6, label %7, label %1
7: ; preds = %1
%8 = tail call i32 @_exit(i32 1)
unreachable
}
void test_step_resume(void) {
  foo();
  asm("nop");
  asm("nop");
}


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

x86 assembly (clang, -O2):
<test_step_resume>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
nop
nop
pop    %rax
ret

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

LLVM IR (-O2):
define void @test_step_resume() {
%1 = tail call i32 (...) @foo()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
float epsilon() {
  float eps = 1.0f;
  while (1.0f + eps != 1.0f)
    eps /= 2.0f;
  return eps;
}


x86 assembly (clang, -O0):
<epsilon>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xee7(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  0xeda(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    113a <epsilon+0x3a>
jp     113a <epsilon+0x3a>
jmp    1155 <epsilon+0x55>
movss  -0x4(%rbp),%xmm0
movss  0xebd(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1111 <epsilon+0x11>
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<epsilon>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @epsilon() {
%1 = alloca float
store float 1.000000e+00, float* %1
br label %2
2: ; preds = %6, %0
%3 = load float, float* %1
%4 = fadd float 1.000000e+00, %3
%5 = fcmp une float %4, 1.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load float, float* %1
%8 = fdiv float %7, 2.000000e+00
store float %8, float* %1
br label %2
9: ; preds = %2
%10 = load float, float* %1
ret float %10
}

LLVM IR (-O2):
define float @epsilon() {
ret float 0x3E70000000000000
}
main(void) {
  int i;
  for (i = 0; i < 10; ++i)
    ;
  return i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    112f <main+0x2f>
jmp    1121 <main+0x21>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 10
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee80211_is_coding_doucoding(__le16 fc) {
  return (fc & cpu_to_le16(0x000c | 0x00f0)) == cpu_to_le16(0x000c | 0x0010);
}


x86 assembly (clang, -O0):
<ieee80211_is_coding_doucoding>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x1c,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_coding_doucoding>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0x1c,%edi
call   1030 <cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_coding_doucoding(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @cpu_to_le16(i32 28)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_coding_doucoding(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @cpu_to_le16(i32 28)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fastq_pair_stream(char *, char *);
int /*<<< orphan*/ help();
int main(int argc, char *argv[]) {
  if (argc < 3) {
    help();
    exit(0);
  }
  fastq_pair_stream(argv[1], argv[2]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    1157 <main+0x27>
mov    $0x0,%al
call   1040 <help@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <fastq_pair_stream@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jle    1147 <main+0x17>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1030 <fastq_pair_stream@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1040 <help@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 3
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = call i32 (...) @help()
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %2
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %4
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i32 @fastq_pair_stream(i8* %13, i8* %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 (...) @help()
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @fastq_pair_stream(i8* %9, i8* %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void panic(char *msg) {
  fprintf(stderr, "%s", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<panic>:
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):
<panic>:
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 = [3 x i8] c"%s\00"
define void @panic(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 ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @panic(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ f02();
int /*<<< orphan*/ f14();
int /*<<< orphan*/ f18();
void test1(void) {
  int i;
  f02();
  f14();
  f18();
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <f02@plt>
mov    $0x0,%al
call   1050 <f14@plt>
mov    $0x0,%al
call   1040 <f18@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rax
xor    %eax,%eax
call   1030 <f02@plt>
xor    %eax,%eax
call   1050 <f14@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <f18@plt>

LLVM IR (-O0):
define void @test1() {
%1 = alloca i32
%2 = call i32 (...) @f02()
%3 = call i32 (...) @f14()
%4 = call i32 (...) @f18()
ret void
}

LLVM IR (-O2):
define void @test1() {
%1 = tail call i32 (...) @f02()
%2 = tail call i32 (...) @f14()
%3 = tail call i32 (...) @f18()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x34() {
  Assert_real((isascii(52)),
              "/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_isascii.c",
              265, ("isascii should be 1 for 4"));
}


x86 assembly (clang, -O0):
<t_isascii_0x34>:
push   %rbp
mov    %rsp,%rbp
mov    $0x34,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x109,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x34>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x109,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for 4\00"
define void @t_isascii_0x34() {
%1 = call i32 @isascii(i32 52)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 265, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for 4\00"
define void @t_isascii_0x34() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 265, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void split_opcode(short *lower, short *upper, short opcode) {
  short mask;
  mask = 0x0F;
  *lower = (opcode & mask);
  mask = 0xF0;
  *upper = (opcode & mask) >> 4;
}


x86 assembly (clang, -O0):
<split_opcode>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
movw   $0xf,-0x14(%rbp)
movswl -0x12(%rbp),%eax
movswl -0x14(%rbp),%ecx
and    %ecx,%eax
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
movw   $0xf0,-0x14(%rbp)
movswl -0x12(%rbp),%eax
movswl -0x14(%rbp),%ecx
and    %ecx,%eax
sar    $0x4,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<split_opcode>:
mov    %edx,%eax
and    $0xf,%eax
mov    %ax,(%rdi)
shr    $0x4,%edx
and    $0xf,%edx
mov    %dx,(%rsi)
ret

LLVM IR (-O0):
define void @split_opcode(i16* %0, i16* %1, i16 signext %2) {
%4 = alloca i16*
%5 = alloca i16*
%6 = alloca i16
%7 = alloca i16
store i16* %0, i16** %4
store i16* %1, i16** %5
store i16 %2, i16* %6
store i16 15, i16* %7
%8 = load i16, i16* %6
%9 = sext i16 %8 to i32
%10 = load i16, i16* %7
%11 = sext i16 %10 to i32
%12 = and i32 %9, %11
%13 = trunc i32 %12 to i16
%14 = load i16*, i16** %4
store i16 %13, i16* %14
store i16 240, i16* %7
%15 = load i16, i16* %6
%16 = sext i16 %15 to i32
%17 = load i16, i16* %7
%18 = sext i16 %17 to i32
%19 = and i32 %16, %18
%20 = ashr i32 %19, 4
%21 = trunc i32 %20 to i16
%22 = load i16*, i16** %5
store i16 %21, i16* %22
ret void
}

LLVM IR (-O2):
define void @split_opcode(i16* nocapture writeonly %0, i16* nocapture writeonly %1, i16 signext %2) {
%4 = and i16 %2, 15
store i16 %4, i16* %0
%5 = lshr i16 %2, 4
%6 = and i16 %5, 15
store i16 %6, i16* %1
ret void
}
void multidecl(sname) char *sname;
{ error2error(sname, " already declared"); }


x86 assembly (clang, -O0):
<multidecl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x0,%al
call   1030 <error2error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multidecl>:
lea    0xee9(%rip),%rsi
xor    %eax,%eax
jmp    1030 <error2error@plt>

LLVM IR (-O0):
@.str = [18 x i8] c" already declared\00"
define void @multidecl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error2error to i32 (i8*, i8*, ...)*)(i8* %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c" already declared\00"
define void @multidecl(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error2error to i32 (i8*, i8*, ...)*)(i8* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
void test() {
  printf("%s:%d %s()\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/fengbohello/practice/refs/heads/master/"
         "clang/attribute/weak_fun/fun.c",
         21, __func__);
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @smemstat_top_clear() {
%1 = tail call i32 (...) @clear()
ret void
}
/* Variables and functions */
scalar_t__ ihex_getchex();
unsigned long ihex_gethex(int size) {
  unsigned long v = 0;
  while (size > 0) {
    v *= 16;
    v += ihex_getchex();
    size--;
  }
  return v;
}


x86 assembly (clang, -O0):
<ihex_gethex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1156 <ihex_gethex+0x46>
mov    -0x10(%rbp),%rax
shl    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <ihex_getchex@plt>
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1123 <ihex_gethex+0x13>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ihex_gethex>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1138 <ihex_gethex+0x28>
mov    %edi,%ebp
add    $0x1,%ebp
xor    %ebx,%ebx
xchg   %ax,%ax
shl    $0x4,%rbx
xor    %eax,%eax
call   1030 <ihex_getchex@plt>
add    %rax,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1120 <ihex_gethex+0x10>
jmp    113a <ihex_gethex+0x2a>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @ihex_gethex(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
store i64 0, i64* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i64, i64* %3
%9 = mul i64 %8, 16
store i64 %9, i64* %3
%10 = call i64 (...) @ihex_getchex()
%11 = load i64, i64* %3
%12 = add i64 %11, %10
store i64 %12, i64* %3
%13 = load i32, i32* %2
%14 = add nsw i32 %13, -1
store i32 %14, i32* %2
br label %4
15: ; preds = %4
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @ihex_gethex(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = shl i64 %4, 4
%7 = tail call i64 (...) @ihex_getchex()
%8 = add i64 %7, %6
%9 = add nsw i32 %5, -1
%10 = icmp ugt i32 %5, 1
br i1 %10, label %3, label %11
11: ; preds = %3, %1
%12 = phi i64 [ 0, %1 ], [ %8, %3 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char *argv[]) {
  write(1, "Hello, world!\n", 0xE);
  sleep(5);
  write(1, "Hello, world!\n", 0xE);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
lea    0xec5(%rip),%rsi
mov    $0xe,%edx
call   1030 <write@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
mov    $0x1,%edi
lea    0xea5(%rip),%rsi
mov    $0xe,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0xe,%edx
call   1030 <write@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0xe,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, world!\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 14)
%4 = tail call i32 @sleep(i32 5)
%5 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 14)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ run();
int /*<<< orphan*/ startInit();
int main(void) {
  startInit();
  run();
  while (1) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <startInit@plt>
mov    $0x0,%al
call   1040 <run@plt>
jmp    113d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <startInit@plt>
xor    %eax,%eax
call   1040 <run@plt>
nop
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @startInit()
%3 = call i32 (...) @run()
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @startInit()
%2 = tail call i32 (...) @run()
br label %3
3: ; preds = %0, %3
br label %3
}
/* Type definitions */
struct xdp_md {
  int dummy;
};

/* Variables and functions */
int XDP_TX;
__attribute__((section("tx"), used)) int xdp_tx(struct xdp_md *xdp) {
  return XDP_TX;
}


x86 assembly (clang, -O0):
<xdp_tx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdp_tx>:
mov    0x2ee9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.xdp_md = type { i32 }
@XDP_TX = global i32 0
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.xdp_md*)* @xdp_tx to i8*)], section "llvm.metadata"
define i32 @xdp_tx(%struct.xdp_md* %0) section "tx" {
%2 = alloca %struct.xdp_md*
store %struct.xdp_md* %0, %struct.xdp_md** %2
%3 = load i32, i32* @XDP_TX
ret i32 %3
}

LLVM IR (-O2):
%struct.xdp_md = type { i32 }
@XDP_TX = global i32 0
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.xdp_md*)* @xdp_tx to i8*)], section "llvm.metadata"
define i32 @xdp_tx(%struct.xdp_md* nocapture readnone %0) section "tx" {
%2 = load i32, i32* @XDP_TX
ret i32 %2
}