// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/test/test-regidx.c
// Function: custom_parse
int custom_parse(const char *line, char **chr_beg, char **chr_end, hts_pos_t *beg, hts_pos_t *end, void *payload, void *usr)
{
    // Use the standard parser for CHROM,FROM,TO
    int i, ret = regidx_parse_tab(line,chr_beg,chr_end,beg,end,NULL,NULL);
    if ( ret!=0 ) return ret;

    // Skip the fields that were parsed above
    char *ss = (char*) line;
    while ( *ss && isspace_c(*ss) ) ss++;
    for (i=0; i<3; i++)
    {
        while ( *ss && !isspace_c(*ss) ) ss++;
        if ( !*ss ) return -2;  // wrong number of fields
        while ( *ss && isspace_c(*ss) ) ss++;
    }
    if ( !*ss ) return -2;

    // Parse the payload
    char *se = ss;
    while ( *se && !isspace_c(*se) ) se++;
    char **dat = (char**) payload;
    *dat = (char*) malloc(se-ss+1);
    memcpy(*dat,ss,se-ss+1);
    (*dat)[se-ss] = 0;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
xorl %eax, %eax
movl %eax, %r9d
movq $0x0, (%rsp)
callq 0x9f00
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
je 0x5b1e
movl -0x40(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x5cd7
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x59(%rbp)
je 0x5b4c
movq -0x48(%rbp), %rax
movsbl (%rax), %edi
callq 0x5ce0
cmpl $0x0, %eax
setne %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
testb $0x1, %al
jne 0x5b55
jmp 0x5b63
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x5b26
movl $0x0, -0x3c(%rbp)
cmpl $0x3, -0x3c(%rbp)
jge 0x5c19
jmp 0x5b76
movq -0x48(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x5a(%rbp)
je 0x5b9e
movq -0x48(%rbp), %rax
movsbl (%rax), %edi
callq 0x5ce0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x5a(%rbp)
movb -0x5a(%rbp), %al
testb $0x1, %al
jne 0x5ba7
jmp 0x5bb5
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x5b76
movq -0x48(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x5bca
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x5cd7
jmp 0x5bcc
movq -0x48(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x5b(%rbp)
je 0x5bf2
movq -0x48(%rbp), %rax
movsbl (%rax), %edi
callq 0x5ce0
cmpl $0x0, %eax
setne %al
movb %al, -0x5b(%rbp)
movb -0x5b(%rbp), %al
testb $0x1, %al
jne 0x5bfb
jmp 0x5c09
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x5bcc
jmp 0x5c0b
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x5b6a
movq -0x48(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x5c2e
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x5cd7
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x5c(%rbp)
je 0x5c5e
movq -0x50(%rbp), %rax
movsbl (%rax), %edi
callq 0x5ce0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x5c(%rbp)
movb -0x5c(%rbp), %al
testb $0x1, %al
jne 0x5c67
jmp 0x5c75
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x5c36
movq -0x38(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rax
subq %rax, %rdi
addq $0x1, %rdi
callq 0x4660
movq %rax, %rcx
movq -0x58(%rbp), %rax
movq %rcx, (%rax)
movq -0x58(%rbp), %rax
movq (%rax), %rdi
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x48(%rbp), %rax
subq %rax, %rdx
addq $0x1, %rdx
callq 0x43b0
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %rdx
subq %rdx, %rcx
movb $0x0, (%rax,%rcx)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq