xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ from_dump();
int /*<<< orphan*/ fromd_dump();
int /*<<< orphan*/ iplist_dump();
int /*<<< orphan*/ to_dump();
int /*<<< orphan*/ tod_dump();
int /*<<< orphan*/ whitelist_dump();
void save_state(void) {
  whitelist_dump();
  iplist_dump();
  to_dump();
  tod_dump();
  from_dump();
  fromd_dump();
}


x86 assembly (clang, -O0):
<save_state>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <whitelist_dump@plt>
mov    $0x0,%al
call   1080 <iplist_dump@plt>
mov    $0x0,%al
call   1050 <to_dump@plt>
mov    $0x0,%al
call   1040 <tod_dump@plt>
mov    $0x0,%al
call   1070 <from_dump@plt>
mov    $0x0,%al
call   1030 <fromd_dump@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_state>:
push   %rax
xor    %eax,%eax
call   1060 <whitelist_dump@plt>
xor    %eax,%eax
call   1080 <iplist_dump@plt>
xor    %eax,%eax
call   1050 <to_dump@plt>
xor    %eax,%eax
call   1040 <tod_dump@plt>
xor    %eax,%eax
call   1070 <from_dump@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <fromd_dump@plt>

LLVM IR (-O0):
define void @save_state() {
%1 = call i32 (...) @whitelist_dump()
%2 = call i32 (...) @iplist_dump()
%3 = call i32 (...) @to_dump()
%4 = call i32 (...) @tod_dump()
%5 = call i32 (...) @from_dump()
%6 = call i32 (...) @fromd_dump()
ret void
}

LLVM IR (-O2):
define void @save_state() {
%1 = tail call i32 (...) @whitelist_dump()
%2 = tail call i32 (...) @iplist_dump()
%3 = tail call i32 (...) @to_dump()
%4 = tail call i32 (...) @tod_dump()
%5 = tail call i32 (...) @from_dump()
%6 = tail call i32 (...) @fromd_dump()
ret void
}
int imx6q_cpuidle_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @imx6q_cpuidle_init() {
ret i32 0
}
int execute_setdomainname() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_setdomainname() {
ret i32 0
}
char *cli_line_trim_leading(char *start, const char *const line_end) {
  while (start <= line_end && ' ' == *start)
    start++;
  return start;
}


x86 assembly (clang, -O0):
<cli_line_trim_leading>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x11(%rbp)
ja     1133 <cli_line_trim_leading+0x33>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x20,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1143 <cli_line_trim_leading+0x43>
jmp    1154 <cli_line_trim_leading+0x54>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <cli_line_trim_leading+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_line_trim_leading>:
mov    %rdi,%rax
cmp    %rsi,%rdi
ja     111e <cli_line_trim_leading+0x1e>
nopl   0x0(%rax,%rax,1)
cmpb   $0x20,(%rax)
jne    111e <cli_line_trim_leading+0x1e>
add    $0x1,%rax
cmp    %rsi,%rax
jbe    1110 <cli_line_trim_leading+0x10>
ret

