// File: /workspace/github_c_makefile_star2_O0/tomka[P]cliaspora/str.c
// Function: strduprintf
char *
strduprintf(const char *fmt, ...)
{
	char	*str, *buf, tmp[64];
	size_t  bufsz;
	va_list ap;

	va_start(ap, fmt); buf = NULL; bufsz = 0;
	while (*fmt != '\0') {
		if (*fmt == '%') {
			if (*++fmt == '\0') {
				va_end(ap); return (buf);
			}
		} else {
			if (strdupstrcat(&buf, &bufsz, fmt++, 1) == NULL)
				goto error;
			continue;
		}
		switch(*fmt++) {
		case '%':
			if (strdupstrcat(&buf, &bufsz, "%", 1) == NULL)
				goto error;
			break;	
		case 'c':
			(void)snprintf(tmp, sizeof(tmp), "%c",
			    va_arg(ap, int));
			if (strdupstrcat(&buf, &bufsz, tmp, 1) == NULL)
				goto error;
			break;
		case 'd':
			(void)snprintf(tmp, sizeof(tmp), "%d",
			    va_arg(ap, int));
			if (strdupstrcat(&buf, &bufsz, tmp,
			    strlen(tmp)) == NULL)
				goto error;
			break;
		case 's':
			str = va_arg(ap, char *);
			if (strdupstrcat(&buf, &bufsz, str,
			    strlen(str)) == NULL)
				goto error;
			break;
		}
	}
	va_end(ap);

	return (buf);
error:
	va_end(ap); free(buf);
	return (NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
testb %al, %al
je 0xd5b7
movaps %xmm0, -0x100(%rbp)
movaps %xmm1, -0xf0(%rbp)
movaps %xmm2, -0xe0(%rbp)
movaps %xmm3, -0xd0(%rbp)
movaps %xmm4, -0xc0(%rbp)
movaps %xmm5, -0xb0(%rbp)
movaps %xmm6, -0xa0(%rbp)
movaps %xmm7, -0x90(%rbp)
movq %r9, -0x108(%rbp)
movq %r8, -0x110(%rbp)
movq %rcx, -0x118(%rbp)
movq %rdx, -0x120(%rbp)
movq %rsi, -0x128(%rbp)
movq %rdi, -0x10(%rbp)
leaq -0x80(%rbp), %rax
leaq -0x130(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x8, (%rax)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x68(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0xd90d
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
jne 0xd659
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0xd657
leaq -0x80(%rbp), %rax
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xd930
jmp 0xd687
movq -0x10(%rbp), %rdx
movq %rdx, %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x68(%rbp), %rsi
movl $0x1, %ecx
callq 0xd460
cmpq $0x0, %rax
jne 0xd685
jmp 0xd91b
jmp 0xd612
movq -0x10(%rbp), %rax
movq %rax, %rcx
incq %rcx
movq %rcx, -0x10(%rbp)
movsbl (%rax), %eax
movl %eax, -0x134(%rbp)
subl $0x25, %eax
je 0xd6d7
jmp 0xd6a5
movl -0x134(%rbp), %eax
subl $0x63, %eax
je 0xd700
jmp 0xd6b2
movl -0x134(%rbp), %eax
subl $0x64, %eax
je 0xd7ac
jmp 0xd6c3
movl -0x134(%rbp), %eax
subl $0x73, %eax
je 0xd86d
jmp 0xd908
leaq -0x20(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq 0x261d(%rip), %rdx      # 0xfd03
movl $0x1, %ecx
callq 0xd460
cmpq $0x0, %rax
jne 0xd6fb
jmp 0xd91b
jmp 0xd908
leaq -0x60(%rbp), %rax
movq %rax, -0x148(%rbp)
leaq -0x80(%rbp), %rax
movq %rax, -0x140(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0x138(%rbp)
cmpl $0x28, %eax
ja 0xd746
movq -0x140(%rbp), %rcx
movl -0x138(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x150(%rbp)
jmp 0xd763
movq -0x140(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x150(%rbp)
movq -0x148(%rbp), %rdi
movq -0x150(%rbp), %rax
movl (%rax), %ecx
movl $0x40, %esi
leaq 0x171e(%rip), %rdx      # 0xee9d
movb $0x0, %al
callq 0x2540
leaq -0x60(%rbp), %rdx
leaq -0x20(%rbp), %rdi
leaq -0x68(%rbp), %rsi
movl $0x1, %ecx
callq 0xd460
cmpq $0x0, %rax
jne 0xd7a7
jmp 0xd91b
jmp 0xd908
leaq -0x60(%rbp), %rax
movq %rax, -0x168(%rbp)
leaq -0x80(%rbp), %rax
movq %rax, -0x160(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0x154(%rbp)
cmpl $0x28, %eax
ja 0xd7f2
movq -0x160(%rbp), %rcx
movl -0x154(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x170(%rbp)
jmp 0xd80f
movq -0x160(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x170(%rbp)
movq -0x168(%rbp), %rdi
movq -0x170(%rbp), %rax
movl (%rax), %ecx
movl $0x40, %esi
leaq 0x1fdc(%rip), %rdx      # 0xf807
movb $0x0, %al
callq 0x2540
leaq -0x60(%rbp), %rax
movq %rax, -0x178(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x2160
movq -0x178(%rbp), %rdx
movq %rax, %rcx
leaq -0x20(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0xd460
cmpq $0x0, %rax
jne 0xd868
jmp 0xd91b
jmp 0xd908
leaq -0x80(%rbp), %rax
movq %rax, -0x188(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0x17c(%rbp)
cmpl $0x28, %eax
ja 0xd8a8
movq -0x188(%rbp), %rcx
movl -0x17c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x190(%rbp)
jmp 0xd8c5
movq -0x188(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x190(%rbp)
movq -0x190(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2160
movq -0x198(%rbp), %rdx
movq %rax, %rcx
leaq -0x20(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0xd460
cmpq $0x0, %rax
jne 0xd906
jmp 0xd91b
jmp 0xd908
jmp 0xd612
leaq -0x80(%rbp), %rax
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xd930
leaq -0x80(%rbp), %rax
movq -0x20(%rbp), %rdi
callq 0x23d0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq