// File: /workspace/github_cpp_makefile_star2_O3/rossy[P]crossc/SPIRV-Cross/spirv_msl.cpp
// Function: spirv_cross::CompilerMSL::sampler_type[abi:cxx11](spirv_cross::SPIRType const&)
std::string CompilerMSL::sampler_type(const SPIRType &type)
{
	if (!type.array.empty())
	{
		if (!msl_options.supports_msl_version(2))
			SPIRV_CROSS_THROW("MSL 2.0 or greater is required for arrays of samplers.");

		if (type.array.size() > 1)
			SPIRV_CROSS_THROW("Arrays of arrays of samplers are not supported in MSL.");

		// Arrays of samplers in MSL must be declared with a special array<T, N> syntax ala C++11 std::array.
		uint32_t array_size =
		    type.array_size_literal.back() ? type.array.back() : get<SPIRConstant>(type.array.back()).scalar();
		if (array_size == 0)
			SPIRV_CROSS_THROW("Unsized array of samplers is not supported in MSL.");

		auto &parent = get<SPIRType>(get_non_pointer_type(type).parent_type);
		return join("array<", sampler_type(parent), ", ", array_size, ">");
	}
	else
		return "sampler";
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x20(%rdx), %rcx
movq 0x28(%rdx), %rax
cmpq %rax, %rcx
je 0x9647f
movq %rsi, %r14
cmpl $0x4e1f, 0x7d0(%rsi)    # imm = 0x4E1F
jbe 0x964aa
movq %rdx, %r15
movq %rax, %rdx
subq %rcx, %rdx
cmpq $0x5, %rdx
jae 0x9650f
movl 0x50(%r15), %ecx
leaq -0x1(%rcx), %rdx
addq $0x3e, %rcx
testq %rdx, %rdx
cmovnsq %rdx, %rcx
sarq $0x6, %rcx
shlq $0x3, %rcx
addq 0x48(%r15), %rcx
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
leaq 0x3f(%rsi), %rdi
andq %rdx, %rdi
xorl %r8d, %r8d
cmpq %rsi, %rdi
setbe %r8b
movq -0x8(%rcx,%r8,8), %rcx
addq $-0x4, %rax
btq %rdx, %rcx
jb 0x96405
movl (%rax), %esi
movq %r14, %rdi
callq 0x1c036
addq $0x10, %rax
movl (%rax), %eax
movl %eax, 0x24(%rsp)
testl %eax, %eax
je 0x96571
movq %r14, %rdi
movq %r15, %rsi
callq 0x14ac0
movl 0x9c(%rax), %esi
movq %r14, %rdi
callq 0xa3ea
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x9636a
leaq 0x1e180(%rip), %rsi     # 0xb45c4
leaq 0x23c60(%rip), %rcx     # 0xba0ab
leaq 0x1ddaa(%rip), %r9      # 0xb41fc
leaq 0x24(%rsp), %r8
movq %rbx, %rdi
movq %r15, %rdx
callq 0xa6951
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9649c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x9649c
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x27633(%rip), %rsi     # 0xbdac0
leaq 0x27633(%rip), %rdx     # 0xbdac7
movq %rbx, %rdi
callq 0x7be0
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x6140
movq %rax, %r14
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x2ca57(%rip), %rsi     # 0xc2f1e
leaq 0x2ca86(%rip), %rdx     # 0xc2f54
movq %rsp, %rdi
callq 0x7be0
movb $0x1, %bpl
movq %rsp, %rsi
movq %r14, %rdi
callq 0x6320
leaq 0x658dd(%rip), %rax     # 0xfbdc8
addq $0x10, %rax
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x658b5(%rip), %rsi     # 0xfbdb0
movq 0x66ad6(%rip), %rdx     # 0xfcfd8
movq %r14, %rdi
callq 0x6470
jmp 0x965d1
movl $0x10, %edi
callq 0x6140
movq %rax, %r14
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x2ca29(%rip), %rsi     # 0xc2f55
leaq 0x2ca58(%rip), %rdx     # 0xc2f8b
movq %rsp, %rdi
callq 0x7be0
movb $0x1, %bpl
movq %rsp, %rsi
movq %r14, %rdi
callq 0x6320
leaq 0x65878(%rip), %rax     # 0xfbdc8
addq $0x10, %rax
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x65850(%rip), %rsi     # 0xfbdb0
movq 0x66a71(%rip), %rdx     # 0xfcfd8
movq %r14, %rdi
callq 0x6470
jmp 0x965d1
movl $0x10, %edi
callq 0x6140
movq %rax, %r14
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x2c9fe(%rip), %rsi     # 0xc2f8c
leaq 0x2ca29(%rip), %rdx     # 0xc2fbe
movq %rsp, %rdi
callq 0x7be0
movb $0x1, %bpl
movq %rsp, %rsi
movq %r14, %rdi
callq 0x6320
leaq 0x65816(%rip), %rax     # 0xfbdc8
addq $0x10, %rax
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x657ee(%rip), %rsi     # 0xfbdb0
movq 0x66a0f(%rip), %rdx     # 0xfcfd8
movq %r14, %rdi
callq 0x6470
jmp 0x965d9
jmp 0x965f9
jmp 0x965d9
jmp 0x965f9
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x965f2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
testb %bpl, %bpl
jne 0x965fc
jmp 0x96604
movq %rax, %rbx
movq %r14, %rdi
callq 0x6200
movq %rbx, %rdi
callq 0x64a0
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x96604
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x96604