// File: /workspace/github_c_makefile_star2_O0/lh3[P]minigraph/gfa-io.c
// Function: gfa_aux_format
int gfa_aux_format(int l_aux, const uint8_t *aux, char **t, int *max)
{
	kstring_t str;
	const uint8_t *s = aux;
	str.l = 0, str.s = *t, str.m = *max;
	while (s < aux + l_aux) {
		uint8_t type, key[2];
		key[0] = s[0]; key[1] = s[1];
		s += 2; type = *s++;
		kputc('\t', &str); kputsn((char*)key, 2, &str); kputc(':', &str);
		if (type == 'A') { kputsn("A:", 2, &str); kputc(*s, &str); ++s; }
		else if (type == 'i') { kputsn("i:", 2, &str); kputw(*(int32_t*)s, &str); s += 4; }
		else if (type == 'f') { ksprintf(&str, "f:%g", *(float*)s); s += 4; }
		else if (type == 'Z') { kputc(type, &str); kputc(':', &str); while (*s) kputc(*s++, &str); ++s; }
		else if (type == 'B') {
			uint8_t sub_type = *(s++);
			int32_t i, n;
			memcpy(&n, s, 4);
			s += 4; // no point to the start of the array
			kputsn("B:", 2, &str); kputc(sub_type, &str); // write the typing
			for (i = 0; i < n; ++i) { // FIXME: for better performance, put the loop after "if"
				kputc(',', &str);
				if ('c' == sub_type)      { kputw(*(int8_t*)s, &str); ++s; }
				else if ('C' == sub_type) { kputw(*(uint8_t*)s, &str); ++s; }
				else if ('s' == sub_type) { kputw(*(int16_t*)s, &str); s += 2; }
				else if ('S' == sub_type) { kputw(*(uint16_t*)s, &str); s += 2; }
				else if ('i' == sub_type) { kputw(*(int32_t*)s, &str); s += 4; }
				else if ('I' == sub_type) { kputuw(*(uint32_t*)s, &str); s += 4; }
				else if ('f' == sub_type) { ksprintf(&str, "%g", *(float*)s); s += 4; }
			}
		}
	}
	*t = str.s, *max = str.m;
	return str.l;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movslq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x40(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq -0x4(%rbp), %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0x919d
movq -0x40(%rbp), %rax
movb (%rax), %al
movb %al, -0x43(%rbp)
movq -0x40(%rbp), %rax
movb 0x1(%rax), %al
movb %al, -0x42(%rbp)
movq -0x40(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x40(%rbp)
movb (%rax), %al
movb %al, -0x41(%rbp)
movl $0x9, %edi
leaq -0x38(%rbp), %rsi
callq 0x91c0
leaq -0x43(%rbp), %rdi
movl $0x2, %esi
leaq -0x38(%rbp), %rdx
callq 0x92f0
movl $0x3a, %edi
leaq -0x38(%rbp), %rsi
callq 0x91c0
movzbl -0x41(%rbp), %eax
cmpl $0x41, %eax
jne 0x8ee5
leaq 0x3355f(%rip), %rdi     # 0x3c415
movl $0x2, %esi
leaq -0x38(%rbp), %rdx
callq 0x92f0
movq -0x40(%rbp), %rax
movzbl (%rax), %edi
leaq -0x38(%rbp), %rsi
callq 0x91c0
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x9198
movzbl -0x41(%rbp), %eax
cmpl $0x69, %eax
jne 0x8f23
leaq 0x33523(%rip), %rdi     # 0x3c418
movl $0x2, %esi
leaq -0x38(%rbp), %rdx
callq 0x92f0
movq -0x40(%rbp), %rax
movl (%rax), %edi
leaq -0x38(%rbp), %rsi
callq 0x9440
movq -0x40(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x40(%rbp)
jmp 0x9196
movzbl -0x41(%rbp), %eax
cmpl $0x66, %eax
jne 0x8f5b
movq -0x40(%rbp), %rax
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
leaq -0x38(%rbp), %rdi
leaq 0x334d8(%rip), %rsi     # 0x3c41b
movb $0x1, %al
callq 0x9630
movq -0x40(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x40(%rbp)
jmp 0x9194
movzbl -0x41(%rbp), %eax
cmpl $0x5a, %eax
jne 0x8fb6
movzbl -0x41(%rbp), %edi
leaq -0x38(%rbp), %rsi
callq 0x91c0
movl $0x3a, %edi
leaq -0x38(%rbp), %rsi
callq 0x91c0
movq -0x40(%rbp), %rax
cmpb $0x0, (%rax)
je 0x8fa5
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x40(%rbp)
movzbl (%rax), %edi
leaq -0x38(%rbp), %rsi
callq 0x91c0
jmp 0x8f7f
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x9192
movzbl -0x41(%rbp), %eax
cmpl $0x42, %eax
jne 0x9190
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x40(%rbp)
movb (%rax), %al
movb %al, -0x44(%rbp)
movq -0x40(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4c(%rbp)
movq -0x40(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x40(%rbp)
leaq 0x3342d(%rip), %rdi     # 0x3c420
movl $0x2, %esi
leaq -0x38(%rbp), %rdx
callq 0x92f0
movzbl -0x44(%rbp), %edi
leaq -0x38(%rbp), %rsi
callq 0x91c0
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jge 0x918e
movl $0x2c, %edi
leaq -0x38(%rbp), %rsi
callq 0x91c0
movzbl -0x44(%rbp), %ecx
movl $0x63, %eax
cmpl %ecx, %eax
jne 0x905d
movq -0x40(%rbp), %rax
movsbl (%rax), %edi
leaq -0x38(%rbp), %rsi
callq 0x9440
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x917e
movzbl -0x44(%rbp), %ecx
movl $0x43, %eax
cmpl %ecx, %eax
jne 0x908b
movq -0x40(%rbp), %rax
movzbl (%rax), %edi
leaq -0x38(%rbp), %rsi
callq 0x9440
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x917c
movzbl -0x44(%rbp), %ecx
movl $0x73, %eax
cmpl %ecx, %eax
jne 0x90b9
movq -0x40(%rbp), %rax
movswl (%rax), %edi
leaq -0x38(%rbp), %rsi
callq 0x9440
movq -0x40(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x40(%rbp)
jmp 0x917a
movzbl -0x44(%rbp), %ecx
movl $0x53, %eax
cmpl %ecx, %eax
jne 0x90e7
movq -0x40(%rbp), %rax
movzwl (%rax), %edi
leaq -0x38(%rbp), %rsi
callq 0x9440
movq -0x40(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x40(%rbp)
jmp 0x9178
movzbl -0x44(%rbp), %ecx
movl $0x69, %eax
cmpl %ecx, %eax
jne 0x9111
movq -0x40(%rbp), %rax
movl (%rax), %edi
leaq -0x38(%rbp), %rsi
callq 0x9440
movq -0x40(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x40(%rbp)
jmp 0x9176
movzbl -0x44(%rbp), %ecx
movl $0x49, %eax
cmpl %ecx, %eax
jne 0x913b
movq -0x40(%rbp), %rax
movl (%rax), %edi
leaq -0x38(%rbp), %rsi
callq 0x9850
movq -0x40(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x40(%rbp)
jmp 0x9174
movzbl -0x44(%rbp), %ecx
movl $0x66, %eax
cmpl %ecx, %eax
jne 0x9172
movq -0x40(%rbp), %rax
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
leaq -0x38(%rbp), %rdi
leaq 0x332be(%rip), %rsi     # 0x3c41d
movb $0x1, %al
callq 0x9630
movq -0x40(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x40(%rbp)
jmp 0x9174
jmp 0x9176
jmp 0x9178
jmp 0x917a
jmp 0x917c
jmp 0x917e
jmp 0x9180
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x9015
jmp 0x9190
jmp 0x9192
jmp 0x9194
jmp 0x9196
jmp 0x9198
jmp 0x8e2d
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x38(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nop