// File: /workspace/github_c_makefile_star2_O3/NedFreed[P]msglint/msglint.c
// Function: wprintf
static void wprintf(dbinfo *db, const char *dt, const char *fmt, ...)
{
    static const char *lastfmt = NULL;
    static int numfmt = 0;
    const char *str;
    msgtoken *mtok = NULL;
    va_list pvar;
    char wbuf[256], pat[3], tmpstr[256], c;
    int indent, pad, pos, len, num, wused = 0;

    va_start(pvar, fmt);

    /* exit on silent mode, or too many repeats of previous error */
    if (silent || (lastfmt == fmt && ++numfmt > 2)) {
	va_end(pvar);
	return;
    }

    /* handle duplicate message suppression */
    if (lastfmt != fmt) {
	if (numfmt > 2) {
	    num = numfmt - 2;
	    numfmt = 0;
	    wprintf(NULL, w_warn,
		    "suppressed %d duplicate%s of previous WARNING",
		    num, num == 1 ? "" : "s");
	}
	lastfmt = dt == w_warn ? fmt : NULL;
	numfmt = 0;
    }

    /* do prefix */
    indent = pos = strlen(dt);
    fprintf(outfile, "%s", dt);

    /* loop between formatting characters */
    while (*fmt != '\0') {
	str = fmt;
	while (*fmt != '\0' && *fmt != '%')  ++fmt;
	wordwrap(str, fmt - str, indent, &pos, wbuf, sizeof (wbuf), &wused);
	if (*fmt == '\0') break;
	len = 0;
	pad = 0;
	switch (*++fmt) {
	  case '0': case '1': case '2': case '3': case '4':
	  case '5': case '6': case '7': case '8': case '9':
	    str = fmt - 1;
	    while (isdigit(*fmt)) {
		pad = pad * 10 + (*fmt - '0');
		++fmt;
	    }
	    len = fmt - str + 1;
	    if (*fmt != 's') break;
	    /* fall through */
	  case 's':
	    str = va_arg(pvar, char *);
	    len = strlen(str);
	    break;
	  case 'd':
	  case 'u':
	  case 'o':
	  case 'x':
	    num = va_arg(pvar, int);
	    pat[0] = '%';
	    pat[1] = *fmt;
	    pat[2] = '\0';
	    sprintf(tmpstr, pat, num);
	    len = strlen(tmpstr);
	    str = tmpstr;
	    break;
	  case 'm':
	    str = va_arg(pvar, char *);
	    for (len = 0; len < 16; ++len) {
		tmpstr[len*2]   = hexchars[(*(unsigned char *)(str+len))>>4];
		tmpstr[len*2+1] = hexchars[(*(unsigned char *)(str+len))&0xf];
	    }
	    str = tmpstr;
	    len = 32;
	    break;
	  case 'c':
	    c = va_arg(pvar, int);
	    if (c >= 0x20 && c < 0x7f) {
		sprintf(tmpstr, "'%c'", c);
	    } else if ((unsigned char) c < 0x20) {
		sprintf(tmpstr, "^%c", c + '@');
	    } else if (c == 0x7f) {
		strcpy(tmpstr, "^?");
	    } else {
		sprintf(tmpstr, "0%o, 0x%02x",
			(int) (unsigned char) c,
			(int) (unsigned char) c);
	    }
	    str = tmpstr;
	    len = strlen(tmpstr);
	    break;
	  case 't':
	  case 'T':
	    mtok = va_arg(pvar, msgtoken *);
	    if (mtok == NULL) {
		len = 0;
	    } else {
		len = mtok->len;
		str = mtok->data;
		if (*fmt == 'T') {
		    wordwrap("token '", 7, indent, &pos, wbuf, sizeof (wbuf),
			     &wused);
		}
	    }
	    break;
	  case '.':
	    if (fmt[1] == '*' && fmt[2] == 's') {
		len = va_arg(pvar, int);
		str = va_arg(pvar, char *);
		fmt += 2;
		break;
	    }
	    /* fall through */
	  default:
	    len = 2;
	    str = fmt - 1;
	    break;
	}
	if (pad) {
	    wordwrap(pad_str, pad - len, indent, &pos, wbuf, sizeof (wbuf),
		     &wused);
	}
	if (len) {
	    wordwrap(str, len, indent, &pos, wbuf, sizeof (wbuf), &wused);
	}
	if (*fmt == 'T' && mtok != NULL) {
	    wordwrap("'", 1, indent, &pos, wbuf, sizeof (wbuf), &wused);
	}
	++fmt;
    }

    /* handle debugging suffix */
    if (db != NULL) {
	str = (fmt[-1] == ' ') ? "" : " in ";
	if (db->headlen) {
	    sprintf(tmpstr, "%s%sheader '%.*s' at line", str,
		    db->flags & DB_INDATE ? "quoted date in " :
		    db->flags & DB_INTYPE ? "type parameter in " : "",
		    db->headlen, db->headname);
	} else {
	    sprintf(tmpstr, " at line");
	}
	len = strlen(tmpstr);
	if (db->endline > db->startline) {
	    sprintf(tmpstr + len, "s %d-%d", db->startline, db->endline);
	} else {
	    sprintf(tmpstr + len, " %d", db->endline);
	}
	len += strlen(tmpstr + len);
	wordwrap(tmpstr, len, indent, &pos, wbuf, sizeof (wbuf), &wused);
    }

    /* flush word buffer */
    wordwrap(NULL, 0, indent, &pos, wbuf, sizeof (wbuf), &wused);

    va_end(pvar);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
movq %rdx, %rbx
leaq 0x250(%rsp), %rdx
movq %rcx, 0x18(%rdx)
movq %r8, 0x20(%rdx)
movq %r9, 0x28(%rdx)
testb %al, %al
je 0x32d3
movaps %xmm0, 0x280(%rsp)
movaps %xmm1, 0x290(%rsp)
movaps %xmm2, 0x2a0(%rsp)
movaps %xmm3, 0x2b0(%rsp)
movaps %xmm4, 0x2c0(%rsp)
movaps %xmm5, 0x2d0(%rsp)
movaps %xmm6, 0x2e0(%rsp)
movaps %xmm7, 0x2f0(%rsp)
movl $0x0, 0xc(%rsp)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, 0x10(%rsp)
leaq 0x340(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %rdx, 0x20(%rsp)
cmpl $0x0, 0xe7d5(%rip)      # 0x11ad8
jne 0x39b2
movq %rsi, %r15
movq %rdi, %r14
movl 0xe9f3(%rip), %ecx      # 0x11d08
cmpq %rbx, 0xe9e4(%rip)      # 0x11d00
je 0x337f
cmpl $0x3, %ecx
jl 0x335c
addl $-0x2, %ecx
movl $0x0, 0xe9d8(%rip)      # 0x11d08
cmpl $0x1, %ecx
leaq 0x8a91(%rip), %rax      # 0xbdcb
leaq 0xb171(%rip), %r8       # 0xe4b2
cmoveq %rax, %r8
leaq 0x8a75(%rip), %rsi      # 0xbdc1
leaq 0x9ffc(%rip), %rdx      # 0xd34f
xorl %edi, %edi
xorl %eax, %eax
callq 0x3267
leaq 0x8a5e(%rip), %rax      # 0xbdc1
xorl %ecx, %ecx
cmpq %rax, %r15
cmoveq %rbx, %rcx
movq %rcx, 0xe98d(%rip)      # 0x11d00
movl $0x0, 0xe98b(%rip)      # 0x11d08
jmp 0x3391
leal 0x1(%rcx), %eax
movl %eax, 0xe980(%rip)      # 0x11d08
cmpl $0x1, %ecx
jg 0x39b2
movq %r14, 0x48(%rsp)
movq %r15, %rdi
callq 0x20a0
movq %rax, %r13
movl %r13d, 0x8(%rsp)
movq 0xe74b(%rip), %rsi      # 0x11af8
movq %r15, %rdi
callq 0x20e0
movb (%rbx), %al
testb %al, %al
je 0x389b
leaq 0x8(%rsp), %r15
leaq 0x150(%rsp), %r14
leaq 0xc(%rsp), %rbp
movq $0x0, 0x38(%rsp)
movq %r13, 0x40(%rsp)
leaq 0x1(%rbx), %r12
xorl %esi, %esi
testb %al, %al
je 0x33fd
movzbl %al, %eax
cmpl $0x25, %eax
je 0x33fd
movb (%r12), %al
incq %r12
incq %rsi
jmp 0x33e5
movq %rbx, %rdi
movl %r13d, %edx
movq %r15, %rcx
movq %r14, %r8
movq %rbp, %r9
callq 0x39c4
cmpb $0x0, -0x1(%r12)
je 0x38a0
movq %r14, %rbp
movq %r13, %r14
leaq -0x1(%r12), %rdi
movb (%r12), %r13b
movzbl %r13b, %r15d
cmpl $0x53, %r15d
jg 0x3477
leal -0x30(%r15), %eax
cmpl $0xa, %eax
jae 0x35d1
movq %rdi, 0x30(%rsp)
callq 0x2200
movq (%rax), %rax
movl $0x2, %ebx
testb $0x8, 0x1(%rax,%r15,2)
jne 0x34d3
leaq 0x8(%rsp), %r15
movq %r14, %r13
movq %rbp, %r14
leaq 0xc(%rsp), %rbp
movq 0x30(%rsp), %rdi
jmp 0x36b7
cmpl $0x6c, %r15d
leaq 0x892e(%rip), %rsi      # 0xbdb0
jle 0x3518
addl $-0x6d, %r15d
cmpl $0xb, %r15d
movq %r14, %r13
movq %rbp, %r14
leaq 0xc(%rsp), %rbp
ja 0x3774
leaq 0x7ba4(%rip), %rcx      # 0xb04c
movslq (%rcx,%r15,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x10(%rsp), %ecx
cmpq $0x28, %rcx
ja 0x3791
movq %rcx, %rax
addq 0x20(%rsp), %rax
addl $0x8, %ecx
movl %ecx, 0x10(%rsp)
jmp 0x379f
xorl %r15d, %r15d
movl $0x2, %ebx
movsbl %r13b, %ecx
leal (%r15,%r15,4), %edx
leal (%rcx,%rdx,2), %r15d
addl $-0x30, %r15d
movsbq 0x1(%r12), %r13
incq %r12
incl %ebx
testb $0x8, 0x1(%rax,%r13,2)
jne 0x34db
cmpb $0x73, %r13b
movq %r14, %r13
movq %rbp, %r14
leaq 0xc(%rsp), %rbp
je 0x3646
jmp 0x367f
cmpl $0x54, %r15d
movq %r14, %r13
movq %rbp, %r14
leaq 0xc(%rsp), %rbp
je 0x35af
cmpl $0x63, %r15d
je 0x3759
cmpl $0x64, %r15d
jne 0x3774
movl 0x10(%rsp), %ecx
cmpq $0x28, %rcx
ja 0x355c
movq %rcx, %rax
addq 0x20(%rsp), %rax
addl $0x8, %ecx
movl %ecx, 0x10(%rsp)
jmp 0x356a
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x8(%rsp), %r15
movl (%rax), %edx
movb $0x25, 0x2d(%rsp)
movb (%r12), %al
movb %al, 0x2e(%rsp)
movb $0x0, 0x2f(%rsp)
leaq 0x50(%rsp), %r13
movq %r13, %rdi
leaq 0x2d(%rsp), %rsi
xorl %eax, %eax
callq 0x21d0
movq %r13, %rdi
callq 0x20a0
movq %rax, %rbx
movq %r13, %rdi
movq 0x40(%rsp), %r13
jmp 0x36b3
movl 0x10(%rsp), %ecx
cmpq $0x28, %rcx
ja 0x370e
movq %rcx, %rax
addq 0x20(%rsp), %rax
addl $0x8, %ecx
movl %ecx, 0x10(%rsp)
jmp 0x371c
cmpl $0x2e, %r15d
movq %r14, %r13
movq %rbp, %r14
leaq 0xc(%rsp), %rbp
jne 0x3774
movl $0x2, %ebx
cmpb $0x2a, 0x1(%r12)
jne 0x3779
cmpb $0x73, 0x2(%r12)
leaq 0x8(%rsp), %r15
jne 0x36b7
movl 0x10(%rsp), %ecx
cmpq $0x29, %rcx
jae 0x3871
movq 0x20(%rsp), %rdx
movq %rcx, %rax
addq $0x8, %rax
movl %eax, 0x10(%rsp)
movl (%rdx,%rcx), %ebx
cmpl $0x20, %ecx
ja 0x3881
addq 0x20(%rsp), %rax
addl $0x10, %ecx
movl %ecx, 0x10(%rsp)
jmp 0x388f
xorl %r15d, %r15d
movl 0x10(%rsp), %ecx
cmpq $0x28, %rcx
ja 0x3661
movq %rcx, %rax
addq 0x20(%rsp), %rax
addl $0x8, %ecx
movl %ecx, 0x10(%rsp)
jmp 0x366f
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
movq (%rax), %rdi
movq %rdi, 0x30(%rsp)
callq 0x20a0
movq %rax, %rbx
testl %r15d, %r15d
je 0x36a9
subl %ebx, %r15d
leaq 0x8742(%rip), %rdi      # 0xbdd0
movl %r15d, %esi
movl %r13d, %edx
leaq 0x8(%rsp), %r15
movq %r15, %rcx
movq %r14, %r8
movq %rbp, %r9
callq 0x39c4
jmp 0x36ae
leaq 0x8(%rsp), %r15
movq 0x30(%rsp), %rdi
testl %ebx, %ebx
je 0x36ca
movl %ebx, %esi
movl %r13d, %edx
movq %r15, %rcx
movq %r14, %r8
movq %rbp, %r9
callq 0x39c4
cmpb $0x54, (%r12)
jne 0x36f6
cmpq $0x0, 0x38(%rsp)
je 0x36f6
leaq 0x9cbb(%rip), %rdi      # 0xd39b
movl $0x1, %esi
movl %r13d, %edx
movq %r15, %rcx
movq %r14, %r8
movq %rbp, %r9
callq 0x39c4
movb 0x1(%r12), %al
incq %r12
movq %r12, %rbx
testb %al, %al
jne 0x33df
jmp 0x38a3
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
movq (%rax), %rax
testq %rax, %rax
leaq 0x8(%rsp), %r15
je 0x3783
movl 0x14(%rax), %ebx
movq %rax, 0x38(%rsp)
movq 0x8(%rax), %rdi
cmpb $0x54, (%r12)
jne 0x36b3
movq %rdi, 0x30(%rsp)
leaq 0x9c49(%rip), %rdi      # 0xd395
movl $0x7, %esi
movl %r13d, %edx
jmp 0x3699
movl 0x10(%rsp), %ecx
cmpq $0x28, %rcx
ja 0x37dd
movq %rcx, %rax
addq 0x20(%rsp), %rax
addl $0x8, %ecx
movl %ecx, 0x10(%rsp)
jmp 0x37eb
movl $0x2, %ebx
leaq 0x8(%rsp), %r15
jmp 0x36b7
movq $0x0, 0x38(%rsp)
jmp 0x36f6
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
movq (%rax), %rax
xorl %ecx, %ecx
leaq 0x8(%rsp), %r15
movzbl (%rax,%rcx), %edx
shrl $0x4, %edx
movb (%rdx,%rsi), %dl
movb %dl, 0x50(%rsp,%rcx,2)
movzbl (%rax,%rcx), %edx
andl $0xf, %edx
movb (%rdx,%rsi), %dl
movb %dl, 0x51(%rsp,%rcx,2)
incq %rcx
cmpq $0x10, %rcx
jne 0x37a9
movl $0x20, %ebx
leaq 0x50(%rsp), %rdi
jmp 0x36b7
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x8(%rsp), %r15
movl (%rax), %eax
movsbl %al, %edx
leal -0x20(%rdx), %ecx
cmpl $0x5e, %ecx
ja 0x380e
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
leaq 0x9b71(%rip), %rsi      # 0xd37d
jmp 0x3828
movzbl %al, %ecx
cmpl $0x1f, %ecx
ja 0x383a
addl $0x40, %edx
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
leaq 0x9b5a(%rip), %rsi      # 0xd382
xorl %eax, %eax
callq 0x21d0
movq %rbx, %rdi
movq %rdi, %r13
jmp 0x359a
shll $0x18, %eax
cmpl $0x7f000000, %eax       # imm = 0x7F000000
jne 0x3857
movb $0x0, 0x52(%rsp)
movw $0x3f5e, 0x50(%rsp)     # imm = 0x3F5E
leaq 0x50(%rsp), %rdi
jmp 0x3832
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
leaq 0x9b23(%rip), %rsi      # 0xd389
movl %ecx, %edx
xorl %eax, %eax
callq 0x21d0
jmp 0x382f
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
movl (%rax), %ebx
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
addq $0x2, %r12
movq (%rax), %rdi
jmp 0x36b3
movq %rbx, %r12
jmp 0x38a3
decq %r12
movq 0x48(%rsp), %rbx
testq %rbx, %rbx
je 0x3994
movl 0x10(%rbx), %r8d
testl %r8d, %r8d
je 0x3909
cmpb $0x20, -0x1(%r12)
leaq 0x8504(%rip), %rax      # 0xbdcb
leaq 0x9af4(%rip), %rdx      # 0xd3c2
cmoveq %rax, %rdx
movl 0x14(%rbx), %ecx
testb $0x2, %cl
leaq 0x9ae8(%rip), %rsi      # 0xd3c7
cmoveq %rax, %rsi
testb $0x1, %cl
leaq 0x9aca(%rip), %rcx      # 0xd3b7
cmoveq %rsi, %rcx
movq (%rbx), %r9
leaq 0x9aa2(%rip), %rsi      # 0xd39d
leaq 0x50(%rsp), %rdi
xorl %eax, %eax
callq 0x21d0
jmp 0x391d
movabsq $0x656e696c20746120, %rax # imm = 0x656E696C20746120
movq %rax, 0x50(%rsp)
movb $0x0, 0x58(%rsp)
movq %rbx, %r15
leaq 0x50(%rsp), %rdi
callq 0x20a0
movq %rax, %rbx
movl 0x8(%r15), %edx
movl 0xc(%r15), %ecx
movslq %ebx, %rax
leaq (%rsp,%rax), %r15
addq $0x50, %r15
cmpl %edx, %ecx
jle 0x3957
leaq 0x9e8e(%rip), %rsi      # 0xd7d9
movq %r15, %rdi
xorl %eax, %eax
callq 0x21d0
jmp 0x396a
leaq 0xa1fb(%rip), %rsi      # 0xdb59
movq %r15, %rdi
movl %ecx, %edx
xorl %eax, %eax
callq 0x21d0
movq %r15, %rdi
callq 0x20a0
leal (%rbx,%rax), %esi
leaq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %rcx
leaq 0x150(%rsp), %r8
leaq 0xc(%rsp), %r9
movl %r13d, %edx
callq 0x39c4
leaq 0x8(%rsp), %rcx
leaq 0x150(%rsp), %r8
leaq 0xc(%rsp), %r9
xorl %edi, %edi
xorl %esi, %esi
movl %r13d, %edx
callq 0x39c4
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq