// File: /workspace/github_c_makefile_star2_O0/NedFreed[P]msglint/msglint.c
// Function: wordwrap
static void wordwrap(const char *str, int len, int indent,
		     int *ppos, char *wbuf, int buflen, int *bufused)
{
    char *wptr = wbuf + *bufused;
    char *wend = wbuf + buflen - 1;
    const char *end = str + len;
    int pos = *ppos;

    /* loop over words */
    do {
	/* copy word to buffer */
	if (str != NULL) {
	    while (str < end && !isspace(*str) && wptr < wend) {
		*wptr = *str;
		++wptr, ++str;
	    }
	    if (str == end) break;
	}
	
	/* check if we need to word wrap
	 *  word wrap at 78 chars unless at beginning of line,
	 *  word wouldn't fit on new line or we're on the last word and it
	 *  will barely squeeze in under 80 columns
	 */
	if (pos > indent && wptr - wbuf + pos >= 78 &&
	    wptr - wbuf + indent < 80 &&
	    (str != NULL || wptr - wbuf + pos > 79)) {
	    fprintf(outfile, NEWLINE);
	    fprintf(outfile, "%.*s", indent, pad_str);
	    pos = indent;
	}
	pos += wptr - wbuf;

	/* deal with spaces */
	if (str != NULL) {
	    while (str < end && isspace(*str) && wptr < wend && pos < 78) {
		*wptr = *str;
		if (*str == '\n') {
		    pos = 78;
		    ++str;
		} else {
		    ++wptr, ++str, ++pos;
		}
	    }
	    while (str < end && isspace(*str)) ++str;
	}

	/* print it */
	*wptr = '\0';
	fprintf(outfile, "%s", wbuf);
	wptr = wbuf;

	/* check for end case */
	if (str == NULL) {
	    fprintf(outfile, NEWLINE);
	    break;
	}
    } while (str < end);
	
    /* set results */
    *ppos = pos;
    *bufused = wptr - wbuf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rbp), %rcx
movslq (%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
addq %rcx, %rax
addq $-0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x44(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x434f
jmp 0x42cc
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpq -0x40(%rbp), %rcx
movb %al, -0x45(%rbp)
jae 0x430f
callq 0x21d0
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %ecx
andl $0x2000, %ecx           # imm = 0x2000
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x45(%rbp)
jne 0x430f
movq -0x30(%rbp), %rax
cmpq -0x38(%rbp), %rax
setb %al
movb %al, -0x45(%rbp)
movb -0x45(%rbp), %al
testb $0x1, %al
jne 0x4318
jmp 0x433e
movq -0x8(%rbp), %rax
movb (%rax), %cl
movq -0x30(%rbp), %rax
movb %cl, (%rax)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x42cc
movq -0x8(%rbp), %rax
cmpq -0x40(%rbp), %rax
jne 0x434d
jmp 0x4554
jmp 0x434f
movl -0x44(%rbp), %eax
cmpl -0x10(%rbp), %eax
jle 0x43e4
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
movslq -0x44(%rbp), %rcx
addq %rcx, %rax
cmpq $0x4e, %rax
jl 0x43e4
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
movslq -0x10(%rbp), %rcx
addq %rcx, %rax
cmpq $0x50, %rax
jge 0x43e4
cmpq $0x0, -0x8(%rbp)
jne 0x43aa
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
movslq -0x44(%rbp), %rcx
addq %rcx, %rax
cmpq $0x4f, %rax
jle 0x43e4
movq 0x10957(%rip), %rdi     # 0x14d08
leaq 0xc4a1(%rip), %rsi      # 0x10859
movb $0x0, %al
callq 0x2100
movq 0x10942(%rip), %rdi     # 0x14d08
movl -0x10(%rbp), %edx
leaq 0xe012(%rip), %rsi      # 0x123e2
leaq 0xafa9(%rip), %rcx      # 0xf380
movb $0x0, %al
callq 0x2100
movl -0x10(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
subq %rax, %rcx
movslq -0x44(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x44(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x44fe
jmp 0x4406
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpq -0x40(%rbp), %rcx
movb %al, -0x46(%rbp)
jae 0x4454
callq 0x21d0
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %ecx
andl $0x2000, %ecx           # imm = 0x2000
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x46(%rbp)
je 0x4454
movq -0x30(%rbp), %rcx
xorl %eax, %eax
cmpq -0x38(%rbp), %rcx
movb %al, -0x46(%rbp)
jae 0x4454
cmpl $0x4e, -0x44(%rbp)
setl %al
movb %al, -0x46(%rbp)
movb -0x46(%rbp), %al
testb $0x1, %al
jne 0x445d
jmp 0x44b0
movq -0x8(%rbp), %rax
movb (%rax), %cl
movq -0x30(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
jne 0x448a
movl $0x4e, -0x44(%rbp)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x44ab
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x4406
jmp 0x44b2
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpq -0x40(%rbp), %rcx
movb %al, -0x47(%rbp)
jae 0x44e5
callq 0x21d0
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
setne %al
movb %al, -0x47(%rbp)
movb -0x47(%rbp), %al
testb $0x1, %al
jne 0x44ee
jmp 0x44fc
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x44b2
jmp 0x44fe
movq -0x30(%rbp), %rax
movb $0x0, (%rax)
movq 0x107fc(%rip), %rdi     # 0x14d08
movq -0x20(%rbp), %rdx
leaq 0xd400(%rip), %rsi      # 0x11917
movb $0x0, %al
callq 0x2100
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x4544
movq 0x107d4(%rip), %rdi     # 0x14d08
leaq 0xc31e(%rip), %rsi      # 0x10859
movb $0x0, %al
callq 0x2100
jmp 0x4554
jmp 0x4546
movq -0x8(%rbp), %rax
cmpq -0x40(%rbp), %rax
jb 0x42bf
movl -0x44(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq 0x10(%rbp), %rax
movl %ecx, (%rax)
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)