// File: /workspace/github_cpp_makefile_star2_O3/iamlouk[P]asbi/src/ast.cc
// Function: ast::If::to_vmops(asbi::Context*, std::vector<asbi::OpCode, std::allocator<asbi::OpCode>>&) const
void If::to_vmops(Context* ctx, std::vector<OpCode> &ops) const {
	cond->to_vmops(ctx, ops);
	ops.push_back(OpCode::IF_TRUE_GOTO);
	ops.push_back(OpCode::NOOP);
	auto pos1 = ops.size() - 1;
	ops.push_back(OpCode::ENTER_SCOPE);
	if (elsebody)
		elsebody->to_vmops(ctx, ops);
	else
		ops.push_back(OpCode::PUSH_NIL);
	ops.push_back(OpCode::LEAVE_SCOPE);
	ops.push_back(OpCode::GOTO);
	ops.push_back(OpCode::NOOP);
	auto pos2 = ops.size() - 1;
	*(ops.data() + pos1) = static_cast<OpCode>(ops.size());
	ops.push_back(OpCode::ENTER_SCOPE);
	ifbody->to_vmops(ctx, ops);
	ops.push_back(OpCode::LEAVE_SCOPE);
	*(ops.data() + pos2) = static_cast<OpCode>(ops.size());
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rdi), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq $0x21, 0x8(%rsp)
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
cmpq %rax, %rsi
je 0xe1f9
movq $0x21, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xe20e
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0xed48
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
movq $0x23, 0x8(%rsp)
cmpq %rax, %rsi
je 0xe22d
movq $0x23, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xe242
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0xed48
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
movq %rsi, %r12
subq (%rbx), %r12
movq $0xa, 0x8(%rsp)
cmpq %rax, %rsi
je 0xe267
movq $0xa, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xe274
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0xed48
movq 0x18(%r15), %rdi
testq %rdi, %rdi
je 0xe28b
movq (%rdi), %rax
movq %r14, %rsi
movq %rbx, %rdx
callq *0x18(%rax)
jmp 0xe2bc
movq $0x4, 0x8(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0xe2af
movq $0x4, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xe2bc
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0xed48
movq $0xb, 0x8(%rsp)
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
cmpq %rax, %rsi
je 0xe2e3
movq $0xb, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xe2f8
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0xed48
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
movq $0x20, 0x8(%rsp)
cmpq %rax, %rsi
je 0xe317
movq $0x20, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xe32c
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0xed48
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
movq $0x23, 0x8(%rsp)
cmpq %rax, %rsi
je 0xe34b
movq $0x23, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xe360
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0xed48
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
movq (%rbx), %rcx
movq %rsi, %r13
subq %rcx, %r13
movq %r13, %rdx
sarq $0x3, %rdx
movq %rdx, -0x8(%rcx,%r12)
movq $0xa, 0x8(%rsp)
cmpq %rax, %rsi
je 0xe394
movq $0xa, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xe3a1
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0xed48
movq 0x10(%r15), %rdi
movq (%rdi), %rax
movq %r14, %rsi
movq %rbx, %rdx
callq *0x18(%rax)
movq $0xb, 0x8(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0xe3d5
movq $0xb, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xe3e6
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0xed48
movq 0x8(%rbx), %rsi
movq (%rbx), %rax
subq %rax, %rsi
sarq $0x3, %rsi
movq %rsi, -0x8(%rax,%r13)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop