// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: init_screen(int)
void init_screen(int why)
{
Cursor cur;
unsigned char *vfx_font;
int font_height;
int i;
unsigned int j;
int old_sw, old_sh;

struct DECO_HINTS {  // stuff for disabling window decorations
   u32 flags;
   u32 functions;
   u32 decorations;
   u32 input_mode;
   u32 status;
} deco_hints;
Atom deco;

   // Initialize the graphics screen
printf("\nInit screen %d: %dx%d (potentially rotated)\n", why, SCREEN_WIDTH,SCREEN_HEIGHT);

   config_screen(3);  // initialize screen rendering variables for potentially rotated size
// VFX_io_done = 1;
   kill_screen();    // release any screen data structures currently in use

   old_sw = SCREEN_WIDTH;
   old_sh = SCREEN_HEIGHT;
   SWAP(SCREEN_WIDTH,SCREEN_HEIGHT);  // physical screen size
printf("Physical screen size: %dx%d\n", SCREEN_WIDTH,SCREEN_HEIGHT);

   // setup text drawing using WIN_VFX fonts
   if(user_font_size == 0)  {
      if(big_plot && (ebolt == 0)) {
         vfx_font = &h_medium_font[0];
         user_font_size = 14;
      }
      else {
         vfx_font = &h_font_12[0];
         user_font_size = 12;
      }
   }
   else if(user_font_size <= 8)  {
      vfx_font = &h_small_font[0];
      user_font_size = 8;
   }
   else if(user_font_size <= 12) {
      vfx_font = &h_font_12[0];
      user_font_size = 12;
   }
   else if(user_font_size <= 14) {
      vfx_font = &h_medium_font[0];
      user_font_size = 14;
   }
   else if(user_font_size <= 16) {
      vfx_font = &h_large_font[0];
      user_font_size = 16;
   }
   else {
      vfx_font = &h_font_12[0];
      user_font_size = 12;
   }

   font_height = user_font_size;
   TEXT_HEIGHT = font_height;
   TEXT_WIDTH  = 8;  // !!!!!!!
   if(font_height <= 12) {
      small_font = 2;
   }
   else small_font = 0;

   dot_font = (unsigned char *) (void *) vfx_font;



   /*  Window variables  */

   int          x, y;
   unsigned int width, height;
   char *window_name;
   char *icon_name;

   if(luxor) {
      window_name = "Luxor X11";
      icon_name   = "Luxor";
   }
   else {
      window_name = &szAppName[0];  // "Lady Heather X11";
      icon_name   = "Heather";
   }


   /*  Display variables  */

   char *       display_name = NULL;


   /*  Miscellaneous X11 variables  */

   XTextProperty windowName, iconName;
   XGCValues     values;

   if(luxor) appname = "LUXOR";  // !!!argv[0];
   else      appname = "HEATHER";  // !!!argv[0];


   /*  Allocate memory for X11 structures  */

   if ( !( size_hints  = XAllocSizeHints() ) ||
        !( wm_hints    = XAllocWMHints()   ) ||
        !( class_hints = XAllocClassHint() )    ) {
       sprintf(out, "%s: couldn't allocate memory.\n", appname);
       error_exit(10005, out);
   }


   /*  Connect to X11 server  */

   display = XOpenDisplay(display_name);
   if(display == NULL) {
      sprintf(out, "%s: couldn't connect to X server %s\n", appname, display_name);
      error_exit(10006, out);
   }


   /*  Get screen size from display structure macro  */

   screen_num     = DefaultScreen(display);
   display_width  = DisplayWidth(display, screen_num);
   display_height = DisplayHeight(display, screen_num);
   have_root_info = 1;

printf("Config disp: %dx%d  screen:%dx%d  kill_decorations:%d  go_full:%d\n", display_width,display_height, SCREEN_WIDTH,SCREEN_HEIGHT, kill_deco, go_fullscreen);
   if(go_fullscreen && (display_width >= MIN_WIDTH) && (display_height >= MIN_HEIGHT)) {
      SCREEN_WIDTH  = display_width;
      SCREEN_HEIGHT = display_height;
      go_fullscreen = 0;
   }
if(kill_deco) go_fullscreen = 1;
printf("Display size: %dx%d  screen:%dx%d  kill_decorations:%d  go_full:%d\n", display_width,display_height, SCREEN_WIDTH,SCREEN_HEIGHT, kill_deco, go_fullscreen);


   if(!RESTORE_MAXED_WINDOW) ; // don't attempt to restore maximized window size
   else if(((unsigned) SCREEN_WIDTH >= display_width) || ((unsigned) SCREEN_HEIGHT >= display_height)) {  // request for large screen
      if(x11_maxed) {
         if(have_restore_size) {
            SCREEN_WIDTH = restore_width;   //1024;
            SCREEN_HEIGHT = restore_height; // 768
         }
         x11_maxed = 0;
printf("have restore size %d: %d %d   new:%d %d\n", have_restore_size, restore_width,restore_height, new_width,new_height);
      }
      else {
         x11_maxed = 1;
printf("maximize window\n");
      }
   }




   /*  Set initial window size and position, and create it  */

   x = x11_left;
   y = x11_top;
   width  = SCREEN_WIDTH;
   height = SCREEN_HEIGHT;
printf("creating %dx%d simple window at %d,%d\n", width,height, x,y);
   screen = XCreateSimpleWindow(display, RootWindow(display,screen_num),
                             x,y, width,height, 0,
                             WhitePixel(display, screen_num),
                             BlackPixel(display, screen_num));

   if(screen == 0) {
       error_exit(10010, "Could not create X11 simple window");
   }

printf("Get window attributes\n");
   XGetWindowAttributes(display,screen, &wattr);  // winz
   x11_left = wattr.x;
   x11_top = wattr.y;
   if(x11_left < 0) x11_left = 0;
   if(x11_top < 0) x11_top = 0;
printf("Window color depth: %d  left/top:%dx%d\n", wattr.depth, x11_left,x11_top);


   // setup screen palette
   memset(palette,0xff,sizeof(palette));
   setup_palette();

//for(xx=0; xx<16; xx++) printf("pal %2d: %08lX\n", xx,palette[xx]);
//printf("white:  %08lX\n", WhitePixel(display,screen_num));

printf("Palette setup\n");
   /*  Set hints for window manager before mapping window  */

   if(XStringListToTextProperty(&window_name, 1, &windowName) == 0 ) {
      sprintf(out, "%s: structure allocation for windowName failed.\n", appname);
      error_exit(10007, out);
   }
printf("Text properties set.\n");
   if(XStringListToTextProperty(&icon_name, 1, &iconName) == 0 ) {
      sprintf(out, "%s: structure allocation for iconName failed.\n", appname);
      error_exit(10008, out);
   }
printf("Icon name set\n");
   /*  Create graphics context  */
printf("creating gc\n");
fflush(stdout);
   gc = XCreateGC(display,screen, 0, &values); // winz
   if(gc == 0) {
      sprintf(out, "Could not create graphics context");
      error_exit(10018, out);
   }

   // Create the icon pixmap
   i = read_pixmap_file();
   if(i) {  // XPM pixmap not loaded, try a monochrome XBM bitmap
      if(luxor) i = XReadBitmapFile(display,screen, "luxor.xbm", &j,&j, &icon_map, &i,&i);
      else      i = XReadBitmapFile(display,screen, "heather.xbm", &j,&j, &icon_map, &i,&i);
   }
   else {  // XPM pixmap created
      i = BitmapSuccess;
   }

   if(i != BitmapSuccess) {
printf("No icon image found.\n");
      icon_map = 0;
   }

   size_hints->flags       = PPosition | PSize | PMinSize;
   size_hints->min_width   = MIN_WIDTH;
   size_hints->min_height  = MIN_HEIGHT;

   if(icon_map) wm_hints->flags = StateHint | InputHint | IconPixmapHint;
   else         wm_hints->flags = StateHint | InputHint;
   wm_hints->initial_state = NormalState;
   wm_hints->input         = True;
   wm_hints->icon_pixmap   = icon_map;

   class_hints->res_name   = appname;
   if(luxor) class_hints->res_class  = "luxor";
   else      class_hints->res_class  = "heather";
printf("setting properties\n");
   XSetWMProperties(display,screen, &windowName, &iconName, 0,0, // winz- argv, argc,
                    size_hints, wm_hints, class_hints);

   wmDeleteMessage = XInternAtom(display, "WM_DELETE_WINDOW",  0);
   XSetWMProtocols(display,screen, &wmDeleteMessage, 1);


   if(kill_deco) {  // disable window decorations to get a full screen display
      deco_hints.flags = 2;
      deco_hints.functions = 0;
      deco_hints.decorations = 0;
      deco_hints.input_mode = 0;
      deco_hints.status = 0;

      deco = XInternAtom(display, "_MOTIF_WM_HINTS", 1);

      if(deco) {
printf("Killing window decorations!\n");
         touch_screen = 1;  // make sure virtual keyboard is available.
                            // If the window size does not match the monitor size
                            // you can lose access to the real keyboard.
         XChangeProperty(display,screen, deco,deco, 32, PropModeReplace, (unsigned char *) &deco_hints, 5);
      }
   }


   /*  Choose which events we want to handle  */

   XSelectInput(display,screen, ExposureMask | KeyPressMask | PointerMotionMask |
                ButtonPressMask | ButtonReleaseMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask);   // winz


   cur = XCreateFontCursor(display, 132);
   if(cur) XDefineCursor(display,screen, cur);    // winz


   XSetForeground(display,gc, WhitePixel(display, screen_num));


   /*  Display Window  */

   XMapWindow(display,screen);  // winz
printf("window mapped    Pixmap wh:%dx%d\n", width,height);
   pix_map = XCreatePixmap(display,screen, width,height, wattr.depth); // winz
   if(pix_map == 0) {
      error_exit(30000, "Could not create pix_map");
   }
printf("pixmap created\n");
   Sleep(X11_sleep);
   XFlush(display);

printf("Display size2: %dx%d\n", SCREEN_WIDTH,SCREEN_HEIGHT);
   SWAP(SCREEN_WIDTH,SCREEN_HEIGHT);
//SCREEN_WIDTH = old_sw;   //piss
//SCREEN_HEIGHT = old_sh;
   config_screen(why);  // re-initialize screen rendering variables
                        // to reflect any changes due to font size
   XFlush(display);

   #ifdef BUFFER_LLA
//lla clear_lla_points(0);
   #endif

printf("screen configured. why=%d  %dx%d (potentially rotated)\n", why, SCREEN_WIDTH,SCREEN_HEIGHT);
   erase_rectangle(0,0, SCREEN_WIDTH,SCREEN_HEIGHT);
printf("screen init done\n\n");
fflush(stdout);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movl %edi, %ebx
movl 0x1f6bd9(%rip), %edx    # 0x202800
movl 0x1f6bd7(%rip), %ecx    # 0x202804
leaq 0xe7fb3(%rip), %rdi     # 0xf3be7
movl %ebx, %esi
xorl %eax, %eax
callq 0x9030
pushq $0x3
popq %rdi
callq 0xcc4f
callq 0xc5b5
cmpl $0x0, 0x1f6bd7(%rip)    # 0x202828
movl 0x1f6ba9(%rip), %eax    # 0x202800
movl 0x1f6ba7(%rip), %esi    # 0x202804
je 0xbc75
movl %esi, 0x1f6bc7(%rip)    # 0x20282c
movl %eax, 0x1f6b99(%rip)    # 0x202804
movl %esi, 0x1f6b8f(%rip)    # 0x202800
movl %eax, %edx
jmp 0xbc79
movl %esi, %edx
movl %eax, %esi
leaq 0xe7f95(%rip), %rdi     # 0xf3c15
xorl %eax, %eax
callq 0x9030
movb 0x1f6bcb(%rip), %cl     # 0x202858
testb %cl, %cl
je 0xbca9
movb $0x2, %al
cmpb $0x9, %cl
jae 0xbcea
leaq 0x12e731(%rip), %rcx    # 0x13a3d0
pushq $0x8
popq %rsi
movb $0x8, %dl
jmp 0xbd43
cmpb $0x0, 0x1f6b80(%rip)    # 0x202830
setne %cl
cmpl $0x0, 0x21d26a(%rip)    # 0x228f24
sete %al
andb %cl, %al
leal (%rax,%rax), %edx
orb $0xc, %dl
movzbl %al, %edi
xorb $0x1, %al
addb %al, %al
leal 0xc(,%rdi,2), %esi
leaq 0x133f16(%rip), %r8     # 0x13fbf0
leaq 0x130aff(%rip), %rcx    # 0x13c7e0
testb %dil, %dil
cmovneq %r8, %rcx
jmp 0xbd43
cmpb $0xd, %cl
jae 0xbcfd
leaq 0x130aea(%rip), %rcx    # 0x13c7e0
pushq $0xc
popq %rsi
movb $0xc, %dl
jmp 0xbd43
cmpb $0xf, %cl
jae 0xbd12
leaq 0x133ee7(%rip), %rcx    # 0x13fbf0
pushq $0xe
popq %rsi
movb $0xe, %dl
xorl %eax, %eax
jmp 0xbd43
xorl %esi, %esi
cmpb $0x11, %cl
setae %al
setb %sil
leaq 0x137adb(%rip), %rdx    # 0x143800
leaq 0x130ab4(%rip), %rcx    # 0x13c7e0
cmovbq %rdx, %rcx
leal (,%rsi,4), %edx
addb $0xc, %dl
addb %al, %al
leal 0xc(,%rsi,4), %esi
movb %dl, 0x1f6b0f(%rip)     # 0x202858
movl %esi, 0x1f6ac5(%rip)    # 0x202814
movl $0x8, 0x1f6ab7(%rip)    # 0x202810
movb %al, 0x1f6afa(%rip)     # 0x202859
cmpb $0x0, 0x21d1d8(%rip)    # 0x228f3e
leaq 0x13bea3(%rip), %rax    # 0x147c10
leaq 0xe7ebe(%rip), %rdx     # 0xf3c32
cmoveq %rax, %rdx
leaq 0xe7ebd(%rip), %rax     # 0xf3c3c
leaq 0x10bf37(%rip), %rsi    # 0x117cbd
cmoveq %rax, %rsi
movq %rcx, 0x31e157(%rip)    # 0x329ee8
movq %rdx, -0x40(%rbp)
movq %rsi, -0x38(%rbp)
leaq 0xe7eaa(%rip), %rax     # 0xf3c4a
leaq 0xe7e9d(%rip), %rcx     # 0xf3c44
cmoveq %rax, %rcx
movq %rcx, 0x14f13e(%rip)    # 0x15aef0
callq 0x9070
movq %rax, 0x31e19a(%rip)    # 0x329f58
testq %rax, %rax
je 0xbde5
callq 0x9270
movq %rax, 0x31e191(%rip)    # 0x329f60
testq %rax, %rax
je 0xbde5
callq 0x95a0
movq %rax, 0x31e188(%rip)    # 0x329f68
testq %rax, %rax
jne 0xbe11
movq 0x14f104(%rip), %rdx    # 0x15aef0
leaq 0x31a42d(%rip), %r14    # 0x326220
leaq 0xe7e58(%rip), %rsi     # 0xf3c52
movq %r14, %rdi
xorl %eax, %eax
callq 0x9060
movl $0x2715, %edi           # imm = 0x2715
movq %r14, %rsi
callq 0xb290
xorl %edi, %edi
callq 0x94e0
movq %rax, 0x14f0a1(%rip)    # 0x15aec0
testq %rax, %rax
jne 0xbe59
movq 0x14f0c5(%rip), %rdx    # 0x15aef0
leaq 0x31a3ee(%rip), %r14    # 0x326220
leaq 0xe7e38(%rip), %rsi     # 0xf3c71
movq %r14, %rdi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x9060
movl $0x2716, %edi           # imm = 0x2716
movq %r14, %rsi
callq 0xb290
movq 0x14f067(%rip), %rax    # 0x15aec0
movslq 0xe0(%rax), %rcx
movl %ecx, 0x14f082(%rip)    # 0x15aee8
movq 0xe8(%rax), %rax
shlq $0x7, %rcx
movl 0x18(%rax,%rcx), %esi
movl %esi, 0x1f697d(%rip)    # 0x2027f8
movl 0x1c(%rax,%rcx), %edx
movl %edx, 0x1f6977(%rip)    # 0x2027fc
movl $0x1, 0x14f01d(%rip)    # 0x15aeac
movl 0x1f696b(%rip), %ecx    # 0x202800
movl 0x1f6968(%rip), %r8d    # 0x202804
movl 0x1f6981(%rip), %r9d    # 0x202824
movl 0x1f6937(%rip), %eax    # 0x2027e0
movl %eax, (%rsp)
leaq 0xe7de3(%rip), %rdi     # 0xf3c96
xorl %eax, %eax
callq 0x9030
movl 0x1f6920(%rip), %eax    # 0x2027e0
testl %eax, %eax
setne %cl
movl 0x1f692d(%rip), %esi    # 0x2027f8
movl $0x140, %edi            # imm = 0x140
cmpl %edi, %esi
setae %r8b
movl 0x1f6920(%rip), %edx    # 0x2027fc
cmpl %edi, %edx
setae %dil
andb %r8b, %dil
andb %cl, %dil
cmpb $0x1, %dil
jne 0xbf03
movl %esi, 0x1f690c(%rip)    # 0x202800
movl %edx, 0x1f690a(%rip)    # 0x202804
andl $0x0, 0x1f68df(%rip)    # 0x2027e0
xorl %eax, %eax
movl 0x1f691a(%rip), %r9d    # 0x202824
testl %r9d, %r9d
je 0xbf1c
movl $0x1, 0x1f68c7(%rip)    # 0x2027e0
pushq $0x1
popq %rax
movl 0x1f68de(%rip), %ecx    # 0x202800
movl 0x1f68db(%rip), %r8d    # 0x202804
movl %eax, (%rsp)
leaq 0xe7da6(%rip), %rdi     # 0xf3cd9
xorl %eax, %eax
callq 0x9030
movl 0x1f68c0(%rip), %eax    # 0x202800
cmpl 0x1f68b2(%rip), %eax    # 0x2027f8
jae 0xbf56
movl 0x1f68b6(%rip), %eax    # 0x202804
cmpl 0x1f68a8(%rip), %eax    # 0x2027fc
jb 0xbfbc
cmpl $0x0, 0x14ef5f(%rip)    # 0x15aebc
je 0xbfa6
movl 0x14ef4b(%rip), %esi    # 0x15aeb0
movl 0x14ef49(%rip), %edx    # 0x15aeb4
movl 0x14ef47(%rip), %ecx    # 0x15aeb8
testl %esi, %esi
je 0xbf81
movl %edx, 0x1f6885(%rip)    # 0x202800
movl %ecx, 0x1f6883(%rip)    # 0x202804
andl $0x0, 0x14ef34(%rip)    # 0x15aebc
movl 0x1f68c1(%rip), %r8d    # 0x202850
movl 0x1f68be(%rip), %r9d    # 0x202854
leaq 0xe7d80(%rip), %rdi     # 0xf3d1d
xorl %eax, %eax
callq 0x9030
jmp 0xbfbc
movl $0x1, 0x14ef0c(%rip)    # 0x15aebc
leaq 0xe97a6(%rip), %rdi     # 0xf575d
callq 0x95d0
movl 0x14ef35(%rip), %r12d   # 0x15aef8
movl 0x14ef32(%rip), %r13d   # 0x15aefc
movl 0x1f682f(%rip), %r14d   # 0x202800
movl 0x1f682c(%rip), %r15d   # 0x202804
leaq 0xe7d67(%rip), %rdi     # 0xf3d46
movl %r14d, %esi
movl %r15d, %edx
movl %r12d, %ecx
movl %r13d, %r8d
xorl %eax, %eax
callq 0x9030
movq 0x14eec7(%rip), %rdi    # 0x15aec0
movq 0xe8(%rdi), %rax
movslq 0x14eee1(%rip), %rcx    # 0x15aee8
shlq $0x7, %rcx
movq 0x10(%rax,%rcx), %rsi
movdqu 0x58(%rax,%rcx), %xmm0
movdqu %xmm0, 0x8(%rsp)
andl $0x0, (%rsp)
movl %r12d, %edx
movl %r13d, %ecx
movl %r14d, %r8d
movl %r15d, %r9d
callq 0x90c0
movq %rax, 0x14ee90(%rip)    # 0x15aec8
testq %rax, %rax
jne 0xc04e
leaq 0xe7d29(%rip), %rsi     # 0xf3d6d
movl $0x271a, %edi           # imm = 0x271A
callq 0xb290
leaq 0xe9718(%rip), %rdi     # 0xf576d
callq 0x95d0
movq 0x14ee5f(%rip), %rdi    # 0x15aec0
movq 0x14ee60(%rip), %rsi    # 0x15aec8
leaq 0x31df01(%rip), %rdx    # 0x329f70
callq 0x96d0
movl 0x31def6(%rip), %edx    # 0x329f70
movl %edx, 0x14ee78(%rip)    # 0x15aef8
movl 0x31deee(%rip), %ecx    # 0x329f74
movl %ecx, 0x14ee70(%rip)    # 0x15aefc
testl %edx, %edx
jns 0xc099
andl $0x0, 0x14ee61(%rip)    # 0x15aef8
xorl %edx, %edx
testl %ecx, %ecx
jns 0xc0a6
andl $0x0, 0x14ee58(%rip)    # 0x15aefc
xorl %ecx, %ecx
movl 0x31ded8(%rip), %esi    # 0x329f84
leaq 0xe7cdd(%rip), %rdi     # 0xf3d90
xorl %eax, %eax
callq 0x9030
pcmpeqd %xmm0, %xmm0
movdqa %xmm0, 0x14eeba(%rip)   # 0x15af80
movdqa %xmm0, 0x14eec2(%rip)   # 0x15af90
movdqa %xmm0, 0x14eeca(%rip)   # 0x15afa0
movdqa %xmm0, 0x14eed2(%rip)   # 0x15afb0
callq 0xd056
leaq 0xe9699(%rip), %rdi     # 0xf5783
callq 0x95d0
leaq -0x40(%rbp), %rdi
pushq $0x1
popq %rsi
leaq -0x98(%rbp), %rdx
callq 0x9370
testl %eax, %eax
jne 0xc132
movq 0x14ede3(%rip), %rdx    # 0x15aef0
leaq 0x31a10c(%rip), %r12    # 0x326220
leaq 0xe7c9d(%rip), %rsi     # 0xf3db8
movq %r12, %rdi
xorl %eax, %eax
callq 0x9060
movl $0x2717, %edi           # imm = 0x2717
movq %r12, %rsi
callq 0xb290
leaq 0xe9658(%rip), %rdi     # 0xf5791
callq 0x95d0
leaq -0x38(%rbp), %rdi
pushq $0x1
popq %rsi
leaq -0x78(%rbp), %rdx
callq 0x9370
testl %eax, %eax
jne 0xc17e
movq 0x14ed97(%rip), %rdx    # 0x15aef0
leaq 0x31a0c0(%rip), %r12    # 0x326220
leaq 0xe7c82(%rip), %rsi     # 0xf3de9
movq %r12, %rdi
xorl %eax, %eax
callq 0x9060
movl $0x2718, %edi           # imm = 0x2718
movq %r12, %rsi
callq 0xb290
leaq 0xe9621(%rip), %rdi     # 0xf57a6
callq 0x95d0
leaq 0xe9623(%rip), %rdi     # 0xf57b4
callq 0x95d0
movq 0x12dcdb(%rip), %r13    # 0x139e78
movq (%r13), %rdi
callq 0x9420
movq 0x14ed13(%rip), %rdi    # 0x15aec0
movq 0x14ed14(%rip), %rsi    # 0x15aec8
leaq -0x118(%rbp), %rcx
xorl %edx, %edx
callq 0x9180
movq %rax, 0x14ed17(%rip)    # 0x15aee0
testq %rax, %rax
jne 0xc206
movups 0xe7c53(%rip), %xmm0    # 0xf3e28
movaps %xmm0, 0x31a054(%rip)   # 0x326230
movdqu 0xe7c34(%rip), %xmm0    # 0xf3e18
movdqa %xmm0, 0x31a034(%rip)   # 0x326220
movw $0x74, 0x31a04b(%rip)   # 0x326240
leaq 0x31a024(%rip), %rsi    # 0x326220
movl $0x2722, %edi           # imm = 0x2722
callq 0xb290
callq 0xc6df
movl %eax, -0x2c(%rbp)
testl %eax, %eax
je 0xc277
cmpb $0x0, 0x21cd25(%rip)    # 0x228f3e
movq 0x14eca0(%rip), %rdi    # 0x15aec0
movq 0x14eca1(%rip), %rsi    # 0x15aec8
leaq 0xe7c16(%rip), %rax     # 0xf3e44
leaq 0xe7c05(%rip), %rdx     # 0xf3e3a
cmoveq %rax, %rdx
leaq -0x2c(%rbp), %r12
movq %r12, 0x8(%rsp)
movq %r12, (%rsp)
leaq 0x14ec8b(%rip), %r9     # 0x15aed8
leaq -0x44(%rbp), %rcx
movq %rcx, %r8
callq 0x9670
movl %eax, (%r12)
testl %eax, %eax
je 0xc27b
leaq 0xe9558(%rip), %rdi     # 0xf57c0
callq 0x95d0
andq $0x0, 0x14ec63(%rip)    # 0x15aed8
jmp 0xc27b
andl $0x0, -0x2c(%rbp)
movq 0x31dcd6(%rip), %rax    # 0x329f58
movq $0x1c, (%rax)
movabsq $0x14000000140, %rcx    # imm = 0x14000000140
movq %rcx, 0x18(%rax)
xorl %eax, %eax
cmpq $0x0, 0x14ec37(%rip)    # 0x15aed8
setne %al
movq 0x31dcb5(%rip), %rcx    # 0x329f60
leaq 0x3(,%rax,4), %rax
movq %rax, (%rcx)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x8(%rcx)
movq 0x14ec0d(%rip), %rax    # 0x15aed8
movq %rax, 0x10(%rcx)
movq 0x14ec1a(%rip), %rax    # 0x15aef0
movq 0x31dc8b(%rip), %rcx    # 0x329f68
movq %rax, (%rcx)
cmpb $0x0, 0x21cc57(%rip)    # 0x228f3e
leaq 0xe77bc(%rip), %rax     # 0xf3aaa
leaq 0xe7b5b(%rip), %rcx     # 0xf3e50
cmoveq %rax, %rcx
movq 0x31dc68(%rip), %rax    # 0x329f68
movq %rcx, 0x8(%rax)
leaq 0xe94ca(%rip), %rdi     # 0xf57d5
callq 0x95d0
movq 0x14eba9(%rip), %rdi    # 0x15aec0
movq 0x14ebaa(%rip), %rsi    # 0x15aec8
movq 0x31dc33(%rip), %rax    # 0x329f58
movq 0x31dc34(%rip), %rcx    # 0x329f60
movq 0x31dc35(%rip), %rdx    # 0x329f68
movq %rdx, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movq %rax, (%rsp)
leaq -0x98(%rbp), %rdx
leaq -0x78(%rbp), %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x94f0
movq 0x14eb62(%rip), %rdi    # 0x15aec0
leaq 0xe7af1(%rip), %rsi     # 0xf3e56
xorl %edx, %edx
callq 0x9240
movq %rax, 0x31dc85(%rip)    # 0x329ff8
leaq 0x31dc7e(%rip), %rdx    # 0x329ff8
movq 0x14eb3f(%rip), %rdi    # 0x15aec0
movq 0x14eb40(%rip), %rsi    # 0x15aec8
pushq $0x1
popq %rcx
callq 0x91b0
cmpl $0x0, 0x1f648d(%rip)    # 0x202824
je 0xc40a
movl $0x2, -0x58(%rbp)
pxor %xmm0, %xmm0
movdqu %xmm0, -0x54(%rbp)
movq 0x14eb10(%rip), %rdi    # 0x15aec0
leaq 0xe7ab0(%rip), %rsi     # 0xf3e67
pushq $0x1
popq %rdx
callq 0x9240
testq %rax, %rax
je 0xc40a
movq %rax, %r12
leaq 0xe941a(%rip), %rdi     # 0xf57e8
callq 0x95d0
movb $0x1, 0x1f8e44(%rip)    # 0x20521e
movq 0x14eadf(%rip), %rdi    # 0x15aec0
movq 0x14eae0(%rip), %rsi    # 0x15aec8
leaq -0x58(%rbp), %rax
movq %rax, (%rsp)
movl $0x5, 0x8(%rsp)
pushq $0x20
popq %r8
movq %r12, %rdx
movq %r12, %rcx
xorl %r9d, %r9d
callq 0x92e0
movq 0x14eaaf(%rip), %rdi    # 0x15aec0
movq 0x14eab0(%rip), %rsi    # 0x15aec8
movl $0x2807d, %edx          # imm = 0x2807D
callq 0x9200
movq 0x14ea97(%rip), %rdi    # 0x15aec0
movl $0x84, %esi
callq 0x91c0
testq %rax, %rax
je 0xc44e
movq 0x14ea81(%rip), %rdi    # 0x15aec0
movq 0x14ea82(%rip), %rsi    # 0x15aec8
movq %rax, %rdx
callq 0x9690
movq 0x14ea6b(%rip), %rdi    # 0x15aec0
movq 0x14ea84(%rip), %rsi    # 0x15aee0
movq 0xe8(%rdi), %rax
movslq 0x14ea7e(%rip), %rcx    # 0x15aee8
shlq $0x7, %rcx
movq 0x58(%rax,%rcx), %rdx
callq 0x90d0
movq 0x14ea41(%rip), %rdi    # 0x15aec0
movq 0x14ea42(%rip), %rsi    # 0x15aec8
callq 0x93f0
leaq 0xe79e5(%rip), %rdi     # 0xf3e77
movl %r14d, %esi
movl %r15d, %edx
xorl %eax, %eax
callq 0x9030
movq 0x14ea1a(%rip), %rdi    # 0x15aec0
movq 0x14ea1b(%rip), %rsi    # 0x15aec8
movl 0x31dad0(%rip), %r8d    # 0x329f84
movl %r14d, %edx
movl %r15d, %ecx
callq 0x90b0
movq %rax, 0x14ea0a(%rip)    # 0x15aed0
testq %rax, %rax
jne 0xc4dc
leaq 0xe79c7(%rip), %rsi     # 0xf3e99
movl $0x7530, %edi           # imm = 0x7530
callq 0xb290
leaq 0xe9338(%rip), %rdi     # 0xf581b
callq 0x95d0
pushq $0x64
popq %rdi
callq 0xae83
movq 0x14e9c9(%rip), %rdi    # 0x15aec0
callq 0x95c0
movl 0x1f62fe(%rip), %esi    # 0x202800
movl 0x1f62fc(%rip), %edx    # 0x202804
leaq 0xe79a3(%rip), %rdi     # 0xf3eb2
xorl %eax, %eax
callq 0x9030
cmpl $0x0, 0x1f630b(%rip)    # 0x202828
je 0xc53d
movl 0x1f62df(%rip), %eax    # 0x202804
movl %eax, 0x1f6301(%rip)    # 0x20282c
movl 0x1f62cf(%rip), %ecx    # 0x202800
movl %ecx, 0x1f62cd(%rip)    # 0x202804
movl %eax, 0x1f62c3(%rip)    # 0x202800
movl %ebx, %edi
callq 0xcc4f
movq 0x14e975(%rip), %rdi    # 0x15aec0
callq 0x95c0
movl 0x1f62aa(%rip), %edx    # 0x202800
movl 0x1f62a8(%rip), %ecx    # 0x202804
leaq 0xe7965(%rip), %rdi     # 0xf3ec8
movl %ebx, %esi
xorl %eax, %eax
callq 0x9030
movl 0x1f628e(%rip), %edx    # 0x202800
movl 0x1f628c(%rip), %ecx    # 0x202804
xorl %edi, %edi
xorl %esi, %esi
callq 0xd0da
leaq 0xe927c(%rip), %rdi     # 0xf5804
callq 0x95d0
movq (%r13), %rdi
callq 0x9420
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq