// File: /workspace/github_cpp_makefile_star2_O3/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 0x64ed2
cmpl $0x5, %edx
je 0x64f03
cmpl $0x6, %edx
je 0x64fd5
cmpl $0x10, %edx
jne 0x64fc8
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x56c68(%rip), %rsi     # 0xbbb2e
leaq 0x56c73(%rip), %rdx     # 0xbbb40
jmp 0x65001
cmpl $0x18, %edx
je 0x64f1d
cmpl $0x24, %edx
je 0x64fec
cmpl $0x29, %edx
jne 0x64fc8
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x56c4a(%rip), %rsi     # 0xbbb41
leaq 0x56c55(%rip), %rdx     # 0xbbb53
jmp 0x65001
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x540bc(%rip), %rsi     # 0xb8fcd
leaq 0x540c0(%rip), %rdx     # 0xb8fd8
jmp 0x65001
movl 0x7c8(%r14), %esi
testl %esi, %esi
je 0x65017
movq %r14, %rdi
callq 0xb3ca
movl 0xc(%rax), %esi
movq %r14, %rdi
callq 0xa3ea
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 0x14b5c
leaq 0x59046(%rip), %rdx     # 0xbdfb7
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movq %rax, %rcx
callq 0x75cc0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x25974
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x64fab
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x65009
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x65009
movq %rbx, %rdi
movq %r14, %rsi
callq 0x402b0
jmp 0x65009
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x54050(%rip), %rsi     # 0xb9033
leaq 0x54056(%rip), %rdx     # 0xb9040
jmp 0x65001
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x56b5a(%rip), %rsi     # 0xbbb54
leaq 0x56b65(%rip), %rdx     # 0xbbb66
movq %rbx, %rdi
callq 0x7be0
movq %rbx, %rax
addq $0x48, %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 0x56a85(%rip), %rsi     # 0xbbab9
leaq 0x56af2(%rip), %rdx     # 0xbbb2d
leaq 0x8(%rsp), %rdi
callq 0x7be0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x6320
leaq 0x96d6c(%rip), %rax     # 0xfbdc8
addq $0x10, %rax
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0x96d44(%rip), %rsi     # 0xfbdb0
movq 0x97f65(%rip), %rdx     # 0xfcfd8
movq %rbx, %rdi
callq 0x6470
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x65095
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
testb %bpl, %bpl
jne 0x6509f
jmp 0x650e7
movq %rax, %r14
movq %rbx, %rdi
callq 0x6200
jmp 0x650e7
movq %rax, %r14
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x650cc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x650cc
movq %rax, %r14
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x650e7
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
movq %r14, %rdi
callq 0x64a0
nop