// File: /workspace/github_cpp_makefile_star2_O2/rossy[P]crossc/SPIRV-Cross/spirv_hlsl.cpp
// Function: spirv_cross::CompilerHLSL::emit_io_block(spirv_cross::SPIRVariable const&)
void CompilerHLSL::emit_io_block(const SPIRVariable &var)
{
	auto &type = get<SPIRType>(var.basetype);
	add_resource_name(type.self);

	statement("struct ", to_name(type.self));
	begin_scope();
	type.member_name_cache.clear();

	uint32_t base_location = get_decoration(var.self, DecorationLocation);

	for (uint32_t i = 0; i < uint32_t(type.member_types.size()); i++)
	{
		string semantic;
		if (has_member_decoration(type.self, i, DecorationLocation))
		{
			uint32_t location = get_member_decoration(type.self, i, DecorationLocation);
			semantic = join(" : ", to_semantic(location));
		}
		else
		{
			// If the block itself has a location, but not its members, use the implicit location.
			// There could be a conflict if the block members partially specialize the locations.
			// It is unclear how SPIR-V deals with this. Assume this does not happen for now.
			uint32_t location = base_location + i;
			semantic = join(" : ", to_semantic(location));
		}

		add_member_name(type, i);

		auto &membertype = get<SPIRType>(type.member_types[i]);
		statement(to_interpolation_qualifiers(get_member_decoration_bitset(type.self, i)),
		          variable_decl(membertype, to_member_name(type, i)), semantic, ";");
	}

	end_scope_decl();
	statement("");

	statement("static ", variable_decl(var), ";");
	statement("");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %r12
movq %rdi, %rbx
movl 0xc(%rsi), %esi
callq 0x90a4
movq %rax, %r15
movl 0x8(%rax), %esi
movq %rbx, %rdi
callq 0x22d1a
movl 0x8(%r15), %edx
movq (%rbx), %rax
leaq 0x18(%rsp), %r14
pushq $0x1
popq %rcx
movq %r14, %rdi
movq %rbx, %rsi
callq *0x38(%rax)
leaq 0x40239(%rip), %rsi     # 0x91a37
movq %rbx, %rdi
movq %r14, %rdx
callq 0x5f02c
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x6548
movq %rbx, %rdi
callq 0x22d28
movq %r15, 0x8(%rsp)
addq $0xa0, %r15
movq %r15, %rdi
callq 0xb854
movq %r12, 0x38(%rsp)
movl 0x8(%r12), %esi
movq %r14, %r15
pushq $0x1e
popq %rdx
movq %rbx, %rdi
callq 0x12174
movl %eax, %eax
movq %rax, 0x40(%rsp)
xorl %r13d, %r13d
leaq 0x48(%rsp), %r14
leaq 0x68(%rsp), %rbp
leaq 0x88(%rsp), %r12
movq 0x8(%rsp), %rcx
movq 0x70(%rcx), %rax
subq 0x68(%rcx), %rax
shrq $0x2, %rax
movl %eax, %eax
cmpq %rax, %r13
jae 0x519fd
leaq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
andq $0x0, 0x20(%rsp)
movb $0x0, 0x28(%rsp)
movl 0x8(%rcx), %esi
movq %rbx, %rdi
movl %r13d, %edx
pushq $0x1e
popq %rcx
callq 0x117ba
movq %r13, 0x10(%rsp)
testb %al, %al
je 0x518ea
movq 0x8(%rsp), %rax
movl 0x8(%rax), %esi
movq %rbx, %rdi
movq 0x10(%rsp), %rdx
pushq $0x1e
popq %rcx
callq 0x12036
movq %r14, %rdi
movq %rbx, %rsi
movl %eax, %edx
callq 0x5175a
movq %rbp, %rdi
leaq 0x3da62(%rip), %rsi     # 0x8f342
movq %r14, %rdx
callq 0x46816
jmp 0x51914
movq 0x40(%rsp), %rax
movq 0x10(%rsp), %rcx
leal (%rax,%rcx), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5175a
movq %rbp, %rdi
leaq 0x3da36(%rip), %rsi     # 0x8f342
movq %r14, %rdx
callq 0x46816
movq %r15, %rdi
movq %rbp, %rsi
callq 0x6320
movq %rbp, %rdi
callq 0x6548
movq %r14, %rdi
callq 0x6548
movq %rbx, %rdi
movq %rbx, %r13
movq 0x8(%rsp), %rbx
movq %rbx, %rsi
movq 0x10(%rsp), %r15
movl %r15d, %edx
callq 0x22d40
movq 0x68(%rbx), %rax
movl (%rax,%r15,4), %esi
movq %r13, %rdi
callq 0x90a4
movq %rax, %rbp
movl 0x8(%rbx), %esi
movq %r13, %rdi
movl %r15d, %edx
callq 0x12050
movq %r13, %rbx
movq (%r13), %rcx
leaq 0x68(%rsp), %rdi
movq %r13, %rsi
movq %rax, %rdx
callq *0x140(%rcx)
movq %r12, %rdi
movq %rbx, %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %r13
movl %r13d, %ecx
callq 0x25cca
movq (%rbx), %rax
movq %r14, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq *0xc8(%rax)
movq %rbx, %rdi
leaq 0x68(%rsp), %rbp
movq %rbp, %rsi
movq %r14, %rdx
leaq 0x18(%rsp), %r15
movq %r15, %rcx
leaq 0x480b1(%rip), %r8      # 0x99a81
callq 0x5f0f2
movq %r14, %rdi
callq 0x6548
movq %r12, %rdi
callq 0x6548
movq %rbp, %rdi
callq 0x6548
movq %r15, %rdi
callq 0x6548
incq %r13
jmp 0x51866
movq %rbx, %rdi
callq 0x22dba
leaq 0x3de7b(%rip), %rsi     # 0x8f887
movq %rbx, %rdi
callq 0x928e
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq 0x38(%rsp), %rdx
callq 0x2619e
leaq 0x44fa7(%rip), %rsi     # 0x969d7
leaq 0x4804a(%rip), %rcx     # 0x99a81
movq %rbx, %rdi
movq %r14, %rdx
callq 0x474ea
leaq 0x18(%rsp), %rdi
callq 0x6548
leaq 0x3de34(%rip), %rsi     # 0x8f887
movq %rbx, %rdi
callq 0x928e
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x51ab7
jmp 0x51ab7
jmp 0x51a79
jmp 0x51ab7
jmp 0x51ab7
jmp 0x51ab7
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
jmp 0x51aae
jmp 0x51ab7
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x6548
jmp 0x51a97
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x6548
jmp 0x51aa9
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x6548
jmp 0x51aba
jmp 0x51ab7
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x6548
movq %rbx, %rdi
callq 0x64b0