// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_msl.cpp
// Function: spirv_cross::CompilerMSL::to_function_name[abi:cxx11](unsigned int, spirv_cross::SPIRType const&, bool, bool, bool, bool, bool, bool, bool, unsigned int)
string CompilerMSL::to_function_name(uint32_t img, const SPIRType &imgtype, bool is_fetch, bool is_gather, bool, bool,
                                     bool has_offset, bool, bool has_dref, uint32_t)
{
	// Special-case gather. We have to alter the component being looked up
	// in the swizzle case.
	if (msl_options.swizzle_texture_samples && is_gather)
	{
		string fname = imgtype.image.depth ? "spvGatherCompareSwizzle" : "spvGatherSwizzle";
		fname += "<" + type_to_glsl(get<SPIRType>(imgtype.image.type)) + ", metal::" + type_to_glsl(imgtype);
		// Add the arg types ourselves. Yes, this sucks, but Clang can't
		// deduce template pack parameters in the middle of an argument list.
		switch (imgtype.image.dim)
		{
		case Dim2D:
			fname += ", float2";
			if (imgtype.image.arrayed)
				fname += ", uint";
			if (imgtype.image.depth)
				fname += ", float";
			if (!imgtype.image.depth || has_offset)
				fname += ", int2";
			break;
		case DimCube:
			fname += ", float3";
			if (imgtype.image.arrayed)
				fname += ", uint";
			if (imgtype.image.depth)
				fname += ", float";
			break;
		default:
			SPIRV_CROSS_THROW("Invalid texture dimension for gather op.");
		}
		fname += ">";
		return fname;
	}

	auto *combined = maybe_get<SPIRCombinedImageSampler>(img);

	// Texture reference
	string fname = to_expression(combined ? combined->image : img) + ".";
	if (msl_options.swizzle_texture_samples && !is_gather && is_sampled_image_type(imgtype))
		fname = "spvTextureSwizzle(" + fname;

	// Texture function and sampler
	if (is_fetch)
		fname += "read";
	else if (is_gather)
		fname += "gather";
	else
		fname += "sample";

	if (has_dref)
		fname += "_compare";

	return fname;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %r9d, %r12d
movq %rcx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movb 0x7df(%rsi), %al
andb %r12b, %al
cmpb $0x1, %al
jne 0x97335
movb 0x88(%r14), %al
testb %al, %al
leaq 0x2c780(%rip), %rcx     # 0xc3a18
leaq 0x2c791(%rip), %rsi     # 0xc3a30
cmovneq %rcx, %rsi
leaq 0x10(%rsi), %rdx
leaq 0x17(%rsi), %rcx
testb %al, %al
cmovneq %rcx, %rdx
leaq 0x10(%rbx), %r12
movq %r12, (%rbx)
movq %rbx, %rdi
callq 0x7c64
movl 0x80(%r14), %esi
movq %r15, %rdi
callq 0xa426
movq (%r15), %r8
leaq 0x88(%rsp), %rdi
movq %r15, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq *0x98(%r8)
leaq 0x21e0d(%rip), %rcx     # 0xb90fd
leaq 0x88(%rsp), %rdi
movl $0x1, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x62c0
leaq 0x78(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x97470
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0x97478
movl %r8d, %ebp
movl %edx, %r13d
movq %r14, 0x60(%rsp)
movq %r15, %rdi
movl %edx, %esi
callq 0x7ad6c
testq %rax, %rax
je 0x97353
movl 0x10(%rax), %r13d
movq %rsp, %r14
movq %r14, %rdi
movq %r15, %rsi
movl %r13d, %edx
callq 0x345e6
leaq 0x244ee(%rip), %rsi     # 0xbb859
movq %r14, %rdi
callq 0x64e0
leaq 0x10(%rbx), %r13
movq %r13, (%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x97395
movq %rdx, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x9739d
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x10(%rsp), %r14
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0x973cf
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
movb 0x7df(%r15), %al
xorb $0x1, %al
orb %r12b, %al
jne 0x97423
movq %r15, %rdi
movq 0x60(%rsp), %rsi
callq 0x14caa
testb %al, %al
je 0x97423
leaq 0x2c6a7(%rip), %rsi     # 0xc3a9c
movq %rsp, %rdi
movq %rbx, %rdx
callq 0x7ada6
movq %rsp, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6310
movq (%r15), %rdi
cmpq %r14, %rdi
je 0x97423
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x2c685(%rip), %rax     # 0xc3aaf
leaq 0x21689(%rip), %rcx     # 0xb8aba
testb %r12b, %r12b
cmovneq %rax, %rcx
leaq 0x2cdf6(%rip), %rsi     # 0xc4235
testb %bpl, %bpl
cmoveq %rcx, %rsi
movq %rbx, %rdi
callq 0x64e0
cmpb $0x0, 0x100(%rsp)
je 0x976f9
leaq 0x2c653(%rip), %rsi     # 0xc3ab6
movq %rbx, %rdi
callq 0x64e0
jmp 0x976f9
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq 0x68(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x2c5a6(%rip), %rsi     # 0xc3a41
callq 0x64e0
leaq 0x30(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x974c7
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x974ce
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%r15), %rax
leaq 0x40(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq *0x98(%rax)
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0x48(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %rbp, %rcx
je 0x9751e
movq 0x30(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x9753d
leaq 0x50(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0x97538
movq 0x50(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x9754e
movq 0x40(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x60b0
jmp 0x9755c
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x62c0
leaq 0x10(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x9757f
movq %rsi, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x97585
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x60b0
leaq 0x10(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x975ce
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x975e9
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x20(%rsp), %rdi
cmpq %rbp, %rdi
je 0x97600
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x68(%rsp), %rdi
cmpq %r13, %rdi
je 0x97617
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x97638
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x6260
movl 0x84(%r14), %eax
cmpl $0x1, %eax
je 0x97688
cmpl $0x3, %eax
jne 0x9770e
leaq 0x2c416(%rip), %rsi     # 0xc3a6a
movq %rbx, %rdi
callq 0x64e0
cmpb $0x1, 0x89(%r14)
jne 0x97675
leaq 0x2c3e7(%rip), %rsi     # 0xc3a54
movq %rbx, %rdi
callq 0x64e0
cmpb $0x1, 0x88(%r14)
jne 0x976ea
leaq 0x2c3d5(%rip), %rsi     # 0xc3a5b
jmp 0x976e2
leaq 0x2c3bc(%rip), %rsi     # 0xc3a4b
movq %rbx, %rdi
callq 0x64e0
cmpb $0x1, 0x89(%r14)
jne 0x976b0
leaq 0x2c3ac(%rip), %rsi     # 0xc3a54
movq %rbx, %rdi
callq 0x64e0
cmpb $0x1, 0x88(%r14)
jne 0x976c9
leaq 0x2c39a(%rip), %rsi     # 0xc3a5b
movq %rbx, %rdi
callq 0x64e0
movb 0x88(%r14), %al
xorb $0x1, %al
orb 0xf0(%rsp), %al
je 0x976ea
leaq 0x2c381(%rip), %rsi     # 0xc3a63
movq %rbx, %rdi
callq 0x64e0
leaq 0x1db0b(%rip), %rsi     # 0xb51fc
movq %rbx, %rdi
callq 0x64e0
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x6140
movq %rax, %r13
movq %rsp, %rdi
movq %r15, (%rdi)
leaq 0x2c34b(%rip), %rsi     # 0xc3a73
leaq 0x2c36c(%rip), %rdx     # 0xc3a9b
callq 0x7c64
movb $0x1, %bpl
movq %rsp, %rsi
movq %r13, %rdi
callq 0x6320
leaq 0x6564f(%rip), %rax     # 0xfcd98
addq $0x10, %rax
movq %rax, (%r13)
xorl %ebp, %ebp
leaq 0x65626(%rip), %rsi     # 0xfcd80
movq 0x66877(%rip), %rdx     # 0xfdfd8
movq %r13, %rdi
callq 0x6470
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x9778a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x9778a
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x97871
movq %r13, %rdi
callq 0x6200
jmp 0x97871
jmp 0x9785b
movq %rax, %r14
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x977c8
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x977c8
movq %rax, %r14
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x977e8
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x977e8
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %rbp, %rdi
je 0x97804
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x97804
movq %rax, %r14
movq 0x68(%rsp), %rdi
cmpq %r13, %rdi
je 0x97820
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x97820
movq %rax, %r14
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x97871
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x97871
movq %rax, %r14
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x97885
movq 0x10(%rsp), %rsi
jmp 0x9787d
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0x97885
movq (%r13), %rsi
jmp 0x9787d
jmp 0x9786e
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r12, %rdi
je 0x97885
movq (%r12), %rsi
incq %rsi
callq 0x6260
movq %r14, %rdi
callq 0x64a0
nop