// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_glsl.cpp
// Function: spirv_cross::CompilerGLSL::emit_struct(spirv_cross::SPIRType&)
void CompilerGLSL::emit_struct(SPIRType &type)
{
	// Struct types can be stamped out multiple times
	// with just different offsets, matrix layouts, etc ...
	// Type-punning with these types is legal, which complicates things
	// when we are storing struct and array types in an SSBO for example.
	// If the type master is packed however, we can no longer assume that the struct declaration will be redundant.
	if (type.type_alias != 0 && !has_decoration(type.type_alias, DecorationCPacked))
		return;

	add_resource_name(type.self);
	auto name = type_to_glsl(type);

	statement(!backend.explicit_struct_type ? "struct " : "", name);
	begin_scope();

	type.member_name_cache.clear();

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

	// Don't declare empty structs in GLSL, this is not allowed.
	if (type_is_empty(type) && !backend.supports_empty_struct)
	{
		statement("int empty_struct_member;");
		emitted = true;
	}

	end_scope_decl();

	if (emitted)
		statement("");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x98(%rsi), %esi
testl %esi, %esi
je 0x28621
movq %rbx, %rdi
movl $0xa, %edx
callq 0x1299a
testb %al, %al
je 0x2878d
movl 0x8(%r14), %eax
leaq 0x488(%rbx), %rsi
imulq $0x148, %rax, %rdx      # imm = 0x148
addq 0x38(%rbx), %rdx
movq %rbx, %rdi
callq 0x2b9f6
movq (%rbx), %rax
leaq 0x28(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq *0x98(%rax)
leaq 0x8d250(%rip), %rax     # 0xb58af
leaq 0x8f401(%rip), %rcx     # 0xb7a67
cmpb $0x0, 0x623(%rbx)
cmovneq %rax, %rcx
movq %rsp, %rsi
movq %rcx, (%rsi)
movq %rbx, %rdi
movq %r15, %rdx
callq 0x51e6e
leaq 0x9355e(%rip), %rsi     # 0xbbbe7
movq %rbx, %rdi
callq 0x5a5fc
incl 0x638(%rbx)
leaq 0xa0(%r14), %rdi
callq 0xd978
movq 0x68(%r14), %r15
movq 0x70(%r14), %rax
xorl %ebp, %ebp
movq %rax, 0x20(%rsp)
cmpq %rax, %r15
je 0x2872a
movq %rsp, %r12
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x2881c
movl (%r15), %r13d
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %r12, %rdi
leaq 0x8d1d2(%rip), %rdx     # 0xb58af
movq %rdx, %rsi
callq 0x7c64
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
movl %r13d, %edx
movl %ebp, %ecx
movq %r12, %r8
xorl %r9d, %r9d
callq *0xa8(%rax)
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2871a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
incl %ebp
addq $0x4, %r15
cmpq 0x20(%rsp), %r15
jne 0x286ba
movb $0x1, %bpl
cmpl $0xc, 0xc(%r14)
jne 0x28756
movq 0x70(%r14), %rax
cmpq %rax, 0x68(%r14)
jne 0x28756
cmpb $0x0, 0x631(%rbx)
jne 0x28756
movb $0x1, %bpl
leaq 0x8f321(%rip), %rsi     # 0xb7a6f
movq %rbx, %rdi
callq 0x51a0a
movq %rbx, %rdi
callq 0x2889c
testb %bpl, %bpl
je 0x28772
leaq 0x8d145(%rip), %rsi     # 0xb58af
movq %rbx, %rdi
callq 0xa700
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2878d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x287a4
jmp 0x287a4
jmp 0x287a4
jmp 0x287a4
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x287c2
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x287a7
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x287a7