// File: /workspace/github_c_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x30(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0xe6db
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 %rsi, 0x10(%rsp)
leaq 0x120(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
leaq 0x1f(%rsp), %r13
movl $0xcccccccd, %ebp       # imm = 0xCCCCCCCD
movq %r15, %r14
movzbl (%r14), %eax
cmpl $0x25, %eax
je 0xe71e
testl %eax, %eax
jne 0xeae1
jmp 0xeae9
movq %r14, %r12
subq %r15, %r12
jbe 0xe796
movq (%rbx), %rax
movslq %r12d, %rcx
leaq (%rax,%rcx), %rdx
incq %rdx
cmpq 0x8(%rbx), %rdx
jbe 0xe781
addq %rcx, %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
callq 0x2320
movq %rax, 0x10(%rbx)
movq 0x10(%rbx), %rdi
addq (%rbx), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x22a0
addq %r12, (%rbx)
movzbl 0x1(%r14), %eax
cmpl $0x72, %eax
jg 0xe7ce
cmpl $0x63, %eax
je 0xe800
cmpl $0x64, %eax
jne 0xeb7b
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0xe93e
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0xe94c
cmpl $0x73, %eax
je 0xe86e
cmpl $0x75, %eax
jne 0xeb7b
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0xea16
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0xea24
movq (%rbx), %rax
leaq 0x2(%rax), %rcx
cmpq 0x8(%rbx), %rcx
jbe 0xe855
incq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
callq 0x2320
movq %rax, 0x10(%rbx)
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0xe887
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0xe895
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0xe8ad
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0xe8bb
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)
jmp 0xead3
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %r15
movq %r15, %rdi
callq 0x2130
movq %rax, %r12
movq (%rbx), %rcx
movslq %r12d, %rax
leaq (%rax,%rcx), %rdx
incq %rdx
cmpq 0x8(%rbx), %rdx
jbe 0xe924
addq %rcx, %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
callq 0x2320
movq %rax, 0x10(%rbx)
movq 0x10(%rbx), %rdi
addq (%rbx), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x22a0
addq %r12, (%rbx)
jmp 0xead3
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movl (%rax), %eax
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
xorl %r15d, %r15d
movl %ecx, %edx
imulq %rbp, %rdx
shrq $0x23, %rdx
leal (%rdx,%rdx), %esi
leal (%rsi,%rsi,4), %esi
movl %ecx, %edi
subl %esi, %edi
orb $0x30, %dil
movb %dil, 0x20(%rsp,%r15)
incq %r15
cmpl $0x9, %ecx
movl %edx, %ecx
ja 0xe958
testl %eax, %eax
jns 0xe98e
movl %r15d, %eax
incl %r15d
movb $0x2d, 0x20(%rsp,%rax)
movq (%rbx), %rax
movslq %r15d, %rcx
leaq (%rax,%rcx), %rdx
incq %rdx
cmpq 0x8(%rbx), %rdx
jbe 0xe9e9
addq %rcx, %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
callq 0x2320
movq %rax, 0x10(%rbx)
movl %r15d, %eax
addq %r13, %rax
incl %r15d
movb (%rax), %cl
movq (%rbx), %rdx
movq 0x10(%rbx), %rsi
leaq 0x1(%rdx), %rdi
movq %rdi, (%rbx)
movb %cl, (%rsi,%rdx)
decl %r15d
decq %rax
cmpl $0x1, %r15d
jg 0xe9f2
jmp 0xead3
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movl (%rax), %ecx
movl $0x1, %edx
xorl %eax, %eax
movq %rdx, %r15
movl %ecx, %esi
imulq %rbp, %rsi
shrq $0x23, %rsi
leal (%rsi,%rsi), %edx
leal (%rdx,%rdx,4), %edx
movl %ecx, %edi
subl %edx, %edi
orb $0x30, %dil
movb %dil, 0x20(%rsp,%rax)
incq %rax
leaq 0x1(%r15), %rdx
cmpl $0x9, %ecx
movl %esi, %ecx
ja 0xea2d
movq (%rbx), %rcx
movl %eax, %eax
leaq (%rcx,%rax), %rdx
incq %rdx
cmpq 0x8(%rbx), %rdx
jbe 0xeab5
addq %rax, %rcx
movq %rcx, %rax
shrq %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rsi
shrq $0x10, %rsi
orq %rcx, %rsi
incq %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
callq 0x2320
movq %rax, 0x10(%rbx)
movb 0x1f(%rsp,%r15), %al
movq (%rbx), %rcx
movq 0x10(%rbx), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, (%rbx)
movb %al, (%rdx,%rcx)
decq %r15
testq %r15, %r15
jg 0xeab5
leaq 0x1(%r14), %rax
addq $0x2, %r14
movq %r14, %r15
movq %rax, %r14
incq %r14
jmp 0xe708
subq %r15, %r14
jbe 0xeb5e
movq (%rbx), %rax
movslq %r14d, %rcx
leaq (%rax,%rcx), %rdx
incq %rdx
cmpq 0x8(%rbx), %rdx
jbe 0xeb49
addq %rcx, %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
callq 0x2320
movq %rax, 0x10(%rbx)
movq 0x10(%rbx), %rdi
addq (%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x22a0
addq %r14, (%rbx)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
movb $0x0, (%rcx,%rax)
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2050