// File: 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
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x40, %eax
je 0x1b583b
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
je 0x1b579f
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x1b5823
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jne 0x1b57dc
cmpl $0x0, -0x20(%rbp)
je 0x1b57b7
movl -0x20(%rbp), %eax
shll %eax
movl %eax, -0x74(%rbp)
jmp 0x1b57c1
movl $0x10, %eax
movl %eax, -0x74(%rbp)
jmp 0x1b57c1
movl -0x74(%rbp), %eax
movl %eax, -0x20(%rbp)
movq -0x28(%rbp), %rdi
movslq -0x20(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rax
subq %rax, %rsi
callq 0x1b56e0
movq %rax, %rdx
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x1b5817
jmp 0x1b5836
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x1b5825
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x1b5783
jmp 0x1b596a
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x2100
movq -0x10(%rbp), %rdi
addq $0x1, %rdi
leaq 0x1dab7c(%rip), %rsi    # 0x3903d6
callq 0x22c0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x1b5877
movq $0x0, -0x8(%rbp)
jmp 0x1b5997
movq -0x40(%rbp), %rdi
callq 0x1b59b0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
movl $0x2, %esi
leaq -0x60(%rbp), %rdx
leaq -0x64(%rbp), %rcx
callq 0x1b5a00
cmpl $0x0, %eax
jl 0x1b5958
movq -0x50(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rcx
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, -0x75(%rbp)
je 0x1b58d0
movq -0x70(%rbp), %rax
movsbl (%rax), %edi
callq 0x2030
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x75(%rbp)
movb -0x75(%rbp), %al
testb $0x1, %al
jne 0x1b58d9
jmp 0x1b58e9
jmp 0x1b58db
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x1b58ab
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jne 0x1b5926
cmpl $0x0, -0x20(%rbp)
je 0x1b5901
movl -0x20(%rbp), %eax
shll %eax
movl %eax, -0x7c(%rbp)
jmp 0x1b590b
movl $0x10, %eax
movl %eax, -0x7c(%rbp)
jmp 0x1b590b
movl -0x7c(%rbp), %eax
movl %eax, -0x20(%rbp)
movq -0x28(%rbp), %rdi
movslq -0x20(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, -0x28(%rbp)
movq -0x50(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x50(%rbp), %rax
subq %rax, %rsi
callq 0x1b56e0
movq %rax, %rdx
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x1b5884
movq -0x48(%rbp), %rdi
callq 0x1b5a40
movq -0x40(%rbp), %rdi
callq 0x2380
cmpq $0x0, -0x28(%rbp)
je 0x1b5986
movq -0x28(%rbp), %rdi
movslq -0x1c(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, -0x28(%rbp)
movl -0x1c(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)