// File: /workspace/github_cpp_makefile_star2_O3/rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::ActiveBuiltinHandler::handle_builtin(spirv_cross::SPIRType const&, spv::BuiltIn, spirv_cross::Bitset const&)
void Compiler::ActiveBuiltinHandler::handle_builtin(const SPIRType &type, BuiltIn builtin,
                                                    const Bitset &decoration_flags)
{
	// If used, we will need to explicitly declare a new array size for these builtins.

	if (builtin == BuiltInClipDistance)
	{
		if (!type.array_size_literal[0])
			SPIRV_CROSS_THROW("Array size for ClipDistance must be a literal.");
		uint32_t array_size = type.array[0];
		if (array_size == 0)
			SPIRV_CROSS_THROW("Array size for ClipDistance must not be unsized.");
		compiler.clip_distance_count = array_size;
	}
	else if (builtin == BuiltInCullDistance)
	{
		if (!type.array_size_literal[0])
			SPIRV_CROSS_THROW("Array size for CullDistance must be a literal.");
		uint32_t array_size = type.array[0];
		if (array_size == 0)
			SPIRV_CROSS_THROW("Array size for CullDistance must not be unsized.");
		compiler.cull_distance_count = array_size;
	}
	else if (builtin == BuiltInPosition)
	{
		if (decoration_flags.get(DecorationInvariant))
			compiler.position_invariant = true;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
testl %edx, %edx
je 0x19a3e
cmpl $0x4, %edx
je 0x19a1b
cmpl $0x3, %edx
jne 0x19a4f
movq 0x38(%rsi), %rax
testb $0x1, (%rax)
je 0x19ac3
movq 0x20(%rsi), %rax
movl (%rax), %eax
testl %eax, %eax
je 0x19b92
movq 0x8(%rdi), %rcx
movl %eax, 0x350(%rcx)
jmp 0x19a4f
movq 0x38(%rsi), %rax
testb $0x1, (%rax)
je 0x19a5a
movq 0x20(%rsi), %rax
movl (%rax), %eax
testl %eax, %eax
je 0x19b2c
movq 0x8(%rdi), %rcx
movl %eax, 0x354(%rcx)
jmp 0x19a4f
testb $0x4, 0x2(%rcx)
je 0x19a4f
movq 0x8(%rdi), %rax
movb $0x1, 0x358(%rax)
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x6140
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x9b6c1(%rip), %rsi     # 0xb5138
leaq 0x9b6e8(%rip), %rdx     # 0xb5166
leaq 0x8(%rsp), %rdi
callq 0x7be0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x6320
leaq 0xe2329(%rip), %rax     # 0xfbdc8
addq $0x10, %rax
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0xe2301(%rip), %rsi     # 0xfbdb0
movq 0xe3522(%rip), %rdx     # 0xfcfd8
movq %rbx, %rdi
callq 0x6470
jmp 0x19bf6
movl $0x10, %edi
callq 0x6140
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x9b5f8(%rip), %rsi     # 0xb50d8
leaq 0x9b61f(%rip), %rdx     # 0xb5106
leaq 0x8(%rsp), %rdi
callq 0x7be0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x6320
leaq 0xe22c0(%rip), %rax     # 0xfbdc8
addq $0x10, %rax
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0xe2298(%rip), %rsi     # 0xfbdb0
movq 0xe34b9(%rip), %rdx     # 0xfcfd8
movq %rbx, %rdi
callq 0x6470
jmp 0x19bf6
movl $0x10, %edi
callq 0x6140
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x9b61e(%rip), %rsi     # 0xb5167
leaq 0x9b647(%rip), %rdx     # 0xb5197
leaq 0x8(%rsp), %rdi
callq 0x7be0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x6320
leaq 0xe2257(%rip), %rax     # 0xfbdc8
addq $0x10, %rax
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0xe222f(%rip), %rsi     # 0xfbdb0
movq 0xe3450(%rip), %rdx     # 0xfcfd8
movq %rbx, %rdi
callq 0x6470
jmp 0x19bf6
movl $0x10, %edi
callq 0x6140
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x9b558(%rip), %rsi     # 0xb5107
leaq 0x9b581(%rip), %rdx     # 0xb5137
leaq 0x8(%rsp), %rdi
callq 0x7be0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x6320
leaq 0xe21f1(%rip), %rax     # 0xfbdc8
addq $0x10, %rax
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0xe21c9(%rip), %rsi     # 0xfbdb0
movq 0xe33ea(%rip), %rdx     # 0xfcfd8
movq %rbx, %rdi
callq 0x6470
jmp 0x19c02
jmp 0x19c23
jmp 0x19c02
jmp 0x19c23
jmp 0x19c02
jmp 0x19c23
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x19c1c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
testb %bpl, %bpl
jne 0x19c26
jmp 0x19c2e
movq %rax, %r14
movq %rbx, %rdi
callq 0x6200
movq %r14, %rdi
callq 0x64a0