#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(unsigned short *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, unsigned short *);
main(int argc, char **argv) {
  FILE *fpin, *fpout;
  char inny[10];
  unsigned short outy[2048], *pouty;
  int i = 0, j, k;
  if (argc != 3) {
    printf("Invalid argument count\n");
    exit(-1);
  }
  if ((fpin = fopen(argv[1], "r")) == NULL) {
    printf("Cannot open %s for reading \n", argv[1]);
    exit(-1);
  }
  if ((fpout = fopen(argv[2], "wb")) == NULL) {
    printf("Cannot open %s for writing\n", argv[2]);
    exit(-1);
  }
  printf("Starting into the file\n");
  pouty = outy;
  pouty++;
  i++;
  fgets(inny, 10, fpin);
  sscanf(inny, "%04x\n", pouty);
  pouty++;
  i++;
  for (j = 0; j < 12; j++) {
    for (k = 0; k < 43; k++) {
      fgets(inny, 10, fpin);
      sscanf(inny, "%04x\n", pouty);
      pouty++;
      i++;
    }
  }
  outy[0] = i - 1;
  fwrite(outy, 2, i, fpout);
  fclose(fpin);
  fclose(fpout);
  printf("Wrote %d bytes, last value = 0x%04X\n", i * 2, pouty[i - 2]);
  for (j = 0; j < 1 + (12 * 43 + 2) / 8; j++) {
    printf("%04X:", j * 16);
    for (k = 0; k < 8; k++) {
      printf(" %04x", outy[j * 8 + k]);
    }
    printf("\n");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1050,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x103c(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11b5 <main+0x45>
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe54(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    11f7 <main+0x87>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe31(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1239 <main+0xc9>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x1030(%rbp),%rax
mov    %rax,-0x1038(%rbp)
mov    -0x1038(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x1038(%rbp)
mov    -0x103c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x103c(%rbp)
lea    -0x2a(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0xa,%esi
call   1050 <fgets@plt>
lea    -0x2a(%rbp),%rdi
mov    -0x1038(%rbp),%rdx
lea    0xdd4(%rip),%rsi
call   1060 <sscanf@plt>
mov    -0x1038(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x1038(%rbp)
mov    -0x103c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x103c(%rbp)
movl   $0x0,-0x1040(%rbp)
cmpl   $0xc,-0x1040(%rbp)
jge    1365 <main+0x1f5>
movl   $0x0,-0x1044(%rbp)
cmpl   $0x2b,-0x1044(%rbp)
jge    134c <main+0x1dc>
lea    -0x2a(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0xa,%esi
call   1050 <fgets@plt>
lea    -0x2a(%rbp),%rdi
mov    -0x1038(%rbp),%rdx
lea    0xd5c(%rip),%rsi
call   1060 <sscanf@plt>
mov    -0x1038(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x1038(%rbp)
mov    -0x103c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x103c(%rbp)
mov    -0x1044(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1044(%rbp)
jmp    12e1 <main+0x171>
jmp    1351 <main+0x1e1>
mov    -0x1040(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1040(%rbp)
jmp    12ca <main+0x15a>
mov    -0x103c(%rbp),%eax
sub    $0x1,%eax
mov    %ax,-0x1030(%rbp)
lea    -0x1030(%rbp),%rdi
mov    -0x103c(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x2,%esi
call   1090 <fwrite@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x103c(%rbp),%esi
shl    $0x1,%esi
mov    -0x1038(%rbp),%rax
mov    -0x103c(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movzwl (%rax,%rcx,2),%edx
lea    0xcab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x1040(%rbp)
cmpl   $0x41,-0x1040(%rbp)
jge    1472 <main+0x302>
mov    -0x1040(%rbp),%esi
shl    $0x4,%esi
lea    0xca2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x1044(%rbp)
cmpl   $0x8,-0x1044(%rbp)
jge    1450 <main+0x2e0>
mov    -0x1040(%rbp),%eax
shl    $0x3,%eax
add    -0x1044(%rbp),%eax
cltq
movzwl -0x1030(%rbp,%rax,2),%esi
ff
lea    0xc6a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1044(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1044(%rbp)
jmp    1408 <main+0x298>
lea    0xbde(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1040(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1040(%rbp)
jmp    13da <main+0x26a>
lea    0xbbc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1050,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1028,%rsp
cmp    $0x3,%edi
jne    139d <main+0x20d>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xe48(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     13b3 <main+0x223>
mov    %rax,%r15
mov    0x10(%rbx),%rdi
lea    0xe4b(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,(%rsp)
test   %rax,%rax
je     13c0 <main+0x230>
lea    0xe88(%rip),%rdi
call   1040 <puts@plt>
lea    0x22(%rsp),%rbx
lea    0x16(%rsp),%r13
mov    %r13,%rdi
mov    $0xa,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
lea    0xe2b(%rip),%r12
mov    %r13,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1080 <sscanf@plt>
xor    %ecx,%ecx
lea    0x24(%rsp),%rax
nopl   0x0(%rax,%rax,1)
mov    %rcx,0x8(%rsp)
mov    %rax,%rbp
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
lea    (%r14,%rbp,1),%rbx
mov    %r13,%rdi
mov    $0xa,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
mov    %r13,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1080 <sscanf@plt>
add    $0x2,%r14
cmp    $0x56,%r14d
jne    1240 <main+0xb0>
mov    0x8(%rsp),%rcx
add    $0x1,%ecx
lea    (%r14,%rbp,1),%rax
cmp    $0xc,%ecx
jne    1230 <main+0xa0>
movw   $0x205,0x20(%rsp)
lea    0x20(%rsp),%rdi
mov    $0x2,%esi
mov    $0x206,%edx
mov    (%rsp),%rbx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
mov    %r15,%rdi
call   1050 <fclose@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
movzwl 0x408(%rbp,%r14,1),%edx
lea    0xd85(%rip),%rdi
mov    $0x40c,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd97(%rip),%r14
lea    0xd96(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
movzwl 0x20(%rsp,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzwl 0x22(%rsp,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzwl 0x24(%rsp,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzwl 0x26(%rsp,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzwl 0x28(%rsp,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzwl 0x2a(%rsp,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzwl 0x2c(%rsp,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzwl 0x2e(%rsp,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rbx
cmp    $0x410,%rbx
jne    12e0 <main+0x150>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x1028,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xce8(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%edi
call   10a0 <exit@plt>
mov    0x8(%rbx),%rsi
lea    0xc44(%rip),%rdi
jmp    13cb <main+0x23b>
mov    0x10(%rbx),%rsi
lea    0xc57(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xffffffff,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Invalid argument count\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [29 x i8] c"Cannot open %s for reading \0A\00"
@.str.3 = [3 x i8] c"wb\00"
@.str.4 = [28 x i8] c"Cannot open %s for writing\0A\00"
@.str.5 = [24 x i8] c"Starting into the file\0A\00"
@.str.6 = [6 x i8] c"%04x\0A\00"
@.str.7 = [37 x i8] c"Wrote %d bytes, last value = 0x%04X\0A\00"
@.str.8 = [6 x i8] c"%04X:\00"
@.str.9 = [6 x i8] c" %04x\00"
@.str.10 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca [10 x i8]
%9 = alloca [2048 x i16]
%10 = alloca i16*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %11
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 3
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @exit(i32 -1)
unreachable
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32* @fopen(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %23, i32** %6
%24 = icmp eq i32* %23, null
br i1 %24, label %25, label %31
25: ; preds = %19
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %28)
%30 = call i32 @exit(i32 -1)
unreachable
31: ; preds = %19
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 2
%34 = load i8*, i8** %33
%35 = call i32* @fopen(i8* %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %35, i32** %7
%36 = icmp eq i32* %35, null
br i1 %36, label %37, label %43
37: ; preds = %31
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 2
%40 = load i8*, i8** %39
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i8* %40)
%42 = call i32 @exit(i32 -1)
unreachable
43: ; preds = %31
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%45 = getelementptr inbounds [2048 x i16], [2048 x i16]* %9, i64 0, i64 0
store i16* %45, i16** %10
%46 = load i16*, i16** %10
%47 = getelementptr inbounds i16, i16* %46, i32 1
store i16* %47, i16** %10
%48 = load i32, i32* %11
%49 = add nsw i32 %48, 1
store i32 %49, i32* %11
%50 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%51 = load i32*, i32** %6
%52 = call i32 @fgets(i8* %50, i32 10, i32* %51)
%53 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%54 = load i16*, i16** %10
%55 = call i32 @sscanf(i8* %53, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i16* %54)
%56 = load i16*, i16** %10
%57 = getelementptr inbounds i16, i16* %56, i32 1
store i16* %57, i16** %10
%58 = load i32, i32* %11
%59 = add nsw i32 %58, 1
store i32 %59, i32* %11
store i32 0, i32* %12
br label %60
60: ; preds = %82, %43
%61 = load i32, i32* %12
%62 = icmp slt i32 %61, 12
br i1 %62, label %63, label %85
63: ; preds = %60
store i32 0, i32* %13
br label %64
64: ; preds = %78, %63
%65 = load i32, i32* %13
%66 = icmp slt i32 %65, 43
br i1 %66, label %67, label %81
67: ; preds = %64
%68 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%69 = load i32*, i32** %6
%70 = call i32 @fgets(i8* %68, i32 10, i32* %69)
%71 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%72 = load i16*, i16** %10
%73 = call i32 @sscanf(i8* %71, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i16* %72)
%74 = load i16*, i16** %10
%75 = getelementptr inbounds i16, i16* %74, i32 1
store i16* %75, i16** %10
%76 = load i32, i32* %11
%77 = add nsw i32 %76, 1
store i32 %77, i32* %11
br label %78
78: ; preds = %67
%79 = load i32, i32* %13
%80 = add nsw i32 %79, 1
store i32 %80, i32* %13
br label %64
81: ; preds = %64
br label %82
82: ; preds = %81
%83 = load i32, i32* %12
%84 = add nsw i32 %83, 1
store i32 %84, i32* %12
br label %60
85: ; preds = %60
%86 = load i32, i32* %11
%87 = sub nsw i32 %86, 1
%88 = trunc i32 %87 to i16
%89 = getelementptr inbounds [2048 x i16], [2048 x i16]* %9, i64 0, i64 0
store i16 %88, i16* %89
%90 = getelementptr inbounds [2048 x i16], [2048 x i16]* %9, i64 0, i64 0
%91 = load i32, i32* %11
%92 = load i32*, i32** %7
%93 = call i32 @fwrite(i16* %90, i32 2, i32 %91, i32* %92)
%94 = load i32*, i32** %6
%95 = call i32 @fclose(i32* %94)
%96 = load i32*, i32** %7
%97 = call i32 @fclose(i32* %96)
%98 = load i32, i32* %11
%99 = mul nsw i32 %98, 2
%100 = load i16*, i16** %10
%101 = load i32, i32* %11
%102 = sub nsw i32 %101, 2
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i16, i16* %100, i64 %103
%105 = load i16, i16* %104
%106 = zext i16 %105 to i32
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i32 %99, i32 %106)
store i32 0, i32* %12
br label %108
108: ; preds = %133, %85
%109 = load i32, i32* %12
%110 = icmp slt i32 %109, 65
br i1 %110, label %111, label %136
111: ; preds = %108
%112 = load i32, i32* %12
%113 = mul nsw i32 %112, 16
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32 %113)
store i32 0, i32* %13
br label %115
115: ; preds = %128, %111
%116 = load i32, i32* %13
%117 = icmp slt i32 %116, 8
br i1 %117, label %118, label %131
118: ; preds = %115
%119 = load i32, i32* %12
%120 = mul nsw i32 %119, 8
%121 = load i32, i32* %13
%122 = add nsw i32 %120, %121
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds [2048 x i16], [2048 x i16]* %9, i64 0, i64 %123
%125 = load i16, i16* %124
%126 = zext i16 %125 to i32
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 %126)
br label %128
128: ; preds = %118
%129 = load i32, i32* %13
%130 = add nsw i32 %129, 1
store i32 %130, i32* %13
br label %115
131: ; preds = %115
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %133
133: ; preds = %131
%134 = load i32, i32* %12
%135 = add nsw i32 %134, 1
store i32 %135, i32* %12
br label %108
136: ; preds = %108
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%138 = load i32, i32* %3
ret i32 %138
}

LLVM IR (-O2):
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [29 x i8] c"Cannot open %s for reading \0A\00"
@.str.3 = [3 x i8] c"wb\00"
@.str.4 = [28 x i8] c"Cannot open %s for writing\0A\00"
@.str.6 = [6 x i8] c"%04x\0A\00"
@.str.7 = [37 x i8] c"Wrote %d bytes, last value = 0x%04X\0A\00"
@.str.8 = [6 x i8] c"%04X:\00"
@.str.9 = [6 x i8] c" %04x\00"
@str = [23 x i8] c"Starting into the file\00"
@str.11 = [23 x i8] c"Invalid argument count\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [10 x i8]
%4 = alloca [2048 x i16]
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%6 = bitcast [2048 x i16]* %4 to i8*
%7 = icmp eq i32 %0, 3
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.11, i64 0, i64 0))
%10 = tail call i32 @exit(i32 -1)
unreachable
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32* @fopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %20
16: ; preds = %11
%17 = load i8*, i8** %12
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %17)
%19 = tail call i32 @exit(i32 -1)
unreachable
20: ; preds = %11
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = tail call i32* @fopen(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp eq i32* %23, null
br i1 %24, label %25, label %29
25: ; preds = %20
%26 = load i8*, i8** %21
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i8* %26)
%28 = tail call i32 @exit(i32 -1)
unreachable
29: ; preds = %20
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%31 = getelementptr inbounds [2048 x i16], [2048 x i16]* %4, i64 0, i64 1
%32 = call i32 @fgets(i8* %5, i32 10, i32* %14)
%33 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i16* %31)
%34 = getelementptr inbounds [2048 x i16], [2048 x i16]* %4, i64 0, i64 2
br label %35
35: ; preds = %29, %48
%36 = phi i32 [ 45, %29 ], [ %51, %48 ]
%37 = phi i32 [ 0, %29 ], [ %50, %48 ]
%38 = phi i32 [ 2, %29 ], [ %49, %48 ]
%39 = phi i16* [ %34, %29 ], [ %45, %48 ]
br label %40
40: ; preds = %35, %40
%41 = phi i32 [ %38, %35 ], [ %46, %40 ]
%42 = phi i16* [ %39, %35 ], [ %45, %40 ]
%43 = call i32 @fgets(i8* %5, i32 10, i32* %14)
%44 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i16* %42)
%45 = getelementptr inbounds i16, i16* %42, i64 1
%46 = add nuw nsw i32 %41, 1
%47 = icmp eq i32 %46, %36
br i1 %47, label %48, label %40
48: ; preds = %40
%49 = add nuw nsw i32 %38, 43
%50 = add nuw nsw i32 %37, 1
%51 = add nuw nsw i32 %36, 43
%52 = icmp eq i32 %50, 12
br i1 %52, label %53, label %35
53: ; preds = %48
%54 = getelementptr inbounds [2048 x i16], [2048 x i16]* %4, i64 0, i64 0
store i16 517, i16* %54
%55 = call i32 @fwrite(i16* %54, i32 2, i32 518, i32* %23)
%56 = call i32 @fclose(i32* %14)
%57 = call i32 @fclose(i32* %23)
%58 = getelementptr inbounds i16, i16* %42, i64 517
%59 = load i16, i16* %58
%60 = zext i16 %59 to i32
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i32 1036, i32 %60)
br label %62
62: ; preds = %53, %62
%63 = phi i64 [ 0, %53 ], [ %108, %62 ]
%64 = trunc i64 %63 to i32
%65 = shl i32 %64, 4
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32 %65)
%67 = shl nsw i64 %63, 3
%68 = getelementptr inbounds [2048 x i16], [2048 x i16]* %4, i64 0, i64 %67
%69 = load i16, i16* %68
%70 = zext i16 %69 to i32
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 %70)
%72 = or i64 %67, 1
%73 = getelementptr inbounds [2048 x i16], [2048 x i16]* %4, i64 0, i64 %72
%74 = load i16, i16* %73
%75 = zext i16 %74 to i32
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 %75)
%77 = or i64 %67, 2
%78 = getelementptr inbounds [2048 x i16], [2048 x i16]* %4, i64 0, i64 %77
%79 = load i16, i16* %78
%80 = zext i16 %79 to i32
%81 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 %80)
%82 = or i64 %67, 3
%83 = getelementptr inbounds [2048 x i16], [2048 x i16]* %4, i64 0, i64 %82
%84 = load i16, i16* %83
%85 = zext i16 %84 to i32
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 %85)
%87 = or i64 %67, 4
%88 = getelementptr inbounds [2048 x i16], [2048 x i16]* %4, i64 0, i64 %87
%89 = load i16, i16* %88
%90 = zext i16 %89 to i32
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 %90)
%92 = or i64 %67, 5
%93 = getelementptr inbounds [2048 x i16], [2048 x i16]* %4, i64 0, i64 %92
%94 = load i16, i16* %93
%95 = zext i16 %94 to i32
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 %95)
%97 = or i64 %67, 6
%98 = getelementptr inbounds [2048 x i16], [2048 x i16]* %4, i64 0, i64 %97
%99 = load i16, i16* %98
%100 = zext i16 %99 to i32
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 %100)
%102 = or i64 %67, 7
%103 = getelementptr inbounds [2048 x i16], [2048 x i16]* %4, i64 0, i64 %102
%104 = load i16, i16* %103
%105 = zext i16 %104 to i32
%106 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 %105)
%107 = call i32 @putchar(i32 10)
%108 = add nuw nsw i64 %63, 1
%109 = icmp eq i64 %108, 65
br i1 %109, label %110, label %62
110: ; preds = %62
%111 = call i32 @putchar(i32 10)
ret i32 0
}