// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movl 0x8(%rsi), %esi
callq 0x22d1a
movl 0xc(%r15), %esi
movq %rbx, %rdi
callq 0x90a4
movq %rax, %r14
movl 0x8(%r15), %edx
movq (%rbx), %rax
leaq 0x50(%rsp), %rdi
pushq $0x1
popq %rcx
movq %rbx, %rsi
callq *0x38(%rax)
movl 0x8(%r15), %eax
movq 0x38(%rbx), %rcx
imulq $0x148, %rax, %rax      # imm = 0x148
movl 0xac(%rcx,%rax), %edx
movl %edx, 0x4c(%rsp)
movl 0xb0(%rcx,%rax), %edx
movl %edx, 0x48(%rsp)
movl 0xa4(%rcx,%rax), %eax
movl %eax, 0x44(%rsp)
movq (%rbx), %rax
leaq 0x70(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq *0x98(%rax)
leaq 0x50(%rsp), %rdx
leaq 0x70(%rsp), %rcx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9626
movl 0xc(%r14), %eax
cmpl $0xe, %eax
ja 0x7d0e
movl $0x6100, %ecx           # imm = 0x6100
btl %eax, %ecx
jae 0x7d0e
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2547c
leaq 0x87563(%rip), %rax     # 0x8f1c0
movq %rax, (%rsp)
leaq 0x87541(%rip), %rsi     # 0x8f1a9
leaq 0x8754e(%rip), %r8      # 0x8f1bd
leaq 0x70(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x50(%rsp), %r9
movq %rbx, %rdi
callq 0x90ba
leaq 0x20(%rsp), %rdi
callq 0x6548
leaq 0x8752d(%rip), %rsi     # 0x8f1c4
leaq 0x8752f(%rip), %rcx     # 0x8f1cd
leaq 0x87531(%rip), %r9      # 0x8f1d6
leaq 0x50(%rsp), %rdx
movq %rbx, %rdi
movq %rdx, %r8
callq 0x91c4
leaq 0x91dc4(%rip), %rax     # 0x99a80
movq %rax, 0x10(%rsp)
leaq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x8d3b9(%rip), %r8      # 0x9508b
movq %r8, (%rsp)
leaq 0x87502(%rip), %rsi     # 0x8f1df
leaq 0x87510(%rip), %rcx     # 0x8f1f4
leaq 0x20(%rsp), %rdi
leaq 0x50(%rsp), %rdx
leaq 0x4c(%rsp), %r9
callq 0x91e9
leaq 0x788(%rbx), %rdi
leaq 0x20(%rsp), %rsi
callq 0xcc8c
jmp 0x7dc2
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2547c
leaq 0x8749b(%rip), %rax     # 0x8f1c0
movq %rax, (%rsp)
leaq 0x87502(%rip), %rsi     # 0x8f232
leaq 0x87486(%rip), %r8      # 0x8f1bd
leaq 0x70(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x50(%rsp), %r9
movq %rbx, %rdi
callq 0x963e
leaq 0x20(%rsp), %rdi
callq 0x6548
leaq 0x87465(%rip), %rsi     # 0x8f1c4
leaq 0x87467(%rip), %rcx     # 0x8f1cd
leaq 0x87469(%rip), %r9      # 0x8f1d6
leaq 0x50(%rsp), %rdx
movq %rbx, %rdi
movq %rdx, %r8
callq 0x91c4
leaq 0x91cfc(%rip), %rax     # 0x99a80
movq %rax, (%rsp)
leaq 0x874be(%rip), %rsi     # 0x8f24d
leaq 0x8745e(%rip), %rcx     # 0x8f1f4
leaq 0x8d2ee(%rip), %r8      # 0x9508b
leaq 0x20(%rsp), %rdi
leaq 0x50(%rsp), %rdx
leaq 0x44(%rsp), %r9
callq 0x9748
leaq 0x788(%rbx), %rdi
leaq 0x20(%rsp), %rsi
callq 0xcc8c
leaq 0x20(%rsp), %rdi
callq 0x6548
leaq 0x87ab4(%rip), %rsi     # 0x8f887
movq %rbx, %rdi
callq 0x928e
leaq 0x70(%rsp), %rdi
callq 0x6548
leaq 0x50(%rsp), %rdi
callq 0x6548
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x7e08
jmp 0x7e1e
jmp 0x7e08
jmp 0x7e1e
jmp 0x7e08
jmp 0x7e1e
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x6548
jmp 0x7e21
jmp 0x7e1e
movq %rax, %rbx
jmp 0x7e2b
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x6548
leaq 0x50(%rsp), %rdi
callq 0x6548
movq %rbx, %rdi
callq 0x64b0
nop