// File: /workspace/github_cpp_makefile_star2_O1/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 $0x28, %rsp
movq %rdi, %r15
movl $0x0, (%rsi)
cmpb $0x40, (%rdi)
movq %rsi, 0x20(%rsp)
jne 0x12f268
incq %r15
leaq 0x1045fb(%rip), %rsi    # 0x2335a7
movq %r15, %rdi
callq 0x22d0
movq %rax, %rbx
testq %rax, %rax
je 0x12f333
movl $0x1, %edi
movl $0x20, %esi
callq 0x2120
movq %rax, %r12
movq %rbx, 0x18(%rsp)
movq %rbx, 0x18(%rax)
movl $0x10000, %edi          # imm = 0x10000
callq 0x2280
movq %rax, (%r12)
movq $0x0, 0x8(%rsp)
xorl %ebp, %ebp
xorl %r15d, %r15d
movq $0x0, 0x10(%rsp)
movq $0x0, (%rsp)
xorl %ebx, %ebx
xorl %r13d, %r13d
movl 0xc(%r12), %eax
movl $0x1, %r14d
cmpl $-0x1, %eax
je 0x12f10e
cmpl %eax, 0x8(%r12)
jge 0x12f100
movl 0x8(%r12), %eax
movl 0xc(%r12), %ecx
movl %eax, %r13d
cmpl %ecx, %eax
jge 0x12f05a
movslq %eax, %rdx
addq (%r12), %rdx
movl %eax, %r13d
cmpb $0xa, (%rdx)
je 0x12f05a
incl %r13d
incq %rdx
cmpl %r13d, %ecx
jne 0x12f047
movl %ecx, %r13d
movq %rbp, %rdx
subq %rbx, %rdx
movl %r13d, %ecx
subl %eax, %ecx
leal 0x1(%rcx), %eax
cltq
cmpq %rax, %rdx
jae 0x12f0b7
movslq %ecx, %rax
addq %rbx, %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, %rbp
shrq $0x10, %rbp
orq %rax, %rbp
incq %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x2370
movq %rax, %r15
leaq (%r15,%rbx), %rdi
movslq 0x8(%r12), %rax
movq (%r12), %rsi
addq %rax, %rsi
movslq %r13d, %r14
movq %r14, %rdx
subq %rax, %rdx
callq 0x2160
movslq 0x8(%r12), %rax
subq %rax, %r14
addq %r14, %rbx
leal 0x1(%r13), %eax
movl %eax, 0x8(%r12)
xorl %r14d, %r14d
cmpl 0xc(%r12), %r13d
setl %r14b
addl %r14d, %r14d
movl $0x1, %r13d
jmp 0x12f10e
movl $0x2, %r14d
cmpl $0x0, 0x10(%r12)
je 0x12f119
testl %r14d, %r14d
je 0x12f00d
jmp 0x12f163
movl $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 0x12f152
testl %eax, %eax
jne 0x12f02c
movl $0x1, 0x10(%r12)
jmp 0x12f10e
movl $0x1, 0x10(%r12)
movl $0x1, %r14d
jmp 0x12f10e
cmpl $0x2, %r14d
jne 0x12f19d
testl %r13d, %r13d
je 0x12f189
testq %r15, %r15
je 0x12f1a5
cmpq $0x2, %rbx
jb 0x12f1bc
xorl %eax, %eax
cmpb $0xd, -0x1(%r15,%rbx)
sete %al
subq %rax, %rbx
jmp 0x12f1bc
cmpl $0x0, 0x10(%r12)
je 0x12f16e
movl 0x8(%r12), %eax
cmpl 0xc(%r12), %eax
jl 0x12f16e
xorl %eax, %eax
movq (%rsp), %r14
jmp 0x12f1ca
movl $0x1, %ebp
movl $0x1, %edi
movl $0x1, %esi
callq 0x2120
movq %rax, %r15
movq (%rsp), %r14
movb $0x0, (%r15,%rbx)
testl %ebx, %ebx
setns %al
testb %al, %al
movq 0x10(%rsp), %rbx
je 0x12f30e
movb (%r15), %al
movq %r15, %r13
testb %al, %al
je 0x12f1fb
movq %r15, %r13
movsbl %al, %edi
callq 0x2030
testl %eax, %eax
jne 0x12f1fb
movb 0x1(%r13), %al
incq %r13
testb %al, %al
jne 0x12f1e4
movl %ebx, %eax
cmpq %rax, 0x8(%rsp)
jne 0x12f22c
movq %rbx, %rax
addl %ebx, %ebx
testl %eax, %eax
movl $0x10, %eax
cmovel %eax, %ebx
movslq %ebx, %rsi
shlq $0x3, %rsi
movq %r14, %rdi
callq 0x2370
movq %rax, %r14
movl %ebx, %eax
movq %rax, 0x10(%rsp)
subq %r15, %r13
leaq 0x1(%r13), %rdi
callq 0x2280
movq %rax, %rbx
movq %rax, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x20d0
movb $0x0, (%rbx,%r13)
movq 0x8(%rsp), %rax
movq %r14, (%rsp)
movq %rbx, (%r14,%rax,8)
incq %rax
movq %rax, 0x8(%rsp)
jmp 0x12f008
leaq 0x1(%r15), %rbx
xorl %ecx, %ecx
movq %r15, %rbp
xorl %r14d, %r14d
xorl %r12d, %r12d
movzbl -0x1(%rbx), %eax
cmpl $0x2c, %eax
je 0x12f284
testl %eax, %eax
jne 0x12f303
movq %r12, 0x8(%rsp)
cmpl %ecx, %r12d
jne 0x12f2b8
leal (%rcx,%rcx), %r12d
testl %ecx, %ecx
movl $0x10, %eax
cmovel %eax, %r12d
movslq %r12d, %rsi
shlq $0x3, %rsi
movq %r14, %rdi
callq 0x2370
movq %rax, %r14
movl %r12d, %eax
movq %rax, (%rsp)
jmp 0x12f2bc
movq %rcx, (%rsp)
movq %rbp, %r12
subq %r15, %r12
leaq 0x1(%r12), %rdi
callq 0x2280
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x20d0
movq %r13, %rax
subq %r15, %rax
movb $0x0, (%rax,%rbp)
movq 0x8(%rsp), %r12
movslq %r12d, %rax
incl %r12d
movq %r13, (%r14,%rax,8)
cmpb $0x0, -0x1(%rbx)
movq %rbx, %r15
movq (%rsp), %rcx
je 0x12f33e
incq %rbx
incq %rbp
jmp 0x12f277
movq (%r12), %rdi
callq 0x2220
movq %r12, %rdi
callq 0x2220
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x2390
movq 0x8(%rsp), %r12
jmp 0x12f339
xorl %r14d, %r14d
xorl %r12d, %r12d
testq %rbx, %rbx
je 0x12f36d
testq %r14, %r14
je 0x12f354
movslq %r12d, %rsi
shlq $0x3, %rsi
movq %r14, %rdi
callq 0x2370
jmp 0x12f356
xorl %eax, %eax
movq 0x20(%rsp), %rcx
movl %r12d, (%rcx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x12f35e