// File: /workspace/github_cpp_makefile_star2_O1/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 0x9ff48
movq %rdx, %r14
movl $0x4, %r8d
leaq 0x20fd9(%rip), %rdx     # 0xc0e20
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq (%rsi), %rax
movq %rbx, %rdi
movq %r14, %rdx
callq *0xb0(%rax)
jmp 0xa01b2
movq %rbx, %rdi
movq %r14, %rdx
callq 0x96f94
jmp 0xa01b2
movl 0x8(%r14), %edx
movq (%rsi), %rax
movq %rbx, %rdi
movl $0x1, %ecx
callq *0x38(%rax)
jmp 0xa01b2
xorl %eax, %eax
cmpl $0x10, 0x10(%r14)
sete %al
leaq 0x24097(%rip), %rdx     # 0xc3f33
leaq 0x23bb3(%rip), %rcx     # 0xc3a56
cmoveq %rdx, %rcx
leaq 0x4(,%rax,2), %r8
jmp 0x9ff98
movl $0x5, %r8d
leaq 0x23b9c(%rip), %rcx     # 0xc3a5d
jmp 0x9ff98
leaq 0x24061(%rip), %rcx     # 0xc3f2e
jmp 0x9ff98
xorl %eax, %eax
cmpl $0x10, 0x10(%r14)
sete %al
leaq 0x24051(%rip), %rdx     # 0xc3f34
leaq 0x18475(%rip), %rcx     # 0xb835f
cmoveq %rdx, %rcx
leaq 0x3(,%rax,2), %r8
jmp 0x9ff98
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x1889b(%rip), %rsi     # 0xb87a4
leaq 0x1889f(%rip), %rdx     # 0xb87af
movq %rbx, %rdi
callq 0x7c64
jmp 0xa01b2
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x18dd6(%rip), %rsi     # 0xb8d01
leaq 0x18dd3(%rip), %rdx     # 0xb8d05
movq %rbx, %rdi
callq 0x7c64
jmp 0xa01b2
leaq 0x18874(%rip), %rcx     # 0xb87ba
jmp 0x9ff98
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x23feb(%rip), %rsi     # 0xc3f41
leaq 0x23ff0(%rip), %rdx     # 0xc3f4d
movq %rbx, %rdi
callq 0x7c64
jmp 0xa01b2
leaq 0x18ac4(%rip), %rcx     # 0xb8a35
jmp 0x9ff98
movl $0x6, %r8d
leaq 0x23fba(%rip), %rcx     # 0xc3f3a
jmp 0x9ff98
movl $0x6, %r8d
leaq 0x1f0e3(%rip), %rcx     # 0xbf072
jmp 0x9ff98
leaq 0x18933(%rip), %rcx     # 0xb88cb
leaq 0x28(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x63f0
movl 0x18(%r14), %ebp
cmpl $0x2, %ebp
jb 0xa00c2
movl $0x1, %eax
cmpl $0xa, %ebp
jb 0xa0001
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %ebp, %edx
cmpl $0x63, %edx
jbe 0x9fffa
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0x9ffff
cmpl $0x2710, %edx           # imm = 0x2710
jb 0xa0001
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0x9ffc9
addl $-0x3, %eax
jmp 0xa0001
addl $-0x2, %eax
jmp 0xa0001
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 0x21251
leaq 0x1ad5b(%rip), %rsi     # 0xbad8d
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 0xa0061
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0xa0068
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 0xa00ab
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0xa00c2
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6260
movl 0x14(%r14), %ebp
cmpl $0x2, %ebp
jb 0xa016f
movl $0x1, %eax
cmpl $0xa, %ebp
jb 0xa011d
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %ebp, %edx
cmpl $0x63, %edx
jbe 0xa0116
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0xa011b
cmpl $0x2710, %edx           # imm = 0x2710
jb 0xa011d
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0xa00e5
addl $-0x3, %eax
jmp 0xa011d
addl $-0x2, %eax
jmp 0xa011d
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 0x21251
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x28(%rsp), %rdi
callq 0x60b0
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xa016f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x28(%rsp), %rcx
cmpq %r12, %rcx
je 0xa018e
movq %rcx, (%rbx)
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0xa0196
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 0xa01c9
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 0xa0231
jmp 0xa0231
jmp 0xa0231
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xa0234
movq 0x18(%rsp), %rsi
jmp 0xa0225
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xa0216
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0xa0216
jmp 0xa0231
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0xa0234
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0xa0234
jmp 0xa0231
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0xa024b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0
nop