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

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

	const char *qual = var.storage == StorageClassInput ? "StageInput" : "StageOutput";
	const char *lowerqual = var.storage == StorageClassInput ? "stage_input" : "stage_output";
	auto instance_name = to_name(var.self);
	uint32_t location = ir.meta[var.self].decoration.location;

	string buffer_name;
	auto flags = ir.meta[type.self].decoration.decoration_flags;
	if (flags.get(DecorationBlock))
	{
		emit_block_struct(type);
		buffer_name = to_name(type.self);
	}
	else
		buffer_name = type_to_glsl(type);

	statement("internal::", qual, "<", buffer_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_", lowerqual, "(", instance_name, "__", ", ", location, ");"));
	statement("");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, %r12
movq %rdi, %rbx
movl 0x8(%rsi), %esi
callq 0x22d1a
movl 0xc(%r12), %esi
movq %rbx, %rdi
callq 0x90a4
movq %rax, %r15
cmpl $0x1, 0x10(%r12)
leaq 0x87962(%rip), %rax     # 0x8f1f7
leaq 0x87966(%rip), %rcx     # 0x8f202
cmoveq %rax, %rcx
leaq 0x9126b(%rip), %rax     # 0x98b12
leaq 0x87960(%rip), %rdx     # 0x8f20e
cmoveq %rax, %rdx
movq %rcx, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movl 0x8(%r12), %edx
movq (%rbx), %rax
leaq 0x58(%rsp), %r14
pushq $0x1
popq %rcx
movq %r14, %rdi
movq %rbx, %rsi
callq *0x38(%rax)
movl 0x8(%r12), %eax
movq 0x38(%rbx), %rcx
imulq $0x148, %rax, %rax      # imm = 0x148
movl 0xa4(%rcx,%rax), %eax
movl %eax, 0x4(%rsp)
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl 0x8(%r15), %eax
imulq $0x148, %rax, %rax      # imm = 0x148
leaq (%rcx,%rax), %rsi
addq $0x60, %rsi
leaq 0x78(%rsp), %rdi
callq 0x934a
testb $0x4, 0x78(%rsp)
jne 0x793d
movq (%rbx), %rax
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq *0x98(%rax)
jmp 0x795d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x783c
movl 0x8(%r15), %edx
movq (%rbx), %rax
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rcx
movq %rbx, %rsi
callq *0x38(%rax)
leaq 0x38(%rsp), %rdi
leaq 0x8(%rsp), %r12
movq %r12, %rsi
callq 0x6320
movq %r12, %rdi
callq 0x6548
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2547c
subq $0x8, %rsp
leaq 0x8782e(%rip), %rax     # 0x8f1c0
leaq 0x87824(%rip), %r10     # 0x8f1bd
leaq 0x8787b(%rip), %rsi     # 0x8f21b
leaq 0x8b726(%rip), %rcx     # 0x930cd
leaq 0x38(%rsp), %rdx
leaq 0x40(%rsp), %r8
leaq 0x10(%rsp), %r9
movq %rbx, %rdi
pushq %rax
pushq %r14
pushq %r10
callq 0x935e
addq $0x20, %rsp
leaq 0x8(%rsp), %rdi
callq 0x6548
leaq 0x877ec(%rip), %rsi     # 0x8f1c4
leaq 0x877ee(%rip), %rcx     # 0x8f1cd
leaq 0x877f0(%rip), %r9      # 0x8f1d6
leaq 0x58(%rsp), %rdx
movq %rbx, %rdi
movq %rdx, %r8
callq 0x91c4
subq $0x8, %rsp
leaq 0x9207f(%rip), %rax     # 0x99a80
leaq 0xc(%rsp), %r10
leaq 0x8d67e(%rip), %r11     # 0x9508b
leaq 0x87812(%rip), %rsi     # 0x8f226
leaq 0x9620e(%rip), %rcx     # 0x9dc29
leaq 0x877d2(%rip), %r9      # 0x8f1f4
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
leaq 0x60(%rsp), %r8
pushq %rax
pushq %r10
pushq %r11
callq 0x9495
addq $0x20, %rsp
leaq 0x788(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0xcc8c
leaq 0x8(%rsp), %rdi
callq 0x6548
leaq 0x87e26(%rip), %rsi     # 0x8f887
movq %rbx, %rdi
callq 0x928e
leaq 0x80(%rsp), %rdi
callq 0xb51c
leaq 0x38(%rsp), %rdi
callq 0x6548
leaq 0x58(%rsp), %rdi
callq 0x6548
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x7ab7
jmp 0x7ab7
jmp 0x7aa1
jmp 0x7ab7
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6548
jmp 0x7aba
jmp 0x7ab7
movq %rax, %rbx
jmp 0x7ac7
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0xb51c
leaq 0x38(%rsp), %rdi
callq 0x6548
leaq 0x58(%rsp), %rdi
callq 0x6548
movq %rbx, %rdi
callq 0x64b0
nop