#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef size_t pixel_offset;

/* Variables and functions */
char NESCombineBits(unsigned char, unsigned char, int);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ v_printf(int, char *, int, int, ...);
int NESTileToComposite(char *tile_data, char *buf) {
  if (!tile_data || !buf)
    return 0;
  char *new_composite = (char *)malloc(8 * 8);
  unsigned char channel_a[8], channel_b[8];
  int i = 0;
  int j = 0;
  for (i = 0; i < 8; i++) {
    channel_a[i] = tile_data[i];
    channel_b[i] = tile_data[8 + i];
    v_printf(4, "Channels A/B: %d/%d", channel_a[i], channel_b[i]);
  }
  for (i = 0; i < 8; i++) {
    for (j = 7; j >= 0; j--) {
      int pixel_offset = (i * 8) + (8 - j);
      new_composite[(pixel_offset)-1] =
          NESCombineBits(channel_a[i], channel_b[i], j);
      v_printf(4, "Composite (%d,%d:%d): %d", i, j, (pixel_offset),
               new_composite[pixel_offset - 1]);
    }
  }
  memcpy(buf, new_composite, 8 * 8);
  free(new_composite);
  return 1;
}


x86 assembly (clang, -O0):
<NESTileToComposite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1176 <NESTileToComposite+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1182 <NESTileToComposite+0x32>
movl   $0x0,-0x4(%rbp)
jmp    12e4 <NESTileToComposite+0x194>
mov    $0x40,%edi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x8,-0x34(%rbp)
jge    120d <NESTileToComposite+0xbd>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x34(%rbp),%rax
mov    %cl,-0x28(%rbp,%rax,1)
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x8,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x34(%rbp),%rax
mov    %cl,-0x30(%rbp,%rax,1)
movslq -0x34(%rbp),%rax
movzbl -0x28(%rbp,%rax,1),%edx
movslq -0x34(%rbp),%rax
movzbl -0x30(%rbp,%rax,1),%ecx
mov    $0x4,%edi
lea    0xe08(%rip),%rsi
mov    $0x0,%al
call   1070 <v_printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11a5 <NESTileToComposite+0x55>
movl   $0x0,-0x34(%rbp)
cmpl   $0x8,-0x34(%rbp)
jge    12c2 <NESTileToComposite+0x172>
movl   $0x7,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jl     12af <NESTileToComposite+0x15f>
mov    -0x34(%rbp),%eax
shl    $0x3,%eax
mov    $0x8,%ecx
sub    -0x38(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x3c(%rbp)
movslq -0x34(%rbp),%rax
mov    -0x28(%rbp,%rax,1),%cl
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,1),%al
mov    -0x38(%rbp),%edx
movzbl %cl,%edi
movzbl %al,%esi
call   1040 <NESCombineBits@plt>
mov    %al,%dl
mov    -0x20(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x34(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    -0x3c(%rbp),%r8d
mov    -0x20(%rbp),%rax
mov    -0x3c(%rbp),%esi
sub    $0x1,%esi
movslq %esi,%rsi
movsbl (%rax,%rsi,1),%r9d
mov    $0x4,%edi
lea    0xd7a(%rip),%rsi
mov    $0x0,%al
call   1070 <v_printf@plt>
mov    -0x38(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x38(%rbp)
jmp    1225 <NESTileToComposite+0xd5>
jmp    12b4 <NESTileToComposite+0x164>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1214 <NESTileToComposite+0xc4>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NESTileToComposite>:
xor    %eax,%eax
test   %rdi,%rdi
je     14c1 <NESTileToComposite+0x371>
test   %rsi,%rsi
je     14c1 <NESTileToComposite+0x371>
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rbx
mov    %rsi,0x20(%rsp)
mov    $0x40,%edi
call   1060 <malloc@plt>
mov    %rax,%r15
mov    (%rbx),%bpl
mov    %bpl,0x10(%rsp)
mov    0x8(%rbx),%r13b
mov    %r13b,0x8(%rsp)
movzbl %bpl,%edx
movzbl %r13b,%ecx
lea    0xe59(%rip),%r14
mov    $0x4,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <v_printf@plt>
movzbl 0x1(%rbx),%edx
mov    %dl,0x11(%rsp)
movzbl 0x9(%rbx),%ecx
mov    %cl,0x9(%rsp)
mov    $0x4,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <v_printf@plt>
movzbl 0x2(%rbx),%edx
mov    %dl,0x12(%rsp)
movzbl 0xa(%rbx),%ecx
mov    %cl,0xa(%rsp)
mov    $0x4,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <v_printf@plt>
movzbl 0x3(%rbx),%edx
mov    %dl,0x13(%rsp)
movzbl 0xb(%rbx),%ecx
mov    %cl,0xb(%rsp)
mov    $0x4,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <v_printf@plt>
movzbl 0x4(%rbx),%edx
mov    %dl,0x14(%rsp)
movzbl 0xc(%rbx),%ecx
mov    %cl,0xc(%rsp)
mov    $0x4,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <v_printf@plt>
movzbl 0x5(%rbx),%edx
mov    %dl,0x15(%rsp)
movzbl 0xd(%rbx),%ecx
mov    %cl,0xd(%rsp)
mov    $0x4,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <v_printf@plt>
movzbl 0x6(%rbx),%edx
mov    %dl,0x16(%rsp)
movzbl 0xe(%rbx),%ecx
mov    %cl,0xe(%rsp)
mov    $0x4,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <v_printf@plt>
movzbl 0x7(%rbx),%edx
mov    %dl,0x17(%rsp)
movzbl 0xf(%rbx),%ecx
mov    %cl,0xf(%rsp)
mov    $0x4,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <v_printf@plt>
mov    %r15,0x18(%rsp)
add    $0x7,%r15
xor    %r12d,%r12d
xor    %ebx,%ebx
nopl   (%rax)
lea    0x1(%r12),%r14d
movzbl %bpl,%ebp
movzbl %r13b,%r13d
mov    %ebp,%edi
mov    %r13d,%esi
mov    $0x7,%edx
call   1040 <NESCombineBits@plt>
mov    %al,-0x7(%r15,%r12,1)
movsbl %al,%r9d
mov    $0x4,%edi
lea    0xd43(%rip),%rsi
mov    %ebx,%edx
mov    $0x7,%ecx
mov    %r14d,%r8d
xor    %eax,%eax
call   1070 <v_printf@plt>
lea    0x2(%r12),%r14d
mov    %ebp,%edi
mov    %r13d,%esi
mov    $0x6,%edx
call   1040 <NESCombineBits@plt>
mov    %al,-0x6(%r15,%r12,1)
movsbl %al,%r9d
mov    $0x4,%edi
lea    0xd09(%rip),%rsi
mov    %ebx,%edx
mov    $0x6,%ecx
mov    %r14d,%r8d
xor    %eax,%eax
call   1070 <v_printf@plt>
lea    0x3(%r12),%r14d
mov    %ebp,%edi
mov    %r13d,%esi
mov    $0x5,%edx
call   1040 <NESCombineBits@plt>
mov    %al,-0x5(%r15,%r12,1)
movsbl %al,%r9d
mov    $0x4,%edi
lea    0xccf(%rip),%rsi
mov    %ebx,%edx
mov    $0x5,%ecx
mov    %r14d,%r8d
xor    %eax,%eax
call   1070 <v_printf@plt>
lea    0x4(%r12),%r14d
mov    %ebp,%edi
mov    %r13d,%esi
mov    $0x4,%edx
call   1040 <NESCombineBits@plt>
mov    %al,-0x4(%r15,%r12,1)
movsbl %al,%r9d
mov    $0x4,%edi
lea    0xc95(%rip),%rsi
mov    %ebx,%edx
mov    $0x4,%ecx
mov    %r14d,%r8d
xor    %eax,%eax
call   1070 <v_printf@plt>
lea    0x5(%r12),%r14d
mov    %ebp,%edi
mov    %r13d,%esi
mov    $0x3,%edx
call   1040 <NESCombineBits@plt>
mov    %al,-0x3(%r15,%r12,1)
movsbl %al,%r9d
mov    $0x4,%edi
lea    0xc5b(%rip),%rsi
mov    %ebx,%edx
mov    $0x3,%ecx
mov    %r14d,%r8d
xor    %eax,%eax
call   1070 <v_printf@plt>
lea    0x6(%r12),%r14d
mov    %ebp,%edi
mov    %r13d,%esi
mov    $0x2,%edx
call   1040 <NESCombineBits@plt>
mov    %al,-0x2(%r15,%r12,1)
movsbl %al,%r9d
mov    $0x4,%edi
lea    0xc21(%rip),%rsi
mov    %ebx,%edx
mov    $0x2,%ecx
mov    %r14d,%r8d
xor    %eax,%eax
call   1070 <v_printf@plt>
lea    0x7(%r12),%r14d
mov    %ebp,%edi
mov    %r13d,%esi
mov    $0x1,%edx
call   1040 <NESCombineBits@plt>
mov    %al,-0x1(%r15,%r12,1)
movsbl %al,%r9d
mov    $0x4,%edi
lea    0xbe7(%rip),%rsi
mov    %ebx,%edx
mov    $0x1,%ecx
mov    %r14d,%r8d
xor    %eax,%eax
call   1070 <v_printf@plt>
lea    0x8(%r12),%r14d
mov    %ebp,%edi
mov    %r13d,%esi
xor    %edx,%edx
call   1040 <NESCombineBits@plt>
mov    %al,(%r15,%r12,1)
movsbl %al,%r9d
mov    $0x4,%edi
lea    0xbb1(%rip),%rsi
mov    %ebx,%edx
xor    %ecx,%ecx
mov    %r14d,%r8d
xor    %eax,%eax
call   1070 <v_printf@plt>
cmp    $0x38,%r12
je     148f <NESTileToComposite+0x33f>
movzbl 0x11(%rsp,%rbx,1),%ebp
movzbl 0x9(%rsp,%rbx,1),%r13d
add    $0x8,%r12
add    $0x1,%rbx
jmp    12a0 <NESTileToComposite+0x150>
mov    0x20(%rsp),%rdi
mov    0x18(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Channels A/B: %d/%d\00"
@.str.1 = [25 x i8] c"Composite (%d,%d:%d): %d\00"
define i32 @NESTileToComposite(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [8 x i8]
%8 = alloca [8 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%12 = load i8*, i8** %4
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = load i8*, i8** %5
%16 = icmp ne i8* %15, null
br i1 %16, label %18, label %17
17: ; preds = %14, %2
store i32 0, i32* %3
br label %109
18: ; preds = %14
%19 = call i64 @malloc(i32 64)
%20 = inttoptr i64 %19 to i8*
store i8* %20, i8** %6
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %9
br label %21
21: ; preds = %53, %18
%22 = load i32, i32* %9
%23 = icmp slt i32 %22, 8
br i1 %23, label %24, label %56
24: ; preds = %21
%25 = load i8*, i8** %4
%26 = load i32, i32* %9
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
%29 = load i8, i8* %28
%30 = load i32, i32* %9
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 %31
store i8 %29, i8* %32
%33 = load i8*, i8** %4
%34 = load i32, i32* %9
%35 = add nsw i32 8, %34
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %33, i64 %36
%38 = load i8, i8* %37
%39 = load i32, i32* %9
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 %40
store i8 %38, i8* %41
%42 = load i32, i32* %9
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 %43
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = load i32, i32* %9
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 %48
%50 = load i8, i8* %49
%51 = zext i8 %50 to i32
%52 = call i32 (i32, i8*, i32, i32, ...) @v_printf(i32 4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %46, i32 %51)
br label %53
53: ; preds = %24
%54 = load i32, i32* %9
%55 = add nsw i32 %54, 1
store i32 %55, i32* %9
br label %21
56: ; preds = %21
store i32 0, i32* %9
br label %57
57: ; preds = %100, %56
%58 = load i32, i32* %9
%59 = icmp slt i32 %58, 8
br i1 %59, label %60, label %103
60: ; preds = %57
store i32 7, i32* %10
br label %61
61: ; preds = %96, %60
%62 = load i32, i32* %10
%63 = icmp sge i32 %62, 0
br i1 %63, label %64, label %99
64: ; preds = %61
%65 = load i32, i32* %9
%66 = mul nsw i32 %65, 8
%67 = load i32, i32* %10
%68 = sub nsw i32 8, %67
%69 = add nsw i32 %66, %68
store i32 %69, i32* %11
%70 = load i32, i32* %9
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 %71
%73 = load i8, i8* %72
%74 = load i32, i32* %9
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 %75
%77 = load i8, i8* %76
%78 = load i32, i32* %10
%79 = call signext i8 @NESCombineBits(i8 zeroext %73, i8 zeroext %77, i32 %78)
%80 = load i8*, i8** %6
%81 = load i32, i32* %11
%82 = sub nsw i32 %81, 1
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i8, i8* %80, i64 %83
store i8 %79, i8* %84
%85 = load i32, i32* %9
%86 = load i32, i32* %10
%87 = load i32, i32* %11
%88 = load i8*, i8** %6
%89 = load i32, i32* %11
%90 = sub nsw i32 %89, 1
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds i8, i8* %88, i64 %91
%93 = load i8, i8* %92
%94 = sext i8 %93 to i32
%95 = call i32 (i32, i8*, i32, i32, ...) @v_printf(i32 4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %85, i32 %86, i32 %87, i32 %94)
br label %96
96: ; preds = %64
%97 = load i32, i32* %10
%98 = add nsw i32 %97, -1
store i32 %98, i32* %10
br label %61
99: ; preds = %61
br label %100
100: ; preds = %99
%101 = load i32, i32* %9
%102 = add nsw i32 %101, 1
store i32 %102, i32* %9
br label %57
103: ; preds = %57
%104 = load i8*, i8** %5
%105 = load i8*, i8** %6
%106 = call i32 @memcpy(i8* %104, i8* %105, i32 64)
%107 = load i8*, i8** %6
%108 = call i32 @free(i8* %107)
store i32 1, i32* %3
br label %109
109: ; preds = %103, %17
%110 = load i32, i32* %3
ret i32 %110
}

LLVM IR (-O2):
@.str = [20 x i8] c"Channels A/B: %d/%d\00"
@.str.1 = [25 x i8] c"Composite (%d,%d:%d): %d\00"
define i32 @NESTileToComposite(i8* %0, i8* %1) {
%3 = alloca [8 x i8]
%4 = alloca [8 x i8]
%5 = icmp ne i8* %0, null
%6 = icmp ne i8* %1, null
%7 = and i1 %5, %6
br i1 %7, label %8, label %146
8: ; preds = %2
%9 = tail call i64 @malloc(i32 64)
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%12 = load i8, i8* %0
store i8 %12, i8* %10
%13 = getelementptr inbounds i8, i8* %0, i64 8
%14 = load i8, i8* %13
store i8 %14, i8* %11
%15 = zext i8 %12 to i32
%16 = zext i8 %14 to i32
%17 = tail call i32 (i32, i8*, i32, i32, ...) @v_printf(i32 4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16)
%18 = getelementptr inbounds i8, i8* %0, i64 1
%19 = load i8, i8* %18
%20 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 1
store i8 %19, i8* %20
%21 = getelementptr inbounds i8, i8* %0, i64 9
%22 = load i8, i8* %21
%23 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 1
store i8 %22, i8* %23
%24 = zext i8 %19 to i32
%25 = zext i8 %22 to i32
%26 = tail call i32 (i32, i8*, i32, i32, ...) @v_printf(i32 4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %24, i32 %25)
%27 = getelementptr inbounds i8, i8* %0, i64 2
%28 = load i8, i8* %27
%29 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 2
store i8 %28, i8* %29
%30 = getelementptr inbounds i8, i8* %0, i64 10
%31 = load i8, i8* %30
%32 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 2
store i8 %31, i8* %32
%33 = zext i8 %28 to i32
%34 = zext i8 %31 to i32
%35 = tail call i32 (i32, i8*, i32, i32, ...) @v_printf(i32 4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %33, i32 %34)
%36 = getelementptr inbounds i8, i8* %0, i64 3
%37 = load i8, i8* %36
%38 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 3
store i8 %37, i8* %38
%39 = getelementptr inbounds i8, i8* %0, i64 11
%40 = load i8, i8* %39
%41 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 3
store i8 %40, i8* %41
%42 = zext i8 %37 to i32
%43 = zext i8 %40 to i32
%44 = tail call i32 (i32, i8*, i32, i32, ...) @v_printf(i32 4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %42, i32 %43)
%45 = getelementptr inbounds i8, i8* %0, i64 4
%46 = load i8, i8* %45
%47 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 4
store i8 %46, i8* %47
%48 = getelementptr inbounds i8, i8* %0, i64 12
%49 = load i8, i8* %48
%50 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 4
store i8 %49, i8* %50
%51 = zext i8 %46 to i32
%52 = zext i8 %49 to i32
%53 = tail call i32 (i32, i8*, i32, i32, ...) @v_printf(i32 4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %51, i32 %52)
%54 = getelementptr inbounds i8, i8* %0, i64 5
%55 = load i8, i8* %54
%56 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 5
store i8 %55, i8* %56
%57 = getelementptr inbounds i8, i8* %0, i64 13
%58 = load i8, i8* %57
%59 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 5
store i8 %58, i8* %59
%60 = zext i8 %55 to i32
%61 = zext i8 %58 to i32
%62 = tail call i32 (i32, i8*, i32, i32, ...) @v_printf(i32 4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %60, i32 %61)
%63 = getelementptr inbounds i8, i8* %0, i64 6
%64 = load i8, i8* %63
%65 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 6
store i8 %64, i8* %65
%66 = getelementptr inbounds i8, i8* %0, i64 14
%67 = load i8, i8* %66
%68 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 6
store i8 %67, i8* %68
%69 = zext i8 %64 to i32
%70 = zext i8 %67 to i32
%71 = tail call i32 (i32, i8*, i32, i32, ...) @v_printf(i32 4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %69, i32 %70)
%72 = getelementptr inbounds i8, i8* %0, i64 7
%73 = load i8, i8* %72
%74 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 7
store i8 %73, i8* %74
%75 = getelementptr inbounds i8, i8* %0, i64 15
%76 = load i8, i8* %75
%77 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 7
store i8 %76, i8* %77
%78 = zext i8 %73 to i32
%79 = zext i8 %76 to i32
%80 = tail call i32 (i32, i8*, i32, i32, ...) @v_printf(i32 4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %78, i32 %79)
%81 = inttoptr i64 %9 to i8*
br label %82
82: ; preds = %138, %8
%83 = phi i8 [ %14, %8 ], [ %142, %138 ]
%84 = phi i8 [ %12, %8 ], [ %140, %138 ]
%85 = phi i64 [ 0, %8 ], [ %136, %138 ]
%86 = trunc i64 %85 to i32
%87 = shl nsw i64 %85, 3
%88 = shl nsw i32 %86, 3
%89 = or i32 %88, 1
%90 = tail call signext i8 @NESCombineBits(i8 zeroext %84, i8 zeroext %83, i32 7)
%91 = getelementptr inbounds i8, i8* %81, i64 %87
store i8 %90, i8* %91
%92 = sext i8 %90 to i32
%93 = tail call i32 (i32, i8*, i32, i32, ...) @v_printf(i32 4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %86, i32 7, i32 %89, i32 %92)
%94 = or i32 %88, 2
%95 = tail call signext i8 @NESCombineBits(i8 zeroext %84, i8 zeroext %83, i32 6)
%96 = or i64 %87, 1
%97 = getelementptr inbounds i8, i8* %81, i64 %96
store i8 %95, i8* %97
%98 = sext i8 %95 to i32
%99 = tail call i32 (i32, i8*, i32, i32, ...) @v_printf(i32 4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %86, i32 6, i32 %94, i32 %98)
%100 = or i32 %88, 3
%101 = tail call signext i8 @NESCombineBits(i8 zeroext %84, i8 zeroext %83, i32 5)
%102 = or i64 %87, 2
%103 = getelementptr inbounds i8, i8* %81, i64 %102
store i8 %101, i8* %103
%104 = sext i8 %101 to i32
%105 = tail call i32 (i32, i8*, i32, i32, ...) @v_printf(i32 4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %86, i32 5, i32 %100, i32 %104)
%106 = or i32 %88, 4
%107 = tail call signext i8 @NESCombineBits(i8 zeroext %84, i8 zeroext %83, i32 4)
%108 = or i64 %87, 3
%109 = getelementptr inbounds i8, i8* %81, i64 %108
store i8 %107, i8* %109
%110 = sext i8 %107 to i32
%111 = tail call i32 (i32, i8*, i32, i32, ...) @v_printf(i32 4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %86, i32 4, i32 %106, i32 %110)
%112 = or i32 %88, 5
%113 = tail call signext i8 @NESCombineBits(i8 zeroext %84, i8 zeroext %83, i32 3)
%114 = or i64 %87, 4
%115 = getelementptr inbounds i8, i8* %81, i64 %114
store i8 %113, i8* %115
%116 = sext i8 %113 to i32
%117 = tail call i32 (i32, i8*, i32, i32, ...) @v_printf(i32 4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %86, i32 3, i32 %112, i32 %116)
%118 = or i32 %88, 6
%119 = tail call signext i8 @NESCombineBits(i8 zeroext %84, i8 zeroext %83, i32 2)
%120 = or i64 %87, 5
%121 = getelementptr inbounds i8, i8* %81, i64 %120
store i8 %119, i8* %121
%122 = sext i8 %119 to i32
%123 = tail call i32 (i32, i8*, i32, i32, ...) @v_printf(i32 4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %86, i32 2, i32 %118, i32 %122)
%124 = or i32 %88, 7
%125 = tail call signext i8 @NESCombineBits(i8 zeroext %84, i8 zeroext %83, i32 1)
%126 = or i64 %87, 6
%127 = getelementptr inbounds i8, i8* %81, i64 %126
store i8 %125, i8* %127
%128 = sext i8 %125 to i32
%129 = tail call i32 (i32, i8*, i32, i32, ...) @v_printf(i32 4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %86, i32 1, i32 %124, i32 %128)
%130 = add nuw nsw i32 %88, 8
%131 = tail call signext i8 @NESCombineBits(i8 zeroext %84, i8 zeroext %83, i32 0)
%132 = or i64 %87, 7
%133 = getelementptr inbounds i8, i8* %81, i64 %132
store i8 %131, i8* %133
%134 = sext i8 %131 to i32
%135 = tail call i32 (i32, i8*, i32, i32, ...) @v_printf(i32 4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %86, i32 0, i32 %130, i32 %134)
%136 = add nuw nsw i64 %85, 1
%137 = icmp eq i64 %136, 8
br i1 %137, label %143, label %138
138: ; preds = %82
%139 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 %136
%140 = load i8, i8* %139
%141 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 %136
%142 = load i8, i8* %141
br label %82
143: ; preds = %82
%144 = tail call i32 @memcpy(i8* %1, i8* %81, i32 64)
%145 = tail call i32 @free(i8* %81)
br label %146
146: ; preds = %2, %143
%147 = phi i32 [ 1, %143 ], [ 0, %2 ]
ret i32 %147
}