xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void doWhileLoop(int n) {
  int flag = 0;
  do {
    printf("%d\n", (n));
    n++;
    if (n >= 10)
      break;
  } while (!flag);
}


x86 assembly (clang, -O0):
<doWhileLoop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     1149 <doWhileLoop+0x39>
jmp    115f <doWhileLoop+0x4f>
jmp    114e <doWhileLoop+0x3e>
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1122 <doWhileLoop+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doWhileLoop>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%edi
mov    $0x9,%ebp
cmovge %edi,%ebp
add    $0x1,%ebp
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1130 <doWhileLoop+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @doWhileLoop(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 10
br i1 %10, label %11, label %12
11: ; preds = %4
br label %17
12: ; preds = %4
br label %13
13: ; preds = %12
%14 = load i32, i32* %3
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
br i1 %16, label %4, label %17
17: ; preds = %13, %11
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @doWhileLoop(i32 %0) {
%2 = call i32 @llvm.smax.i32(i32 %0, i32 9)
br label %3
3: ; preds = %3, %1
%4 = phi i32 [ %0, %1 ], [ %6, %3 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add i32 %4, 1
%7 = icmp eq i32 %4, %2
br i1 %7, label %8, label %3
8: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x13() {
  Assert_real((isdigit(19) == 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",
              100, ("isdigit should be 0 for 0x13"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x13>:
push   %rax
mov    $0x13,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x64,%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 0x13\00"
define void @t_isdigit_0x13() {
%1 = call i64 @isdigit(i32 19)
%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 100, 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 0x13\00"
define void @t_isdigit_0x13() {
%1 = tail call i64 @isdigit(i32 19)
%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 100, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xfd() {
  Assert_real((isprint(253) == 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_isprint.c",
              1270, ("isprint should be 0 for 0xfd"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0xfd>:
push   %rax
mov    $0xfd,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4f6,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xfd\00"
define void @t_isprint_0xfd() {
%1 = call i64 @isprint(i32 253)
%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 1270, 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xfd\00"
define void @t_isprint_0xfd() {
%1 = tail call i64 @isprint(i32 253)
%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 1270, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OCTEON_IS_OCTEON3();
int octeon_has_feature_OCTEON_FEATURE_TRA(void) { return !OCTEON_IS_OCTEON3(); }


x86 assembly (clang, -O0):
<octeon_has_feature_OCTEON_FEATURE_TRA>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <OCTEON_IS_OCTEON3@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<octeon_has_feature_OCTEON_FEATURE_TRA>:
push   %rax
xor    %eax,%eax
call   1030 <OCTEON_IS_OCTEON3@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @octeon_has_feature_OCTEON_FEATURE_TRA() {
%1 = call i32 (...) @OCTEON_IS_OCTEON3()
%2 = icmp ne i32 %1, 0
%3 = xor i1 %2, true
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @octeon_has_feature_OCTEON_FEATURE_TRA() {
%1 = tail call i32 (...) @OCTEON_IS_OCTEON3()
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int libB_func_impl(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @libB_func_impl() {
ret i32 0
}
void mbc2_ram_en(int val) {}


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

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

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

LLVM IR (-O2):
define void @mbc2_ram_en(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_putc(char);
void serial_puts(char *s) {
  while (*s) {
    if (*s == '\n')
      serial_putc('\r');
    serial_putc(*s++);
  }
}


x86 assembly (clang, -O0):
<serial_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115f <serial_puts+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1143 <serial_puts+0x33>
mov    $0xd,%edi
call   1030 <serial_putc@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <serial_putc@plt>
jmp    111c <serial_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_puts>:
push   %rbx
mov    %rdi,%rbx
jmp    1139 <serial_puts+0x29>
cs nopw 0x0(%rax,%rax,1)
mov    $0xd,%edi
call   1030 <serial_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
movsbl %al,%edi
call   1030 <serial_putc@plt>
movzbl (%rbx),%eax
cmp    $0xa,%al
je     1120 <serial_puts+0x10>
test   %al,%al
jne    112d <serial_puts+0x1d>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @serial_puts(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = load i8, i8* %3
switch i8 %4, label %8 [
i8 0, label %12
i8 10, label %5
]
5: ; preds = %2
%6 = tail call i32 @serial_putc(i8 signext 13)
%7 = load i8, i8* %3
br label %8
8: ; preds = %2, %5
%9 = phi i8 [ %4, %2 ], [ %7, %5 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
%11 = tail call i32 @serial_putc(i8 signext %9)
br label %2
12: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *alloc(size_t size) {
  void *p = malloc(size);
  if (p == NULL) {
    fprintf(stderr, "Out of memory.\n");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <alloc+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <alloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"Out of memory.\0A\00"
define i8* @alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Out of memory.\0A\00"
define noalias i8* @alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
char tohex(char c) { return c >= 10 ? c - 10 + 'a' : c + '0'; }


x86 assembly (clang, -O0):
<tohex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jl     1129 <tohex+0x29>
movsbl -0x1(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <tohex+0x33>
movsbl -0x1(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tohex>:
cmp    $0xa,%dil
mov    $0x57,%ecx
mov    $0x30,%eax
cmovge %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @tohex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 10
%10 = add nsw i32 %9, 97
br label %15
11: ; preds = %1
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, 48
br label %15
15: ; preds = %11, %6
%16 = phi i32 [ %10, %6 ], [ %14, %11 ]
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @tohex(i8 signext %0) {
%2 = icmp sgt i8 %0, 9
%3 = select i1 %2, i8 87, i8 48
%4 = add i8 %3, %0
ret i8 %4
}
/* Variables and functions */
int jimi_getch_term(int);
int jimi_getche(void) { return jimi_getch_term(1); }


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

x86 assembly (clang, -O2):
<jimi_getche>:
mov    $0x1,%edi
jmp    1030 <jimi_getch_term@plt>

LLVM IR (-O0):
define i32 @jimi_getche() {
%1 = call i32 @jimi_getch_term(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @jimi_getche() {
%1 = tail call i32 @jimi_getch_term(i32 1)
ret i32 %1
}
/* Variables and functions */
int dev2major(int);
int dev2minor(int);
int dev_open(char *, int);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
int open_dev_flags(int devnum, int flags) {
  char buf[20];
  sprintf(buf, "%d:%d", dev2major(devnum), dev2minor(devnum));
  return dev_open(buf, flags);
}


x86 assembly (clang, -O0):
<open_dev_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <dev2major@plt>
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <dev2minor@plt>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    %eax,%ecx
lea    0xe87(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1060 <dev_open@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_dev_flags>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %esi,%r14d
mov    %edi,%ebp
call   1050 <dev2major@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1030 <dev2minor@plt>
lea    0xe9e(%rip),%rsi
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    %ebx,%edx
mov    %eax,%ecx
call   1040 <sprintf@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
call   1060 <dev_open@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d:%d\00"
define i32 @open_dev_flags(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [20 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @dev2major(i32 %7)
%9 = load i32, i32* %3
%10 = call i32 @dev2minor(i32 %9)
%11 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10)
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%13 = load i32, i32* %4
%14 = call i32 @dev_open(i8* %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d:%d\00"
define i32 @open_dev_flags(i32 %0, i32 %1) {
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @dev2major(i32 %0)
%6 = tail call i32 @dev2minor(i32 %0)
%7 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = call i32 @dev_open(i8* %4, i32 %1)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Print CRC32 checksums\n");
  printf("usage: crc32sum <FILE>...\n\n");
  printf("  --help     display this help and exit\n");
  printf("  --version  output version information and exit\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
lea    0xf01(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Print CRC32 checksums\0A\00"
@.str.1 = [28 x i8] c"usage: crc32sum <FILE>...\0A\0A\00"
@.str.2 = [41 x i8] c" --help display this help and exit\0A\00"
@.str.3 = [50 x i8] c" --version output version information and exit\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"Print CRC32 checksums\00"
@str.4 = [27 x i8] c"usage: crc32sum <FILE>...\0A\00"
@str.5 = [40 x i8] c" --help display this help and exit\00"
@str.6 = [49 x i8] c" --version output version information and exit\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("DDD\nD  D\nD   D\nD    D\nD   D\nD  D\nDDD\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"DDD\0AD D\0AD D\0AD D\0AD D\0AD D\0ADDD\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [37 x i8] c"DDD\0AD D\0AD D\0AD D\0AD D\0AD D\0ADDD\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct dictionary {
  int dummy;
};
struct const_var_set {
  int dummy;
};

/* Variables and functions */
scalar_t__ var_set_create_from_dict(struct dictionary const *);
struct const_var_set *
const_var_set_create_from_dict(const struct dictionary *d) {
  return (struct const_var_set *)var_set_create_from_dict(d);
}


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

x86 assembly (clang, -O2):
<const_var_set_create_from_dict>:
jmp    1030 <var_set_create_from_dict@plt>

LLVM IR (-O0):
%struct.const_var_set = type { i32 }
%struct.dictionary = type { i32 }
define %struct.const_var_set* @const_var_set_create_from_dict(%struct.dictionary* %0) {
%2 = alloca %struct.dictionary*
store %struct.dictionary* %0, %struct.dictionary** %2
%3 = load %struct.dictionary*, %struct.dictionary** %2
%4 = call i64 @var_set_create_from_dict(%struct.dictionary* %3)
%5 = inttoptr i64 %4 to %struct.const_var_set*
ret %struct.const_var_set* %5
}

LLVM IR (-O2):
%struct.const_var_set = type { i32 }
%struct.dictionary = type { i32 }
define %struct.const_var_set* @const_var_set_create_from_dict(%struct.dictionary* %0) {
%2 = tail call i64 @var_set_create_from_dict(%struct.dictionary* %0)
%3 = inttoptr i64 %2 to %struct.const_var_set*
ret %struct.const_var_set* %3
}
long long int factorial(long long int n) {
  if (n == 0) {
    return 1;
  } else if (n == 1) {
    return 1;
  } else {
    return ((n % 1000000007) * (factorial(n - 1) % 1000000007)) % 1000000007;
  }
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <factorial+0x24>
movq   $0x1,-0x8(%rbp)
jmp    118b <factorial+0x7b>
cmpq   $0x1,-0x10(%rbp)
jne    114c <factorial+0x3c>
movq   $0x1,-0x8(%rbp)
jmp    118b <factorial+0x7b>
mov    -0x10(%rbp),%rax
mov    $0x3b9aca07,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <factorial@plt>
mov    $0x3b9aca07,%ecx
cqto
idiv   %rcx
mov    -0x18(%rbp),%rax
imul   %rdx,%rax
mov    $0x3b9aca07,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
mov    $0x1,%ecx
cmp    $0x1,%rdi
jbe    11a7 <factorial+0x97>
push   %r14
push   %rbx
push   %rax
movabs $0x89705f3112a28fe5,%r14
5f 70 89
mov    %rdi,%rax
imul   %r14
add    %rdi,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x1d,%rdx
add    %rax,%rdx
imul   $0x3b9aca07,%rdx,%rax
mov    %rdi,%rbx
sub    %rax,%rbx
add    $0xffffffffffffffff,%rdi
call   1030 <factorial@plt>
mov    %rax,%rcx
imul   %r14
add    %rcx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x1d,%rdx
add    %rax,%rdx
imul   $0x3b9aca07,%rdx,%rax
sub    %rax,%rcx
imul   %rbx,%rcx
mov    %rcx,%rax
imul   %r14
add    %rcx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x1d,%rdx
add    %rax,%rdx
imul   $0x3b9aca07,%rdx,%rax
sub    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @factorial(i64 %0) {
%2 = icmp ult i64 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i64 [ %11, %5 ], [ 1, %1 ]
ret i64 %4
5: ; preds = %1
%6 = srem i64 %0, 1000000007
%7 = add nsw i64 %0, -1
%8 = tail call i64 @factorial(i64 %7)
%9 = srem i64 %8, 1000000007
%10 = mul nsw i64 %9, %6
%11 = srem i64 %10, 1000000007
br label %3
}
int test_imm_47uint16_mem(unsigned short *val) {
  return ((*val) & (-0x47 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_47uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -71
%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_47uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -71
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int pigpio_command(int, int, int /*<<< orphan*/, int /*<<< orphan*/, int);
int wave_create(int pi) { return pigpio_command(pi, 49, 0, 0, 1); }


x86 assembly (clang, -O0):
<wave_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x31,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    %ecx,%edx
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wave_create>:
mov    $0x31,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

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

LLVM IR (-O2):
define i32 @wave_create(i32 %0) {
%2 = tail call i32 @pigpio_command(i32 %0, i32 49, i32 0, i32 0, i32 1)
ret i32 %2
}
void case_2(struct rbt *tree, struct node *node, struct node *sibling) {}


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

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

LLVM IR (-O0):
%struct.rbt = type opaque
%struct.node = type opaque
define void @case_2(%struct.rbt* %0, %struct.node* %1, %struct.node* %2) {
%4 = alloca %struct.rbt*
%5 = alloca %struct.node*
%6 = alloca %struct.node*
store %struct.rbt* %0, %struct.rbt** %4
store %struct.node* %1, %struct.node** %5
store %struct.node* %2, %struct.node** %6
ret void
}

LLVM IR (-O2):
%struct.rbt = type opaque
%struct.node = type opaque
define void @case_2(%struct.rbt* nocapture %0, %struct.node* nocapture %1, %struct.node* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_sleep(int);
int /*<<< orphan*/ write_log(int /*<<< orphan*/, char *);
void sock_close_all_sockets() {
  write_log(0, "Closing all remaining sockets...");
  my_sleep(30000);
}


x86 assembly (clang, -O0):
<sock_close_all_sockets>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xed3(%rip),%rsi
call   1030 <write_log@plt>
mov    $0x7530,%edi
call   1040 <my_sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_close_all_sockets>:
push   %rax
lea    0xed8(%rip),%rsi
xor    %edi,%edi
call   1030 <write_log@plt>
mov    $0x7530,%edi
pop    %rax
jmp    1040 <my_sleep@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Closing all remaining sockets...\00"
define void @sock_close_all_sockets() {
%1 = call i32 @write_log(i32 0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @my_sleep(i32 30000)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Closing all remaining sockets...\00"
define void @sock_close_all_sockets() {
%1 = tail call i32 @write_log(i32 0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @my_sleep(i32 30000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x11() {
  Assert_real((isdigit(17) == 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",
              90, ("isdigit should be 0 for 0x11"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x11>:
push   %rax
mov    $0x11,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x5a,%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 0x11\00"
define void @t_isdigit_0x11() {
%1 = call i64 @isdigit(i32 17)
%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 90, 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 0x11\00"
define void @t_isdigit_0x11() {
%1 = tail call i64 @isdigit(i32 17)
%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 90, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void vt100_cursor_save(void) {
  printf("\x1B[s");
  fflush(stdout);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"\1B[s\00"
@stdout = global i32 0
define void @vt100_cursor_save() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[s\00"
@stdout = global i32 0
define void @vt100_cursor_save() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_ext_device_restore_read_formats() {
  printf("NOT IMPLEMENTED:"
         "pa_ext_device_restore_read_formats"
         "\n");
}


x86 assembly (clang, -O0):
<pa_ext_device_restore_read_formats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [52 x i8] c"NOT IMPLEMENTED:pa_ext_device_restore_read_formats\0A\00"
define i32 @pa_ext_device_restore_read_formats() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [51 x i8] c"NOT IMPLEMENTED:pa_ext_device_restore_read_formats\00"
define i32 @pa_ext_device_restore_read_formats() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ define(char *, char *);
scalar_t__ strcmp(char *, char *);
bool handle_possible_define(char *words[]) {
  if (strcmp(words[0], "#define") == 0) {
    define(words[1], words[2]);
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<handle_possible_define>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xec6(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    116a <handle_possible_define+0x4a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <define@plt>
movl   $0x1,-0x4(%rbp)
jmp    1171 <handle_possible_define+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_possible_define>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
lea    0xed2(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     113f <handle_possible_define+0x1f>
pop    %rbx
ret
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rsi
call   1040 <define@plt>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"#define\00"
define i32 @handle_possible_define(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = getelementptr inbounds i8*, i8** %0, i64 1
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8*, i8** %0, i64 2
%9 = load i8*, i8** %8
%10 = tail call i32 @define(i8* %7, i8* %9)
br label %11
11: ; preds = %1, %5
%12 = phi i32 [ 1, %5 ], [ 0, %1 ]
ret i32 %12
}
int globus_list_int_less(void *low_datum, void *high_datum, void *ignored) {
  return (low_datum) < (high_datum);
}


x86 assembly (clang, -O0):
<globus_list_int_less>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<globus_list_int_less>:
xor    %eax,%eax
cmp    %rsi,%rdi
setb   %al
ret

LLVM IR (-O0):
define i32 @globus_list_int_less(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = icmp ult i8* %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @globus_list_int_less(i8* readnone %0, i8* readnone %1, i8* nocapture readnone %2) {
%4 = icmp ult i8* %0, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void Usage(void) {
  printf("\nUsage:\ttmond [-p port]\nThe default port number is 7777.\n\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [59 x i8] c"\0AUsage:\09tmond [-p port]\0AThe default port number is 7777.\0A\0A\00"
define void @Usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [58 x i8] c"\0AUsage:\09tmond [-p port]\0AThe default port number is 7777.\0A\00"
define void @Usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
unsigned char *blake2s_buffer(unsigned char *, unsigned char const *, size_t,
                              unsigned char const *, size_t);
unsigned char *hash_buffer_blake2s_key(unsigned char *out,
                                       const unsigned char *in, size_t in_len,
                                       const unsigned char *key,
                                       size_t key_len) {
  return blake2s_buffer(out, in, in_len, key, key_len);
}


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

x86 assembly (clang, -O2):
<hash_buffer_blake2s_key>:
jmp    1030 <blake2s_buffer@plt>

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

LLVM IR (-O2):
define i8* @hash_buffer_blake2s_key(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i8* @blake2s_buffer(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4)
ret i8* %6
}
int xfuse_devredir_cb_enum_dir(void *vp, struct xrdp_inode *xinode) {}


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

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

LLVM IR (-O0):
%struct.xrdp_inode = type opaque
define i32 @xfuse_devredir_cb_enum_dir(i8* %0, %struct.xrdp_inode* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.xrdp_inode*
store i8* %0, i8** %4
store %struct.xrdp_inode* %1, %struct.xrdp_inode** %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.xrdp_inode = type opaque
define i32 @xfuse_devredir_cb_enum_dir(i8* nocapture readnone %0, %struct.xrdp_inode* nocapture readnone %1) {
ret i32 undef
}
int(ars_d_set_ipopt_ssrr)(struct ars_packet *pkt, int layer, char *f, char *v) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.ars_packet = type opaque
define i32 @ars_d_set_ipopt_ssrr(%struct.ars_packet* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca %struct.ars_packet*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store %struct.ars_packet* %0, %struct.ars_packet** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret i32 0
}

LLVM IR (-O2):
%struct.ars_packet = type opaque
define i32 @ars_d_set_ipopt_ssrr(%struct.ars_packet* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i32 0
}
int Max3(int A, int B, int C) { return A > B ? A > C ? A : C : B > C ? B : C; }


x86 assembly (clang, -O0):
<Max3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1141 <Max3+0x41>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1130 <Max3+0x30>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <Max3+0x36>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1164 <Max3+0x64>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1158 <Max3+0x58>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    115e <Max3+0x5e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Max3>:
mov    %edx,%eax
cmp    %edx,%edi
cmovg  %edi,%eax
cmp    %esi,%eax
cmovle %esi,%eax
ret

LLVM IR (-O0):
define i32 @Max3(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* %5
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = icmp sgt i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load i32, i32* %4
br label %18
16: ; preds = %10
%17 = load i32, i32* %6
br label %18
18: ; preds = %16, %14
%19 = phi i32 [ %15, %14 ], [ %17, %16 ]
br label %30
20: ; preds = %3
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = icmp sgt i32 %21, %22
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = load i32, i32* %5
br label %28
26: ; preds = %20
%27 = load i32, i32* %6
br label %28
28: ; preds = %26, %24
%29 = phi i32 [ %25, %24 ], [ %27, %26 ]
br label %30
30: ; preds = %28, %18
%31 = phi i32 [ %19, %18 ], [ %29, %28 ]
ret i32 %31
}

LLVM IR (-O2):
define i32 @Max3(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %2
%5 = select i1 %4, i32 %0, i32 %2
%6 = icmp sgt i32 %5, %1
%7 = select i1 %6, i32 %5, i32 %1
ret i32 %7
}
int test_imm_C3int64_midword_reg(long long val) {
  return ((val >> 16) & (0xC3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C3int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0xc3,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C3int64_midword_reg>:
test   $0xc30000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C3int64_midword_reg(i64 %0) {
%2 = and i64 %0, 12779520
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int fun1(int, int);
int fun0(int a, int b) {
  if (a > b) {
    return fun1(a - 1, b + 1);
  } else {
    return b - a;
  }
}


x86 assembly (clang, -O0):
<fun0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1143 <fun0+0x33>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
call   1030 <fun1@plt>
mov    %eax,-0x4(%rbp)
jmp    114c <fun0+0x3c>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun0>:
mov    %esi,%eax
sub    %edi,%eax
jge    1121 <fun0+0x11>
add    $0xffffffff,%edi
add    $0x1,%esi
jmp    1030 <fun1@plt>
ret

LLVM IR (-O0):
define i32 @fun0(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* %4
%7 = load i32, i32* %5
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i32, i32* %4
%11 = sub nsw i32 %10, 1
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
%14 = call i32 @fun1(i32 %11, i32 %13)
store i32 %14, i32* %3
br label %19
15: ; preds = %2
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = sub nsw i32 %16, %17
store i32 %18, i32* %3
br label %19
19: ; preds = %15, %9
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @fun0(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = add nsw i32 %0, -1
%6 = add nsw i32 %1, 1
%7 = tail call i32 @fun1(i32 %5, i32 %6)
br label %10
8: ; preds = %2
%9 = sub nsw i32 %1, %0
br label %10
10: ; preds = %8, %4
%11 = phi i32 [ %7, %4 ], [ %9, %8 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fsync(int);
int /*<<< orphan*/ tran_file_write_track_deltas(int, int /*<<< orphan*/ *,
                                                int /*<<< orphan*/, int, int);
void tran_file_close(int fd, int write_eof) {
  if (fd != -1) {
    if (write_eof) {
      tran_file_write_track_deltas(fd, NULL, 0, -1, -1);
      fsync(fd);
    }
    close(fd);
  }
}


x86 assembly (clang, -O0):
<tran_file_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     1179 <tran_file_close+0x49>
cmpl   $0x0,-0x8(%rbp)
je     1171 <tran_file_close+0x41>
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
mov    $0xffffffff,%r8d
mov    %r8d,%ecx
call   1040 <tran_file_write_track_deltas@plt>
mov    -0x4(%rbp),%edi
call   1050 <fsync@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tran_file_close>:
cmp    $0xffffffff,%edi
je     1161 <tran_file_close+0x31>
push   %rbx
mov    %edi,%ebx
test   %esi,%esi
je     1159 <tran_file_close+0x29>
mov    %ebx,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0xffffffff,%ecx
mov    $0xffffffff,%r8d
call   1040 <tran_file_write_track_deltas@plt>
mov    %ebx,%edi
call   1050 <fsync@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <close@plt>
ret

LLVM IR (-O0):
define void @tran_file_close(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %18
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i32, i32* %3
%12 = call i32 @tran_file_write_track_deltas(i32 %11, i32* null, i32 0, i32 -1, i32 -1)
%13 = load i32, i32* %3
%14 = call i32 @fsync(i32 %13)
br label %15
15: ; preds = %10, %7
%16 = load i32, i32* %3
%17 = call i32 @close(i32 %16)
br label %18
18: ; preds = %15, %2
ret void
}

LLVM IR (-O2):
define void @tran_file_close(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, -1
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = icmp eq i32 %1, 0
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = tail call i32 @tran_file_write_track_deltas(i32 %0, i32* null, i32 0, i32 -1, i32 -1)
%8 = tail call i32 @fsync(i32 %0)
br label %9
9: ; preds = %6, %4
%10 = tail call i32 @close(i32 %0)
br label %11
11: ; preds = %9, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_op_load_lr();
void spr_read_lr(void *opaque, int sprn) { gen_op_load_lr(); }


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

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

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

LLVM IR (-O2):
define void @spr_read_lr(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @gen_op_load_lr()
ret void
}
int quicktime_release() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @quicktime_release() {
ret i32 0
}