// File: /workspace/github_cpp_makefile_star2_O2/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, %r15
movl %r8d, 0x1c(%rsp)
movq %rcx, 0x20(%rsp)
movl %edx, 0x18(%rsp)
movq %rsi, %r14
movq %rdi, %rbp
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
leaq 0x28(%rsp), %rdi
movq %r9, %rdx
callq 0x2c226
leaq 0x28(%rsp), %rsi
movq %rbp, %rdi
callq 0x64f0
leaq 0x28(%rsp), %rdi
callq 0x6548
leaq 0x6761e(%rip), %rsi     # 0x9dc29
movq %rbp, %rdi
callq 0x64d0
xorl %r13d, %r13d
leaq 0x28(%rsp), %r12
movq %rbp, (%rsp)
movq %r15, 0x8(%rsp)
movq 0x68(%r15), %rax
movq 0x70(%r15), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
movl %ecx, %ecx
cmpq %rcx, %r13
jae 0x3678d
testq %r13, %r13
je 0x36656
movq %rbp, %rdi
leaq 0x5ea3e(%rip), %rsi     # 0x9508b
callq 0x64d0
movq 0x68(%r15), %rax
movl (%rax,%r13,4), %esi
movq %r14, %rdi
callq 0x90a4
movq %rax, 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
movl %r13d, %edx
callq 0x1267e
movl %eax, %ebx
xorl %r15d, %r15d
movq 0x10(%rsp), %rax
cmpl $0x2, 0x18(%rax)
movl $0x0, %eax
jb 0x366d0
movq %r12, %rdi
movq %r14, %rsi
movq 0x8(%rsp), %r12
movq %r12, %rdx
movl %r13d, %ecx
callq 0x16ba6
movl 0x28(%rsp), %r15d
leaq 0x30(%rsp), %rdi
callq 0xb51c
movq %r14, %rbp
movq %r14, %rdi
movq %r12, %rsi
movl %r13d, %edx
callq 0x127d2
andl $0x10, %r15d
shrl $0x4, %r15d
movq %rbp, %r14
leaq 0x28(%rsp), %r12
addl 0xe0(%rsp), %ebx
subq $0x8, %rsp
movzbl %r15b, %r10d
movq %r12, %rdi
movq %r14, %rsi
movl 0x20(%rsp), %edx
movq 0x28(%rsp), %rcx
movl 0x24(%rsp), %r8d
movq 0x18(%rsp), %r9
pushq %r10
pushq %rax
pushq %rbx
callq 0x3619a
addq $0x20, %rsp
testb %r15b, %r15b
je 0x36769
leaq 0x68(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movq (%rsp), %rbp
callq 0x63c0
movq 0x8(%rsp), %r15
movq (%r14), %rax
movq %r14, %rsi
leaq 0x88(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rdx
movq 0x10(%rsp), %rcx
xorl %r8d, %r8d
callq *0x118(%rax)
movq %rbp, %rdi
movq %r12, %rsi
callq 0x64f0
movq %r12, %rdi
callq 0x6548
leaq 0x68(%rsp), %rdi
callq 0x6548
leaq 0x28(%rsp), %r12
jmp 0x3677d
movq (%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
callq 0x64f0
movq 0x8(%rsp), %r15
movq %r12, %rdi
callq 0x6548
incq %r13
jmp 0x36624
leaq 0x5f261(%rip), %rsi     # 0x959f5
movq %rbp, %rdi
callq 0x64d0
movq %rbp, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
leaq 0x28(%rsp), %rdi
callq 0x6548
jmp 0x3680a
jmp 0x367fc
jmp 0x367fc
jmp 0x36803
movq %rax, %r15
leaq 0x88(%rsp), %rdi
callq 0x6548
jmp 0x367db
movq %rax, %r15
leaq 0x68(%rsp), %rdi
callq 0x6548
jmp 0x367ee
jmp 0x367eb
jmp 0x36803
movq %rax, %r15
leaq 0x28(%rsp), %rdi
callq 0x6548
jmp 0x36806
jmp 0x367fc
movq %rax, %r15
jmp 0x3680a
jmp 0x36803
movq %rax, %r15
movq (%rsp), %rbp
movq %rbp, %rdi
callq 0x6548
movq %r15, %rdi
callq 0x64b0