// File: /workspace/github_cpp_makefile_star2_O2/rossy[P]crossc/SPIRV-Cross/spirv_msl.cpp
// Function: spirv_cross::CompilerMSL::type_to_glsl[abi:cxx11](spirv_cross::SPIRType const&, unsigned int)
string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id)
{
	// Ignore the pointer type since GLSL doesn't have pointers.

	string type_name;

	switch (type.basetype)
	{
	case SPIRType::Struct:
		// Need OpName lookup here to get a "sensible" name for a struct.
		return to_name(type.self);

	case SPIRType::Image:
	case SPIRType::SampledImage:
		return image_type_glsl(type, id);

	case SPIRType::Sampler:
		return sampler_type(type);

	case SPIRType::Void:
		return "void";

	case SPIRType::AtomicCounter:
		return "atomic_uint";

	// Scalars
	case SPIRType::Boolean:
		type_name = "bool";
		break;
	case SPIRType::Char:
		type_name = "char";
		break;
	case SPIRType::Int:
		type_name = (type.width == 16 ? "short" : "int");
		break;
	case SPIRType::UInt:
		type_name = (type.width == 16 ? "ushort" : "uint");
		break;
	case SPIRType::Int64:
		type_name = "long"; // Currently unsupported
		break;
	case SPIRType::UInt64:
		type_name = "size_t";
		break;
	case SPIRType::Half:
		type_name = "half";
		break;
	case SPIRType::Float:
		type_name = "float";
		break;
	case SPIRType::Double:
		type_name = "double"; // Currently unsupported
		break;

	default:
		return "unknown_type";
	}

	// Matrix?
	if (type.columns > 1)
		type_name += to_string(type.columns) + "x";

	// Vector or Matrix?
	if (type.vecsize > 1)
		type_name += to_string(type.vecsize);

	return type_name;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
andq $0x0, -0x8(%r15)
movb $0x0, (%r15)
movl 0xc(%rdx), %eax
decl %eax
cmpl $0xe, %eax
ja 0x7c921
movq %rdx, %r14
leaq 0x1e562(%rip), %rdx     # 0x9adc0
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq (%rsi), %rax
movq %rbx, %rdi
movq %r14, %rdx
callq *0xb0(%rax)
jmp 0x7ca15
movq %rbx, %rdi
movq %r14, %rdx
callq 0x78108
jmp 0x7ca15
movl 0x8(%r14), %edx
movq (%rsi), %rax
pushq $0x1
popq %rcx
movq %rbx, %rdi
callq *0x38(%rax)
jmp 0x7ca15
cmpl $0x10, 0x10(%r14)
leaq 0x2160f(%rip), %rax     # 0x9debb
leaq 0x2112b(%rip), %rsi     # 0x9d9de
jmp 0x7c8e0
leaq 0x21129(%rip), %rsi     # 0x9d9e5
jmp 0x7c95c
leaq 0x215ee(%rip), %rsi     # 0x9deb6
jmp 0x7c95c
cmpl $0x10, 0x10(%r14)
leaq 0x215e3(%rip), %rax     # 0x9debc
leaq 0x15a4f(%rip), %rsi     # 0x9232f
cmoveq %rax, %rsi
jmp 0x7c95c
leaq 0x15e87(%rip), %rsi     # 0x92774
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x6100
jmp 0x7ca15
leaq 0x163cb(%rip), %rsi     # 0x92cd1
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x6100
jmp 0x7ca15
leaq 0x15e6b(%rip), %rsi     # 0x9278a
jmp 0x7c95c
leaq 0x215a1(%rip), %rsi     # 0x9dec9
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x6100
jmp 0x7ca15
leaq 0x160c4(%rip), %rsi     # 0x92a05
jmp 0x7c95c
leaq 0x21578(%rip), %rsi     # 0x9dec2
jmp 0x7c95c
leaq 0x1c6b7(%rip), %rsi     # 0x9900a
jmp 0x7c95c
leaq 0x15f3f(%rip), %rsi     # 0x9289b
movq %rsp, %rdi
callq 0x64e0
movl 0x18(%r14), %esi
cmpl $0x2, %esi
jb 0x7c9ae
leaq 0x40(%rsp), %rdi
callq 0x1c182
leaq 0x183df(%rip), %rdx     # 0x94d5d
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xab3f
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x64f0
leaq 0x20(%rsp), %rdi
callq 0x6548
leaq 0x40(%rsp), %rdi
callq 0x6548
movl 0x14(%r14), %esi
cmpl $0x2, %esi
jb 0x7c9d8
leaq 0x20(%rsp), %rdi
callq 0x1c182
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x64f0
leaq 0x20(%rsp), %rdi
callq 0x6548
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq (%rsp), %rcx
cmpq %r15, %rcx
je 0x7c9f6
movq %rcx, (%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0x7c9fd
movups (%r15), %xmm0
movups %xmm0, (%rax)
movq 0x8(%rsp), %rax
movq %rax, 0x8(%rbx)
movq %r15, (%rsp)
andq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq %rsp, %rdi
callq 0x6548
movq %rbx, %rax
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x7ca5c
jmp 0x7ca5c
jmp 0x7ca5c
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
jmp 0x7ca53
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x6548
jmp 0x7ca4e
jmp 0x7ca5c
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x6548
jmp 0x7ca5f
jmp 0x7ca5c
movq %rax, %rbx
movq %rsp, %rdi
callq 0x6548
movq %rbx, %rdi
callq 0x64b0
nop