// File: /workspace/github_c_makefile_star2_O1/ieyasu[P]funit/parse_test_file.c
// Function: parse_end_sequence
static int parse_end_sequence(struct ParseState *ps, const char *kind,
                              const char *name, size_t namelen)
{
    char message[32] = "end ";
    char *tok;
    size_t len;

    strncpy(message + 4, kind, sizeof(message) - 4);
    if (expect_token(ps, "end", message))
        return -1;
    // expect kind
    tok = next_token(ps, &len);
    assert(tok != NULL);
    if (tok == END_OF_LINE) {
        syntax_error(ps);
        return -1;
    }
    if (!same_token(kind, strlen(kind), tok, len)) {
        parse_vfail(ps, ps->read_pos, "expected \"end %s\"", kind);
        return -1;
    }
    // check end name if given and present
    if (name) {
        tok = next_name(ps, &len);
        assert(tok != NULL);
        if (tok != END_OF_LINE && !same_token(name, namelen, tok, len)) {
            parse_vfail(ps, ps->read_pos, "mismatched %s name", kind);
            return -1;
        }
    }
    return expect_eol(ps);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movaps 0x2dc1(%rip), %xmm0     # 0x9370
leaq 0x14(%rsp), %rdi
movaps %xmm0, 0xc(%rdi)
movaps 0x2da1(%rip), %xmm0     # 0x9360
movaps %xmm0, -0x4(%rdi)
movl $0x1c, %edx
callq 0x2070
leaq -0x88c(%rip), %rdx      # 0x5d48
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x5338
cmpq $0x1, %rax
je 0x6616
testq %rax, %rax
je 0x670a
cmpq $0x1, %rax
je 0x6616
cmpq $0x3, 0x8(%rsp)
jne 0x6616
leaq 0x26a2(%rip), %rdi      # 0x8ca7
movl $0x3, %edx
movq %rax, %rsi
callq 0x21d0
testl %eax, %eax
je 0x6643
movq 0x38(%rbx), %rsi
leaq 0x2d2e(%rip), %rdx      # 0x934f
leaq 0x10(%rsp), %rcx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x5120
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq -0x902(%rip), %rdx      # 0x5d48
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x5338
cmpq $0x1, %rax
je 0x66a3
movq %rax, %r13
testq %rax, %rax
je 0x6729
movq %r14, %rdi
callq 0x20d0
cmpq $0x1, %r13
je 0x6690
cmpq 0x8(%rsp), %rax
jne 0x6690
movq %r14, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x21d0
testl %eax, %eax
je 0x66ad
movq 0x38(%rbx), %rsi
leaq 0x2c4d(%rip), %rdx      # 0x92e8
movq %rbx, %rdi
movq %r14, %rcx
jmp 0x6629
movq %rbx, %rdi
callq 0x51ce
jmp 0x6630
testq %r12, %r12
je 0x66fd
leaq 0xae(%rip), %rdx        # 0x6767
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x5338
cmpq $0x1, %rax
je 0x66fd
testq %rax, %rax
je 0x6748
cmpq $0x1, %rax
je 0x66f0
cmpq %r15, 0x8(%rsp)
jne 0x66f0
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x21d0
testl %eax, %eax
je 0x66fd
movq 0x38(%rbx), %rsi
leaq 0x2bff(%rip), %rdx      # 0x92fa
jmp 0x669b
movq %rbx, %rdi
callq 0x5dbf
jmp 0x6635
leaq 0x2830(%rip), %rdi      # 0x8f41
leaq 0x26db(%rip), %rsi      # 0x8df3
leaq 0x2bee(%rip), %rcx      # 0x930d
movl $0x246, %edx            # imm = 0x246
callq 0x2120
leaq 0x2811(%rip), %rdi      # 0x8f41
leaq 0x26bc(%rip), %rsi      # 0x8df3
leaq 0x2b5a(%rip), %rcx      # 0x9298
movl $0x265, %edx            # imm = 0x265
callq 0x2120
leaq 0x27f2(%rip), %rdi      # 0x8f41
leaq 0x269d(%rip), %rsi      # 0x8df3
leaq 0x2b3b(%rip), %rcx      # 0x9298
movl $0x271, %edx            # imm = 0x271
callq 0x2120