// File: /workspace/github_c_makefile_star2_O1/ieyasu[P]funit/parse_test_file.c
// Function: parse_test_file
struct TestFile *parse_test_file(const char *path)
{
    struct TestFile *tf = NEW0(struct TestFile);
    struct ParseState *ps = &tf->ps;
    tf->path = fu_strdup(path);

    if (open_file_for_parsing(path, ps) != 0) {
        free(tf);
        return NULL;
    }

    if (!next_line(ps)) {
        syntax_error(ps);
        goto close_it;
    }

    for (;;) {
        size_t toklen;
        char *token = next_token(ps, &toklen);
        if (same_token("set", 3, token, toklen)) {
            struct TestSet *set = parse_set(ps);
            if (!set) // parse failure already reported
                goto close_it;
            set->next = tf->sets;
            tf->sets = set;
        } else if (token == END_OF_LINE) {
            if (!next_line(ps)) { // EOF
                if (!tf->sets) {
                    goto no_sets;
                }
                goto done;
            }
            // else swallow blank line
        } else {
no_sets:
            parse_fail(ps, ps->read_pos, "expected a test set");
            goto close_it;
        }
    }

 close_it:
    close_testfile(tf);
 done:
    return tf;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r15
movl $0x1, %edi
movl $0x68, %esi
callq 0x2170
movq %rax, %rbx
leaq 0x18(%rax), %r14
movq %r15, %rdi
callq 0x6bdf
movq %rax, (%rbx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x537e
testl %eax, %eax
je 0x55f4
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
jmp 0x5c69
movq %r14, %rdi
callq 0x51de
testq %rax, %rax
je 0x5c59
leaq 0x73c(%rip), %r15       # 0x5d48
movq %rsp, %rbp
leaq 0x3816(%rip), %r13      # 0x8e2c
movq %r14, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x5338
movq %rax, %r12
cmpq $0x1, %rax
je 0x564c
cmpq $0x3, (%rsp)
jne 0x564c
movl $0x3, %edx
leaq 0x38ec(%rip), %rdi      # 0x8f2c
movq %r12, %rsi
callq 0x21d0
testl %eax, %eax
je 0x568e
cmpq $0x1, %r12
je 0x566b
movq 0x50(%rbx), %rsi
movq %r14, %rdi
movq %r13, %rdx
callq 0x5000
movl $0x2, %eax
jmp 0x5bd9
movq %r14, %rdi
callq 0x51de
testq %rax, %rax
jne 0x5bd7
movl $0x6, %eax
cmpq $0x0, 0x10(%rbx)
jne 0x5bd9
jmp 0x5652
movl $0x1, %edi
movl $0x68, %esi
callq 0x2170
movq %rax, %r13
movq 0x58(%rbx), %rax
testq %rax, %rax
je 0x5c9a
cmpq 0x50(%rbx), %rax
jbe 0x5c7b
movq %r13, %rsi
addq $0x58, %rsi
movq %r14, %rdi
leaq 0x3864(%rip), %rdx      # 0x8f2c
callq 0x5d7b
movq %rax, 0x50(%r13)
testq %rax, %rax
je 0x5ba3
movq %r14, %rdi
callq 0x5dbf
testl %eax, %eax
jne 0x5ba3
movq $0x0, 0x60(%r13)
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
movq %r15, %rdx
callq 0x5338
cmpq $0x1, %rax
je 0x5873
movq %rax, %rbp
testq %rax, %rax
je 0x5b86
movq 0x8(%rsp), %r15
cmpq $0x1, %rbp
setne %al
cmpq $0x3, %r15
sete %r12b
andb %al, %r12b
cmpb $0x1, %r12b
jne 0x576d
movl $0x3, %edx
leaq 0x374a(%rip), %rdi      # 0x8e8b
movq %rbp, %rsi
callq 0x21d0
testl %eax, %eax
je 0x5889
movl $0x3, %edx
leaq 0x3732(%rip), %rdi      # 0x8e8f
movq %rbp, %rsi
callq 0x21d0
testl %eax, %eax
je 0x59ab
cmpq $0x1, %rbp
sete %al
cmpq $0x9, %r15
setne %cl
orb %al, %cl
jne 0x579b
movl $0x9, %edx
leaq 0x3708(%rip), %rdi      # 0x8e93
movq %rbp, %rsi
callq 0x21d0
testl %eax, %eax
je 0x594e
cmpq $0x1, %rbp
sete %al
cmpq $0x5, %r15
setne %cl
orb %al, %cl
jne 0x57c9
movl $0x5, %edx
leaq 0x2a70(%rip), %rdi      # 0x8229
movq %rbp, %rsi
callq 0x21d0
testl %eax, %eax
je 0x5a16
cmpq $0x1, %rbp
sete %al
cmpq $0x8, %r15
setne %cl
orb %al, %cl
jne 0x57f7
movl $0x8, %edx
leaq 0x2a48(%rip), %rdi      # 0x822f
movq %rbp, %rsi
callq 0x21d0
testl %eax, %eax
je 0x5a36
cmpq $0x1, %rbp
sete %al
cmpq $0x4, %r15
setne %cl
orb %al, %cl
jne 0x5825
movl $0x4, %edx
leaq 0x3705(%rip), %rdi      # 0x8f1a
movq %rbp, %rsi
callq 0x21d0
testl %eax, %eax
je 0x5a69
testb %r12b, %r12b
leaq 0x519(%rip), %r15       # 0x5d48
je 0x584d
movl $0x3, %edx
leaq 0x346a(%rip), %rdi      # 0x8ca7
movq %rbp, %rsi
callq 0x21d0
testl %eax, %eax
je 0x5bef
movq 0x40(%rbx), %rax
movq %rax, 0x50(%rbx)
movq %rax, 0x58(%rbx)
movq %r14, %rdi
xorl %esi, %esi
callq 0x5e9e
movq 0x30(%r13), %rcx
movq %rcx, (%rax)
movq %rax, 0x30(%r13)
jmp 0x56f2
movq %r14, %rdi
callq 0x51de
testq %rax, %rax
jne 0x56f2
jmp 0x5b9b
movl $0x1, %edi
movl $0x18, %esi
callq 0x2170
movq %rax, %rbp
leaq 0x10(%rax), %r12
movq %r14, %rdi
movq %r12, %rsi
leaq 0xeee(%rip), %rdx       # 0x679a
callq 0x5338
cmpq $0x1, %rax
leaq 0x48c(%rip), %r15       # 0x5d48
je 0x58fd
testq %rax, %rax
je 0x5cb9
cmpb $0x22, (%rax)
jne 0x58fd
movq 0x58(%rbx), %rsi
cmpq %rax, %rsi
je 0x5b0b
cmpb $0x22, -0x1(%rsi)
jne 0x5b0b
movq 0x50(%rbx), %rax
incq %rax
movq %rax, 0x50(%rbx)
movq %rax, %rcx
notq %rcx
addq %rsi, %rcx
movq %rcx, (%r12)
jmp 0x5911
movq %r14, %rdi
movq %rax, %rsi
leaq 0x36b2(%rip), %rdx      # 0x8fbc
callq 0x5000
xorl %eax, %eax
movq %rax, 0x8(%rbp)
testq %rax, %rax
je 0x5926
movq %r14, %rdi
callq 0x5dbf
testl %eax, %eax
je 0x5930
movq %rbp, %rdi
callq 0x2040
xorl %ebp, %ebp
testq %rbp, %rbp
je 0x5ba3
movq 0x8(%r13), %rax
movq %rax, (%rbp)
movq %rbp, 0x8(%r13)
incq 0x38(%r13)
jmp 0x56f2
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
leaq 0x3eb(%rip), %r15       # 0x5d48
movq %r15, %rdx
callq 0x5338
movq 0x50(%rbx), %rsi
cmpq $0x1, %rax
jbe 0x5c14
movq %rsi, %rdi
leaq 0x10(%rsp), %rsi
callq 0x20a0
movsd %xmm0, 0x60(%r13)
movq 0x10(%rsp), %rax
movq 0x50(%rbx), %rsi
cmpq %rsi, %rax
je 0x5be3
cmpq 0x58(%rbx), %rax
jne 0x5be3
movq %rax, 0x58(%rbx)
jmp 0x56f2
movl $0x1, %edi
movl $0x28, %esi
callq 0x2170
movq %rax, %rbp
leaq 0x18(%rax), %rsi
movq %r14, %rdi
leaq 0x37d(%rip), %r15       # 0x5d48
movq %r15, %rdx
callq 0x5338
movq %rax, 0x8(%rbp)
cmpq $0x1, %rax
je 0x5ad0
movq 0x48(%rbx), %rax
movq 0x58(%rbx), %rcx
cmpq %rax, %rcx
jae 0x5a01
movq %rcx, 0x50(%rbx)
movq %rax, 0x58(%rbx)
movq %rcx, 0x10(%rbp)
subq %rcx, %rax
movq %rax, 0x20(%rbp)
movq %r14, %rdi
callq 0x5dbf
testl %eax, %eax
jne 0x5ae3
jmp 0x5aed
cmpq $0x0, 0x18(%r13)
jne 0x5c23
movq %r14, %rdi
leaq 0x27fe(%rip), %rsi      # 0x8229
callq 0x5e3c
movq %rax, 0x18(%r13)
jmp 0x5a54
cmpq $0x0, 0x20(%r13)
jne 0x5c33
movq %r14, %rdi
leaq 0x27e4(%rip), %rsi      # 0x822f
callq 0x5e3c
movq %rax, 0x20(%r13)
testq %rax, %rax
leaq 0x2ea(%rip), %r15       # 0x5d48
jne 0x56f2
jmp 0x5ba3
movl $0x1, %edi
movl $0x28, %esi
callq 0x2170
movq %rax, %rbp
leaq 0x10(%rax), %r12
movq %r14, %rdi
movq %r12, %rsi
leaq 0x348e(%rip), %rdx      # 0x8f1a
callq 0x5d7b
movq %rax, 0x8(%rbp)
testq %rax, %rax
leaq 0x2a9(%rip), %r15       # 0x5d48
je 0x5b26
movq (%r12), %rdx
movq %rax, %rdi
movl $0x22, %esi
callq 0x2160
testq %rax, %rax
je 0x5b1a
movq 0x50(%rbx), %rsi
movq %r14, %rdi
leaq 0x3557(%rip), %rdx      # 0x9020
callq 0x5000
jmp 0x5b26
movq 0x50(%rbx), %rsi
movq %r14, %rdi
leaq 0x352b(%rip), %rdx      # 0x9009
callq 0x5000
movq %rbp, %rdi
callq 0x2040
xorl %ebp, %ebp
testq %rbp, %rbp
je 0x5ba3
movq 0x10(%r13), %rax
movq %rax, (%rbp)
movq %rbp, 0x10(%r13)
incq 0x40(%r13)
jmp 0x56f2
movq %r14, %rdi
leaq 0x34ce(%rip), %rdx      # 0x8fe3
jmp 0x590a
movq %r14, %rdi
callq 0x5dbf
testl %eax, %eax
je 0x5b4a
movq %rbp, %rdi
callq 0x5d20
xorl %ebp, %ebp
testq %rbp, %rbp
je 0x5ba3
movq 0x28(%r13), %rax
movq %rax, (%rbp)
movq %rbp, 0x28(%r13)
incq 0x48(%r13)
jmp 0x56f2
movq %rbp, %rsi
addq $0x18, %rsi
movl $0x0, 0x18(%rbp)
movq %r14, %rdi
callq 0x5e9e
movq %rax, 0x20(%rbp)
testq %rax, %rax
je 0x5b26
movq 0x8(%rbp), %rdx
movq 0x10(%rbp), %rcx
movq %r14, %rdi
leaq 0x339f(%rip), %rsi      # 0x8f1a
callq 0x658f
testl %eax, %eax
jne 0x5b26
jmp 0x5b30
movq 0x50(%rbx), %rsi
movq %r14, %rdi
leaq 0x338b(%rip), %rdx      # 0x8f1f
callq 0x5000
jmp 0x5ba3
movq %r14, %rdi
callq 0x51ce
movq %r13, %rdi
callq 0x5544
xorl %r13d, %r13d
testq %r13, %r13
movq %rsp, %rbp
je 0x5bc6
movq 0x10(%rbx), %rax
movq %rax, (%r13)
movq %r13, 0x10(%rbx)
xorl %eax, %eax
jmp 0x5bcb
movl $0x2, %eax
testq %r13, %r13
leaq 0x3257(%rip), %r13      # 0x8e2c
je 0x5bd9
xorl %eax, %eax
testl %eax, %eax
je 0x5616
jmp 0x5c52
movq %r14, %rdi
leaq 0x32c9(%rip), %rdx      # 0x8eb6
jmp 0x5b94
movq 0x50(%rbx), %rax
movq %rax, 0x58(%rbx)
movq 0x50(%r13), %rdx
movq 0x58(%r13), %rcx
movq %r14, %rdi
leaq 0x3323(%rip), %rsi      # 0x8f2c
callq 0x658f
testl %eax, %eax
jne 0x5ba3
jmp 0x5bae
movq %r14, %rdi
leaq 0x327f(%rip), %rdx      # 0x8e9d
jmp 0x5b94
movq 0x58(%rbx), %rsi
movq %r14, %rdi
leaq 0x32a0(%rip), %rdx      # 0x8ed1
jmp 0x5c41
movq 0x58(%rbx), %rsi
movq %r14, %rdi
leaq 0x32b3(%rip), %rdx      # 0x8ef4
callq 0x5000
leaq 0xfb(%rip), %r15        # 0x5d48
jmp 0x5ba3
cmpl $0x2, %eax
je 0x5c61
jmp 0x5c69
movq %r14, %rdi
callq 0x51ce
movq %rbx, %rdi
callq 0x54f4
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x31ed(%rip), %rdi      # 0x8e6f
leaq 0x316a(%rip), %rsi      # 0x8df3
leaq 0x31b0(%rip), %rcx      # 0x8e40
movl $0x2dd, %edx            # imm = 0x2DD
callq 0x2120
leaq 0x300a(%rip), %rdi      # 0x8cab
leaq 0x314b(%rip), %rsi      # 0x8df3
leaq 0x3191(%rip), %rcx      # 0x8e40
movl $0x2dc, %edx            # imm = 0x2DC
callq 0x2120
leaq 0x2ee4(%rip), %rdi      # 0x8ba4
leaq 0x312c(%rip), %rsi      # 0x8df3
leaq 0x32b6(%rip), %rcx      # 0x8f84
movl $0xa8, %edx
callq 0x2120