// File: /workspace/github_cpp_makefile_star2_O1/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 0xa426
movq %rax, %r14
movl 0x8(%rax), %esi
movq %rbx, %rdi
callq 0x287ea
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 0x53041(%rip), %rsi     # 0xb7a67
movq %rbx, %rdi
movq %r14, %rdx
callq 0x76100
leaq 0x18(%rsp), %rbp
movq -0x10(%rbp), %rdi
cmpq %rbp, %rdi
je 0x64a4c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x28804
movq (%rsp), %r14
movq %r14, %rdi
addq $0xa0, %rdi
callq 0xd978
movq %r12, 0x68(%rsp)
movl 0x8(%r12), %esi
movq %rbx, %rdi
movl $0x1e, %edx
callq 0x14ff6
movq 0x70(%r14), %rcx
subq 0x68(%r14), %rcx
shrq $0x2, %rcx
testl %ecx, %ecx
je 0x64cac
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 0x14222
testb %al, %al
je 0x64b10
movq (%rsp), %rax
movl 0x8(%rax), %esi
movq %rbx, %rdi
movl %r13d, %edx
movl $0x1e, %ecx
callq 0x14e6c
movq %r14, %rdi
movq %rbx, %rsi
movl %eax, %edx
callq 0x64952
leaq 0x48(%rsp), %r15
movq %r15, %rdi
leaq 0x50864(%rip), %rsi     # 0xb536a
movq %r14, %rdx
callq 0x58997
jmp 0x64b3b
movq 0x70(%rsp), %rax
leal (%rax,%r13), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x64952
leaq 0x48(%rsp), %r15
movq %r15, %rdi
leaq 0x50837(%rip), %rsi     # 0xb536a
movq %r14, %rdx
callq 0x58997
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x6310
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x64b64
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x64b7b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
movq (%rsp), %r15
movq %r15, %rsi
movl %r13d, %edx
callq 0x2881c
movq 0x68(%r15), %rax
movl (%rax,%r13,4), %esi
movq %rbx, %rdi
callq 0xa426
movq %rax, %rbp
movl 0x8(%r15), %esi
movq %rbx, %rdi
movl %r13d, %edx
callq 0x14e86
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 0x2c69c
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 0x5aed9(%rip), %r8      # 0xbfae9
leaq 0x18(%rsp), %rbp
callq 0x7622c
movq %r12, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %r12
cmpq %r12, %rdi
je 0x64c39
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x64c5b
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x64c77
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x64c8e
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 0x64aa9
movq %rbx, %rdi
callq 0x2889c
leaq 0x50bf4(%rip), %rsi     # 0xb58af
movq %rbx, %rdi
callq 0xa700
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq 0x68(%rsp), %rdx
callq 0x2ce16
leaq 0x57d60(%rip), %rsi     # 0xbca3f
leaq 0x5ae03(%rip), %rcx     # 0xbfae9
movq %rbx, %rdi
movq %r14, %rdx
callq 0x59b6c
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x64d08
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x50ba0(%rip), %rsi     # 0xb58af
movq %rbx, %rdi
callq 0xa700
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x64de4
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x64dfb
jmp 0x64e08
jmp 0x64d59
jmp 0x64de4
jmp 0x64de4
jmp 0x64de4
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x64df1
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x64df1
jmp 0x64de9
movq %rax, %rbx
jmp 0x64dc6
movq %rax, %rbx
jmp 0x64da4
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x64da4
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x64dc6
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x64dec
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x64dec
movq %rax, %rbx
jmp 0x64df1
movq %rax, %rbx
leaq 0x18(%rsp), %rbp
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x64e08
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0