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

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

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

	case SPIRType::Sampler:
		return comparison_ids.count(id) ? "SamplerComparisonState" : "SamplerState";

	case SPIRType::Void:
		return "void";

	default:
		break;
	}

	if (type.vecsize == 1 && type.columns == 1) // Scalar builtin
	{
		switch (type.basetype)
		{
		case SPIRType::Boolean:
			return "bool";
		case SPIRType::Int:
			return backend.basic_int_type;
		case SPIRType::UInt:
			return backend.basic_uint_type;
		case SPIRType::AtomicCounter:
			return "atomic_uint";
		case SPIRType::Half:
			return "min16float";
		case SPIRType::Float:
			return "float";
		case SPIRType::Double:
			return "double";
		case SPIRType::Int64:
			return "int64_t";
		case SPIRType::UInt64:
			return "uint64_t";
		default:
			return "???";
		}
	}
	else if (type.vecsize > 1 && type.columns == 1) // Vector builtin
	{
		switch (type.basetype)
		{
		case SPIRType::Boolean:
			return join("bool", type.vecsize);
		case SPIRType::Int:
			return join("int", type.vecsize);
		case SPIRType::UInt:
			return join("uint", type.vecsize);
		case SPIRType::Half:
			return join("min16float", type.vecsize);
		case SPIRType::Float:
			return join("float", type.vecsize);
		case SPIRType::Double:
			return join("double", type.vecsize);
		case SPIRType::Int64:
			return join("i64vec", type.vecsize);
		case SPIRType::UInt64:
			return join("u64vec", type.vecsize);
		default:
			return "???";
		}
	}
	else
	{
		switch (type.basetype)
		{
		case SPIRType::Boolean:
			return join("bool", type.columns, "x", type.vecsize);
		case SPIRType::Int:
			return join("int", type.columns, "x", type.vecsize);
		case SPIRType::UInt:
			return join("uint", type.columns, "x", type.vecsize);
		case SPIRType::Half:
			return join("min16float", type.columns, "x", type.vecsize);
		case SPIRType::Float:
			return join("float", type.columns, "x", type.vecsize);
		case SPIRType::Double:
			return join("double", type.columns, "x", type.vecsize);
		// Matrix types not supported for int64/uint64.
		default:
			return "???";
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl %ecx, 0x4(%rsp)
movl 0xc(%rdx), %eax
cmpl $0xc, %eax
jle 0x63f91
leal -0xd(%rax), %edi
cmpl $0x2, %edi
jae 0x63ff5
movq %rbx, %rdi
callq 0x63f42
jmp 0x6405b
cmpl $0x1, %eax
je 0x6403e
cmpl $0xc, %eax
jne 0x64066
cmpb $0x1, 0x623(%rsi)
jne 0x640b2
movl 0x8(%rdx), %edx
movq (%rsi), %rax
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x1, %ecx
callq *0x38(%rax)
leaq 0x53a9a(%rip), %rsi     # 0xb7a67
movq %rbx, %rdi
movq %r14, %rdx
callq 0x58ad7
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6405b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x6405b
cmpl $0xf, %eax
jne 0x64066
addq $0x360, %rsi            # imm = 0x360
leaq 0x4(%rsp), %rax
movq %rsi, %rdi
movq %rax, %rsi
callq 0x1fbce
testq %rax, %rax
leaq 0x58a0c(%rip), %rcx     # 0xbca27
leaq 0x589ee(%rip), %rsi     # 0xbca10
cmoveq %rcx, %rsi
leaq 0x16(%rsi), %rdx
leaq 0xc(%rsi), %rcx
testq %rax, %rax
cmoveq %rcx, %rdx
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
jmp 0x64053
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x54cb5(%rip), %rsi     # 0xb8d01
leaq 0x54cb2(%rip), %rdx     # 0xb8d05
movq %rbx, %rdi
callq 0x7c64
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movl 0x14(%rdx), %ecx
movl 0x18(%rdx), %edi
movl %ecx, %r8d
xorl $0x1, %r8d
movl %edi, %r9d
xorl $0x1, %r9d
orl %r8d, %r9d
jne 0x640c5
addl $-0x2, %eax
cmpl $0x9, %eax
ja 0x64127
leaq 0x5803a(%rip), %rcx     # 0xbc0cc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x54711(%rip), %rsi     # 0xb87ba
leaq 0x5470e(%rip), %rdx     # 0xb87be
jmp 0x64053
movl 0x8(%rdx), %edx
movq (%rsi), %rax
movq %rbx, %rdi
movl $0x1, %ecx
callq *0x38(%rax)
jmp 0x6405b
leaq 0x14(%rdx), %r8
cmpl $0x1, %edi
sete %sil
cmpl $0x2, %ecx
setae %cl
andb %sil, %cl
addl $-0x2, %eax
cmpb $0x1, %cl
jne 0x64102
cmpl $0x9, %eax
ja 0x64127
leaq 0x57fb7(%rip), %rcx     # 0xbc0a4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x546bd(%rip), %rsi     # 0xb87ba
jmp 0x642db
cmpl $0x9, %eax
ja 0x64127
addq $0x18, %rdx
leaq 0x57f6a(%rip), %rcx     # 0xbc07c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x54698(%rip), %rsi     # 0xb87ba
jmp 0x64206
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x5777f(%rip), %rsi     # 0xbb8b4
leaq 0x5777b(%rip), %rdx     # 0xbb8b7
jmp 0x64053
movq 0x610(%rsi), %rsi
jmp 0x6416b
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x5464c(%rip), %rsi     # 0xb87a4
leaq 0x54650(%rip), %rdx     # 0xb87af
jmp 0x64053
movq 0x608(%rsi), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x6100
jmp 0x6405b
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x588a9(%rip), %rsi     # 0xbca34
leaq 0x588ac(%rip), %rdx     # 0xbca3e
jmp 0x64053
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x5f8b8(%rip), %rsi     # 0xc3a5d
leaq 0x5f8b6(%rip), %rdx     # 0xc3a62
jmp 0x64053
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x576ed(%rip), %rsi     # 0xbb8ac
leaq 0x576ed(%rip), %rdx     # 0xbb8b3
jmp 0x64053
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x576d2(%rip), %rsi     # 0xbb8ab
leaq 0x576d3(%rip), %rdx     # 0xbb8b3
jmp 0x64053
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x5ae7f(%rip), %rsi     # 0xbf072
leaq 0x5ae7e(%rip), %rdx     # 0xbf078
jmp 0x64053
leaq 0x5f850(%rip), %rsi     # 0xc3a56
leaq 0x56b80(%rip), %rcx     # 0xbad8d
movq %rbx, %rdi
callq 0x58d07
jmp 0x6405b
leaq 0x5ae51(%rip), %rsi     # 0xbf072
leaq 0x56b65(%rip), %rcx     # 0xbad8d
movq %rbx, %rdi
callq 0x58da5
jmp 0x6405b
leaq 0x54123(%rip), %rsi     # 0xb835f
leaq 0x56b4a(%rip), %rcx     # 0xbad8d
movq %rbx, %rdi
callq 0x58e43
jmp 0x6405b
leaq 0x587dd(%rip), %rsi     # 0xbca34
leaq 0x56b2f(%rip), %rcx     # 0xbad8d
movq %rbx, %rdi
callq 0x75fc4
jmp 0x6405b
leaq 0x5f7eb(%rip), %rsi     # 0xc3a5d
leaq 0x56b14(%rip), %rcx     # 0xbad8d
movq %rbx, %rdi
callq 0x76062
jmp 0x6405b
leaq 0x587a7(%rip), %rsi     # 0xbca34
movq %rbx, %rdi
movq %r8, %rdx
callq 0x75eac
jmp 0x6405b
leaq 0x540bb(%rip), %rsi     # 0xb835f
movq %rbx, %rdi
movq %r8, %rdx
callq 0x58c7b
jmp 0x6405b
leaq 0x5f7a2(%rip), %rsi     # 0xc3a5d
movq %rbx, %rdi
movq %r8, %rdx
callq 0x75f38
jmp 0x6405b
leaq 0x5ada0(%rip), %rsi     # 0xbf072
jmp 0x642fb
leaq 0x5f77b(%rip), %rsi     # 0xc3a56
movq %rbx, %rdi
movq %r8, %rdx
callq 0x58b63
jmp 0x6405b
leaq 0x575e1(%rip), %rsi     # 0xbb8d3
jmp 0x642fb
leaq 0x575df(%rip), %rsi     # 0xbb8da
movq %rbx, %rdi
movq %r8, %rdx
callq 0x58bef
jmp 0x6405b
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x64329
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0
nop