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

/* Variables and functions */
int __xstat(int, char *, struct stat *);
int /*<<< orphan*/ free(char *);
char *normalize_pathat(int, char const *);
int __fxstatat(int ver, int dirfd, const char *argpath, struct stat *buf,
               int flags) {
  char *path = NULL;
  int ret;
  path = normalize_pathat(dirfd, argpath);
  ret = __xstat(ver, path, buf);
  free(path);
  return ret;
}


x86 assembly (clang, -O0):
<__fxstatat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <normalize_pathat@plt>
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <__xstat@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fxstatat>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %edi,%ebp
mov    %esi,%edi
mov    %rdx,%rsi
call   1050 <normalize_pathat@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %rax,%rsi
mov    %r14,%rdx
call   1040 <__xstat@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @__fxstatat(i32 %0, i32 %1, i8* %2, %struct.stat* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca %struct.stat*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store %struct.stat* %3, %struct.stat** %9
store i32 %4, i32* %10
store i8* null, i8** %11
%13 = load i32, i32* %7
%14 = load i8*, i8** %8
%15 = call i8* @normalize_pathat(i32 %13, i8* %14)
store i8* %15, i8** %11
%16 = load i32, i32* %6
%17 = load i8*, i8** %11
%18 = load %struct.stat*, %struct.stat** %9
%19 = call i32 @__xstat(i32 %16, i8* %17, %struct.stat* %18)
store i32 %19, i32* %12
%20 = load i8*, i8** %11
%21 = call i32 @free(i8* %20)
%22 = load i32, i32* %12
ret i32 %22
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @__fxstatat(i32 %0, i32 %1, i8* %2, %struct.stat* %3, i32 %4) {
%6 = tail call i8* @normalize_pathat(i32 %1, i8* %2)
%7 = tail call i32 @__xstat(i32 %0, i8* %6, %struct.stat* %3)
%8 = tail call i32 @free(i8* %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ init();
int /*<<< orphan*/ play();
int main() {
  init();
  play();
  endwin();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <init@plt>
mov    $0x0,%al
call   1030 <play@plt>
mov    $0x0,%al
call   1050 <endwin@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <init@plt>
xor    %eax,%eax
call   1030 <play@plt>
xor    %eax,%eax
call   1050 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @init()
%2 = call i32 (...) @play()
%3 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 (...) @play()
%3 = tail call i32 (...) @endwin()
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void UARTFIFODisable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x0000002C))) &= ~(0x00000010);
}


x86 assembly (clang, -O0):
<UARTFIFODisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%rcx
and    $0xffffffffffffffef,%rcx
mov    %rcx,0x2c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFIFODisable>:
andq   $0xffffffffffffffef,0x2c(%rdi)
ret

LLVM IR (-O0):
define void @UARTFIFODisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 44
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -17
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @UARTFIFODisable(i64 %0) {
%2 = add nsw i64 %0, 44
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -17
store volatile i64 %5, i64* %3
ret void
}
int my_strlcpy(dest, src, n)
char *dest, *src;
int n;
{
  int len, len_src;
  len_src = strlen(src);
  len = (((n - 1) < (len_src)) ? (n - 1) : (len_src));
  memmove(dest, src, len);
  dest[len] = '\0';
  return len_src;
}


x86 assembly (clang, -O0):
<my_strlcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
cmp    -0x1c(%rbp),%eax
jge    115c <my_strlcpy+0x3c>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1162 <my_strlcpy+0x42>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x18(%rbp),%rdx
call   1040 <memmove@plt>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlcpy>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rax,%r12
add    $0xffffffff,%ebx
cmp    %r12d,%ebx
cmovge %r12d,%ebx
movslq %ebx,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memmove@plt>
movb   $0x0,(%r15,%rbx,1)
mov    %r12d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @my_strlcpy(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i8*, i8** %5
%10 = call i64 @strlen(i8* %9)
%11 = trunc i64 %10 to i32
store i32 %11, i32* %8
%12 = load i32, i32* %6
%13 = sub nsw i32 %12, 1
%14 = load i32, i32* %8
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %19
16: ; preds = %3
%17 = load i32, i32* %6
%18 = sub nsw i32 %17, 1
br label %21
19: ; preds = %3
%20 = load i32, i32* %8
br label %21
21: ; preds = %19, %16
%22 = phi i32 [ %18, %16 ], [ %20, %19 ]
store i32 %22, i32* %7
%23 = load i8*, i8** %4
%24 = load i8*, i8** %5
%25 = load i32, i32* %7
%26 = sext i32 %25 to i64
%27 = load i8*, i8** %4
%28 = load i32, i32* %7
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %27, i64 %29
store i8 0, i8* %30
%31 = load i32, i32* %8
ret i32 %31
}

