// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathui.cpp
// Function: edit_screen_res()
void edit_screen_res()
{
int font_set;
int n;
char c;

   // change the screen size
   if((SCREEN_HEIGHT < TINY_TINY_HEIGHT) || (SCREEN_WIDTH < TINY_TINY_WIDTH)) {  // exit vector font mode if switching out of a TINY_TINY mode
      use_vc_fonts = 0;      // if not 0, draw fonts using vector chars
      vc_font_scale = 100;
   }

   strupr(edit_buffer);
   if(strstr(edit_buffer, "N")) return;

   font_set = 0;
   if     (strstr(edit_buffer, ":")) font_set = 12;
   else if(strstr(edit_buffer, "S")) font_set = 12;
   else if(strstr(edit_buffer, "M")) font_set = 14;
   else if(strstr(edit_buffer, "L")) font_set = 16;
   else if(strstr(edit_buffer, "T")) font_set = 8;
   else                              font_set = 0;

   if(strstr(edit_buffer, "I")) invert_screen();

   if(screen_type == 'c') {  // custom screen size
      if(strstr(edit_buffer, "N")) return;

      custom_width = custom_height = (-1);
      n = sscanf(edit_buffer, "%d%c%d", &custom_width,&c,&custom_height);
      if(n != 3) return;
      if(custom_width < 0) return;
      if(custom_height < 0) return;

#ifdef WIN_VFX
      custom_height &= (~1);
      custom_width &= (~1);
#endif  // USE_X11

      if(custom_width < MIN_WIDTH) custom_width = MIN_WIDTH;
      if(custom_width > MAX_WIDTH) custom_width = MAX_WIDTH;
      if(custom_height < MIN_HEIGHT) custom_height = MIN_HEIGHT;
   }
   else if(screen_type == 'f') {
      custom_width = display_width;
      custom_height= display_height;
      if(custom_width < MIN_WIDTH) custom_width = MIN_WIDTH;
      if(custom_width > MAX_WIDTH) custom_width = MAX_WIDTH;
      if(custom_height < MIN_HEIGHT) custom_height = MIN_HEIGHT;
#ifdef WIN_VFX
      custom_height &= (~1);
      custom_width &= (~1);
      custom_width -= 10;
      custom_height -= 32;
#endif  // USE_X11
      screen_type = 'c';
   }

   #ifdef WINDOWS
      if(font_set == 0) {
         if(screen_type == 'c') ;
         else if(strstr(edit_buffer, "Y")) ;
         else if(strstr(edit_buffer, "I")) ;
         else if(0 && strstr(edit_buffer, "F")) ;
         else return;
      }
      if(0 && strstr(edit_buffer, "F")) initial_window_mode = VFX_TRY_FULLSCREEN;
      else initial_window_mode = VFX_WINDOW_MODE;
   #else  // __linux__  __MACH__   __FreeBSD__
   #endif

   if((user_font_size == 0) && (SCREEN_HEIGHT < SHORT_SCREEN)) font_set = 12;
   user_font_size = font_set;

   change_screen_res();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
leaq 0x1e4226(%rip), %r15    # 0x218804
cmpl $0x190, (%r15)          # imm = 0x190
jl 0x345f6
leaq 0x1e4212(%rip), %rax    # 0x218800
cmpl $0x1c1, (%rax)          # imm = 0x1C1
jg 0x34610
leaq 0x1eef43(%rip), %rax    # 0x223540
movl $0x0, (%rax)
leaq 0x1eef3a(%rip), %rax    # 0x223544
movl $0x64, (%rax)
leaq 0x30acc9(%rip), %rbx    # 0x33f2e0
movq %rbx, %rdi
callq 0x9899
movq %rbx, %rdi
movl $0x4e, %esi
callq 0x9100
testq %rax, %rax
jne 0x347f9
leaq 0x30aca4(%rip), %rdi    # 0x33f2e0
movl $0x3a, %esi
callq 0x9100
movb $0xc, %r12b
testq %rax, %rax
jne 0x346b2
leaq 0x30ac8b(%rip), %rdi    # 0x33f2e0
movl $0x53, %esi
callq 0x9100
testq %rax, %rax
jne 0x346b2
leaq 0x30ac75(%rip), %rdi    # 0x33f2e0
movl $0x4d, %esi
callq 0x9100
movb $0xe, %r12b
testq %rax, %rax
jne 0x346b2
leaq 0x30ac5c(%rip), %rdi    # 0x33f2e0
movl $0x4c, %esi
callq 0x9100
movb $0x10, %r12b
testq %rax, %rax
jne 0x346b2
leaq 0x30ac43(%rip), %rdi    # 0x33f2e0
movl $0x54, %esi
callq 0x9100
testq %rax, %rax
setne %r12b
shlb $0x3, %r12b
leaq 0x30ac27(%rip), %rdi    # 0x33f2e0
movl $0x49, %esi
callq 0x9100
testq %rax, %rax
je 0x346cd
callq 0xf3b5
leaq 0x1e415d(%rip), %rax    # 0x218831
movzbl (%rax), %ecx
cmpl $0x66, %ecx
je 0x3477e
cmpl $0x63, %ecx
jne 0x347d2
leaq 0x30abf0(%rip), %rdi    # 0x33f2e0
movl $0x4e, %esi
callq 0x9100
testq %rax, %rax
jne 0x347f9
leaq 0x1e4112(%rip), %rbx    # 0x21881c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, (%rbx)
leaq 0x1e4100(%rip), %r14    # 0x218818
movl %eax, (%r14)
leaq 0x30abbe(%rip), %rdi    # 0x33f2e0
leaq 0xe99a7(%rip), %rsi     # 0x11e0d0
leaq -0x21(%rbp), %rcx
movq %r14, %rdx
movq %rbx, %r8
xorl %eax, %eax
callq 0x9360
cmpl $0x3, %eax
jne 0x347f9
movl (%r14), %ecx
movl (%rbx), %eax
movl %ecx, %edx
orl %eax, %edx
js 0x347f9
movl $0x140, %edx            # imm = 0x140
cmpl $0x140, %ecx            # imm = 0x140
jb 0x3476c
movl $0x1000, %edx           # imm = 0x1000
cmpl $0x1001, %ecx           # imm = 0x1001
jb 0x3476f
movl %edx, (%r14)
cmpl $0x13f, %eax            # imm = 0x13F
ja 0x347d2
movl $0x140, (%rbx)          # imm = 0x140
jmp 0x347d2
leaq 0x1e4073(%rip), %rcx    # 0x2187f8
movl (%rcx), %edi
leaq 0x1e408a(%rip), %rdx    # 0x218818
movl %edi, (%rdx)
leaq 0x1e4065(%rip), %rcx    # 0x2187fc
movl (%rcx), %esi
leaq 0x1e407c(%rip), %rcx    # 0x21881c
movl %esi, (%rcx)
movl $0x140, %r8d            # imm = 0x140
cmpl $0x140, %edi            # imm = 0x140
jl 0x347be
movl $0x1000, %r8d           # imm = 0x1000
cmpl $0x1001, %edi           # imm = 0x1001
jb 0x347c1
movl %r8d, (%rdx)
cmpl $0x13f, %esi            # imm = 0x13F
jg 0x347cf
movl $0x140, (%rcx)          # imm = 0x140
movb $0x63, (%rax)
leaq 0x1e407f(%rip), %rax    # 0x218858
cmpl $0x258, (%r15)          # imm = 0x258
movzbl %r12b, %ecx
movl $0xc, %edx
cmovgel %ecx, %edx
cmpb $0x0, (%rax)
cmovnel %ecx, %edx
movb %dl, (%rax)
callq 0x34545
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq