// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_hlsl.cpp
// Function: spirv_cross::CompilerHLSL::builtin_to_glsl[abi:cxx11](spv::BuiltIn, spv::StorageClass)
std::string CompilerHLSL::builtin_to_glsl(spv::BuiltIn builtin, spv::StorageClass storage)
{
	switch (builtin)
	{
	case BuiltInVertexId:
		return "gl_VertexID";
	case BuiltInInstanceId:
		return "gl_InstanceID";
	case BuiltInNumWorkgroups:
	{
		if (!num_workgroups_builtin)
			SPIRV_CROSS_THROW("NumWorkgroups builtin is used, but remap_num_workgroups_builtin() was not called. "
			                  "Cannot emit code for this builtin.");

		auto &var = get<SPIRVariable>(num_workgroups_builtin);
		auto &type = get<SPIRType>(var.basetype);
		return sanitize_underscores(join(to_name(num_workgroups_builtin), "_", get_member_name(type.self, 0)));
	}
	case BuiltInPointCoord:
		// Crude hack, but there is no real alternative. This path is only enabled if point_coord_compat is set.
		return "float2(0.5f, 0.5f)";
	case BuiltInSubgroupLocalInvocationId:
		return "WaveGetLaneIndex()";
	case BuiltInSubgroupSize:
		return "WaveGetLaneCount()";

	default:
		return CompilerGLSL::builtin_to_glsl(builtin, storage);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x17, %edx
jg 0x657a6
cmpl $0x5, %edx
je 0x657d7
cmpl $0x6, %edx
je 0x658a9
cmpl $0x10, %edx
jne 0x6589c
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x5738c(%rip), %rsi     # 0xbcb26
leaq 0x57397(%rip), %rdx     # 0xbcb38
jmp 0x658d5
cmpl $0x18, %edx
je 0x657f1
cmpl $0x24, %edx
je 0x658c0
cmpl $0x29, %edx
jne 0x6589c
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x5736e(%rip), %rsi     # 0xbcb39
leaq 0x57379(%rip), %rdx     # 0xbcb4b
jmp 0x658d5
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x547f8(%rip), %rsi     # 0xb9fdd
leaq 0x547fc(%rip), %rdx     # 0xb9fe8
jmp 0x658d5
movl 0x7c8(%r14), %esi
testl %esi, %esi
je 0x658eb
movq %r14, %rdi
callq 0xb40a
movl 0xc(%rax), %esi
movq %r14, %rdi
callq 0xa426
movq %rax, %r15
movl 0x7c8(%r14), %edx
movq (%r14), %rax
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
movl $0x1, %ecx
callq *0x38(%rax)
movl 0x8(%r15), %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0x14cea
leaq 0x5976a(%rip), %rdx     # 0xbefaf
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movq %rax, %rcx
callq 0x767cc
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x26038
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6587f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x658dd
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x658dd
movq %rbx, %rdi
movq %r14, %rsi
callq 0x40af6
jmp 0x658dd
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x5478c(%rip), %rsi     # 0xba043
leaq 0x54792(%rip), %rdx     # 0xba050
jmp 0x658d5
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x5727e(%rip), %rsi     # 0xbcb4c
leaq 0x57289(%rip), %rdx     # 0xbcb5e
movq %rbx, %rdi
callq 0x7c64
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x6140
movq %rax, %r14
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x571a9(%rip), %rsi     # 0xbcab1
leaq 0x57216(%rip), %rdx     # 0xbcb25
leaq 0x8(%rsp), %rdi
callq 0x7c64
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x6320
leaq 0x97468(%rip), %rax     # 0xfcd98
addq $0x10, %rax
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x97440(%rip), %rsi     # 0xfcd80
movq 0x98691(%rip), %rdx     # 0xfdfd8
movq %r14, %rdi
callq 0x6470
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x65971
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x65971
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x659be
movq %r14, %rdi
callq 0x6200
jmp 0x659be
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x659a3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x659a3
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x659be
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0