// File: /workspace/github_cpp_makefile_star2_O3/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 $0xa8, %rsp
movq %rsi, %r13
movq %rdi, %rbp
movl 0xc(%rsi), %esi
callq 0xa3ea
movq %rax, %r15
movl 0x8(%rax), %eax
movq 0x38(%rbp), %rcx
imulq $0x148, %rax, %rax      # imm = 0x148
movb 0x60(%rcx,%rax), %bl
movq (%rbp), %rax
movq %rbp, %rdi
movq %r13, %rsi
callq *0x130(%rax)
movq %rax, 0x60(%rsp)
testb $0x4, %bl
jne 0x2c20a
cmpl $0xc, 0xc(%r15)
jne 0x2c18f
cmpb $0x0, 0x43c(%rbp)
movl $0x135, %ecx            # imm = 0x135
movl $0x95, %edx
cmovnel %ecx, %edx
cmpl %edx, 0x438(%rbp)
jbe 0x2c283
movl 0x8(%r13), %eax
leaq 0x488(%rbp), %rsi
imulq $0x148, %rax, %rdx      # imm = 0x148
addq 0x38(%rbp), %rdx
movq %rbp, %rdi
callq 0x2b3ee
leaq 0x28(%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x295fe
leaq 0x8(%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x2c7ac
leaq 0x9291d(%rip), %rcx     # 0xbeaf1
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbp, %rdi
callq 0x521d0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2c64c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x2c64c
movb 0x43c(%rbp), %cl
movl 0x438(%rbp), %edx
testb %cl, %cl
movl $0x135, %esi            # imm = 0x135
movl $0x95, %edi
cmovnel %esi, %edi
cmpl %edi, %edx
jbe 0x2c283
xorb $0x1, %cl
cmpl $0x140, %edx            # imm = 0x140
setae %al
orb %cl, %al
jne 0x2c35c
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x8a3c6(%rip), %rsi     # 0xb6613
leaq 0x8a3d5(%rip), %rdx     # 0xb6629
leaq 0x28(%rsp), %rdi
callq 0x7be0
movq 0x720(%rbp), %rdi
movq 0x728(%rbp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x6088f
cmpq 0x728(%rbp), %rax
je 0x2c2a2
xorl %ebx, %ebx
jmp 0x2c302
movq %rbp, %rdi
movq %r13, %rsi
movq %rax, %rdx
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2bade
movq %r15, %r12
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x8a3a0(%rip), %rsi     # 0xb6655
leaq 0x8a3b3(%rip), %rdx     # 0xb666f
leaq 0x8(%rsp), %rdi
callq 0x7be0
movq 0x720(%rbp), %rdi
movq 0x728(%rbp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x6088f
cmpq 0x728(%rbp), %rax
sete %bl
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2c2ff
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
movq %r12, %r15
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x2c319
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
testb %bl, %bl
je 0x2c35c
leaq 0x28(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x8ae02(%rip), %rsi     # 0xb712e
leaq 0x8ae12(%rip), %rdx     # 0xb7145
callq 0x7be0
leaq 0x28(%rsp), %rsi
movq %rbp, %rdi
callq 0x26356
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x2c35c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
movl 0x8(%r15), %edx
movq (%rbp), %rax
leaq 0x28(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rsi
xorl %ecx, %ecx
callq *0x38(%rax)
leaq 0x4f8(%rbp), %r12
leaq 0x4c0(%rbp), %rax
cmpl $0x1, 0x64(%r15)
cmoveq %rax, %r12
cmpq $0x0, 0x8(%r14)
je 0x2c3a4
leaq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x20790
testq %rax, %rax
je 0x2c3e3
movl 0x8(%r15), %edx
movq (%rbp), %rax
leaq 0x8(%rsp), %rdi
movq %rbp, %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 0x2c3f8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x2c3f8
leaq 0x8(%rsp), %rdx
movq %r12, (%rdx)
leaq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x208a8
cmpq $0x0, 0x30(%rsp)
jne 0x2c457
movl 0xc(%r13), %esi
movq %rbp, %rdi
callq 0xa3ea
addq $0x8, %rax
leaq 0x8(%r13), %r8
leaq 0x91b9c(%rip), %rcx     # 0xbdfb7
leaq 0x8(%rsp), %rdi
movq %rcx, %rsi
movq %rax, %rdx
callq 0x51b54
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x6310
movq (%r14), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2c457
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x488(%rbp), %rbx
leaq 0x8(%rsp), %rdx
movq %rbx, (%rdx)
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x208a8
leaq 0x8(%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x295fe
leaq 0x8(%rsp), %rsi
leaq 0x60(%rsp), %rdx
leaq 0x28(%rsp), %rcx
movq %rbp, %rdi
callq 0x51fbc
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2c4b5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x8e71b(%rip), %rsi     # 0xbabd7
movq %rbp, %rdi
callq 0x59e02
movq %rbx, 0x48(%rsp)
movq %r13, 0x50(%rsp)
movq %rbp, %r13
incl 0x638(%rbp)
movq %r15, %rdi
addq $0xa0, %rdi
callq 0xd940
movq %r15, %rax
movq 0x68(%r15), %r15
movq %rax, %rbx
movq 0x70(%rax), %rax
movq %rax, 0x58(%rsp)
cmpq %rax, %r15
je 0x2c575
xorl %ebp, %ebp
leaq 0x8(%rsp), %r12
movq %r13, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x281f0
movl (%r15), %r14d
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r12, %rdi
leaq 0x88386(%rip), %rdx     # 0xb48af
movq %rdx, %rsi
callq 0x7be0
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 0x2c568
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
incl %ebp
addq $0x4, %r15
cmpq 0x58(%rsp), %r15
jne 0x2c505
movq 0x50(%rsp), %r14
movl 0x8(%r14), %eax
imulq $0x148, %rax, %rdx      # imm = 0x148
addq 0x38(%r13), %rdx
movq %r13, %rdi
movq 0x48(%rsp), %rsi
callq 0x2b3ee
movl 0x8(%r14), %edx
movq (%r13), %rax
leaq 0x88(%rsp), %rdi
movq %r13, %rsi
movl $0x1, %ecx
callq *0x38(%rax)
leaq 0x68(%rsp), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x2b55a
leaq 0x8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x52133
leaq 0x8(%rsp), %rsi
movq %r13, %rdi
callq 0x2b486
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2c601
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2c61c
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2c63d
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x8826b(%rip), %rsi     # 0xb48af
movq %r13, %rdi
callq 0xa6c4
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2c667
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2c69e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x2c69e
jmp 0x2c69b
jmp 0x2c69b
jmp 0x2c6b1
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
jne 0x2c771
jmp 0x2c77e
movq %rax, %rbx
jmp 0x2c77e
jmp 0x2c73f
jmp 0x2c73f
jmp 0x2c729
jmp 0x2c73f
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2c6e8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x2c6e8
movq %rax, %rbx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2c708
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x2c708
movq %rax, %rbx
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2c763
movq 0x98(%rsp), %rsi
jmp 0x2c75b
jmp 0x2c73f
jmp 0x2c729
jmp 0x2c73f
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x2c751
jmp 0x2c73f
jmp 0x2c73f
jmp 0x2c73f
jmp 0x2c73f
movq %rax, %rbx
jmp 0x2c763
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2c763
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2c77e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0