// File: /workspace/github_cpp_makefile_star2_O2/rossy[P]crossc/SPIRV-Cross/spirv_msl.cpp
// Function: spirv_cross::CompilerMSL::builtin_qualifier[abi:cxx11](spv::BuiltIn)
string CompilerMSL::builtin_qualifier(BuiltIn builtin)
{
	auto &execution = get_entry_point();

	switch (builtin)
	{
	// Vertex function in
	case BuiltInVertexId:
		return "vertex_id";
	case BuiltInVertexIndex:
		return "vertex_id";
	case BuiltInBaseVertex:
		return "base_vertex";
	case BuiltInInstanceId:
		return "instance_id";
	case BuiltInInstanceIndex:
		return "instance_id";
	case BuiltInBaseInstance:
		return "base_instance";
	case BuiltInDrawIndex:
		SPIRV_CROSS_THROW("DrawIndex is not supported in MSL.");

	// Vertex function out
	case BuiltInClipDistance:
		return "clip_distance";
	case BuiltInPointSize:
		return "point_size";
	case BuiltInPosition:
		return "position";
	case BuiltInLayer:
		return "render_target_array_index";
	case BuiltInViewportIndex:
		if (!msl_options.supports_msl_version(2, 0))
			SPIRV_CROSS_THROW("ViewportIndex requires Metal 2.0.");
		return "viewport_array_index";

	// Fragment function in
	case BuiltInFrontFacing:
		return "front_facing";
	case BuiltInPointCoord:
		return "point_coord";
	case BuiltInFragCoord:
		return "position";
	case BuiltInSampleId:
		return "sample_id";
	case BuiltInSampleMask:
		return "sample_mask";
	case BuiltInSamplePosition:
		// Shouldn't be reached.
		SPIRV_CROSS_THROW("Sample position is retrieved by a function in MSL.");

	// Fragment function out
	case BuiltInFragDepth:
		if (execution.flags.get(ExecutionModeDepthGreater))
			return "depth(greater)";
		else if (execution.flags.get(ExecutionModeDepthLess))
			return "depth(less)";
		else
			return "depth(any)";

	// Compute function in
	case BuiltInGlobalInvocationId:
		return "thread_position_in_grid";

	case BuiltInWorkgroupId:
		return "threadgroup_position_in_grid";

	case BuiltInNumWorkgroups:
		return "threadgroups_per_grid";

	case BuiltInLocalInvocationId:
		return "thread_position_in_threadgroup";

	case BuiltInLocalInvocationIndex:
		return "thread_index_in_threadgroup";

	default:
		return "unsupported-built-in";
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x12fa4
cmpl $0x2b, %ebp
ja 0x7bbd7
movl %ebp, %ecx
leaq 0x1f09e(%rip), %rdx     # 0x9ac60
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
leaq 0x22678(%rip), %rsi     # 0x9e24a
jmp 0x7bcee
cmpl $0x1148, %ebp           # imm = 0x1148
je 0x7bcd5
cmpl $0x1149, %ebp           # imm = 0x1149
je 0x7bccc
cmpl $0x114a, %ebp           # imm = 0x114A
je 0x7bda0
leaq 0x2278e(%rip), %rsi     # 0x9e390
jmp 0x7bcee
leaq 0x22609(%rip), %rsi     # 0x9e217
jmp 0x7bcee
leaq 0x225e7(%rip), %rsi     # 0x9e201
jmp 0x7bcee
cmpl $0x4e1f, 0x7d0(%r14) # imm = 0x4E1F
jbe 0x7bd07
leaq 0x22636(%rip), %rsi     # 0x9e26d
jmp 0x7bcee
leaq 0x225fc(%rip), %rsi     # 0x9e23f
jmp 0x7bcee
leaq 0x22640(%rip), %rsi     # 0x9e28f
jmp 0x7bcee
leaq 0x225d6(%rip), %rsi     # 0x9e231
jmp 0x7bcee
leaq 0x226bb(%rip), %rsi     # 0x9e322
jmp 0x7bcee
leaq 0x22697(%rip), %rsi     # 0x9e30a
jmp 0x7bcee
leaq 0x22606(%rip), %rsi     # 0x9e282
jmp 0x7bcee
leaq 0x225ce(%rip), %rsi     # 0x9e253
jmp 0x7bcee
leaq 0x2260d(%rip), %rsi     # 0x9e29b
jmp 0x7bcee
leaq 0x2260e(%rip), %rsi     # 0x9e2a5
jmp 0x7bcee
movq 0x60(%rax), %rax
btl $0xe, %eax
jb 0x7bcde
testw %ax, %ax
js 0x7bce7
leaq 0x22650(%rip), %rsi     # 0x9e2ff
jmp 0x7bcee
leaq 0x22687(%rip), %rsi     # 0x9e33f
jmp 0x7bcee
leaq 0x22694(%rip), %rsi     # 0x9e355
jmp 0x7bcee
leaq 0x226aa(%rip), %rsi     # 0x9e374
jmp 0x7bcee
leaq 0x22550(%rip), %rsi     # 0x9e223
jmp 0x7bcee
leaq 0x2252f(%rip), %rsi     # 0x9e20b
jmp 0x7bcee
leaq 0x225ff(%rip), %rsi     # 0x9e2e4
jmp 0x7bcee
leaq 0x22605(%rip), %rsi     # 0x9e2f3
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x6100
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x6140
movq %rax, %rbx
leaq 0x21fc2(%rip), %rsi     # 0x9dcdb
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x6100
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x6f6e
xorl %ebp, %ebp
leaq 0x6b07f(%rip), %rsi     # 0xe6dc0
movq 0x6c298(%rip), %rdx     # 0xe7fe0
movq %rbx, %rdi
callq 0x6490
jmp 0x7bde9
pushq $0x10
popq %rdi
callq 0x6140
movq %rax, %rbx
leaq 0x2254a(%rip), %rsi     # 0x9e2b1
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x6100
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x6f6e
xorl %ebp, %ebp
leaq 0x6b031(%rip), %rsi     # 0xe6dc0
movq 0x6c24a(%rip), %rdx     # 0xe7fe0
movq %rbx, %rdi
callq 0x6490
jmp 0x7bde9
pushq $0x10
popq %rdi
callq 0x6140
movq %rax, %rbx
leaq 0x21ef4(%rip), %rsi     # 0x9dca6
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x6100
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x6f6e
xorl %ebp, %ebp
leaq 0x6afe6(%rip), %rsi     # 0xe6dc0
movq 0x6c1ff(%rip), %rdx     # 0xe7fe0
movq %rbx, %rdi
callq 0x6490
jmp 0x7bdf1
jmp 0x7be05
jmp 0x7bdf1
jmp 0x7be05
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x6548
testb %bpl, %bpl
jne 0x7be08
jmp 0x7be10
movq %rax, %r14
movq %rbx, %rdi
callq 0x6200
movq %r14, %rdi
callq 0x64b0