// File: /workspace/github_c_makefile_star2_O0/krinkinmu[P]64bit/vsinkprintf.c
// Function: vsinkprintf
void vsinkprintf(struct vsinkprintf_sink *sink, const char *fmt, va_list args)
{
	struct format_spec spec;

	while (*fmt) {
		const char *save = fmt;
		const int read = format_decode(fmt, &spec);

		fmt += read;

		switch (spec.type) {
		case FT_NONE: {
			vsinkprintf_write(sink, save, read);
			break;
		}

		case FT_CHAR: {
			char c = va_arg(args, int);

			vsinkprintf_repeat(sink, ' ', MAX(spec.width, 0));
			vsinkprintf_putchar(sink, c);
			break;
		}

		case FT_STR: {
			const char *toprint = va_arg(args, const char *);
			const int len = strlen(toprint);

			vsinkprintf_repeat(sink, ' ', MAX(spec.width - len, 0));
			vsinkprintf_puts_nonewline(sink, toprint);
			break;
		}

		case FT_PERCENT:
			vsinkprintf_putchar(sink, '%');
			break;

		case FT_INVALID:
			vsinkprintf_putchar(sink, '?');
			break;

		default: {
			uintmax_t value;

			switch (spec.type) {
			case FT_PTR:
				value = (uintptr_t)va_arg(args, void *);
				break;
			case FT_LLONG:
				value = va_arg(args, long long);
				break;
			case FT_LONG:
				value = va_arg(args, long);
				break;
			case FT_INTMAX:
				value = va_arg(args, intmax_t);
				break;
			case FT_SIZE:
				value = va_arg(args, size_t);
				break;
			case FT_PTRDIFF:
				value = va_arg(args, ptrdiff_t);
				break;
			default:
				value = va_arg(args, int);
				break;
			}

			format_number(sink, value, &spec);
			break;
		}

		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0xffffffff8010280e
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0xffffffff80102820
movl %eax, -0x44(%rbp)
movslq -0x44(%rbp), %rcx
movq -0x10(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x68(%rbp)
subq $0xd, %rax
ja 0xffffffff801024ea
movq -0x68(%rbp), %rax
leaq 0xfa18(%rip), %rcx      # 0xffffffff80111d80
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
movslq -0x44(%rbp), %rdx
callq 0xffffffff80102bb0
jmp 0xffffffff80102809
movq -0x18(%rbp), %rax
movq %rax, -0x78(%rbp)
movl (%rax), %eax
movl %eax, -0x6c(%rbp)
cmpl $0x28, %eax
ja 0xffffffff801023b2
movq -0x78(%rbp), %rcx
movl -0x6c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x80(%rbp)
jmp 0xffffffff801023c9
movq -0x78(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movl (%rax), %eax
movb %al, -0x45(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movslq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xffffffff80102c30
movq -0x88(%rbp), %rdi
movq %rax, %rdx
movl $0x20, %esi
callq 0xffffffff80102be0
movq -0x8(%rbp), %rdi
movsbl -0x45(%rbp), %esi
callq 0xffffffff80102c60
jmp 0xffffffff80102809
movq -0x18(%rbp), %rax
movq %rax, -0x98(%rbp)
movl (%rax), %eax
movl %eax, -0x8c(%rbp)
cmpl $0x28, %eax
ja 0xffffffff8010244a
movq -0x98(%rbp), %rcx
movl -0x8c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0xa0(%rbp)
jmp 0xffffffff80102467
movq -0x98(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
callq 0xffffffff801018d0
movl %eax, -0x54(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl -0x20(%rbp), %eax
subl -0x54(%rbp), %eax
movslq %eax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xffffffff80102c30
movq -0xa8(%rbp), %rdi
movq %rax, %rdx
movl $0x20, %esi
callq 0xffffffff80102be0
movq -0x8(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0xffffffff80102ca0
jmp 0xffffffff80102809
movq -0x8(%rbp), %rdi
movl $0x25, %esi
callq 0xffffffff80102c60
jmp 0xffffffff80102809
movq -0x8(%rbp), %rdi
movl $0x3f, %esi
callq 0xffffffff80102c60
jmp 0xffffffff80102809
movq -0x38(%rbp), %rax
addq $-0x4, %rax
movq %rax, -0xb0(%rbp)
subq $0x5, %rax
ja 0xffffffff80102793
movq -0xb0(%rbp), %rax
leaq 0xf8a7(%rip), %rcx      # 0xffffffff80111db8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rax
movq %rax, -0xc0(%rbp)
movl (%rax), %eax
movl %eax, -0xb4(%rbp)
cmpl $0x28, %eax
ja 0xffffffff80102554
movq -0xc0(%rbp), %rcx
movl -0xb4(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0xc8(%rbp)
jmp 0xffffffff80102571
movq -0xc0(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0xffffffff801027f8
movq -0x18(%rbp), %rax
movq %rax, -0xd8(%rbp)
movl (%rax), %eax
movl %eax, -0xcc(%rbp)
cmpl $0x28, %eax
ja 0xffffffff801025be
movq -0xd8(%rbp), %rcx
movl -0xcc(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0xe0(%rbp)
jmp 0xffffffff801025db
movq -0xd8(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0xffffffff801027f8
movq -0x18(%rbp), %rax
movq %rax, -0xf0(%rbp)
movl (%rax), %eax
movl %eax, -0xe4(%rbp)
cmpl $0x28, %eax
ja 0xffffffff80102628
movq -0xf0(%rbp), %rcx
movl -0xe4(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0xf8(%rbp)
jmp 0xffffffff80102645
movq -0xf0(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0xffffffff801027f8
movq -0x18(%rbp), %rax
movq %rax, -0x108(%rbp)
movl (%rax), %eax
movl %eax, -0xfc(%rbp)
cmpl $0x28, %eax
ja 0xffffffff80102692
movq -0x108(%rbp), %rcx
movl -0xfc(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x110(%rbp)
jmp 0xffffffff801026af
movq -0x108(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0xffffffff801027f8
movq -0x18(%rbp), %rax
movq %rax, -0x120(%rbp)
movl (%rax), %eax
movl %eax, -0x114(%rbp)
cmpl $0x28, %eax
ja 0xffffffff801026fc
movq -0x120(%rbp), %rcx
movl -0x114(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x128(%rbp)
jmp 0xffffffff80102719
movq -0x120(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0xffffffff801027f8
movq -0x18(%rbp), %rax
movq %rax, -0x138(%rbp)
movl (%rax), %eax
movl %eax, -0x12c(%rbp)
cmpl $0x28, %eax
ja 0xffffffff80102766
movq -0x138(%rbp), %rcx
movl -0x12c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x140(%rbp)
jmp 0xffffffff80102783
movq -0x138(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0xffffffff801027f8
movq -0x18(%rbp), %rax
movq %rax, -0x150(%rbp)
movl (%rax), %eax
movl %eax, -0x144(%rbp)
cmpl $0x28, %eax
ja 0xffffffff801027cd
movq -0x150(%rbp), %rcx
movl -0x144(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x158(%rbp)
jmp 0xffffffff801027ea
movq -0x150(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x158(%rbp)
movq -0x158(%rbp), %rax
movslq (%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
movq -0x60(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0xffffffff80102ce0
jmp 0xffffffff80102317
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
nopw (%rax,%rax)