// File: /workspace/github_c_makefile_star2_O3/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 $0x28, %rsp
movq %rdi, %r15
movl $0x1, %edi
movl $0x68, %esi
callq 0x2170
movq %rax, %rbx
leaq 0x18(%rax), %r14
movq %r15, %rdi
callq 0x6933
movq %rax, (%rbx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x529e
testl %eax, %eax
je 0x5514
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
jmp 0x5acc
movq %r14, %rdi
callq 0x50f2
testq %rax, %rax
je 0x5a3b
leaq 0x6ca(%rip), %r12       # 0x5bf6
leaq 0x10(%rsp), %r15
leaq 0x3904(%rip), %rbp      # 0x8e3c
leaq 0x20(%rsp), %r13
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x5258
cmpq $0x1, %rax
je 0x59d8
cmpq $0x3, 0x10(%rsp)
jne 0x59d8
movl $0x3, %edx
movq %rbp, %rdi
movq %rax, %rsi
callq 0x21d0
testl %eax, %eax
jne 0x5a8c
movl $0x1, %edi
movl $0x68, %esi
callq 0x2170
movq %rax, %r15
movq 0x58(%rbx), %rax
testq %rax, %rax
je 0x5b48
cmpq 0x50(%rbx), %rax
jbe 0x5b67
movq %r15, %rsi
addq $0x58, %rsi
movq %r14, %rdi
movq %rbp, %rdx
callq 0x5c29
movq %rax, 0x50(%r15)
testq %rax, %rax
je 0x5abc
movq %r14, %rdi
callq 0x5c6d
testl %eax, %eax
jne 0x5abc
movq $0x0, 0x60(%r15)
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x5258
cmpq $0x1, %rax
je 0x5669
movq %rax, %rbp
testq %rax, %rax
je 0x5a45
movq 0x20(%rsp), %rax
cmpq $0x1, %rbp
sete %cl
cmpq $0x3, %rax
setne %dl
orb %cl, %dl
jne 0x567f
movl $0x3, %edx
leaq 0x377f(%rip), %rdi      # 0x8d9b
movq %rbp, %rsi
callq 0x21d0
testl %eax, %eax
je 0x5752
movl $0x3, %edx
leaq 0x3767(%rip), %rdi      # 0x8d9f
movq %rbp, %rsi
callq 0x21d0
testl %eax, %eax
je 0x5849
movl $0x3, %edx
leaq 0x3563(%rip), %rdi      # 0x8bb7
movq %rbp, %rsi
callq 0x21d0
testl %eax, %eax
jne 0x58e7
jmp 0x59f8
movq %r14, %rdi
callq 0x50f2
testq %rax, %rax
jne 0x55d9
jmp 0x5a5a
cmpq $0x1, %rbp
sete %cl
cmpq $0x9, %rax
setne %dl
orb %cl, %dl
jne 0x56fd
movl $0x9, %edx
leaq 0x3706(%rip), %rdi      # 0x8da3
movq %rbp, %rsi
callq 0x21d0
testl %eax, %eax
jne 0x58e7
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x5258
movq 0x50(%rbx), %rsi
cmpq $0x1, %rax
jbe 0x5ade
movq %rsi, %rdi
leaq 0x18(%rsp), %rsi
callq 0x20a0
movsd %xmm0, 0x60(%r15)
movq 0x18(%rsp), %rax
movq 0x50(%rbx), %rsi
cmpq %rsi, %rax
je 0x5a7c
cmpq 0x58(%rbx), %rax
je 0x55d9
jmp 0x5a7c
cmpq $0x1, %rbp
sete %cl
cmpq $0x5, %rax
setne %dl
orb %cl, %dl
jne 0x57eb
movl $0x5, %edx
leaq 0x2a1a(%rip), %rdi      # 0x8139
movq %rbp, %rsi
callq 0x21d0
testl %eax, %eax
jne 0x58e7
cmpq $0x0, 0x18(%r15)
jne 0x5aea
movq %r14, %rdi
leaq 0x29f5(%rip), %rsi      # 0x8139
callq 0x5cea
movq %rax, 0x18(%r15)
jmp 0x583b
movl $0x1, %edi
movl $0x18, %esi
callq 0x2170
movq %rax, %rbp
leaq 0x10(%rax), %rsi
movq %r14, %rdi
leaq 0xdef(%rip), %rdx       # 0x6561
callq 0x5258
cmpq $0x1, %rax
je 0x5a64
testq %rax, %rax
je 0x5b29
cmpb $0x22, (%rax)
jne 0x5a64
movq 0x58(%rbx), %rsi
cmpq %rax, %rsi
je 0x5a73
cmpb $0x22, -0x1(%rsi)
jne 0x5a73
movq 0x50(%rbx), %rax
incq %rax
movq %rax, 0x50(%rbx)
movq %rax, %rcx
notq %rcx
addq %rsi, %rcx
movq %rcx, 0x10(%rbp)
movq %rax, 0x8(%rbp)
movq %r14, %rdi
callq 0x5c6d
testl %eax, %eax
jne 0x5ab4
movq 0x8(%r15), %rax
movq %rax, (%rbp)
movq %rbp, 0x8(%r15)
incq 0x38(%r15)
jmp 0x55d9
cmpq $0x1, %rbp
sete %cl
cmpq $0x8, %rax
setne %dl
orb %cl, %dl
jne 0x58bd
movl $0x8, %edx
leaq 0x2932(%rip), %rdi      # 0x813f
movq %rbp, %rsi
callq 0x21d0
testl %eax, %eax
jne 0x58e7
cmpq $0x0, 0x20(%r15)
jne 0x5afa
movq %r14, %rdi
leaq 0x290d(%rip), %rsi      # 0x813f
callq 0x5cea
movq %rax, 0x20(%r15)
testq %rax, %rax
jne 0x55d9
jmp 0x5abc
movl $0x1, %edi
movl $0x28, %esi
callq 0x2170
movq %rax, %rbp
leaq 0x18(%rax), %rsi
movq %r14, %rdi
movq %r12, %rdx
callq 0x5258
movq %rax, 0x8(%rbp)
cmpq $0x1, %rax
je 0x5aa1
movq 0x48(%rbx), %rax
movq 0x58(%rbx), %rcx
cmpq %rax, %rcx
jae 0x5898
movq %rcx, 0x50(%rbx)
movq %rax, 0x58(%rbx)
movq %rcx, 0x10(%rbp)
subq %rcx, %rax
movq %rax, 0x20(%rbp)
movq %r14, %rdi
callq 0x5c6d
testl %eax, %eax
jne 0x5ab4
movq 0x10(%r15), %rax
movq %rax, (%rbp)
movq %rbp, 0x10(%r15)
incq 0x40(%r15)
jmp 0x55d9
cmpq $0x1, %rbp
sete %cl
cmpq $0x4, %rax
setne %al
orb %cl, %al
jne 0x58e7
movl $0x4, %edx
leaq 0x354f(%rip), %rdi      # 0x8e2a
movq %rbp, %rsi
callq 0x21d0
testl %eax, %eax
je 0x590d
movq 0x40(%rbx), %rax
movq %rax, 0x50(%rbx)
movq %rax, 0x58(%rbx)
movq %r14, %rdi
xorl %esi, %esi
callq 0x5d4a
movq 0x30(%r15), %rcx
movq %rcx, (%rax)
movq %rax, 0x30(%r15)
jmp 0x55d9
movl $0x1, %edi
movl $0x28, %esi
callq 0x2170
movq %rax, 0x8(%rsp)
leaq 0x10(%rax), %rbp
movq %r14, %rdi
movq %rbp, %rsi
leaq 0x34f8(%rip), %rdx      # 0x8e2a
callq 0x5c29
movq 0x8(%rsp), %rdi
movq %rax, 0x8(%rdi)
testq %rax, %rax
je 0x5b22
movq (%rbp), %rdx
movq %rax, %rdi
movl $0x22, %esi
callq 0x2160
testq %rax, %rax
jne 0x5b0a
movq %r14, %rdi
callq 0x5c6d
testl %eax, %eax
movq 0x8(%rsp), %rdi
jne 0x5b22
movq %rdi, %rsi
addq $0x18, %rsi
movl $0x0, 0x18(%rdi)
movq %r14, %rdi
callq 0x5d4a
movq 0x8(%rsp), %rdi
movq %rax, 0x20(%rdi)
testq %rax, %rax
je 0x5b22
movq 0x8(%rdi), %rdx
movq 0x10(%rdi), %rcx
movq %r14, %rdi
leaq 0x3478(%rip), %rsi      # 0x8e2a
callq 0x6361
movq 0x8(%rsp), %rdi
testl %eax, %eax
jne 0x5b22
movq 0x28(%r15), %rax
movq %rax, (%rdi)
movq %rdi, 0x28(%r15)
incq 0x48(%r15)
jmp 0x55d9
cmpq $0x1, %rax
jne 0x5a8c
movq %r14, %rdi
callq 0x50f2
testq %rax, %rax
jne 0x553d
jmp 0x5a85
movq 0x50(%rbx), %rax
movq %rax, 0x58(%rbx)
movq 0x50(%r15), %rdx
movq 0x58(%r15), %rcx
movq %r14, %rdi
leaq 0x342a(%rip), %rsi      # 0x8e3c
callq 0x6361
testl %eax, %eax
jne 0x5abc
movq 0x10(%rbx), %rax
movq %rax, (%r15)
movq %r15, 0x10(%rbx)
leaq 0x10(%rsp), %r15
leaq 0x3406(%rip), %rbp      # 0x8e3c
jmp 0x553d
movq %r14, %rdi
callq 0x50e2
jmp 0x5ac4
movq 0x50(%rbx), %rsi
leaq 0x33df(%rip), %rdx      # 0x8e2f
movq %r14, %rdi
callq 0x4f08
jmp 0x5abc
movq %r14, %rdi
callq 0x50e2
jmp 0x5abc
leaq 0x3461(%rip), %rdx      # 0x8ecc
movq %r14, %rdi
movq %rax, %rsi
jmp 0x5aaf
leaq 0x3479(%rip), %rdx      # 0x8ef3
jmp 0x5aac
leaq 0x3343(%rip), %rdx      # 0x8dc6
jmp 0x5a50
cmpq $0x0, 0x10(%rbx)
jne 0x5acc
movq 0x50(%rbx), %rsi
leaq 0x32a5(%rip), %rdx      # 0x8d3c
movq %r14, %rdi
callq 0x4f08
jmp 0x5ac4
movq 0x50(%rbx), %rsi
leaq 0x346d(%rip), %rdx      # 0x8f19
movq %r14, %rdi
callq 0x4f08
movq %rbp, %rdi
callq 0x2040
movq %r15, %rdi
callq 0x5464
movq %rbx, %rdi
callq 0x5414
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x32c8(%rip), %rdx      # 0x8dad
jmp 0x5a50
movq 0x58(%rbx), %rsi
leaq 0x32ec(%rip), %rdx      # 0x8de1
jmp 0x5a50
movq 0x58(%rbx), %rsi
leaq 0x32ff(%rip), %rdx      # 0x8e04
jmp 0x5a50
movq 0x50(%rbx), %rsi
leaq 0x341b(%rip), %rdx      # 0x8f30
movq %r14, %rdi
callq 0x4f08
movq 0x8(%rsp), %rdi
callq 0x5bce
jmp 0x5abc
leaq 0x2f84(%rip), %rdi      # 0x8ab4
leaq 0x31cc(%rip), %rsi      # 0x8d03
leaq 0x3356(%rip), %rcx      # 0x8e94
movl $0xa8, %edx
callq 0x2120
leaq 0x306c(%rip), %rdi      # 0x8bbb
leaq 0x31ad(%rip), %rsi      # 0x8d03
leaq 0x31f3(%rip), %rcx      # 0x8d50
movl $0x2dc, %edx            # imm = 0x2DC
callq 0x2120
leaq 0x3211(%rip), %rdi      # 0x8d7f
leaq 0x318e(%rip), %rsi      # 0x8d03
leaq 0x31d4(%rip), %rcx      # 0x8d50
movl $0x2dd, %edx            # imm = 0x2DD
callq 0x2120