// File: /workspace/github_cpp_makefile_star2_O1/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 0x1e4343(%rip), %r15    # 0x218804
cmpl $0x190, (%r15)          # imm = 0x190
jl 0x344d9
leaq 0x1e432f(%rip), %rax    # 0x218800
cmpl $0x1c1, (%rax)          # imm = 0x1C1
jg 0x344f3
leaq 0x1ef060(%rip), %rax    # 0x223540
movl $0x0, (%rax)
leaq 0x1ef057(%rip), %rax    # 0x223544
movl $0x64, (%rax)
leaq 0x30ade6(%rip), %rbx    # 0x33f2e0
movq %rbx, %rdi
callq 0x9899
movq %rbx, %rdi
movl $0x4e, %esi
callq 0x9100
testq %rax, %rax
jne 0x346db
leaq 0x30adc1(%rip), %rdi    # 0x33f2e0
movl $0x3a, %esi
callq 0x9100
movb $0xc, %r12b
testq %rax, %rax
jne 0x34595
leaq 0x30ada8(%rip), %rdi    # 0x33f2e0
movl $0x53, %esi
callq 0x9100
testq %rax, %rax
jne 0x34595
leaq 0x30ad92(%rip), %rdi    # 0x33f2e0
movl $0x4d, %esi
callq 0x9100
movb $0xe, %r12b
testq %rax, %rax
jne 0x34595
leaq 0x30ad79(%rip), %rdi    # 0x33f2e0
movl $0x4c, %esi
callq 0x9100
movb $0x10, %r12b
testq %rax, %rax
jne 0x34595
leaq 0x30ad60(%rip), %rdi    # 0x33f2e0
movl $0x54, %esi
callq 0x9100
testq %rax, %rax
setne %r12b
shlb $0x3, %r12b
leaq 0x30ad44(%rip), %rdi    # 0x33f2e0
movl $0x49, %esi
callq 0x9100
testq %rax, %rax
je 0x345b0
callq 0xf437
leaq 0x1e427a(%rip), %rax    # 0x218831
movzbl (%rax), %ecx
cmpl $0x66, %ecx
je 0x34663
cmpl $0x63, %ecx
jne 0x346b4
leaq 0x30ad0d(%rip), %rdi    # 0x33f2e0
movl $0x4e, %esi
callq 0x9100
testq %rax, %rax
jne 0x346db
leaq 0x1e422f(%rip), %rbx    # 0x21881c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, (%rbx)
leaq 0x1e421d(%rip), %r14    # 0x218818
movl %eax, (%r14)
leaq 0x30acdb(%rip), %rdi    # 0x33f2e0
leaq 0xe9a39(%rip), %rsi     # 0x11e045
leaq -0x21(%rbp), %rcx
movq %r14, %rdx
movq %rbx, %r8
xorl %eax, %eax
callq 0x9360
cmpl $0x3, %eax
jne 0x346db
movl (%r14), %ecx
movl (%rbx), %eax
movl %ecx, %edx
orl %eax, %edx
js 0x346db
cmpl $0x13f, %ecx            # imm = 0x13F
jg 0x34644
movl $0x140, (%r14)          # imm = 0x140
cmpl $0x1001, (%r14)         # imm = 0x1001
jl 0x34654
movl $0x1000, (%r14)         # imm = 0x1000
cmpl $0x13f, %eax            # imm = 0x13F
jg 0x346b4
movl $0x140, (%rbx)          # imm = 0x140
jmp 0x346b4
leaq 0x1e418e(%rip), %rcx    # 0x2187f8
movl (%rcx), %edi
leaq 0x1e41a5(%rip), %rdx    # 0x218818
movl %edi, (%rdx)
leaq 0x1e4180(%rip), %rcx    # 0x2187fc
movl (%rcx), %esi
leaq 0x1e4197(%rip), %rcx    # 0x21881c
movl %esi, (%rcx)
cmpl $0x13f, %edi            # imm = 0x13F
jg 0x34695
movl $0x140, (%rdx)          # imm = 0x140
cmpl $0x1001, (%rdx)         # imm = 0x1001
jl 0x346a3
movl $0x1000, (%rdx)         # imm = 0x1000
cmpl $0x13f, %esi            # imm = 0x13F
jg 0x346b1
movl $0x140, (%rcx)          # imm = 0x140
movb $0x63, (%rax)
leaq 0x1e419d(%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 0x34428
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq