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

	// Either make it plain in/out or in/out blocks depending on what shader is doing ...
	bool block = ir.meta[type.self].decoration.decoration_flags.get(DecorationBlock);
	const char *qual = to_storage_qualifiers_glsl(var);

	if (block)
	{
		// ESSL earlier than 310 and GLSL earlier than 150 did not support
		// I/O variables which are struct types.
		// To support this, flatten the struct into separate varyings instead.
		if ((options.es && options.version < 310) || (!options.es && options.version < 150))
		{
			// I/O blocks on ES require version 310 with Android Extension Pack extensions, or core version 320.
			// On desktop, I/O blocks were introduced with geometry shaders in GL 3.2 (GLSL 150).
			emit_flattened_io_block(var, qual);
		}
		else
		{
			if (options.es && options.version < 320)
			{
				// Geometry and tessellation extensions imply this extension.
				if (!has_extension("GL_EXT_geometry_shader") && !has_extension("GL_EXT_tessellation_shader"))
					require_extension_internal("GL_EXT_shader_io_blocks");
			}

			// Block names should never alias.
			auto block_name = to_name(type.self, false);

			// The namespace for I/O blocks is separate from other variables in GLSL.
			auto &block_namespace = type.storage == StorageClassInput ? block_input_names : block_output_names;

			// Shaders never use the block by interface name, so we don't
			// have to track this other than updating name caches.
			if (block_name.empty() || block_namespace.find(block_name) != end(block_namespace))
				block_name = get_fallback_name(type.self);
			else
				block_namespace.insert(block_name);

			// If for some reason buffer_name is an illegal name, make a final fallback to a workaround name.
			// This cannot conflict with anything else, so we're safe now.
			if (block_name.empty())
				block_name = join("_", get<SPIRType>(var.basetype).self, "_", var.self);

			// Instance names cannot alias block names.
			resource_names.insert(block_name);

			statement(layout_for_variable(var), qual, block_name);
			begin_scope();

			type.member_name_cache.clear();

			uint32_t i = 0;
			for (auto &member : type.member_types)
			{
				add_member_name(type, i);
				emit_struct_member(type, member, i);
				i++;
			}

			add_resource_name(var.self);
			end_scope_decl(join(to_name(var.self), type_to_array_glsl(type)));
			statement("");
		}
	}
	else
	{
		// ESSL earlier than 310 and GLSL earlier than 150 did not support
		// I/O variables which are struct types.
		// To support this, flatten the struct into separate varyings instead.
		if (type.basetype == SPIRType::Struct &&
		    ((options.es && options.version < 310) || (!options.es && options.version < 150)))
		{
			emit_flattened_io_block(var, qual);
		}
		else
		{
			add_resource_name(var.self);
			statement(layout_for_variable(var), variable_decl(var), ";");
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0xc(%rsi), %esi
callq 0x90a4
movq %rax, %r13
movl 0x8(%rax), %eax
movq 0x38(%rbx), %rcx
imulq $0x148, %rax, %rax      # imm = 0x148
movb 0x60(%rcx,%rax), %bpl
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x130(%rax)
movq %rax, 0x50(%rsp)
testb $0x4, %bpl
jne 0x25e06
cmpl $0xc, 0xc(%r13)
jne 0x25db8
cmpb $0x0, 0x43c(%rbx)
movl $0x135, %ecx            # imm = 0x135
movl $0x95, %edx
cmovnel %ecx, %edx
cmpl %edx, 0x438(%rbx)
jbe 0x25f3f
movl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x22d1a
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x23d8a
movq %rsp, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2619e
leaq 0x73c98(%rip), %rcx     # 0x99a81
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x422f6
movq %rsp, %rdi
callq 0x6548
jmp 0x260ed
movb 0x43c(%rbx), %cl
movl 0x438(%rbx), %edx
testb %cl, %cl
movl $0x135, %esi            # imm = 0x135
movl $0x95, %edi
cmovnel %esi, %edi
cmpl %edi, %edx
jbe 0x25f3f
xorb $0x1, %cl
cmpl $0x140, %edx            # imm = 0x140
setae %al
orb %cl, %al
jne 0x25ec7
leaq 0x6b7af(%rip), %rsi     # 0x915f3
leaq 0x20(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0x6100
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x26178
testb %al, %al
jne 0x25ebd
leaq 0x6b7ca(%rip), %rsi     # 0x91635
movq %rsp, %rdi
leaq 0x78(%rsp), %rdx
callq 0x6100
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x26178
movl %eax, %ebp
movq %rsp, %rdi
callq 0x6548
leaq 0x20(%rsp), %rdi
callq 0x6548
testb %bpl, %bpl
jne 0x25ec7
leaq 0x6c26b(%rip), %rsi     # 0x9210e
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
callq 0x6100
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x21390
leaq 0x20(%rsp), %rdi
callq 0x6548
movl 0x8(%r13), %edx
movq (%rbx), %rax
movq %r14, 0x40(%rsp)
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
callq *0x38(%rax)
leaq 0x4f8(%rbx), %r14
leaq 0x4c0(%rbx), %rax
cmpl $0x1, 0x64(%r13)
cmoveq %rax, %r14
cmpq $0x0, 0x8(%r15)
movq 0x40(%rsp), %r15
je 0x25f18
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x1be34
testq %rax, %rax
je 0x25f5e
movl 0x8(%r13), %edx
movq (%rbx), %rax
movq %rsp, %rdi
movq %rbx, %rsi
callq *0x18(%rax)
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x6170
movq %rsp, %rdi
callq 0x6548
jmp 0x25f6b
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x258ea
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x1bf20
cmpq $0x0, 0x28(%rsp)
jne 0x25fb4
movl 0xc(%r15), %esi
movq %rbx, %rdi
callq 0x90a4
addq $0x8, %rax
leaq 0x8(%r15), %r8
leaq 0x72fb9(%rip), %rcx     # 0x98f47
movq %rsp, %rdi
movq %rcx, %rsi
movq %rax, %rdx
callq 0x41e67
leaq 0x20(%rsp), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x6320
movq %r14, %rdi
callq 0x6548
leaq 0x488(%rbx), %rdi
leaq 0x20(%rsp), %rsi
callq 0x1bf20
movq %rsp, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x23d8a
movq %rsp, %rsi
leaq 0x50(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %rbx, %rdi
callq 0x421b2
movq %rsp, %rdi
callq 0x6548
movq %rbx, %rdi
callq 0x22d28
movq %r13, %rdi
addq $0xa0, %rdi
callq 0xb854
movq 0x68(%r13), %r12
movq 0x70(%r13), %rax
movq %rax, 0x48(%rsp)
xorl %ebp, %ebp
movq %rsp, %r14
cmpq 0x48(%rsp), %r12
je 0x26074
movq %rbx, %rdi
movq %r13, %rsi
movl %ebp, %edx
callq 0x22d40
movl (%r12), %r15d
movq %r14, %rdi
leaq 0x6984c(%rip), %rsi     # 0x8f887
leaq 0x58(%rsp), %rdx
callq 0x6100
movq %rbx, %rdi
movq (%rbx), %rax
movq %r13, %rsi
movl %r15d, %edx
movl %ebp, %ecx
movq %r14, %r8
xorl %r9d, %r9d
callq *0xa8(%rax)
movq %r14, %rdi
callq 0x6548
incl %ebp
addq $0x4, %r12
movq 0x40(%rsp), %r15
jmp 0x26019
movl 0x8(%r15), %esi
movq %rbx, %rdi
callq 0x22d1a
movl 0x8(%r15), %edx
movq (%rbx), %rax
leaq 0x58(%rsp), %rdi
pushq $0x1
popq %rcx
movq %rbx, %rsi
callq *0x38(%rax)
leaq 0x78(%rsp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x2547c
movq %rsp, %rdi
leaq 0x58(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0x4228c
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x253d4
movq %rsp, %rdi
callq 0x6548
leaq 0x78(%rsp), %rdi
callq 0x6548
leaq 0x58(%rsp), %rdi
callq 0x6548
leaq 0x697a2(%rip), %rsi     # 0x8f887
movq %rbx, %rdi
callq 0x928e
leaq 0x20(%rsp), %rdi
callq 0x6548
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x26156
jmp 0x26113
jmp 0x2615b
jmp 0x26156
jmp 0x26156
movq %rax, %rbx
jmp 0x26170
jmp 0x26156
jmp 0x26156
jmp 0x2615b
jmp 0x26156
movq %rax, %rbx
movq %rsp, %rdi
callq 0x6548
jmp 0x26130
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x6548
jmp 0x2613f
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
jmp 0x26161
jmp 0x26156
jmp 0x2615b
jmp 0x26156
jmp 0x2615b
jmp 0x26156
jmp 0x26156
jmp 0x26156
jmp 0x26156
movq %rax, %rbx
jmp 0x26166
movq %rax, %rbx
movq %rsp, %rdi
callq 0x6548
leaq 0x20(%rsp), %rdi
callq 0x6548
movq %rbx, %rdi
callq 0x64b0