#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*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ exit(int);
long expand(unsigned char *, unsigned char *, long);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(unsigned char *, int, long, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(unsigned char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(unsigned char *, int, long, int /*<<< orphan*/ *);
int get_word(unsigned char *);
unsigned char *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, int);
int main(int argc, char *argv[]) {
  unsigned char *src;
  long size;
  unsigned char *dest;
  long dest_size;
  if (2 > argc) {
    exit(0);
  }
  {
    FILE *f;
    f = fopen(argv[1], "rb");
    if (NULL == f) {
      printf("t@Cª¶ÝµÜ¹ñ (%s\n", argv[1]);
      exit(1);
    }
    fseek(f, 0, SEEK_END);
    size = ftell(f);
    src = malloc(size);
    if (NULL == src) {
      fclose(f);
      printf("ðmÛÅ«Ü¹ñÅµ½ (%s\n",
             argv[1]);
      exit(1);
    }
    fseek(f, 0, SEEK_SET);
    fread(src, 1, size, f);
    fclose(f);
  }
  dest = malloc(0x10000);
  if (NULL == dest) {
    free(src);
    printf("ðmÛÅ«Ü¹ñÅµ½ (%s\n",
           argv[1]);
    exit(1);
  }
  {
    int k;
    long ofs, t_ofs, t_size;
    k = 0;
    ofs = 4;
    while (256 > ofs) {
      t_ofs = get_word(src + ofs) * 0x400;
      if (0 == t_ofs) {
        break;
      }
      if (t_ofs >= size) {
        break;
      }
      t_size = get_word(src + t_ofs);
      dest_size = expand(dest, (src + t_ofs + 2), (t_size));
      printf("%x %d %d\n", t_ofs, t_size, dest_size);
      {
        FILE *f;
        char *t;
        char t_name[64];
        t = "MUSIC.%03d";
        if (3 <= argc) {
          t = argv[2];
        }
        sprintf(t_name, t, k);
        f = fopen(t_name, "wb");
        fwrite(dest, 1, dest_size, f);
        fclose(f);
      }
      ofs += 2;
      k += 1;
    }
  }
  free(dest);
  free(src);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%eax
cmp    -0x8(%rbp),%eax
jle    11fe <main+0x2e>
xor    %edi,%edi
call   10e0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdf3(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x38(%rbp)
xor    %eax,%eax
cmp    -0x38(%rbp),%rax
jne    1242 <main+0x72>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x38(%rbp),%rdi
mov    0x2d9b(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1090 <fseek@plt>
mov    -0x38(%rbp),%rdi
call   1070 <ftell@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
jne    12a7 <main+0xd7>
mov    -0x38(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xd9c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x38(%rbp),%rdi
mov    0x2d26(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1090 <fseek@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fread@plt>
mov    -0x38(%rbp),%rdi
call   1050 <fclose@plt>
mov    $0x10000,%edi
call   1080 <malloc@plt>
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
cmp    -0x28(%rbp),%rax
jne    131d <main+0x14d>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xd26(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
movl   $0x0,-0x3c(%rbp)
movq   $0x4,-0x48(%rbp)
mov    $0x100,%eax
cmp    -0x48(%rbp),%rax
jle    1447 <main+0x277>
mov    -0x18(%rbp),%rdi
add    -0x48(%rbp),%rdi
call   10a0 <get_word@plt>
shl    $0xa,%eax
cltq
mov    %rax,-0x50(%rbp)
xor    %eax,%eax
cmp    -0x50(%rbp),%rax
jne    1362 <main+0x192>
jmp    1447 <main+0x277>
mov    -0x50(%rbp),%rax
cmp    -0x20(%rbp),%rax
jl     1375 <main+0x1a5>
jmp    1447 <main+0x277>
mov    -0x18(%rbp),%rdi
add    -0x50(%rbp),%rdi
call   10a0 <get_word@plt>
cltq
mov    %rax,-0x58(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    -0x50(%rbp),%rsi
add    $0x2,%rsi
mov    -0x58(%rbp),%rdx
call   10c0 <expand@plt>
mov    %rax,-0x30(%rbp)
mov    -0x50(%rbp),%rsi
mov    -0x58(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    0xcb7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xcb3(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    $0x3,%eax
cmp    -0x8(%rbp),%eax
jg     13e4 <main+0x214>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x68(%rbp)
lea    -0xb0(%rbp),%rdi
mov    -0x68(%rbp),%rsi
mov    -0x3c(%rbp),%edx
call   10d0 <sprintf@plt>
lea    -0xb0(%rbp),%rdi
lea    0xc7f(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x60(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    -0x60(%rbp),%rcx
mov    $0x1,%esi
call   10f0 <fwrite@plt>
mov    -0x60(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x48(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x48(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    132c <main+0x15c>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   10e0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %edi,0x14(%rsp)
cmp    $0x1,%edi
jg     11ee <main+0x1e>
xor    %edi,%edi
call   10e0 <exit@plt>
mov    %rsi,%r14
mov    0x8(%rsi),%rdi
lea    0xe04(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
jne    1216 <main+0x46>
mov    0x8(%r14),%rsi
lea    0xdf2(%rip),%rdi
jmp    12a6 <main+0xd6>
mov    %rax,%rbx
mov    0x2dc8(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1090 <fseek@plt>
mov    %rbx,%rdi
call   1070 <ftell@plt>
mov    %rax,%r15
mov    %r15d,%edi
call   1080 <malloc@plt>
test   %rax,%rax
jne    124e <main+0x7e>
mov    %rbx,%rdi
call   1050 <fclose@plt>
jmp    129b <main+0xcb>
mov    %rax,%rbp
mov    0x2d80(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1090 <fseek@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
mov    %r15,%rdx
mov    %rbx,%rcx
call   1040 <fread@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    $0x10000,%edi
call   1080 <malloc@plt>
mov    %rax,0x8(%rsp)
test   %rax,%rax
jne    12b7 <main+0xe7>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    0x8(%r14),%rsi
lea    0xd8c(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    %r14,0x18(%rsp)
mov    $0x2,%ebx
xor    %r13d,%r13d
mov    %rbp,0x28(%rsp)
mov    %r15,0x20(%rsp)
jmp    132a <main+0x15a>
lea    0x30(%rsp),%rbp
mov    %rbp,%rdi
mov    %r13d,%edx
call   10d0 <sprintf@plt>
mov    %rbp,%rdi
lea    0xd9a(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%rbp
mov    0x8(%rsp),%rdi
mov    $0x1,%esi
mov    %r15,%rdx
mov    %rax,%rcx
call   10f0 <fwrite@plt>
mov    %rbp,%rdi
call   1050 <fclose@plt>
add    $0x1,%r13d
add    $0x2,%rbx
cmp    $0xfe,%rbx
mov    0x28(%rsp),%rbp
mov    0x20(%rsp),%r15
jae    13a1 <main+0x1d1>
lea    (%rbx,%rbp,1),%rdi
add    $0x2,%rdi
call   10a0 <get_word@plt>
test   %eax,%eax
je     13a1 <main+0x1d1>
shl    $0xa,%eax
movslq %eax,%r12
cmp    %r12,%r15
jle    13a1 <main+0x1d1>
lea    (%r12,%rbp,1),%rdi
call   10a0 <get_word@plt>
movslq %eax,%r14
lea    (%r12,%rbp,1),%rsi
add    $0x2,%rsi
mov    0x8(%rsp),%rdi
mov    %r14,%rdx
call   10c0 <expand@plt>
mov    %rax,%r15
lea    0xcfe(%rip),%rdi
mov    %r12,%rsi
mov    %r14,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xcf1(%rip),%rsi
cmpl   $0x3,0x14(%rsp)
jb     12d0 <main+0x100>
mov    0x18(%rsp),%rax
mov    0x10(%rax),%rsi
jmp    12d0 <main+0x100>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
@.str.1 = [47 x i8] c"\C2\83t\C2\83@\C2\83C\C2\83\C2\8B\C2\82\C2\AA\C2\91\C2\B6\C2\8D\C3\9D\C2\82\C2\B5\C2\82\C3\9C\C2\82\C2\B9\C2\82\C3\B1 (%s\0A\00"
@SEEK_END = global i32 0
@.str.2 = [61 x i8] c"\C2\83\C2\81\C2\83\C2\82\C2\83\C2\8A\C2\82\C3\B0\C2\8Am\C2\95\C3\9B\C2\82\C3\85\C2\82\C2\AB\C2\82\C3\9C\C2\82\C2\B9\C2\82\C3\B1\C2\82\C3\85\C2\82\C2\B5\C2\82\C2\BD (%s\0A\00"
@SEEK_SET = global i32 0
@.str.3 = [10 x i8] c"%x %d %d\0A\00"
@.str.4 = [11 x i8] c"MUSIC.%03d\00"
@.str.5 = [3 x i8] c"wb\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i32*
%16 = alloca i8*
%17 = alloca [64 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = load i32, i32* %4
%19 = icmp sgt i32 2, %18
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = call i32 @exit(i32 0)
unreachable
22: ; preds = %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i32* @fopen(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %26, i32** %10
%27 = load i32*, i32** %10
%28 = icmp eq i32* null, %27
br i1 %28, label %29, label %35
29: ; preds = %22
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i8* %32)
%34 = call i32 @exit(i32 1)
unreachable
35: ; preds = %22
%36 = load i32*, i32** %10
%37 = load i32, i32* @SEEK_END
%38 = call i32 @fseek(i32* %36, i32 0, i32 %37)
%39 = load i32*, i32** %10
%40 = call i64 @ftell(i32* %39)
store i64 %40, i64* %7
%41 = load i64, i64* %7
%42 = trunc i64 %41 to i32
%43 = call i8* @malloc(i32 %42)
store i8* %43, i8** %6
%44 = load i8*, i8** %6
%45 = icmp eq i8* null, %44
br i1 %45, label %46, label %54
46: ; preds = %35
%47 = load i32*, i32** %10
%48 = call i32 @fclose(i32* %47)
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i64 1
%51 = load i8*, i8** %50
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), i8* %51)
%53 = call i32 @exit(i32 1)
unreachable
54: ; preds = %35
%55 = load i32*, i32** %10
%56 = load i32, i32* @SEEK_SET
%57 = call i32 @fseek(i32* %55, i32 0, i32 %56)
%58 = load i8*, i8** %6
%59 = load i64, i64* %7
%60 = load i32*, i32** %10
%61 = call i32 @fread(i8* %58, i32 1, i64 %59, i32* %60)
%62 = load i32*, i32** %10
%63 = call i32 @fclose(i32* %62)
%64 = call i8* @malloc(i32 65536)
store i8* %64, i8** %8
%65 = load i8*, i8** %8
%66 = icmp eq i8* null, %65
br i1 %66, label %67, label %75
67: ; preds = %54
%68 = load i8*, i8** %6
%69 = call i32 @free(i8* %68)
%70 = load i8**, i8*** %5
%71 = getelementptr inbounds i8*, i8** %70, i64 1
%72 = load i8*, i8** %71
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), i8* %72)
%74 = call i32 @exit(i32 1)
unreachable
75: ; preds = %54
store i32 0, i32* %11
store i64 4, i64* %12
br label %76
76: ; preds = %117, %75
%77 = load i64, i64* %12
%78 = icmp sgt i64 256, %77
br i1 %78, label %79, label %134
79: ; preds = %76
%80 = load i8*, i8** %6
%81 = load i64, i64* %12
%82 = getelementptr inbounds i8, i8* %80, i64 %81
%83 = call i32 @get_word(i8* %82)
%84 = mul nsw i32 %83, 1024
%85 = sext i32 %84 to i64
store i64 %85, i64* %13
%86 = load i64, i64* %13
%87 = icmp eq i64 0, %86
br i1 %87, label %88, label %89
88: ; preds = %79
br label %134
89: ; preds = %79
%90 = load i64, i64* %13
%91 = load i64, i64* %7
%92 = icmp sge i64 %90, %91
br i1 %92, label %93, label %94
93: ; preds = %89
br label %134
94: ; preds = %89
%95 = load i8*, i8** %6
%96 = load i64, i64* %13
%97 = getelementptr inbounds i8, i8* %95, i64 %96
%98 = call i32 @get_word(i8* %97)
%99 = sext i32 %98 to i64
store i64 %99, i64* %14
%100 = load i8*, i8** %8
%101 = load i8*, i8** %6
%102 = load i64, i64* %13
%103 = getelementptr inbounds i8, i8* %101, i64 %102
%104 = getelementptr inbounds i8, i8* %103, i64 2
%105 = load i64, i64* %14
%106 = call i64 @expand(i8* %100, i8* %104, i64 %105)
store i64 %106, i64* %9
%107 = load i64, i64* %13
%108 = load i64, i64* %14
%109 = load i64, i64* %9
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i64 %107, i64 %108, i64 %109)
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8** %16
%111 = load i32, i32* %4
%112 = icmp sle i32 3, %111
br i1 %112, label %113, label %117
113: ; preds = %94
%114 = load i8**, i8*** %5
%115 = getelementptr inbounds i8*, i8** %114, i64 2
%116 = load i8*, i8** %115
store i8* %116, i8** %16
br label %117
117: ; preds = %113, %94
%118 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%119 = load i8*, i8** %16
%120 = load i32, i32* %11
%121 = call i32 @sprintf(i8* %118, i8* %119, i32 %120)
%122 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%123 = call i32* @fopen(i8* %122, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
store i32* %123, i32** %15
%124 = load i8*, i8** %8
%125 = load i64, i64* %9
%126 = load i32*, i32** %15
%127 = call i32 @fwrite(i8* %124, i32 1, i64 %125, i32* %126)
%128 = load i32*, i32** %15
%129 = call i32 @fclose(i32* %128)
%130 = load i64, i64* %12
%131 = add nsw i64 %130, 2
store i64 %131, i64* %12
%132 = load i32, i32* %11
%133 = add nsw i32 %132, 1
store i32 %133, i32* %11
br label %76
134: ; preds = %93, %88, %76
%135 = load i8*, i8** %8
%136 = call i32 @free(i8* %135)
%137 = load i8*, i8** %6
%138 = call i32 @free(i8* %137)
%139 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
@.str.1 = [47 x i8] c"\C2\83t\C2\83@\C2\83C\C2\83\C2\8B\C2\82\C2\AA\C2\91\C2\B6\C2\8D\C3\9D\C2\82\C2\B5\C2\82\C3\9C\C2\82\C2\B9\C2\82\C3\B1 (%s\0A\00"
@SEEK_END = global i32 0
@.str.2 = [61 x i8] c"\C2\83\C2\81\C2\83\C2\82\C2\83\C2\8A\C2\82\C3\B0\C2\8Am\C2\95\C3\9B\C2\82\C3\85\C2\82\C2\AB\C2\82\C3\9C\C2\82\C2\B9\C2\82\C3\B1\C2\82\C3\85\C2\82\C2\B5\C2\82\C2\BD (%s\0A\00"
@SEEK_SET = global i32 0
@.str.3 = [10 x i8] c"%x %d %d\0A\00"
@.str.4 = [11 x i8] c"MUSIC.%03d\00"
@.str.5 = [3 x i8] c"wb\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [64 x i8]
%4 = icmp slt i32 %0, 2
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32* @fopen(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %16
12: ; preds = %7
%13 = load i8*, i8** %8
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = tail call i32 @exit(i32 1)
unreachable
16: ; preds = %7
%17 = load i32, i32* @SEEK_END
%18 = tail call i32 @fseek(i32* %10, i32 0, i32 %17)
%19 = tail call i64 @ftell(i32* %10)
%20 = trunc i64 %19 to i32
%21 = tail call i8* @malloc(i32 %20)
%22 = icmp eq i8* %21, null
br i1 %22, label %23, label %28
23: ; preds = %16
%24 = tail call i32 @fclose(i32* %10)
%25 = load i8*, i8** %8
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), i8* %25)
%27 = tail call i32 @exit(i32 1)
unreachable
28: ; preds = %16
%29 = load i32, i32* @SEEK_SET
%30 = tail call i32 @fseek(i32* %10, i32 0, i32 %29)
%31 = tail call i32 @fread(i8* %21, i32 1, i64 %19, i32* %10)
%32 = tail call i32 @fclose(i32* %10)
%33 = tail call dereferenceable_or_null(65536) i8* @malloc(i32 65536)
%34 = icmp eq i8* %33, null
br i1 %34, label %39, label %35
35: ; preds = %28
%36 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%37 = icmp ugt i32 %0, 2
%38 = getelementptr inbounds i8*, i8** %1, i64 2
br label %44
39: ; preds = %28
%40 = tail call i32 @free(i8* %21)
%41 = load i8*, i8** %8
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), i8* %41)
%43 = tail call i32 @exit(i32 1)
unreachable
44: ; preds = %35, %63
%45 = phi i32 [ 0, %35 ], [ %70, %63 ]
%46 = phi i64 [ 4, %35 ], [ %69, %63 ]
%47 = getelementptr inbounds i8, i8* %21, i64 %46
%48 = tail call i32 @get_word(i8* %47)
%49 = shl nsw i32 %48, 10
%50 = sext i32 %49 to i64
%51 = icmp ne i32 %48, 0
%52 = icmp sgt i64 %19, %50
%53 = select i1 %51, i1 %52, i1 false
br i1 %53, label %54, label %72
54: ; preds = %44
%55 = getelementptr inbounds i8, i8* %21, i64 %50
%56 = tail call i32 @get_word(i8* %55)
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8, i8* %55, i64 2
%59 = tail call i64 @expand(i8* %33, i8* %58, i64 %57)
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i64 %50, i64 %57, i64 %59)
br i1 %37, label %61, label %63
61: ; preds = %54
%62 = load i8*, i8** %38
br label %63
63: ; preds = %61, %54
%64 = phi i8* [ %62, %61 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), %54 ]
%65 = call i32 @sprintf(i8* %36, i8* dereferenceable(1) %64, i32 %45)
%66 = call i32* @fopen(i8* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%67 = tail call i32 @fwrite(i8* %33, i32 1, i64 %59, i32* %66)
%68 = tail call i32 @fclose(i32* %66)
%69 = add nuw nsw i64 %46, 2
%70 = add nuw nsw i32 %45, 1
%71 = icmp ult i64 %46, 254
br i1 %71, label %44, label %72
72: ; preds = %44, %63
%73 = tail call i32 @free(i8* %33)
%74 = tail call i32 @free(i8* %21)
%75 = tail call i32 @exit(i32 0)
unreachable
}