// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/tekmsc.c
// Function: mprintf
void
mprintf(short x,short y,char prop,char shade,char palnum,char *stg,...)
{
     int  i,n,pic,propx;
     va_list vargs;

     va_start(vargs,stg);
     vsprintf((char *)tempbuf,stg,vargs);
     va_end(vargs);
     Bstrupr((char *)tempbuf);
     n=(int)strlen((char *)tempbuf);
     if (x == -1) {
          if (prop) {
               pic=MFONT_A;
               propx=0;
               for (i=0 ; i < n ; i++) {
                    if (isalpha(tempbuf[i])) {
                         pic=MFONT_A+tempbuf[i]-'A';
                    }
                    else if (isdigit(tempbuf[i])) {
                         pic=MFONT_0+tempbuf[i]-'0';
                    }
                    else if (tempbuf[i] > ' ' && tempbuf[i] < '0') {
                         pic=MFONT_SPECIAL1+tempbuf[i]-'!';
                    }
                    propx+=tilesizx[pic];
               }
               x=(xdim>>1)-(propx>>1);
          }
          else {
               x=(xdim>>1)-(n<<3);
          }
     }
     if (y == -1) {
          y=(ydim>>1)-(MFONTYSTEP>>1);
     }
     else {
          y=MFONTYSTEP*y;
          if (ydim >= 400) {
               y<<=1;
          }
     }
     pic=MFONT_A;
     for (i=0 ; i < n ; i++) {
          if (isalpha(tempbuf[i])) {
               pic=MFONT_A+tempbuf[i]-'A';
               rotatesprite(x<<16, y<<16, 65536l, 0, pic, shade, palnum, 8+16, 0, 0, xdim-1, ydim-1);
          }
          else if (isdigit(tempbuf[i])) {
               pic=MFONT_0+tempbuf[i]-'0';
               rotatesprite(x<<16, y<<16, 65536l, 0, pic, shade, palnum, 8+16, 0, 0, xdim-1, ydim-1);
          }
          else if (tempbuf[i] > ' ' && tempbuf[i] < '0') {
               pic=MFONT_SPECIAL1+tempbuf[i]-'!';
               rotatesprite(x<<16, y<<16, 65536l, 0, pic, shade, palnum, 8+16, 0, 0, xdim-1, ydim-1);
          }
          if (prop) {
               x+=tilesizx[pic];
          }
          else {
               if (tempbuf[i] == ' ') {
                    x+=8;
               }
               else {
                    x+=16;
               }
          }
     }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %r8d, %r15d
movl %ecx, %r14d
movl %edx, (%rsp)
movl %esi, %r13d
movl %edi, %ebp
testb %al, %al
je 0x17517
movaps %xmm0, 0x60(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
movaps %xmm4, 0xa0(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xc0(%rsp)
movaps %xmm7, 0xd0(%rsp)
leaq 0x30(%rsp), %rax
leaq 0x10(%rsp), %rdx
movq %rax, 0x10(%rdx)
leaq 0x120(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000030, %rax     # imm = 0x3000000030
movq %rax, (%rdx)
leaq 0xcd0ab(%rip), %rbx     # 0xe45f0
movq %rbx, %rdi
movq %r9, %rsi
callq 0x91e0
movq %rbx, %rdi
callq 0x35b9e
movq %rbx, %rdi
callq 0x85a0
movq %rax, %r11
cmpw $-0x1, %bp
jne 0x1762a
cmpb $0x0, (%rsp)
je 0x17606
testl %r11d, %r11d
jle 0x1761b
movq %r11, %rbx
callq 0x81c0
movq %rbx, %r11
movq (%rax), %rcx
movl %r11d, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movl $0x5d5, %r8d            # imm = 0x5D5
xorl %esi, %esi
leaq 0x5a98fa(%rip), %rdi    # 0x5c0ea0
xorl %eax, %eax
leaq 0xcd041(%rip), %r9      # 0xe45f0
movzbl (%r9,%rsi), %r9d
movzwl (%rcx,%r9,2), %r10d
btl $0xa, %r10d
jb 0x175dc
btl $0xb, %r10d
jb 0x175e5
leal -0x21(%r9), %r10d
addl $0x5da, %r9d            # imm = 0x5DA
cmpb $0xf, %r10b
cmovbl %r9d, %r8d
jmp 0x175ef
addl $0x594, %r9d            # imm = 0x594
jmp 0x175ec
addl $0x5bf, %r9d            # imm = 0x5BF
movl %r9d, %r8d
movl %r8d, %r9d
movswl (%rdi,%r9,2), %r9d
addl %r9d, %eax
incq %rsi
cmpq %rsi, %rdx
jne 0x175a8
shrl %eax
jmp 0x1761d
leaq 0x5a185f(%rip), %rax    # 0x5b8e6c
movl (%rax), %ebp
shrl %ebp
leal (,%r11,8), %eax
jmp 0x17628
xorl %eax, %eax
leaq 0x5a1848(%rip), %rcx    # 0x5b8e6c
movl (%rcx), %ebp
shrl %ebp
subl %eax, %ebp
leaq 0x5a183f(%rip), %rax    # 0x5b8e70
movl (%rax), %eax
cmpw $-0x1, %r13w
je 0x17655
cmpl $0x190, %eax            # imm = 0x190
movl $0x18, %eax
movl $0xc, %ecx
cmovgel %eax, %ecx
imull %ecx, %r13d
movl %r13d, %eax
jmp 0x1765a
shrl %eax
addl $-0x6, %eax
testl %r11d, %r11d
jle 0x17760
movq %r11, %rbx
movl %eax, %r12d
callq 0x81c0
movl %r12d, %esi
movq %rbx, %r11
movq %rax, %r13
shll $0x10, %esi
andl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
movl $0x5d5, %eax            # imm = 0x5D5
movzbl %r15b, %ecx
movq %rcx, 0x8(%rsp)
movsbl %r14b, %ecx
movl %ecx, 0x4(%rsp)
xorl %r12d, %r12d
movq (%r13), %rdx
leaq 0xccf4b(%rip), %rcx     # 0xe45f0
movzbl (%rcx,%r12), %ecx
movzwl (%rdx,%rcx,2), %edx
movl $0x594, %ebx            # imm = 0x594
btl $0xa, %edx
jb 0x176d1
movl $0x5bf, %ebx            # imm = 0x5BF
btl $0xb, %edx
jb 0x176d1
leal -0x21(%rcx), %edx
movl $0x5da, %ebx            # imm = 0x5DA
cmpb $0xe, %dl
ja 0x17723
addl %ecx, %ebx
movl %ebp, %edi
shll $0x10, %edi
leaq 0x5a178d(%rip), %rax    # 0x5b8e6c
movl (%rax), %eax
decl %eax
leaq 0x5a1786(%rip), %rcx    # 0x5b8e70
movl (%rcx), %r10d
decl %r10d
movl %esi, %r14d
movl $0x10000, %edx          # imm = 0x10000
xorl %ecx, %ecx
movl %ebx, %r8d
movl 0x4(%rsp), %r9d
pushq %r10
pushq %rax
xorl %eax, %eax
pushq %rax
pushq %rax
pushq $0x18
pushq 0x30(%rsp)
movq %r11, %r15
callq 0x4dcbd
movl %r14d, %esi
movq %r15, %r11
addq $0x30, %rsp
movl %ebx, %eax
cmpb $0x0, (%rsp)
je 0x17738
movl %eax, %ecx
leaq 0x5a976e(%rip), %rdx    # 0x5c0ea0
movzwl (%rdx,%rcx,2), %ecx
jmp 0x17750
xorl %ecx, %ecx
leaq 0xcceaf(%rip), %rdx     # 0xe45f0
cmpb $0x20, (%rdx,%r12)
setne %cl
leal 0x8(,%rcx,8), %ecx
addl %ebp, %ecx
incq %r12
movl %ecx, %ebp
cmpq %r12, %r11
jne 0x1769a
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq