// File: /workspace/github_c_makefile_star2_O3/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 0xe5df
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 0xe622
testl %eax, %eax
jne 0xe9ef
jmp 0xe9f7
movq %r14, %r12
subq %r15, %r12
jbe 0xe69f
movq (%rbx), %rdi
movslq %r12d, %rax
leaq (%rdi,%rax), %rcx
incq %rcx
cmpq 0x8(%rbx), %rcx
jbe 0xe68a
addq %rax, %rdi
movq %rdi, %rax
shrq %rax
orq %rdi, %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)
movq (%rbx), %rdi
jmp 0xe68e
movq 0x10(%rbx), %rax
addq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x22a0
addq %r12, (%rbx)
movzbl 0x1(%r14), %eax
cmpl $0x72, %eax
jg 0xe6d7
cmpl $0x63, %eax
je 0xe709
cmpl $0x64, %eax
jne 0xea8e
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0xe84c
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0xe85a
cmpl $0x73, %eax
je 0xe777
cmpl $0x75, %eax
jne 0xea8e
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0xe924
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0xe932
movq (%rbx), %rax
leaq 0x2(%rax), %rcx
cmpq 0x8(%rbx), %rcx
jbe 0xe75e
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 0xe790
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0xe79e
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0xe7b6
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0xe7c4
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 0xe9e1
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), %rdi
movslq %r12d, %rax
leaq (%rax,%rdi), %rcx
incq %rcx
cmpq 0x8(%rbx), %rcx
jbe 0xe832
addq %rdi, %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 (%rbx), %rdi
jmp 0xe836
movq 0x10(%rbx), %rax
addq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x22a0
addq %r12, (%rbx)
jmp 0xe9e1
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 0xe866
testl %eax, %eax
jns 0xe89c
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 0xe8f7
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 0xe900
jmp 0xe9e1
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 0xe93b
movq (%rbx), %rcx
movl %eax, %eax
leaq (%rcx,%rax), %rdx
incq %rdx
cmpq 0x8(%rbx), %rdx
jbe 0xe9c3
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 0xe9c3
leaq 0x1(%r14), %rax
addq $0x2, %r14
movq %r14, %r15
movq %rax, %r14
incq %r14
jmp 0xe60c
subq %r15, %r14
jbe 0xea71
movq (%rbx), %rdi
movslq %r14d, %rax
leaq (%rdi,%rax), %rcx
incq %rcx
cmpq 0x8(%rbx), %rcx
jbe 0xea5c
addq %rax, %rdi
movq %rdi, %rax
shrq %rax
orq %rdi, %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)
movq (%rbx), %rdi
jmp 0xea60
movq 0x10(%rbx), %rax
addq %rax, %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