// File: /workspace/github_cpp_makefile_star2_O2/rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::make_constant_null(unsigned int, unsigned int)
void Compiler::make_constant_null(uint32_t id, uint32_t type)
{
	auto &constant_type = get<SPIRType>(type);

	if (!constant_type.array.empty())
	{
		assert(constant_type.parent_type);
		uint32_t parent_id = ir.increase_bound_by(1);
		make_constant_null(parent_id, constant_type.parent_type);

		if (!constant_type.array_size_literal.back())
			SPIRV_CROSS_THROW("Array size of OpConstantNull must be a literal.");

		vector<uint32_t> elements(constant_type.array.back());
		for (uint32_t i = 0; i < constant_type.array.back(); i++)
			elements[i] = parent_id;
		set<SPIRConstant>(id, type, elements.data(), uint32_t(elements.size()), false);
	}
	else if (!constant_type.member_types.empty())
	{
		uint32_t member_ids = ir.increase_bound_by(uint32_t(constant_type.member_types.size()));
		vector<uint32_t> elements(constant_type.member_types.size());
		for (uint32_t i = 0; i < constant_type.member_types.size(); i++)
		{
			make_constant_null(member_ids + i, constant_type.member_types[i]);
			elements[i] = member_ids + i;
		}
		set<SPIRConstant>(id, type, elements.data(), uint32_t(elements.size()), false);
	}
	else
	{
		auto &constant = set<SPIRConstant>(id, type);
		constant.make_null(constant_type);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %ebx
movq %rdi, %r14
movl %edx, 0x4(%rsp)
movl %edx, %esi
callq 0x90a4
movq %rax, %r15
movq 0x20(%rax), %rax
cmpq 0x28(%r15), %rax
je 0x16a0a
cmpl $0x0, 0x9c(%r15)
je 0x16af1
leaq 0x8(%r14), %rdi
pushq $0x1
popq %rsi
callq 0x202bc
movl %eax, %ebp
movl 0x9c(%r15), %edx
movq %r14, %rdi
movl %eax, %esi
callq 0x1692a
movq %r15, %rdi
addq $0x38, %rdi
callq 0x17d30
testq %rdx, (%rax)
je 0x16b10
movq 0x28(%r15), %rax
movl -0x4(%rax), %esi
leaq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x17d5e
movq 0x28(%r15), %rax
movq 0x18(%rsp), %rcx
xorl %edx, %edx
movl -0x4(%rax), %esi
cmpq %rsi, %rdx
jae 0x169cc
movl %ebp, (%rcx,%rdx,4)
incq %rdx
jmp 0x169bc
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movq %rax, (%rcx)
subq %rax, %rdx
shrq $0x2, %rdx
leaq 0x14(%rsp), %r8
movl %edx, (%r8)
leaq 0x3(%rsp), %r9
movb $0x0, (%r9)
leaq 0x4(%rsp), %rdx
movq %r14, %rdi
movl %ebx, %esi
callq 0x17db0
jmp 0x16abc
movq 0x68(%r15), %rax
movq 0x70(%r15), %rsi
cmpq %rsi, %rax
je 0x16ad5
leaq 0x8(%r14), %rdi
subq %rax, %rsi
shrq $0x2, %rsi
callq 0x202bc
movl %eax, %r12d
movq 0x70(%r15), %rsi
subq 0x68(%r15), %rsi
sarq $0x2, %rsi
leaq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x17d5e
xorl %eax, %eax
movl %eax, %r13d
movq 0x68(%r15), %rax
movq 0x70(%r15), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r13, %rcx
jbe 0x16a83
leal (%r12,%r13), %ebp
movl (%rax,%r13,4), %edx
movq %r14, %rdi
movl %ebp, %esi
callq 0x1692a
movq 0x18(%rsp), %rax
movl %ebp, (%rax,%r13,4)
leal 0x1(%r13), %eax
jmp 0x16a4b
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movq %rax, (%rcx)
subq %rax, %rdx
shrq $0x2, %rdx
leaq 0x14(%rsp), %r8
movl %edx, (%r8)
leaq 0x3(%rsp), %r9
movb $0x0, (%r9)
leaq 0x4(%rsp), %rdx
movq %r14, %rdi
movl %ebx, %esi
callq 0x17db0
leaq 0x18(%rsp), %rdi
callq 0x6cf8
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4(%rsp), %rdx
movq %r14, %rdi
movl %ebx, %esi
callq 0x17df2
movq %rax, %rdi
movq %r15, %rsi
callq 0x17e1a
jmp 0x16ac6
leaq 0x79673(%rip), %rdi     # 0x9016b
leaq 0x791da(%rip), %rsi     # 0x8fcd9
leaq 0x7967f(%rip), %rcx     # 0x90185
movl $0xdd3, %edx            # imm = 0xDD3
callq 0x61c0
pushq $0x10
popq %rdi
callq 0x6140
movq %rax, %rbx
leaq 0x796a6(%rip), %rsi     # 0x901c8
leaq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x6100
movb $0x1, %bpl
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x6f6e
xorl %ebp, %ebp
leaq 0xd0276(%rip), %rsi     # 0xe6dc0
movq 0xd148f(%rip), %rdx     # 0xe7fe0
movq %rbx, %rdi
callq 0x6490
jmp 0x16b85
jmp 0x16b80
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x6548
testb %bpl, %bpl
jne 0x16b74
jmp 0x16b92
movq %rax, %r14
movq %rbx, %rdi
callq 0x6200
jmp 0x16b92
jmp 0x16b85
movq %rax, %r14
jmp 0x16b92
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x6cf8
movq %r14, %rdi
callq 0x64b0