// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq 0x4821(%rip), %rax      # 0xc620
movq %rax, -0x50(%rbp)
movq 0x481e(%rip), %rax      # 0xc628
movq %rax, -0x48(%rbp)
movq 0x481b(%rip), %rax      # 0xc630
movq %rax, -0x40(%rbp)
movq 0x4818(%rip), %rax      # 0xc638
movq %rax, -0x38(%rbp)
leaq -0x50(%rbp), %rdi
addq $0x4, %rdi
movq -0x18(%rbp), %rsi
movl $0x1c, %edx
callq 0x2070
movq -0x10(%rbp), %rdi
leaq -0x50(%rbp), %rdx
leaq 0x4043(%rip), %rsi      # 0xbe8c
callq 0x8fb0
cmpl $0x0, %eax
je 0x7e5f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7faa
movq -0x10(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x7060
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x7e79
jmp 0x7e98
leaq 0x436d(%rip), %rdi      # 0xc1ed
leaq 0x4218(%rip), %rsi      # 0xc09f
movl $0x265, %edx            # imm = 0x265
leaq 0x46c0(%rip), %rcx      # 0xc553
callq 0x2120
movl $0x1, %eax
cmpq %rax, -0x58(%rbp)
jne 0x7eb8
movq -0x10(%rbp), %rdi
callq 0x6680
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7faa
movq -0x18(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rdi
callq 0x20d0
movq -0x68(%rbp), %rdi
movq %rax, %rsi
movq -0x58(%rbp), %rdx
movq -0x60(%rbp), %rcx
callq 0x7090
cmpl $0x0, %eax
jne 0x7f0c
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
movq -0x18(%rbp), %rcx
leaq 0x46aa(%rip), %rdx      # 0xc5a3
movb $0x0, %al
callq 0x65a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7faa
cmpq $0x0, -0x20(%rbp)
je 0x7f9e
movq -0x10(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x7fc0
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x7f31
jmp 0x7f50
leaq 0x42b5(%rip), %rdi      # 0xc1ed
leaq 0x4160(%rip), %rsi      # 0xc09f
movl $0x271, %edx            # imm = 0x271
leaq 0x4608(%rip), %rcx      # 0xc553
callq 0x2120
movl $0x1, %eax
cmpq %rax, -0x58(%rbp)
je 0x7f9c
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x60(%rbp), %rcx
callq 0x7090
cmpl $0x0, %eax
jne 0x7f9c
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
movq -0x18(%rbp), %rcx
leaq 0x4629(%rip), %rdx      # 0xc5b5
movb $0x0, %al
callq 0x65a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7faa
jmp 0x7f9e
movq -0x10(%rbp), %rdi
callq 0x77d0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)