// File: /workspace/github_cpp_makefile_star2_O3/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 $0x98, %rsp
movq %rsi, %r12
movq %rdi, %rbx
movl 0xc(%rsi), %esi
callq 0xa3ea
movq %rax, %r14
movl 0x8(%rax), %esi
movq %rbx, %rdi
callq 0x281be
movq %r14, (%rsp)
movl 0x8(%r14), %edx
movq (%rbx), %rax
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %ecx
callq *0x38(%rax)
leaq 0x528df(%rip), %rsi     # 0xb6a57
movq %rbx, %rdi
movq %r14, %rdx
callq 0x755f4
leaq 0x18(%rsp), %rbp
movq -0x10(%rbp), %rdi
cmpq %rbp, %rdi
je 0x6419e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x281d8
movq (%rsp), %r14
movq %r14, %rdi
addq $0xa0, %rdi
callq 0xd940
movq %r12, 0x68(%rsp)
movl 0x8(%r12), %esi
movq %rbx, %rdi
movl $0x1e, %edx
callq 0x14e6e
movq 0x70(%r14), %rcx
subq 0x68(%r14), %rcx
shrq $0x2, %rcx
testl %ecx, %ecx
je 0x643fe
movq %r14, %rdx
leaq 0x38(%rsp), %r12
movl %eax, %eax
movq %rax, 0x70(%rsp)
xorl %r13d, %r13d
leaq 0x28(%rsp), %r14
movq %rbp, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movl 0x8(%rdx), %esi
movq %rbx, %rdi
movl %r13d, %edx
movl $0x1e, %ecx
callq 0x1406a
testb %al, %al
je 0x64262
movq (%rsp), %rax
movl 0x8(%rax), %esi
movq %rbx, %rdi
movl %r13d, %edx
movl $0x1e, %ecx
callq 0x14cde
movq %r14, %rdi
movq %rbx, %rsi
movl %eax, %edx
callq 0x640c4
leaq 0x48(%rsp), %r15
movq %r15, %rdi
leaq 0x50112(%rip), %rsi     # 0xb436a
movq %r14, %rdx
callq 0x5819d
jmp 0x6428d
movq 0x70(%rsp), %rax
leal (%rax,%r13), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x640c4
leaq 0x48(%rsp), %r15
movq %r15, %rdi
leaq 0x500e5(%rip), %rsi     # 0xb436a
movq %r14, %rdx
callq 0x5819d
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x6310
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x642b6
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x642cd
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
movq (%rsp), %r15
movq %r15, %rsi
movl %r13d, %edx
callq 0x281f0
movq 0x68(%r15), %rax
movl (%rax,%r13,4), %esi
movq %rbx, %rdi
callq 0xa3ea
movq %rax, %rbp
movl 0x8(%r15), %esi
movq %rbx, %rdi
movl %r13d, %edx
callq 0x14cf8
movq (%rbx), %rcx
leaq 0x48(%rsp), %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq *0x140(%rcx)
movq %rbx, %r12
leaq 0x78(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movq (%rsp), %rdx
movl %r13d, %ecx
callq 0x2c088
movq (%r12), %rax
movq %r14, %r15
movq %r14, %rdi
movq %r12, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
callq *0xc8(%rax)
movq %r12, %rdi
leaq 0x48(%rsp), %rsi
movq %r15, %rdx
leaq 0x8(%rsp), %rcx
leaq 0x5a78f(%rip), %r8      # 0xbeaf1
leaq 0x18(%rsp), %rbp
callq 0x75720
movq %r12, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %r12
cmpq %r12, %rdi
je 0x6438b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x643ad
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x643c9
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x643e0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
movq (%rsp), %rdx
movq 0x70(%rdx), %rax
subq 0x68(%rdx), %rax
incq %r13
shrq $0x2, %rax
movl %eax, %eax
cmpq %rax, %r13
jb 0x641fb
movq %rbx, %rdi
callq 0x28270
leaq 0x504a2(%rip), %rsi     # 0xb48af
movq %rbx, %rdi
callq 0xa6c4
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq 0x68(%rsp), %rdx
callq 0x2c7ac
leaq 0x57616(%rip), %rsi     # 0xbba47
leaq 0x5a6b9(%rip), %rcx     # 0xbeaf1
movq %rbx, %rdi
movq %r14, %rdx
callq 0x59372
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x6445a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x5044e(%rip), %rsi     # 0xb48af
movq %rbx, %rdi
callq 0xa6c4
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x64536
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x6454d
jmp 0x6455a
jmp 0x644ab
jmp 0x64536
jmp 0x64536
jmp 0x64536
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x64543
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x64543
jmp 0x6453b
movq %rax, %rbx
jmp 0x64518
movq %rax, %rbx
jmp 0x644f6
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x644f6
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x64518
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x6453e
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x6453e
movq %rax, %rbx
jmp 0x64543
movq %rax, %rbx
leaq 0x18(%rsp), %rbp
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x6455a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0