// File: /workspace/github_cpp_makefile_star2_O3/rossy[P]crossc/SPIRV-Cross/spirv_glsl.cpp
// Function: spirv_cross::CompilerGLSL::flattened_access_chain_struct[abi:cxx11](unsigned int, unsigned int const*, unsigned int, spirv_cross::SPIRType const&, unsigned int)
std::string CompilerGLSL::flattened_access_chain_struct(uint32_t base, const uint32_t *indices, uint32_t count,
                                                        const SPIRType &target_type, uint32_t offset)
{
	std::string expr;

	expr += type_to_glsl_constructor(target_type);
	expr += "(";

	for (uint32_t i = 0; i < uint32_t(target_type.member_types.size()); ++i)
	{
		if (i != 0)
			expr += ", ";

		const SPIRType &member_type = get<SPIRType>(target_type.member_types[i]);
		uint32_t member_offset = type_struct_member_offset(target_type, i);

		// The access chain terminates at the struct, so we need to find matrix strides and row-major information
		// ahead of time.
		bool need_transpose = false;
		uint32_t matrix_stride = 0;
		if (member_type.columns > 1)
		{
			need_transpose = combined_decoration_for_member(target_type, i).get(DecorationRowMajor);
			matrix_stride = type_struct_member_matrix_stride(target_type, i);
		}

		auto tmp = flattened_access_chain(base, indices, count, member_type, offset + member_offset, matrix_stride,
		                                  need_transpose);

		// Cannot forward transpositions, so resolve them here.
		if (need_transpose)
			expr += convert_row_major_matrix(tmp, member_type, false);
		else
			expr += tmp;
	}

	expr += ")";

	return expr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %r9, %r14
movl %r8d, 0x1c(%rsp)
movq %rcx, 0xa0(%rsp)
movl %edx, 0x18(%rsp)
movq %rsi, %r13
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, 0x8(%rsp)
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
leaq 0x20(%rsp), %rdi
movq %r9, %rdx
movq %rbx, 0x10(%rsp)
callq 0x34a5c
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x60b0
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x42ea6
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x7fdc4(%rip), %rsi     # 0xc2c71
movq %rbx, %rdi
callq 0x64e0
movq 0x68(%r14), %rax
movq 0x70(%r14), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
testl %ecx, %ecx
je 0x43079
xorl %ebp, %ebp
testq %rbp, %rbp
je 0x42ee6
movq %rbx, %rdi
leaq 0x771ce(%rip), %rsi     # 0xba0ab
callq 0x64e0
movq 0x68(%r14), %rax
movl (%rax,%rbp,4), %esi
movq %r13, %rdi
callq 0xa3ea
movq %rax, %r15
movq %r13, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x15402
movl %eax, %r12d
xorl %ebx, %ebx
cmpl $0x2, 0x18(%r15)
movl $0x0, %eax
jb 0x42f45
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x1af9a
movl 0x20(%rsp), %ebx
leaq 0x28(%rsp), %rdi
callq 0xd570
movq %r13, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x155e0
andl $0x10, %ebx
shrl $0x4, %ebx
addl 0xe0(%rsp), %r12d
subq $0x8, %rsp
movzbl %bl, %r10d
leaq 0x28(%rsp), %rdi
movq %r13, %rsi
movl 0x20(%rsp), %edx
movq 0xa8(%rsp), %rcx
movl 0x24(%rsp), %r8d
movq %r15, %r9
pushq %r10
pushq %rax
pushq %r12
callq 0x4287a
addq $0x20, %rsp
testb %bl, %bl
je 0x43029
leaq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0xe456
movq (%r13), %rax
leaq 0x80(%rsp), %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %r15, %rcx
xorl %r8d, %r8d
callq *0x118(%rax)
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x60b0
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x4300b
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x43040
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x43040
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x60b0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x4305c
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6260
incq %rbp
movq 0x68(%r14), %rax
movq 0x70(%r14), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
movl %ecx, %ecx
cmpq %rcx, %rbp
jb 0x42ece
leaq 0x77995(%rip), %rsi     # 0xbaa15
movq %rbx, %rdi
callq 0x64e0
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x43110
jmp 0x43132
jmp 0x43124
jmp 0x43132
jmp 0x430bd
movq %rax, %r14
jmp 0x430ea
jmp 0x43132
movq %rax, %r14
jmp 0x43106
movq %rax, %r14
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x430ea
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x43106
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x43135
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x43135
movq %rax, %r14
movq 0x8(%rsp), %rax
jmp 0x4313f
jmp 0x43132
jmp 0x43132
movq %rax, %r14
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rbx
movq (%rbx), %rdi
cmpq %rax, %rdi
je 0x43152
movq (%rax), %rsi
incq %rsi
callq 0x6260
movq %r14, %rdi
callq 0x64a0