LLVM IR (-O2):
define i32 @my_strlcpy(i8* nocapture writeonly %0, i8* nocapture %1, i32 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = trunc i64 %4 to i32
%6 = add nsw i32 %2, -1
%7 = icmp slt i32 %6, %5
%8 = select i1 %7, i32 %6, i32 %5
%9 = sext i32 %8 to i64
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %9, i1 false)
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
ret i32 %5
}
void __attribute__((constructor)) destr(void) {
  extern void baz(void);
  baz();
}


x86 assembly (clang, -O0):
<destr>:
push   %rbp
mov    %rsp,%rbp
call   1030 <baz@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<destr>:
jmp    1030 <baz@plt>

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @destr, i8* null }]
define void @destr() {
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @destr, i8* null }]
define void @destr() {
tail call void @baz()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xb3() {
  Assert_real((ispunct(179) == 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_ispunct.c",
              900, ("ispunct should be 0 for 0xb3"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0xb3>:
push   %rax
mov    $0xb3,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x384,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xb3\00"
define void @t_ispunct_0xb3() {
%1 = call i64 @ispunct(i32 179)
%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 900, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xb3\00"
define void @t_ispunct_0xb3() {
%1 = tail call i64 @ispunct(i32 179)
%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 900, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rom_present(char *);
int et4000w32p_available() { return rom_present("et4000w32.bin"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"et4000w32.bin\00"
define i32 @et4000w32p_available() {
%1 = call i32 @rom_present(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [14 x i8] c"et4000w32.bin\00"
define i32 @et4000w32p_available() {
%1 = tail call i32 @rom_present(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int midpoint(int imin, int imax) { return (imin + imax) / 2; }


x86 assembly (clang, -O0):
<midpoint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<midpoint>:
lea    (%rdi,%rsi,1),%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @midpoint(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 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = sdiv i32 %7, 2
ret i32 %8
}

LLVM IR (-O2):
define i32 @midpoint(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sdiv i32 %3, 2
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ BIO_C_GET_READ_REQUEST;
size_t BIO_ctrl(int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/,
                int /*<<< orphan*/ *);
size_t BIO_ctrl_get_read_request(BIO *bio) {
  return BIO_ctrl(bio, BIO_C_GET_READ_REQUEST, 0, NULL);
}


x86 assembly (clang, -O0):
<BIO_ctrl_get_read_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <BIO_ctrl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIO_ctrl_get_read_request>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <BIO_ctrl@plt>

LLVM IR (-O0):
@BIO_C_GET_READ_REQUEST = global i32 0
define i64 @BIO_ctrl_get_read_request(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @BIO_C_GET_READ_REQUEST
%5 = call i64 @BIO_ctrl(i32* %3, i32 %4, i32 0, i32* null)
ret i64 %5
}

LLVM IR (-O2):
@BIO_C_GET_READ_REQUEST = global i32 0
define i64 @BIO_ctrl_get_read_request(i32* %0) {
%2 = load i32, i32* @BIO_C_GET_READ_REQUEST
%3 = tail call i64 @BIO_ctrl(i32* %0, i32 %2, i32 0, i32* null)
ret i64 %3
}
char unescape(char c) {
  switch (c) {
  case 'n':
    return 10;
  case 'r':
    return 13;
  case 't':
    return 9;
  default:
    return c;
  }
}


x86 assembly (clang, -O0):
<unescape>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x6e,%eax
je     1141 <unescape+0x41>
jmp    111f <unescape+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x72,%eax
je     114a <unescape+0x4a>
jmp    1130 <unescape+0x30>
mov    -0x8(%rbp),%eax
sub    $0x74,%eax
je     1153 <unescape+0x53>
jmp    115c <unescape+0x5c>
movb   $0xa,-0x1(%rbp)
jmp    1162 <unescape+0x62>
movb   $0xd,-0x1(%rbp)
jmp    1162 <unescape+0x62>
movb   $0x9,-0x1(%rbp)
jmp    1162 <unescape+0x62>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unescape>:
cmp    $0x6e,%edi
je     1114 <unescape+0x14>
mov    %edi,%eax
cmp    $0x74,%edi
je     1117 <unescape+0x17>
cmp    $0x72,%eax
jne    1119 <unescape+0x19>
mov    $0xd,%al
ret
mov    $0xa,%al
ret
mov    $0x9,%al
ret

LLVM IR (-O0):
define signext i8 @unescape(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 110, label %6
i32 114, label %7
i32 116, label %8
]
6: ; preds = %1
store i8 10, i8* %2
br label %11
7: ; preds = %1
store i8 13, i8* %2
br label %11
8: ; preds = %1
store i8 9, i8* %2
br label %11
9: ; preds = %1
%10 = load i8, i8* %3
store i8 %10, i8* %2
br label %11
11: ; preds = %9, %8, %7, %6
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @unescape(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %5 [
i32 110, label %6
i32 114, label %3
i32 116, label %4
]
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3
%7 = phi i8 [ %0, %5 ], [ 9, %4 ], [ 13, %3 ], [ 10, %1 ]
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ w_pawns_able_to_capture_east(int, int);
void w_pawns_able_to_capture_east_test(void **state) {
  assert_int_equal(
      0x0000000004000000ul,
      w_pawns_able_to_capture_east(0x000000000C10E300ul, 0x00E3140800000000ul));
}


x86 assembly (clang, -O0):
<w_pawns_able_to_capture_east_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xc10e300,%edi
xor    %esi,%esi
call   1030 <w_pawns_able_to_capture_east@plt>
mov    %eax,%esi
mov    $0x4000000,%edi
call   1040 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_pawns_able_to_capture_east_test>:
push   %rax
mov    $0xc10e300,%edi
xor    %esi,%esi
call   1030 <w_pawns_able_to_capture_east@plt>
mov    $0x4000000,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <assert_int_equal@plt>

LLVM IR (-O0):
define void @w_pawns_able_to_capture_east_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @w_pawns_able_to_capture_east(i32 202433280, i32 0)
%4 = call i32 @assert_int_equal(i32 67108864, i32 %3)
ret void
}

LLVM IR (-O2):
define void @w_pawns_able_to_capture_east_test(i8** nocapture readnone %0) {
%2 = tail call i32 @w_pawns_able_to_capture_east(i32 202433280, i32 0)
%3 = tail call i32 @assert_int_equal(i32 67108864, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EA_AY_AI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_st_8_ai(void) { m68ki_write_8(EA_AY_AI_8(), 0xff); }


x86 assembly (clang, -O0):
<m68k_op_st_8_ai>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <EA_AY_AI_8@plt>
mov    %eax,%edi
mov    $0xff,%esi
call   1040 <m68ki_write_8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_st_8_ai>:
push   %rax
xor    %eax,%eax
call   1030 <EA_AY_AI_8@plt>
mov    %eax,%edi
mov    $0xff,%esi
pop    %rax
jmp    1040 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_st_8_ai() {
%1 = call i32 (...) @EA_AY_AI_8()
%2 = call i32 @m68ki_write_8(i32 %1, i32 255)
ret void
}

LLVM IR (-O2):
define void @m68k_op_st_8_ai() {
%1 = tail call i32 (...) @EA_AY_AI_8()
%2 = tail call i32 @m68ki_write_8(i32 %1, i32 255)
ret void
}
unsigned int U4(unsigned char *p) {
  unsigned char b[4];
  b[0] = p[3];
  b[1] = p[2];
  b[2] = p[1];
  b[3] = p[0];
  return *(unsigned int *)b;
}


x86 assembly (clang, -O0):
<U4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @U4(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 3
%6 = load i8, i8* %5
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 %6, i8* %7
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 2
%10 = load i8, i8* %9
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 %10, i8* %11
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 %14, i8* %15
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 %18, i8* %19
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%21 = bitcast i8* %20 to i32*
%22 = load i32, i32* %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @U4(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %0, i64 2
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = load i8, i8* %0
%9 = zext i8 %8 to i32
%10 = shl nuw i32 %9, 24
%11 = zext i8 %7 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = zext i8 %5 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = zext i8 %3 to i32
%16 = or i32 %14, %15
%17 = or i32 %16, %12
%18 = or i32 %17, %10
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ err_fatal_simple_core(char *, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int err_fflush(FILE *stream) {
  int ret = fflush(stream);
  if (ret != 0) {
    err_fatal_simple_core("fflush", strerror(errno));
  }
  return ret;
}


x86 assembly (clang, -O0):
<err_fflush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fflush@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     116e <err_fflush+0x3e>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%esi
lea    0xe97(%rip),%rdi
call   1030 <err_fatal_simple_core@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_fflush>:
push   %rbx
call   1040 <fflush@plt>
mov    %eax,%ebx
test   %eax,%eax
je     1158 <err_fflush+0x28>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
call   1030 <err_fatal_simple_core@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"fflush\00"
@errno = global i32 0
define i32 @err_fflush(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fflush(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @errno
%10 = call i32 @strerror(i32 %9)
%11 = call i32 @err_fatal_simple_core(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %8, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [7 x i8] c"fflush\00"
@errno = global i32 0
define i32 @err_fflush(i32* nocapture %0) {
%2 = tail call i32 @fflush(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @err_fatal_simple_core(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %4, %1
ret i32 %2
}
int get_num_args(char *start_ptr) {
  int num_args = (!!*start_ptr);
  while (*start_ptr++) {
    num_args += *start_ptr == ' ';
  }
  return num_args;
}


x86 assembly (clang, -O0):
<get_num_args>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1153 <get_num_args+0x53>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    111e <get_num_args+0x1e>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_num_args>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
setne  %al
je     1125 <get_num_args+0x25>
add    $0x1,%rdi
xchg   %ax,%ax
movzbl (%rdi),%ecx
xor    %edx,%edx
cmp    $0x20,%cl
sete   %dl
add    %edx,%eax
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <get_num_args+0x10>
ret

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

LLVM IR (-O2):
define i32 @get_num_args(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ne i8 %2, 0
%4 = zext i1 %3 to i32
%5 = icmp eq i8 %2, 0
br i1 %5, label %15, label %6
6: ; preds = %1, %6
%7 = phi i8* [ %9, %6 ], [ %0, %1 ]
%8 = phi i32 [ %13, %6 ], [ %4, %1 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 32
%12 = zext i1 %11 to i32
%13 = add nuw nsw i32 %8, %12
%14 = icmp eq i8 %10, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %1
%16 = phi i32 [ %4, %1 ], [ %13, %6 ]
ret i32 %16
}
long dsfmt_get_min_array_size(void) { return (((132049 - 128) / 104 + 1) * 2); }


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

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

LLVM IR (-O0):
define i64 @dsfmt_get_min_array_size() {
ret i64 2538
}

LLVM IR (-O2):
define i64 @dsfmt_get_min_array_size() {
ret i64 2538
}
/* Type definitions */
struct cec_msg {
  int /*<<< orphan*/ *msg;
};
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
void cec_ops_menu_request(const struct cec_msg *msg, __u8 *menu_req) {
  *menu_req = msg->msg[2];
}


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

x86 assembly (clang, -O2):
<cec_ops_menu_request>:
mov    (%rdi),%rax
mov    0x8(%rax),%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32* }
define void @cec_ops_menu_request(%struct.cec_msg* %0, i32* %1) {
%3 = alloca %struct.cec_msg*
%4 = alloca i32*
store %struct.cec_msg* %0, %struct.cec_msg** %3
store i32* %1, i32** %4
%5 = load %struct.cec_msg*, %struct.cec_msg** %3
%6 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %5, i32 0, i32 0
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 2
%9 = load i32, i32* %8
%10 = load i32*, i32** %4
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32* }
define void @cec_ops_menu_request(%struct.cec_msg* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 2
%6 = load i32, i32* %5
store i32 %6, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ swerr1(char *);
int /*<<< orphan*/ swerr_SetPos(char *, int);
int os_rDirName(char const *str, char *out, int size) {
  do {
    swerr_SetPos("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/misty-fungus/ejudge-debian/"
                 "refs/heads/master/win32/reuse_rdirname.c",
                 33);
    swerr1("Not implemented");
  } while (0);
}


x86 assembly (clang, -O0):
<os_rDirName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
lea    0xec6(%rip),%rdi
mov    $0x21,%esi
call   1030 <swerr_SetPos@plt>
lea    0xf53(%rip),%rdi
call   1040 <swerr1@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_rDirName>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x21,%esi
call   1030 <swerr_SetPos@plt>
lea    0xf65(%rip),%rdi
pop    %rax
jmp    1040 <swerr1@plt>

LLVM IR (-O0):
@.str = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/misty-fungus/ejudge-debian/refs/heads/master/win32/reuse_rdirname.c\00"
@.str.1 = [16 x i8] c"Not implemented\00"
define i32 @os_rDirName(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
br label %8
8: ; preds = %3
%9 = call i32 @swerr_SetPos(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 33)
%10 = call i32 @swerr1(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %8
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
@.str = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/misty-fungus/ejudge-debian/refs/heads/master/win32/reuse_rdirname.c\00"
@.str.1 = [16 x i8] c"Not implemented\00"
define i32 @os_rDirName(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @swerr_SetPos(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 33)
%5 = tail call i32 @swerr1(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
char *range(char *s, int first, int last) {
  *s++ = first;
  if (last > first) {
    if (last > first + 1)
      *s++ = '-';
    *s++ = last;
  }
  return s;
}


x86 assembly (clang, -O0):
<range>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1169 <range+0x69>
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jle    1153 <range+0x53>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x2d,(%rax)
mov    -0x10(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<range>:
lea    0x1(%rdi),%rax
mov    %sil,(%rdi)
cmp    %esi,%edx
jle    1123 <range+0x23>
add    $0x1,%esi
cmp    %edx,%esi
jge    111d <range+0x1d>
movb   $0x2d,0x1(%rdi)
add    $0x2,%rdi
mov    %rdi,%rax
mov    %dl,(%rax)
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i8* @range(i8* writeonly %0, i32 %1, i32 %2) {
%4 = trunc i32 %1 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %4, i8* %0
%6 = icmp sgt i32 %2, %1
br i1 %6, label %7, label %16
7: ; preds = %3
%8 = add nsw i32 %1, 1
%9 = icmp slt i32 %8, %2
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = getelementptr inbounds i8, i8* %0, i64 2
store i8 45, i8* %5
br label %12
12: ; preds = %10, %7
%13 = phi i8* [ %11, %10 ], [ %5, %7 ]
%14 = trunc i32 %2 to i8
%15 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %14, i8* %13
br label %16
16: ; preds = %12, %3
%17 = phi i8* [ %15, %12 ], [ %5, %3 ]
ret i8* %17
}
void foo072() {}


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

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

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

LLVM IR (-O2):
define void @foo072() {
ret void
}
void gtk_tool_item_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tool_item_new() {
ret void
}
int main(void) {
  long i;
  unsigned long u;
  i = 1;
  i = -1;
  i = -1l;
  i = -1u;
  i = -1ll;
  i = (1ll << 32) - 1 & 3;
  i = (long)((1ll << 32) - 1) < 0;
  i = -1u < 0;
  u = 1;
  u = -1;
  u = -1l;
  u = -1u;
  u = -1ll;
  u = (1ll << 32) - 1 & 3;
  u = (long)((1ll << 32) - 1) < 0;
  u = -1u < 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
mov    $0xffffffff,%eax
mov    %rax,-0x10(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
movq   $0x3,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
mov    $0xffffffff,%eax
mov    %rax,-0x18(%rbp)
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
movq   $0x3,-0x18(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
store i64 1, i64* %2
store i64 -1, i64* %2
store i64 -1, i64* %2
store i64 4294967295, i64* %2
store i64 -1, i64* %2
store i64 3, i64* %2
store i64 0, i64* %2
store i64 0, i64* %2
store i64 1, i64* %3
store i64 -1, i64* %3
store i64 -1, i64* %3
store i64 4294967295, i64* %3
store i64 -1, i64* %3
store i64 3, i64* %3
store i64 0, i64* %3
store i64 0, i64* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void Sys_EarlyOutput(char *string) { printf("%s", string); }


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

x86 assembly (clang, -O2):
<Sys_EarlyOutput>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @Sys_EarlyOutput(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
falFreeFontNames() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @falFreeFontNames() {
ret i32 0
}
unsigned char *serialize_int(unsigned char *buffer, unsigned int val) {
  unsigned int size = sizeof(unsigned int);
  for (unsigned int i = 0; i < size; ++i) {
    buffer[i] = val >> (8 * (size - i - 1));
  }
  return buffer + size;
}


x86 assembly (clang, -O0):
<serialize_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jae    1150 <serialize_int+0x50>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    -0x14(%rbp),%ecx
sub    $0x1,%ecx
shl    $0x3,%ecx
shr    %cl,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <serialize_int+0x19>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialize_int>:
bswap  %esi
mov    %esi,(%rdi)
lea    0x4(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @serialize_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 4, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %24, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = icmp ult i32 %8, %9
br i1 %10, label %11, label %27
11: ; preds = %7
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub i32 %13, %14
%16 = sub i32 %15, 1
%17 = mul i32 8, %16
%18 = lshr i32 %12, %17
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %3
%21 = load i32, i32* %6
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
store i8 %19, i8* %23
br label %24
24: ; preds = %11
%25 = load i32, i32* %6
%26 = add i32 %25, 1
store i32 %26, i32* %6
br label %7
27: ; preds = %7
%28 = load i8*, i8** %3
%29 = load i32, i32* %5
%30 = zext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %28, i64 %30
ret i8* %31
}

LLVM IR (-O2):
define i8* @serialize_int(i8* writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
%13 = getelementptr inbounds i8, i8* %0, i64 4
ret i8* %13
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
scalar_t__ ERR;
scalar_t__ keypad(int /*<<< orphan*/, int);
int /*<<< orphan*/ stdscr;
uint8_t ccbi_keypad(int on) { return ((keypad(stdscr, on)) == ERR ? 0 : 1); }


x86 assembly (clang, -O0):
<ccbi_keypad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
call   1030 <keypad@plt>
mov    %rax,%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%rsi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccbi_keypad>:
push   %rax
mov    %edi,%esi
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
call   1030 <keypad@plt>
mov    0x2ec0(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stdscr = global i32 0
@ERR = global i64 0
define i32 @ccbi_keypad(i32 %0) {
%2 = load i32, i32* @stdscr
%3 = tail call i64 @keypad(i32 %2, i32 %0)
%4 = load i64, i64* @ERR
%5 = icmp ne i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
unsigned which_bit(const unsigned x) {
  const unsigned y = x & 7u;
  return (y - (y >> 2)) | ((x - 1) & 4u) | (x >> 4);
}


x86 assembly (clang, -O0):
<which_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x2,%ecx
sub    %ecx,%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    $0x4,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<which_bit>:
mov    %edi,%ecx
and    $0x7,%ecx
mov    %ecx,%eax
shr    $0x2,%eax
sub    %eax,%ecx
lea    -0x1(%rdi),%eax
and    $0x4,%eax
shr    $0x4,%edi
or     %edi,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @which_bit(i32 %0) {
%2 = and i32 %0, 7
%3 = lshr i32 %2, 2
%4 = sub nsw i32 %2, %3
%5 = add i32 %0, 7
%6 = and i32 %5, 4
%7 = lshr i32 %0, 4
%8 = or i32 %6, %7
%9 = or i32 %8, %4
ret i32 %9
}
/* Variables and functions */
char *japi_getitem(int, int, char *);
char *j_getitem(int arg0, int arg1, char *arg2) {
  return (japi_getitem(arg0, arg1, arg2));
}


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

x86 assembly (clang, -O2):
<j_getitem>:
jmp    1030 <japi_getitem@plt>

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

LLVM IR (-O2):
define i8* @j_getitem(i32 %0, i32 %1, i8* %2) {
%4 = tail call i8* @japi_getitem(i32 %0, i32 %1, i8* %2)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int read(int, int /*<<< orphan*/ *, int);
void load_first_bank(uint8_t *p, int fd) {
  if (read(fd, p + 256, 16384 - 256) < 1) {
    perror("read");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<load_first_bank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
add    $0x400,%rsi
mov    $0x3f00,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
jge    1176 <load_first_bank+0x46>
lea    0xe99(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_first_bank>:
push   %rax
mov    %esi,%eax
lea    0x400(%rdi),%rsi
mov    %eax,%edi
mov    $0x3f00,%edx
call   1030 <read@plt>
test   %eax,%eax
jle    114c <load_first_bank+0x1c>
pop    %rax
ret
lea    0xead(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"read\00"
define void @load_first_bank(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 256
%8 = call i32 @read(i32 %5, i32* %7, i32 16128)
%9 = icmp slt i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"read\00"
define void @load_first_bank(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 256
%4 = tail call i32 @read(i32 %1, i32* %3, i32 16128)
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kbhit();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usleep(int);
int main(int argc, char *argv[]) {
  while (!kbhit()) {
    printf(".");
    usleep(100 * 1000);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <kbhit@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1162 <main+0x32>
jmp    117d <main+0x4d>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    $0x186a0,%edi
call   1050 <usleep@plt>
jmp    1146 <main+0x16>
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <kbhit@plt>
test   %eax,%eax
jne    1161 <main+0x31>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x186a0,%edi
call   1050 <usleep@plt>
jmp    1140 <main+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @kbhit()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2, %5
%6 = tail call i32 @putchar(i32 46)
%7 = tail call i32 @usleep(i32 100000)
%8 = tail call i32 (...) @kbhit()
%9 = icmp eq i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %2
%11 = tail call i32 @putchar(i32 10)
ret i32 0
}
long powd(int a, int b) {
  long x;
  unsigned char i;
  x = a;
  for (i = 0; i < b - 1; i++) {
    x = x * a;
  }
  return x;
}


x86 assembly (clang, -O0):
<powd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1145 <powd+0x45>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x11(%rbp),%al
add    $0x1,%al
mov    %al,-0x11(%rbp)
jmp    1116 <powd+0x16>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<powd>:
movslq %edi,%rcx
cmp    $0x2,%esi
jl     111f <powd+0x1f>
add    $0xffffffff,%esi
mov    $0x1,%dl
mov    %rcx,%rax
imul   %rcx,%rax
movzbl %dl,%edi
lea    0x1(%rdi),%edx
cmp    %edi,%esi
jg     1110 <powd+0x10>
ret
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @powd(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = add nsw i32 %1, -1
%5 = icmp sgt i32 %1, 1
br i1 %5, label %6, label %13
6: ; preds = %2, %6
%7 = phi i8 [ %10, %6 ], [ 0, %2 ]
%8 = phi i64 [ %9, %6 ], [ %3, %2 ]
%9 = mul nsw i64 %8, %3
%10 = add i8 %7, 1
%11 = zext i8 %10 to i32
%12 = icmp sgt i32 %4, %11
br i1 %12, label %6, label %13
13: ; preds = %6, %2
%14 = phi i64 [ %3, %2 ], [ %9, %6 ]
ret i64 %14
}