xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __NR_fstat;
int syscall(int /*<<< orphan*/, int, struct stat *);
__attribute__((always_)) int _syscall_fstat(int fd, struct stat *buf) {
  return syscall(__NR_fstat, fd, buf);
}


x86 assembly (clang, -O0):
<_syscall_fstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_syscall_fstat>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@__NR_fstat = global i32 0
define i32 @_syscall_fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* @__NR_fstat
%6 = load i32, i32* %3
%7 = load %struct.stat*, %struct.stat** %4
%8 = call i32 @syscall(i32 %5, i32 %6, %struct.stat* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@__NR_fstat = global i32 0
define i32 @_syscall_fstat(i32 %0, %struct.stat* %1) {
%3 = load i32, i32* @__NR_fstat
%4 = tail call i32 @syscall(i32 %3, i32 %0, %struct.stat* %1)
ret i32 %4
}
void dd_pbl_ios_fb_invite_friends(const char *message) {}


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

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

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

LLVM IR (-O2):
define void @dd_pbl_ios_fb_invite_friends(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int print(int, char *);
int cls(int tty) { return print(tty, "\033[2J\033[1;1H"); }


x86 assembly (clang, -O0):
<cls>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cls>:
lea    0xee9(%rip),%rsi
jmp    1030 <print@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\1B[2J\1B[1;1H\00"
define i32 @cls(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @print(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [11 x i8] c"\1B[2J\1B[1;1H\00"
define i32 @cls(i32 %0) {
%2 = tail call i32 @print(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
int main(void) {
  const int SZ = 5;
  int a[SZ];
  for (int i = 0; i < SZ; i++)
    a[i] = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    1144 <main+0x44>
movslq -0x14(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1120 <main+0x20>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void input_shutdown() {}


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

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

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

LLVM IR (-O2):
define void @input_shutdown() {
ret void
}
void test43_BlinkEnvLed_pollen__reset__E() {}


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

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

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

LLVM IR (-O2):
define void @test43_BlinkEnvLed_pollen__reset__E() {
ret void
}
int judge(int num) {
  int i;
  for (i = 2; i < num; i++) {
    if (num % i == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<judge>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <judge+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <judge+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1150 <judge+0x50>
jmp    113b <judge+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <judge+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<judge>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <judge+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <judge+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <judge+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @judge(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
/* Type definitions */
struct walnut_cmd_arg {
  int dummy;
};

/* Variables and functions */
int parse_help(int, char **, struct walnut_cmd_arg *);
int parse_none(int argc, char **argv, struct walnut_cmd_arg *cmd) {
  return parse_help(argc, argv, cmd);
}


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

x86 assembly (clang, -O2):
<parse_none>:
jmp    1030 <parse_help@plt>

LLVM IR (-O0):
%struct.walnut_cmd_arg = type { i32 }
define i32 @parse_none(i32 %0, i8** %1, %struct.walnut_cmd_arg* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.walnut_cmd_arg*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.walnut_cmd_arg* %2, %struct.walnut_cmd_arg** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load %struct.walnut_cmd_arg*, %struct.walnut_cmd_arg** %6
%10 = call i32 @parse_help(i32 %7, i8** %8, %struct.walnut_cmd_arg* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.walnut_cmd_arg = type { i32 }
define i32 @parse_none(i32 %0, i8** %1, %struct.walnut_cmd_arg* %2) {
%4 = tail call i32 @parse_help(i32 %0, i8** %1, %struct.walnut_cmd_arg* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x16() {
  Assert_real((isdigit(22) == 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_isdigit.c",
              115, ("isdigit should be 0 for 0x16"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x16>:
push   %rax
mov    $0x16,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x73,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x16\00"
define void @t_isdigit_0x16() {
%1 = call i64 @isdigit(i32 22)
%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 115, i8* getelementptr inbounds ([29 x i8], [29 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x16\00"
define void @t_isdigit_0x16() {
%1 = tail call i64 @isdigit(i32 22)
%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 115, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int track_y(int ch, int i) {}


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

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

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

LLVM IR (-O2):
define i32 @track_y(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
size_t Fibonacci(unsigned char x) {
  if (x < 2) {
    return 1;
  } else {
    return Fibonacci(x - 1) + Fibonacci(x - 2);
  }
}


x86 assembly (clang, -O0):
<Fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0x2,%eax
jge    1138 <Fibonacci+0x28>
movq   $0x1,-0x8(%rbp)
jmp    1168 <Fibonacci+0x58>
movzbl -0x9(%rbp),%eax
sub    $0x1,%eax
movzbl %al,%edi
call   1030 <Fibonacci@plt>
mov    %rax,-0x18(%rbp)
movzbl -0x9(%rbp),%eax
sub    $0x2,%eax
movzbl %al,%edi
call   1030 <Fibonacci@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fibonacci>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x1,%r14d
cmp    $0x2,%bl
jb     114a <Fibonacci+0x3a>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x1(%rbx),%eax
movzbl %al,%edi
call   1030 <Fibonacci@plt>
add    $0xfe,%bl
add    %rax,%r14
cmp    $0x1,%bl
ja     1130 <Fibonacci+0x20>
add    $0x1,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @Fibonacci(i8 zeroext %0) {
%2 = icmp ult i8 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i8 [ %8, %3 ], [ %0, %1 ]
%5 = phi i64 [ %9, %3 ], [ 0, %1 ]
%6 = add i8 %4, -1
%7 = tail call i64 @Fibonacci(i8 zeroext %6)
%8 = add i8 %4, -2
%9 = add i64 %7, %5
%10 = icmp ult i8 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i64 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i64 [ 1, %1 ], [ %12, %11 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x, y = 0;
  x = 1 / y;
  printf("result=%d\n", x);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"result=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 poison)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cprintf(char *, long);
void hexbzs(char n) {
  cprintf((8) <= 8 ? "%02lx" : (8) <= 16 ? "%04lx" : "%08lx", ((long)n));
}


x86 assembly (clang, -O0):
<hexbzs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbq -0x1(%rbp),%rsi
lea    0xed6(%rip),%rdi
call   1030 <cprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexbzs>:
movslq %edi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <cprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%02lx\00"
define void @hexbzs(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i64
%5 = call i32 @cprintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %4)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%02lx\00"
define void @hexbzs(i8 signext %0) {
%2 = sext i8 %0 to i64
%3 = tail call i32 @cprintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stStopAlarm();
void port_timer_stop_alarm(void) { stStopAlarm(); }


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

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

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

LLVM IR (-O2):
define void @port_timer_stop_alarm() {
%1 = tail call i32 (...) @stStopAlarm()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x8b() {
  Assert_real((isspace(139) == 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",
              700, ("isspace should be 0 for 0x8b"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x8b>:
push   %rax
mov    $0x8b,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2bc,%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 = [29 x i8] c"isspace should be 0 for 0x8b\00"
define void @t_isspace_0x8b() {
%1 = call i64 @isspace(i32 139)
%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 700, i8* getelementptr inbounds ([29 x i8], [29 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 = [29 x i8] c"isspace should be 0 for 0x8b\00"
define void @t_isspace_0x8b() {
%1 = tail call i64 @isspace(i32 139)
%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 700, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _test_wfi();
__attribute__((always_)) void __WFI(void) { _test_wfi(); }


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

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

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

LLVM IR (-O2):
define void @__WFI() {
%1 = tail call i32 (...) @_test_wfi()
ret void
}
any2() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @any2() {
ret i32 0
}
void null_drop(struct codec *c) {}


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

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

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

LLVM IR (-O2):
%struct.codec = type opaque
define void @null_drop(%struct.codec* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ make_client(int, int, int);
int main(int argc, char *argv[]) {
  int outstanding = 10;
  int value_size = 32;
  int id = 1;
  make_client(id, outstanding, value_size);
  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   $0xa,-0x14(%rbp)
movl   $0x20,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <make_client@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
store i32 32, i32* %7
store i32 1, i32* %8
%9 = load i32, i32* %8
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = call i32 @make_client(i32 %9, i32 %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @make_client(i32 1, i32 10, i32 32)
ret i32 0
}
/* Variables and functions */
int nRF24L01P_getRegister(int);
int /*<<< orphan*/ printf(char *, int);
int nRF24L01P_getRfOutputPower(void) {
  int rfPwr;
  rfPwr = nRF24L01P_getRegister(0x06) & (0x3 << 1);
  switch (rfPwr) {
  case (0x3 << 1):
    return 0;
  case (0x2 << 1):
    return -6;
  case (0x1 << 1):
    return -12;
  case (0x0 << 1):
    return -18;
  default:
    printf("nRF24L01P: Unknown RF Output Power value %d\r\n", rfPwr);
    return 0;
  }
}


x86 assembly (clang, -O0):
<nRF24L01P_getRfOutputPower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x6,%edi
call   1040 <nRF24L01P_getRegister@plt>
and    $0x6,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x6,%rax
ja     118d <nRF24L01P_getRfOutputPower+0x6d>
mov    -0x10(%rbp),%rax
lea    0xeac(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    11a3 <nRF24L01P_getRfOutputPower+0x83>
movl   $0xfffffffa,-0x4(%rbp)
jmp    11a3 <nRF24L01P_getRfOutputPower+0x83>
movl   $0xfffffff4,-0x4(%rbp)
jmp    11a3 <nRF24L01P_getRfOutputPower+0x83>
movl   $0xffffffee,-0x4(%rbp)
jmp    11a3 <nRF24L01P_getRfOutputPower+0x83>
mov    -0x8(%rbp),%esi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nRF24L01P_getRfOutputPower>:
push   %rax
mov    $0x6,%edi
call   1030 <nRF24L01P_getRegister@plt>
and    $0x6,%eax
lea    0xedb(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"nRF24L01P: Unknown RF Output Power value %d\0D\0A\00"
define i32 @nRF24L01P_getRfOutputPower() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @nRF24L01P_getRegister(i32 6)
%4 = and i32 %3, 6
store i32 %4, i32* %2
%5 = load i32, i32* %2
switch i32 %5, label %10 [
i32 6, label %6
i32 4, label %7
i32 2, label %8
i32 0, label %9
]
6: ; preds = %0
store i32 0, i32* %1
br label %13
7: ; preds = %0
store i32 -6, i32* %1
br label %13
8: ; preds = %0
store i32 -12, i32* %1
br label %13
9: ; preds = %0
store i32 -18, i32* %1
br label %13
10: ; preds = %0
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %11)
store i32 0, i32* %1
br label %13
13: ; preds = %10, %9, %8, %7, %6
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@switch.table.nRF24L01P_getRfOutputPower = [7 x i32] [i32 -18, i32 0, i32 -12, i32 0, i32 -6, i32 0, i32 0]
define i32 @nRF24L01P_getRfOutputPower() {
%1 = tail call i32 @nRF24L01P_getRegister(i32 6)
%2 = and i32 %1, 6
%3 = zext i32 %2 to i64
%4 = getelementptr inbounds [7 x i32], [7 x i32]* @switch.table.nRF24L01P_getRfOutputPower, i64 0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
void foo_1_1_1_1_2_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_1_2_2_2_1_1() {
ret void
}
void gtk_tree_path_copy() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_path_copy() {
ret void
}
/* Variables and functions */
int _pb_print_bits(unsigned long long *, int);
int _pb_print_bits_ull(unsigned long long value) {
  return _pb_print_bits(&value, sizeof(unsigned long long));
}


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

x86 assembly (clang, -O2):
<_pb_print_bits_ull>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <_pb_print_bits@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_pb_print_bits_ull(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @_pb_print_bits(i64* %2, i32 8)
ret i32 %3
}

LLVM IR (-O2):
define i32 @_pb_print_bits_ull(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @_pb_print_bits(i64* %2, i32 8)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void agbnp3_vfree(void *x) {
  if (x)
    free(x);
}


x86 assembly (clang, -O0):
<agbnp3_vfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <agbnp3_vfree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<agbnp3_vfree>:
test   %rdi,%rdi
je     111a <agbnp3_vfree+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @agbnp3_vfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @agbnp3_vfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int memcg_alloc_cache_params(struct mem_cgroup *memcg, struct kmem_cache *s,
                             struct kmem_cache *root_cache) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.mem_cgroup = type opaque
%struct.kmem_cache = type opaque
define i32 @memcg_alloc_cache_params(%struct.mem_cgroup* %0, %struct.kmem_cache* %1, %struct.kmem_cache* %2) {
%4 = alloca %struct.mem_cgroup*
%5 = alloca %struct.kmem_cache*
%6 = alloca %struct.kmem_cache*
store %struct.mem_cgroup* %0, %struct.mem_cgroup** %4
store %struct.kmem_cache* %1, %struct.kmem_cache** %5
store %struct.kmem_cache* %2, %struct.kmem_cache** %6
ret i32 0
}

LLVM IR (-O2):
%struct.mem_cgroup = type opaque
%struct.kmem_cache = type opaque
define i32 @memcg_alloc_cache_params(%struct.mem_cgroup* nocapture readnone %0, %struct.kmem_cache* nocapture readnone %1, %struct.kmem_cache* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int __builtin_arc_fls(int);
int bar(void) { return __builtin_arc_fls(0x10); }


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

x86 assembly (clang, -O2):
<bar>:
mov    $0x10,%edi
jmp    1030 <__builtin_arc_fls@plt>

LLVM IR (-O0):
define i32 @bar() {
%1 = call i32 @__builtin_arc_fls(i32 16)
ret i32 %1
}

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32 @__builtin_arc_fls(i32 16)
ret i32 %1
}
int isdigit(int character) {
  return ((character >= '0') && (character <= '9'));
}


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int f380(int *);
int f381(int *p) { return f380(p); }


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

x86 assembly (clang, -O2):
<f381>:
jmp    1030 <f380@plt>

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

LLVM IR (-O2):
define i32 @f381(i32* %0) {
%2 = tail call i32 @f380(i32* %0)
ret i32 %2
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ free(char *);
int atoi2(char *buffer) {
  int num = atoi(buffer);
  free(buffer);
  return num;
}


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

x86 assembly (clang, -O2):
<atoi2>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @atoi2(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @atoi(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @atoi2(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = tail call i32 @free(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
void main() {
  printf("Content-type:text/html\n\n");
  puts("Linkerist<br><br>");
  putchar('AA');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <printf@plt>
lea    0xed2(%rip),%rdi
call   1040 <puts@plt>
mov    $0x41,%edi
call   1030 <putchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeea(%rip),%rdi
call   1040 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <puts@plt>
mov    $0x41,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Content-type:text/html\0A\0A\00"
@.str.1 = [18 x i8] c"Linkerist<br><br>\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @putchar(i8 signext 65)
ret void
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"Linkerist<br><br>\00"
@str = [24 x i8] c"Content-type:text/html\0A\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @putchar(i8 signext 65)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ zsrand(unsigned int);
void rand_reset(unsigned s) { zsrand(s); }


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

x86 assembly (clang, -O2):
<rand_reset>:
jmp    1030 <zsrand@plt>

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

LLVM IR (-O2):
define void @rand_reset(i32 %0) {
%2 = tail call i32 @zsrand(i32 %0)
ret void
}
int test_imm_EDint16_mem(short *val) {
  return ((*val) & (-0xED << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EDint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffff13,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_EDint16_mem>:
movzwl (%rdi),%eax
test   $0xff13,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_EDint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -237
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_EDint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -237
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ IntEnable(int);
int /*<<< orphan*/ IntRegister(int, void (*)());
void EMACIntRegister(uint32_t ui32Base, void (*pfnHandler)(void)) {
  ;
  IntRegister(56, pfnHandler);
  IntEnable(56);
}


x86 assembly (clang, -O0):
<EMACIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x38,%edi
call   1040 <IntRegister@plt>
mov    $0x38,%edi
call   1030 <IntEnable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACIntRegister>:
push   %rax
mov    $0x38,%edi
call   1040 <IntRegister@plt>
mov    $0x38,%edi
pop    %rax
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @EMACIntRegister(i32 %0, void ()* %1) {
%3 = alloca i32
%4 = alloca void ()*
store i32 %0, i32* %3
store void ()* %1, void ()** %4
%5 = load void ()*, void ()** %4
%6 = bitcast void ()* %5 to void (...)*
%7 = call i32 @IntRegister(i32 56, void (...)* %6)
%8 = call i32 @IntEnable(i32 56)
ret void
}

LLVM IR (-O2):
define void @EMACIntRegister(i32 %0, void ()* %1) {
%3 = bitcast void ()* %1 to void (...)*
%4 = tail call i32 @IntRegister(i32 56, void (...)* %3)
%5 = tail call i32 @IntEnable(i32 56)
ret void
}
/* Type definitions */
struct record {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ cdf_print(int /*<<< orphan*/ *, struct record *);
struct record **record_find(int);
void cdf_write(FILE *f, int pid, int type) {
  struct record **r = record_find(pid);
  cdf_print(f, r[type]);
}


x86 assembly (clang, -O0):
<cdf_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <record_find@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <cdf_print@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdf_write>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1040 <record_find@plt>
movslq %ebx,%rcx
mov    (%rax,%rcx,8),%rsi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <cdf_print@plt>

LLVM IR (-O0):
%struct.record = type { i32 }
define void @cdf_write(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.record**
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = call %struct.record** @record_find(i32 %8)
store %struct.record** %9, %struct.record*** %7
%10 = load i32*, i32** %4
%11 = load %struct.record**, %struct.record*** %7
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds %struct.record*, %struct.record** %11, i64 %13
%15 = load %struct.record*, %struct.record** %14
%16 = call i32 @cdf_print(i32* %10, %struct.record* %15)
ret void
}

LLVM IR (-O2):
%struct.record = type { i32 }
define void @cdf_write(i32* %0, i32 %1, i32 %2) {
%4 = tail call %struct.record** @record_find(i32 %1)
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds %struct.record*, %struct.record** %4, i64 %5
%7 = load %struct.record*, %struct.record** %6
%8 = tail call i32 @cdf_print(i32* %0, %struct.record* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void test_failure(const char *name, const bool fatal) {
  fprintf(stderr, "\t- %s FAILED.\n", name);
  if (fatal)
    exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<test_failure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
cmpl   $0x0,-0xc(%rbp)
je     1160 <test_failure+0x40>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_failure>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
test   %ebx,%ebx
jne    1141 <test_failure+0x21>
pop    %rbx
ret
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"\09- %s FAILED.\0A\00"
@EXIT_FAILURE = global i32 0
define void @test_failure(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"\09- %s FAILED.\0A\00"
@EXIT_FAILURE = global i32 0
define void @test_failure(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = icmp eq i32 %1, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Usage(void) {
  fprintf(stderr,
          "Usage: 'eitsecmapper onid tsid sid to onid2 tsid2 sid2 and [...]\n");
}


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

x86 assembly (clang, -O2):
<Usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [66 x i8] c"Usage: 'eitsecmapper onid tsid sid to onid2 tsid2 sid2 and [...]\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [66 x i8] c"Usage: 'eitsecmapper onid tsid sid to onid2 tsid2 sid2 and [...]\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
ret void
}
rfilop(s, t) char *s, t;
{
  if (*s == 000) {
    printf("?File specification required\n");
    return (-2);
  }
  {};
  return (setgen(t, s, "", ""));
}


x86 assembly (clang, -O0):
<rfilop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    115c <rfilop+0x3c>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1178 <rfilop+0x58>
movsbl -0x11(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xeb2(%rip),%rcx
mov    %rcx,%rdx
mov    $0x0,%al
call   1030 <setgen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfilop>:
push   %rax
cmpb   $0x0,(%rdi)
je     1143 <rfilop+0x23>
mov    %rdi,%rax
movsbl %sil,%edi
lea    0xee8(%rip),%rcx
mov    %rax,%rsi
mov    %rcx,%rdx
xor    %eax,%eax
pop    %r8
jmp    1040 <setgen@plt>
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
mov    $0xfffffffe,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"?File specification required\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @rfilop(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8
%6 = trunc i32 %1 to i8
store i8* %0, i8** %4
store i8 %6, i8* %5
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store i32 -2, i32* %3
br label %18
13: ; preds = %2
%14 = load i8, i8* %5
%15 = sext i8 %14 to i32
%16 = load i8*, i8** %4
%17 = call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @setgen to i32 (i32, i8*, i8*, i8*, ...)*)(i32 %15, i8* %16, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
store i32 %17, i32* %3
br label %18
18: ; preds = %13, %11
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str.1 = [1 x i8] zeroinitializer
@str = [29 x i8] c"?File specification required\00"
define i32 @rfilop(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
br label %11
7: ; preds = %2
%8 = shl i32 %1, 24
%9 = ashr exact i32 %8, 24
%10 = tail call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @setgen to i32 (i32, i8*, i8*, i8*, ...)*)(i32 %9, i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %7, %5
%12 = phi i32 [ -2, %5 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
int PUTS(const char *s) {
  int r = 0;
  while (*s) {
    putchar(*s++);
    r++;
  }
  return r;
}


x86 assembly (clang, -O0):
<PUTS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1155 <PUTS+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <PUTS+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PUTS>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1138 <PUTS+0x28>
mov    %rdi,%r14
xor    %ebx,%ebx
nop
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl 0x1(%r14,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <PUTS+0x10>
jmp    113a <PUTS+0x2a>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @PUTS(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %5 to i32
%10 = tail call i32 @putchar(i32 %9)
%11 = add nuw nsw i32 %6, 1
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
int hash(const char *s) {
  int hashval = 0;
  while (*s) {
    hashval += *s++;
    hashval *= 81;
    hashval &= (256 - 1);
  }
  return hashval;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <hash+0x4b>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
imul   $0x51,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112a <hash+0x2a>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
add    %eax,%ecx
lea    (%rcx,%rcx,8),%eax
lea    (%rax,%rax,8),%eax
movzbl %al,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = zext i8 %5 to i32
%10 = add nuw nsw i32 %6, %9
%11 = mul nuw nsw i32 %10, 81
%12 = and i32 %11, 255
%13 = load i8, i8* %8
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %12, %4 ]
ret i32 %16
}