// File: /workspace/github_c_makefile_star2_O1/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 0x1743e
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 0xca184(%rip), %rbx     # 0xe15f0
movq %rbx, %rdi
movq %r9, %rsi
callq 0x91e0
movq %rbx, %rdi
callq 0x348be
movq %rbx, %rdi
callq 0x85a0
movq %rax, %r11
cmpw $-0x1, %bp
jne 0x17551
cmpb $0x0, (%rsp)
je 0x1752d
testl %r11d, %r11d
jle 0x17542
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 0x5a69b3(%rip), %rdi    # 0x5bde80
xorl %eax, %eax
leaq 0xca11a(%rip), %r9      # 0xe15f0
movzbl (%r9,%rsi), %r9d
movzwl (%rcx,%r9,2), %r10d
btl $0xa, %r10d
jb 0x17503
btl $0xb, %r10d
jb 0x1750c
leal -0x21(%r9), %r10d
addl $0x5da, %r9d            # imm = 0x5DA
cmpb $0xf, %r10b
cmovbl %r9d, %r8d
jmp 0x17516
addl $0x594, %r9d            # imm = 0x594
jmp 0x17513
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 0x174cf
shrl %eax
jmp 0x17544
leaq 0x59e918(%rip), %rax    # 0x5b5e4c
movl (%rax), %ebp
shrl %ebp
leal (,%r11,8), %eax
jmp 0x1754f
xorl %eax, %eax
leaq 0x59e901(%rip), %rcx    # 0x5b5e4c
movl (%rcx), %ebp
shrl %ebp
subl %eax, %ebp
leaq 0x59e8f8(%rip), %rax    # 0x5b5e50
movl (%rax), %eax
cmpw $-0x1, %r13w
je 0x1757c
cmpl $0x190, %eax            # imm = 0x190
movl $0x18, %eax
movl $0xc, %ecx
cmovgel %eax, %ecx
imull %ecx, %r13d
movl %r13d, %eax
jmp 0x17581
shrl %eax
addl $-0x6, %eax
testl %r11d, %r11d
jle 0x17687
movq %r11, %rbx
movl %eax, %r12d
callq 0x81c0
movl %r12d, %esi
movq %rbx, %r11
movq %rax, %r13
andl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
shll $0x10, %esi
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 0xca024(%rip), %rcx     # 0xe15f0
movzbl (%rcx,%r12), %ecx
movzwl (%rdx,%rcx,2), %edx
movl $0x594, %ebx            # imm = 0x594
btl $0xa, %edx
jb 0x175f8
movl $0x5bf, %ebx            # imm = 0x5BF
btl $0xb, %edx
jb 0x175f8
leal -0x21(%rcx), %edx
movl $0x5da, %ebx            # imm = 0x5DA
cmpb $0xe, %dl
ja 0x1764a
addl %ecx, %ebx
movl %ebp, %edi
shll $0x10, %edi
leaq 0x59e846(%rip), %rax    # 0x5b5e4c
movl (%rax), %eax
decl %eax
leaq 0x59e83f(%rip), %rcx    # 0x5b5e50
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 0x4bca3
movl %r14d, %esi
movq %r15, %r11
addq $0x30, %rsp
movl %ebx, %eax
cmpb $0x0, (%rsp)
je 0x1765f
movl %eax, %ecx
leaq 0x5a6827(%rip), %rdx    # 0x5bde80
movzwl (%rdx,%rcx,2), %ecx
jmp 0x17677
xorl %ecx, %ecx
leaq 0xc9f88(%rip), %rdx     # 0xe15f0
cmpb $0x20, (%rdx,%r12)
setne %cl
leal 0x8(,%rcx,8), %ecx
addl %ebp, %ecx
incq %r12
movl %ecx, %ebp
cmpq %r12, %r11
jne 0x175c1
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq