// File: /workspace/github_cpp_makefile_star2_O3/rossy[P]crossc/SPIRV-Cross/spirv_cpp.cpp
// Function: spirv_cross::CompilerCPP::emit_uniform(spirv_cross::SPIRVariable const&)
void CompilerCPP::emit_uniform(const SPIRVariable &var)
{
	add_resource_name(var.self);

	auto &type = get<SPIRType>(var.basetype);
	auto instance_name = to_name(var.self);

	uint32_t descriptor_set = ir.meta[var.self].decoration.set;
	uint32_t binding = ir.meta[var.self].decoration.binding;
	uint32_t location = ir.meta[var.self].decoration.location;

	string type_name = type_to_glsl(type);
	remap_variable_type_name(type, instance_name, type_name);

	if (type.basetype == SPIRType::Image || type.basetype == SPIRType::SampledImage ||
	    type.basetype == SPIRType::AtomicCounter)
	{
		statement("internal::Resource<", type_name, type_to_array_glsl(type), "> ", instance_name, "__;");
		statement_no_indent("#define ", instance_name, " __res->", instance_name, "__.get()");
		resource_registrations.push_back(
		    join("s.register_resource(", instance_name, "__", ", ", descriptor_set, ", ", binding, ");"));
	}
	else
	{
		statement("internal::UniformConstant<", type_name, type_to_array_glsl(type), "> ", instance_name, "__;");
		statement_no_indent("#define ", instance_name, " __res->", instance_name, "__.get()");
		resource_registrations.push_back(
		    join("s.register_uniform_constant(", instance_name, "__", ", ", location, ");"));
	}

	statement("");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movl 0x8(%rsi), %esi
callq 0x281be
movl 0xc(%r15), %esi
movq %rbx, %rdi
callq 0xa3ea
movq %rax, %r14
movl 0x8(%r15), %edx
movq (%rbx), %rax
leaq 0x48(%rsp), %rdi
movq %rbx, %rsi
movl $0x1, %ecx
callq *0x38(%rax)
movl 0x8(%r15), %eax
movq 0x38(%rbx), %rcx
imulq $0x148, %rax, %rax      # imm = 0x148
movl 0xac(%rcx,%rax), %edx
movl %edx, 0x44(%rsp)
movl 0xb0(%rcx,%rax), %edx
movl %edx, 0x40(%rsp)
movl 0xa4(%rcx,%rax), %eax
movl %eax, 0x3c(%rsp)
movq (%rbx), %rax
leaq 0x68(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq *0x98(%rax)
cmpq $0x0, 0x218(%rbx)
je 0x89d5
leaq 0x208(%rbx), %rdi
leaq 0x48(%rsp), %rdx
leaq 0x68(%rsp), %rcx
movq %r14, %rsi
callq *0x220(%rbx)
movl 0xc(%r14), %eax
cmpl $0xe, %eax
ja 0x8adf
movl $0x6100, %ecx           # imm = 0x6100
btl %eax, %ecx
jae 0x8adf
leaq 0x18(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2b55a
leaq 0xab7e1(%rip), %rax     # 0xb41e8
movq %rax, (%rsp)
leaq 0xab7bf(%rip), %rsi     # 0xb41d1
leaq 0xab7cc(%rip), %r8      # 0xb41e5
leaq 0x68(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x48(%rsp), %r9
movq %rbx, %rdi
callq 0xa41e
leaq 0x28(%rsp), %r14
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0x8a4b
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x6260
movl 0x638(%rbx), %ebp
movl $0x0, 0x638(%rbx)
leaq 0xab78a(%rip), %rsi     # 0xb41ec
leaq 0xab78c(%rip), %rcx     # 0xb41f5
leaq 0xab78e(%rip), %r9      # 0xb41fe
leaq 0x48(%rsp), %rdx
movq %rbx, %rdi
movq %rdx, %r8
callq 0xe6d6
movl %ebp, 0x638(%rbx)
leaq 0xb6063(%rip), %rax     # 0xbeaf0
movq %rax, 0x10(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0xb1608(%rip), %r8      # 0xba0ab
movq %r8, (%rsp)
leaq 0xab759(%rip), %rsi     # 0xb4207
leaq 0xab767(%rip), %rcx     # 0xb421c
leaq 0x18(%rsp), %rdi
leaq 0x48(%rsp), %rdx
leaq 0x44(%rsp), %r9
callq 0xa5f6
leaq 0x788(%rbx), %rdi
leaq 0x18(%rsp), %rsi
callq 0xebc2
jmp 0x8bba
leaq 0x18(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2b55a
leaq 0xab6f2(%rip), %rax     # 0xb41e8
movq %rax, (%rsp)
leaq 0xab759(%rip), %rsi     # 0xb425a
leaq 0xab6dd(%rip), %r8      # 0xb41e5
leaq 0x68(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x48(%rsp), %r9
movq %rbx, %rdi
callq 0xab44
leaq 0x28(%rsp), %r14
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0x8b3a
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x6260
movl 0x638(%rbx), %ebp
movl $0x0, 0x638(%rbx)
leaq 0xab69b(%rip), %rsi     # 0xb41ec
leaq 0xab69d(%rip), %rcx     # 0xb41f5
leaq 0xab69f(%rip), %r9      # 0xb41fe
leaq 0x48(%rsp), %rdx
movq %rbx, %rdi
movq %rdx, %r8
callq 0xe6d6
movl %ebp, 0x638(%rbx)
leaq 0xb5f74(%rip), %rax     # 0xbeaf0
movq %rax, (%rsp)
leaq 0xab6ee(%rip), %rsi     # 0xb4275
leaq 0xab68e(%rip), %rcx     # 0xb421c
leaq 0xb1516(%rip), %r8      # 0xba0ab
leaq 0x18(%rsp), %rdi
leaq 0x48(%rsp), %rdx
leaq 0x3c(%rsp), %r9
callq 0xad1c
leaq 0x788(%rbx), %rdi
leaq 0x18(%rsp), %rsi
callq 0xebc2
movq 0x18(%rsp), %rdi
cmpq %r14, %rdi
je 0x8bd1
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0xabcd7(%rip), %rsi     # 0xb48af
movq %rbx, %rdi
callq 0xa6c4
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8bfb
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8c16
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6260
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8c2c
jmp 0x8c64
jmp 0x8c3d
jmp 0x8c64
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %r14, %rdi
jne 0x8c4e
jmp 0x8c67
jmp 0x8c64
movq %rax, %rbx
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8c67
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x8c67
jmp 0x8c64
movq %rax, %rbx
jmp 0x8c82
movq %rax, %rbx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8c82
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8c9d
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0
nop