LLVM IR (-O0):
define i8* @cli_line_trim_leading(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %16, %2
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = icmp ule i8* %6, %7
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 32, %12
br label %14
14: ; preds = %9, %5
%15 = phi i1 [ false, %5 ], [ %13, %9 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %3
br label %5
19: ; preds = %14
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
define i8* @cli_line_trim_leading(i8* %0, i8* readnone %1) {
%3 = icmp ugt i8* %0, %1
br i1 %3, label %11, label %4
4: ; preds = %2, %8
%5 = phi i8* [ %9, %8 ], [ %0, %2 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 32
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %5, i64 1
%10 = icmp ugt i8* %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %8, %2
%12 = phi i8* [ %0, %2 ], [ %9, %8 ], [ %5, %4 ]
ret i8* %12
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int msgget(int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int queue_access(key_t keyval, int msg_flags) {
  int msqid;
  if ((msqid = msgget(keyval, msg_flags) == -1)) {
    perror("msgget");
    return -1;
  }
  return msqid;
}


x86 assembly (clang, -O0):
<queue_access>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <msgget@plt>
cmp    $0xffffffff,%eax
sete   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x10(%rbp)
test   $0x1,%al
jne    1157 <queue_access+0x37>
jmp    116f <queue_access+0x4f>
lea    0xea2(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1175 <queue_access+0x55>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<queue_access>:
push   %rax
call   1030 <msgget@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
je     1131 <queue_access+0x11>
pop    %rcx
ret
lea    0xec8(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"msgget\00"
define i32 @queue_access(i32 %0, i32 %1) {
%3 = tail call i32 @msgget(i32 %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ -1, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ MyThreadExit();
int /*<<< orphan*/ printf(char *);
void t0(void *dummy) {
  printf("t0 start\n");
  MyThreadExit();
}


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"t0 start\00"
define void @t0(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @MyThreadExit()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
int verifica_arquivo(FILE *fp) {
  int i = 0;
  char ch;
  while (!feof(fp)) {
    ch = fgetc(fp);
    if (ch == '\n') {
      i++;
    }
  }
  return i;
}


x86 assembly (clang, -O0):
<verifica_arquivo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1151 <verifica_arquivo+0x31>
jmp    1178 <verifica_arquivo+0x58>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
cmp    $0xa,%eax
jne    1173 <verifica_arquivo+0x53>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <verifica_arquivo+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verifica_arquivo>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <feof@plt>
xor    %ebp,%ebp
test   %eax,%eax
jne    115d <verifica_arquivo+0x3d>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1030 <fgetc@plt>
xor    %ecx,%ecx
cmp    $0xa,%al
sete   %cl
add    %ecx,%ebp
mov    %rbx,%rdi
call   1040 <feof@plt>
test   %eax,%eax
je     1140 <verifica_arquivo+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @verifica_arquivo(i32* nocapture %0) {
%2 = tail call i32 @feof(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %12
4: ; preds = %1, %4
%5 = phi i32 [ %9, %4 ], [ 0, %1 ]
%6 = tail call signext i8 @fgetc(i32* %0)
%7 = icmp eq i8 %6, 10
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %5, %8
%10 = tail call i32 @feof(i32* %0)
%11 = icmp eq i32 %10, 0
br i1 %11, label %4, label %12
12: ; preds = %4, %1
%13 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %13
}
OP(fd, eb) { op_eb(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_eb@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_eb()
ret i32 undef
}
/* Variables and functions */
void *AssertDriver(void *, void *, int /*<<< orphan*/, int /*<<< orphan*/ *,
                   int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void *EnvAssert(void *theEnv, void *vTheFact) {
  return AssertDriver(theEnv, vTheFact, 0, NULL, NULL, NULL);
}


x86 assembly (clang, -O0):
<EnvAssert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%rcx
mov    %r9,%r8
call   1030 <AssertDriver@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EnvAssert>:
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <AssertDriver@plt>

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

LLVM IR (-O2):
define i8* @EnvAssert(i8* %0, i8* %1) {
%3 = tail call i8* @AssertDriver(i8* %0, i8* %1, i32 0, i32* null, i32* null, i32* null)
ret i8* %3
}
const char *local_kind(int kind) {
  switch (kind) {
  case 0:
    return "flush";
  case 2:
    return "change";
  case 1:
    return "add";
  default:
    return "???";
  }
}


x86 assembly (clang, -O0):
<local_kind>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     113c <local_kind+0x3c>
jmp    111a <local_kind+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     115c <local_kind+0x5c>
jmp    112b <local_kind+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     114c <local_kind+0x4c>
jmp    116c <local_kind+0x6c>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <local_kind+0x77>
lea    0xeb3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <local_kind+0x77>
lea    0xeaa(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <local_kind+0x77>
lea    0xe9e(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<local_kind>:
cmp    $0x2,%edi
ja     1117 <local_kind+0x17>
movslq %edi,%rax
lea    0xf09(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xef3(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"flush\00"
@.str.1 = [7 x i8] c"change\00"
@.str.2 = [4 x i8] c"add\00"
@.str.3 = [4 x i8] c"???\00"
define i8* @local_kind(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 0, label %5
i32 2, label %6
i32 1, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [6 x i8] c"flush\00"
@.str.1 = [7 x i8] c"change\00"
@.str.2 = [4 x i8] c"add\00"
@.str.3 = [4 x i8] c"???\00"
@reltable.local_kind = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.local_kind to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.local_kind to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.local_kind to i64)) to i32)]
define i8* @local_kind(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.local_kind to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  char a[] = "foo@bar";
  if (strcmp(a, "foo@bar"))
    do {
      ;
      abort();
    } while (0);
  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    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1167 <main+0x47>
jmp    1160 <main+0x40>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x726162406f6f66,%rax
mov    %rax,(%rsp)
lea    0xeca(%rip),%rsi
mov    %rsp,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1147 <main+0x27>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@__const.main.a = [8 x i8] c"foo@bar\00"
@.str = [8 x i8] c"foo@bar\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [8 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [8 x i8]* %6 to i8*
%8 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%9 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
br label %12
12: ; preds = %11
%13 = call i32 (...) @abort()
unreachable
14: ; No predecessors!
br label %15
15: ; preds = %14, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"foo@bar\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 32195221960748902, i64* %3
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %2
ret i32 0
}
char __lt_func(long double d1, long double d2) { return d1 < d2 ? 1 : 0; }


x86 assembly (clang, -O0):
<__lt_func>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__lt_func>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
ret

LLVM IR (-O0):
define signext i8 @__lt_func(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fcmp olt x86_fp80 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @__lt_func(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp olt x86_fp80 %0, %1
%4 = zext i1 %3 to i8
ret i8 %4
}
void fpf_header(l1, l2) struct token *l1;
struct token *l2;
{
  fpf_header_names(l1);
  show_empty_list(l2);
  put_nl();
  fpf_header_types(l1);
}


x86 assembly (clang, -O0):
<fpf_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <fpf_header_names@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <show_empty_list@plt>
mov    $0x0,%al
call   1030 <put_nl@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1060 <fpf_header_types@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpf_header>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <fpf_header_names@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <show_empty_list@plt>
xor    %eax,%eax
call   1030 <put_nl@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <fpf_header_types@plt>

LLVM IR (-O0):
%struct.token = type opaque
define void @fpf_header(%struct.token* %0, %struct.token* %1) {
%3 = alloca %struct.token*
%4 = alloca %struct.token*
store %struct.token* %0, %struct.token** %3
store %struct.token* %1, %struct.token** %4
%5 = load %struct.token*, %struct.token** %3
%6 = call i32 (%struct.token*, ...) bitcast (i32 (...)* @fpf_header_names to i32 (%struct.token*, ...)*)(%struct.token* %5)
%7 = load %struct.token*, %struct.token** %4
%8 = call i32 (%struct.token*, ...) bitcast (i32 (...)* @show_empty_list to i32 (%struct.token*, ...)*)(%struct.token* %7)
%9 = call i32 (...) @put_nl()
%10 = load %struct.token*, %struct.token** %3
%11 = call i32 (%struct.token*, ...) bitcast (i32 (...)* @fpf_header_types to i32 (%struct.token*, ...)*)(%struct.token* %10)
ret void
}

LLVM IR (-O2):
%struct.token = type opaque
define void @fpf_header(%struct.token* %0, %struct.token* %1) {
%3 = tail call i32 (%struct.token*, ...) bitcast (i32 (...)* @fpf_header_names to i32 (%struct.token*, ...)*)(%struct.token* %0)
%4 = tail call i32 (%struct.token*, ...) bitcast (i32 (...)* @show_empty_list to i32 (%struct.token*, ...)*)(%struct.token* %1)
%5 = tail call i32 (...) @put_nl()
%6 = tail call i32 (%struct.token*, ...) bitcast (i32 (...)* @fpf_header_types to i32 (%struct.token*, ...)*)(%struct.token* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_delete();
int /*<<< orphan*/ test_insert();
int /*<<< orphan*/ test_reverse();
int main(void) {
  printf("Start testing singly linked list: \n");
  test_insert();
  test_delete();
  test_reverse();
  printf("\nAll tests done.\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1070 <test_insert@plt>
mov    $0x0,%al
call   1040 <test_delete@plt>
mov    $0x0,%al
call   1060 <test_reverse@plt>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e4d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <test_insert@plt>
xor    %eax,%eax
call   1040 <test_delete@plt>
xor    %eax,%eax
call   1060 <test_reverse@plt>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Start testing singly linked list: \0A\00"
@.str.1 = [18 x i8] c"\0AAll tests done.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @test_insert()
%4 = call i32 (...) @test_delete()
%5 = call i32 (...) @test_reverse()
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [35 x i8] c"Start testing singly linked list: \00"
@str.2 = [17 x i8] c"\0AAll tests done.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @test_insert()
%3 = tail call i32 (...) @test_delete()
%4 = tail call i32 (...) @test_reverse()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.2, i64 0, i64 0))
%6 = load i32, i32* @EXIT_SUCCESS
%7 = tail call i32 @exit(i32 %6)
unreachable
}
int ascii_wctosb(unsigned char *r, const unsigned int wc) {
  if (wc < 0x80) {
    *r = (unsigned char)wc;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ascii_wctosb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x80,-0x14(%rbp)
jae    112f <ascii_wctosb+0x2f>
mov    -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1136 <ascii_wctosb+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_wctosb>:
xor    %eax,%eax
cmp    $0x7f,%esi
ja     110f <ascii_wctosb+0xf>
mov    %sil,(%rdi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ascii_wctosb(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp ult i32 %6, 128
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %5
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %4
store i8 %10, i8* %11
store i32 1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @ascii_wctosb(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp ult i32 %1, 128
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = trunc i32 %1 to i8
store i8 %5, i8* %0
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ 1, %4 ], [ 0, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ msg_print(char *);
void report_mlist_error(const char *err_msg, int error_node, int prev_node) {
  (void)error_node;
  (void)prev_node;
  msg_print((char *)err_msg);
}


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

x86 assembly (clang, -O2):
<report_mlist_error>:
jmp    1030 <msg_print@plt>

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

LLVM IR (-O2):
define void @report_mlist_error(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @msg_print(i8* %0)
ret void
}
int thread_range(int thread_num, int threads, int records) {
  return thread_num * records / threads;
}


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

x86 assembly (clang, -O2):
<thread_range>:
mov    %edi,%eax
imul   %edx,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @thread_range(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %5
%11 = sdiv i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @thread_range(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %0
%5 = sdiv i32 %4, %1
ret i32 %5
}
double maxVal(double a, double b) {
  double ret = a;
  if (a < b) {
    ret = b;
  } else {
  }
  return ret;
}


x86 assembly (clang, -O0):
<maxVal>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    113b <maxVal+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1140 <maxVal+0x40>
jmp    1140 <maxVal+0x40>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxVal>:
maxsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @maxVal(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
store double %6, double* %5
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fcmp olt double %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load double, double* %4
store double %11, double* %5
br label %13
12: ; preds = %2
br label %13
13: ; preds = %12, %10
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
define double @maxVal(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %1, double %0
ret double %4
}
/* Variables and functions */
int _READ(int fd, void *buf, size_t nbytes) { return 0; }


x86 assembly (clang, -O0):
<_READ>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_READ(i32 %0, i8* nocapture readnone %1, i64 %2) {
ret i32 0
}
/* Variables and functions */
int WSAGetLastError();
int HTTPWrapperGetSocketError(int s) { return WSAGetLastError(); }


x86 assembly (clang, -O0):
<HTTPWrapperGetSocketError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <WSAGetLastError@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @HTTPWrapperGetSocketError(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @WSAGetLastError()
ret i32 %3
}

LLVM IR (-O2):
define i32 @HTTPWrapperGetSocketError(i32 %0) {
%2 = tail call i32 (...) @WSAGetLastError()
ret i32 %2
}
/* Variables and functions */
int fibonacci(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("O oitavo termo da sequencia de fibonacci: %d", fibonacci(8));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"O oitavo termo da sequencia de fibonacci: %d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fibonacci(i32 8)
%3 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [45 x i8] c"O oitavo termo da sequencia de fibonacci: %d\00"
define i32 @main() {
%1 = tail call i32 @fibonacci(i32 8)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int handle_proc_exit(int read_fd, int write_fd, struct child_cmd *cmd) {}


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

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

LLVM IR (-O0):
%struct.child_cmd = type opaque
define i32 @handle_proc_exit(i32 %0, i32 %1, %struct.child_cmd* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.child_cmd*
store i32 %0, i32* %5
store i32 %1, i32* %6
store %struct.child_cmd* %2, %struct.child_cmd** %7
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
%struct.child_cmd = type opaque
define i32 @handle_proc_exit(i32 %0, i32 %1, %struct.child_cmd* nocapture readnone %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x49() {
  Assert_real((isspace(73) == 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_isspace.c",
              370, ("isspace should be 0 for I"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x49>:
push   %rax
mov    $0x49,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x172,%edx
pop    %rax
jmp    1040 <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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for I\00"
define void @t_isspace_0x49() {
%1 = call i64 @isspace(i32 73)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 370, 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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for I\00"
define void @t_isspace_0x49() {
%1 = tail call i64 @isspace(i32 73)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 370, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void junk_junk() { printf("no underscores\n"); }


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"no underscores\00"
define void @junk_junk() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
int reset_controller(int bn) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @reset_controller(i32 %0) {
ret i32 0
}
/* Variables and functions */
bool reset_empty_sniffer(void) { return true; }


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

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

LLVM IR (-O0):
define i32 @reset_empty_sniffer() {
ret i32 1
}

LLVM IR (-O2):
define i32 @reset_empty_sniffer() {
ret i32 1
}
/* Variables and functions */
int __api(int, unsigned long);
int rt_set_priority(unsigned long priority) {
  return (__api(8, priority) == 1) ? 0 : 1;
}


x86 assembly (clang, -O0):
<rt_set_priority>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x8,%edi
call   1030 <__api@plt>
mov    %eax,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_set_priority>:
push   %rax
mov    %rdi,%rsi
mov    $0x8,%edi
call   1030 <__api@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rt_set_priority(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @__api(i32 8, i64 %3)
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 0, i32 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @rt_set_priority(i64 %0) {
%2 = tail call i32 @__api(i32 8, i64 %0)
%3 = icmp ne i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void print_usage_exit(void) {
  printf("Usage: hackbench [-pipe] <num groups> [process|thread] [loops]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage_exit>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage_exit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [64 x i8] c"Usage: hackbench [-pipe] <num groups> [process|thread] [loops]\0A\00"
define void @print_usage_exit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [63 x i8] c"Usage: hackbench [-pipe] <num groups> [process|thread] [loops]\00"
define void @print_usage_exit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
void test_exceptions(const char *test_name, int exception) {}


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

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

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

LLVM IR (-O2):
define void @test_exceptions(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int fork();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int main(int argc, char **argv) {
  int ret;
  sleep(5);
  printf("forking...\n");
  ret = fork();
  printf("ret=%d\n", ret);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edi
call   1040 <sleep@plt>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <fork@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1050 <sleep@plt>
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <fork@plt>
lea    0xe9b(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [8 x i8] c"ret=%d\0A\00"
@str = [11 x i8] c"forking...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @sleep(i32 5)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (...) @fork()
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(long *);
void bar(long *lp) { foo(lp); }


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

x86 assembly (clang, -O2):
<bar>:
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define void @bar(i64* %0) {
%2 = tail call i32 @foo(i64* %0)
ret void
}
OP(ed, f3) { illegal_2(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar_fd(char, int);
int /*<<< orphan*/ ft_putstr_fd(char const *, int);
void ft_putendl_fd(char const *s, int fd) {
  if (!(s))
    return;
  ft_putstr_fd(s, fd);
  ft_putchar_fd('\n', fd);
}


x86 assembly (clang, -O0):
<ft_putendl_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113f <ft_putendl_fd+0x1f>
jmp    1158 <ft_putendl_fd+0x38>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <ft_putstr_fd@plt>
mov    -0xc(%rbp),%esi
mov    $0xa,%edi
call   1040 <ft_putchar_fd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl_fd>:
test   %rdi,%rdi
je     113a <ft_putendl_fd+0x1a>
push   %rbx
mov    %esi,%ebx
call   1030 <ft_putstr_fd@plt>
mov    $0xa,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <ft_putchar_fd@plt>
ret

LLVM IR (-O0):
define void @ft_putendl_fd(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %2
br label %14
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = call i32 @ft_putstr_fd(i8* %9, i32 %10)
%12 = load i32, i32* %4
%13 = call i32 @ft_putchar_fd(i8 signext 10, i32 %12)
br label %14
14: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @ft_putendl_fd(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @ft_putstr_fd(i8* %0, i32 %1)
%6 = tail call i32 @ft_putchar_fd(i8 signext 10, i32 %1)
br label %7
7: ; preds = %2, %4
ret void
}
double Sleef_expm1_u10(double x) { return __builtin_expm1(x); }


x86 assembly (clang, -O0):
<Sleef_expm1_u10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <expm1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleef_expm1_u10>:
jmp    1030 <expm1@plt>

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

LLVM IR (-O2):
define double @Sleef_expm1_u10(double %0) {
%2 = tail call double @expm1(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_target(int target[2]) {
  printf("\nlinha: %d\n", target[0]);
  printf("\ncoluna: %d\n", target[1]);
}


x86 assembly (clang, -O0):
<print_target>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_target>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rbx),%esi
lea    0xee0(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"\0Alinha: %d\0A\00"
@.str.1 = [13 x i8] c"\0Acoluna: %d\0A\00"
define void @print_target(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"\0Alinha: %d\0A\00"
@.str.1 = [13 x i8] c"\0Acoluna: %d\0A\00"
define void @print_target(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
int combine_word(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  int x = 0x89ABCDEF;
  int y = 0x76543210;
  int z = combine_word(x, y);
  printf("x=0x%X, y=0x%X, combine_word=0x%X\n", x, y, z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x89abcdef,-0x8(%rbp)
movl   $0x76543210,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <combine_word@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [35 x i8] c"x=0x%X, y=0x%X, combine_word=0x%X\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 -1985229329, i32* %2
store i32 1985229328, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @combine_word(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"x=0x%X, y=0x%X, combine_word=0x%X\0A\00"
define i32 @main() {
%1 = tail call i32 @combine_word(i32 -1985229329, i32 1985229328)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 -1985229329, i32 1985229328, i32 %1)
ret i32 0
}
/* Variables and functions */
char tolower(char);
void lowercaseheader(char *s) {
  int i = 0;
  for (; s[i] != ':'; i++)
    s[i] = tolower(s[i]);
}


x86 assembly (clang, -O0):
<lowercaseheader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
je     1164 <lowercaseheader+0x54>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <lowercaseheader+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowercaseheader>:
push   %rbx
mov    (%rdi),%al
cmp    $0x3a,%al
je     1136 <lowercaseheader+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
cmp    $0x3a,%al
jne    1120 <lowercaseheader+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @lowercaseheader(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 58
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %11, %4 ], [ %2, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = tail call signext i8 @tolower(i8 signext %6)
store i8 %8, i8* %7
%9 = add nuw i64 %5, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 58
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}