// File: /workspace/github_cpp_makefile_star2_O3/rossy[P]crossc/SPIRV-Cross/spirv_glsl.cpp
// Function: spirv_cross::CompilerGLSL::access_chain[abi:cxx11](unsigned int, unsigned int const*, unsigned int, spirv_cross::SPIRType const&, bool*, bool*)
string CompilerGLSL::access_chain(uint32_t base, const uint32_t *indices, uint32_t count, const SPIRType &target_type,
                                  bool *out_need_transpose, bool *result_is_packed)
{
	if (flattened_buffer_blocks.count(base))
	{
		uint32_t matrix_stride = 0;
		bool need_transpose = false;
		flattened_access_chain_offset(expression_type(base), indices, count, 0, 16, &need_transpose, &matrix_stride);

		if (out_need_transpose)
			*out_need_transpose = target_type.columns > 1 && need_transpose;
		if (result_is_packed)
			*result_is_packed = false;

		return flattened_access_chain(base, indices, count, target_type, 0, matrix_stride, need_transpose);
	}
	else if (flattened_structs.count(base) && count > 0)
	{
		auto chain = access_chain_internal(base, indices, count, false, true).substr(1);
		if (out_need_transpose)
			*out_need_transpose = false;
		if (result_is_packed)
			*result_is_packed = false;
		return sanitize_underscores(join(to_name(base), "_", chain));
	}
	else
	{
		return access_chain_internal(base, indices, count, false, false, out_need_transpose, result_is_packed);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %r9, %r12
movl %r8d, %ebp
movq %rcx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq 0xe8(%rsp), %r13
leaq 0x4(%rsp), %rsi
movl %edx, (%rsi)
leaq 0x678(%r14), %rdi
callq 0x1f4b4
testq %rax, %rax
je 0x41c76
movq %r12, 0x30(%rsp)
movq %rbx, 0x38(%rsp)
leaq 0x40(%rsp), %rbx
movl $0x0, (%rbx)
leaq 0x8(%rsp), %r12
movb $0x0, (%r12)
movl 0x4(%rsp), %esi
movq %r14, %rdi
callq 0x12a72
subq $0x8, %rsp
leaq 0x88(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %rax, %rdx
movq %r15, 0x30(%rsp)
movq %r15, %rcx
movl %ebp, %r8d
xorl %r9d, %r9d
pushq %rbx
pushq %r12
pushq $0x10
callq 0x41e64
addq $0x20, %rsp
movq (%r13), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x41c0f
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0xe0(%rsp), %rsi
testq %rsi, %rsi
movq 0xe8(%rsp), %rdx
movq 0x30(%rsp), %r9
je 0x41c3a
xorl %eax, %eax
cmpl $0x2, 0x18(%r9)
movzbl 0x8(%rsp), %ecx
cmovbl %eax, %ecx
movb %cl, (%rsi)
testq %rdx, %rdx
movq 0x38(%rsp), %rbx
movq 0x28(%rsp), %rcx
je 0x41c4c
movb $0x0, (%rdx)
movl 0x4(%rsp), %edx
movl 0x40(%rsp), %eax
movzbl 0x8(%rsp), %r10d
subq $0x8, %rsp
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %r8d
pushq %r10
pushq %rax
pushq $0x0
callq 0x4287a
jmp 0x41dd1
leaq 0x6b0(%r14), %rdi
leaq 0x4(%rsp), %rsi
callq 0x1f4b4
testl %ebp, %ebp
je 0x41daa
testq %rax, %rax
je 0x41daa
movl 0x4(%rsp), %edx
subq $0x20, %rsp
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsp)
movl $0x1, (%rsp)
leaq 0x28(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rcx
movl %ebp, %r8d
xorl %r9d, %r9d
callq 0x35194
addq $0x20, %rsp
leaq 0x40(%rsp), %rdi
movl $0x1, %edx
movq %r12, %rsi
movq $-0x1, %rcx
callq 0x6290
leaq 0x18(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
movq 0xe0(%rsp), %r12
je 0x41d08
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
testq %r12, %r12
je 0x41d12
movb $0x0, (%r12)
testq %r13, %r13
je 0x41d1c
movb $0x0, (%r13)
movl 0x4(%rsp), %edx
movq (%r14), %rax
leaq 0x60(%rsp), %rdi
movq %r14, %rsi
movl $0x1, %ecx
callq *0x38(%rax)
leaq 0x7c27d(%rip), %rdx     # 0xbdfb7
leaq 0x8(%rsp), %rdi
leaq 0x60(%rsp), %rsi
leaq 0x40(%rsp), %rcx
callq 0x51f10
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x25974
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x41d72
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x41d8d
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x41dd5
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x41dd5
movl 0x4(%rsp), %edx
subq $0x8, %rsp
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rcx
movl %ebp, %r8d
xorl %r9d, %r9d
pushq %r13
pushq 0xf0(%rsp)
pushq $0x0
callq 0x35194
addq $0x20, %rsp
movq %rbx, %rax
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 0x41e09
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x41e09
movq %rax, %rbx
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x41e29
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x41e29
movq %rax, %rbx
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x41e5c
movq 0x50(%rsp), %rsi
jmp 0x41e54
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x41e5c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0