// File: /workspace/github_cpp_makefile_star2_O3/iamlouk[P]asbi/src/parser.cc
// Function: asbi::Parser::parse_lambda(std::vector<ast::Node*, std::allocator<ast::Node*>>)
ast::Lambda* Parser::parse_lambda(std::vector<ast::Node*> argnamenodes) {
	expect(tok::Arrow);

	std::vector<asbi::StringContainer*> argnames;
	for (auto const& node: argnamenodes) {
		ast::Variable* var = dynamic_cast<ast::Variable*>(node);
		if (var == nullptr)
			throw utils::parser_error("lambda-litteral args should only be identifiers", node);

		argnames.push_back(var->sc);
		delete var;
	}

	ast::Block* body;
	auto _body = parse_expr();
	if (body = dynamic_cast<ast::Block*>(_body); body == nullptr) {
		std::vector<ast::Node*> vec = { _body };
		body = new ast::Block(vec);
	}

	return new ast::Lambda(std::move(argnames), body);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r14
movq %rdi, 0x30(%rsp)
movl $0xc, %esi
callq 0x8044
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq (%r14), %rbp
movq 0x8(%r14), %rbx
cmpq %rbx, %rbp
je 0x9a6c
leaq 0x16b8f(%rip), %r14     # 0x20590
leaq 0x16c70(%rip), %r15     # 0x20678
leaq 0x10(%rsp), %r12
movq (%rbp), %rdi
testq %rdi, %rdi
je 0x9bbf
movq %r14, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x53f0
testq %rax, %rax
je 0x9bbf
movq %rax, %r13
leaq 0x8(%rax), %rdx
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x9a51
movq (%rdx), %rax
movq %rax, (%rsi)
addq $0x8, 0x18(%rsp)
jmp 0x9a59
movq %r12, %rdi
callq 0xa492
movq (%r13), %rax
movq %r13, %rdi
callq *0x8(%rax)
addq $0x8, %rbp
cmpq %rbx, %rbp
jne 0x9a0d
movq 0x30(%rsp), %rdi
callq 0x8262
movq %rax, %r14
testq %rax, %rax
je 0x9aa2
leaq 0x16b0b(%rip), %rsi     # 0x20590
leaq 0x1713c(%rip), %rdx     # 0x20bc8
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x53f0
movq %rax, %rbx
testq %rax, %rax
jne 0x9b2a
leaq 0x80(%rsp), %rsi
movq %r14, (%rsi)
leaq 0x50(%rsp), %rdi
leaq 0xf(%rsp), %rcx
movl $0x1, %edx
callq 0x9f30
movl $0x20, %edi
callq 0x5380
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x9eb0
leaq 0x17054(%rip), %rax     # 0x20b38
addq $0x10, %rax
movq %rax, (%rbx)
movq %rbx, %rdi
addq $0x8, %rdi
leaq 0x38(%rsp), %rsi
callq 0x9eb0
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x9b13
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x5390
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x9b2a
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x5390
movl $0x28, %edi
callq 0x5380
movq %rax, %r15
movq 0x10(%rsp), %rax
leaq 0x68(%rsp), %rsi
movq %rax, (%rsi)
movups 0x18(%rsp), %xmm0
movups %xmm0, 0x8(%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
leaq 0x16dfb(%rip), %rax     # 0x20960
addq $0x10, %rax
movq %rax, (%r15)
movq %r15, %rdi
addq $0x8, %rdi
callq 0xa0e0
movq %rbx, 0x20(%r15)
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x9b93
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x5390
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x9baa
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x5390
movq %r15, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x48, %edi
callq 0x51b0
movq %rax, %rbx
movq (%rbp), %rdx
leaq 0xdc73(%rip), %rsi      # 0x1784a
movq %rax, %rdi
callq 0xaa7a
leaq 0x16992(%rip), %rsi     # 0x20578
leaq 0x293(%rip), %rdx       # 0x9e80
movq %rbx, %rdi
callq 0x55d0
movq %rax, %r14
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x9c14
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x5390
jmp 0x9c14
movq %rax, %r14
movl $0x20, %esi
movq %rbx, %rdi
callq 0x5390
jmp 0x9c26
movq %rax, %r14
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x9c79
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
jmp 0x9c5e
jmp 0x9c69
movq %rax, %r14
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x9c56
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x5390
movl $0x28, %esi
movq %r15, %rdi
callq 0x5390
jmp 0x9c79
jmp 0x9c69
jmp 0x9c69
movq %rax, %r14
jmp 0x9c79
movq %rax, %r14
movq %rbx, %rdi
callq 0x5280
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x9c90
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x5390
movq %r14, %rdi
callq 0x55e0