// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/teksmk.c
// Function: smkplayseq
int
smkplayseq(char *name)
{
     char path[BMAX_PATH], result = SMK_DONE;
     int fh, flen, i, ret = 0;

     unsigned char smkpal[NUMSMKTILES][768], smkchannels[7], smkbitdepth[7], *smkbuf = NULL;
     unsigned char *smkframes = NULL;
     unsigned long smkx, smky, smkaudrate[7];

     unsigned long playframe, decodeframe;
     double usf, clocktime, nowtime;
     int voice = -1, frame;

     snprintf(path, sizeof(path), "smk/%s.smk", name);
     if ((fh = kopen4load(path, 0)) < 0) {
          snprintf(path, sizeof(path), "%s.smk", name);
          fh = kopen4load(path, 0);
     }
     if (fh < 0) {
          debugprintf("smkplayseq(\"%s\") failed\n", name);
          return -1;
     }

     flen = kfilelength(fh);
     smkbuf = (unsigned char *)malloc(flen);
     if (smkbuf == NULL) {
          kclose(fh);
          debugprintf("smkplayseq(\"%s\") malloc of %d bytes failed\n", name, flen);
          return -1;
     }

     kread(fh, smkbuf, flen);
     kclose(fh);

     smkseq = smk_open_memory(smkbuf, flen);
     if (!smkseq) {
          free(smkbuf);
          debugprintf("smk_open_memory() returned null\n");
          return -1;
     }

     smk_enable_all(smkseq, SMK_VIDEO_TRACK | SMK_AUDIO_TRACK_0);
     smk_info_all(smkseq, NULL, NULL, &usf);
     smk_info_video(smkseq, &smkx, &smky, NULL);
     smk_info_audio(smkseq, NULL, smkchannels, smkbitdepth, smkaudrate);
     if (smkbitdepth[0] != 8 || smkchannels[0] > 2) {
          debugprintf("smkplayseq(\"%s\") is not 8-bit mono/stereo audio\n", name);
          ret = -1;
          goto end;
     }

     // Smacker frames are decoded linewise, but BUILD expects its
     // tiles columnwise, so we will treat the tile as though it's
     // rotated 90 degrees and flipped horizontally.

     smkframes = malloc(NUMSMKTILES * smkx*smky);
     if (!smkframes) {
          debugprintf("smkplayseq(\"%s\") malloc of frames failed\n", name);
          ret = -1;
          goto end;
     }
     for (i = 0; i < NUMSMKTILES; i++) {
          tilesizx[SMKPICNUM0+i] = smky;
          tilesizy[SMKPICNUM0+i] = smkx;
          waloff[SMKPICNUM0+i] = (intptr_t)&smkframes[i*smkx*smky];
     }

     smkaudiowrite = smkaudioread = 0;
     decodeframe = playframe = 0;
     result = smk_first(smkseq);

     while (result == SMK_MORE || (playframe < decodeframe && result == SMK_LAST)) {
          while (decodeframe - playframe < NUMSMKTILES && result == SMK_MORE) {
               unsigned long audiolen, slice, downsamp;
               const unsigned char *audiodata, *palptr;

               frame = decodeframe % NUMSMKTILES;
               memcpy(&smkframes[frame*smkx*smky], smk_get_video(smkseq), smkx*smky);
               for (palptr = smk_get_palette(smkseq), i=256*3-1; i>=0; i--)
                   smkpal[frame][i] = palptr[i] >> 2;

               audiolen = smk_get_audio_size(smkseq, 0);
               audiodata = smk_get_audio(smkseq, 0);
               if (smkchannels[0] == 2) audiolen >>= 1;     // Stereo is downmixed for JFAudiolib.
               while (audiolen > 0) {
                    if (smkaudiowrite + audiolen > SMKAUDIOBUFSZ) {
                         slice = SMKAUDIOBUFSZ - smkaudiowrite;
                    } else {
                         slice = audiolen;
                    }
                    if (smkchannels[0] == 2) {
                         downsamp = slice - 1;
                         do { smkaudiobuf[smkaudiowrite+downsamp] =
                              (audiodata[(downsamp<<1)+0] >> 1) +
                              (audiodata[(downsamp<<1)+1] >> 1);
                         } while (downsamp--);
                    } else {
                         memcpy(&smkaudiobuf[smkaudiowrite], audiodata, slice);
                    }
                    audiodata += slice * smkchannels[0];
                    audiolen -= slice;
                    smkaudiowrite = (smkaudiowrite + slice) % SMKAUDIOBUFSZ;
               }

               decodeframe++;
               result = smk_next(smkseq);
               if (result == SMK_ERROR) {
                    ret = -1;
                    goto end;
               }
          }

          nowtime = (double)getusecticks();

          if (voice < 0) {
               voice = FX_StartDemandFeedPlayback(smkplayfeeder, (int)smkaudrate[0],
                    0, 63, 63, 63, 1, (unsigned int)-1);
               if (voice < 0) {
                    debugprintf("smkplayseq(\"%s\") failed to start audio playback\n", name);
                    ret = -1;
                    goto end;
               }

               clocktime = nowtime;
          }

          while (nowtime - clocktime >= usf) clocktime += usf, playframe++;
          frame = playframe % NUMSMKTILES;

          setbrightness(-1, smkpal[frame], 2|4);
#if USE_POLYMOST && USE_OPENGL
          invalidatetile(SMKPICNUM0+frame, 0, -1);
#endif
          clearallviews(0);
          rotatesprite(160<<16, 100<<16, divscale16(200, tilesizx[SMKPICNUM0+frame]),
                      512, SMKPICNUM0+frame, 0, 0, 2+4+64, 0, 0, xdim-1, ydim-1);
          nextpage();

          handleevents();
          if (keystatus[0x1]|keystatus[0x1c]|keystatus[0x39]|keystatus[0x9c]) {
               keystatus[0x1]=keystatus[0x1c]=keystatus[0x39]=keystatus[0x9c]=0;
               ret = 1;
               break;
          }
          if (!FX_SoundActive(voice)) { // If the audio stops for some reason.
               break;
          }
     }

end:
     if (result == SMK_ERROR) debugprintf("smkplayseq(\"%s\") error at decodeframe %lud (%d)\n", name, decodeframe, result);
     if (voice >= 0) FX_StopSound(voice);
     if (smkseq) smk_close(smkseq);
     smkseq = NULL;
     if (smkbuf) free(smkbuf);

     for (i = 0; i < NUMSMKTILES; i++) waloff[SMKPICNUM0+i] = 0;
     if (smkframes) free(smkframes);

     return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe40, %rsp            # imm = 0xE40
movq %rdi, -0x10(%rbp)
movb $0x0, -0x411(%rbp)
movl $0x0, -0x424(%rbp)
movq $0x0, -0xd48(%rbp)
movq $0x0, -0xd50(%rbp)
movl $0xffffffff, -0xdcc(%rbp) # imm = 0xFFFFFFFF
leaq -0x410(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl $0x400, %esi            # imm = 0x400
leaq 0xb46cf(%rip), %rdx     # 0xd9e26
movb $0x0, %al
callq 0x86a0
leaq -0x410(%rbp), %rdi
xorl %esi, %esi
callq 0x4d470
movl %eax, -0x418(%rbp)
cmpl $0x0, %eax
jge 0x257a9
leaq -0x410(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl $0x400, %esi            # imm = 0x400
leaq 0xb469c(%rip), %rdx     # 0xd9e2a
movb $0x0, %al
callq 0x86a0
leaq -0x410(%rbp), %rdi
xorl %esi, %esi
callq 0x4d470
movl %eax, -0x418(%rbp)
cmpl $0x0, -0x418(%rbp)
jge 0x257d0
movq -0x10(%rbp), %rsi
leaq 0xb4674(%rip), %rdi     # 0xd9e31
movb $0x0, %al
callq 0xc23f0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x260f1
movl -0x418(%rbp), %edi
callq 0x4dce0
movl %eax, -0x41c(%rbp)
movslq -0x41c(%rbp), %rdi
callq 0x8ca0
movq %rax, -0xd48(%rbp)
cmpq $0x0, -0xd48(%rbp)
jne 0x2582d
movl -0x418(%rbp), %edi
callq 0x4def0
movq -0x10(%rbp), %rsi
movl -0x41c(%rbp), %edx
leaq 0xb4630(%rip), %rdi     # 0xd9e4a
movb $0x0, %al
callq 0xc23f0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x260f1
movl -0x418(%rbp), %edi
movq -0xd48(%rbp), %rsi
movl -0x41c(%rbp), %edx
callq 0x4d840
movl -0x418(%rbp), %edi
callq 0x4def0
movq -0xd48(%rbp), %rdi
movslq -0x41c(%rbp), %rsi
callq 0x44a80
movq %rax, 0x244986(%rip)    # 0x26a1f0
cmpq $0x0, 0x24497e(%rip)    # 0x26a1f0
jne 0x2589a
movq -0xd48(%rbp), %rdi
callq 0x8260
leaq 0xb45ef(%rip), %rdi     # 0xd9e76
movb $0x0, %al
callq 0xc23f0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x260f1
movq 0x24494f(%rip), %rdi    # 0x26a1f0
movl $0x81, %esi
callq 0x46b20
movq 0x24493e(%rip), %rdi    # 0x26a1f0
xorl %eax, %eax
movl %eax, %edx
leaq -0xdb8(%rbp), %rcx
movq %rdx, %rsi
callq 0x467c0
movq 0x244924(%rip), %rdi    # 0x26a1f0
leaq -0xd58(%rbp), %rsi
leaq -0xd60(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x46890
movq 0x244906(%rip), %rdi    # 0x26a1f0
leaq -0xd37(%rbp), %rdx
leaq -0xd3e(%rbp), %rcx
leaq -0xda0(%rbp), %r8
xorl %eax, %eax
movl %eax, %esi
callq 0x46950
movzbl -0xd3e(%rbp), %eax
cmpl $0x8, %eax
jne 0x25920
movzbl -0xd37(%rbp), %eax
cmpl $0x2, %eax
jle 0x25941
movq -0x10(%rbp), %rsi
leaq 0xb456c(%rip), %rdi     # 0xd9e97
movb $0x0, %al
callq 0xc23f0
movl $0xffffffff, -0x424(%rbp) # imm = 0xFFFFFFFF
jmp 0x2601a
imulq $0x3, -0xd58(%rbp), %rdi
imulq -0xd60(%rbp), %rdi
callq 0x8ca0
movq %rax, -0xd50(%rbp)
cmpq $0x0, -0xd50(%rbp)
jne 0x25988
movq -0x10(%rbp), %rsi
leaq 0xb4556(%rip), %rdi     # 0xd9ec8
movb $0x0, %al
callq 0xc23f0
movl $0xffffffff, -0x424(%rbp) # imm = 0xFFFFFFFF
jmp 0x2601a
movl $0x0, -0x420(%rbp)
cmpl $0x3, -0x420(%rbp)
jge 0x25a33
movq -0xd60(%rbp), %rax
movw %ax, %dx
movl -0x420(%rbp), %eax
addl $0x23fd, %eax           # imm = 0x23FD
movslq %eax, %rcx
leaq 0x5e2692(%rip), %rax    # 0x608050
movw %dx, (%rax,%rcx,2)
movq -0xd58(%rbp), %rax
movw %ax, %dx
movl -0x420(%rbp), %eax
addl $0x23fd, %eax           # imm = 0x23FD
movslq %eax, %rcx
leaq 0x5d3e2f(%rip), %rax    # 0x5f9810
movw %dx, (%rax,%rcx,2)
movq -0xd50(%rbp), %rdx
movslq -0x420(%rbp), %rax
imulq -0xd58(%rbp), %rax
imulq -0xd60(%rbp), %rax
addq %rax, %rdx
movl -0x420(%rbp), %eax
addl $0x23fd, %eax           # imm = 0x23FD
movslq %eax, %rcx
leaq 0x56d6f5(%rip), %rax    # 0x593110
movq %rdx, (%rax,%rcx,8)
movl -0x420(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x420(%rbp)
jmp 0x25992
movq $0x0, 0x2447ba(%rip) # 0x26a1f8
movq $0x0, 0x2447b7(%rip) # 0x26a200
movq $0x0, -0xda8(%rbp)
movq $0x0, -0xdb0(%rbp)
movq 0x24478a(%rip), %rdi    # 0x26a1f0
callq 0x46e00
movb %al, -0x411(%rbp)
movsbl -0x411(%rbp), %ecx
movb $0x1, %al
cmpl $0x1, %ecx
movb %al, -0xdf9(%rbp)
je 0x25abc
movq -0xda8(%rbp), %rcx
xorl %eax, %eax
cmpq -0xdb0(%rbp), %rcx
movb %al, -0xdfa(%rbp)
jae 0x25ab0
movsbl -0x411(%rbp), %eax
cmpl $0x2, %eax
sete %al
movb %al, -0xdfa(%rbp)
movb -0xdfa(%rbp), %al
movb %al, -0xdf9(%rbp)
movb -0xdf9(%rbp), %al
testb $0x1, %al
jne 0x25acb
jmp 0x26018
jmp 0x25acd
movq -0xdb0(%rbp), %rcx
subq -0xda8(%rbp), %rcx
xorl %eax, %eax
cmpq $0x3, %rcx
movb %al, -0xdfb(%rbp)
jae 0x25afc
movsbl -0x411(%rbp), %eax
cmpl $0x1, %eax
sete %al
movb %al, -0xdfb(%rbp)
movb -0xdfb(%rbp), %al
testb $0x1, %al
jne 0x25b0b
jmp 0x25db9
movq -0xdb0(%rbp), %rax
movl $0x3, %ecx
xorl %edx, %edx
divq %rcx
movl %edx, %eax
movl %eax, -0xdd0(%rbp)
movq -0xd50(%rbp), %rax
movslq -0xdd0(%rbp), %rcx
imulq -0xd58(%rbp), %rcx
imulq -0xd60(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xe08(%rbp)
movq 0x24469d(%rip), %rdi    # 0x26a1f0
callq 0x46cf0
movq -0xe08(%rbp), %rdi
movq %rax, %rsi
movq -0xd58(%rbp), %rdx
imulq -0xd60(%rbp), %rdx
callq 0x80e0
movq 0x244673(%rip), %rdi    # 0x26a1f0
callq 0x46ca0
movq %rax, -0xdf8(%rbp)
movl $0x2ff, -0x420(%rbp)    # imm = 0x2FF
cmpl $0x0, -0x420(%rbp)
jl 0x25be6
movq -0xdf8(%rbp), %rax
movslq -0x420(%rbp), %rcx
movzbl (%rax,%rcx), %eax
sarl $0x2, %eax
movb %al, %dl
movslq -0xdd0(%rbp), %rcx
leaq -0xd30(%rbp), %rax
imulq $0x300, %rcx, %rcx      # imm = 0x300
addq %rcx, %rax
movslq -0x420(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x420(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x420(%rbp)
jmp 0x25b93
movq 0x244603(%rip), %rdi    # 0x26a1f0
xorl %esi, %esi
callq 0x46da0
movq %rax, -0xdd8(%rbp)
movq 0x2445ee(%rip), %rdi    # 0x26a1f0
xorl %esi, %esi
callq 0x46d40
movq %rax, -0xdf0(%rbp)
movzbl -0xd37(%rbp), %eax
cmpl $0x2, %eax
jne 0x25c2d
movq -0xdd8(%rbp), %rax
shrq %rax
movq %rax, -0xdd8(%rbp)
jmp 0x25c2f
cmpq $0x0, -0xdd8(%rbp)
jbe 0x25d75
movq 0x2445bc(%rip), %rax    # 0x26a200
addq -0xdd8(%rbp), %rax
cmpq $0x8000, %rax           # imm = 0x8000
jbe 0x25c68
movl $0x8000, %eax           # imm = 0x8000
subq 0x2445a1(%rip), %rax    # 0x26a200
movq %rax, -0xde0(%rbp)
jmp 0x25c76
movq -0xdd8(%rbp), %rax
movq %rax, -0xde0(%rbp)
movzbl -0xd37(%rbp), %eax
cmpl $0x2, %eax
jne 0x25cfc
movq -0xde0(%rbp), %rax
subq $0x1, %rax
movq %rax, -0xde8(%rbp)
movq -0xdf0(%rbp), %rax
movq -0xde8(%rbp), %rcx
shlq %rcx
movzbl (%rax,%rcx), %eax
sarl %eax
movq -0xdf0(%rbp), %rcx
movq -0xde8(%rbp), %rdx
shlq %rdx
movzbl 0x1(%rcx,%rdx), %ecx
sarl %ecx
addl %ecx, %eax
movb %al, %dl
movq 0x244532(%rip), %rcx    # 0x26a200
addq -0xde8(%rbp), %rcx
leaq 0x244534(%rip), %rax    # 0x26a210
movb %dl, (%rax,%rcx)
movq -0xde8(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0xde8(%rbp)
cmpq $0x0, %rax
jne 0x25c94
jmp 0x25d1d
leaq 0x24450d(%rip), %rdi    # 0x26a210
addq 0x2444f6(%rip), %rdi    # 0x26a200
movq -0xdf0(%rbp), %rsi
movq -0xde0(%rbp), %rdx
callq 0x80e0
movq -0xde0(%rbp), %rax
movzbl -0xd37(%rbp), %ecx
imulq %rcx, %rax
addq -0xdf0(%rbp), %rax
movq %rax, -0xdf0(%rbp)
movq -0xde0(%rbp), %rcx
movq -0xdd8(%rbp), %rax
subq %rcx, %rax
movq %rax, -0xdd8(%rbp)
movq 0x2444a4(%rip), %rax    # 0x26a200
addq -0xde0(%rbp), %rax
andq $0x7fff, %rax           # imm = 0x7FFF
movq %rax, 0x244490(%rip)    # 0x26a200
jmp 0x25c2f
movq -0xdb0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xdb0(%rbp)
movq 0x244462(%rip), %rdi    # 0x26a1f0
callq 0x47330
movb %al, -0x411(%rbp)
movsbl -0x411(%rbp), %eax
cmpl $-0x1, %eax
jne 0x25db4
movl $0xffffffff, -0x424(%rbp) # imm = 0xFFFFFFFF
jmp 0x2601a
jmp 0x25acd
callq 0xc29d0
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0xdc8(%rbp)
cmpl $0x0, -0xdcc(%rbp)
jge 0x25e48
movq -0xda0(%rbp), %rax
movl %eax, %esi
leaq 0x31a(%rip), %rdi       # 0x26100
xorl %edx, %edx
movl $0x3f, %r9d
movl %r9d, %ecx
movl %r9d, %r8d
movl $0x1, (%rsp)
movl $0xffffffff, 0x8(%rsp)  # imm = 0xFFFFFFFF
callq 0xccd20
movl %eax, -0xdcc(%rbp)
cmpl $0x0, -0xdcc(%rbp)
jge 0x25e38
movq -0x10(%rbp), %rsi
leaq 0xb40d0(%rip), %rdi     # 0xd9ef2
movb $0x0, %al
callq 0xc23f0
movl $0xffffffff, -0x424(%rbp) # imm = 0xFFFFFFFF
jmp 0x2601a
movsd -0xdc8(%rbp), %xmm0
movsd %xmm0, -0xdc0(%rbp)
jmp 0x25e4a
movsd -0xdc8(%rbp), %xmm0
subsd -0xdc0(%rbp), %xmm0
ucomisd -0xdb8(%rbp), %xmm0
jb 0x25e90
movsd -0xdb8(%rbp), %xmm0
addsd -0xdc0(%rbp), %xmm0
movsd %xmm0, -0xdc0(%rbp)
movq -0xda8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xda8(%rbp)
jmp 0x25e4a
movq -0xda8(%rbp), %rax
movl $0x3, %ecx
xorl %edx, %edx
divq %rcx
movl %edx, %eax
movl %eax, -0xdd0(%rbp)
movslq -0xdd0(%rbp), %rax
leaq -0xd30(%rbp), %rsi
imulq $0x300, %rax, %rax      # imm = 0x300
addq %rax, %rsi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0x6, %edx
callq 0x67360
movl -0xdd0(%rbp), %eax
addl $0x23fd, %eax           # imm = 0x23FD
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movswl %ax, %edi
callq 0x72fc0
xorl %edi, %edi
callq 0x67660
movl -0xdd0(%rbp), %eax
addl $0x23fd, %eax           # imm = 0x23FD
movslq %eax, %rcx
leaq 0x5e214a(%rip), %rax    # 0x608050
movswl (%rax,%rcx,2), %esi
movl $0xc8, %edi
callq 0x26150
movl %eax, %edx
movl -0xdd0(%rbp), %eax
addl $0x23fd, %eax           # imm = 0x23FD
movw %ax, %r8w
leaq 0x5da0f0(%rip), %rax    # 0x60001c
movl (%rax), %r10d
subl $0x1, %r10d
leaq 0x5da0e6(%rip), %rax    # 0x600020
movl (%rax), %eax
subl $0x1, %eax
movl $0xa00000, %edi         # imm = 0xA00000
movl $0x640000, %esi         # imm = 0x640000
movl $0x200, %ecx            # imm = 0x200
xorl %r9d, %r9d
movswl %r8w, %r8d
movl $0x0, (%rsp)
movl $0x46, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movl $0x0, 0x18(%rsp)
movl %r10d, 0x20(%rsp)
movl %eax, 0x28(%rsp)
callq 0x718a0
callq 0x67810
callq 0xc3d90
leaq 0x35213d(%rip), %rax    # 0x3780d0
movsbl 0x1(%rax), %eax
leaq 0x352132(%rip), %rcx    # 0x3780d0
movsbl 0x1c(%rcx), %ecx
orl %ecx, %eax
leaq 0x352125(%rip), %rcx    # 0x3780d0
movsbl 0x39(%rcx), %ecx
orl %ecx, %eax
leaq 0x352118(%rip), %rcx    # 0x3780d0
movsbl 0x9c(%rcx), %ecx
orl %ecx, %eax
cmpl $0x0, %eax
je 0x26001
leaq 0x352103(%rip), %rax    # 0x3780d0
movb $0x0, 0x9c(%rax)
leaq 0x3520f5(%rip), %rax    # 0x3780d0
movb $0x0, 0x39(%rax)
leaq 0x3520ea(%rip), %rax    # 0x3780d0
movb $0x0, 0x1c(%rax)
leaq 0x3520df(%rip), %rax    # 0x3780d0
movb $0x0, 0x1(%rax)
movl $0x1, -0x424(%rbp)
jmp 0x26018
movl -0xdcc(%rbp), %edi
callq 0xccc20
cmpl $0x0, %eax
jne 0x26013
jmp 0x26018
jmp 0x25a71
jmp 0x2601a
movsbl -0x411(%rbp), %eax
cmpl $-0x1, %eax
jne 0x26046
movq -0x10(%rbp), %rsi
movq -0xdb0(%rbp), %rdx
movsbl -0x411(%rbp), %ecx
leaq 0xb3ee4(%rip), %rdi     # 0xd9f23
movb $0x0, %al
callq 0xc23f0
cmpl $0x0, -0xdcc(%rbp)
jl 0x2605a
movl -0xdcc(%rbp), %edi
callq 0xccc50
cmpq $0x0, 0x24418e(%rip)    # 0x26a1f0
je 0x26070
movq 0x244185(%rip), %rdi    # 0x26a1f0
callq 0x463d0
movq $0x0, 0x244175(%rip) # 0x26a1f0
cmpq $0x0, -0xd48(%rbp)
je 0x26091
movq -0xd48(%rbp), %rdi
callq 0x8260
movl $0x0, -0x420(%rbp)
cmpl $0x3, -0x420(%rbp)
jge 0x260d2
movl -0x420(%rbp), %eax
addl $0x23fd, %eax           # imm = 0x23FD
movslq %eax, %rcx
leaq 0x56d057(%rip), %rax    # 0x593110
movq $0x0, (%rax,%rcx,8)
movl -0x420(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x420(%rbp)
jmp 0x2609b
cmpq $0x0, -0xd50(%rbp)
je 0x260e8
movq -0xd50(%rbp), %rdi
callq 0x8260
movl -0x424(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xe40, %rsp            # imm = 0xE40
popq %rbp
retq
nopl (%rax)