// File: /workspace/github_c_makefile_star2_O3/LenShustek[P]miditones/miditones.c
// Function: find_next_note
void find_next_note (int tracknum) {
   unsigned long int delta_ticks;
   int event, chan;
   int note, velocity, controller, pressure, pitchbend, instrument;
   int meta_cmd, meta_length;
   unsigned long int sysex_length;
   char *tag;

   struct track_status *t = &track[tracknum];   // our track status structure
   while (t->trkptr < t->trkend) {
      delta_ticks = get_varlen (&t->trkptr);
      t->time += delta_ticks;
      if (logparse) {
         fprintf(logfile, "# trk %d ", tracknum);
         if (loggen) fprintf(logfile, "at ticks+%lu=%lu: ", delta_ticks, t->time);
         else {
            if (delta_ticks > 0) fprintf(logfile, "ticks+%-5lu%7lu  ", delta_ticks, t->time);
            else fprintf(logfile, "                    "); } }

      if (*t->trkptr < 0x80) event = t->last_event;  // using "running status": same event as before
      else event = *t->trkptr++; // otherwise get new "status" (event type) */

      if (event == 0xff) { // meta-event
         meta_cmd = *t->trkptr++;
         meta_length = get_varlen (&t->trkptr);
         switch (meta_cmd) {
         case 0x00:
            if (logparse) fprintf (logfile, "sequence number %d\n", rev_short (*(unsigned short *) t->trkptr));
            break;
         case 0x01:
            tag = "description"; goto show_text;
         case 0x02:
            tag = "copyright"; goto show_text;
         case 0x03:
            tag = "track name";
            if (tracknum == 0 && !parseonly && !binaryoutput && !asm_output) {
               /* Incredibly, MIDI has no standard for recording the name of the piece!
                  Track 0's "trackname" is often used for that so we output it to the C file as documentation. */
               fprintf (outfile, "// ");
               for (int i = 0; i < meta_length; ++i) {
                  int ch = t->trkptr[i];
                  fprintf (outfile, "%c", isprint (ch) ? ch : '?'); }
               fprintf (outfile, "\n"); }
            goto show_text;
         case 0x04:
            tag = "instrument name"; goto show_text;
         case 0x05:
            tag = "lyric"; goto show_text;
         case 0x06:
            tag = "marked point"; goto show_text;
         case 0x07:
            tag = "cue point"; goto show_text;
         case 0x08:
            tag = "program name"; goto show_text;
         case 0x09:
            tag = "device (port) name";
show_text:
            if (logparse) {
               fprintf (logfile, "meta cmd %02X, length %d, %s: \"", meta_cmd, meta_length, tag);
               for (int i = 0; i < meta_length; ++i) {
                  int ch = t->trkptr[i];
                  fprintf (logfile, "%c", isprint (ch) ? ch : '?'); }
               fprintf (logfile, "\"\n"); }
            break;
         case 0x20:
            if (logparse) fprintf (logfile, "channel prefix %d\n", *t->trkptr);
            break;
         case 0x21:
            if (logparse) fprintf(logfile, "MIDI port %d\n", *t->trkptr);
            break;
         case 0x2f:
            if (logparse) fprintf (logfile, "end of track\n");
            break;
         case 0x51:    // tempo: 3 byte big-endian integer, not a varlen integer!
            t->cmd = CMD_TEMPO;
            t->tempo = rev_long (*(uint32_t *) (t->trkptr - 1)) & 0xffffffL;
            if (logparse) fprintf (logfile, "set tempo %ld usec/qnote\n", t->tempo);
            t->trkptr += meta_length;
            return;
         case 0x54:
            if (logparse) fprintf (logfile, "SMPTE offset %08" PRIx32 "\n",
                                      rev_long (*(uint32_t *) t->trkptr));
            break;
         case 0x58:
            if (logparse) fprintf (logfile, "time signature %08" PRIx32 "\n",
                                      rev_long (*(uint32_t *) t->trkptr));
            break;
         case 0x59:
            if (logparse) fprintf (logfile, "key signature %04X\n", rev_short (*(unsigned short *) t->trkptr));
            break;
         case 0x7f:
            tag = "sequencer data"; goto show_hex;
         default:              /* unknown meta command */
            tag = "???";
show_hex:
            if (logparse) {
               fprintf (logfile, "meta cmd %02X, length %d, %s: ", meta_cmd, meta_length, tag);
               for (int i = 0; i < meta_length; ++i)
                  fprintf (logfile, "%02X ", t->trkptr[i]);
               fprintf (logfile, "\n"); }
            break; }
         t->trkptr += meta_length; }

      else if (event < 0x80) midi_error ("Unknown MIDI event type", t->trkptr);

      else {
         if (event < 0xf0)
            t->last_event = event;      // remember "running status" if not meta or sysex event
         t->chan = chan = event & 0xf;
         switch (event >> 4) {
         case 0x8: // note off
            t->note = *t->trkptr++;
            t->volume = *t->trkptr++;
note_off:   if (logparse) fprintf(logfile, "note %d (0x%02X) off, channel %d, volume %d\n", t->note, t->note, chan, t->volume);
            if ((1 << chan) & channel_mask  // we're processing this channel
                  && (!percussion_ignore || chan != PERCUSSION_TRACK)) {  // and not ignoring percussion
               if (!instrumentoutput) t->chan = 0; // if no instruments, force all notes to channel 0
               t->cmd = CMD_STOPNOTE;    /* stop processing and return */
               return; }
            break;
         case 0x9: // note on
            t->note = *t->trkptr++;
            t->volume = *t->trkptr++;
            if (t->volume == 0)  // some scores use note-on with zero velocity for off!
               goto note_off;
            if (logparse) fprintf(logfile, "note %d (0x%02X) on,  channel %d, volume %d\n", t->note, t->note, chan, t->volume);
            if ((1 << chan) & channel_mask // we're processing this channel
                  && (!percussion_ignore || chan != PERCUSSION_TRACK)) {  // and not ignoring percussion
               if (!instrumentoutput) t->chan = 0; // if no instruments, force all notes to channel 0
               t->cmd = CMD_PLAYNOTE;    /* stop processing and return */
               return; }
            break;
         case 0xa: // key pressure
            note = *t->trkptr++;
            velocity = *t->trkptr++;
            if (logparse) fprintf (logfile, "channel %d: note %d (0x%02X) has key pressure %d\n", chan, note, note, velocity);
            break;
         case 0xb: // control value change
            controller = *t->trkptr++;
            velocity = *t->trkptr++;
            if (logparse) fprintf (logfile, "channel %d: change control value of controller %d to %d\n", chan, controller, velocity);
            break;
         case 0xc: // program patch, ie which instrument
            instrument = *t->trkptr++;
            channel[chan].instrument = instrument;    // record new instrument for this channel
            if (logparse) fprintf (logfile, "channel %d: program patch to instrument %d\n", chan, instrument);
            break;
         case 0xd: // channel pressure
            pressure = *t->trkptr++;
            if (logparse) fprintf (logfile, "channel %d: after-touch pressure is %d\n", chan, pressure);
            break;
         case 0xe: // pitch wheel change
            pitchbend = *t->trkptr++ | (*t->trkptr++ << 7);
            if (logparse) fprintf (logfile, "pitch wheel change to %d\n", pitchbend);
            break;
         case 0xf: // sysex event
            sysex_length = get_varlen (&t->trkptr);
            if (logparse) fprintf (logfile, "SysEx event %d with %ld bytes\n", event, sysex_length);
            t->trkptr += sysex_length;
            break;
         default:
            midi_error ("Unknown MIDI command", t->trkptr); } } }
   t->cmd = CMD_TRACKDONE;   //no more events to process on this track
   ++tracks_done; }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movslq %edi, %rax
leaq (%rax,%rax,2), %rcx
shlq $0x4, %rcx
leaq 0x6113(%rip), %rdx      # 0x93c0
leaq (%rdx,%rcx), %rbp
movq (%rcx,%rdx), %rax
cmpq 0x8(%rcx,%rdx), %rax
jae 0x3aad
movl %edi, %r15d
leaq 0x28(%rbp), %rbx
xorl %ecx, %ecx
xorl %r12d, %r12d
movl %edi, 0xc(%rsp)
movq %rbx, 0x20(%rsp)
leaq 0x1(%rax), %rdx
movq %rdx, (%rbp)
movzbl (%rax), %eax
movq %r12, %rsi
shlq $0x7, %rsi
movl %eax, %r12d
andl $0x7f, %r12d
orq %rsi, %r12
testb %al, %al
setns %al
incl %ecx
cmpl $0x4, %ecx
sete %sil
orb %al, %sil
movq %rdx, %rax
cmpb $0x1, %sil
jne 0x32d5
addq %r12, 0x10(%rbp)
cmpb $0x1, 0x5eaf(%rip)      # 0x91c5
jne 0x3375
movq 0x5eb9(%rip), %rdi      # 0x91d8
leaq 0x2d29(%rip), %rsi      # 0x604f
movl %r15d, %edx
xorl %eax, %eax
callq 0x10b0
cmpb $0x1, 0x5e8c(%rip)      # 0x91c3
jne 0x334d
movq 0x5e98(%rip), %rdi      # 0x91d8
movq 0x10(%rbp), %rcx
leaq 0x2d0e(%rip), %rsi      # 0x6059
jmp 0x336b
movq 0x5e84(%rip), %rax      # 0x91d8
testq %r12, %r12
je 0x34d8
movq 0x10(%rbp), %rcx
movq %rax, %rdi
leaq 0x2d01(%rip), %rsi      # 0x606c
movq %r12, %rdx
xorl %eax, %eax
callq 0x10b0
movq (%rbp), %rax
cmpb $0x0, (%rax)
js 0x3386
movq %rax, %rsi
movq %rbx, %rax
jmp 0x338e
leaq 0x1(%rax), %rsi
movq %rsi, (%rbp)
movzbl (%rax), %edx
cmpl $0xff, %edx
je 0x33f4
testb %dl, %dl
jns 0x3b2c
cmpb $-0x11, %dl
ja 0x33a8
movb %dl, (%rbx)
movl %edx, %r12d
andl $0xf, %r12d
movb %r12b, 0x25(%rbp)
movl %edx, %eax
shrl $0x4, %eax
addl $-0x8, %eax
leaq 0x1c42(%rip), %rcx      # 0x5004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1(%rsi), %rax
movq %rax, (%rbp)
movb (%rsi), %al
movb %al, 0x26(%rbp)
leaq 0x2(%rsi), %rcx
movq %rcx, (%rbp)
movzbl 0x1(%rsi), %r9d
movb %r9b, 0x27(%rbp)
movb 0x5dd6(%rip), %cl       # 0x91c5
jmp 0x3755
leaq 0x1(%rsi), %rax
movq %rax, (%rbp)
movzbl (%rsi), %r13d
movl $0x3, %ecx
xorl %r12d, %r12d
movq %r12, %rbx
movq %rax, %rdx
incq %rax
movq %rax, (%rbp)
movzbl (%rdx), %r14d
movq %r12, %rdx
shlq $0x7, %rdx
movl %r14d, %r12d
andl $0x7f, %r12d
orq %rdx, %r12
subl $0x1, %ecx
setb %dl
testb %r14b, %r14b
jns 0x3439
testb %dl, %dl
je 0x3408
cmpl $0x20, %r13d
jg 0x348d
cmpl $0x9, %r13d
ja 0x37a3
movl %r13d, %ecx
leaq 0x1bd1(%rip), %rdx      # 0x5024
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
leaq 0x2c46(%rip), %r8       # 0x60a7
jmpq *%rcx
cmpb $0x1, 0x5d5b(%rip)      # 0x91c5
jne 0x3a8b
movq 0x5d61(%rip), %rdi      # 0x91d8
movzwl (%rax), %eax
rolw $0x8, %ax
movzwl %ax, %edx
leaq 0x2c0b(%rip), %rsi      # 0x6093
jmp 0x38bf
cmpl $0x50, %r13d
jle 0x370f
leal -0x51(%r13), %ecx
cmpl $0x8, %ecx
ja 0x37cc
leaq 0x1ba1(%rip), %rdx      # 0x504c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
cmpb $0x1, 0x5d0a(%rip)      # 0x91c5
jne 0x3a8b
movq 0x5d10(%rip), %rdi      # 0x91d8
movl (%rax), %edx
bswapl %edx
leaq 0x2cb2(%rip), %rsi      # 0x6185
jmp 0x38bf
movl $0x14, %esi
movl $0x1, %edx
leaq 0x2b95(%rip), %rdi      # 0x607e
movq %rax, %rcx
callq 0x1150
jmp 0x3375
leaq 0x1(%rsi), %rax
movq %rax, (%rbp)
movzbl (%rsi), %ecx
imulq $0x194, %r12, %rax      # imm = 0x194
leaq 0x6331(%rip), %rdx      # 0x9840
movl %ecx, (%rax,%rdx)
cmpb $0x1, 0x5cac(%rip)      # 0x91c5
jne 0x3a97
movq 0x5cb2(%rip), %rdi      # 0x91d8
leaq 0x2d9f(%rip), %rsi      # 0x62cc
jmp 0x36be
leaq 0x1(%rsi), %rax
movq %rax, (%rbp)
movzbl (%rsi), %ecx
addq $0x2, %rsi
movq %rsi, (%rbp)
cmpb $0x1, 0x5c79(%rip)      # 0x91c5
jne 0x3a97
movzbl (%rax), %r9d
movq 0x5c7b(%rip), %rdi      # 0x91d8
leaq 0x2cfd(%rip), %rsi      # 0x6261
movl %r12d, %edx
movl %ecx, %r8d
xorl %eax, %eax
callq 0x10b0
jmp 0x3a97
leaq 0x1(%rsi), %rax
movq %rax, (%rbp)
movzbl (%rsi), %ecx
addq $0x2, %rsi
movq %rsi, (%rbp)
cmpb $0x1, 0x5c35(%rip)      # 0x91c5
jne 0x3a97
movzbl (%rax), %r8d
movq 0x5c37(%rip), %rdi      # 0x91d8
leaq 0x2ceb(%rip), %rsi      # 0x6293
movl %r12d, %edx
xorl %eax, %eax
callq 0x10b0
jmp 0x3a97
movl $0x3, %eax
xorl %r12d, %r12d
movq %rsi, %rcx
incq %rsi
movq %rsi, (%rbp)
movzbl (%rcx), %edi
movq %r12, %rcx
shlq $0x7, %rcx
movl %edi, %r12d
andl $0x7f, %r12d
orq %rcx, %r12
subl $0x1, %eax
setb %cl
testb %dil, %dil
jns 0x35ec
testb %cl, %cl
je 0x35bf
cmpb $0x1, 0x5bd2(%rip)      # 0x91c5
jne 0x3611
movq 0x5bdc(%rip), %rdi      # 0x91d8
leaq 0x2d37(%rip), %rsi      # 0x633a
movq %r12, %rcx
xorl %eax, %eax
callq 0x10b0
movq (%rbp), %rsi
addq %r12, %rsi
movq %rsi, (%rbp)
jmp 0x3a97
leaq 0x1(%rsi), %rax
movq %rax, (%rbp)
movb (%rsi), %al
movb %al, 0x26(%rbp)
leaq 0x2(%rsi), %rcx
movq %rcx, (%rbp)
movzbl 0x1(%rsi), %r9d
movb %r9b, 0x27(%rbp)
movb 0x5b84(%rip), %cl       # 0x91c5
testl %r9d, %r9d
je 0x3752
testb $0x1, %cl
je 0x366c
movzbl %al, %ecx
movq 0x5b7f(%rip), %rdi      # 0x91d8
leaq 0x2bd4(%rip), %rsi      # 0x6234
movl %ecx, %edx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x10b0
movl 0x5a7e(%rip), %eax      # 0x90f0
btl %r12d, %eax
jae 0x3a97
cmpl $0x9, %r12d
jne 0x3ad9
cmpb $0x0, 0x5b3a(%rip)      # 0x91c7
jne 0x3a97
jmp 0x3ad9
leaq 0x1(%rsi), %rax
movq %rax, (%rbp)
cmpb $0x1, 0x5b1e(%rip)      # 0x91c5
jne 0x3a97
movzbl (%rsi), %ecx
movq 0x5b21(%rip), %rdi      # 0x91d8
leaq 0x2c3a(%rip), %rsi      # 0x62f8
movl %r12d, %edx
xorl %eax, %eax
callq 0x10b0
jmp 0x3a97
leaq 0x1(%rsi), %rcx
movq %rcx, (%rbp)
movzbl (%rsi), %eax
addq $0x2, %rsi
movq %rsi, (%rbp)
cmpb $0x1, 0x5ade(%rip)      # 0x91c5
jne 0x3a97
movzbl (%rcx), %edx
shll $0x7, %edx
orl %eax, %edx
movq 0x5adc(%rip), %rdi      # 0x91d8
leaq 0x2c1d(%rip), %rsi      # 0x6320
xorl %eax, %eax
callq 0x10b0
jmp 0x3a97
cmpl $0x21, %r13d
je 0x38a1
cmpl $0x2f, %r13d
jne 0x37d9
cmpb $0x1, 0x5a9b(%rip)      # 0x91c5
jne 0x3a8b
movq 0x5aa1(%rip), %rcx      # 0x91d8
movl $0xd, %esi
movl $0x1, %edx
leaq 0x2a15(%rip), %rdi      # 0x615d
callq 0x1150
jmp 0x3a8b
xorl %r9d, %r9d
testb $0x1, %cl
je 0x3777
movq 0x5a77(%rip), %rdi      # 0x91d8
movzbl %al, %ecx
leaq 0x2a9c(%rip), %rsi      # 0x6207
movl %ecx, %edx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x10b0
movl 0x5973(%rip), %eax      # 0x90f0
btl %r12d, %eax
jae 0x3a97
cmpl $0x9, %r12d
jne 0x3ac6
cmpb $0x0, 0x5a2f(%rip)      # 0x91c7
jne 0x3a97
jmp 0x3ac6
cmpl $0x20, %r13d
jne 0x37d9
cmpb $0x1, 0x5a15(%rip)      # 0x91c5
jne 0x3a8b
movq 0x5a1b(%rip), %rdi      # 0x91d8
movzbl (%rax), %edx
leaq 0x2975(%rip), %rsi      # 0x613c
jmp 0x38bf
leaq 0x29ee(%rip), %r8       # 0x61c1
cmpl $0x7f, %r13d
je 0x37e0
leaq 0x2768(%rip), %r8       # 0x5f48
cmpb $0x1, 0x59de(%rip)      # 0x91c5
jne 0x3a8b
movq 0x59e4(%rip), %rdi      # 0x91d8
leaq 0x29d5(%rip), %rsi      # 0x61d0
movl %r13d, %edx
movl %r12d, %ecx
xorl %eax, %eax
callq 0x10b0
testl %r12d, %r12d
leaq 0x222e(%rip), %r13      # 0x5a40
jle 0x3843
shll $0x7, %ebx
andl $0x7f, %r14d
orq %r14, %rbx
xorl %r14d, %r14d
movq 0x59b0(%rip), %rdi      # 0x91d8
movq (%rbp), %rax
movzbl (%rax,%r14), %edx
movq %r13, %rsi
xorl %eax, %eax
callq 0x10b0
incq %r14
cmpq %r14, %rbx
jne 0x3821
movq 0x598e(%rip), %rsi      # 0x91d8
movl $0xa, %edi
callq 0x1090
jmp 0x3a8b
cmpb $0x1, 0x5965(%rip)      # 0x91c5
jne 0x3a8b
movq 0x596b(%rip), %rdi      # 0x91d8
movzwl (%rax), %eax
rolw $0x8, %ax
movzwl %ax, %edx
leaq 0x292f(%rip), %rsi      # 0x61ad
jmp 0x38bf
cmpb $0x1, 0x593e(%rip)      # 0x91c5
jne 0x3a8b
movq 0x5944(%rip), %rdi      # 0x91d8
movl (%rax), %edx
bswapl %edx
leaq 0x28f9(%rip), %rsi      # 0x6198
jmp 0x38bf
cmpb $0x1, 0x591d(%rip)      # 0x91c5
jne 0x3a8b
movq 0x5923(%rip), %rdi      # 0x91d8
movzbl (%rax), %edx
leaq 0x2890(%rip), %rsi      # 0x614f
xorl %eax, %eax
callq 0x10b0
jmp 0x3a8b
leaq 0x27fa(%rip), %r8       # 0x60cc
jmp 0x39f6
leaq 0x2828(%rip), %r8       # 0x6106
jmp 0x39f6
leaq 0x27c9(%rip), %r8       # 0x60b3
jmp 0x39f6
leaq 0x27c7(%rip), %r8       # 0x60bd
testl %r15d, %r15d
jne 0x39f6
cmpb $0x0, 0x58c0(%rip)      # 0x91c6
leaq 0x27b0(%rip), %r8       # 0x60bd
jne 0x39f6
cmpb $0x0, 0x58a6(%rip)      # 0x91c0
leaq 0x279c(%rip), %r8       # 0x60bd
jne 0x39f6
cmpb $0x0, 0x589c(%rip)      # 0x91ca
leaq 0x2788(%rip), %r8       # 0x60bd
jne 0x39f6
movq 0x58ae(%rip), %rcx      # 0x91f0
movl $0x3, %esi
movl $0x1, %edx
leaq 0x2775(%rip), %rdi      # 0x60c8
callq 0x1150
testl %r12d, %r12d
jle 0x39b5
callq 0x1170
movq %rax, 0x18(%rsp)
movl %ebx, %ecx
shll $0x7, %ecx
movl %r14d, %eax
andl $0x7f, %eax
orq %rax, %rcx
movq %rcx, 0x10(%rsp)
xorl %r15d, %r15d
movq (%rbp), %rax
movzbl (%rax,%r15), %eax
movq 0x5863(%rip), %rsi      # 0x91f0
movq 0x18(%rsp), %rcx
movq (%rcx), %rcx
movzwl (%rcx,%rax,2), %ecx
btl $0xe, %ecx
movl $0x3f, %edi
jae 0x39a6
movl %eax, %edi
callq 0x1090
incq %r15
cmpq %r15, 0x10(%rsp)
jne 0x397d
movq 0x5834(%rip), %rsi      # 0x91f0
movl $0xa, %edi
callq 0x1090
leaq 0x26f0(%rip), %r8       # 0x60bd
movl 0xc(%rsp), %r15d
jmp 0x39f6
leaq 0x2714(%rip), %r8       # 0x60ef
jmp 0x39f6
leaq 0x26f8(%rip), %r8       # 0x60dc
jmp 0x39f6
leaq 0x26f5(%rip), %r8       # 0x60e2
jmp 0x39f6
leaq 0x2703(%rip), %r8       # 0x60f9
cmpb $0x1, 0x57c8(%rip)      # 0x91c5
jne 0x3a8b
movq 0x57ce(%rip), %rdi      # 0x91d8
leaq 0x2708(%rip), %rsi      # 0x6119
movl %r13d, %edx
movl %r12d, %ecx
xorl %eax, %eax
callq 0x10b0
testl %r12d, %r12d
jle 0x3a69
callq 0x1170
movq %rax, %r15
shll $0x7, %ebx
andl $0x7f, %r14d
orq %r14, %rbx
xorl %r14d, %r14d
movq (%rbp), %rax
movzbl (%rax,%r14), %eax
movq 0x5790(%rip), %rsi      # 0x91d8
movq (%r15), %rcx
movzwl (%rcx,%rax,2), %ecx
btl $0xe, %ecx
movl $0x3f, %edi
jae 0x3a5c
movl %eax, %edi
callq 0x1090
incq %r14
cmpq %r14, %rbx
jne 0x3a38
movq 0x5768(%rip), %rcx      # 0x91d8
movl $0x2, %esi
movl $0x1, %edx
leaq 0x26b8(%rip), %rdi      # 0x6139
callq 0x1150
movl 0xc(%rsp), %r15d
movslq %r12d, %rax
addq %rax, (%rbp)
movq 0x20(%rsp), %rbx
movq (%rbp), %rax
xorl %ecx, %ecx
movl $0x0, %r12d
cmpq 0x8(%rbp), %rax
jb 0x32d5
movb $-0x1, 0x24(%rbp)
incl 0x5679(%rip)            # 0x9130
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x0, 0x56f7(%rip)      # 0x91c4
jne 0x3ad3
movb $0x0, 0x25(%rbp)
movb $-0x80, 0x24(%rbp)
jmp 0x3ab7
cmpb $0x0, 0x56e4(%rip)      # 0x91c4
jne 0x3ae6
movb $0x0, 0x25(%rbp)
movb $-0x70, 0x24(%rbp)
jmp 0x3ab7
movb $-0x2, 0x24(%rbp)
movl $0xffffff00, %edx       # imm = 0xFFFFFF00
andl -0x1(%rax), %edx
bswapl %edx
movq %rdx, 0x18(%rbp)
cmpb $0x1, 0x56c0(%rip)      # 0x91c5
jne 0x3b20
movq 0x56ca(%rip), %rdi      # 0x91d8
leaq 0x2656(%rip), %rsi      # 0x616b
xorl %eax, %eax
callq 0x10b0
movq (%rbp), %rax
movslq %r12d, %rcx
addq %rax, %rcx
movq %rcx, (%rbp)
jmp 0x3ab7
leaq 0x26bc(%rip), %rdi      # 0x61ef
callq 0x1b04