// File: /workspace/github_c_makefile_star2_O3/salextpuru[P]speccy-toochain/src/snatzx/ppmtozx.c
// Function: main
int main()
{
FILE *in;
unsigned char buf[1024];
int w,h;
int x,y,a,b,r,g,c,f,specy,mask;

in=stdin;

fgets(buf,sizeof(buf),in);
fscanf(in,"%d%d\n",&w,&h);

if(buf[0]!='P')
  {
  printf("Stdin not a PNM file!\n");
  exit(1);
  }

switch(buf[1])
  {
  case '6':
    break;
  default:
    fprintf(stderr,"Sorry, raw PPM files only (\"P6\").\n");
    exit(1);
  }

if(w!=256 || h!=192)
  fprintf(stderr,"Must be 256x192.\n"),exit(1);

fgets(buf,sizeof(buf),in);
if(atoi(buf)!=255)
  fprintf(stderr,"Maxval must be 255 (run through `pnmdepth 255').\n"),exit(1);

fread(image,3,256*192,in);

if(in!=stdin) fclose(in);

for(y=0;y<192;y++)
  {
  for(x=0;x<256;x++)
    {
    r=image[(y*256+x)*3  ];
    g=image[(y*256+x)*3+1];
    b=image[(y*256+x)*3+2];
    
    /* BFI anyone? */
    c=0;
    if(r==0 && g==0 && b!=0) c=1;
    if(r!=0 && g==0 && b==0) c=2;
    if(r!=0 && g==0 && b!=0) c=3;
    if(r==0 && g!=0 && b==0) c=4;
    if(r==0 && g!=0 && b!=0) c=5;
    if(r!=0 && g!=0 && b==0) c=6;
    if(r!=0 && g!=0 && b!=0) c=7;
    if(r>240 || g>240 || b>240) c+=8;
    
    speccol[y*256+x]=c;
    }
  }

/* map colours to attrs and generate matching bitmaps */
specy=0;
for(y=0;y<24;y++)
  {
  for(x=0;x<32;x++)
    {
    int histo[16],outc[16],idx,fg,bg,fgbr,bgbr,tmp;
    
    for(f=0;f<16;f++) histo[f]=outc[f]=0;
    
    for(b=0;b<8;b++)
      for(a=0;a<8;a++)
        histo[speccol[(y*8+b)*256+x*8+a]]++;
    
    idx=0;
    for(f=0;f<16;f++)
      {
      if(histo[f])
        {
        outc[idx++]=f;
        if(idx==3)
          fprintf(stderr,
           "warning: more than 2 colours in square (%d,%d), data lost!\n",x,y);
        }
      }
    
    bg=outc[0]; fg=outc[1];
    if((bg&7)>(fg&7)) tmp=bg,bg=fg,fg=tmp;
    
    bgbr=(bg>>3); bg&=7;
    fgbr=(fg>>3); fg&=7;
    
    /* sort out BRIGHT - both must be either on or off */
    if(bgbr+fgbr==1)
      {
      /* but black can be either, which complicates matters...
       * bg is the darker, so that'll be black if either is.
       * (fg could also be black, but that's unimportant.)
       * black is always set to non-bright in speccol[], so
       * we need to make bg `bright' if black, else give an
       * error.
       */
      
      if(bg==0)
        bgbr++;
      else
        fprintf(stderr,
         "warning: impossible BRIGHT mix in square (%d,%d), data lost!\n",x,y);
      }
    
    /* make the attr */
    attr[y*32+x]=fliporig[0]=fgbr*64+8*bg+fg;
    
    /* now make this char's bitmap according to the attr. */
    bg=8*bgbr+bg; fg=8*fgbr+fg;
    
    for(b=0;b<8;b++)
      {
      for(a=0,tmp=0,mask=128;a<8;a++,mask>>=1)
        {
        c=speccol[(y*8+b)*256+x*8+a];
        if(c==fg) tmp|=mask;
        }
      
      bmp[(specy+8*b)*32+x]=fliporig[b+1]=~tmp;
      }

#ifndef NO_FLIP    
    /* now see if flipping fg/bg reduces the number of `1' bits.
     * I do this to reduce the time taken to send via tape. (Zero bits
     * are sent in half the time one bits are.)
     */
    flipped[0]=((fliporig[0]&0xc0)|((fliporig[0]>>3)&7)|8*(fliporig[0]&7));
    for(f=1;f<9;f++) flipped[f]=~fliporig[f];
    for(f=a=b=0;f<9;f++)
      {
      for(c=0,mask=128;c<8;c++,mask>>=1)
        {
        a+=((fliporig[f]&mask)?1:0);
        b+=((flipped [f]&mask)?1:0);
        }
      }

    if(a>b)
      {
      /* flip fg/bg. */
      attr[y*32+x]=flipped[0];
      for(f=0;f<8;f++)
        bmp[(specy+8*f)*32+x]=~flipped[f+1];
      }
#endif	/* !NO_FLIP */
    }
  
  specy++;
  if(specy==8) specy=64;
  if(specy==72) specy=128;
  }


/* now finally write as speccy screen on stdout */

fwrite(bmp,32,192,stdout);
fwrite(attr,32,24,stdout);

exit(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4b8, %rsp            # imm = 0x4B8
movq 0x2e04(%rip), %r15      # 0x3fd8
movq (%r15), %r14
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdx
callq 0x1090
leaq 0xf0a(%rip), %rsi       # 0x2100
leaq 0x14(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x10a0
cmpb $0x50, (%rbx)
jne 0x1993
cmpb $0x36, 0xb1(%rsp)
jne 0x19a1
cmpl $0x100, 0x14(%rsp)      # imm = 0x100
jne 0x19b9
cmpl $0xc0, 0x10(%rsp)
jne 0x19b9
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdx
callq 0x1090
movq %rbx, %rdi
callq 0x1080
cmpl $0xff, %eax
jne 0x19d1
leaq 0x2e11(%rip), %rbx      # 0x4080
movl $0x3, %esi
movl $0xc000, %edx           # imm = 0xC000
movq %rbx, %rdi
movq %r14, %rcx
callq 0x1060
cmpq (%r15), %r14
je 0x1291
movq %r14, %rdi
callq 0x1030
leaq 0x26de8(%rip), %rax     # 0x28080
xorl %ecx, %ecx
pxor %xmm4, %xmm4
movdqa 0xd79(%rip), %xmm15     # 0x2020
movdqa 0xd90(%rip), %xmm11     # 0x2040
pxor %xmm12, %xmm12
movq %rbx, %rdx
xorl %esi, %esi
movdqa (%rdx), %xmm3
movdqa 0x10(%rdx), %xmm9
movdqa 0x20(%rdx), %xmm8
movdqa 0xd3d(%rip), %xmm10     # 0x2010
movdqa 0xd75(%rip), %xmm5      # 0x2050
pandn %xmm9, %xmm10
pandn %xmm3, %xmm5
movdqa 0xd24(%rip), %xmm0      # 0x2010
pandn %xmm3, %xmm0
movdqa %xmm3, %xmm2
pand 0xd14(%rip), %xmm2      # 0x2010
por %xmm10, %xmm2
movdqa %xmm2, %xmm3
punpckhbw %xmm4, %xmm3    # xmm3 = xmm3[8],xmm4[8],xmm3[9],xmm4[9],xmm3[10],xmm4[10],xmm3[11],xmm4[11],xmm3[12],xmm4[12],xmm3[13],xmm4[13],xmm3[14],xmm4[14],xmm3[15],xmm4[15]
movdqa %xmm15, %xmm4
punpcklbw %xmm12, %xmm2   # xmm2 = xmm2[0],xmm12[0],xmm2[1],xmm12[1],xmm2[2],xmm12[2],xmm2[3],xmm12[3],xmm2[4],xmm12[4],xmm2[5],xmm12[5],xmm2[6],xmm12[6],xmm2[7],xmm12[7]
pand %xmm15, %xmm2
pandn %xmm3, %xmm4
movdqa %xmm8, %xmm10
punpckhbw %xmm12, %xmm10  # xmm10 = xmm10[8],xmm12[8],xmm10[9],xmm12[9],xmm10[10],xmm12[10],xmm10[11],xmm12[11],xmm10[12],xmm12[12],xmm10[13],xmm12[13],xmm10[14],xmm12[14],xmm10[15],xmm12[15]
movdqa %xmm11, %xmm6
pshuflw $0xec, %xmm3, %xmm3     # xmm3 = xmm3[0,3,2,3,4,5,6,7]
pandn %xmm10, %xmm6
punpcklbw %xmm12, %xmm8   # xmm8 = xmm8[0],xmm12[0],xmm8[1],xmm12[1],xmm8[2],xmm12[2],xmm8[3],xmm12[3],xmm8[4],xmm12[4],xmm8[5],xmm12[5],xmm8[6],xmm12[6],xmm8[7],xmm12[7]
movdqa %xmm8, %xmm7
por %xmm4, %xmm2
pand %xmm11, %xmm7
por %xmm6, %xmm7
pshufd $0x27, %xmm7, %xmm4     # xmm4 = xmm7[3,1,2,0]
pshufd $0xec, %xmm3, %xmm14    # xmm14 = xmm3[0,3,2,3]
pshuflw $0xe6, %xmm4, %xmm3     # xmm3 = xmm4[2,1,2,3,4,5,6,7]
pshufd $0x2c, %xmm3, %xmm4     # xmm4 = xmm3[0,3,2,0]
movdqa 0xcc6(%rip), %xmm13     # 0x2030
movdqa %xmm13, %xmm3
pshufd $0xd8, %xmm2, %xmm2     # xmm2 = xmm2[0,2,1,3]
movdqa %xmm9, %xmm6
pand 0xccf(%rip), %xmm6      # 0x2050
por %xmm5, %xmm6
pshufhw $0x6c, %xmm4, %xmm4     # xmm4 = xmm4[0,1,2,3,4,7,6,5]
movdqa %xmm6, %xmm5
punpckhbw %xmm12, %xmm5   # xmm5 = xmm5[8],xmm12[8],xmm5[9],xmm12[9],xmm5[10],xmm12[10],xmm5[11],xmm12[11],xmm5[12],xmm12[12],xmm5[13],xmm12[13],xmm5[14],xmm12[14],xmm5[15],xmm12[15]
movdqa %xmm11, %xmm7
pshufhw $0x6c, %xmm2, %xmm2     # xmm2 = xmm2[0,1,2,3,4,7,6,5]
pandn %xmm5, %xmm7
punpcklbw %xmm12, %xmm6   # xmm6 = xmm6[0],xmm12[0],xmm6[1],xmm12[1],xmm6[2],xmm12[2],xmm6[3],xmm12[3],xmm6[4],xmm12[4],xmm6[5],xmm12[5],xmm6[6],xmm12[6],xmm6[7],xmm12[7]
pand %xmm11, %xmm6
packuswb %xmm4, %xmm4
por %xmm7, %xmm6
pshuflw $0xc6, %xmm6, %xmm6     # xmm6 = xmm6[2,1,0,3,4,5,6,7]
pshufhw $0xc6, %xmm6, %xmm7     # xmm7 = xmm6[0,1,2,3,6,5,4,7]
pshufd $0x6c, %xmm2, %xmm6     # xmm6 = xmm2[0,3,2,1]
pshufhw $0xec, %xmm5, %xmm2     # xmm2 = xmm5[0,1,2,3,4,7,6,7]
pshufd $0xe8, %xmm2, %xmm2     # xmm2 = xmm2[0,2,2,3]
pshuflw $0xf9, %xmm2, %xmm5     # xmm5 = xmm2[1,2,3,3,4,5,6,7]
pandn %xmm4, %xmm3
movdqa %xmm11, %xmm4
pandn %xmm8, %xmm4
movdqa %xmm15, %xmm2
pshufd $0x6c, %xmm7, %xmm7     # xmm7 = xmm7[0,3,2,1]
pandn %xmm10, %xmm2
pand %xmm11, %xmm10
pshuflw $0x6c, %xmm6, %xmm6     # xmm6 = xmm6[0,3,2,1,4,5,6,7]
por %xmm4, %xmm10
pshuflw $0xec, %xmm10, %xmm4    # xmm4 = xmm10[0,3,2,3,4,5,6,7]
pshufhw $0xe6, %xmm4, %xmm4     # xmm4 = xmm4[0,1,2,3,6,5,6,7]
pshuflw $0x39, %xmm7, %xmm7     # xmm7 = xmm7[1,2,3,0,4,5,6,7]
pshufd $0x24, %xmm4, %xmm4     # xmm4 = xmm4[0,1,2,0]
pshuflw $0xaa, %xmm4, %xmm4     # xmm4 = xmm4[2,2,2,2,4,5,6,7]
pshufhw $0x39, %xmm4, %xmm4     # xmm4 = xmm4[0,1,2,3,5,6,7,4]
packuswb %xmm4, %xmm4
movdqa %xmm13, %xmm10
pand 0xbe2(%rip), %xmm9      # 0x2010
por %xmm0, %xmm9
pandn %xmm4, %xmm10
movdqa %xmm9, %xmm0
punpckhbw %xmm12, %xmm0   # xmm0 = xmm0[8],xmm12[8],xmm0[9],xmm12[9],xmm0[10],xmm12[10],xmm0[11],xmm12[11],xmm0[12],xmm12[12],xmm0[13],xmm12[13],xmm0[14],xmm12[14],xmm0[15],xmm12[15]
movdqa 0xc16(%rip), %xmm1      # 0x2060
movdqa %xmm1, %xmm4
pshufhw $0xc6, %xmm6, %xmm6     # xmm6 = xmm6[0,1,2,3,6,5,4,7]
pandn %xmm0, %xmm4
punpcklbw %xmm12, %xmm9   # xmm9 = xmm9[0],xmm12[0],xmm9[1],xmm12[1],xmm9[2],xmm12[2],xmm9[3],xmm12[3],xmm9[4],xmm12[4],xmm9[5],xmm12[5],xmm9[6],xmm12[6],xmm9[7],xmm12[7]
pand %xmm1, %xmm9
pshufhw $0x39, %xmm7, %xmm7     # xmm7 = xmm7[0,1,2,3,5,6,7,4]
por %xmm4, %xmm9
pshufd $0x27, %xmm9, %xmm4     # xmm4 = xmm9[3,1,2,0]
pshufhw $0x6c, %xmm4, %xmm4     # xmm4 = xmm4[0,1,2,3,4,7,6,5]
packuswb %xmm14, %xmm6
pshufd $0x27, %xmm4, %xmm4     # xmm4 = xmm4[3,1,2,0]
pshuflw $0xc6, %xmm4, %xmm4     # xmm4 = xmm4[2,1,0,3,4,5,6,7]
pshufhw $0xc6, %xmm4, %xmm4     # xmm4 = xmm4[0,1,2,3,6,5,4,7]
packuswb %xmm5, %xmm7
pshufd $0xe6, %xmm0, %xmm0     # xmm0 = xmm0[2,1,2,3]
pshuflw $0xe6, %xmm0, %xmm0     # xmm0 = xmm0[2,1,2,3,4,5,6,7]
packuswb %xmm0, %xmm4
pand %xmm13, %xmm6
movdqa 0xbc7(%rip), %xmm1      # 0x2070
pand %xmm1, %xmm4
pand %xmm15, %xmm8
por %xmm2, %xmm8
pand %xmm13, %xmm7
pshufd $0xd8, %xmm8, %xmm0     # xmm0 = xmm8[0,2,1,3]
pshuflw $0x64, %xmm0, %xmm0     # xmm0 = xmm0[0,1,2,1,4,5,6,7]
pshufd $0xd8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,1,3]
por %xmm6, %xmm3
pshuflw $0xc4, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,3,4,5,6,7]
pshufhw $0xc6, %xmm0, %xmm0     # xmm0 = xmm0[0,1,2,3,6,5,4,7]
packuswb %xmm0, %xmm2
por %xmm7, %xmm10
movdqa %xmm1, %xmm0
pandn %xmm2, %xmm0
por %xmm4, %xmm0
movdqa %xmm3, %xmm8
movdqa %xmm3, %xmm5
movdqa 0xbe0(%rip), %xmm1      # 0x20e0
pmaxub %xmm1, %xmm5
pcmpeqb %xmm3, %xmm5
movdqa %xmm3, %xmm2
pcmpeqb %xmm12, %xmm8
movdqa %xmm10, %xmm3
pmaxub %xmm1, %xmm3
por %xmm10, %xmm2
pcmpeqb %xmm10, %xmm3
movdqa %xmm0, %xmm9
pcmpeqb %xmm12, %xmm10
pmaxub %xmm1, %xmm9
pcmpeqb %xmm0, %xmm9
pcmpeqb %xmm12, %xmm2
pcmpeqb %xmm12, %xmm0
movdqa %xmm8, %xmm4
movdqa %xmm0, %xmm6
pandn %xmm10, %xmm4
pandn %xmm4, %xmm6
pand %xmm0, %xmm4
movdqa %xmm10, %xmm7
pandn %xmm8, %xmm7
movdqa %xmm0, %xmm13
pandn %xmm7, %xmm13
por %xmm8, %xmm10
pand %xmm0, %xmm7
movdqa %xmm10, %xmm8
pandn %xmm0, %xmm8
por %xmm0, %xmm10
pandn %xmm2, %xmm0
movdqa %xmm4, %xmm2
pandn %xmm0, %xmm2
pand 0xae8(%rip), %xmm4      # 0x2080
psubb %xmm2, %xmm4
movdqa 0xafb(%rip), %xmm14     # 0x20a0
movdqa 0xae3(%rip), %xmm2      # 0x2090
movdqa %xmm6, %xmm0
pandn %xmm4, %xmm0
pxor %xmm4, %xmm4
pand %xmm2, %xmm6
movdqa 0xaeb(%rip), %xmm2      # 0x20b0
por %xmm0, %xmm6
movdqa %xmm7, %xmm0
pandn %xmm6, %xmm0
pand %xmm14, %xmm7
por %xmm0, %xmm7
movdqa %xmm13, %xmm0
pandn %xmm7, %xmm0
pand %xmm2, %xmm13
movdqa 0xad0(%rip), %xmm2      # 0x20c0
por %xmm0, %xmm13
movdqa %xmm8, %xmm0
pandn %xmm13, %xmm0
pand %xmm2, %xmm8
movdqa 0xac4(%rip), %xmm2      # 0x20d0
por %xmm0, %xmm8
pand %xmm10, %xmm8
pandn %xmm2, %xmm10
movdqa 0xacd(%rip), %xmm0      # 0x20f0
por %xmm8, %xmm10
por %xmm5, %xmm3
por %xmm3, %xmm9
pand %xmm0, %xmm9
paddb %xmm10, %xmm9
movdqa %xmm9, (%rax,%rsi)
addq $0x10, %rsi
addq $0x30, %rdx
cmpq $0x100, %rsi            # imm = 0x100
jne 0x12ba
incq %rcx
addq $0x100, %rax            # imm = 0x100
addq $0x300, %rbx            # imm = 0x300
cmpq $0xc0, %rcx
jne 0x12b5
leaq 0x26a06(%rip), %rax     # 0x28080
leaq 0x329ff(%rip), %rbx     # 0x34080
xorl %ecx, %ecx
xorl %ebp, %ebp
movq %rcx, (%rsp)
shlq $0x5, %rcx
movq %rcx, 0x28(%rsp)
movl %ebp, 0xc(%rsp)
shll $0x5, %ebp
movq %rax, 0x20(%rsp)
movq %rax, %rdi
xorl %r12d, %r12d
pxor %xmm0, %xmm0
movdqa %xmm0, 0x60(%rsp)
movdqa %xmm0, 0x50(%rsp)
movdqa %xmm0, 0x40(%rsp)
movdqa %xmm0, 0x30(%rsp)
movdqa %xmm0, 0x70(%rsp)
movdqa %xmm0, 0x80(%rsp)
movdqa %xmm0, 0x90(%rsp)
movdqa %xmm0, 0xa0(%rsp)
movq %rdi, %rax
xorl %ecx, %ecx
xorl %edx, %edx
movzbl (%rax,%rdx), %esi
incl 0x70(%rsp,%rsi,4)
incq %rdx
cmpq $0x8, %rdx
jne 0x16e8
incq %rcx
addq $0x100, %rax            # imm = 0x100
cmpq $0x8, %rcx
jne 0x16e6
xorl %r15d, %r15d
xorl %eax, %eax
cmpl $0x0, 0x70(%rsp,%r15,4)
je 0x1724
movslq %eax, %rcx
incl %eax
movl %r15d, 0x30(%rsp,%rcx,4)
cmpl $0x3, %eax
je 0x172f
incq %r15
cmpq $0x10, %r15
jne 0x170d
jmp 0x175b
movq 0x28aa(%rip), %rax      # 0x3fe0
movq %rdi, %r14
movq (%rax), %rdi
leaq 0xa2a(%rip), %rsi       # 0x216d
movl %r12d, %edx
movq (%rsp), %rcx
xorl %eax, %eax
callq 0x1050
movq %r14, %rdi
movl $0x3, %eax
jmp 0x1724
movl 0x30(%rsp), %eax
movl 0x34(%rsp), %ecx
movl %eax, %edx
andl $0x7, %edx
movl %ecx, %esi
andl $0x7, %esi
cmpl %esi, %edx
movl %ecx, %r15d
cmoval %eax, %r15d
cmoval %ecx, %eax
movl %r15d, %r13d
sarl $0x3, %r13d
movl %eax, %r14d
andl $0x7, %r14d
movq %rdi, 0x18(%rsp)
je 0x179d
sarl $0x3, %eax
addl %r13d, %eax
cmpl $0x1, %eax
je 0x18f2
movl %r15d, %ecx
andl $0x7, %ecx
shll $0x6, %r13d
leal (%r13,%r14,8), %eax
orl %ecx, %eax
movb %al, 0x328cc(%rip)      # 0x34080
movq 0x28(%rsp), %rcx
addq %r12, %rcx
leaq 0x328cd(%rip), %rdx     # 0x34090
movb %al, (%rdx,%rcx)
movq %rdi, %rdx
xorl %esi, %esi
leaq 0x32bbe(%rip), %r13     # 0x34390
movq %rsi, %rdi
shlq $0x8, %rdi
movb $-0x80, %r9b
xorl %r10d, %r10d
xorl %r8d, %r8d
movzbl (%rdx,%r10), %r11d
cmpl %r11d, %r15d
je 0x17f1
xorl %r11d, %r11d
jmp 0x17f5
movzbl %r9b, %r11d
orb %r11b, %r8b
incq %r10
shrb %r9b
cmpq $0x8, %r10
jne 0x17e2
notb %r8b
movb %r8b, 0x1(%rsi,%rbx)
incq %rsi
addl %ebp, %edi
movslq %edi, %rdi
addq %r12, %rdi
movb %r8b, (%r13,%rdi)
addq $0x100, %rdx            # imm = 0x100
cmpq $0x8, %rsi
jne 0x17d2
movl %eax, %edx
andb $-0x40, %dl
movl %eax, %esi
shrb $0x3, %sil
andb $0x7, %sil
orb %dl, %sil
shlb $0x3, %al
andb $0x38, %al
orb %sil, %al
movb %al, 0x34347(%rip)      # 0x35b90
movq 0x32831(%rip), %rdx     # 0x34081
notq %rdx
movq %rdx, 0x34337(%rip)     # 0x35b91
xorl %edx, %edx
xorl %esi, %esi
xorl %edi, %edi
leaq 0x34329(%rip), %r15     # 0x35b90
movzbl (%rdx,%rbx), %r8d
movzbl (%rdx,%r15), %r9d
movl $0x80, %r10d
movl $0x8, %r11d
movl %r10d, %r14d
andl %r8d, %r14d
cmpl $0x1, %r14d
sbbl $-0x1, %esi
movl %r10d, %r14d
andl %r9d, %r14d
cmpl $0x1, %r14d
sbbl $-0x1, %edi
shrl %r10d
decl %r11d
jne 0x187d
incq %rdx
cmpq $0x9, %rdx
jne 0x1867
cmpl %edi, %esi
jle 0x18da
leaq 0x327dd(%rip), %rdx     # 0x34090
movb %al, (%rdx,%rcx)
movl %ebp, %eax
xorl %ecx, %ecx
movb 0x1(%rcx,%r15), %dl
incq %rcx
notb %dl
cltq
leaq (%r12,%rax), %rsi
movb %dl, (%r13,%rsi)
addl $0x100, %eax            # imm = 0x100
cmpq $0x8, %rcx
jne 0x18ba
incq %r12
movq 0x18(%rsp), %rdi
addq $0x8, %rdi
cmpq $0x20, %r12
jne 0x16a4
jmp 0x191b
movq 0x26e7(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
leaq 0x8a6(%rip), %rsi       # 0x21a9
movl %r12d, %edx
movq (%rsp), %rcx
xorl %eax, %eax
callq 0x1050
movq 0x18(%rsp), %rdi
jmp 0x179d
movl 0xc(%rsp), %ebp
incl %ebp
cmpl $0x8, %ebp
movl $0x40, %eax
cmovel %eax, %ebp
cmpl $0x48, %ebp
movl $0x80, %eax
cmovel %eax, %ebp
movq (%rsp), %rcx
incq %rcx
movq 0x20(%rsp), %rax
addq $0x800, %rax            # imm = 0x800
cmpq $0x18, %rcx
jne 0x1685
movq 0x2666(%rip), %rbx      # 0x3fc0
movq (%rbx), %rcx
leaq 0x32a2c(%rip), %rdi     # 0x34390
movl $0x20, %esi
movl $0xc0, %edx
callq 0x10b0
movq (%rbx), %rcx
leaq 0x32713(%rip), %rdi     # 0x34090
movl $0x20, %esi
movl $0x18, %edx
callq 0x10b0
xorl %edi, %edi
callq 0x1040
leaq 0x84d(%rip), %rdi       # 0x21e7
callq 0x1070
jmp 0x19f1
movq 0x2638(%rip), %rax      # 0x3fe0
movq (%rax), %rcx
leaq 0x754(%rip), %rdi       # 0x2106
movl $0x22, %esi
jmp 0x19e7
movq 0x2620(%rip), %rax      # 0x3fe0
movq (%rax), %rcx
leaq 0x75f(%rip), %rdi       # 0x2129
movl $0x11, %esi
jmp 0x19e7
movq 0x2608(%rip), %rax      # 0x3fe0
movq (%rax), %rcx
leaq 0x759(%rip), %rdi       # 0x213b
movl $0x31, %esi
movl $0x1, %edx
callq 0x10b0
movl $0x1, %edi
callq 0x1040