// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
movl 0xc(%rdx), %eax
decl %eax
cmpl $0xe, %eax
ja 0x9f0d4
movq %rdx, %r14
movl $0x4, %r8d
leaq 0x20e5d(%rip), %rdx     # 0xbfe30
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq (%rsi), %rax
movq %rbx, %rdi
movq %r14, %rdx
callq *0xb0(%rax)
jmp 0x9f33e
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9636a
jmp 0x9f33e
movl 0x8(%r14), %edx
movq (%rsi), %rax
movq %rbx, %rdi
movl $0x1, %ecx
callq *0x38(%rax)
jmp 0x9f33e
xorl %eax, %eax
cmpl $0x10, 0x10(%r14)
sete %al
leaq 0x23edb(%rip), %rdx     # 0xc2f03
leaq 0x239f7(%rip), %rcx     # 0xc2a26
cmoveq %rdx, %rcx
leaq 0x4(,%rax,2), %r8
jmp 0x9f124
movl $0x5, %r8d
leaq 0x239e0(%rip), %rcx     # 0xc2a2d
jmp 0x9f124
leaq 0x23ea5(%rip), %rcx     # 0xc2efe
jmp 0x9f124
xorl %eax, %eax
cmpl $0x10, 0x10(%r14)
sete %al
leaq 0x23e95(%rip), %rdx     # 0xc2f04
leaq 0x182d9(%rip), %rcx     # 0xb734f
cmoveq %rdx, %rcx
leaq 0x3(,%rax,2), %r8
jmp 0x9f124
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x186ff(%rip), %rsi     # 0xb7794
leaq 0x18703(%rip), %rdx     # 0xb779f
movq %rbx, %rdi
callq 0x7be0
jmp 0x9f33e
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x18c3a(%rip), %rsi     # 0xb7cf1
leaq 0x18c37(%rip), %rdx     # 0xb7cf5
movq %rbx, %rdi
callq 0x7be0
jmp 0x9f33e
leaq 0x186d8(%rip), %rcx     # 0xb77aa
jmp 0x9f124
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x23e2f(%rip), %rsi     # 0xc2f11
leaq 0x23e34(%rip), %rdx     # 0xc2f1d
movq %rbx, %rdi
callq 0x7be0
jmp 0x9f33e
leaq 0x18928(%rip), %rcx     # 0xb7a25
jmp 0x9f124
movl $0x6, %r8d
leaq 0x23dfe(%rip), %rcx     # 0xc2f0a
jmp 0x9f124
movl $0x6, %r8d
leaq 0x1ef5f(%rip), %rcx     # 0xbe07a
jmp 0x9f124
leaq 0x18797(%rip), %rcx     # 0xb78bb
leaq 0x28(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x63f0
movl 0x18(%r14), %ebp
cmpl $0x2, %ebp
jb 0x9f24e
movl $0x1, %eax
cmpl $0xa, %ebp
jb 0x9f18d
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %ebp, %edx
cmpl $0x63, %edx
jbe 0x9f186
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0x9f18b
cmpl $0x2710, %edx           # imm = 0x2710
jb 0x9f18d
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0x9f155
addl $-0x3, %eax
jmp 0x9f18d
addl $-0x2, %eax
jmp 0x9f18d
decl %eax
movl %eax, %esi
leaq 0x58(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x48(%rsp), %rdi
xorl %edx, %edx
callq 0x62f0
leaq 0x48(%rsp), %r15
movq (%r15), %rdi
movl 0x8(%r15), %esi
movl %ebp, %edx
callq 0x20b57
leaq 0x1abbf(%rip), %rsi     # 0xb9d7d
movq %r15, %rdi
callq 0x64e0
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9f1ed
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x9f1f4
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x28(%rsp), %rdi
callq 0x60b0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x9f237
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x9f24e
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6260
movl 0x14(%r14), %ebp
cmpl $0x2, %ebp
jb 0x9f2fb
movl $0x1, %eax
cmpl $0xa, %ebp
jb 0x9f2a9
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %ebp, %edx
cmpl $0x63, %edx
jbe 0x9f2a2
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0x9f2a7
cmpl $0x2710, %edx           # imm = 0x2710
jb 0x9f2a9
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0x9f271
addl $-0x3, %eax
jmp 0x9f2a9
addl $-0x2, %eax
jmp 0x9f2a9
decl %eax
movl %eax, %esi
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x8(%rsp), %rdi
xorl %edx, %edx
callq 0x62f0
movq 0x8(%rsp), %rdi
movl 0x10(%rsp), %esi
movl %ebp, %edx
callq 0x20b57
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x28(%rsp), %rdi
callq 0x60b0
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x9f2fb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x28(%rsp), %rcx
cmpq %r12, %rcx
je 0x9f31a
movq %rcx, (%rbx)
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0x9f322
movups (%r12), %xmm0
movups %xmm0, (%rax)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rbx)
movq %r12, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
movb $0x0, 0x38(%rsp)
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x9f355
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9f3bd
jmp 0x9f3bd
jmp 0x9f3bd
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x9f3c0
movq 0x18(%rsp), %rsi
jmp 0x9f3b1
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x9f3a2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x9f3a2
jmp 0x9f3bd
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x9f3c0
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x9f3c0
jmp 0x9f3bd
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x9f3d7
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0
nop