// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekmsc.c
// Function: setup3dscreen
void
setup3dscreen()
{
     int      i, dax, day, dax2, day2;

     if( screensize > xdim ) {
          dax = 0; day = 0;
          dax2 = xdim-1; day2 = ydim-1;
     }
     else {
          dax = (xdim>>1)-(screensize>>1);
          dax2 = dax+screensize-1;
          day = ((ydim-32)>>1)-(((screensize*(ydim-32))/xdim)>>1);
          day2 = day + ((screensize*(ydim-32))/xdim)-1;
          tekview(&dax,&day,&dax2,&day2);
          setview(dax,day>>detailmode,dax2,day2>>detailmode);
     }
     if( screensize <= xdim ) {
          permanentwritespritetile(0L,0L,BACKGROUND,0,0L,0L,xdim-1,ydim-1,0);
          permanentwritesprite((xdim-320)>>1,ydim-32,STATUSBAR,0,0,0,xdim-1,ydim-1,0);
          i = ((xdim-320)>>1);
          while (i >= 8) i -= 8, permanentwritesprite(i,ydim-32,STATUSBARFILL8,0,0,0,xdim-1,ydim-1,0);
          if (i >= 4) i -= 4, permanentwritesprite(i,ydim-32,STATUSBARFILL4,0,0,0,xdim-1,ydim-1,0);
          i = ((xdim-320)>>1)+320;
          while (i <= xdim-8) permanentwritesprite(i,ydim-32,STATUSBARFILL8,0,0,0,xdim-1,ydim-1,0), i += 8;
          if (i <= xdim-4) permanentwritesprite(i,ydim-32,STATUSBARFILL4,0,0,0,xdim-1,ydim-1,0), i += 4;
     }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
leaq 0x114db3(%rip), %rax    # 0x12eb62
movswl (%rax), %eax
leaq 0x5e6263(%rip), %rcx    # 0x60001c
cmpl (%rcx), %eax
jle 0x19dee
movl $0x0, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
leaq 0x5e624a(%rip), %rax    # 0x60001c
movl (%rax), %eax
subl $0x1, %eax
movl %eax, -0x10(%rbp)
leaq 0x5e623f(%rip), %rax    # 0x600020
movl (%rax), %eax
subl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x19ed5
leaq 0x5e6227(%rip), %rax    # 0x60001c
movl (%rax), %eax
sarl %eax
leaq 0x114d62(%rip), %rcx    # 0x12eb62
movswl (%rcx), %ecx
sarl %ecx
subl %ecx, %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
leaq 0x114d4e(%rip), %rcx    # 0x12eb62
movswl (%rcx), %ecx
addl %ecx, %eax
subl $0x1, %eax
movl %eax, -0x10(%rbp)
leaq 0x5e61fa(%rip), %rax    # 0x600020
movl (%rax), %eax
subl $0x20, %eax
sarl %eax
movl %eax, -0x1c(%rbp)
leaq 0x114d2b(%rip), %rax    # 0x12eb62
movswl (%rax), %eax
leaq 0x5e61df(%rip), %rcx    # 0x600020
movl (%rcx), %ecx
subl $0x20, %ecx
imull %ecx, %eax
leaq 0x5e61cc(%rip), %rcx    # 0x60001c
cltd
idivl (%rcx)
movl %eax, %ecx
movl -0x1c(%rbp), %eax
sarl %ecx
subl %ecx, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x18(%rbp)
leaq 0x114cf6(%rip), %rax    # 0x12eb62
movswl (%rax), %eax
leaq 0x5e61aa(%rip), %rcx    # 0x600020
movl (%rcx), %ecx
subl $0x20, %ecx
imull %ecx, %eax
leaq 0x5e6197(%rip), %rcx    # 0x60001c
cltd
idivl (%rcx)
movl %eax, %ecx
movl -0x18(%rbp), %eax
addl %ecx, %eax
subl $0x1, %eax
movl %eax, -0x14(%rbp)
leaq -0x8(%rbp), %rdi
leaq -0xc(%rbp), %rsi
leaq -0x10(%rbp), %rdx
leaq -0x14(%rbp), %rcx
callq 0x256b0
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %esi
leaq 0x11391b(%rip), %rax    # 0x12d7d2
movsbl (%rax), %ecx
sarl %cl, %esi
movl -0x10(%rbp), %edx
movl -0x14(%rbp), %eax
leaq 0x113909(%rip), %rcx    # 0x12d7d2
movsbl (%rcx), %ecx
sarl %cl, %eax
movl %eax, %ecx
callq 0x67180
leaq 0x114c86(%rip), %rax    # 0x12eb62
movswl (%rax), %eax
leaq 0x5e6136(%rip), %rcx    # 0x60001c
cmpl (%rcx), %eax
jg 0x1a142
leaq 0x5e6127(%rip), %rax    # 0x60001c
movl (%rax), %r10d
subl $0x1, %r10d
leaq 0x5e611d(%rip), %rax    # 0x600020
movl (%rax), %eax
subl $0x1, %eax
xorl %r9d, %r9d
movl $0x196, %edx            # imm = 0x196
movl %r9d, %edi
movl %r9d, %esi
movl %r9d, %ecx
movl %r9d, %r8d
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
callq 0x9330
leaq 0x5e60e4(%rip), %rax    # 0x60001c
movl (%rax), %edi
subl $0x140, %edi            # imm = 0x140
sarl %edi
leaq 0x5e60d7(%rip), %rax    # 0x600020
movl (%rax), %esi
subl $0x20, %esi
leaq 0x5e60c7(%rip), %rax    # 0x60001c
movl (%rax), %r10d
subl $0x1, %r10d
leaq 0x5e60bd(%rip), %rax    # 0x600020
movl (%rax), %eax
subl $0x1, %eax
movl $0x19e, %edx            # imm = 0x19E
xorl %r9d, %r9d
movl %r9d, %ecx
movl %r9d, %r8d
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
callq 0x9290
leaq 0x5e608a(%rip), %rax    # 0x60001c
movl (%rax), %eax
subl $0x140, %eax            # imm = 0x140
sarl %eax
movl %eax, -0x4(%rbp)
cmpl $0x8, -0x4(%rbp)
jl 0x19ffb
movl -0x4(%rbp), %eax
subl $0x8, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %edi
leaq 0x5e6069(%rip), %rax    # 0x600020
movl (%rax), %esi
subl $0x20, %esi
leaq 0x5e6059(%rip), %rax    # 0x60001c
movl (%rax), %r10d
subl $0x1, %r10d
leaq 0x5e604f(%rip), %rax    # 0x600020
movl (%rax), %eax
subl $0x1, %eax
movl $0x1b7, %edx            # imm = 0x1B7
xorl %r9d, %r9d
movl %r9d, %ecx
movl %r9d, %r8d
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
callq 0x9290
jmp 0x19f9e
cmpl $0x4, -0x4(%rbp)
jl 0x1a056
movl -0x4(%rbp), %eax
subl $0x4, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %edi
leaq 0x5e600c(%rip), %rax    # 0x600020
movl (%rax), %esi
subl $0x20, %esi
leaq 0x5e5ffc(%rip), %rax    # 0x60001c
movl (%rax), %r10d
subl $0x1, %r10d
leaq 0x5e5ff2(%rip), %rax    # 0x600020
movl (%rax), %eax
subl $0x1, %eax
movl $0x1b9, %edx            # imm = 0x1B9
xorl %r9d, %r9d
movl %r9d, %ecx
movl %r9d, %r8d
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
callq 0x9290
leaq 0x5e5fbf(%rip), %rax    # 0x60001c
movl (%rax), %eax
subl $0x140, %eax            # imm = 0x140
sarl %eax
addl $0x140, %eax            # imm = 0x140
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
leaq 0x5e5fa4(%rip), %rcx    # 0x60001c
movl (%rcx), %ecx
subl $0x8, %ecx
cmpl %ecx, %eax
jg 0x1a0d8
movl -0x4(%rbp), %edi
leaq 0x5e5f95(%rip), %rax    # 0x600020
movl (%rax), %esi
subl $0x20, %esi
leaq 0x5e5f85(%rip), %rax    # 0x60001c
movl (%rax), %r10d
subl $0x1, %r10d
leaq 0x5e5f7b(%rip), %rax    # 0x600020
movl (%rax), %eax
subl $0x1, %eax
movl $0x1b7, %edx            # imm = 0x1B7
xorl %r9d, %r9d
movl %r9d, %ecx
movl %r9d, %r8d
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
callq 0x9290
movl -0x4(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x4(%rbp)
jmp 0x1a06e
movl -0x4(%rbp), %eax
leaq 0x5e5f3a(%rip), %rcx    # 0x60001c
movl (%rcx), %ecx
subl $0x4, %ecx
cmpl %ecx, %eax
jg 0x1a140
movl -0x4(%rbp), %edi
leaq 0x5e5f2b(%rip), %rax    # 0x600020
movl (%rax), %esi
subl $0x20, %esi
leaq 0x5e5f1b(%rip), %rax    # 0x60001c
movl (%rax), %r10d
subl $0x1, %r10d
leaq 0x5e5f11(%rip), %rax    # 0x600020
movl (%rax), %eax
subl $0x1, %eax
movl $0x1b9, %edx            # imm = 0x1B9
xorl %r9d, %r9d
movl %r9d, %ecx
movl %r9d, %r8d
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
callq 0x9290
movl -0x4(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x4(%rbp)
jmp 0x1a142
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)