// File: /workspace/github_cpp_makefile_star2_O1/pfnet-research[P]pml/src/parser.cpp
// Function: parser::typed_expr(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned long&)
expr_result_t typed_expr(std::string const& input, size_t& pos) {
    auto expr_result = neg_expr_t(input, pos);
    if (expr_result.is_error())
        return expr_result;

    auto colon_token = next_token(input, pos);
    if (colon_token.kind != token_t::kind_t::Colon)
        return expr_result;
    pos = colon_token.pos + colon_token.lexime.size();

    auto type_result = refinement_type(input, pos);
    if (type_result.is_error())
        return type_result.convert<ptr<ast::expr_t>>();

    auto expr = expr_result.ok();
    auto type = type_result.ok();

    return expr_result_t::ok(make<ast::typed_expr_t>(expr, type));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x230c7
movb 0x30(%r12), %al
testb %al, %al
je 0x232f9
movq (%r14), %rdx
leaq 0x98(%rsp), %rdi
movq %r15, %rsi
callq 0x1bcc7
cmpl $0x1c, 0x98(%rsp)
jne 0x23328
movq 0xb0(%rsp), %rax
addq 0xa0(%rsp), %rax
movq %rax, (%r14)
leaq 0xc8(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x204de
cmpb $0x0, 0x100(%rsp)
je 0x233ac
leaq 0x8(%rsp), %rdi
callq 0x24ee2
movq (%rax), %rcx
movq %rcx, 0x50(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x58(%rsp)
testq %rax, %rax
je 0x233f4
movq 0x3fcc8(%rip), %rcx     # 0x62fb0
cmpb $0x0, (%rcx)
je 0x233f0
incl 0x8(%rax)
jmp 0x233f4
movb %al, 0x30(%rbx)
leaq 0x28(%rsp), %rax
movups -0x20(%rax), %xmm0
movups %xmm0, (%rbx)
leaq 0x20(%rbx), %rcx
movq %rcx, 0x10(%rbx)
movq -0x10(%rax), %rdx
cmpq %rax, %rdx
je 0x23359
movq %rdx, 0x10(%rbx)
movq 0x28(%rsp), %rcx
movq %rcx, 0x20(%rbx)
jmp 0x2335f
movb 0x38(%rsp), %al
movb %al, 0x30(%rbx)
cmpb $0x1, %al
jne 0x23380
movq 0x8(%rsp), %rax
movq %rax, (%rbx)
xorl %eax, %eax
movq %rax, 0x8(%rbx)
movq 0x10(%rsp), %rcx
movq %rax, 0x10(%rsp)
movq %rcx, 0x8(%rbx)
movq %rax, 0x8(%rsp)
jmp 0x234ec
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq 0x20(%rsp), %rcx
movq %rcx, 0x18(%rbx)
movq %rax, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
movb $0x0, 0x28(%rsp)
jmp 0x2350d
leaq 0x28(%rsp), %rax
movups -0x20(%rax), %xmm0
movups %xmm0, (%rbx)
leaq 0x20(%rbx), %rcx
movq %rcx, 0x10(%rbx)
movq -0x10(%rax), %rdx
cmpq %rax, %rdx
je 0x233c9
movq %rdx, 0x10(%rbx)
movq 0x28(%rsp), %rcx
movq %rcx, 0x20(%rbx)
jmp 0x233cf
leaq 0xc8(%rsp), %rdi
callq 0x2852e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x24e94
jmp 0x234df
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq 0x20(%rsp), %rcx
movq %rcx, 0x18(%rbx)
movq %rax, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
movb $0x0, 0x28(%rsp)
jmp 0x234ec
lock
incl 0x8(%rax)
leaq 0xc8(%rsp), %rdi
callq 0x24e06
movq %rax, %r14
leaq 0x70(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x60(%rsp), %rdi
callq 0xad30
movl 0x20(%r14), %eax
movl %eax, 0x80(%rsp)
movq 0x28(%r14), %rax
movq %rax, 0x88(%rsp)
movq 0x30(%r14), %rax
movq %rax, 0x90(%rsp)
testq %rax, %rax
je 0x2345e
movq 0x3fb60(%rip), %rcx     # 0x62fb0
cmpb $0x0, (%rcx)
je 0x2345a
incl 0x8(%rax)
jmp 0x2345e
lock
incl 0x8(%rax)
leaq 0x48(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x40(%rsp), %rsi
leaq 0x7(%rsp), %rdx
leaq 0x50(%rsp), %rcx
leaq 0x60(%rsp), %r8
callq 0x2631e
movaps 0x40(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x40(%rsp)
movb $0x1, 0x30(%rbx)
movups %xmm0, (%rbx)
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x234a7
callq 0xaa12
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x234b9
callq 0xaa12
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x234d0
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x92e0
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x234df
callq 0xaa12
leaq 0xc8(%rsp), %rdi
callq 0x28440
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2350d
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x92e0
leaq 0x8(%rsp), %rdi
callq 0x1a10e
movq %rbx, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x24c5c
jmp 0x2353d
jmp 0x2354e
movq %rax, %rbx
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x23551
callq 0xaa12
jmp 0x23551
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x28440
jmp 0x23563
movq %rax, %rbx
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x23589
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x92e0
jmp 0x23589
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1a10e
movq %rbx, %rdi
callq 0x94e0