// File: /workspace/github_c_makefile_star2_O1/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, %rbp
movq %rdi, 0x48(%rsp)
leaq 0x250(%rsp), %rdx
movq %rcx, 0x18(%rdx)
movq %r8, 0x20(%rdx)
movq %r9, 0x28(%rdx)
testb %al, %al
je 0x4b54
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, 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, 0xcf44(%rip)      # 0x11ac8
jne 0x5201
movq %rsi, %rbx
movq 0xd15c(%rip), %rax      # 0x11cf0
cmpq %rbp, %rax
je 0x50c4
movl 0xd155(%rip), %ecx      # 0x11cf8
cmpl $0x3, %ecx
jl 0x4be1
addl $-0x2, %ecx
movl $0x0, 0xd143(%rip)      # 0x11cf8
cmpl $0x1, %ecx
leaq 0x727c(%rip), %rax      # 0xbe3b
leaq 0x9960(%rip), %r8       # 0xe526
cmoveq %rax, %r8
leaq 0x7260(%rip), %rsi      # 0xbe31
leaq 0x87eb(%rip), %rdx      # 0xd3c3
xorl %edi, %edi
xorl %eax, %eax
callq 0x4ae3
leaq 0x7249(%rip), %rax      # 0xbe31
xorl %ecx, %ecx
cmpq %rax, %rbx
cmoveq %rbp, %rcx
movq %rcx, 0xd0f8(%rip)      # 0x11cf0
movl $0x0, 0xd0f6(%rip)      # 0x11cf8
movq %rbx, %rdi
callq 0x20a0
movq %rax, 0x40(%rsp)
movl %eax, 0xc(%rsp)
movq 0xcece(%rip), %rsi      # 0x11ae8
movq %rbx, %rdi
callq 0x20e0
cmpb $0x0, (%rbp)
je 0x50ed
leaq 0x71ed(%rip), %rbx      # 0xbe20
xorl %r13d, %r13d
movq %r13, 0x30(%rsp)
xorl %r13d, %r13d
movzbl (%rbp,%r13), %eax
testl %eax, %eax
je 0x4c52
cmpl $0x25, %eax
je 0x4c52
incq %r13
jmp 0x4c3e
movq %rbp, %rdi
movl %r13d, %esi
movq 0x40(%rsp), %rdx
leaq 0xc(%rsp), %rcx
leaq 0x150(%rsp), %r8
leaq 0x8(%rsp), %r9
callq 0x5213
cmpb $0x0, (%rbp,%r13)
je 0x50ea
movq %rbp, %r15
addq %r13, %r15
leaq 0x1(,%r13), %r14
addq %rbp, %r14
movzbl (%r14), %eax
cmpl $0x53, %eax
jg 0x4cfe
leal -0x30(%rax), %ecx
cmpl $0xa, %ecx
jae 0x4eab
callq 0x21f0
movq (%rax), %rcx
movsbq (%r14), %rax
xorl %ebx, %ebx
testb $0x8, 0x1(%rcx,%rax,2)
je 0x4cd8
xorl %ebx, %ebx
movsbl %al, %eax
leal (%rbx,%rbx,4), %edx
leal (%rax,%rdx,2), %ebx
addl $-0x30, %ebx
movsbq 0x1(%r14), %rax
incq %r14
testb $0x8, 0x1(%rcx,%rax,2)
jne 0x4cbd
cmpb $0x73, %al
jne 0x4d41
movl 0x10(%rsp), %ecx
cmpq $0x28, %rcx
ja 0x4d90
movq %rcx, %rax
addq 0x20(%rsp), %rax
addl $0x8, %ecx
movl %ecx, 0x10(%rsp)
jmp 0x4d9e
cmpl $0x6c, %eax
jle 0x4d5a
addl $-0x6d, %eax
cmpl $0xb, %eax
ja 0x4f6f
leaq 0x6336(%rip), %rcx      # 0xb04c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x10(%rsp), %ecx
cmpq $0x28, %rcx
ja 0x4f8a
movq %rcx, %rax
addq 0x20(%rsp), %rax
addl $0x8, %ecx
movl %ecx, 0x10(%rsp)
jmp 0x4f98
movl $0x1, %r12d
subl %ebp, %r12d
addq %r14, %r12
subq %r13, %r12
movq 0x30(%rsp), %r13
jmp 0x4def
cmpl $0x54, %eax
je 0x4e90
cmpl $0x63, %eax
je 0x4f54
cmpl $0x64, %eax
jne 0x4f6f
movl 0x10(%rsp), %ecx
cmpq $0x28, %rcx
ja 0x4da8
movq %rcx, %rax
addq 0x20(%rsp), %rax
addl $0x8, %ecx
movl %ecx, 0x10(%rsp)
jmp 0x4db6
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
movq 0x30(%rsp), %r13
movq (%rax), %r15
jmp 0x4de4
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
movq 0x30(%rsp), %r13
movl (%rax), %edx
movb $0x25, 0x3d(%rsp)
movb (%r14), %al
movb %al, 0x3e(%rsp)
movb $0x0, 0x3f(%rsp)
xorl %ebx, %ebx
leaq 0x50(%rsp), %r15
movq %r15, %rdi
leaq 0x3d(%rsp), %rsi
xorl %eax, %eax
callq 0x21c0
movq %r15, %rdi
callq 0x20a0
movq %rax, %r12
testl %ebx, %ebx
je 0x4e1b
subl %r12d, %ebx
leaq 0x7043(%rip), %rdi      # 0xbe40
movl %ebx, %esi
movq 0x40(%rsp), %rdx
leaq 0xc(%rsp), %rcx
leaq 0x150(%rsp), %r8
leaq 0x8(%rsp), %r9
callq 0x5213
testl %r12d, %r12d
je 0x4e42
movq %r15, %rdi
movl %r12d, %esi
movq 0x40(%rsp), %rdx
leaq 0xc(%rsp), %rcx
leaq 0x150(%rsp), %r8
leaq 0x8(%rsp), %r9
callq 0x5213
cmpb $0x54, (%r14)
jne 0x4e75
testq %r13, %r13
je 0x4e75
leaq 0x85bb(%rip), %rdi      # 0xd40f
movl $0x1, %esi
movq 0x40(%rsp), %rdx
leaq 0xc(%rsp), %rcx
leaq 0x150(%rsp), %r8
leaq 0x8(%rsp), %r9
callq 0x5213
leaq 0x1(%r14), %rbp
cmpb $0x0, 0x1(%r14)
leaq 0x6f9b(%rip), %rbx      # 0xbe20
jne 0x4c36
jmp 0x50ed
movl 0x10(%rsp), %ecx
cmpq $0x28, %rcx
ja 0x4efd
movq %rcx, %rax
addq 0x20(%rsp), %rax
addl $0x8, %ecx
movl %ecx, 0x10(%rsp)
jmp 0x4f0b
cmpl $0x2e, %eax
jne 0x4f6f
movl $0x2, %r12d
xorl %ebx, %ebx
cmpb $0x2a, 0x2(%rbp,%r13)
jne 0x4d50
cmpb $0x73, 0x3(%rbp,%r13)
jne 0x4d50
movl 0x10(%rsp), %ecx
cmpq $0x28, %rcx
ja 0x5077
movq %rcx, %rax
addq 0x20(%rsp), %rax
addl $0x8, %ecx
movl %ecx, 0x10(%rsp)
jmp 0x5085
xorl %ebx, %ebx
jmp 0x4cdc
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
movq (%rax), %r13
xorl %ebx, %ebx
testq %r13, %r13
je 0x4f7c
movl 0x14(%r13), %r12d
movq 0x8(%r13), %r15
cmpb $0x54, (%r14)
jne 0x4def
leaq 0x84db(%rip), %rdi      # 0xd409
movl $0x7, %esi
movq 0x40(%rsp), %rdx
leaq 0xc(%rsp), %rcx
leaq 0x150(%rsp), %r8
leaq 0x8(%rsp), %r9
callq 0x5213
jmp 0x4def
movl 0x10(%rsp), %ecx
cmpq $0x28, %rcx
ja 0x4fd9
movq %rcx, %rax
addq 0x20(%rsp), %rax
addl $0x8, %ecx
movl %ecx, 0x10(%rsp)
jmp 0x4fe7
movl $0x2, %r12d
xorl %ebx, %ebx
jmp 0x4d50
xorl %r13d, %r13d
movq %rbp, %r15
xorl %r12d, %r12d
jmp 0x4def
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
movq (%rax), %rax
xorl %ecx, %ecx
movq 0x30(%rsp), %r13
movzbl (%rax,%rcx), %edx
shrl $0x4, %edx
movb (%rdx,%rbx), %dl
movb %dl, 0x50(%rsp,%rcx,2)
movzbl (%rax,%rcx), %edx
andl $0xf, %edx
movb (%rdx,%rbx), %dl
movb %dl, 0x51(%rsp,%rcx,2)
incq %rcx
cmpq $0x10, %rcx
jne 0x4fa2
movl $0x20, %r12d
xorl %ebx, %ebx
leaq 0x50(%rsp), %r15
jmp 0x4def
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 0x30(%rsp), %r13
ja 0x500a
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
leaq 0x83e9(%rip), %rsi      # 0xd3f1
jmp 0x5024
movzbl %al, %ecx
cmpl $0x1f, %ecx
ja 0x5040
addl $0x40, %edx
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
leaq 0x83d2(%rip), %rsi      # 0xd3f6
xorl %eax, %eax
callq 0x21c0
movq %rbx, %rdi
movq %rdi, %r15
callq 0x20a0
movq %rax, %r12
xorl %ebx, %ebx
jmp 0x4def
shll $0x18, %eax
cmpl $0x7f000000, %eax       # imm = 0x7F000000
jne 0x505d
movb $0x0, 0x52(%rsp)
movw $0x3f5e, 0x50(%rsp)     # imm = 0x3F5E
leaq 0x50(%rsp), %rdi
jmp 0x502e
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
leaq 0x8391(%rip), %rsi      # 0xd3fd
movl %ecx, %edx
xorl %eax, %eax
callq 0x21c0
jmp 0x502b
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
movl (%rax), %r12d
movl 0x10(%rsp), %ecx
cmpq $0x28, %rcx
ja 0x50a3
movq %rcx, %rax
addq 0x20(%rsp), %rax
addl $0x8, %ecx
movl %ecx, 0x10(%rsp)
jmp 0x50b1
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x3(,%r13), %r14
addq %rbp, %r14
movq (%rax), %r15
jmp 0x4d50
movl 0xcc2e(%rip), %ecx      # 0x11cf8
leal 0x1(%rcx), %edx
movl %edx, 0xcc25(%rip)      # 0x11cf8
cmpl $0x1, %ecx
jg 0x5201
cmpq %rbp, %rax
jne 0x4b9d
jmp 0x4c02
addq %r13, %rbp
movq 0x48(%rsp), %rbx
testq %rbx, %rbx
je 0x51e1
movl 0x10(%rbx), %r8d
testl %r8d, %r8d
je 0x5151
cmpb $0x20, -0x1(%rbp)
leaq 0x6d2c(%rip), %rax      # 0xbe3b
leaq 0x8320(%rip), %rdx      # 0xd436
cmoveq %rax, %rdx
movl 0x14(%rbx), %ecx
testb $0x2, %cl
leaq 0x8314(%rip), %rsi      # 0xd43b
cmoveq %rax, %rsi
testb $0x1, %cl
leaq 0x82f6(%rip), %rcx      # 0xd42b
cmoveq %rsi, %rcx
movq (%rbx), %r9
leaq 0x82ce(%rip), %rsi      # 0xd411
leaq 0x50(%rsp), %rdi
xorl %eax, %eax
callq 0x21c0
jmp 0x5165
movabsq $0x656e696c20746120, %rax # imm = 0x656E696C20746120
movq %rax, 0x50(%rsp)
movb $0x0, 0x58(%rsp)
movq %rbx, %r14
leaq 0x50(%rsp), %rdi
callq 0x20a0
movq %rax, %rbx
movl 0x8(%r14), %edx
movl 0xc(%r14), %ecx
movslq %ebx, %rax
leaq (%rsp,%rax), %rdi
addq $0x50, %rdi
cmpl %edx, %ecx
jle 0x519c
leaq 0x86ba(%rip), %rsi      # 0xd84d
xorl %eax, %eax
callq 0x21c0
jmp 0x51ac
leaq 0x8a2a(%rip), %rsi      # 0xdbcd
movl %ecx, %edx
xorl %eax, %eax
callq 0x21c0
movslq %ebx, %rbx
leaq (%rsp,%rbx), %rdi
addq $0x50, %rdi
callq 0x20a0
addl %eax, %ebx
leaq 0x50(%rsp), %rdi
leaq 0xc(%rsp), %rcx
leaq 0x150(%rsp), %r8
leaq 0x8(%rsp), %r9
movl %ebx, %esi
movq 0x40(%rsp), %rdx
callq 0x5213
leaq 0xc(%rsp), %rcx
leaq 0x150(%rsp), %r8
leaq 0x8(%rsp), %r9
xorl %edi, %edi
xorl %esi, %esi
movq 0x40(%rsp), %rdx
callq 0x5213
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq