// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekmsc.c
// Function: rearview
void
rearview(int snum)
{
     int      cposx, cposy, cposz, choriz, czoom;
     short     cang;
     short     plrang,plrhoriz;
     int       oldwx1,oldwx2,oldwy1,oldwy2;

     if( toggles[TOGGLE_REARVIEW] == 0 ) {
          return;
     }

     oldwx1=windowx1; oldwx2=windowx2;
     oldwy1=windowy1; oldwy2=windowy2;

     plrang=ang[snum];
     plrhoriz=ohoriz[snum];
     setview(67,9,130,40);

     oang[snum]=(plrang+1024)&2047;
     ohoriz[snum]=(200-plrhoriz);

     cposx = oposx[snum]+mulscale(posx[snum]-oposx[snum],0,16);
     cposy = oposy[snum]+mulscale(posy[snum]-oposy[snum],0,16);
     cposz = oposz[snum]+mulscale(posz[snum]-oposz[snum],0,16);
     if (frameinterpolate == 0)
          { cposx = posx[snum]; cposy = posy[snum]; cposz = posz[snum]; }
     choriz = ohoriz[snum]+mulscale(horiz[snum]-ohoriz[snum],0,16);
     czoom = ozoom[snum]+mulscale(zoom[snum]-ozoom[snum],0,16);
     cang = oang[snum]+mulscale(((ang[snum]+1024-oang[snum])&2047)-1024,0,16);

     drawrooms(cposx,cposy,cposz,cang,choriz,cursectnum[snum]);
     rearviewdraw=1;
     analyzesprites(posx[snum],posy[snum]);
     rearviewdraw=0;
     drawmasks();

     oang[snum]=plrang;
     ohoriz[snum]=plrhoriz;
     setview(oldwx1,oldwy1, oldwx2,oldwy2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x4(%rbp)
leaq 0xfd49e(%rip), %rax     # 0x11a000
cmpl $0x0, 0x14(%rax)
jne 0x1cb6d
jmp 0x1ce93
leaq 0x5ae8ac(%rip), %rax    # 0x5cb420
movl (%rax), %eax
movl %eax, -0x24(%rbp)
leaq 0x5e3490(%rip), %rax    # 0x600010
movl (%rax), %eax
movl %eax, -0x28(%rbp)
leaq 0x5aff24(%rip), %rax    # 0x5ccab0
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
leaq 0x5e347c(%rip), %rax    # 0x600014
movl (%rax), %eax
movl %eax, -0x30(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x110c88(%rip), %rax    # 0x12d830
movw (%rax,%rcx,2), %ax
movw %ax, -0x1c(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x111e55(%rip), %rax    # 0x12ea10
movl (%rax,%rcx,4), %eax
movw %ax, -0x1e(%rbp)
movl $0x43, %edi
movl $0x9, %esi
movl $0x82, %edx
movl $0x28, %ecx
callq 0x67180
movswl -0x1c(%rbp), %eax
addl $0x400, %eax            # imm = 0x400
andl $0x7ff, %eax            # imm = 0x7FF
movw %ax, %dx
movslq -0x4(%rbp), %rcx
leaq 0x111e99(%rip), %rax    # 0x12ea90
movw %dx, (%rax,%rcx,2)
movswl -0x1e(%rbp), %eax
movl $0xc8, %edx
subl %eax, %edx
movslq -0x4(%rbp), %rcx
leaq 0x111dff(%rip), %rax    # 0x12ea10
movl %edx, (%rax,%rcx,4)
movslq -0x4(%rbp), %rcx
leaq 0x111d31(%rip), %rax    # 0x12e950
movl (%rax,%rcx,4), %eax
movl %eax, -0x3c(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x110c20(%rip), %rax    # 0x12d850
movl (%rax,%rcx,4), %edi
movslq -0x4(%rbp), %rcx
leaq 0x111d12(%rip), %rax    # 0x12e950
subl (%rax,%rcx,4), %edi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1f370
movl %eax, %ecx
movl -0x3c(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x8(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x111d2e(%rip), %rax    # 0x12e990
movl (%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x110c1d(%rip), %rax    # 0x12d890
movl (%rax,%rcx,4), %edi
movslq -0x4(%rbp), %rcx
leaq 0x111d0f(%rip), %rax    # 0x12e990
subl (%rax,%rcx,4), %edi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1f370
movl %eax, %ecx
movl -0x38(%rbp), %eax
addl %ecx, %eax
movl %eax, -0xc(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x111d2b(%rip), %rax    # 0x12e9d0
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x110c1a(%rip), %rax    # 0x12d8d0
movl (%rax,%rcx,4), %edi
movslq -0x4(%rbp), %rcx
leaq 0x111d0c(%rip), %rax    # 0x12e9d0
subl (%rax,%rcx,4), %edi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1f370
movl %eax, %ecx
movl -0x34(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x10(%rbp)
leaq 0xfd3bc(%rip), %rax     # 0x11a0a0
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x1cd1f
movslq -0x4(%rbp), %rcx
leaq 0x110b59(%rip), %rax    # 0x12d850
movl (%rax,%rcx,4), %eax
movl %eax, -0x8(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x110b88(%rip), %rax    # 0x12d890
movl (%rax,%rcx,4), %eax
movl %eax, -0xc(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x110bb7(%rip), %rax    # 0x12d8d0
movl (%rax,%rcx,4), %eax
movl %eax, -0x10(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x111ce6(%rip), %rax    # 0x12ea10
movl (%rax,%rcx,4), %eax
movl %eax, -0x48(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x111ae5(%rip), %rax    # 0x12e820
movl (%rax,%rcx,4), %edi
movslq -0x4(%rbp), %rcx
leaq 0x111cc7(%rip), %rax    # 0x12ea10
subl (%rax,%rcx,4), %edi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1f370
movl %eax, %ecx
movl -0x48(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x14(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x111ce3(%rip), %rax    # 0x12ea50
movl (%rax,%rcx,4), %eax
movl %eax, -0x44(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x111b12(%rip), %rax    # 0x12e890
movl (%rax,%rcx,4), %edi
movslq -0x4(%rbp), %rcx
leaq 0x111cc4(%rip), %rax    # 0x12ea50
subl (%rax,%rcx,4), %edi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1f370
movl %eax, %ecx
movl -0x44(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x18(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x111ce0(%rip), %rax    # 0x12ea90
movswl (%rax,%rcx,2), %eax
movl %eax, -0x40(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x110a6e(%rip), %rax    # 0x12d830
movswl (%rax,%rcx,2), %edi
addl $0x400, %edi            # imm = 0x400
movslq -0x4(%rbp), %rcx
leaq 0x111cb9(%rip), %rax    # 0x12ea90
movswl (%rax,%rcx,2), %eax
subl %eax, %edi
andl $0x7ff, %edi            # imm = 0x7FF
subl $0x400, %edi            # imm = 0x400
xorl %esi, %esi
movl $0x10, %edx
callq 0x1f370
movl %eax, %ecx
movl -0x40(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x1a(%rbp)
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movw -0x1a(%rbp), %cx
movl -0x14(%rbp), %r8d
movslq -0x4(%rbp), %r9
leaq 0x1118c4(%rip), %rax    # 0x12e6e0
movswl %cx, %ecx
movswl (%rax,%r9,2), %r9d
callq 0x530d0
movb $0x1, 0x15d19c(%rip)    # 0x179fcc
movslq -0x4(%rbp), %rcx
leaq 0x110a15(%rip), %rax    # 0x12d850
movl (%rax,%rcx,4), %edi
movslq -0x4(%rbp), %rcx
leaq 0x110a47(%rip), %rax    # 0x12d890
movl (%rax,%rcx,4), %esi
callq 0x28c40
movb $0x0, 0x15d174(%rip)    # 0x179fcc
callq 0x56520
movw -0x1c(%rbp), %dx
movslq -0x4(%rbp), %rcx
leaq 0x111c24(%rip), %rax    # 0x12ea90
movw %dx, (%rax,%rcx,2)
movswl -0x1e(%rbp), %edx
movslq -0x4(%rbp), %rcx
leaq 0x111b91(%rip), %rax    # 0x12ea10
movl %edx, (%rax,%rcx,4)
movl -0x24(%rbp), %edi
movl -0x2c(%rbp), %esi
movl -0x28(%rbp), %edx
movl -0x30(%rbp), %ecx
callq 0x67180
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)