// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
testb %al, %al
je 0x14537
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 %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x50(%rbp), %rax
leaq -0x130(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpb $0x0, (%rax)
je 0x14999
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
jne 0x14986
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jbe 0x145c3
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x17110
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x64, %eax
jne 0x1470d
movl $0x0, -0x5c(%rbp)
leaq -0x50(%rbp), %rax
movq %rax, -0x140(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0x134(%rbp)
cmpl $0x28, %eax
ja 0x14621
movq -0x140(%rbp), %rcx
movl -0x134(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x148(%rbp)
jmp 0x1463e
movq -0x140(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x148(%rbp)
movq -0x148(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x54(%rbp)
cmpl $0x0, -0x54(%rbp)
jl 0x1465b
movl -0x54(%rbp), %eax
movl %eax, -0x14c(%rbp)
jmp 0x14666
xorl %eax, %eax
subl -0x54(%rbp), %eax
movl %eax, -0x14c(%rbp)
movl -0x14c(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %eax
movl $0xa, %ecx
xorl %edx, %edx
divl %ecx
addl $0x30, %edx
movb %dl, %cl
movl -0x5c(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x5c(%rbp)
cltq
movb %cl, -0x20(%rbp,%rax)
movl -0x60(%rbp), %eax
movl $0xa, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, -0x60(%rbp)
cmpl $0x0, -0x60(%rbp)
ja 0x1466f
cmpl $0x0, -0x54(%rbp)
jge 0x146be
movl -0x5c(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x5c(%rbp)
cltq
movb $0x2d, -0x20(%rbp,%rax)
movq -0x8(%rbp), %rdi
movl -0x5c(%rbp), %esi
callq 0x17180
movl -0x5c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x58(%rbp)
cmpl $0x0, -0x58(%rbp)
jl 0x14708
movslq -0x58(%rbp), %rax
movb -0x20(%rbp,%rax), %dl
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movb %dl, (%rax,%rcx)
movl -0x58(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x146d3
jmp 0x1497a
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x75, %eax
jne 0x1480e
movl $0x0, -0x68(%rbp)
leaq -0x50(%rbp), %rax
movq %rax, -0x158(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0x150(%rbp)
cmpl $0x28, %eax
ja 0x1475f
movq -0x158(%rbp), %rcx
movl -0x150(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x160(%rbp)
jmp 0x1477c
movq -0x158(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x160(%rbp)
movq -0x160(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movl $0xa, %ecx
xorl %edx, %edx
divl %ecx
addl $0x30, %edx
movb %dl, %cl
movl -0x68(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x68(%rbp)
cltq
movb %cl, -0x20(%rbp,%rax)
movl -0x6c(%rbp), %eax
movl $0xa, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, -0x6c(%rbp)
cmpl $0x0, -0x6c(%rbp)
ja 0x14788
movq -0x8(%rbp), %rdi
movl -0x68(%rbp), %esi
callq 0x17180
movl -0x68(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
jl 0x14809
movslq -0x64(%rbp), %rax
movb -0x20(%rbp,%rax), %dl
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movb %dl, (%rax,%rcx)
movl -0x64(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x147d4
jmp 0x14978
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x73, %eax
jne 0x148d0
leaq -0x50(%rbp), %rax
movq %rax, -0x170(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0x164(%rbp)
cmpl $0x28, %eax
ja 0x14859
movq -0x170(%rbp), %rcx
movl -0x164(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x178(%rbp)
jmp 0x14876
movq -0x170(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x178(%rbp)
movq -0x178(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x180(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x190(%rbp)
movq -0x78(%rbp), %rdi
callq 0x2130
movq -0x190(%rbp), %rdx
movq -0x188(%rbp), %rdi
movq -0x180(%rbp), %rsi
addq %rax, %rdx
callq 0x17110
jmp 0x14976
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x63, %eax
jne 0x1496f
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x17180
leaq -0x50(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0x194(%rbp)
cmpl $0x28, %eax
ja 0x14929
movq -0x1a0(%rbp), %rcx
movl -0x194(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x1a8(%rbp)
jmp 0x14946
movq -0x1a0(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x1a8(%rbp)
movq -0x1a8(%rbp), %rax
movl (%rax), %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movb %dl, (%rax,%rcx)
jmp 0x14974
callq 0x2050
jmp 0x14976
jmp 0x14978
jmp 0x1497a
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x14988
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x1458b
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jbe 0x149b4
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x17110
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq 0x10(%rax), %rax
movb $0x0, (%rax,%rcx)
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
nopl (%rax)