// File: rossy[P]crossc/SPIRV-Cross/spirv_glsl.cpp
// Function: spirv_cross::CompilerGLSL::flattened_access_chain[abi:cxx11](unsigned int, unsigned int const*, unsigned int, spirv_cross::SPIRType const&, unsigned int, unsigned int, bool)
std::string CompilerGLSL::flattened_access_chain(uint32_t base, const uint32_t *indices, uint32_t count,
                                                 const SPIRType &target_type, uint32_t offset, uint32_t matrix_stride,
                                                 bool need_transpose)
{
	if (!target_type.array.empty())
		SPIRV_CROSS_THROW("Access chains that result in an array can not be flattened");
	else if (target_type.basetype == SPIRType::Struct)
		return flattened_access_chain_struct(base, indices, count, target_type, offset);
	else if (target_type.columns > 1)
		return flattened_access_chain_matrix(base, indices, count, target_type, offset, matrix_stride, need_transpose);
	else
		return flattened_access_chain_vector(base, indices, count, target_type, offset, matrix_stride, need_transpose);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x88(%rbp)
movq %rdi, %rax
movq %rax, -0x80(%rbp)
movb 0x20(%rbp), %al
movl 0x18(%rbp), %r10d
movl 0x10(%rbp), %r10d
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq %r9, -0x30(%rbp)
andb $0x1, %al
movb %al, -0x31(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x30(%rbp), %rdi
addq $0x20, %rdi
callq 0x8690
testb $0x1, %al
jne 0x87215
movb $0x1, -0x6d(%rbp)
movl $0x10, %edi
callq 0x71a0
movq %rax, -0x98(%rbp)
leaq -0x59(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x7650
movq -0x90(%rbp), %rdx
leaq 0xbc976(%rip), %rsi     # 0x143b06
leaq -0x58(%rbp), %rdi
callq 0x7520
jmp 0x8719b
movq -0x98(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x9c50
jmp 0x871ad
movq -0x98(%rbp), %rdi
movb $0x0, -0x6d(%rbp)
leaq 0x126c19(%rip), %rsi    # 0x1addd8
leaq -0x7d536(%rip), %rdx    # 0x9c90
callq 0x7610
jmp 0x872e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x871f3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x7708
leaq -0x59(%rbp), %rdi
callq 0x73d0
testb $0x1, -0x6d(%rbp)
jne 0x87204
jmp 0x87210
movq -0x98(%rbp), %rdi
callq 0x72c0
jmp 0x872da
movq -0x30(%rbp), %rax
cmpl $0xc, 0xc(%rax)
jne 0x87249
movq -0x78(%rbp), %rsi
movq -0x88(%rbp), %rdi
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
movl 0x10(%rbp), %eax
movl %eax, (%rsp)
callq 0x877b0
jmp 0x872cd
movq -0x30(%rbp), %rax
cmpl $0x1, 0x18(%rax)
jbe 0x87291
movq -0x78(%rbp), %rsi
movq -0x88(%rbp), %rdi
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
movl 0x10(%rbp), %r11d
movl 0x18(%rbp), %r10d
movb -0x31(%rbp), %al
andb $0x1, %al
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movzbl %al, %eax
movl %eax, 0x10(%rsp)
callq 0x87b50
jmp 0x872cd
movq -0x78(%rbp), %rsi
movq -0x88(%rbp), %rdi
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
movl 0x10(%rbp), %r11d
movl 0x18(%rbp), %r10d
movb -0x31(%rbp), %al
andb $0x1, %al
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movzbl %al, %eax
movl %eax, 0x10(%rsp)
callq 0x87df0
movq -0x80(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x7640
nopw %cs:(%rax,%rax)