// File: rossy[P]crossc/SPIRV-Cross/spirv_cross_parsed_ir.cpp
// Function: spirv_cross::ParsedIR::set_decoration(unsigned int, spv::Decoration, unsigned int)
void ParsedIR::set_decoration(uint32_t id, Decoration decoration, uint32_t argument)
{
	auto &dec = meta[id].decoration;
	dec.decoration_flags.set(decoration);

	switch (decoration)
	{
	case DecorationBuiltIn:
		dec.builtin = true;
		dec.builtin_type = static_cast<BuiltIn>(argument);
		break;

	case DecorationLocation:
		dec.location = argument;
		break;

	case DecorationComponent:
		dec.component = argument;
		break;

	case DecorationOffset:
		dec.offset = argument;
		break;

	case DecorationArrayStride:
		dec.array_stride = argument;
		break;

	case DecorationMatrixStride:
		dec.matrix_stride = argument;
		break;

	case DecorationBinding:
		dec.binding = argument;
		break;

	case DecorationDescriptorSet:
		dec.set = argument;
		break;

	case DecorationInputAttachmentIndex:
		dec.input_attachment = argument;
		break;

	case DecorationSpecId:
		dec.spec_id = argument;
		break;

	case DecorationIndex:
		dec.index = argument;
		break;

	case DecorationHlslCounterBufferGOOGLE:
		meta[id].hlsl_magic_counter_buffer = argument;
		meta[id].hlsl_is_magic_counter_buffer = true;
		break;

	default:
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
addq $0x30, %rdi
movl -0xc(%rbp), %eax
movl %eax, %esi
callq 0xead0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
addq $0x60, %rdi
movl -0x10(%rbp), %esi
callq 0x300d0
movl -0x10(%rbp), %eax
movl %eax, -0x24(%rbp)
subl $0x1, %eax
je 0x5493b
jmp 0x54800
movl -0x24(%rbp), %eax
subl $0x6, %eax
je 0x548ea
jmp 0x5480e
movl -0x24(%rbp), %eax
subl $0x7, %eax
je 0x548fc
jmp 0x5481c
movl -0x24(%rbp), %eax
subl $0xb, %eax
je 0x54897
jmp 0x54826
movl -0x24(%rbp), %eax
subl $0x1e, %eax
je 0x548b4
jmp 0x54834
movl -0x24(%rbp), %eax
subl $0x1f, %eax
je 0x548c6
jmp 0x54842
movl -0x24(%rbp), %eax
subl $0x20, %eax
je 0x5494a
jmp 0x54850
movl -0x24(%rbp), %eax
subl $0x21, %eax
je 0x5490e
jmp 0x5485e
movl -0x24(%rbp), %eax
subl $0x22, %eax
je 0x5491d
jmp 0x5486c
movl -0x24(%rbp), %eax
subl $0x23, %eax
je 0x548d8
jmp 0x54876
movl -0x24(%rbp), %eax
subl $0x2b, %eax
je 0x5492c
jmp 0x54884
movl -0x24(%rbp), %eax
subl $0x1602, %eax           # imm = 0x1602
je 0x54959
jmp 0x54995
movq -0x20(%rbp), %rax
movb $0x1, 0xcc(%rax)
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xa0(%rax)
jmp 0x54997
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xa4(%rax)
jmp 0x54997
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xa8(%rax)
jmp 0x54997
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xb4(%rax)
jmp 0x54997
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xb8(%rax)
jmp 0x54997
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xbc(%rax)
jmp 0x54997
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xb0(%rax)
jmp 0x54997
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xac(%rax)
jmp 0x54997
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xc0(%rax)
jmp 0x54997
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xc4(%rax)
jmp 0x54997
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xc8(%rax)
jmp 0x54997
movq -0x30(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, -0x34(%rbp)
addq $0x30, %rdi
movl -0xc(%rbp), %eax
movl %eax, %esi
callq 0xead0
movl -0x34(%rbp), %ecx
movq -0x30(%rbp), %rdi
movl %ecx, 0x144(%rax)
addq $0x30, %rdi
movl -0xc(%rbp), %eax
movl %eax, %esi
callq 0xead0
movb $0x1, 0x141(%rax)
jmp 0x54997
jmp 0x54997
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)