// File: rossy[P]crossc/SPIRV-Cross/spirv_glsl.cpp
// Function: spirv_cross::CompilerGLSL::to_array_size[abi:cxx11](spirv_cross::SPIRType const&, unsigned int)
string CompilerGLSL::to_array_size(const SPIRType &type, uint32_t index)
{
	assert(type.array.size() == type.array_size_literal.size());

	// Tessellation control shaders must have either gl_MaxPatchVertices or unsized arrays for input arrays.
	// Opt for unsized as it's the more "correct" variant to use.
	if (type.storage == StorageClassInput && get_entry_point().model == ExecutionModelTessellationControl)
		return "";

	auto &size = type.array[index];
	if (!type.array_size_literal[index])
		return to_expression(size);
	else if (size)
		return convert_to_string(size);
	else if (!backend.flexible_member_array_supported)
	{
		// For runtime-sized arrays, we can work around
		// lack of standard support for this by simply having
		// a single element array.
		//
		// Runtime length arrays must always be the last element
		// in an interface block.
		return "1";
	}
	else
		return "";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x60(%rbp)
movq %rdi, %rax
movq %rax, -0x58(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
callq 0x8650
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
addq $0x38, %rdi
callq 0x3dc60
movq %rax, %rcx
movq -0x48(%rbp), %rax
cmpq %rcx, %rax
jne 0x85c69
jmp 0x85c88
leaq 0xbee3c(%rip), %rdi     # 0x144aac
leaq 0xbb5b5(%rip), %rsi     # 0x14122c
movl $0x214a, %edx           # imm = 0x214A
leaq 0xbeeb9(%rip), %rcx     # 0x144b3c
callq 0x7260
movq -0x18(%rbp), %rax
cmpl $0x1, 0x64(%rax)
jne 0x85cef
movq -0x50(%rbp), %rdi
callq 0x25150
cmpl $0x1, 0xb8(%rax)
jne 0x85cef
leaq -0x1d(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0x7650
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rdx
leaq 0xb8bde(%rip), %rsi     # 0x13e89e
callq 0x7520
jmp 0x85cc7
leaq -0x1d(%rbp), %rdi
callq 0x73d0
jmp 0x85de5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x1d(%rbp), %rdi
callq 0x73d0
jmp 0x85df2
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
movl -0x1c(%rbp), %eax
movl %eax, %esi
callq 0x8570
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
addq $0x38, %rdi
movl -0x1c(%rbp), %eax
movl %eax, %esi
callq 0x118c0
testb $0x1, %al
jne 0x85d33
movq -0x50(%rbp), %rsi
movq -0x60(%rbp), %rdi
movq -0x38(%rbp), %rax
movl (%rax), %edx
callq 0x71b50
jmp 0x85de5
movq -0x38(%rbp), %rax
cmpl $0x0, (%rax)
je 0x85d4e
movq -0x60(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0xa75b0
jmp 0x85de5
movq -0x50(%rbp), %rax
testb $0x1, 0x622(%rax)
jne 0x85da0
leaq -0x39(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0x7650
movq -0x60(%rbp), %rdi
movq -0x70(%rbp), %rdx
leaq 0xbe5e1(%rip), %rsi     # 0x144358
callq 0x7520
jmp 0x85d7e
leaq -0x39(%rbp), %rdi
callq 0x73d0
jmp 0x85de5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x39(%rbp), %rdi
callq 0x73d0
jmp 0x85df2
leaq -0x3a(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0x7650
movq -0x60(%rbp), %rdi
movq -0x78(%rbp), %rdx
leaq 0xb8ae2(%rip), %rsi     # 0x13e89e
callq 0x7520
jmp 0x85dc3
leaq -0x3a(%rbp), %rdi
callq 0x73d0
jmp 0x85de5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x3a(%rbp), %rdi
callq 0x73d0
jmp 0x85df2
movq -0x58(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x7640
nopl (%rax,%rax)