// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x15f76
cmpl $0x1147, %ebp           # imm = 0x1147
jg 0x9dceb
cmpl $0x2b, %ebp
ja 0x9df11
movl %ebp, %ecx
leaq 0x22008(%rip), %rdx     # 0xbfcd0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x255b3(%rip), %rsi     # 0xc3292
leaq 0x255b4(%rip), %rdx     # 0xc329a
jmp 0x9df36
cmpl $0x1148, %ebp           # imm = 0x1148
je 0x9ded7
cmpl $0x1149, %ebp           # imm = 0x1149
jne 0x9df05
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x2555a(%rip), %rsi     # 0xc326b
leaq 0x25560(%rip), %rdx     # 0xc3278
jmp 0x9df36
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x25534(%rip), %rsi     # 0xc325f
leaq 0x25538(%rip), %rdx     # 0xc326a
jmp 0x9df36
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x25504(%rip), %rsi     # 0xc3249
leaq 0x25506(%rip), %rdx     # 0xc3252
jmp 0x9df36
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x2560b(%rip), %rsi     # 0xc336a
leaq 0x25620(%rip), %rdx     # 0xc3386
jmp 0x9df36
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x2555e(%rip), %rsi     # 0xc32d7
leaq 0x25562(%rip), %rdx     # 0xc32e2
jmp 0x9df36
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x254f4(%rip), %rsi     # 0xc3287
leaq 0x254f7(%rip), %rdx     # 0xc3291
jmp 0x9df36
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x25536(%rip), %rsi     # 0xc32e3
leaq 0x25538(%rip), %rdx     # 0xc32ec
jmp 0x9df36
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x255d6(%rip), %rsi     # 0xc339d
leaq 0x255ed(%rip), %rdx     # 0xc33bb
jmp 0x9df36
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x25571(%rip), %rsi     # 0xc3352
leaq 0x25581(%rip), %rdx     # 0xc3369
jmp 0x9df36
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x2547e(%rip), %rsi     # 0xc3279
leaq 0x25484(%rip), %rdx     # 0xc3286
jmp 0x9df36
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x254b5(%rip), %rsi     # 0xc32ca
leaq 0x254ba(%rip), %rdx     # 0xc32d6
jmp 0x9df36
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x2546c(%rip), %rsi     # 0xc329b
leaq 0x2547e(%rip), %rdx     # 0xc32b4
jmp 0x9df36
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x254a4(%rip), %rsi     # 0xc32ed
leaq 0x254a8(%rip), %rdx     # 0xc32f8
jmp 0x9df36
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x25524(%rip), %rsi     # 0xc3387
leaq 0x25532(%rip), %rdx     # 0xc339c
jmp 0x9df36
cmpl $0x4e1f, 0x7d0(%r14) # imm = 0x4E1F
jbe 0x9df4c
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x25427(%rip), %rsi     # 0xc32b5
leaq 0x25434(%rip), %rdx     # 0xc32c9
jmp 0x9df36
movq 0x60(%rax), %rax
btl $0xe, %eax
jb 0x9deee
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
testw %ax, %ax
js 0x9df28
leaq 0x25490(%rip), %rsi     # 0xc3347
leaq 0x25493(%rip), %rdx     # 0xc3351
jmp 0x9df36
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x254ee(%rip), %rsi     # 0xc33bc
leaq 0x25502(%rip), %rdx     # 0xc33d7
jmp 0x9df36
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x2536e(%rip), %rsi     # 0xc3253
leaq 0x25372(%rip), %rdx     # 0xc325e
jmp 0x9df36
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x25430(%rip), %rsi     # 0xc332c
leaq 0x25437(%rip), %rdx     # 0xc333a
jmp 0x9df36
cmpl $0x114a, %ebp           # imm = 0x114A
je 0x9dfb5
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x254b9(%rip), %rsi     # 0xc33d8
leaq 0x254c6(%rip), %rdx     # 0xc33ec
jmp 0x9df36
leaq 0x2540c(%rip), %rsi     # 0xc333b
leaq 0x25410(%rip), %rdx     # 0xc3346
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, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x24dba(%rip), %rsi     # 0xc2d23
leaq 0x24dd4(%rip), %rdx     # 0xc2d44
leaq 0x8(%rsp), %rdi
callq 0x7be0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x6320
leaq 0x5de37(%rip), %rax     # 0xfbdc8
addq $0x10, %rax
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0x5de0f(%rip), %rsi     # 0xfbdb0
movq 0x5f030(%rip), %rdx     # 0xfcfd8
movq %rbx, %rdi
callq 0x6470
jmp 0x9e07f
movl $0x10, %edi
callq 0x6140
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x24d1c(%rip), %rsi     # 0xc2cee
leaq 0x24d37(%rip), %rdx     # 0xc2d10
leaq 0x8(%rsp), %rdi
callq 0x7be0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x6320
leaq 0x5ddce(%rip), %rax     # 0xfbdc8
addq $0x10, %rax
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0x5dda6(%rip), %rsi     # 0xfbdb0
movq 0x5efc7(%rip), %rdx     # 0xfcfd8
movq %rbx, %rdi
callq 0x6470
jmp 0x9e07f
movl $0x10, %edi
callq 0x6140
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x252c1(%rip), %rsi     # 0xc32f9
leaq 0x252ec(%rip), %rdx     # 0xc332b
leaq 0x8(%rsp), %rdi
callq 0x7be0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x6320
leaq 0x5dd68(%rip), %rax     # 0xfbdc8
addq $0x10, %rax
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0x5dd40(%rip), %rsi     # 0xfbdb0
movq 0x5ef61(%rip), %rdx     # 0xfcfd8
movq %rbx, %rdi
callq 0x6470
jmp 0x9e087
jmp 0x9e0a8
jmp 0x9e087
jmp 0x9e0a8
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x9e0a1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
testb %bpl, %bpl
jne 0x9e0ab
jmp 0x9e0b3
movq %rax, %r14
movq %rbx, %rdi
callq 0x6200
movq %r14, %rdi
callq 0x64a0
nop