#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 int /*<<< orphan*/ filename_from;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ changefileext(char *, char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ free(unsigned char *);
unsigned char *loadfile2(char *, unsigned long *);
scalar_t__ malloc(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char *filename_from, *filename_to;
  unsigned int count;
  unsigned long size;
  unsigned char *buf;
  if (argc == 1) {
    printf("pal2gpl\n");
    printf("----------------------------------\n");
    printf("usage: pal2gpl file.pal [file.gpl]\n");
    exit(0);
  } else if (argc == 3) {
    filename_from = argv[1];
    filename_to = argv[2];
  } else if (argc == 2) {
    filename_from = argv[1];
    filename_to = (char *)malloc(sizeof(filename_from) + 1);
    if (filename_to == NULL) {
      perror("malloc");
      exit(1);
    }
    strcpy(filename_to, filename_from);
    changefileext(filename_to, ".gpl");
  } else {
    printf("Too many arguments!\n");
    exit(1);
  }
  buf = loadfile2(filename_from, &size);
  if (buf == NULL)
    exit(1);
  count = size / 3;
  printf("'%s' has %d colors, file size is %li.\n", filename_from, count, size);
  FILE *des = fopen(filename_to, "wb");
  if (des == NULL) {
    perror("create file");
    exit(1);
  }
  fprintf(des, "GIMP Palette\nName: eracha\n#\n");
  unsigned int i, r, g, b;
  for (i = 0; i < size; i = i + 3) {
    r = (buf[i] << 2) | (buf[i] >> 4);
    g = (buf[i + 1] << 2) | (buf[i + 1] >> 4);
    b = (buf[i + 2] << 2) | (buf[i + 2] >> 4);
    fprintf(des, "%3d %3d %3d\n", r, g, b);
  }
  fclose(des);
  free(buf);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1201 <main+0x51>
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xor    %edi,%edi
call   10d0 <exit@plt>
cmpl   $0x3,-0x8(%rbp)
jne    1228 <main+0x78>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    12ac <main+0xfc>
cmpl   $0x2,-0x8(%rbp)
jne    128f <main+0xdf>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    $0x9,%edi
call   1090 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    126d <main+0xbd>
lea    0xdf3(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x20(%rbp),%rdi
lea    0xdd3(%rip),%rsi
call   10c0 <changefileext@plt>
jmp    12a7 <main+0xf7>
lea    0xdc7(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
jmp    12ac <main+0xfc>
jmp    12b1 <main+0x101>
mov    -0x18(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1060 <loadfile2@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    12d7 <main+0x127>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x30(%rbp),%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x30(%rbp),%rcx
lea    0xd78(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x20(%rbp),%rdi
lea    0xd8d(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1336 <main+0x186>
lea    0xd75(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x40(%rbp),%rdi
lea    0xd67(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x30(%rbp),%rax
jae    13fd <main+0x24d>
mov    -0x38(%rbp),%rax
mov    -0x44(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
shl    $0x2,%eax
mov    -0x38(%rbp),%rcx
mov    -0x44(%rbp),%edx
movzbl (%rcx,%rdx,1),%ecx
sar    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x48(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%eax
shl    $0x2,%eax
mov    -0x38(%rbp),%rcx
mov    -0x44(%rbp),%edx
add    $0x1,%edx
mov    %edx,%edx
movzbl (%rcx,%rdx,1),%ecx
sar    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x2,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%eax
shl    $0x2,%eax
mov    -0x38(%rbp),%rcx
mov    -0x44(%rbp),%edx
add    $0x2,%edx
mov    %edx,%edx
movzbl (%rcx,%rdx,1),%ecx
sar    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x50(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%edx
mov    -0x4c(%rbp),%ecx
mov    -0x50(%rbp),%r8d
lea    0xcdd(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x44(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x44(%rbp)
jmp    134f <main+0x19f>
mov    -0x40(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   10d0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x3,%edi
je     1212 <main+0x42>
cmp    $0x2,%edi
je     121c <main+0x4c>
cmp    $0x1,%edi
jne    123b <main+0x6b>
lea    0xe92(%rip),%rdi
call   1050 <puts@plt>
lea    0xe8e(%rip),%rdi
call   1050 <puts@plt>
lea    0xea5(%rip),%rdi
call   1050 <puts@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
mov    0x8(%rsi),%r15
mov    0x10(%rsi),%r14
jmp    126e <main+0x9e>
mov    0x8(%rsi),%r15
mov    $0x9,%edi
call   10a0 <malloc@plt>
test   %rax,%rax
jne    1251 <main+0x81>
lea    0xdca(%rip),%rdi
jmp    12ce <main+0xfe>
lea    0xe2a(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %r15,%rsi
call   1040 <strcpy@plt>
lea    0xda1(%rip),%rsi
mov    %r14,%rdi
call   10d0 <changefileext@plt>
mov    %rsp,%rsi
mov    %r15,%rdi
call   1070 <loadfile2@plt>
test   %rax,%rax
jne    1288 <main+0xb8>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    %rax,%r12
mov    (%rsp),%rcx
movabs $0xaaaaaaaaaaaaaaab,%rdx
aa aa aa
mov    %rcx,%rax
mul    %rdx
shr    %rdx
lea    0xd63(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xd79(%rip),%rsi
mov    %r14,%rdi
call   10b0 <fopen@plt>
test   %rax,%rax
jne    12dd <main+0x10d>
lea    0xd68(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    %rax,%r14
lea    0xd5b(%rip),%rdi
mov    $0x1c,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10f0 <fwrite@plt>
cmpq   $0x0,(%rsp)
je     1362 <main+0x192>
lea    0xd58(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
movzbl (%r12,%rbx,1),%edx
lea    0x0(,%rdx,4),%eax
shr    $0x4,%edx
or     %eax,%edx
lea    0x1(%rbx),%eax
movzbl (%r12,%rax,1),%ecx
lea    0x0(,%rcx,4),%eax
shr    $0x4,%ecx
or     %eax,%ecx
lea    0x2(%rbx),%eax
movzbl (%r12,%rax,1),%r8d
lea    0x0(,%r8,4),%eax
shr    $0x4,%r8d
or     %eax,%r8d
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
add    $0x3,%ebx
cmp    %rbx,(%rsp)
ja     1310 <main+0x140>
mov    %r14,%rdi
call   1060 <fclose@plt>
mov    %r12,%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"pal2gpl\0A\00"
@.str.1 = [36 x i8] c"----------------------------------\0A\00"
@.str.2 = [36 x i8] c"usage: pal2gpl file.pal [file.gpl]\0A\00"
@.str.3 = [7 x i8] c"malloc\00"
@.str.4 = [5 x i8] c".gpl\00"
@.str.5 = [21 x i8] c"Too many arguments!\0A\00"
@.str.6 = [39 x i8] c"'%s' has %d colors, file size is %li.\0A\00"
@.str.7 = [3 x i8] c"wb\00"
@.str.8 = [12 x i8] c"create file\00"
@.str.9 = [29 x i8] c"GIMP Palette\0AName: eracha\0A#\0A\00"
@.str.10 = [13 x i8] c"%3d %3d %3d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i32*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %23
18: ; preds = %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%22 = call i32 @exit(i32 0)
unreachable
23: ; preds = %2
%24 = load i32, i32* %4
%25 = icmp eq i32 %24, 3
br i1 %25, label %26, label %33
26: ; preds = %23
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
store i8* %29, i8** %6
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 2
%32 = load i8*, i8** %31
store i8* %32, i8** %7
br label %57
33: ; preds = %23
%34 = load i32, i32* %4
%35 = icmp eq i32 %34, 2
br i1 %35, label %36, label %53
36: ; preds = %33
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
store i8* %39, i8** %6
%40 = call i64 @malloc(i32 9)
%41 = inttoptr i64 %40 to i8*
store i8* %41, i8** %7
%42 = load i8*, i8** %7
%43 = icmp eq i8* %42, null
br i1 %43, label %44, label %47
44: ; preds = %36
%45 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%46 = call i32 @exit(i32 1)
unreachable
47: ; preds = %36
%48 = load i8*, i8** %7
%49 = load i8*, i8** %6
%50 = call i32 @strcpy(i8* %48, i8* %49)
%51 = load i8*, i8** %7
%52 = call i32 @changefileext(i8* %51, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %56
53: ; preds = %33
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
%55 = call i32 @exit(i32 1)
unreachable
56: ; preds = %47
br label %57
57: ; preds = %56, %26
br label %58
58: ; preds = %57
%59 = load i8*, i8** %6
%60 = call i8* @loadfile2(i8* %59, i64* %9)
store i8* %60, i8** %10
%61 = load i8*, i8** %10
%62 = icmp eq i8* %61, null
br i1 %62, label %63, label %65
63: ; preds = %58
%64 = call i32 @exit(i32 1)
unreachable
65: ; preds = %58
%66 = load i64, i64* %9
%67 = udiv i64 %66, 3
%68 = trunc i64 %67 to i32
store i32 %68, i32* %8
%69 = load i8*, i8** %6
%70 = load i32, i32* %8
%71 = load i64, i64* %9
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0), i8* %69, i32 %70, i64 %71)
%73 = load i8*, i8** %7
%74 = call i32* @fopen(i8* %73, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
store i32* %74, i32** %11
%75 = load i32*, i32** %11
%76 = icmp eq i32* %75, null
br i1 %76, label %77, label %80
77: ; preds = %65
%78 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
%79 = call i32 @exit(i32 1)
unreachable
80: ; preds = %65
%81 = load i32*, i32** %11
%82 = call i32 (i32*, i8*, ...) @fprintf(i32* %81, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %12
br label %83
83: ; preds = %143, %80
%84 = load i32, i32* %12
%85 = zext i32 %84 to i64
%86 = load i64, i64* %9
%87 = icmp ult i64 %85, %86
br i1 %87, label %88, label %146
88: ; preds = %83
%89 = load i8*, i8** %10
%90 = load i32, i32* %12
%91 = zext i32 %90 to i64
%92 = getelementptr inbounds i8, i8* %89, i64 %91
%93 = load i8, i8* %92
%94 = zext i8 %93 to i32
%95 = shl i32 %94, 2
%96 = load i8*, i8** %10
%97 = load i32, i32* %12
%98 = zext i32 %97 to i64
%99 = getelementptr inbounds i8, i8* %96, i64 %98
%100 = load i8, i8* %99
%101 = zext i8 %100 to i32
%102 = ashr i32 %101, 4
%103 = or i32 %95, %102
store i32 %103, i32* %13
%104 = load i8*, i8** %10
%105 = load i32, i32* %12
%106 = add i32 %105, 1
%107 = zext i32 %106 to i64
%108 = getelementptr inbounds i8, i8* %104, i64 %107
%109 = load i8, i8* %108
%110 = zext i8 %109 to i32
%111 = shl i32 %110, 2
%112 = load i8*, i8** %10
%113 = load i32, i32* %12
%114 = add i32 %113, 1
%115 = zext i32 %114 to i64
%116 = getelementptr inbounds i8, i8* %112, i64 %115
%117 = load i8, i8* %116
%118 = zext i8 %117 to i32
%119 = ashr i32 %118, 4
%120 = or i32 %111, %119
store i32 %120, i32* %14
%121 = load i8*, i8** %10
%122 = load i32, i32* %12
%123 = add i32 %122, 2
%124 = zext i32 %123 to i64
%125 = getelementptr inbounds i8, i8* %121, i64 %124
%126 = load i8, i8* %125
%127 = zext i8 %126 to i32
%128 = shl i32 %127, 2
%129 = load i8*, i8** %10
%130 = load i32, i32* %12
%131 = add i32 %130, 2
%132 = zext i32 %131 to i64
%133 = getelementptr inbounds i8, i8* %129, i64 %132
%134 = load i8, i8* %133
%135 = zext i8 %134 to i32
%136 = ashr i32 %135, 4
%137 = or i32 %128, %136
store i32 %137, i32* %15
%138 = load i32*, i32** %11
%139 = load i32, i32* %13
%140 = load i32, i32* %14
%141 = load i32, i32* %15
%142 = call i32 (i32*, i8*, ...) @fprintf(i32* %138, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i32 %139, i32 %140, i32 %141)
br label %143
143: ; preds = %88
%144 = load i32, i32* %12
%145 = add i32 %144, 3
store i32 %145, i32* %12
br label %83
146: ; preds = %83
%147 = load i32*, i32** %11
%148 = call i32 @fclose(i32* %147)
%149 = load i8*, i8** %10
%150 = call i32 @free(i8* %149)
%151 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.3 = [7 x i8] c"malloc\00"
@.str.4 = [5 x i8] c".gpl\00"
@.str.6 = [39 x i8] c"'%s' has %d colors, file size is %li.\0A\00"
@.str.7 = [3 x i8] c"wb\00"
@.str.8 = [12 x i8] c"create file\00"
@.str.9 = [29 x i8] c"GIMP Palette\0AName: eracha\0A#\0A\00"
@.str.10 = [13 x i8] c"%3d %3d %3d\0A\00"
@str = [20 x i8] c"Too many arguments!\00"
@str.11 = [8 x i8] c"pal2gpl\00"
@str.12 = [35 x i8] c"----------------------------------\00"
@str.13 = [35 x i8] c"usage: pal2gpl file.pal [file.gpl]\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
switch i32 %0, label %27 [
i32 1, label %5
i32 3, label %10
i32 2, label %15
]
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.11, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.12, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.13, i64 0, i64 0))
%9 = tail call i32 @exit(i32 0)
unreachable
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8*, i8** %1, i64 2
%14 = load i8*, i8** %13
br label %30
15: ; preds = %2
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = tail call i64 @malloc(i32 9)
%19 = inttoptr i64 %18 to i8*
%20 = icmp eq i64 %18, 0
br i1 %20, label %21, label %24
21: ; preds = %15
%22 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%23 = tail call i32 @exit(i32 1)
unreachable
24: ; preds = %15
%25 = tail call i32 @strcpy(i8* %19, i8* %17)
%26 = tail call i32 @changefileext(i8* %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %30
27: ; preds = %2
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%29 = tail call i32 @exit(i32 1)
unreachable
30: ; preds = %10, %24
%31 = phi i8* [ %14, %10 ], [ %19, %24 ]
%32 = phi i8* [ %12, %10 ], [ %17, %24 ]
%33 = call i8* @loadfile2(i8* %32, i64* %3)
%34 = icmp eq i8* %33, null
br i1 %34, label %35, label %37
35: ; preds = %30
%36 = call i32 @exit(i32 1)
unreachable
37: ; preds = %30
%38 = load i64, i64* %3
%39 = udiv i64 %38, 3
%40 = trunc i64 %39 to i32
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0), i8* %32, i32 %40, i64 %38)
%42 = call i32* @fopen(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%43 = icmp eq i32* %42, null
br i1 %43, label %44, label %47
44: ; preds = %37
%45 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
%46 = call i32 @exit(i32 1)
unreachable
47: ; preds = %37
%48 = call i64 @fwrite(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i64 0, i64 0), i64 28, i64 1, i32* %42)
%49 = load i64, i64* %3
%50 = icmp eq i64 %49, 0
br i1 %50, label %80, label %51
51: ; preds = %47, %51
%52 = phi i64 [ %77, %51 ], [ 0, %47 ]
%53 = getelementptr inbounds i8, i8* %33, i64 %52
%54 = load i8, i8* %53
%55 = zext i8 %54 to i32
%56 = shl nuw nsw i32 %55, 2
%57 = lshr i32 %55, 4
%58 = or i32 %56, %57
%59 = add nuw nsw i64 %52, 1
%60 = and i64 %59, 4294967295
%61 = getelementptr inbounds i8, i8* %33, i64 %60
%62 = load i8, i8* %61
%63 = zext i8 %62 to i32
%64 = shl nuw nsw i32 %63, 2
%65 = lshr i32 %63, 4
%66 = or i32 %64, %65
%67 = add nuw nsw i64 %52, 2
%68 = and i64 %67, 4294967295
%69 = getelementptr inbounds i8, i8* %33, i64 %68
%70 = load i8, i8* %69
%71 = zext i8 %70 to i32
%72 = shl nuw nsw i32 %71, 2
%73 = lshr i32 %71, 4
%74 = or i32 %72, %73
%75 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i32 %58, i32 %66, i32 %74)
%76 = add nuw nsw i64 %52, 3
%77 = and i64 %76, 4294967295
%78 = load i64, i64* %3
%79 = icmp ugt i64 %78, %77
br i1 %79, label %51, label %80
80: ; preds = %51, %47
%81 = call i32 @fclose(i32* %42)
%82 = call i32 @free(i8* %33)
%83 = call i32 @exit(i32 0)
unreachable
}