// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/extract.cpp
// Function: gv_read_list(char const*, int*)
char **gv_read_list(const char *o, int *n_)
{
	int n = 0, m = 0;
	char **s = 0;
	*n_ = 0;
	if (*o != '@') {
		const char *q = o, *p;
		for (p = q;; ++p) {
			if (*p == ',' || *p == 0) {
				if (n == m) {
					m = m? m<<1 : 16;
					GFA_REALLOC(s, m);
				}
				s[n++] = gfa_strndup(q, p - q);
				if (*p == 0) break;
				q = p + 1;
			}
		}
	} else {
		gzFile fp;
		kstream_t *ks;
		kstring_t str = {0,0,0};
		int dret;

		fp = gzopen(o + 1, "r");
		if (fp == 0) return 0;
		ks = ks_init(fp);
		while (ks_getuntil(ks, KS_SEP_LINE, &str, &dret) >= 0) {
			char *p;
			for (p = str.s; *p && !isspace(*p); ++p);
			if (n == m) {
				m = m? m<<1 : 16;
				GFA_REALLOC(s, m);
			}
			s[n++] = gfa_strndup(str.s, p - str.s);
		}
		ks_destroy(ks);
		gzclose(fp);
	}
	if (s) s = (char**)realloc(s, n * sizeof(char*));
	*n_ = n;
	return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
andl $0x0, (%rsi)
movq %rdi, %r15
movb (%rdi), %al
cmpb $0x40, %al
jne 0xeeec1
incq %r15
leaq 0x102a6f(%rip), %rsi    # 0x1f16b7
movq %r15, %rdi
callq 0x22d0
xorl %r15d, %r15d
testq %rax, %rax
je 0xeef75
movq %rax, %r14
movq %rbx, 0x28(%rsp)
pushq $0x1
popq %rdi
pushq $0x20
popq %rsi
callq 0x2120
movq %rax, %r12
movq %r14, 0x30(%rsp)
movq %r14, 0x18(%rax)
movl $0x10000, %edi          # imm = 0x10000
callq 0x2280
movq %rax, (%r12)
xorl %ebx, %ebx
movq $0x0, 0x18(%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x1, %r13b
xorl %ebp, %ebp
cmpl $-0x1, %r15d
je 0xeef37
movl 0x8(%r12), %r8d
cmpl %r15d, %r8d
jl 0xeed09
cmpl $0x0, 0x10(%r12)
jne 0xeede0
andl $0x0, 0x8(%r12)
movq (%r12), %rsi
movq 0x18(%r12), %rdi
movl $0x10000, %edx          # imm = 0x10000
callq 0x23d0
movl %eax, 0xc(%r12)
cmpl $-0x1, %eax
je 0xeef37
movl %eax, %r15d
testl %eax, %eax
je 0xeedf0
xorl %r8d, %r8d
movslq %r8d, %rsi
movslq %r15d, %rcx
cmpl %ecx, %esi
movl %ecx, %r14d
cmovgl %esi, %r14d
movq %rsi, %rdx
movq 0x8(%rsp), %rax
cmpq %rcx, %rdx
jge 0xeed37
movq (%r12), %rdi
cmpb $0xa, (%rdi,%rdx)
je 0xeed34
incq %rdx
jmp 0xeed20
movl %edx, %r14d
movq 0x18(%rsp), %rdx
subq %rbp, %rdx
movl %r14d, %ecx
subl %r8d, %ecx
leal 0x1(%rcx), %edi
movslq %edi, %rdi
cmpq %rdi, %rdx
jae 0xeeda1
movslq %ecx, %rdx
addq %rbp, %rdx
movq %rdx, %rcx
shrq %rcx
orq %rdx, %rcx
movq %rcx, %rdx
shrq $0x2, %rdx
orq %rcx, %rdx
movq %rdx, %rcx
shrq $0x4, %rcx
orq %rdx, %rcx
movq %rcx, %rdx
shrq $0x8, %rdx
orq %rcx, %rdx
movq %rdx, %rsi
shrq $0x10, %rsi
orq %rdx, %rsi
incq %rsi
movq %rax, %rdi
movq %rsi, 0x18(%rsp)
callq 0x2370
movslq 0x8(%r12), %rsi
movl %r14d, %ecx
subl %esi, %ecx
movq %rax, 0x8(%rsp)
leaq (%rax,%rbp), %rdi
addq (%r12), %rsi
movslq %ecx, %rdx
callq 0x2160
movslq 0x8(%r12), %rax
movslq %r14d, %rcx
subq %rax, %rcx
addq %rcx, %rbp
leal 0x1(%r14), %eax
movl %eax, 0x8(%r12)
movl 0xc(%r12), %r15d
xorl %r13d, %r13d
cmpl %r15d, %r14d
jge 0xeecb4
jmp 0xeee03
cmpl %r15d, %r8d
setge %al
testb %r13b, %al
je 0xeee03
jmp 0xeef37
movl $0x1, 0x10(%r12)
testb $0x1, %r13b
jne 0xeef37
movq 0x8(%rsp), %rax
testq %rax, %rax
je 0xeee22
cmpq $0x2, %rbp
jb 0xeee36
xorl %ecx, %ecx
cmpb $0xd, -0x1(%rax,%rbp)
sete %cl
subq %rcx, %rbp
jmp 0xeee36
pushq $0x1
popq %r14
movq %r14, %rdi
movq %r14, %rsi
callq 0x2120
movq %r14, 0x18(%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, (%rax,%rbp)
testl %ebp, %ebp
js 0xeef37
xorl %r15d, %r15d
movq 0x8(%rsp), %r13
movq 0x20(%rsp), %rbp
movsbl (%r13,%r15), %edi
testl %edi, %edi
je 0xeee6c
callq 0x2030
testl %eax, %eax
jne 0xeee6c
incq %r15
jmp 0xeee54
movl %ebp, %eax
cmpq %rax, %rbx
jne 0xeee96
movq %rbp, %rax
addl %ebp, %ebp
testl %eax, %eax
pushq $0x10
popq %rax
cmovel %eax, %ebp
movslq %ebp, %rsi
shlq $0x3, %rsi
movq 0x10(%rsp), %rdi
callq 0x2370
movq %rax, %r14
jmp 0xeee9b
movq 0x10(%rsp), %r14
movq %rbp, 0x20(%rsp)
movq %r13, %rdi
movq %r15, %rsi
callq 0xeebea
movq %r14, 0x10(%rsp)
movq %rax, (%r14,%rbx,8)
incq %rbx
movl 0xc(%r12), %r15d
jmp 0xeecaf
movq %rbx, 0x28(%rsp)
leaq 0x1(%r15), %r14
xorl %r13d, %r13d
movq %r15, %r12
xorl %ebp, %ebp
xorl %ebx, %ebx
cmpb $0x2c, %al
je 0xeeedf
movzbl %al, %eax
testl %eax, %eax
jne 0xeef2c
cmpl %r13d, %ebx
jne 0xeef0a
movq %rbp, %rdi
leal (,%r13,2), %ebp
testl %r13d, %r13d
pushq $0x10
popq %rax
cmovel %eax, %ebp
movslq %ebp, %rsi
shlq $0x3, %rsi
callq 0x2370
movl %ebp, %r13d
movq %rax, %rbp
movq %r12, %rsi
subq %r15, %rsi
movq %r15, %rdi
callq 0xeebea
movslq %ebx, %rcx
incl %ebx
movq %rax, (%rbp,%rcx,8)
cmpb $0x0, -0x1(%r14)
movq %r14, %r15
je 0xeef5c
movb (%r14), %al
incq %r14
incq %r12
jmp 0xeeed4
movq (%r12), %rdi
callq 0x2220
movq %r12, %rdi
callq 0x2220
movq 0x30(%rsp), %rdi
callq 0x2390
movq 0x10(%rsp), %rbp
testq %rbp, %rbp
je 0xeef87
movslq %ebx, %rsi
shlq $0x3, %rsi
movq %rbp, %rdi
callq 0x2370
movq %rax, %r15
movq 0x28(%rsp), %rax
movl %ebx, (%rax)
movq %r15, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r15d, %r15d
jmp 0xeef6e