// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_glsl.cpp
// Function: spirv_cross::CompilerGLSL::emit_buffer_block_flattened(spirv_cross::SPIRVariable const&)
void CompilerGLSL::emit_buffer_block_flattened(const SPIRVariable &var)
{
	auto &type = get<SPIRType>(var.basetype);

	// Block names should never alias.
	auto buffer_name = to_name(type.self, false);
	size_t buffer_size = (get_declared_struct_size(type) + 15) / 16;

	SPIRType::BaseType basic_type;
	if (get_common_basic_type(type, basic_type))
	{
		SPIRType tmp;
		tmp.basetype = basic_type;
		tmp.vecsize = 4;
		if (basic_type != SPIRType::Float && basic_type != SPIRType::Int && basic_type != SPIRType::UInt)
			SPIRV_CROSS_THROW("Basic types in a flattened UBO must be float, int or uint.");

		auto flags = ir.get_buffer_block_flags(var);
		statement("uniform ", flags_to_precision_qualifiers_glsl(tmp, flags), type_to_glsl(tmp), " ", buffer_name, "[",
		          buffer_size, "];");
	}
	else
		SPIRV_CROSS_THROW("All basic types in a flattened block must be the same.");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movq %rsi, %r14
movq %rdi, %rbx
movl 0xc(%rsi), %esi
callq 0xa426
movq %rax, %r15
movl 0x8(%rax), %edx
movq (%rbx), %rax
leaq 0x40(%rsp), %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
callq *0x38(%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x158c2
addq $0xf, %rax
shrq $0x4, %rax
movq %rax, 0x18(%rsp)
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x19f94
testb %al, %al
je 0x2b077
xorl %eax, %eax
leaq 0x170(%rsp), %rcx
movl %eax, -0xc8(%rcx)
leaq 0xd253e(%rip), %r15     # 0xfd3b0
addq $0x10, %r15
movq %r15, -0xd0(%rcx)
movaps 0x8ad7c(%rip), %xmm0    # 0xb5c00
movups %xmm0, -0xc4(%rcx)
movq %rax, -0x88(%rcx)
movl %eax, -0x80(%rcx)
movq %rax, -0x78(%rcx)
movb $0x0, -0x70(%rcx)
xorps %xmm0, %xmm0
movups %xmm0, -0xb0(%rcx)
movups %xmm0, -0xa0(%rcx)
movl %eax, -0x90(%rcx)
movl $0x8, -0x6c(%rcx)
movups %xmm0, -0x68(%rcx)
movq %rax, -0x58(%rcx)
movq %rax, -0x38(%rcx)
movq %rcx, -0x30(%rcx)
movq $0x1, -0x28(%rcx)
movups %xmm0, -0x20(%rcx)
movl $0x3f800000, -0x10(%rcx) # imm = 0x3F800000
movups %xmm0, -0x8(%rcx)
movl 0xc(%rsp), %eax
movl %eax, -0xc4(%rcx)
movl $0x4, -0xbc(%rcx)
leal -0x4(%rax), %ecx
cmpl $0x2, %ecx
jb 0x2af07
cmpl $0xa, %eax
jne 0x2b0e6
leaq 0x8(%rbx), %rsi
leaq 0x60(%rsp), %rdi
movq %r14, %rdx
callq 0x24ca0
leaq 0xa0(%rsp), %rsi
leaq 0x60(%rsp), %rdx
movq %rbx, %rdi
callq 0x2beea
movq %rax, 0x10(%rsp)
movq (%rbx), %rax
leaq 0x20(%rsp), %rdi
leaq 0xa0(%rsp), %rdx
movq %rbx, %rsi
xorl %ecx, %ecx
callq *0x98(%rax)
subq $0x8, %rsp
leaq 0x92b82(%rip), %rax     # 0xbdada
leaq 0x20(%rsp), %r10
leaq 0x98db8(%rip), %r11     # 0xc3d1c
leaq 0x8d0bd(%rip), %rsi     # 0xb8028
leaq 0x8a93c(%rip), %r8      # 0xb58ae
leaq 0x18(%rsp), %rdx
leaq 0x28(%rsp), %rcx
leaq 0x48(%rsp), %r9
movq %rbx, %rdi
pushq %rax
pushq %r10
pushq %r11
callq 0x5258c
addq $0x20, %rsp
leaq 0x140(%rsp), %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2afb5
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x68(%rsp), %rdi
callq 0xd5b0
movq %r15, 0xa0(%rsp)
movq %rbx, %rdi
callq 0xdeb6
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
je 0x2afec
movq 0x118(%rsp), %rsi
subq %rdi, %rsi
callq 0x6260
movq 0xd8(%rsp), %rdi
testq %rdi, %rdi
je 0x2b031
movq 0xf8(%rsp), %rsi
subq %rdi, %rsi
callq 0x6260
xorl %eax, %eax
movq %rax, 0xd8(%rsp)
movl %eax, 0xe0(%rsp)
movq %rax, 0xe8(%rsp)
movl %eax, 0xf0(%rsp)
movq %rax, 0xf8(%rsp)
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x2b04e
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x6260
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b069
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x6260
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x6140
movq %rax, %r14
leaq 0xb0(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x8cfd5(%rip), %rsi     # 0xb806c
leaq 0x8d004(%rip), %rdx     # 0xb80a2
leaq 0xa0(%rsp), %rdi
callq 0x7c64
movb $0x1, %bpl
leaq 0xa0(%rsp), %rsi
movq %r14, %rdi
callq 0x6320
leaq 0xd1cd3(%rip), %rax     # 0xfcd98
addq $0x10, %rax
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0xd1cab(%rip), %rsi     # 0xfcd80
movq 0xd2efc(%rip), %rdx     # 0xfdfd8
movq %r14, %rdi
callq 0x6470
jmp 0x2b14a
movl $0x10, %edi
callq 0x6140
movq %rax, %r14
leaq 0x70(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x8cf2e(%rip), %rsi     # 0xb8031
leaq 0x8cf61(%rip), %rdx     # 0xb806b
leaq 0x60(%rsp), %rdi
callq 0x7c64
movb $0x1, %bpl
leaq 0x60(%rsp), %rsi
movq %r14, %rdi
callq 0x6320
leaq 0xd1c6d(%rip), %rax     # 0xfcd98
addq $0x10, %rax
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0xd1c45(%rip), %rsi     # 0xfcd80
movq 0xd2e96(%rip), %rdx     # 0xfdfd8
movq %r14, %rdi
callq 0x6470
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x2b16c
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x2b16c
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x2b1e6
movq %r14, %rdi
callq 0x6200
jmp 0x2b1e6
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r15, %rdi
je 0x2b1a3
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x2b1a3
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x2b1fa
movq %r14, %rdi
callq 0x6200
jmp 0x2b1fa
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b1d7
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x2b1d7
jmp 0x2b1d4
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0xd5b0
jmp 0x2b1e6
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x1c438
jmp 0x2b1fa
jmp 0x2b1f7
movq %rax, %rbx
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b215
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0
nop