// File: /workspace/github_c_makefile_star2_O3/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 0x2e7f(%rip), %xmm0     # 0x9200
leaq 0x14(%rsp), %rdi
movaps %xmm0, -0x4(%rdi)
movl $0x1c, %edx
callq 0x2070
leaq -0x7a5(%rip), %rdx      # 0x5bf6
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x5258
cmpq $0x1, %rax
je 0x63dd
testq %rax, %rax
je 0x64d1
cmpq $0x1, %rax
je 0x63dd
cmpq $0x3, 0x8(%rsp)
jne 0x63dd
leaq 0x27eb(%rip), %rdi      # 0x8bb7
movl $0x3, %edx
movq %rax, %rsi
callq 0x21d0
testl %eax, %eax
je 0x640a
movq 0x38(%rbx), %rsi
leaq 0x2e07(%rip), %rdx      # 0x91ef
leaq 0x10(%rsp), %rcx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x5034
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq -0x81b(%rip), %rdx      # 0x5bf6
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x5258
cmpq $0x1, %rax
je 0x646a
movq %rax, %r13
testq %rax, %rax
je 0x64f0
movq %r14, %rdi
callq 0x20d0
cmpq $0x1, %r13
je 0x6457
cmpq 0x8(%rsp), %rax
jne 0x6457
movq %r14, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x21d0
testl %eax, %eax
je 0x6474
movq 0x38(%rbx), %rsi
leaq 0x2d26(%rip), %rdx      # 0x9188
movq %rbx, %rdi
movq %r14, %rcx
jmp 0x63f0
movq %rbx, %rdi
callq 0x50e2
jmp 0x63f7
testq %r12, %r12
je 0x64c4
leaq 0xae(%rip), %rdx        # 0x652e
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x5258
cmpq $0x1, %rax
je 0x64c4
testq %rax, %rax
je 0x650f
cmpq $0x1, %rax
je 0x64b7
cmpq %r15, 0x8(%rsp)
jne 0x64b7
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x21d0
testl %eax, %eax
je 0x64c4
movq 0x38(%rbx), %rsi
leaq 0x2cd8(%rip), %rdx      # 0x919a
jmp 0x6462
movq %rbx, %rdi
callq 0x5c6d
jmp 0x63fc
leaq 0x2979(%rip), %rdi      # 0x8e51
leaq 0x2824(%rip), %rsi      # 0x8d03
leaq 0x2cc7(%rip), %rcx      # 0x91ad
movl $0x246, %edx            # imm = 0x246
callq 0x2120
leaq 0x295a(%rip), %rdi      # 0x8e51
leaq 0x2805(%rip), %rsi      # 0x8d03
leaq 0x2c33(%rip), %rcx      # 0x9138
movl $0x265, %edx            # imm = 0x265
callq 0x2120
leaq 0x293b(%rip), %rdi      # 0x8e51
leaq 0x27e6(%rip), %rsi      # 0x8d03
leaq 0x2c14(%rip), %rcx      # 0x9138
movl $0x271, %edx            # imm = 0x271
callq 0x2120