// File: /workspace/github_c_makefile_star2_O2/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, %r15
leaq 0x250(%rsp), %rdx
movq %rcx, 0x18(%rdx)
movq %r8, 0x20(%rdx)
movq %r9, 0x28(%rdx)
testb %al, %al
je 0x492c
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)
andl $0x0, 0x8(%rsp)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, 0x10(%rsp)
leaq 0x340(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %rdx, 0x20(%rsp)
cmpl $0x0, 0xe17f(%rip)      # 0x12ad8
jne 0x4f96
movq %rsi, %r12
movl 0xe3a0(%rip), %ecx      # 0x12d08
cmpq %r15, 0xe391(%rip)      # 0x12d00
je 0x49d2
cmpl $0x3, %ecx
jl 0x49b2
addl $-0x2, %ecx
andl $0x0, 0xe388(%rip)      # 0x12d08
cmpl $0x1, %ecx
leaq 0x7461(%rip), %rax      # 0xbdeb
leaq 0x9b41(%rip), %r8       # 0xe4d2
cmoveq %rax, %r8
leaq 0x7445(%rip), %rsi      # 0xbde1
leaq 0x89cc(%rip), %rdx      # 0xd36f
movq %rdi, %rbx
xorl %edi, %edi
xorl %eax, %eax
callq 0x48c0
movq %rbx, %rdi
leaq 0x7428(%rip), %rax      # 0xbde1
xorl %ecx, %ecx
cmpq %rax, %r12
cmoveq %r15, %rcx
movq %rcx, 0xe337(%rip)      # 0x12d00
andl $0x0, 0xe338(%rip)      # 0x12d08
jmp 0x49e4
leal 0x1(%rcx), %eax
movl %eax, 0xe32d(%rip)      # 0x12d08
cmpl $0x1, %ecx
jg 0x4f96
movq %rdi, 0x48(%rsp)
movq %r12, %rdi
callq 0x20a0
movq %rax, %rbx
leaq 0xc(%rsp), %rax
movl %ebx, (%rax)
movq 0xe0f6(%rip), %rsi      # 0x12af8
movq %r12, %rdi
callq 0x20e0
leaq 0x150(%rsp), %r13
leaq 0x8(%rsp), %rbp
xorl %r12d, %r12d
movb (%r15), %al
testb %al, %al
je 0x4e86
leaq 0x1(%r15), %r14
xorl %esi, %esi
testb %al, %al
je 0x4a42
movzbl %al, %eax
cmpl $0x25, %eax
je 0x4a42
movb (%r14), %al
incq %r14
incq %rsi
jmp 0x4a2b
movq %r15, %rdi
movl %ebx, %edx
leaq 0xc(%rsp), %rcx
movq %r13, %r8
movq %rbp, %r9
callq 0x4fa8
cmpb $0x0, -0x1(%r14)
je 0x4e80
movq %rbx, %rbp
movq %r13, %rbx
leaq -0x1(%r14), %rdi
movb (%r14), %r13b
movzbl %r13b, %eax
leal -0x30(%rax), %ecx
cmpl $0xa, %ecx
jb 0x4acb
leal -0x6d(%rax), %ecx
cmpl $0xb, %ecx
ja 0x4b3d
leaq 0x65da(%rip), %rdx      # 0xb068
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
movq %rbx, %r13
movq %rbp, %rbx
leaq 0x8(%rsp), %rbp
leaq 0x7329(%rip), %rsi      # 0xbdd0
jmpq *%rax
movl 0x10(%rsp), %ecx
cmpq $0x28, %rcx
ja 0x4d67
movq %rcx, %rax
addq 0x20(%rsp), %rax
addl $0x8, %ecx
movl %ecx, 0x10(%rsp)
jmp 0x4d75
movq %rdi, 0x40(%rsp)
movq %r12, 0x38(%rsp)
callq 0x2200
movq (%rax), %rax
xorl %r12d, %r12d
pushq $0x2
popq %rcx
movl %ecx, %r15d
movsbq %r13b, %rcx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x4b0d
movsbl %r13b, %ecx
imull $0xa, %r12d, %edx
leal (%rdx,%rcx), %r12d
addl $-0x30, %r12d
movb 0x1(%r14), %r13b
incq %r14
incl %r15d
jmp 0x4ae6
cmpb $0x73, %r13b
movq %rbx, %r13
movq %rbp, %rbx
leaq 0x8(%rsp), %rbp
jne 0x4baa
movl 0x10(%rsp), %ecx
cmpq $0x28, %rcx
ja 0x4b8c
movq %rcx, %rax
addq 0x20(%rsp), %rax
addl $0x8, %ecx
movl %ecx, 0x10(%rsp)
jmp 0x4b9a
cmpl $0x2e, %eax
movq %rbx, %r13
je 0x4cea
cmpl $0x54, %eax
movq %rbp, %rbx
leaq 0x8(%rsp), %rbp
je 0x4c6e
cmpl $0x63, %eax
je 0x4d44
cmpl $0x64, %eax
jne 0x4d40
movl 0x10(%rsp), %ecx
cmpq $0x28, %rcx
movq %r12, 0x38(%rsp)
ja 0x4bda
movq %rcx, %rax
addq 0x20(%rsp), %rax
addl $0x8, %ecx
movl %ecx, 0x10(%rsp)
jmp 0x4be8
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
movq (%rax), %rdi
movq %rdi, 0x40(%rsp)
callq 0x20a0
movq %rax, %r15
testl %r12d, %r12d
je 0x4bce
subl %r15d, %r12d
leaq 0x7237(%rip), %rdi      # 0xbdf0
movl %r12d, %esi
movl %ebx, %edx
leaq 0xc(%rsp), %rcx
movq %r13, %r8
movq %rbp, %r9
callq 0x4fa8
movq 0x38(%rsp), %r12
movq 0x40(%rsp), %rdi
jmp 0x4c22
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
movl (%rax), %edx
movb $0x25, 0x35(%rsp)
movb (%r14), %al
movb %al, 0x36(%rsp)
movb $0x0, 0x37(%rsp)
leaq 0x50(%rsp), %r12
movq %r12, %rdi
leaq 0x35(%rsp), %rsi
xorl %eax, %eax
callq 0x21d0
movq %r12, %rdi
callq 0x20a0
movq %rax, %r15
movq %r12, %rdi
movq 0x38(%rsp), %r12
testl %r15d, %r15d
je 0x4c3c
movl %r15d, %esi
movl %ebx, %edx
leaq 0xc(%rsp), %rcx
movq %r13, %r8
movq %rbp, %r9
callq 0x4fa8
cmpb $0x54, (%r14)
jne 0x4c63
testq %r12, %r12
je 0x4c63
leaq 0x876d(%rip), %rdi      # 0xd3bb
pushq $0x1
popq %rsi
movl %ebx, %edx
leaq 0xc(%rsp), %rcx
movq %r13, %r8
movq %rbp, %r9
callq 0x4fa8
incq %r14
movq %r14, %r15
jmp 0x4a1a
movl 0x10(%rsp), %ecx
cmpq $0x28, %rcx
ja 0x4c96
movq %rcx, %rax
addq 0x20(%rsp), %rax
addl $0x8, %ecx
movl %ecx, 0x10(%rsp)
jmp 0x4ca4
movq %r12, 0x38(%rsp)
xorl %r12d, %r12d
jmp 0x4b22
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
movq (%rax), %r12
testq %r12, %r12
je 0x4d5f
movl 0x14(%r12), %r15d
movq 0x8(%r12), %rdi
cmpb $0x54, (%r14)
jne 0x4c22
movq %rdi, 0x40(%rsp)
leaq 0x86e5(%rip), %rdi      # 0xd3b5
pushq $0x7
popq %rsi
movl %ebx, %edx
leaq 0xc(%rsp), %rcx
movq %r13, %r8
movq %rbp, %r9
callq 0x4fa8
jmp 0x4bd3
cmpb $0x2a, 0x1(%r14)
movq %rbp, %rbx
jne 0x4db1
cmpb $0x73, 0x2(%r14)
leaq 0x8(%rsp), %rbp
jne 0x4d40
movl 0x10(%rsp), %ecx
cmpq $0x29, %rcx
jae 0x4e3b
movq 0x20(%rsp), %rdx
movq %rcx, %rax
addq $0x8, %rax
movl %eax, 0x10(%rsp)
movl (%rdx,%rcx), %r15d
cmpl $0x20, %ecx
ja 0x4e4c
addq 0x20(%rsp), %rax
addl $0x10, %ecx
movl %ecx, 0x10(%rsp)
jmp 0x4e5a
pushq $0x2
jmp 0x4da8
movl 0x10(%rsp), %ecx
cmpq $0x28, %rcx
ja 0x4dc1
movq %rcx, %rax
addq 0x20(%rsp), %rax
addl $0x8, %ecx
movl %ecx, 0x10(%rsp)
jmp 0x4dcf
xorl %r12d, %r12d
jmp 0x4c3c
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
movq (%rax), %rax
xorl %ecx, %ecx
cmpq $0x10, %rcx
je 0x4da1
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
jmp 0x4d7a
leaq 0x50(%rsp), %rdi
pushq $0x20
popq %rax
movl %eax, %r15d
jmp 0x4c27
pushq $0x2
popq %rax
movl %eax, %r15d
leaq 0x8(%rsp), %rbp
jmp 0x4c27
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
movl (%rax), %eax
movsbl %al, %edx
leal -0x20(%rdx), %ecx
cmpl $0x5e, %ecx
movq %r12, 0x38(%rsp)
ja 0x4df2
leaq 0x50(%rsp), %r15
movq %r15, %rdi
leaq 0x85ad(%rip), %rsi      # 0xd39d
jmp 0x4e0c
movzbl %al, %ecx
cmpl $0x1f, %ecx
ja 0x4e1e
addl $0x40, %edx
leaq 0x50(%rsp), %r15
movq %r15, %rdi
leaq 0x8596(%rip), %rsi      # 0xd3a2
xorl %eax, %eax
callq 0x21d0
movq %r15, %rdi
movq %rdi, %r12
jmp 0x4c12
shll $0x18, %eax
cmpl $0x7f000000, %eax       # imm = 0x7F000000
jne 0x4e66
movb $0x0, 0x52(%rsp)
movw $0x3f5e, 0x50(%rsp)     # imm = 0x3F5E
leaq 0x50(%rsp), %rdi
jmp 0x4e16
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
movl (%rax), %r15d
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
addq $0x2, %r14
movq (%rax), %rdi
jmp 0x4c22
leaq 0x50(%rsp), %r15
movq %r15, %rdi
leaq 0x8534(%rip), %rsi      # 0xd3a9
movl %ecx, %edx
xorl %eax, %eax
callq 0x21d0
jmp 0x4e13
decq %r14
movq %r14, %r15
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x4f79
movl 0x10(%rdi), %r8d
testl %r8d, %r8d
je 0x4eee
cmpb $0x20, -0x1(%r15)
leaq 0x6f42(%rip), %rax      # 0xbdeb
leaq 0x8532(%rip), %rdx      # 0xd3e2
cmoveq %rax, %rdx
movl 0x14(%rdi), %ecx
testb $0x2, %cl
leaq 0x8526(%rip), %rsi      # 0xd3e7
cmoveq %rax, %rsi
testb $0x1, %cl
leaq 0x8508(%rip), %rcx      # 0xd3d7
cmoveq %rsi, %rcx
movq (%rdi), %r9
leaq 0x84e0(%rip), %rsi      # 0xd3bd
movq %rdi, %r15
leaq 0x50(%rsp), %rdi
xorl %eax, %eax
callq 0x21d0
jmp 0x4f05
movabsq $0x656e696c20746120, %rax # imm = 0x656E696C20746120
movq %rax, 0x50(%rsp)
movb $0x0, 0x58(%rsp)
movq %rdi, %r15
leaq 0x50(%rsp), %rdi
callq 0x20a0
movq %rax, %r14
movl 0x8(%r15), %edx
movl 0xc(%r15), %ecx
movslq %r14d, %rax
leaq (%rsp,%rax), %r15
addq $0x50, %r15
cmpl %edx, %ecx
jle 0x4f3c
leaq 0x88c9(%rip), %rsi      # 0xd7f9
movq %r15, %rdi
xorl %eax, %eax
callq 0x21d0
jmp 0x4f4f
leaq 0x8c36(%rip), %rsi      # 0xdb79
movq %r15, %rdi
movl %ecx, %edx
xorl %eax, %eax
callq 0x21d0
movq %r15, %rdi
callq 0x20a0
leal (%r14,%rax), %esi
leaq 0x50(%rsp), %rdi
leaq 0xc(%rsp), %rcx
leaq 0x150(%rsp), %r8
leaq 0x8(%rsp), %r9
movl %ebx, %edx
callq 0x4fa8
leaq 0xc(%rsp), %rcx
leaq 0x150(%rsp), %r8
leaq 0x8(%rsp), %r9
xorl %edi, %edi
xorl %esi, %esi
movl %ebx, %edx
callq 0x4fa8
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq