// File: /workspace/github_cpp_makefile_star2_O2/rossy[P]crossc/SPIRV-Cross/spirv_hlsl.cpp
// Function: spirv_cross::CompilerHLSL::emit_specialization_constants()
void CompilerHLSL::emit_specialization_constants()
{
	bool emitted = false;
	SpecializationConstant wg_x, wg_y, wg_z;
	uint32_t workgroup_size_id = get_work_group_size_specialization_constants(wg_x, wg_y, wg_z);

	for (auto &id : ir.ids)
	{
		if (id.get_type() == TypeConstant)
		{
			auto &c = id.get<SPIRConstant>();
			if (!c.specialization)
				continue;
			if (c.self == workgroup_size_id)
				continue;

			auto &type = get<SPIRType>(c.constant_type);
			auto name = to_name(c.self);

			statement("static const ", variable_decl(type, name), " = ", constant_expression(c), ";");
			emitted = true;
		}
		else if (id.get_type() == TypeConstantOp)
		{
			auto &c = id.get<SPIRConstantOp>();
			auto &type = get<SPIRType>(c.basetype);
			auto name = to_name(c.self);
			statement("static const ", variable_decl(type, name), " = ", constant_op_expression(c), ";");
		}
	}

	if (workgroup_size_id)
	{
		statement("static const uint3 gl_WorkGroupSize = ", constant_expression(get<SPIRConstant>(workgroup_size_id)),
		          ";");
		emitted = true;
	}

	if (emitted)
		statement("");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
leaq 0x90(%rsp), %rsi
leaq 0x88(%rsp), %rdx
leaq 0x80(%rsp), %rcx
callq 0x12fd6
movl %eax, 0xc(%rsp)
movq 0x20(%rbx), %r14
movq 0x28(%rbx), %r13
movl $0x0, 0x10(%rsp)
leaq 0x40(%rsp), %r15
movq %r13, 0x38(%rsp)
cmpq %r13, %r14
je 0x52677
movl 0x8(%r14), %eax
cmpl $0xa, %eax
je 0x525cc
cmpl $0x3, %eax
jne 0x5266e
movq %r14, %rdi
callq 0x172b0
cmpb $0x1, 0x108(%rax)
jne 0x5266e
movq %rax, %rbp
movl 0xc(%rsp), %eax
cmpl %eax, 0x8(%rbp)
je 0x5266e
movl 0xc(%rbp), %esi
movq %rbx, %rdi
callq 0x90a4
movq %rax, 0x10(%rsp)
movl 0x8(%rbp), %edx
movq (%rbx), %rax
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
pushq $0x1
popq %rcx
callq *0x38(%rax)
movq (%rbx), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq 0x10(%rsp), %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq *0xc8(%rax)
leaq 0x60(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x271d4
movq %rbx, %rdi
leaq 0x4456e(%rip), %rsi     # 0x96af7
leaq 0x40(%rsp), %r15
movq %r15, %rdx
leaq 0x47452(%rip), %rcx     # 0x999ea
movq %r12, %r8
leaq 0x474df(%rip), %r9      # 0x99a81
callq 0x5f54a
movq %r12, %rdi
callq 0x6548
movq %r15, %rdi
callq 0x6548
leaq 0x18(%rsp), %rdi
callq 0x6548
movb $0x1, %al
movl %eax, 0x10(%rsp)
jmp 0x5266e
movq %r14, %rdi
callq 0x20ad0
movq %rax, %rbp
movl 0x28(%rax), %esi
movq %rbx, %rdi
callq 0x90a4
movq %rax, %r13
movl 0x8(%rbp), %edx
movq (%rbx), %rax
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
pushq $0x1
popq %rcx
callq *0x38(%rax)
movq (%rbx), %rax
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq *0xc8(%rax)
leaq 0x60(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x265a8
movq %rbx, %rdi
leaq 0x444c6(%rip), %rsi     # 0x96af7
leaq 0x40(%rsp), %r15
movq %r15, %rdx
leaq 0x473aa(%rip), %rcx     # 0x999ea
movq %r12, %r8
leaq 0x47437(%rip), %r9      # 0x99a81
callq 0x5f54a
movq 0x38(%rsp), %r13
movq %r12, %rdi
callq 0x6548
movq %r15, %rdi
callq 0x6548
leaq 0x18(%rsp), %rdi
callq 0x6548
addq $0x10, %r14
jmp 0x524e7
movl 0xc(%rsp), %esi
testl %esi, %esi
je 0x526bf
movq %rbx, %rdi
callq 0x17bce
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x271d4
leaq 0x44464(%rip), %rsi     # 0x96b05
leaq 0x473d9(%rip), %rcx     # 0x99a81
movq %rbx, %rdi
movq %r14, %rdx
callq 0x5f640
leaq 0x18(%rsp), %rdi
callq 0x6548
jmp 0x526c6
testb $0x1, 0x10(%rsp)
je 0x526d5
leaq 0x3d1ba(%rip), %rsi     # 0x8f887
movq %rbx, %rdi
callq 0x928e
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x526ef
jmp 0x526f4
jmp 0x52703
jmp 0x526ef
movq %rax, %rbx
jmp 0x52710
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x6548
jmp 0x52706
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x6548
leaq 0x18(%rsp), %rdi
callq 0x6548
movq %rbx, %rdi
callq 0x64b0