// File: /workspace/github_cpp_makefile_star2_O3/pfnet-research[P]pml/src/parser.cpp
// Function: parser::letfun_expr(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned long&)
expr_result_t letfun_expr(std::string const& input, size_t& pos) {
    EXPECT(letfun_token, LetFun);
    EXPECT(ident_token, Ident);
    auto name = ident_token.lexime;
    auto depty_result = dependent_type(input, pos);
    if (depty_result.is_error())
        return depty_result.convert<ptr<ast::expr_t>>();
    auto type = depty_result.ok();

    EXPECT(eq_token, Eq);

    auto init_result = expr(input, pos);
    if (init_result.is_error())
        return init_result;
    auto init = init_result.ok();

    EXPECT(in_token, In);

    auto body_result = expr(input, pos);
    if (body_result.is_error())
        return body_result;
    auto body = body_result.ok();

    return expr_result_t::ok(make<ast::letfun_expr_t>(name, type, init, body));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x318, %rsp            # imm = 0x318
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdx), %rdx
leaq 0x288(%rsp), %r12
movq %r12, %rdi
movl $0x1, %ecx
callq 0x1c56e
cmpb $0x0, 0x30(%r12)
je 0x2147b
leaq 0x288(%rsp), %rdi
callq 0x24814
movups (%rax), %xmm0
leaq 0x1c0(%rsp), %rdi
movaps %xmm0, -0x10(%rdi)
leaq 0x1d0(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x10(%rax), %rsi
movq 0x18(%rax), %rdx
addq %rsi, %rdx
callq 0xac68
movq 0x1c8(%rsp), %rdx
addq 0x1b8(%rsp), %rdx
movq %rdx, (%r14)
leaq 0x250(%rsp), %rdi
movq %r15, %rsi
movl $0xa, %ecx
callq 0x1c56e
cmpb $0x0, 0x280(%rsp)
je 0x21498
leaq 0x250(%rsp), %rdi
callq 0x24814
movups (%rax), %xmm0
leaq 0x40(%rsp), %rdi
movaps %xmm0, -0x10(%rdi)
leaq 0x50(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq 0x10(%rax), %rsi
movq 0x18(%rax), %rdx
addq %rsi, %rdx
callq 0xac68
movq 0x48(%rsp), %rdx
movq 0x38(%rsp), %rax
addq %rdx, %rax
movq %rax, (%r14)
leaq 0x70(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x40(%rsp), %rsi
addq %rsi, %rdx
leaq 0x60(%rsp), %rdi
callq 0xac68
leaq 0x2c0(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x202ac
cmpb $0x0, 0x310(%rsp)
je 0x214b5
leaq 0x2c0(%rsp), %rdi
callq 0x24e06
movq %rax, %r12
leaq 0x130(%rsp), %rdi
movq %rax, %rsi
callq 0xcdea
leaq 0x148(%rsp), %rdi
leaq 0x158(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x18(%r12), %rsi
movq 0x20(%r12), %rdx
addq %rsi, %rdx
callq 0xac68
movl 0x38(%r12), %eax
movl %eax, 0x168(%rsp)
movq 0x40(%r12), %rax
movq %rax, 0x170(%rsp)
movq 0x48(%r12), %rax
movq %rax, 0x178(%rsp)
testq %rax, %rax
je 0x214d6
movq 0x40b3f(%rip), %rcx     # 0x61fb0
cmpb $0x0, (%rcx)
je 0x214d2
incl 0x8(%rax)
jmp 0x214d6
leaq 0x288(%rsp), %rdi
callq 0x247ba
movq %rbx, %rdi
movq %rax, %rsi
callq 0x24d5e
jmp 0x2194c
leaq 0x250(%rsp), %rdi
callq 0x247ba
movq %rbx, %rdi
movq %rax, %rsi
callq 0x24d5e
jmp 0x2190e
leaq 0x2c0(%rsp), %rdi
callq 0x28688
movq %rbx, %rdi
movq %rax, %rsi
callq 0x24d5e
jmp 0x218ce
lock
incl 0x8(%rax)
movq (%r14), %rdx
leaq 0x218(%rsp), %rdi
movq %r15, %rsi
movl $0xd, %ecx
callq 0x1c56e
cmpb $0x0, 0x248(%rsp)
je 0x215a5
leaq 0x218(%rsp), %rdi
callq 0x24814
movups (%rax), %xmm0
leaq 0x190(%rsp), %rdi
movaps %xmm0, -0x10(%rdi)
leaq 0x1a0(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x10(%rax), %rsi
movq 0x18(%rax), %rdx
addq %rsi, %rdx
callq 0xac68
movq 0x198(%rsp), %rax
addq 0x188(%rsp), %rax
movq %rax, (%r14)
leaq 0xe8(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2120b
movb 0x118(%rsp), %al
testb %al, %al
je 0x215c2
leaq 0xe8(%rsp), %rdi
callq 0x24dac
movq (%rax), %rcx
movq %rcx, 0x20(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x2162e
movq 0x40a1c(%rip), %rcx     # 0x61fb0
cmpb $0x0, (%rcx)
je 0x2162a
incl 0x8(%rax)
jmp 0x2162e
leaq 0x218(%rsp), %rdi
callq 0x247ba
movq %rbx, %rdi
movq %rax, %rsi
callq 0x24d5e
jmp 0x21869
movb %al, 0x30(%rbx)
leaq 0x108(%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 0x215f7
movq %rdx, 0x10(%rbx)
movq 0x108(%rsp), %rcx
movq %rcx, 0x20(%rbx)
jmp 0x215fd
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq 0x100(%rsp), %rcx
movq %rcx, 0x18(%rbx)
movq %rax, 0xf8(%rsp)
movq $0x0, 0x100(%rsp)
movb $0x0, 0x108(%rsp)
jmp 0x2183f
lock
incl 0x8(%rax)
movq (%r14), %rdx
leaq 0x1e0(%rsp), %rdi
movq %r15, %rsi
movl $0x2, %ecx
callq 0x1c56e
cmpb $0x0, 0x210(%rsp)
je 0x216fc
leaq 0x1e0(%rsp), %rdi
callq 0x24814
movups (%rax), %xmm0
leaq 0x90(%rsp), %rdi
movaps %xmm0, -0x10(%rdi)
leaq 0xa0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq 0x10(%rax), %rsi
movq 0x18(%rax), %rdx
addq %rsi, %rdx
callq 0xac68
movq 0x98(%rsp), %rax
addq 0x88(%rsp), %rax
movq %rax, (%r14)
leaq 0xb0(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2120b
movb 0xe0(%rsp), %al
testb %al, %al
je 0x21719
leaq 0xb0(%rsp), %rdi
callq 0x24dac
movq (%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0x21782
movq 0x408c5(%rip), %rcx     # 0x61fb0
cmpb $0x0, (%rcx)
je 0x2177e
incl 0x8(%rax)
jmp 0x21782
leaq 0x1e0(%rsp), %rdi
callq 0x247ba
movq %rbx, %rdi
movq %rax, %rsi
callq 0x24d5e
jmp 0x2180f
movb %al, 0x30(%rbx)
leaq 0xd0(%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 0x2174e
movq %rdx, 0x10(%rbx)
movq 0xd0(%rsp), %rcx
movq %rcx, 0x20(%rbx)
jmp 0x21754
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq 0xc8(%rsp), %rcx
movq %rcx, 0x18(%rbx)
movq %rax, 0xc0(%rsp)
movq $0x0, 0xc8(%rsp)
movb $0x0, 0xd0(%rsp)
jmp 0x217dd
lock
incl 0x8(%rax)
leaq 0x128(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
leaq 0x120(%rsp), %rsi
leaq 0xf(%rsp), %rdx
leaq 0x60(%rsp), %rcx
leaq 0x130(%rsp), %r8
leaq 0x20(%rsp), %r9
callq 0x2583c
movb $0x1, 0x30(%rbx)
movaps 0x120(%rsp), %xmm0
movups %xmm0, (%rbx)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x217dd
callq 0xa946
leaq 0xb0(%rsp), %rdi
callq 0x19f1e
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x2180f
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x92e0
leaq 0x200(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x21830
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x92e0
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x2183f
callq 0xa946
leaq 0xe8(%rsp), %rdi
callq 0x19f1e
movq 0x190(%rsp), %rdi
cmpq %r12, %rdi
je 0x21869
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x92e0
leaq 0x238(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2188a
movq 0x238(%rsp), %rsi
incq %rsi
callq 0x92e0
movq 0x178(%rsp), %rdi
testq %rdi, %rdi
je 0x2189c
callq 0xa946
movq 0x148(%rsp), %rdi
leaq 0x158(%rsp), %rax
cmpq %rax, %rdi
je 0x218c1
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x92e0
leaq 0x130(%rsp), %rdi
callq 0xce82
leaq 0x2c0(%rsp), %rdi
callq 0x2833a
movq 0x60(%rsp), %rdi
cmpq %rbp, %rdi
je 0x218f2
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x92e0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x2190e
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x92e0
leaq 0x270(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2192f
movq 0x270(%rsp), %rsi
incq %rsi
callq 0x92e0
movq 0x1c0(%rsp), %rdi
cmpq %r13, %rdi
je 0x2194c
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x92e0
leaq 0x2a8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2196d
movq 0x2a8(%rsp), %rsi
incq %rsi
callq 0x92e0
movq %rbx, %rax
addq $0x318, %rsp            # imm = 0x318
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x21999
callq 0xa946
jmp 0x21999
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x19f1e
jmp 0x219ab
movq %rax, %rbx
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x219d7
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x92e0
jmp 0x219d7
jmp 0x219d4
movq %rax, %rbx
leaq 0x200(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x219fd
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x92e0
jmp 0x219fd
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x21a11
callq 0xa946
jmp 0x21a11
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x19f1e
jmp 0x21a23
movq %rax, %rbx
movq 0x190(%rsp), %rdi
cmpq %r12, %rdi
je 0x21a47
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x92e0
jmp 0x21a47
jmp 0x21a44
movq %rax, %rbx
leaq 0x238(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x21a6d
movq 0x238(%rsp), %rsi
incq %rsi
callq 0x92e0
jmp 0x21a6d
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
callq 0x24d2a
jmp 0x21a93
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
callq 0xce82
jmp 0x21a93
jmp 0x21a90
movq %rax, %rbx
leaq 0x2c0(%rsp), %rdi
callq 0x2833a
movq 0x60(%rsp), %rdi
cmpq %rbp, %rdi
je 0x21ac1
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x92e0
jmp 0x21ac1
movq %rax, %rbx
jmp 0x21aa0
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x21ae4
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x92e0
jmp 0x21ae4
jmp 0x21ae1
movq %rax, %rbx
leaq 0x270(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x21b0a
movq 0x270(%rsp), %rsi
incq %rsi
callq 0x92e0
jmp 0x21b0a
movq %rax, %rbx
movq 0x1c0(%rsp), %rdi
cmpq %r13, %rdi
je 0x21b2e
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x92e0
jmp 0x21b2e
jmp 0x21b2b
movq %rax, %rbx
leaq 0x2a8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x21b4f
movq 0x2a8(%rsp), %rsi
incq %rsi
callq 0x92e0
movq %rbx, %rdi
callq 0x94e0