// File: /workspace/github_cpp_makefile_star2_O2/pfnet-research[P]pml/src/parser.cpp
// Function: parser::dependent_type(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned long&)
depty_result_t dependent_type(std::string const& input, size_t& pos) {
    auto token = next_token(input, pos);
    std::vector<ast::refinement_type_t> args;
    if (token.kind == token_t::kind_t::LParen) {
        EXPECT(lparen_token, LParen);
        auto refty_result = refinement_type(input, pos);
        if (refty_result.is_error())
            return refty_result.convert<ast::dependent_type_t>();
        args.push_back(refty_result.ok());
        while (true) {
            if (next_token(input, pos).kind != token_t::kind_t::Comma)
                break;
            EXPECT(comma_token, Comma);
            auto refty_result = refinement_type(input, pos);
            if (refty_result.is_error())
                return refty_result.convert<ast::dependent_type_t>();
            args.push_back(refty_result.ok());
        }
        EXPECT(rparen_token, RParen);
    } else {
        auto refty_result = refinement_type(input, pos);
        if (refty_result.is_error())
            return refty_result.convert<ast::dependent_type_t>();
        args.push_back(refty_result.ok());
    }
    EXPECT(arrow_token, Arrow);
    auto retty_result = refinement_type(input, pos);
    if (retty_result.is_error())
        return retty_result.convert<ast::dependent_type_t>();
    return depty_result_t::ok(ast::dependent_type_t {
            args, retty_result.ok()
            });
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdx), %rdx
leaq 0x178(%rsp), %r12
movq %r12, %rdi
callq 0x1537c
andq $0x0, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
cmpl $0x1f, (%r12)
jne 0x182c6
movq (%r14), %rdx
leaq 0x58(%rsp), %rdi
pushq $0x1f
popq %rcx
movq %r15, %rsi
callq 0x15bc7
cmpb $0x0, 0x88(%rsp)
je 0x18300
leaq 0x58(%rsp), %rdi
callq 0x1ac66
leaq 0x148(%rsp), %rdi
movq %rax, %rsi
callq 0x1acbe
leaq 0x158(%rsp), %rcx
movq 0x8(%rcx), %rax
addq -0x8(%rcx), %rax
movq %rax, (%r14)
leaq 0x90(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1809e
cmpb $0x0, 0xc8(%rsp)
je 0x1840a
leaq 0x90(%rsp), %rdi
callq 0x1b0da
movq %rsp, %rdi
movq %rax, %rsi
callq 0x1b0ae
leaq 0x18(%rsp), %r13
leaq 0xe0(%rsp), %rbp
movq (%r14), %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x1537c
movl 0x18(%rsp), %r12d
leaq 0x28(%rsp), %rdi
callq 0x9130
cmpl $0x12, %r12d
jne 0x1843e
movq (%r14), %rdx
movq %rbp, %rdi
movq %r15, %rsi
pushq $0x12
popq %rcx
callq 0x15bc7
cmpb $0x0, 0x110(%rsp)
je 0x18496
movq %rbp, %rdi
callq 0x1ac66
leaq 0x118(%rsp), %rdi
movq %rax, %rsi
callq 0x1acbe
movq 0x130(%rsp), %rax
addq 0x120(%rsp), %rax
movq %rax, (%r14)
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1809e
movb 0x50(%rsp), %r12b
testb %r12b, %r12b
je 0x1828b
movq %r13, %rdi
callq 0x1b0da
movq %rsp, %rdi
movq %rax, %rsi
callq 0x1b0ae
jmp 0x18296
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1b092
movq %r13, %rdi
callq 0x1fe92
leaq 0x128(%rsp), %rdi
callq 0x9130
leaq 0xf0(%rsp), %rdi
callq 0x9130
testb %r12b, %r12b
jne 0x181ed
jmp 0x184bb
leaq 0x90(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1809e
movb 0xc8(%rsp), %bpl
testb %bpl, %bpl
je 0x1831a
leaq 0x90(%rsp), %rdi
callq 0x1b0da
movq %rsp, %rdi
movq %rax, %rsi
callq 0x1b0ae
jmp 0x1832a
leaq 0x58(%rsp), %rdi
callq 0x1ac0e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1b064
jmp 0x184d5
leaq 0x90(%rsp), %rsi
movq %rbx, %rdi
callq 0x1b092
leaq 0x90(%rsp), %rdi
callq 0x1fe92
testb %bpl, %bpl
je 0x184df
movq (%r14), %rdx
leaq 0x58(%rsp), %rdi
pushq $0xb
popq %rcx
movq %r15, %rsi
callq 0x15bc7
cmpb $0x0, 0x88(%rsp)
je 0x183f0
leaq 0x58(%rsp), %rdi
callq 0x1ac66
leaq 0xe0(%rsp), %rdi
movq %rax, %rsi
callq 0x1acbe
leaq 0xf0(%rsp), %r12
movq 0x8(%r12), %rax
addq -0x8(%r12), %rax
movq %rax, (%r14)
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1809e
cmpb $0x0, 0x50(%rsp)
je 0x1841f
leaq 0x90(%rsp), %rdi
movq %rsp, %rsi
callq 0xc0b2
leaq 0x18(%rsp), %rdi
callq 0x1b0da
leaq 0xa8(%rsp), %rdi
movq %rax, %rsi
callq 0xc10c
leaq 0x90(%rsp), %rsi
movq %rbx, %rdi
callq 0x1b132
leaq 0x90(%rsp), %rdi
callq 0xc5c6
jmp 0x1842c
leaq 0x58(%rsp), %rdi
callq 0x1ac0e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1b064
jmp 0x184d5
leaq 0x90(%rsp), %rsi
movq %rbx, %rdi
callq 0x1b092
jmp 0x184bb
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x1b092
leaq 0x18(%rsp), %rdi
callq 0x1fe92
movq %r12, %rdi
jmp 0x184d0
movq (%r14), %rdx
leaq 0x18(%rsp), %rdi
pushq $0x20
popq %rcx
movq %r15, %rsi
callq 0x15bc7
movb 0x48(%rsp), %bpl
testb %bpl, %bpl
je 0x18509
leaq 0x18(%rsp), %rdi
callq 0x1ac66
leaq 0xe0(%rsp), %rdi
movq %rax, %rsi
callq 0x1acbe
leaq 0xf0(%rsp), %rdi
movq 0x8(%rdi), %rax
addq -0x8(%rdi), %rax
movq %rax, (%r14)
callq 0x9130
jmp 0x1851e
leaq 0xe0(%rsp), %rdi
callq 0x1ac0e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1b064
leaq 0xf0(%rsp), %rdi
callq 0x9130
leaq 0x90(%rsp), %rdi
callq 0x1fe92
leaq 0x158(%rsp), %rdi
callq 0x9130
leaq 0x68(%rsp), %rdi
callq 0x9130
movq %rsp, %rdi
callq 0xc13c
leaq 0x188(%rsp), %rdi
callq 0x9130
movq %rbx, %rax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18(%rsp), %rdi
callq 0x1ac0e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1b064
leaq 0x28(%rsp), %rdi
callq 0x9130
leaq 0x90(%rsp), %rdi
callq 0x1fe92
leaq 0x158(%rsp), %rdi
callq 0x9130
leaq 0x68(%rsp), %rdi
callq 0x9130
jmp 0x18337
jmp 0x18553
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
jmp 0x18601
jmp 0x185d5
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0xc5c6
jmp 0x1858d
jmp 0x18576
movq %rax, %rbx
jmp 0x1858d
jmp 0x185f6
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0xc13c
leaq 0x18(%rsp), %rdi
callq 0x1fe92
jmp 0x1859c
movq %rax, %rbx
movq %r12, %rdi
jmp 0x1861b
movq %rax, %rbx
jmp 0x18613
jmp 0x185b0
jmp 0x185b0
jmp 0x185b7
jmp 0x185d5
jmp 0x185b0
movq %rax, %rbx
jmp 0x18620
jmp 0x185b7
movq %rax, %rbx
jmp 0x1862a
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x1fe92
jmp 0x1862a
movq %rax, %rbx
jmp 0x185e7
jmp 0x185d5
movq %rax, %rbx
jmp 0x18606
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x1fe92
leaq 0x128(%rsp), %rdi
callq 0x9130
jmp 0x185f9
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
callq 0x9130
leaq 0x90(%rsp), %rdi
callq 0x1fe92
leaq 0x158(%rsp), %rdi
callq 0x9130
leaq 0x68(%rsp), %rdi
callq 0x9130
movq %rsp, %rdi
callq 0xc13c
leaq 0x188(%rsp), %rdi
callq 0x9130
movq %rbx, %rdi
callq 0x94d0