// File: /workspace/github_c_makefile_star2_O2/lh3[P]minimap2/format.c
// Function: mm_sprintf_lite
static void mm_sprintf_lite(kstring_t *s, const char *fmt, ...)
{
	char buf[16]; // for integer to string conversion
	const char *p, *q;
	va_list ap;
	va_start(ap, fmt);
	for (q = p = fmt; *p; ++p) {
		if (*p == '%') {
			if (p > q) str_copy(s, q, p);
			++p;
			if (*p == 'd') {
				int c, i, l = 0;
				unsigned int x;
				c = va_arg(ap, int);
				x = c >= 0? c : -c;
				do { buf[l++] = x%10 + '0'; x /= 10; } while (x > 0);
				if (c < 0) buf[l++] = '-';
				str_enlarge(s, l);
				for (i = l - 1; i >= 0; --i) s->s[s->l++] = buf[i];
			} else if (*p == 'u') {
				int i, l = 0;
				uint32_t x;
				x = va_arg(ap, uint32_t);
				do { buf[l++] = x%10 + '0'; x /= 10; } while (x > 0);
				str_enlarge(s, l);
				for (i = l - 1; i >= 0; --i) s->s[s->l++] = buf[i];
			} else if (*p == 's') {
				char *r = va_arg(ap, char*);
				str_copy(s, r, r + strlen(r));
			} else if (*p == 'c') {
				str_enlarge(s, 1);
				s->s[s->l++] = va_arg(ap, int);
			} else abort();
			q = p + 1;
		}
	}
	if (p > q) str_copy(s, q, p);
	va_end(ap);
	s->s[s->l] = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xe0, %rsp
movq %rdi, %rbx
leaq 0x30(%rsp), %rdi
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0xcef3
movaps %xmm0, 0x60(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
movaps %xmm4, 0xa0(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xc0(%rsp)
movaps %xmm7, 0xd0(%rsp)
movq %rdi, 0x10(%rsp)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
pushq $0x1
popq %rbp
pushq $0xa
popq %r12
movq %rsi, %r14
movzbl (%r14), %eax
cmpl $0x25, %eax
je 0xcf33
testl %eax, %eax
jne 0xd0ad
jmp 0xd10d
cmpq %rsi, %r14
jbe 0xcf43
movq %rbx, %rdi
movq %r14, %rdx
callq 0xf09a
movzbl 0x1(%r14), %eax
cmpl $0x63, %eax
je 0xcf99
cmpl $0x75, %eax
je 0xcfc3
cmpl $0x73, %eax
je 0xcf80
cmpl $0x64, %eax
jne 0xd138
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0xd010
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0xd01e
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0xcfe3
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0xcff1
movq %rbx, %rdi
movl %ebp, %esi
callq 0xf0cd
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0xd07e
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0xd08c
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0xd0b5
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0xd0c3
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %r15
movq %r15, %rdi
callq 0x2130
leaq (%rax,%r15), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xf09a
jmp 0xd09f
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movl (%rax), %esi
movl %esi, %ecx
negl %ecx
cmovsl %esi, %ecx
xorl %r15d, %r15d
movl %ecx, %eax
xorl %edx, %edx
divl %r12d
orb $0x30, %dl
movb %dl, 0x20(%rsp,%r15)
incq %r15
cmpl $0x9, %ecx
movl %eax, %ecx
ja 0xd02a
testl %esi, %esi
jns 0xd052
movl %r15d, %eax
incl %r15d
movb $0x2d, 0x20(%rsp,%rax)
movq %rbx, %rdi
movl %r15d, %esi
callq 0xf0cd
movl %r15d, %eax
testl %eax, %eax
jle 0xd09f
movb 0x1f(%rsp,%rax), %cl
decq %rax
movq (%rbx), %rdx
movq 0x10(%rbx), %rsi
leaq 0x1(%rdx), %rdi
movq %rdi, (%rbx)
movb %cl, (%rsi,%rdx)
jmp 0xd060
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movb (%rax), %al
movq (%rbx), %rcx
movq 0x10(%rbx), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, (%rbx)
movb %al, (%rdx,%rcx)
leaq 0x1(%r14), %rax
addq $0x2, %r14
movq %r14, %rsi
movq %rax, %r14
incq %r14
jmp 0xcf1d
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movl (%rax), %ecx
xorl %esi, %esi
movl %ecx, %eax
xorl %edx, %edx
divl %r12d
orb $0x30, %dl
movb %dl, 0x20(%rsp,%rsi)
incq %rsi
cmpl $0x9, %ecx
movl %eax, %ecx
ja 0xd0c7
leal -0x1(%rsi), %r15d
movq %rbx, %rdi
callq 0xf0cd
testl %r15d, %r15d
js 0xd09f
movl %r15d, %eax
movb 0x20(%rsp,%rax), %al
movq (%rbx), %rcx
movq 0x10(%rbx), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, (%rbx)
movb %al, (%rdx,%rcx)
decl %r15d
jmp 0xd0eb
cmpq %rsi, %r14
jbe 0xd11d
movq %rbx, %rdi
movq %r14, %rdx
callq 0xf09a
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
movb $0x0, (%rcx,%rax)
addq $0xe0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x2050