// File: /workspace/github_cpp_makefile_star2_O3/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 0x5ec74(%rip), %al      # 0xfd660
testb %al, %al
je 0x9eb85
movb 0x5eca6(%rip), %al      # 0xfd6a0
testb %al, %al
je 0x9ece1
movq 0x20(%rbx), %rbp
movq %rbx, 0x10(%rsp)
movq 0x28(%rbx), %r12
cmpq %r12, %rbp
je 0x9eb0d
leaq 0x5ec09(%rip), %r14     # 0xfd628
leaq 0x240ad(%rip), %r15     # 0xc2ad3
movl 0x8(%rbp), %eax
cmpl $0x1, %eax
je 0x9ea5f
cmpl $0x4, %eax
je 0x9ea51
cmpl $0x2, %eax
jne 0x9eb00
movq (%rbp), %rax
testq %rax, %rax
je 0x9ead3
movl 0x8(%rax), %eax
jmp 0x9ead5
movq (%rbp), %rax
testq %rax, %rax
je 0x9ea6d
movl 0x8(%rax), %eax
jmp 0x9ea6f
movq (%rbp), %rax
testq %rax, %rax
je 0x9ea88
movl 0x8(%rax), %eax
jmp 0x9ea8a
xorl %eax, %eax
imulq $0x148, %rax, %r13      # imm = 0x148
movq 0x10(%rsp), %rax
addq 0x38(%rax), %r13
leaq 0x5ebe2(%rip), %rdi     # 0xfd668
jmp 0x9eae8
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 0x9eb00
movq %r14, %rdi
movq %r13, %rsi
callq 0x5beae
testq %rax, %rax
je 0x9eaca
movq %r13, %rdi
movq %r15, %rsi
callq 0x64e0
addq $0xd0, %r13
jmp 0x9eaaa
xorl %eax, %eax
imulq $0x148, %rax, %r13      # imm = 0x148
movq 0x10(%rsp), %rax
addq 0x38(%rax), %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x5beae
testq %rax, %rax
je 0x9eb00
movq %r13, %rdi
movq %r15, %rsi
callq 0x64e0
addq $0x10, %rbp
cmpq %r12, %rbp
jne 0x9ea26
movq 0x10(%rsp), %rbx
movq 0xe0(%rbx), %r13
testq %r13, %r13
je 0x9eb6b
leaq 0x5eb43(%rip), %r14     # 0xfd668
leaq 0x23fa7(%rip), %r15     # 0xc2ad3
leaq 0x18(%r13), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x5beae
testq %rax, %rax
je 0x9eb4b
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 0x9eb2c
movq %rbx, %rdi
callq 0x2e338
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5ead4(%rip), %r14     # 0xfd660
movq %r14, %rdi
callq 0x64c0
testl %eax, %eax
je 0x9e9f4
movq %rbx, %rbp
leaq 0x28(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x2425a(%rip), %rsi     # 0xc2e09
leaq 0x24259(%rip), %rdx     # 0xc2e0f
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x7be0
leaq 0x38(%rsp), %r12
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x24680(%rip), %rsi     # 0xc3258
leaq 0x2467f(%rip), %rdx     # 0xc325e
movq %r12, %rdi
callq 0x7be0
leaq 0x58(%rsp), %r12
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x24204(%rip), %rsi     # 0xc2e00
leaq 0x24205(%rip), %rdx     # 0xc2e08
movq %r12, %rdi
callq 0x7be0
leaq 0x78(%rsp), %r12
leaq 0x88(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x242bd(%rip), %rsi     # 0xc2ee0
leaq 0x242bd(%rip), %rdx     # 0xc2ee7
movq %r12, %rdi
callq 0x7be0
leaq 0x98(%rsp), %r12
leaq 0xa8(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x1f2db(%rip), %rsi     # 0xbdf28
leaq 0x1f2d8(%rip), %rdx     # 0xbdf2c
movq %r12, %rdi
callq 0x7be0
leaq 0xb8(%rsp), %r15
leaq 0xd(%rsp), %rax
movq %rax, (%rsp)
leaq 0x5e9b4(%rip), %rdi     # 0xfd628
leaq 0x18(%rsp), %rsi
leaq 0xf(%rsp), %r8
leaq 0xe(%rsp), %r9
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x5bdae
movq $-0xa0, %rbx
movq -0x10(%r13), %rdi
cmpq %rdi, %r13
je 0x9eca9
movq (%r13), %rsi
incq %rsi
callq 0x6260
addq $-0x20, %r13
addq $0x20, %rbx
jne 0x9ec94
leaq -0x4c69c(%rip), %rdi    # 0x5261e
leaq 0x5e967(%rip), %rsi     # 0xfd628
leaq 0x5e5c8(%rip), %rdx     # 0xfd290
callq 0x6240
leaq 0x5e98c(%rip), %rdi     # 0xfd660
callq 0x61a0
movq %rbp, %rbx
jmp 0x9e9f4
leaq 0x5e9b8(%rip), %r14     # 0xfd6a0
movq %r14, %rdi
callq 0x64c0
testl %eax, %eax
je 0x9ea02
movq %rbx, %r13
leaq 0x28(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1edd2(%rip), %rsi     # 0xbdadd
leaq 0x1edcf(%rip), %rdx     # 0xbdae1
leaq 0x18(%rsp), %rdi
callq 0x7be0
leaq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x241b6(%rip), %rsi     # 0xc2ee8
leaq 0x241b7(%rip), %rdx     # 0xc2ef0
callq 0x7be0
leaq 0x58(%rsp), %r15
leaq 0xd(%rsp), %rax
movq %rax, (%rsp)
leaq 0x5e915(%rip), %rdi     # 0xfd668
leaq 0x18(%rsp), %rsi
leaq 0xf(%rsp), %r8
leaq 0xe(%rsp), %r9
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x5bdae
movq $-0x40, %rbx
movq -0x10(%r12), %rdi
cmpq %rdi, %r12
je 0x9ed89
movq (%r12), %rsi
incq %rsi
callq 0x6260
addq $-0x20, %r12
addq $0x20, %rbx
jne 0x9ed73
leaq -0x4c77c(%rip), %rdi    # 0x5261e
leaq 0x5e8c7(%rip), %rsi     # 0xfd668
leaq 0x5e4e8(%rip), %rdx     # 0xfd290
callq 0x6240
leaq 0x5e8ec(%rip), %rdi     # 0xfd6a0
callq 0x61a0
movq %r13, %rbx
jmp 0x9ea02
movq %rax, %rbx
leaq 0x18(%rsp), %rsi
movq %r15, %rdi
callq 0x6ebc
jmp 0x9ee3c
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x9ee3c
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x9ee3c
jmp 0x9ee39
movq %rax, %rbx
leaq 0x18(%rsp), %rsi
movq %r15, %rdi
callq 0x6e82
jmp 0x9ee3c
jmp 0x9ee09
jmp 0x9ee09
jmp 0x9ee09
movq %rax, %rbx
addq $-0x10, %r12
movq -0x10(%r12), %rdi
cmpq %rdi, %r12
je 0x9ee26
movq (%r12), %rsi
incq %rsi
callq 0x6260
leaq -0x20(%r12), %rax
addq $-0x10, %r12
cmpq %r15, %r12
movq %rax, %r12
jne 0x9ee10
jmp 0x9ee3c
movq %rax, %rbx
movq %r14, %rdi
callq 0x6190
movq %rbx, %rdi
callq 0x64a0