// File: /workspace/github_c_makefile_star2_O2/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 $0xf8, %rsp
movl %r8d, 0x1c(%rsp)
movl %ecx, %r14d
movl %edx, 0x18(%rsp)
movl %esi, %r13d
movl %edi, %ebp
testb %al, %al
je 0x1609f
movaps %xmm0, 0x70(%rsp)
movaps %xmm1, 0x80(%rsp)
movaps %xmm2, 0x90(%rsp)
movaps %xmm3, 0xa0(%rsp)
movaps %xmm4, 0xb0(%rsp)
movaps %xmm5, 0xc0(%rsp)
movaps %xmm6, 0xd0(%rsp)
movaps %xmm7, 0xe0(%rsp)
leaq 0x40(%rsp), %rax
leaq 0x20(%rsp), %rdx
movq %rax, 0x10(%rdx)
leaq 0x130(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000030, %rax     # imm = 0x3000000030
movq %rax, (%rdx)
leaq 0xc4523(%rip), %rbx     # 0xda5f0
movq %rbx, %rdi
movq %r9, %rsi
callq 0x91e0
movq %rbx, %rdi
callq 0x31b92
movq %rbx, %rdi
callq 0x85a0
movq %rax, 0x10(%rsp)
cmpw $-0x1, %bp
jne 0x161af
cmpb $0x0, 0x18(%rsp)
je 0x16196
movl %r14d, 0xc(%rsp)
xorl %ebx, %ebx
movq 0x10(%rsp), %rax
testl %eax, %eax
movl $0x0, %r15d
cmovgl %eax, %r15d
movl $0x5d5, %ebp            # imm = 0x5D5
leaq 0x5a0d7a(%rip), %r12    # 0x5b6ea0
xorl %r14d, %r14d
cmpq %rbx, %r15
je 0x1617e
callq 0x81c0
movq (%rax), %rcx
leaq 0xc44b3(%rip), %rax     # 0xda5f0
movzbl (%rax,%rbx), %eax
movzwl (%rcx,%rax,2), %ecx
btl $0xa, %ecx
jb 0x16161
btl $0xb, %ecx
jb 0x16168
leal -0x21(%rax), %ecx
addl $0x5da, %eax            # imm = 0x5DA
cmpb $0xf, %cl
cmovbl %eax, %ebp
jmp 0x1616f
addl $0x594, %eax            # imm = 0x594
jmp 0x1616d
addl $0x5bf, %eax            # imm = 0x5BF
movl %eax, %ebp
movl %ebp, %eax
movswl (%r12,%rax,2), %eax
addl %eax, %r14d
incq %rbx
jmp 0x16129
leaq 0x598ce7(%rip), %rax    # 0x5aee6c
movl (%rax), %ebp
shrl %ebp
shrl %r14d
subl %r14d, %ebp
movl 0xc(%rsp), %r14d
jmp 0x161af
leaq 0x598ccf(%rip), %rax    # 0x5aee6c
movl (%rax), %ebp
shrl %ebp
movq 0x10(%rsp), %rax
leal (,%rax,8), %eax
subl %eax, %ebp
leaq 0x598cba(%rip), %rax    # 0x5aee70
movl (%rax), %eax
cmpw $-0x1, %r13w
je 0x161d6
cmpl $0x190, %eax            # imm = 0x190
pushq $0x18
popq %rax
pushq $0xc
popq %rcx
cmovgel %eax, %ecx
imull %ecx, %r13d
movl %r13d, %eax
jmp 0x161db
shrl %eax
addl $-0x6, %eax
shll $0x10, %eax
movl %eax, 0xc(%rsp)
xorl %ebx, %ebx
movq 0x10(%rsp), %r15
testl %r15d, %r15d
cmovlel %ebx, %r15d
movl $0x5d5, %r12d           # imm = 0x5D5
movzbl 0x1c(%rsp), %eax
movq %rax, 0x10(%rsp)
movsbl %r14b, %r13d
cmpq %rbx, %r15
je 0x162ce
callq 0x81c0
movq (%rax), %rcx
leaq 0xc43d4(%rip), %rax     # 0xda5f0
movzbl (%rax,%rbx), %eax
movzwl (%rcx,%rax,2), %ecx
movl $0x594, %r14d           # imm = 0x594
btl $0xa, %ecx
jb 0x1624a
movl $0x5bf, %r14d           # imm = 0x5BF
btl $0xb, %ecx
jb 0x1624a
leal -0x21(%rax), %ecx
movl $0x5da, %r14d           # imm = 0x5DA
cmpb $0xe, %cl
ja 0x16294
addl %eax, %r14d
movl %ebp, %edi
shll $0x10, %edi
leaq 0x598c13(%rip), %rax    # 0x5aee6c
movl (%rax), %eax
decl %eax
leaq 0x598c0c(%rip), %rcx    # 0x5aee70
movl (%rcx), %r10d
decl %r10d
movl 0xc(%rsp), %esi
movl $0x10000, %edx          # imm = 0x10000
xorl %ecx, %ecx
movl %r14d, %r8d
movl %r13d, %r9d
pushq %r10
pushq %rax
pushq $0x0
pushq $0x0
pushq $0x18
pushq 0x38(%rsp)
callq 0x48ebe
addq $0x30, %rsp
movl %r14d, %r12d
cmpb $0x0, 0x18(%rsp)
je 0x162ab
movl %r12d, %eax
leaq 0x5a0bfb(%rip), %rcx    # 0x5b6ea0
movzwl (%rcx,%rax,2), %eax
jmp 0x162c2
xorl %eax, %eax
leaq 0xc433c(%rip), %rcx     # 0xda5f0
cmpb $0x20, (%rcx,%rbx)
setne %al
leal 0x8(,%rax,8), %eax
addl %ebp, %eax
incq %rbx
movl %eax, %ebp
jmp 0x16204
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq