// File: /workspace/github_cpp_makefile_star2_O1/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 $0xc8, %rsp
movq %rsi, %r13
movq %rdi, %r15
movl 0xc(%rsi), %esi
callq 0xa426
movq %rax, %rbp
movl 0x8(%rax), %eax
movq 0x38(%r15), %rcx
imulq $0x148, %rax, %rax      # imm = 0x148
movb 0x60(%rcx,%rax), %bl
movq (%r15), %rax
movq %r15, %rdi
movq %r13, %rsi
callq *0x130(%rax)
movq %rax, 0x80(%rsp)
testb $0x4, %bl
jne 0x2c821
cmpl $0xc, 0xc(%rbp)
jne 0x2c7a6
cmpb $0x0, 0x43c(%r15)
movl $0x135, %ecx            # imm = 0x135
movl $0x95, %edx
cmovnel %ecx, %edx
cmpl %edx, 0x438(%r15)
jbe 0x2c8a5
movl 0x8(%r13), %eax
leaq 0x488(%r15), %rsi
imulq $0x148, %rax, %rdx      # imm = 0x148
addq 0x38(%r15), %rdx
movq %r15, %rdi
callq 0x2b9f6
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x29c10
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x2ce16
leaq 0x932fe(%rip), %rcx     # 0xbfae9
leaq 0x28(%rsp), %rsi
leaq 0x48(%rsp), %rdx
movq %r15, %rdi
callq 0x529c8
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2cc83
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x2cc83
movb 0x43c(%r15), %cl
movl 0x438(%r15), %edx
testb %cl, %cl
movl $0x135, %esi            # imm = 0x135
movl $0x95, %edi
cmovnel %esi, %edi
cmpl %edi, %edx
jbe 0x2c8a5
xorb $0x1, %cl
cmpl $0x140, %edx            # imm = 0x140
setae %al
orb %cl, %al
jne 0x2c98b
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x8adbd(%rip), %rsi     # 0xb7623
leaq 0x8adcc(%rip), %rdx     # 0xb7639
leaq 0x28(%rsp), %rdi
callq 0x7c64
movq 0x720(%r15), %rdi
movq 0x728(%r15), %rsi
leaq 0x28(%rsp), %rdx
callq 0x61107
movq %rax, %r12
movq %rbp, %r14
movq 0x728(%r15), %rbx
cmpq %rbx, %rax
je 0x2c8c4
xorl %ebp, %ebp
jmp 0x2c908
movq %r15, %rdi
movq %r13, %rsi
movq %rax, %rdx
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2c0fa
leaq 0x58(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x8ad91(%rip), %rsi     # 0xb7665
leaq 0x8ada4(%rip), %rdx     # 0xb767f
leaq 0x48(%rsp), %rdi
callq 0x7c64
movq 0x720(%r15), %rdi
movq 0x728(%r15), %rsi
leaq 0x48(%rsp), %rdx
callq 0x61107
cmpq 0x728(%r15), %rax
sete %bpl
cmpq %rbx, %r12
leaq 0x38(%rsp), %r12
jne 0x2c92d
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2c92d
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x2c944
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
testb %bpl, %bpl
movq %r14, %rbp
je 0x2c98b
leaq 0x28(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x8b7e3(%rip), %rsi     # 0xb813e
leaq 0x8b7f3(%rip), %rdx     # 0xb8155
callq 0x7c64
leaq 0x28(%rsp), %rsi
movq %r15, %rdi
callq 0x26a0a
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x2c98b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
movl 0x8(%rbp), %edx
movq (%r15), %rax
leaq 0x28(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq *0x38(%rax)
leaq 0x4f8(%r15), %r12
leaq 0x4c0(%r15), %rax
cmpl $0x1, 0x64(%rbp)
cmoveq %rax, %r12
cmpq $0x0, 0x8(%r14)
je 0x2c9d0
leaq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x20e88
testq %rax, %rax
je 0x2ca0d
movl 0x8(%rbp), %edx
movq (%r15), %rax
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq *0x18(%rax)
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x6170
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2ca22
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x2ca22
leaq 0x8(%rsp), %rdx
movq %r12, (%rdx)
leaq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x20fa0
cmpq $0x0, 0x30(%rsp)
jne 0x2ca81
movl 0xc(%r13), %esi
movq %r15, %rdi
callq 0xa426
addq $0x8, %rax
leaq 0x8(%r13), %r8
leaq 0x9256a(%rip), %rcx     # 0xbefaf
leaq 0x8(%rsp), %rdi
movq %rcx, %rsi
movq %rax, %rdx
callq 0x5234c
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x6310
movq (%r14), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2ca81
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x488(%r15), %rbx
leaq 0x8(%rsp), %rdx
movq %rbx, (%rdx)
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x20fa0
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x29c10
leaq 0x8(%rsp), %rsi
leaq 0x80(%rsp), %rdx
leaq 0x28(%rsp), %rcx
movq %r15, %rdi
callq 0x527b4
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2cae2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x8f0fe(%rip), %rsi     # 0xbbbe7
movq %r15, %rdi
callq 0x5a5fc
movq %rbx, 0x68(%rsp)
movq %r13, 0x70(%rsp)
movq %r15, %r13
incl 0x638(%r15)
movq %rbp, %rdi
addq $0xa0, %rdi
callq 0xd978
movq 0x68(%rbp), %r15
movq %rbp, %rbx
movq 0x70(%rbp), %rax
movq %rax, 0x78(%rsp)
cmpq %rax, %r15
je 0x2cba0
xorl %ebp, %ebp
leaq 0x8(%rsp), %r12
movq %r13, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x2881c
movl (%r15), %r14d
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r12, %rdi
leaq 0x88d5b(%rip), %rdx     # 0xb58af
movq %rdx, %rsi
callq 0x7c64
movq %r13, %rdi
movq (%r13), %rax
movq %rbx, %rsi
movl %r14d, %edx
movl %ebp, %ecx
movq %r12, %r8
xorl %r9d, %r9d
callq *0xa8(%rax)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2cb93
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
incl %ebp
addq $0x4, %r15
cmpq 0x78(%rsp), %r15
jne 0x2cb30
movq 0x70(%rsp), %r14
movl 0x8(%r14), %eax
imulq $0x148, %rax, %rdx      # imm = 0x148
addq 0x38(%r13), %rdx
movq %r13, %rdi
movq 0x68(%rsp), %rsi
callq 0x2b9f6
movl 0x8(%r14), %edx
movq (%r13), %rax
leaq 0xa8(%rsp), %rdi
movq %r13, %rsi
movl $0x1, %ecx
callq *0x38(%rax)
leaq 0x88(%rsp), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x2bb66
leaq 0x8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x5292b
leaq 0x8(%rsp), %rsi
movq %r13, %rdi
callq 0x2ba8e
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2cc32
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2cc53
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2cc74
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x88c34(%rip), %rsi     # 0xb58af
movq %r13, %rdi
callq 0xa700
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2cc9e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2cce9
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x2cce9
jmp 0x2cce6
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
jne 0x2cdda
jmp 0x2cde7
jmp 0x2ccf8
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
jmp 0x2cdd5
movq %rax, %rbx
jmp 0x2cde7
jmp 0x2cda8
jmp 0x2cda8
jmp 0x2cd78
jmp 0x2cda8
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2cd35
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x2cd35
movq %rax, %rbx
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2cd5b
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x2cd5b
movq %rax, %rbx
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2cdcc
movq 0xb8(%rsp), %rsi
jmp 0x2cdc4
jmp 0x2cda8
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x2cdba
jmp 0x2cda8
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2cdcc
movq 0x58(%rsp), %rsi
jmp 0x2cdc4
jmp 0x2cda8
jmp 0x2cda8
jmp 0x2cda8
jmp 0x2cda8
movq %rax, %rbx
jmp 0x2cdcc
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2cdcc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2cde7
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0
nop