// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rdi
pushq $0x68
popq %rsi
callq 0x2170
movq %rax, %rbx
leaq 0x18(%rax), %r14
movq %r15, %rdi
callq 0x63bb
movq %rax, (%rbx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x4de3
testl %eax, %eax
je 0x5102
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
jmp 0x55e2
movq %r14, %rdi
callq 0x4c69
testq %rax, %rax
je 0x5583
movq %rsp, %r12
leaq 0x3d1f(%rip), %rbp      # 0x8e3c
pushq $0x3
popq %r13
movq %r14, %rdi
movq %r12, %rsi
callq 0x56c9
movq %rax, %r15
movq (%rsp), %rcx
movq %rbp, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x56d5
testl %eax, %eax
je 0x5525
pushq $0x1
popq %rdi
pushq $0x68
popq %rsi
callq 0x2170
movq %rax, %r15
movq 0x58(%rbx), %rax
testq %rax, %rax
je 0x56aa
cmpq 0x50(%rbx), %rax
leaq 0x3ccd(%rip), %rdx      # 0x8e3c
jbe 0x568b
movq %r15, %rsi
addq $0x58, %rsi
movq %r14, %rdi
callq 0x57a7
movq %rax, 0x50(%r15)
testq %rax, %rax
je 0x55d2
movq %r14, %rdi
callq 0x57e4
testl %eax, %eax
jne 0x55d2
andq $0x0, 0x60(%r15)
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0x56c9
cmpq $0x1, %rax
je 0x5282
movq %rax, %r12
testq %rax, %rax
je 0x55b5
movq 0x8(%rsp), %rbp
leaq 0x3bc6(%rip), %rdi      # 0x8d9b
movq %r13, %rsi
movq %r12, %rdx
movq %rbp, %rcx
callq 0x56d5
testl %eax, %eax
je 0x5298
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x2170
movq %rax, %r12
leaq 0x10(%rax), %rsi
movq %r14, %rdi
leaq 0xdef(%rip), %rdx       # 0x5ff6
callq 0x4d9f
cmpq $0x1, %rax
je 0x558d
testq %rax, %rax
je 0x566c
cmpb $0x22, (%rax)
jne 0x558d
movq 0x58(%rbx), %rsi
cmpq %rax, %rsi
je 0x559c
cmpb $0x22, -0x1(%rsi)
jne 0x559c
movq 0x50(%rbx), %rax
incq %rax
movq %rax, 0x50(%rbx)
movq %rax, %rcx
notq %rcx
addq %rsi, %rcx
movq %rcx, 0x10(%r12)
movq %rax, 0x8(%r12)
movq %r14, %rdi
callq 0x57e4
testl %eax, %eax
jne 0x55ab
movq 0x8(%r15), %rax
movq %rax, (%r12)
movq %r12, 0x8(%r15)
incq 0x38(%r15)
jmp 0x51a6
movq %r14, %rdi
callq 0x4c69
testq %rax, %rax
jne 0x51a6
jmp 0x55ca
leaq 0x3b00(%rip), %rdi      # 0x8d9f
movq %r13, %rsi
movq %r12, %rdx
movq %rbp, %rcx
callq 0x56d5
testl %eax, %eax
je 0x5325
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x2170
movq %rax, %r12
leaq 0x18(%rax), %rsi
movq %r14, %rdi
callq 0x56c9
movq %rax, 0x8(%r12)
cmpq $0x1, %rax
je 0x55f4
movq 0x48(%rbx), %rax
movq 0x58(%rbx), %rcx
cmpq %rax, %rcx
jae 0x52fc
movq %rcx, 0x50(%rbx)
movq %rax, 0x58(%rbx)
movq %rcx, 0x10(%r12)
subq %rcx, %rax
movq %rax, 0x20(%r12)
movq %r14, %rdi
callq 0x57e4
testl %eax, %eax
pushq $0x3
popq %r13
jne 0x55ab
movq 0x10(%r15), %rax
movq %rax, (%r12)
movq %r12, 0x10(%r15)
incq 0x40(%r15)
jmp 0x51a6
leaq 0x3a77(%rip), %rdi      # 0x8da3
pushq $0x9
popq %rsi
movq %r12, %rdx
movq %rbp, %rcx
callq 0x56d5
testl %eax, %eax
je 0x5391
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0x56c9
movq 0x50(%rbx), %rsi
cmpq $0x1, %rax
pushq $0x3
popq %r13
jbe 0x5626
movq %rsi, %rdi
leaq 0x10(%rsp), %rsi
callq 0x20a0
movsd %xmm0, 0x60(%r15)
movq 0x10(%rsp), %rax
movq 0x50(%rbx), %rsi
cmpq %rsi, %rax
je 0x5601
cmpq 0x58(%rbx), %rax
je 0x51a6
jmp 0x5601
leaq 0x2da1(%rip), %rdi      # 0x8139
pushq $0x5
popq %rsi
movq %r12, %rdx
movq %rbp, %rcx
callq 0x56d5
testl %eax, %eax
je 0x53ca
cmpq $0x0, 0x18(%r15)
jne 0x562f
movq %r14, %rdi
leaq 0x2d7a(%rip), %rsi      # 0x8139
callq 0x5858
movq %rax, 0x18(%r15)
jmp 0x5401
leaq 0x2d6e(%rip), %rdi      # 0x813f
pushq $0x8
popq %rsi
movq %r12, %rdx
movq %rbp, %rcx
callq 0x56d5
testl %eax, %eax
je 0x5413
cmpq $0x0, 0x20(%r15)
jne 0x563c
movq %r14, %rdi
leaq 0x2d47(%rip), %rsi      # 0x813f
callq 0x5858
movq %rax, 0x20(%r15)
testq %rax, %rax
pushq $0x3
popq %r13
jne 0x51a6
jmp 0x55d2
leaq 0x3a10(%rip), %r13      # 0x8e2a
movq %r13, %rdi
pushq $0x4
popq %rsi
movq %r12, %rdx
movq %rbp, %rcx
callq 0x56d5
testl %eax, %eax
je 0x54e2
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x2170
movq %rax, %r12
leaq 0x10(%rax), %rbp
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x57a7
movq %rax, 0x8(%r12)
testq %rax, %rax
je 0x565f
movq (%rbp), %rdx
movq %rax, %rdi
pushq $0x22
popq %rsi
callq 0x2160
testq %rax, %rax
jne 0x564c
movq %r14, %rdi
callq 0x57e4
testl %eax, %eax
jne 0x565f
movq %r12, %rsi
addq $0x18, %rsi
andl $0x0, 0x18(%r12)
movq %r14, %rdi
callq 0x58b8
movq %rax, 0x20(%r12)
testq %rax, %rax
je 0x565f
movq 0x8(%r12), %rdx
movq 0x10(%r12), %rcx
movq %r14, %rdi
movq %r13, %rsi
callq 0x5e14
testl %eax, %eax
jne 0x565f
movq 0x28(%r15), %rax
movq %rax, (%r12)
movq %r12, 0x28(%r15)
incq 0x48(%r15)
pushq $0x3
popq %r13
jmp 0x51a6
leaq 0x36ce(%rip), %rdi      # 0x8bb7
pushq $0x3
popq %rsi
movq %r12, %rdx
movq %rbp, %rcx
callq 0x56d5
testl %eax, %eax
jne 0x554c
movq 0x40(%rbx), %rax
movq %rax, 0x50(%rbx)
movq %rax, 0x58(%rbx)
movq %r14, %rdi
xorl %esi, %esi
callq 0x58b8
movq 0x30(%r15), %rcx
movq %rcx, (%rax)
movq %rax, 0x30(%r15)
pushq $0x3
popq %r13
jmp 0x51a6
cmpq $0x1, %r15
jne 0x5611
movq %r14, %rdi
callq 0x4c69
testq %rax, %rax
je 0x560a
leaq 0x38f5(%rip), %rbp      # 0x8e3c
jmp 0x5121
movq 0x50(%rbx), %rax
movq %rax, 0x58(%rbx)
movq 0x50(%r15), %rdx
movq 0x58(%r15), %rcx
movq %r14, %rdi
leaq 0x38d6(%rip), %rsi      # 0x8e3c
callq 0x5e14
testl %eax, %eax
pushq $0x3
popq %r13
jne 0x55d2
movq 0x10(%rbx), %rax
movq %rax, (%r15)
movq %r15, 0x10(%rbx)
movq %rsp, %r12
jmp 0x5540
movq %r14, %rdi
callq 0x4c59
jmp 0x55da
leaq 0x3938(%rip), %rdx      # 0x8ecc
movq %r14, %rdi
movq %rax, %rsi
jmp 0x55a6
leaq 0x3950(%rip), %rdx      # 0x8ef3
movq %r14, %rdi
callq 0x4a70
movq %r12, %rdi
callq 0x2040
jmp 0x55d2
movq 0x50(%rbx), %rsi
leaq 0x386f(%rip), %rdx      # 0x8e2f
movq %r14, %rdi
callq 0x4a70
jmp 0x55d2
movq %r14, %rdi
callq 0x4c59
movq %r15, %rdi
callq 0x5056
movq %rbx, %rdi
callq 0x5008
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x50(%rbx), %rsi
leaq 0x391a(%rip), %rdx      # 0x8f19
jmp 0x55a3
leaq 0x37be(%rip), %rdx      # 0x8dc6
jmp 0x55c0
cmpq $0x0, 0x10(%rbx)
jne 0x55e2
movq 0x50(%rbx), %rsi
leaq 0x3720(%rip), %rdx      # 0x8d3c
movq %r14, %rdi
callq 0x4a70
jmp 0x55da
leaq 0x3780(%rip), %rdx      # 0x8dad
jmp 0x55c0
movq 0x58(%rbx), %rsi
leaq 0x37a7(%rip), %rdx      # 0x8de1
jmp 0x55c0
movq 0x58(%rbx), %rsi
leaq 0x37bd(%rip), %rdx      # 0x8e04
jmp 0x55c0
movq 0x50(%rbx), %rsi
leaq 0x38d9(%rip), %rdx      # 0x8f30
movq %r14, %rdi
callq 0x4a70
movq %r12, %rdi
callq 0x574f
jmp 0x55d2
leaq 0x3441(%rip), %rdi      # 0x8ab4
leaq 0x3689(%rip), %rsi      # 0x8d03
leaq 0x3813(%rip), %rcx      # 0x8e94
movl $0xa8, %edx
callq 0x2120
leaq 0x36ed(%rip), %rdi      # 0x8d7f
leaq 0x366a(%rip), %rsi      # 0x8d03
leaq 0x36b0(%rip), %rcx      # 0x8d50
movl $0x2dd, %edx            # imm = 0x2DD
callq 0x2120
leaq 0x350a(%rip), %rdi      # 0x8bbb
leaq 0x364b(%rip), %rsi      # 0x8d03
leaq 0x3691(%rip), %rcx      # 0x8d50
movl $0x2dc, %edx            # imm = 0x2DC
callq 0x2120