// File: /workspace/github_cpp_makefile_star2_O2/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 $0xb8, %rsp
movq %r9, %r15
movl %r8d, %ebp
movq %rcx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movq 0xf8(%rsp), %r13
leaq 0x1c(%rsp), %rsi
movl %edx, (%rsi)
leaq 0x678(%r14), %rdi
callq 0x1aeea
testq %rax, %rax
je 0x3591f
movq %rbx, 0x48(%rsp)
leaq 0x50(%rsp), %rbx
andl $0x0, (%rbx)
leaq 0x20(%rsp), %r13
movb $0x0, (%r13)
movl 0x1c(%rsp), %esi
movq %r14, %rdi
callq 0x104b0
movq %rbx, 0x10(%rsp)
movq %r13, 0x8(%rsp)
movl $0x10, (%rsp)
leaq 0x90(%rsp), %r13
xorl %ebx, %ebx
movq %r13, %rdi
movq %r14, %rsi
movq %rax, %rdx
movq %r12, 0x40(%rsp)
movq %r12, %rcx
movl %ebp, %r8d
xorl %r9d, %r9d
callq 0x35a84
movq %r13, %rdi
callq 0x6548
movq 0xf0(%rsp), %rcx
testq %rcx, %rcx
je 0x358d6
cmpl $0x2, 0x18(%r15)
movzbl 0x20(%rsp), %eax
cmovael %eax, %ebx
movb %bl, (%rcx)
movq 0xf8(%rsp), %rax
testq %rax, %rax
je 0x358e6
movb $0x0, (%rax)
movl 0x1c(%rsp), %edx
movl 0x50(%rsp), %eax
movzbl 0x20(%rsp), %ecx
andl $0x0, (%rsp)
movl %ecx, 0x10(%rsp)
movl %eax, 0x8(%rsp)
movq 0x48(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movq 0x40(%rsp), %rcx
movl %ebp, %r8d
movq %r15, %r9
callq 0x3619a
jmp 0x35a32
movq %r12, %r15
leaq 0x6b0(%r14), %rdi
leaq 0x1c(%rsp), %rsi
callq 0x1aeea
testl %ebp, %ebp
je 0x35a04
testq %rax, %rax
je 0x35a04
movl 0x1c(%rsp), %edx
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsp)
movl $0x1, (%rsp)
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rcx
movl %ebp, %r8d
xorl %r9d, %r9d
callq 0x2c79e
leaq 0x50(%rsp), %rdi
pushq $0x1
popq %rdx
pushq $-0x1
popq %rcx
movq %r12, %rsi
callq 0x62b0
leaq 0x20(%rsp), %rdi
callq 0x6548
movq 0xf0(%rsp), %rax
testq %rax, %rax
je 0x3599d
movb $0x0, (%rax)
testq %r13, %r13
je 0x359a7
movb $0x0, (%r13)
movl 0x1c(%rsp), %edx
movq (%r14), %rax
leaq 0x70(%rsp), %rdi
pushq $0x1
popq %rcx
movq %r14, %rsi
callq *0x38(%rax)
leaq 0x63584(%rip), %rdx     # 0x98f47
leaq 0x20(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x50(%rsp), %rcx
callq 0x42137
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x20bb0
leaq 0x20(%rsp), %rdi
callq 0x6548
leaq 0x70(%rsp), %rdi
callq 0x6548
leaq 0x50(%rsp), %rdi
callq 0x6548
jmp 0x35a32
movl 0x1c(%rsp), %edx
andl $0x0, (%rsp)
movq %r13, 0x10(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rcx
movl %ebp, %r8d
xorl %r9d, %r9d
callq 0x2c79e
movq %rbx, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x6548
jmp 0x35a59
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x6548
jmp 0x35a68
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
jmp 0x35a77
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x6548
movq %rbx, %rdi
callq 0x64b0