// File: /workspace/github_cpp_makefile_star2_O3/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 $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x98(%rsi), %esi
testl %esi, %esi
je 0x27fd7
movq %rbx, %rdi
movl $0xa, %edx
callq 0x12974
testb %al, %al
je 0x28160
movl 0x8(%r14), %eax
leaq 0x488(%rbx), %rsi
imulq $0x148, %rax, %rdx      # imm = 0x148
addq 0x38(%rbx), %rdx
movq %rbx, %rdi
callq 0x2b3ee
movq (%rbx), %rax
leaq 0x38(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq *0x98(%rax)
leaq 0x8c89a(%rip), %rax     # 0xb48af
leaq 0x8ea3b(%rip), %rcx     # 0xb6a57
cmpb $0x0, 0x623(%rbx)
cmovneq %rax, %rcx
leaq 0x10(%rsp), %rsi
movq %rcx, (%rsi)
movq %rbx, %rdi
movq %r15, %rdx
callq 0x51676
leaq 0x92b96(%rip), %rsi     # 0xbabd7
movq %rbx, %rdi
callq 0x59e02
incl 0x638(%rbx)
leaq 0xa0(%r14), %rdi
callq 0xd940
movq 0x68(%r14), %r15
movq 0x70(%r14), %rax
movq %rax, 0x30(%rsp)
cmpq %rax, %r15
setne %bpl
je 0x280ff
movb %bpl, 0xf(%rsp)
xorl %ebp, %ebp
leaq 0x10(%rsp), %r12
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x281f0
movl (%r15), %r13d
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r12, %rdi
leaq 0x8c80a(%rip), %rdx     # 0xb48af
movq %rdx, %rsi
callq 0x7be0
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 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x280e3
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6260
incl %ebp
addq $0x4, %r15
cmpq 0x30(%rsp), %r15
jne 0x28081
movq 0x68(%r14), %rax
movq 0x70(%r14), %r15
movb 0xf(%rsp), %bpl
jmp 0x28102
movq %r15, %rax
cmpl $0xc, 0xc(%r14)
jne 0x28129
cmpq %r15, %rax
jne 0x28129
cmpb $0x0, 0x631(%rbx)
jne 0x28129
movb $0x1, %bpl
leaq 0x8e93e(%rip), %rsi     # 0xb6a5f
movq %rbx, %rdi
callq 0x51212
movq %rbx, %rdi
callq 0x28270
testb %bpl, %bpl
je 0x28145
leaq 0x8c772(%rip), %rsi     # 0xb48af
movq %rbx, %rdi
callq 0xa6c4
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x28160
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x6260
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x28177
jmp 0x28177
jmp 0x28177
jmp 0x28177
movq %rax, %rbx
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x28195
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x2817a
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x2817a