// File: /workspace/github_cpp_makefile_star2_O3/Heptagon196[P]Gos/GosVM.cpp
// Function: GosVM::VMProgram::WriteCommandDefFunc(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&)
std::function<void(int)> GosVM::VMProgram::WriteCommandDefFunc(const std::string& name, const std::string& retType, const std::vector<std::string>& paramTypes) {
    AddOperation(DEF_MEMBER_FUNC);
    AddParamString(name);
    AddParamString(retType);
    int len = paramTypes.size();
    AddParamInt(len);
    for (int i = 0; i < len; i++) {
        AddParamString(paramTypes[i]);
    }
    int pos = content.size();
    AddParamInt(0);
    int startJump = content.size();
    return [this, pos, startJump](int jmp) {
        *(int*)&content[pos] = jmp - startJump;
    };
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r8, 0x8(%rsp)
movq %rcx, %r13
movq %rdx, %rbp
movq %rsi, %r14
movq %rdi, %r12
leaq 0x20(%rsi), %r15
movq %r15, %rdi
movl $0x4, %esi
callq 0x6e3f2
leaq 0x68(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rbp), %rsi
movq 0x8(%rbp), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %rbp
movq %rbp, %rdi
callq 0x36954
movq %r14, %rdi
movq %rbp, %rsi
callq 0x943fa
movq 0x58(%rsp), %rdi
cmpq %rbx, %rdi
je 0x98da3
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x11360
leaq 0x48(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq 0x38(%rsp), %r13
movq %r13, %rdi
callq 0x36954
movq %r14, %rdi
movq %r13, %rsi
callq 0x943fa
movq %r12, 0x10(%rsp)
movq 0x38(%rsp), %rdi
cmpq %rbx, %rdi
je 0x98deb
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x11360
movq 0x8(%rsp), %rax
movq 0x8(%rax), %r12
subq (%rax), %r12
shrq $0x5, %r12
movl $0xfffffff8, %ebp       # imm = 0xFFFFFFF8
addl $0x8, %ebp
movl %r12d, %eax
movl %ebp, %ecx
sarl %cl, %eax
movsbl %al, %esi
movq %r15, %rdi
callq 0x6e3f2
cmpl $0x18, %ebp
jb 0x98e00
testl %r12d, %r12d
jle 0x98e81
leaq 0x28(%rsp), %rbx
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
movl $0x8, %ebp
leaq 0x18(%rsp), %r13
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq %rbx, 0x18(%rsp)
movq -0x8(%rax,%rbp), %rsi
movq (%rax,%rbp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x36954
movq %r14, %rdi
movq %r13, %rsi
callq 0x943fa
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0x98e78
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x11360
addq $0x20, %rbp
decq %r12
jne 0x98e35
movq 0x28(%r14), %rbx
movl $0xfffffff8, %ebp       # imm = 0xFFFFFFF8
movq %r15, %rdi
xorl %esi, %esi
callq 0x6e3f2
addl $0x8, %ebp
cmpl $0x18, %ebp
jb 0x98e8a
movl 0x28(%r14), %ecx
movq 0x10(%rsp), %rax
movq %r14, (%rax)
movl %ebx, 0x8(%rax)
movl %ecx, 0xc(%rax)
leaq 0x15c9(%rip), %rcx      # 0x9a47e
movq %rcx, 0x18(%rax)
leaq 0x15d2(%rip), %rcx      # 0x9a492
movq %rcx, 0x10(%rax)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x38(%rsp), %rdi
jmp 0x98eef
movq %rax, %r14
movq 0x58(%rsp), %rdi
jmp 0x98eef
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0x98eff
movq (%rbx), %rsi
incq %rsi
callq 0x11360
movq %r14, %rdi
callq 0x11580
nop