// File: rossy[P]crossc/SPIRV-Cross/spirv_glsl.cpp
// Function: spirv_cross::CompilerGLSL::constant_expression[abi:cxx11](spirv_cross::SPIRConstant const&)
string CompilerGLSL::constant_expression(const SPIRConstant &c)
{
	if (!c.subconstants.empty())
	{
		auto &type = get<SPIRType>(c.constant_type);

		// Handles Arrays and structures.
		string res;
		if (backend.use_initializer_list && backend.use_typed_initializer_list && type.basetype == SPIRType::Struct &&
		    type.array.empty())
		{
			res = type_to_glsl_constructor(type) + "{ ";
		}
		else if (backend.use_initializer_list)
		{
			res = "{ ";
		}
		else
		{
			res = type_to_glsl_constructor(type) + "(";
		}

		for (auto &elem : c.subconstants)
		{
			auto &subc = get<SPIRConstant>(elem);
			if (subc.specialization && options.vulkan_semantics)
				res += to_name(elem);
			else
				res += constant_expression(subc);

			if (&elem != &c.subconstants.back())
				res += ", ";
		}

		res += backend.use_initializer_list ? " }" : ")";
		return res;
	}
	else if (c.columns() == 1)
	{
		return constant_expression_vector(c, 0);
	}
	else
	{
		string res = type_to_glsl(get<SPIRType>(c.constant_type)) + "(";
		for (uint32_t col = 0; col < c.columns(); col++)
		{
			if (options.vulkan_semantics && c.specialization_constant_id(col) != 0)
				res += to_name(c.specialization_constant_id(col));
			else
				res += constant_expression_vector(c, col);

			if (col + 1 < c.columns())
				res += ", ";
		}
		res += ")";
		return res;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
movq %rdi, -0x1a8(%rbp)
movq %rdi, %rax
movq %rax, -0x1a0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0x18(%rbp), %rdi
addq $0x110, %rdi            # imm = 0x110
callq 0x8690
testb $0x1, %al
jne 0x64fc9
movq -0x198(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0xc(%rax), %esi
callq 0xea90
movq -0x1a8(%rbp), %rdi
movq %rax, -0x20(%rbp)
movb $0x0, -0x21(%rbp)
callq 0x7530
movq -0x198(%rbp), %rax
testb $0x1, 0x624(%rax)
je 0x64cf9
movq -0x198(%rbp), %rax
testb $0x1, 0x625(%rax)
je 0x64cf9
movq -0x20(%rbp), %rax
cmpl $0xc, 0xc(%rax)
jne 0x64cf9
movq -0x20(%rbp), %rdi
addq $0x20, %rdi
callq 0x8690
testb $0x1, %al
jne 0x64c7b
jmp 0x64cf9
movq -0x198(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x68(%rbp), %rdi
callq 0x72bf0
jmp 0x64c91
leaq 0xdd9d1(%rip), %rdx     # 0x142669
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x11910
jmp 0x64ca7
movq -0x1a8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x7430
leaq -0x48(%rbp), %rdi
callq 0x7708
leaq -0x68(%rbp), %rdi
callq 0x7708
jmp 0x64da1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x64fb8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x7708
jmp 0x64fb8
movq -0x198(%rbp), %rax
testb $0x1, 0x624(%rax)
je 0x64d20
movq -0x1a8(%rbp), %rdi
leaq 0xdd952(%rip), %rsi     # 0x142669
callq 0x7510
jmp 0x64d1e
jmp 0x64d9f
movq -0x198(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0xb8(%rbp), %rdi
callq 0x72bf0
jmp 0x64d39
leaq 0xe85ed(%rip), %rdx     # 0x14d32d
leaq -0x98(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x11910
jmp 0x64d55
movq -0x1a8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x7430
leaq -0x98(%rbp), %rdi
callq 0x7708
leaq -0xb8(%rbp), %rdi
callq 0x7708
jmp 0x64d9f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x7708
jmp 0x64fb8
jmp 0x64da1
movq -0x18(%rbp), %rax
addq $0x110, %rax            # imm = 0x110
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rdi
callq 0xbaf0
movq %rax, -0xc8(%rbp)
movq -0xc0(%rbp), %rdi
callq 0xbb20
movq %rax, -0xd0(%rbp)
leaq -0xc8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x2e710
testb $0x1, %al
jne 0x64df4
jmp 0x64f6d
leaq -0xc8(%rbp), %rdi
callq 0x2e750
movq -0x198(%rbp), %rdi
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rax
movl (%rax), %esi
callq 0x31910
movq %rax, -0x1b0(%rbp)
jmp 0x64e25
movq -0x1b0(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rax
testb $0x1, 0x108(%rax)
je 0x64eba
movq -0x198(%rbp), %rax
testb $0x1, 0x43e(%rax)
je 0x64eba
movq -0x198(%rbp), %rsi
movq -0xd8(%rbp), %rax
movl (%rax), %edx
movq (%rsi), %rax
movq 0x38(%rax), %rax
leaq -0x100(%rbp), %rdi
movl $0x1, %ecx
callq *%rax
jmp 0x64e7a
movq -0x1a8(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x7470
jmp 0x64e8f
leaq -0x100(%rbp), %rdi
callq 0x7708
jmp 0x64f16
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x7708
jmp 0x64fb8
movq -0x198(%rbp), %rsi
movq -0xe0(%rbp), %rdx
leaq -0x120(%rbp), %rdi
callq 0x64bc0
jmp 0x64ed6
movq -0x1a8(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x7470
jmp 0x64eeb
leaq -0x120(%rbp), %rdi
callq 0x7708
jmp 0x64f16
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x7708
jmp 0x64fb8
movq -0xd8(%rbp), %rax
movq %rax, -0x1b8(%rbp)
movq -0x18(%rbp), %rdi
addq $0x110, %rdi            # imm = 0x110
callq 0x2fe30
movq %rax, %rcx
movq -0x1b8(%rbp), %rax
cmpq %rcx, %rax
je 0x64f5a
movq -0x1a8(%rbp), %rdi
leaq 0xdf63e(%rip), %rsi     # 0x14458f
callq 0x7340
jmp 0x64f58
jmp 0x64f5a
jmp 0x64f5c
leaq -0xc8(%rbp), %rdi
callq 0x2e770
jmp 0x64dd8
movq -0x1a8(%rbp), %rdi
movq -0x198(%rbp), %rax
movb 0x624(%rax), %cl
leaq 0xdd6e4(%rip), %rax     # 0x14266c
leaq 0xdff6a(%rip), %rsi     # 0x144ef9
testb $0x1, %cl
cmovneq %rax, %rsi
callq 0x7340
jmp 0x64f9d
movb $0x1, -0x21(%rbp)
testb $0x1, -0x21(%rbp)
jne 0x64fb3
movq -0x1a8(%rbp), %rdi
callq 0x7708
jmp 0x65285
movq -0x1a8(%rbp), %rdi
callq 0x7708
jmp 0x65295
movq -0x18(%rbp), %rdi
callq 0xa1940
cmpl $0x1, %eax
jne 0x64ff9
movq -0x198(%rbp), %rsi
movq -0x1a8(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq (%rsi), %rax
xorl %ecx, %ecx
callq *0xb8(%rax)
jmp 0x65285
movq -0x198(%rbp), %rdi
movb $0x0, -0x121(%rbp)
movq -0x18(%rbp), %rax
movl 0xc(%rax), %esi
callq 0xea90
movq -0x198(%rbp), %rsi
movq %rax, %rdx
movq (%rsi), %rax
movq 0x98(%rax), %rax
leaq -0x148(%rbp), %rdi
movq %rdi, -0x1c0(%rbp)
xorl %ecx, %ecx
callq *%rax
movq -0x1a8(%rbp), %rdi
movq -0x1c0(%rbp), %rsi
leaq 0xe82df(%rip), %rdx     # 0x14d32d
callq 0x11910
jmp 0x65055
leaq -0x148(%rbp), %rdi
callq 0x7708
movl $0x0, -0x14c(%rbp)
movl -0x14c(%rbp), %eax
movl %eax, -0x1c8(%rbp)
movq -0x18(%rbp), %rdi
callq 0xa1940
movl %eax, -0x1c4(%rbp)
jmp 0x65088
movl -0x1c8(%rbp), %eax
movl -0x1c4(%rbp), %ecx
cmpl %ecx, %eax
jae 0x65244
movq -0x198(%rbp), %rax
testb $0x1, 0x43e(%rax)
je 0x65182
movq -0x18(%rbp), %rdi
movl -0x14c(%rbp), %esi
callq 0xa1960
movl %eax, -0x1cc(%rbp)
jmp 0x650c7
movl -0x1cc(%rbp), %eax
cmpl $0x0, %eax
je 0x65182
movq -0x18(%rbp), %rdi
movl -0x14c(%rbp), %esi
callq 0xa1960
movl %eax, -0x1d0(%rbp)
jmp 0x650ed
movl -0x1d0(%rbp), %edx
movq -0x198(%rbp), %rsi
movq (%rsi), %rax
movq 0x38(%rax), %rax
leaq -0x170(%rbp), %rdi
movl $0x1, %ecx
callq *%rax
jmp 0x65111
movq -0x1a8(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x7470
jmp 0x65126
leaq -0x170(%rbp), %rdi
callq 0x7708
jmp 0x651e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x7708
jmp 0x65295
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x65277
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x7708
jmp 0x65277
movq -0x198(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x14c(%rbp), %ecx
movq (%rsi), %rax
movq 0xb8(%rax), %rax
leaq -0x190(%rbp), %rdi
callq *%rax
jmp 0x651a8
movq -0x1a8(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x7470
jmp 0x651bd
leaq -0x190(%rbp), %rdi
callq 0x7708
jmp 0x651e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x7708
jmp 0x65277
movl -0x14c(%rbp), %eax
incl %eax
movl %eax, -0x1d8(%rbp)
movq -0x18(%rbp), %rdi
callq 0xa1940
movl %eax, -0x1d4(%rbp)
jmp 0x65207
movl -0x1d8(%rbp), %eax
movl -0x1d4(%rbp), %ecx
cmpl %ecx, %eax
jae 0x6522e
movq -0x1a8(%rbp), %rdi
leaq 0xdf36a(%rip), %rsi     # 0x14458f
callq 0x7340
jmp 0x6522c
jmp 0x6522e
jmp 0x65230
movl -0x14c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14c(%rbp)
jmp 0x6506b
movq -0x1a8(%rbp), %rdi
leaq 0xdfca7(%rip), %rsi     # 0x144ef9
callq 0x7340
jmp 0x65259
movb $0x1, -0x121(%rbp)
testb $0x1, -0x121(%rbp)
jne 0x65275
movq -0x1a8(%rbp), %rdi
callq 0x7708
jmp 0x65285
movq -0x1a8(%rbp), %rdi
callq 0x7708
jmp 0x65295
movq -0x1a0(%rbp), %rax
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
movq -0x70(%rbp), %rdi
callq 0x7640
nop