// File: /workspace/github_cpp_makefile_star2_O2/rossy[P]crossc/SPIRV-Cross/spirv_hlsl.cpp
// Function: spirv_cross::CompilerHLSL::emit_modern_uniform(spirv_cross::SPIRVariable const&)
void CompilerHLSL::emit_modern_uniform(const SPIRVariable &var)
{
	auto &type = get<SPIRType>(var.basetype);
	switch (type.basetype)
	{
	case SPIRType::SampledImage:
	case SPIRType::Image:
	{
		bool is_coherent = false;
		if (type.basetype == SPIRType::Image && type.image.sampled == 2)
			is_coherent = has_decoration(var.self, DecorationCoherent);

		statement(is_coherent ? "globallycoherent " : "", image_type_hlsl_modern(type, var.self), " ",
		          to_name(var.self), type_to_array_glsl(type), to_resource_binding(var), ";");

		if (type.basetype == SPIRType::SampledImage && type.image.dim != DimBuffer)
		{
			// For combined image samplers, also emit a combined image sampler.
			if (image_is_comparison(type, var.self))
				statement("SamplerComparisonState ", to_sampler_expression(var.self), type_to_array_glsl(type),
				          to_resource_binding_sampler(var), ";");
			else
				statement("SamplerState ", to_sampler_expression(var.self), type_to_array_glsl(type),
				          to_resource_binding_sampler(var), ";");
		}
		break;
	}

	case SPIRType::Sampler:
		if (comparison_ids.count(var.self))
			statement("SamplerComparisonState ", to_name(var.self), type_to_array_glsl(type), to_resource_binding(var),
			          ";");
		else
			statement("SamplerState ", to_name(var.self), type_to_array_glsl(type), to_resource_binding(var), ";");
		break;

	default:
		statement(variable_decl(var), to_resource_binding(var), ";");
		break;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0xc(%rsi), %esi
callq 0x90a4
movq %rax, %r15
movl 0xc(%rax), %eax
leal -0xd(%rax), %ecx
cmpl $0x2, %ecx
jae 0x57c42
leaq 0x37d9c(%rip), %rcx     # 0x8f887
cmpl $0xd, %eax
jne 0x57b1d
cmpl $0x2, 0x8c(%r15)
jne 0x57b1d
movl 0x8(%r14), %esi
pushq $0x17
popq %rdx
movq %rbx, %rdi
callq 0x103d2
leaq 0x40de5(%rip), %rdx     # 0x988f5
leaq 0x37d70(%rip), %rcx     # 0x8f887
testb %al, %al
cmovneq %rdx, %rcx
movq %rcx, 0x60(%rsp)
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x500e4
movl 0x8(%r14), %edx
movq (%rbx), %rax
movq %rsp, %rdi
pushq $0x1
popq %rcx
movq %rbx, %rsi
callq *0x38(%rax)
leaq 0x40(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2547c
leaq 0x68(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x54cfa
leaq 0x41f12(%rip), %rax     # 0x99a81
leaq 0x37d10(%rip), %rcx     # 0x8f886
leaq 0x60(%rsp), %rsi
leaq 0x20(%rsp), %rdx
movq %rsp, %r8
leaq 0x40(%rsp), %r9
movq %rbx, %rdi
pushq %rax
pushq %r12
callq 0x629a4
popq %rax
popq %rcx
leaq 0x68(%rsp), %rdi
callq 0x6548
leaq 0x40(%rsp), %rdi
callq 0x6548
movq %rsp, %rdi
callq 0x6548
leaq 0x20(%rsp), %rdi
callq 0x6548
cmpl $0xe, 0xc(%r15)
jne 0x57dbe
cmpl $0x5, 0x84(%r15)
je 0x57dbe
movl 0x8(%r14), %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x16cd4
testb %al, %al
je 0x57cf8
movl 0x8(%r14), %edx
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x552f6
movq %rsp, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2547c
leaq 0x40(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x57a3c
leaq 0x40e5b(%rip), %rsi     # 0x98a7c
leaq 0x41e59(%rip), %r9      # 0x99a81
leaq 0x20(%rsp), %rdx
movq %rsp, %rcx
leaq 0x40(%rsp), %r8
movq %rbx, %rdi
callq 0x62ac0
jmp 0x57da2
cmpl $0xf, %eax
jne 0x57cbe
leaq 0x360(%rbx), %rdi
leaq 0x8(%r14), %r12
movq %r12, %rsi
callq 0x1aeea
testq %rax, %rax
je 0x57d4c
movl (%r12), %edx
movq (%rbx), %rax
leaq 0x20(%rsp), %rdi
pushq $0x1
popq %rcx
movq %rbx, %rsi
callq *0x38(%rax)
movq %rsp, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2547c
leaq 0x40(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x54cfa
leaq 0x40ddf(%rip), %rsi     # 0x98a7c
leaq 0x41ddd(%rip), %r9      # 0x99a81
leaq 0x20(%rsp), %rdx
movq %rsp, %rcx
leaq 0x40(%rsp), %r8
movq %rbx, %rdi
callq 0x62ac0
jmp 0x57da2
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2619e
movq %rsp, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x54cfa
leaq 0x41d9e(%rip), %rcx     # 0x99a81
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x422f6
jmp 0x57dac
movl 0x8(%r14), %edx
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x552f6
movq %rsp, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2547c
leaq 0x40(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x57a3c
leaq 0x40d66(%rip), %rsi     # 0x98a94
leaq 0x41d4c(%rip), %r9      # 0x99a81
leaq 0x20(%rsp), %rdx
movq %rsp, %rcx
leaq 0x40(%rsp), %r8
movq %rbx, %rdi
callq 0x62bb6
jmp 0x57da2
movl (%r12), %edx
movq (%rbx), %rax
leaq 0x20(%rsp), %rdi
pushq $0x1
popq %rcx
movq %rbx, %rsi
callq *0x38(%rax)
movq %rsp, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2547c
leaq 0x40(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x54cfa
leaq 0x40d0e(%rip), %rsi     # 0x98a94
leaq 0x41cf4(%rip), %r9      # 0x99a81
leaq 0x20(%rsp), %rdx
movq %rsp, %rcx
leaq 0x40(%rsp), %r8
movq %rbx, %rdi
callq 0x62bb6
leaq 0x40(%rsp), %rdi
callq 0x6548
movq %rsp, %rdi
callq 0x6548
leaq 0x20(%rsp), %rdi
callq 0x6548
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x6548
jmp 0x57ddf
movq %rax, %rbx
jmp 0x57e28
jmp 0x57e32
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x6548
jmp 0x57e04
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x6548
jmp 0x57e09
movq %rax, %rbx
jmp 0x57e28
movq %rax, %rbx
jmp 0x57e28
jmp 0x57e32
jmp 0x57e32
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x6548
jmp 0x57e21
movq %rax, %rbx
jmp 0x57e28
jmp 0x57e32
movq %rax, %rbx
movq %rsp, %rdi
callq 0x6548
jmp 0x57e65
movq %rax, %rbx
jmp 0x57e65
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x6548
jmp 0x57e49
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x6548
jmp 0x57e58
movq %rax, %rbx
movq %rsp, %rdi
callq 0x6548
jmp 0x57e65
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x6548
movq %rbx, %rdi
callq 0x64b0
nop