// File: /workspace/github_cpp_makefile_star2_O3/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 0x2b33d
cmpl $0x1, %eax
jne 0x2b3b3
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x1be52(%rip), %rsi     # 0x47183
leaq 0x1be4f(%rip), %rdx     # 0x47187
jmp 0x2b3c8
leaq 0x361a4(%rip), %rsi     # 0x614e8
leaq 0x361ad(%rip), %rdx     # 0x614f8
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x2b54e
movq %rax, %r14
movq 0x8(%rax), %rax
movq (%rax), %rsi
movq %rsp, %r15
movq %r15, %rdi
callq 0x2b2f9
leaq 0x1c189(%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 0x2b3d5
movq %rdx, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x2b3db
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x1bdbe(%rip), %rsi     # 0x4717f
leaq 0x1bdba(%rip), %rdx     # 0x47182
movq %rbx, %rdi
callq 0x116f8
jmp 0x2b53c
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 0x2b40d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x92e0
movq 0x8(%r14), %rax
movq 0x10(%r14), %rcx
subq %rax, %rcx
cmpq $0x11, %rcx
jb 0x2b4fa
movl $0x1, %r13d
movl $0x10, %r12d
leaq 0x28(%rsp), %r15
movq (%rax,%r12), %rsi
movq %r15, %rdi
callq 0x2b2f9
movl $0x2, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x1bd4c(%rip), %rcx     # 0x4719f
callq 0x9330
movq %rbp, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2b479
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x2b480
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 0x2b4bf
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x92e0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x2b4db
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x92e0
incq %r13
movq 0x8(%r14), %rax
movq 0x10(%r14), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
addq $0x10, %r12
cmpq %rcx, %r13
jb 0x2b433
leaq 0x1da97(%rip), %rsi     # 0x48f98
movq %rbx, %rdi
callq 0x9540
movq 0x20(%r14), %rsi
movq %rsp, %rdi
callq 0x2b2f9
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x90d0
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x2b53c
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 0x2b5c1
movq 0x10(%rsp), %rsi
jmp 0x2b5b9
jmp 0x2b582
jmp 0x2b582
movq %rax, %r14
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b5db
movq 0x10(%rsp), %rsi
jmp 0x2b5d3
movq %rax, %r14
jmp 0x2b5c1
movq %rax, %r14
jmp 0x2b5a5
movq %rax, %r14
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x2b5a5
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x92e0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x2b5c1
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x92e0
movq (%rbx), %rdi
cmpq 0x20(%rsp), %rdi
je 0x2b5db
movq 0x20(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x92e0
movq %r14, %rdi
callq 0x94e0