// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_msl.cpp
// Function: spirv_cross::CompilerMSL::replace_illegal_names()
void CompilerMSL::replace_illegal_names()
{
	// FIXME: MSL and GLSL are doing two different things here.
	// Agree on convention and remove this override.
	static const unordered_set<string> keywords = {
		"kernel", "vertex", "fragment", "compute", "bias",
	};

	static const unordered_set<string> illegal_func_names = {
		"main",
		"saturate",
	};

	for (auto &id : ir.ids)
	{
		switch (id.get_type())
		{
		case TypeVariable:
		{
			auto &dec = ir.meta[id.get_id()].decoration;
			if (keywords.find(dec.alias) != end(keywords))
				dec.alias += "0";

			break;
		}

		case TypeFunction:
		{
			auto &dec = ir.meta[id.get_id()].decoration;
			if (illegal_func_names.find(dec.alias) != end(illegal_func_names))
				dec.alias += "0";

			break;
		}

		case TypeType:
		{
			for (auto &mbr_dec : ir.meta[id.get_id()].members)
				if (keywords.find(mbr_dec.alias) != end(keywords))
					mbr_dec.alias += "0";

			break;
		}

		default:
			break;
		}
	}

	for (auto &entry : ir.entry_points)
	{
		// Change both the entry point name and the alias, to keep them synced.
		string &ep_name = entry.second.name;
		if (illegal_func_names.find(ep_name) != end(illegal_func_names))
			ep_name += "0";

		// Always write this because entry point might have been renamed earlier.
		ir.meta[entry.first].decoration.alias = ep_name;
	}

	CompilerGLSL::replace_illegal_names();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdi, %rbx
movb 0x5ee4a(%rip), %al      # 0xfe660
testb %al, %al
je 0x9f9af
movb 0x5ee7c(%rip), %al      # 0xfe6a0
testb %al, %al
je 0x9fb0b
movq 0x20(%rbx), %rbp
movq %rbx, 0x10(%rsp)
movq 0x28(%rbx), %r12
cmpq %r12, %rbp
je 0x9f937
leaq 0x5eddf(%rip), %r14     # 0xfe628
leaq 0x242b3(%rip), %r15     # 0xc3b03
movl 0x8(%rbp), %eax
cmpl $0x1, %eax
je 0x9f889
cmpl $0x4, %eax
je 0x9f87b
cmpl $0x2, %eax
jne 0x9f92a
movq (%rbp), %rax
testq %rax, %rax
je 0x9f8fd
movl 0x8(%rax), %eax
jmp 0x9f8ff
movq (%rbp), %rax
testq %rax, %rax
je 0x9f897
movl 0x8(%rax), %eax
jmp 0x9f899
movq (%rbp), %rax
testq %rax, %rax
je 0x9f8b2
movl 0x8(%rax), %eax
jmp 0x9f8b4
xorl %eax, %eax
imulq $0x148, %rax, %r13      # imm = 0x148
movq 0x10(%rsp), %rax
addq 0x38(%rax), %r13
leaq 0x5edb8(%rip), %rdi     # 0xfe668
jmp 0x9f912
xorl %eax, %eax
movq 0x10(%rsp), %rcx
movq 0x38(%rcx), %rcx
imulq $0x148, %rax, %rax      # imm = 0x148
movq 0xd0(%rcx,%rax), %r13
movq 0xd8(%rcx,%rax), %rbx
cmpq %rbx, %r13
je 0x9f92a
movq %r14, %rdi
movq %r13, %rsi
callq 0x5c6da
testq %rax, %rax
je 0x9f8f4
movq %r13, %rdi
movq %r15, %rsi
callq 0x64e0
addq $0xd0, %r13
jmp 0x9f8d4
xorl %eax, %eax
imulq $0x148, %rax, %r13      # imm = 0x148
movq 0x10(%rsp), %rax
addq 0x38(%rax), %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x5c6da
testq %rax, %rax
je 0x9f92a
movq %r13, %rdi
movq %r15, %rsi
callq 0x64e0
addq $0x10, %rbp
cmpq %r12, %rbp
jne 0x9f850
movq 0x10(%rsp), %rbx
movq 0xe0(%rbx), %r13
testq %r13, %r13
je 0x9f995
leaq 0x5ed19(%rip), %r14     # 0xfe668
leaq 0x241ad(%rip), %r15     # 0xc3b03
leaq 0x18(%r13), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x5c6da
testq %rax, %rax
je 0x9f975
movq %r12, %rdi
movq %r15, %rsi
callq 0x64e0
movl 0x8(%r13), %eax
imulq $0x148, %rax, %rdi      # imm = 0x148
addq 0x38(%rbx), %rdi
movq %r12, %rsi
callq 0x6170
movq (%r13), %r13
testq %r13, %r13
jne 0x9f956
movq %rbx, %rdi
callq 0x2e9c8
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5ecaa(%rip), %r14     # 0xfe660
movq %r14, %rdi
callq 0x64c0
testl %eax, %eax
je 0x9f81e
movq %rbx, %r12
leaq 0x28(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x24460(%rip), %rsi     # 0xc3e39
leaq 0x2445f(%rip), %rdx     # 0xc3e3f
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x7c64
leaq 0x38(%rsp), %r15
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x24886(%rip), %rsi     # 0xc4288
leaq 0x24885(%rip), %rdx     # 0xc428e
movq %r15, %rdi
callq 0x7c64
leaq 0x58(%rsp), %r15
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x2440a(%rip), %rsi     # 0xc3e30
leaq 0x2440b(%rip), %rdx     # 0xc3e38
movq %r15, %rdi
callq 0x7c64
leaq 0x78(%rsp), %r15
leaq 0x88(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x244c3(%rip), %rsi     # 0xc3f10
leaq 0x244c3(%rip), %rdx     # 0xc3f17
movq %r15, %rdi
callq 0x7c64
leaq 0x98(%rsp), %r15
leaq 0xa8(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x1f4a9(%rip), %rsi     # 0xbef20
leaq 0x1f4a6(%rip), %rdx     # 0xbef24
movq %r15, %rdi
callq 0x7c64
leaq 0xb8(%rsp), %r13
leaq 0xd(%rsp), %rax
movq %rax, (%rsp)
leaq 0x5eb8a(%rip), %rdi     # 0xfe628
leaq 0x18(%rsp), %rsi
leaq 0xf(%rsp), %r8
leaq 0xe(%rsp), %r9
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x5c5da
movq $-0xa0, %rbx
movq -0x10(%rbp), %rdi
cmpq %rdi, %rbp
je 0x9fad3
movq (%rbp), %rsi
incq %rsi
callq 0x6260
addq $-0x20, %rbp
addq $0x20, %rbx
jne 0x9fabe
leaq -0x4ccce(%rip), %rdi    # 0x52e16
leaq 0x5eb3d(%rip), %rsi     # 0xfe628
leaq 0x5e79e(%rip), %rdx     # 0xfe290
callq 0x6240
leaq 0x5eb62(%rip), %rdi     # 0xfe660
callq 0x61a0
movq %r12, %rbx
jmp 0x9f81e
leaq 0x5eb8e(%rip), %r14     # 0xfe6a0
movq %r14, %rdi
callq 0x64c0
testl %eax, %eax
je 0x9f82c
movq %rbx, %r12
leaq 0x28(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1efa0(%rip), %rsi     # 0xbead5
leaq 0x1ef9d(%rip), %rdx     # 0xbead9
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x7c64
leaq 0x38(%rsp), %r15
leaq 0x48(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x243ba(%rip), %rsi     # 0xc3f18
leaq 0x243bb(%rip), %rdx     # 0xc3f20
movq %r15, %rdi
callq 0x7c64
leaq 0x58(%rsp), %r13
leaq 0xd(%rsp), %rax
movq %rax, (%rsp)
leaq 0x5eae6(%rip), %rdi     # 0xfe668
leaq 0x18(%rsp), %rsi
leaq 0xf(%rsp), %r8
leaq 0xe(%rsp), %r9
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x5c5da
movq $-0x40, %rbx
movq -0x10(%rbp), %rdi
cmpq %rdi, %rbp
je 0x9fbb7
movq (%rbp), %rsi
incq %rsi
callq 0x6260
addq $-0x20, %rbp
addq $0x20, %rbx
jne 0x9fba2
leaq -0x4cdb2(%rip), %rdi    # 0x52e16
leaq 0x5ea99(%rip), %rsi     # 0xfe668
leaq 0x5e6ba(%rip), %rdx     # 0xfe290
callq 0x6240
leaq 0x5eabe(%rip), %rdi     # 0xfe6a0
callq 0x61a0
movq %r12, %rbx
jmp 0x9f82c
movq %rax, %rbp
leaq 0x18(%rsp), %rsi
movq %r13, %rdi
callq 0x6f16
movb $0x1, %al
jmp 0x9fc12
movq %rax, %rbp
xorl %eax, %eax
jmp 0x9fc12
movq %rax, %rbp
xorl %eax, %eax
movq %rbx, %r15
cmpq %r15, %rbx
sete %cl
orb %al, %cl
jne 0x9fca5
addq $-0x10, %r15
leaq 0x18(%rsp), %r12
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x9fc3d
movq (%r15), %rsi
incq %rsi
callq 0x6260
leaq -0x20(%r15), %rax
addq $-0x10, %r15
cmpq %r12, %r15
movq %rax, %r15
jne 0x9fc29
jmp 0x9fca5
movq %rax, %rbp
leaq 0x18(%rsp), %rsi
movq %r13, %rdi
callq 0x6edc
movb $0x1, %al
jmp 0x9fc6e
jmp 0x9fc69
jmp 0x9fc69
jmp 0x9fc69
movq %rax, %rbp
xorl %eax, %eax
cmpq %r15, %rbx
sete %cl
orb %al, %cl
jne 0x9fca5
addq $-0x10, %r15
leaq 0x18(%rsp), %r12
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x9fc95
movq (%r15), %rsi
incq %rsi
callq 0x6260
leaq -0x20(%r15), %rax
addq $-0x10, %r15
cmpq %r12, %r15
movq %rax, %r15
jne 0x9fc81
movq %r14, %rdi
callq 0x6190
movq %rbp, %rdi
callq 0x64a0
movq %rax, %rbp
xorl %eax, %eax
movq %rbx, %r15
jmp 0x9fc6e
nop