// File: /workspace/github_cpp_makefile_star2_O1/pfnet-research[P]pml/src/simple_type.cpp
// Function: simty::to_debug_string[abi:cxx11](simty::type_t const&)
std::string to_debug_string(type_t const& ty) {
    switch (ty.kind()) {
    case simty::kind_t::Int:
        return "Int";
    case simty::kind_t::Bool:
        return "Bool";
    case simty::kind_t::Fun: {
        auto const& fun_ty = cast<fun_type_t>(ty);
        std::string result = "(" + to_debug_string(*fun_ty.args[0]);
        for (size_t i=1; i<fun_ty.args.size(); ++i)
            result += ", " + to_debug_string(*fun_ty.args[i]);
        result += ") -> ";
        result += to_debug_string(*fun_ty.ret);
        return result;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
movq %rsi, %rdi
callq *(%rax)
cmpl $0x2, %eax
je 0x2b4c7
cmpl $0x1, %eax
jne 0x2b53d
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x1bcc8(%rip), %rsi     # 0x47183
leaq 0x1bcc5(%rip), %rdx     # 0x47187
jmp 0x2b552
leaq 0x36ff2(%rip), %rsi     # 0x624c0
leaq 0x36ffb(%rip), %rdx     # 0x624d0
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x2b6d6
movq %rax, %r14
movq 0x8(%rax), %rax
movq (%rax), %rsi
movq %rsp, %r15
movq %r15, %rdi
callq 0x2b483
leaq 0x1bfff(%rip), %rcx     # 0x47503
movl $0x1, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x9330
leaq 0x10(%rbx), %rsi
movq %rsi, (%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
movq %rsi, 0x20(%rsp)
je 0x2b55f
movq %rdx, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x2b565
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x1bc34(%rip), %rsi     # 0x4717f
leaq 0x1bc30(%rip), %rdx     # 0x47182
movq %rbx, %rdi
callq 0x11866
jmp 0x2b6c4
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x10(%rsp), %rbp
movq -0x10(%rbp), %rdi
cmpq %rbp, %rdi
je 0x2b597
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x92e0
movq 0x10(%r14), %rax
subq 0x8(%r14), %rax
cmpq $0x11, %rax
jb 0x2b682
movl $0x1, %r13d
movl $0x10, %r12d
leaq 0x28(%rsp), %r15
movq 0x8(%r14), %rax
movq (%rax,%r12), %rsi
movq %r15, %rdi
callq 0x2b483
movl $0x2, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x1bbc1(%rip), %rcx     # 0x4719f
callq 0x9330
movq %rbp, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2b604
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x2b60b
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x90d0
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x2b64a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x92e0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x2b666
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x92e0
movq 0x10(%r14), %rax
subq 0x8(%r14), %rax
incq %r13
sarq $0x4, %rax
addq $0x10, %r12
cmpq %rax, %r13
jb 0x2b5ba
leaq 0x1d90f(%rip), %rsi     # 0x48f98
movq %rbx, %rdi
callq 0x9540
movq 0x20(%r14), %rsi
movq %rsp, %rdi
callq 0x2b483
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x90d0
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x2b6c4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x92e0
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x9530
movq %rax, %r14
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x2b749
movq 0x10(%rsp), %rsi
jmp 0x2b741
jmp 0x2b70a
jmp 0x2b70a
movq %rax, %r14
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b763
movq 0x10(%rsp), %rsi
jmp 0x2b75b
movq %rax, %r14
jmp 0x2b749
movq %rax, %r14
jmp 0x2b72d
movq %rax, %r14
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x2b72d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x92e0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x2b749
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x92e0
movq (%rbx), %rdi
cmpq 0x20(%rsp), %rdi
je 0x2b763
movq 0x20(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x92e0
movq %r14, %rdi
callq 0x94e0