// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/vrb2/vrb2_cfg_app.c
// Function: vrb2_irq_handler
int
vrb2_irq_handler(void *dev)
{
	hw_device *accel_pci_dev = (hw_device *)dev;
	uint32_t *info_ring = (uint32_t *) (accel_pci_dev->info_ring);
	uint32_t *ring_data = info_ring +
				(accel_pci_dev->info_ring_head & VRB2_INFO_RING_MASK);
	uint8_t *bar0addr = accel_pci_dev->bar0Addr;
	uint16_t curr_head, error_type, engine_idx;
	uint32_t int_nb, detailed_info, status;

	LOG(DEBUG, "info_ring_head: %d", accel_pci_dev->info_ring_head);
	LOG(DEBUG, "dev info ring virt:%p", info_ring);
	LOG(DEBUG, "dev ring data virt:%p", ring_data);

	if (!FIELD_GET(INFO_RING_VALID, *ring_data)) {
		/* read the info_ring_head from HW */
		curr_head = (vrb2_reg_read(bar0addr, HWPfHiInfoRingPointerRegPf)
				& VRB2_INFO_RING_PTR_MASK) / sizeof(uint32_t);
		if (curr_head != accel_pci_dev->info_ring_head) {
			accel_pci_dev->info_ring_head = curr_head;
			ring_data = info_ring + (accel_pci_dev->info_ring_head &
				VRB2_INFO_RING_MASK);
		}
		LOG(DEBUG, "No Information Ring available %d %d\n",
			curr_head, accel_pci_dev->info_ring_head);

		if (vrb2_device_error(dev, VRB2_ITR_UNDEFINED))
			return 0;

	}
	while (FIELD_GET(INFO_RING_VALID, *ring_data)) {
		int_nb = FIELD_GET(INFO_RING_INT_NB, *ring_data);
		if (int_nb >= 32) {
			LOG(INFO, "MSI: unexpected Event: %d  msi_0=%ld loop=%ld ",
				int_nb,
				FIELD_GET(INFO_RING_MSI_0, *ring_data),
				FIELD_GET(INFO_RING_LOOP, *ring_data));
			if (vrb2_device_error(dev, VRB2_ITR_UNDEFINED))
				return 0;
		} else if (irdata[int_nb].use_det_info) {
			switch (int_nb) {
			case VRB2_DOORBELL_VFTOPF:
				vrb2_pfvf(dev, FIELD_GET(INFO_RING_VF2PF, *ring_data),
						FIELD_GET(INFO_RING_DET_INFO, *ring_data));
				break;

			case VRB2_QMGR_AQ_OVERFLOW:
			case VRB2_QMGR_DISABLED_ACCESS:
			case VRB2_QMGR_AQ_OVER_THRESHOLD:
			case VRB2_4G_DMA_DL_DESC_IRQ:
			case VRB2_4G_DMA_UL_DESC_IRQ:
			case VRB2_FFT_DESC_IRQ:
			case VRB2_5G_DMA_DL_DESC_IRQ:
			case VRB2_5G_DMA_UL_DESC_IRQ:
			case VRB2_MLD_DESCRIPTOR_IRQ:
				/* These should not happen*/
				LOG(INFO,
					"Unexpected MSI: Event: %s aq_id = 0x%lx qg_id=0x%lx vf_id=0x%lx",
					irdata[int_nb].name,
					FIELD_GET(INFO_RING_DET_INFO_AQ_ID, *ring_data),
					FIELD_GET(INFO_RING_DET_INFO_QG_ID, *ring_data),
					FIELD_GET(INFO_RING_DET_INFO_VF_ID, *ring_data));
				if (vrb2_device_error(dev, int_nb))
					return 0;
				break;

			case VRB2_PAGE_FAULT_ATS_ERROR:
				LOG(INFO, "MSI: Event: %s err_type=%ld aq_id = 0x%lx "
					"qg_id=0x%lx vf_id=0x%lx",
					irdata[int_nb].name,
					FIELD_GET(INFO_RING_ERR_TYPE, *ring_data),
					FIELD_GET(INFO_RING_DET_INFO_AQ_ID, *ring_data),
					FIELD_GET(INFO_RING_DET_INFO_QG_ID, *ring_data),
					FIELD_GET(INFO_RING_DET_INFO_VF_ID, *ring_data));
				if (vrb2_device_error(dev, int_nb))
					return 0;
				break;

			case VRB2_PARITY_ERR:
				LOG(INFO, "MSI: Event: %s err_type=%ld Info = 0x%lx",
					irdata[int_nb].name,
					FIELD_GET(INFO_RING_ERR_TYPE, *ring_data),
					FIELD_GET(INFO_RING_DET_INFO, *ring_data));
				if (vrb2_device_error(dev, int_nb))
					return 0;
				break;

			case VRB2_QMGR_ERROR_DETECTED:
				error_type = FIELD_GET(INFO_RING_ERR_TYPE, *ring_data);
				if (error_type == 4)
					LOG(INFO,
						"MSI: Event: %s err_type =0x%lx AXI Time Out Info= 0x%lx",
						irdata[int_nb].name,
						FIELD_GET(INFO_RING_ERR_TYPE, *ring_data),
						FIELD_GET(INFO_RING_DET_INFO, *ring_data));
				else if (error_type == 5)
					LOG(INFO,
						"MSI: Event: %s err_type =0x%lx ARAM Time Out Info= 0x%lx",
						irdata[int_nb].name,
						FIELD_GET(INFO_RING_ERR_TYPE, *ring_data),
						FIELD_GET(INFO_RING_DET_INFO, *ring_data));
				else
					LOG(INFO,
						"MSI: Event: %s err_type =0x%lx Process Time Out Info= 0x%lx",
						irdata[int_nb].name,
						FIELD_GET(INFO_RING_ERR_TYPE, *ring_data),
						FIELD_GET(INFO_RING_DET_INFO, *ring_data));
				if (vrb2_device_error(dev, int_nb))
					return 0;
				break;

			case VRB2_5G_EXTRA_COMPLETION_RECVD:
			case VRB2_5G_COMPLETION_READ_TIMEOUT:
				LOG(INFO, "MSI: Event: %s fec slice num = 0x%lx",
					irdata[int_nb].name,
					FIELD_GET(INFO_RING_DET_INFO_FEC_SLICE, *ring_data));
				if (vrb2_device_error(dev, int_nb))
					return 0;
				break;

			case VRB2_CORE_HANG_DETECTED:
				error_type = FIELD_GET(INFO_RING_ERR_TYPE, *ring_data);
				detailed_info = FIELD_GET(INFO_RING_DET_INFO, *ring_data);
				LOG(INFO, "MSI: Event: %s Raw %x err_type=0x%x",
					irdata[int_nb].name, *ring_data,
					error_type);
				/* Such error types are actually DMA Fatal errors. */
				if (error_type <= VRB2_CORE_DMA_ERROR)
					int_nb = VRB2_DMA_CLUSTER_HANG_DETECTED;
				/* Core hang recovery failure handled as fatal error. */
				if (detailed_info == VRB2_CORE_RECOVERY_FAILURE) {
					int_nb = VRB2_DMA_CLUSTER_HANG_DETECTED;
					LOG(ERR, "Core hang recovery failure on engine %d",
							error_type - VRB2_ERR_TYPE_OFFSET);
				}

				/* Special handling to catch data corruption after CHR */
				if (error_type >= VRB2_ERR_TYPE_OFFSET) {
					engine_idx = error_type - VRB2_ERR_TYPE_OFFSET;
					status = vrb2_reg_read(bar0addr, HWPfDmaStatusToutProcess);
					/* Core hang reported without processing time out . */
					if ((status & (1 << engine_idx)) == 0) {
						LOG(ERR, "CHR report is due to parity fatal error");
						int_nb = VRB2_DMA_CLUSTER_HANG_DETECTED;
					}
				}

				if (vrb2_device_error(dev, int_nb))
					return 0;
				vrb2_core_hang_recovery(dev, error_type);
				break;

			case VRB2_DOWN_STREAM_HANG_DETECTED:
				LOG(INFO, "MSI: Event: %s slave_id=%ld master_id=%ld "
					"write=%ld trans_id=%ld",
					irdata[int_nb].name,
					FIELD_GET(INFO_RING_DET_INFO_SLAVE_ID, *ring_data),
					FIELD_GET(INFO_RING_DET_INFO_MASTER_ID, *ring_data),
					FIELD_GET(INFO_RING_DET_INFO_WRITE, *ring_data),
					FIELD_GET(INFO_RING_DET_INFO_TRANS_ID, *ring_data));
				if (vrb2_device_error(dev, int_nb))
					return 0;
				break;

			default:
				/* Other cases */
				LOG(INFO, "MSI: Event: int_nb=%d %s detailed_info = 0x%lx",
					int_nb, irdata[int_nb].name,
					FIELD_GET(INFO_RING_DET_INFO, *ring_data));
				if (vrb2_device_error(dev, int_nb))
					return 0;
				break;
			}
		} else {
			/* No additional information */
			LOG(INFO, "MSI: Event: %d  %s msi_0=%ld loop=%ld vf2pf = %ld Ptr %d",
				int_nb, irdata[int_nb].name,
				FIELD_GET(INFO_RING_MSI_0, (uint32_t) *ring_data),
				FIELD_GET(INFO_RING_LOOP, (uint32_t) *ring_data),
				FIELD_GET(INFO_RING_VF2PF, (uint32_t) *ring_data),
				accel_pci_dev->info_ring_head);
			if (vrb2_device_error(dev, int_nb))
				return 0;
		}

		/* Initialize Info Ring entry and move forward */
		*ring_data = 0;
		++accel_pci_dev->info_ring_head;
		ring_data = info_ring + (accel_pci_dev->info_ring_head &
			 VRB2_INFO_RING_MASK);
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x90(%rdi), %rbp
movq 0xb0(%rdi), %r12
movzwl 0xa8(%rdi), %eax
andl $0x3ff, %eax            # imm = 0x3FF
leaq (,%rax,4), %r15
addq %rbp, %r15
callq 0x16854
leaq 0x20226(%rip), %r13     # 0x33ed0
movq 0x18(%r13), %r8
movzwl 0xa8(%rbx), %r10d
subq $0x8, %rsp
leaq 0x8b6c(%rip), %rdx      # 0x1c82d
leaq 0x8ec8(%rip), %r14      # 0x1cb90
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
movq %r14, %r9
xorl %eax, %eax
pushq %r10
callq 0x19ca8
addq $0x10, %rsp
callq 0x16854
movq 0x18(%r13), %r8
subq $0x8, %rsp
leaq 0x8eab(%rip), %rdx      # 0x1cba1
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
movq %r14, %r9
xorl %eax, %eax
pushq %rbp
callq 0x19ca8
addq $0x10, %rsp
callq 0x16854
movq 0x18(%r13), %r8
subq $0x8, %rsp
leaq 0x8ea1(%rip), %rdx      # 0x1cbc4
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
movq %r14, %r9
xorl %eax, %eax
pushq %r15
callq 0x19ca8
addq $0x10, %rsp
cmpl $0x0, (%r15)
movq %r12, 0x20(%rsp)
js 0x13de1
movl 0xc8401c(%r12), %r14d
shrl $0x2, %r14d
andl $0x3ff, %r14d           # imm = 0x3FF
cmpw 0xa8(%rbx), %r14w
je 0x13d80
movw %r14w, 0xa8(%rbx)
movzwl %r14w, %eax
leaq (,%rax,4), %r15
addq %rbp, %r15
callq 0x16854
leaq 0x20144(%rip), %rcx     # 0x33ed0
movq 0x18(%rcx), %r8
movzwl 0xa8(%rbx), %r10d
leaq 0x8e48(%rip), %rdx      # 0x1cbe7
leaq 0x8dea(%rip), %r9       # 0x1cb90
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
pushq %r10
pushq %r14
callq 0x19ca8
addq $0x10, %rsp
movq %rbx, %rdi
movl $0x1f, %esi
callq 0x146f7
testb %al, %al
je 0x13de1
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl (%r15), %r13d
testl %r13d, %r13d
jns 0x13dd0
movl %r13d, %r12d
shrl $0x11, %r12d
andl $0x3f, %r12d
cmpl $0x20, %r12d
jb 0x13e50
callq 0x16854
leaq 0x200ca(%rip), %rcx     # 0x33ed0
movq 0x10(%rcx), %r8
movl (%r15), %r10d
movl %r10d, %r11d
shrl $0x17, %r11d
andl $0x1, %r11d
shrl $0x1e, %r10d
andl $0x1, %r10d
movl $0x2, %edi
xorl %esi, %esi
leaq 0x8deb(%rip), %rdx      # 0x1cc19
movq %rax, %rcx
movl %r12d, %r9d
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x19ca8
addq $0x10, %rsp
movq %rbx, %rdi
movl $0x1f, %esi
jmp 0x144d1
movl %r12d, %eax
shll $0x4, %eax
leaq 0x1e983(%rip), %rcx     # 0x327e0
leaq (%rcx,%rax), %r14
cmpb $0x1, 0x8(%rax,%rcx)
jne 0x13ee0
cmpl $0x1c, %r12d
ja 0x14340
movl %r12d, %eax
leaq 0x8bd4(%rip), %rcx      # 0x1ca50
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x16854
leaq 0x2003f(%rip), %rcx     # 0x33ed0
movq 0x10(%rcx), %r8
movq (%r14), %r9
movl (%r15), %r10d
movl %r10d, %r11d
andl $0x3f, %r11d
movl %r10d, %r14d
shrl $0x6, %r14d
andl $0x1f, %r14d
shrl $0xb, %r10d
andl $0x3f, %r10d
subq $0x8, %rsp
movl $0x2, %edi
xorl %esi, %esi
leaq 0x8d88(%rip), %rdx      # 0x1cc4f
movq %rax, %rcx
xorl %eax, %eax
pushq %r10
pushq %r14
pushq %r11
callq 0x19ca8
addq $0x20, %rsp
jmp 0x144cb
callq 0x16854
leaq 0x1ffe4(%rip), %rcx     # 0x33ed0
movq 0x10(%rcx), %r8
movl (%r15), %r11d
movl %r11d, %r10d
shrl $0x17, %r10d
andl $0x1, %r10d
movl %r11d, %r13d
shrl $0x1e, %r13d
andl $0x1, %r13d
shrl $0x18, %r11d
andl $0x3f, %r11d
movq %r15, (%rsp)
movq %r14, %r15
movq %rbp, %r14
movzwl 0xa8(%rbx), %ebp
subq $0x8, %rsp
movl $0x2, %edi
xorl %esi, %esi
leaq 0x8fd0(%rip), %rdx      # 0x1cf04
movq %rax, %rcx
movl %r12d, %r9d
xorl %eax, %eax
pushq %rbp
movq %r14, %rbp
pushq %r11
pushq %r13
pushq %r10
pushq (%r15)
movq 0x30(%rsp), %r15
callq 0x19ca8
addq $0x30, %rsp
jmp 0x144cb
callq 0x16854
leaq 0x1ff68(%rip), %rcx     # 0x33ed0
movq 0x10(%rcx), %r8
movq (%r14), %r9
movl (%r15), %r10d
andl $0x7ff, %r10d           # imm = 0x7FF
subq $0x8, %rsp
movl $0x2, %edi
xorl %esi, %esi
leaq 0x8e46(%rip), %rdx      # 0x1cdd1
movq %rax, %rcx
xorl %eax, %eax
pushq %r10
jmp 0x144c2
movl %r13d, %r12d
shrl $0x18, %r12d
andl $0x3f, %r12d
movl %r13d, %r14d
andl $0x1ffff, %r14d         # imm = 0x1FFFF
callq 0x16854
leaq 0x1ff18(%rip), %rcx     # 0x33ed0
movq 0x18(%rcx), %r8
subq $0x8, %rsp
movl $0x3, %edi
xorl %esi, %esi
leaq 0x844b(%rip), %rdx      # 0x1c419
movq %rax, %rcx
leaq 0x95cd(%rip), %r9       # 0x1d5a5
xorl %eax, %eax
pushq %r14
callq 0x19ca8
addq $0x10, %rsp
cmpl $0x3, %r14d
je 0x140c8
cmpl $0x1, %r14d
jne 0x140ed
movl %r12d, %esi
movq 0xf0(%rbx,%rsi,8), %rax
movq 0xb0(%rbx), %rcx
movl %r12d, %edx
shll $0x8, %edx
movl %eax, 0xc80008(%rcx,%rdx)
movl $0x0, 0xc84000(%rcx)
cmpq %rax, 0x2f0(%rbx,%rsi,8)
je 0x140a4
movq %rsi, (%rsp)
callq 0x16854
movq %rax, 0x18(%rsp)
leaq 0x1fe8f(%rip), %rax     # 0x33ed0
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
movq (%rsp), %rax
movq 0xf0(%rbx,%rax,8), %rdi
movq %rdi, 0x8(%rsp)
callq 0x19fa0
movq %rax, %r10
movl $0x2, %edi
xorl %esi, %esi
leaq 0x83d1(%rip), %rdx      # 0x1c442
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %r8
movl %r12d, %r9d
xorl %eax, %eax
pushq %r10
pushq 0x10(%rsp)
callq 0x19ca8
movq 0x10(%rsp), %rsi
addq $0x10, %rsp
movq 0xf0(%rbx,%rsi,8), %rax
movq %rax, 0x2f0(%rbx,%rsi,8)
movq 0xf0(%rbx,%rsi,8), %rax
addq $-0x6, %rax
cmpq $0x2, %rax
ja 0x140c2
movq $0x3, 0xf0(%rbx,%rsi,8)
cmpl $0x3, %r14d
jne 0x140ed
movzwl 0x4fc(%rbx), %eax
movq 0xb0(%rbx), %rcx
movl %r12d, %edx
shll $0x8, %edx
movl %eax, 0xc80008(%rcx,%rdx)
movl $0x0, 0xc84000(%rcx)
cmpw $0x4, %r13w
je 0x14649
movzwl %r13w, %eax
cmpl $0x5, %eax
jne 0x14678
movl $0x500, %eax            # imm = 0x500
jmp 0x1464e
movq %r14, (%rsp)
movl %r13d, %r14d
shrl $0x18, %r14d
andl $0x3f, %r14d
andl $0x1ffff, %r13d         # imm = 0x1FFFF
callq 0x16854
leaq 0x1fd9f(%rip), %rcx     # 0x33ed0
movq 0x10(%rcx), %r8
movq (%rsp), %rcx
movq (%rcx), %r9
movl (%r15), %r10d
movl $0x2, %edi
xorl %esi, %esi
leaq 0x8cb0(%rip), %rdx      # 0x1cdfd
movq %rax, %rcx
xorl %eax, %eax
pushq %r14
pushq %r10
callq 0x19ca8
addq $0x10, %rsp
cmpl $0x4, %r14d
movl $0x1b, %eax
cmovbl %eax, %r12d
cmpl $0x4800, %r13d          # imm = 0x4800
jne 0x141a3
callq 0x16854
leaq 0x1fd4f(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
leal -0xa(%r14), %r9d
xorl %edi, %edi
xorl %esi, %esi
leaq 0x8c95(%rip), %rdx      # 0x1ce28
movq %rax, %rcx
xorl %eax, %eax
callq 0x19ca8
movl $0x1b, %r12d
cmpl $0xa, %r14d
jb 0x141ea
movq 0x20(%rsp), %rax
movl 0xb80890(%rax), %eax
leal -0xa(%r14), %ecx
movzbl %cl, %ecx
btl %ecx, %eax
jb 0x141ea
callq 0x16854
leaq 0x1fd04(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
xorl %edi, %edi
xorl %esi, %esi
leaq 0x8c7d(%rip), %rdx      # 0x1ce57
movq %rax, %rcx
xorl %eax, %eax
callq 0x19ca8
movl $0x1b, %r12d
movq %rbx, %rdi
movl %r12d, %esi
callq 0x146f7
testb %al, %al
jne 0x13dd0
movq %r14, (%rsp)
movq 0xb0(%rbx), %r14
movl 0xb80040(%r14), %r12d
testl %r12d, %r12d
je 0x1423b
callq 0x16854
leaq 0x1fcb0(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
xorl %edi, %edi
xorl %esi, %esi
leaq 0x9381(%rip), %rdx      # 0x1d5af
movq %rax, %rcx
movl %r12d, %r9d
xorl %eax, %eax
callq 0x19ca8
movq %r14, 0x8(%rsp)
addq $0xb80c0c, %r14         # imm = 0xB80C0C
xorl %r12d, %r12d
movl (%r14), %r13d
testl %r13d, %r13d
je 0x14283
callq 0x16854
leaq 0x1fc72(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
subq $0x8, %rsp
xorl %edi, %edi
xorl %esi, %esi
leaq 0x936d(%rip), %rdx      # 0x1d5dd
movq %rax, %rcx
movl %r12d, %r9d
xorl %eax, %eax
pushq %r13
callq 0x19ca8
addq $0x10, %rsp
incq %r12
addq $0x10, %r14
cmpq $0x20, %r12
jne 0x1424a
movq 0x8(%rsp), %r13
movl 0xb80818(%r13), %r12d
testl %r12d, %r12d
je 0x142c8
callq 0x16854
leaq 0x1fc23(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
xorl %edi, %edi
xorl %esi, %esi
leaq 0x9358(%rip), %rdx      # 0x1d613
movq %rax, %rcx
movl %r12d, %r9d
xorl %eax, %eax
callq 0x19ca8
movl 0xb80890(%r13), %r12d
testl %r12d, %r12d
movq (%rsp), %r14
je 0x142ff
callq 0x16854
leaq 0x1fbec(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
xorl %edi, %edi
xorl %esi, %esi
leaq 0x9343(%rip), %rdx      # 0x1d635
movq %rax, %rcx
movl %r12d, %r9d
xorl %eax, %eax
callq 0x19ca8
movq %rbx, %rdi
movl $0x8, %esi
callq 0x1a35f
cmpw $0x8, %r14w
jne 0x14509
callq 0x16854
leaq 0x1fbad(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
xorl %edi, %edi
xorl %esi, %esi
leaq 0x932f(%rip), %rdx      # 0x1d660
movq %rax, %rcx
xorl %eax, %eax
callq 0x19ca8
jmp 0x144de
callq 0x16854
leaq 0x1fb84(%rip), %rcx     # 0x33ed0
movq 0x10(%rcx), %r8
movl (%r15), %r10d
andl $0x1ffff, %r10d         # imm = 0x1FFFF
movl $0x2, %edi
xorl %esi, %esi
leaq 0x8b66(%rip), %rdx      # 0x1cece
movq %rax, %rcx
movl %r12d, %r9d
xorl %eax, %eax
pushq %r10
pushq (%r14)
callq 0x19ca8
jmp 0x144c7
callq 0x16854
leaq 0x1fb45(%rip), %rcx     # 0x33ed0
movq 0x10(%rcx), %r8
movq (%r14), %r9
movl (%r15), %r11d
movl %r11d, %r10d
shrl $0x18, %r10d
andl $0x3f, %r10d
movl %r11d, %r14d
andl $0x3f, %r14d
movl %r11d, %r13d
shrl $0x6, %r13d
andl $0x1f, %r13d
shrl $0xb, %r11d
andl $0x3f, %r11d
movl $0x2, %edi
xorl %esi, %esi
leaq 0x88ce(%rip), %rdx      # 0x1cc96
jmp 0x14413
callq 0x16854
leaq 0x1fafa(%rip), %rcx     # 0x33ed0
movq 0x10(%rcx), %r8
movq (%r14), %r9
movl (%r15), %r11d
movl %r11d, %r10d
andl $0x3, %r10d
movl %r11d, %r14d
shrl $0x2, %r14d
andl $0x3, %r14d
movl %r11d, %r13d
shrl $0x4, %r13d
andl $0x1, %r13d
shrl $0x5, %r11d
andl $0x1f, %r11d
movl $0x2, %edi
xorl %esi, %esi
leaq 0x8a73(%rip), %rdx      # 0x1ce86
movq %rax, %rcx
xorl %eax, %eax
pushq %r11
pushq %r13
pushq %r14
pushq %r10
jmp 0x13ed2
callq 0x16854
leaq 0x1fa9f(%rip), %rcx     # 0x33ed0
movq 0x10(%rcx), %r8
movq (%r14), %r9
movl (%r15), %r10d
movl %r10d, %r11d
shrl $0x18, %r11d
andl $0x3f, %r11d
andl $0x1ffff, %r10d         # imm = 0x1FFFF
movl $0x2, %edi
xorl %esi, %esi
leaq 0x8884(%rip), %rdx      # 0x1ccdf
jmp 0x144b9
shrl $0x18, %r13d
andl $0x3f, %r13d
callq 0x16854
leaq 0x1fa5f(%rip), %rcx     # 0x33ed0
movq 0x10(%rcx), %r8
movl (%r15), %r10d
movl %r10d, %r11d
shrl $0x18, %r11d
andl $0x3f, %r11d
andl $0x1ffff, %r10d         # imm = 0x1FFFF
cmpl $0x5, %r13d
leaq 0x88f9(%rip), %rdx      # 0x1cd8e
leaq 0x88b2(%rip), %rcx      # 0x1cd4e
cmoveq %rcx, %rdx
movq (%r14), %r9
cmpl $0x4, %r13d
leaq 0x8861(%rip), %rcx      # 0x1cd0f
cmoveq %rcx, %rdx
movl $0x2, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x19ca8
addq $0x10, %rsp
movq %rbx, %rdi
movl %r12d, %esi
callq 0x146f7
testb %al, %al
jne 0x13dd0
movl $0x0, (%r15)
movl 0xa8(%rbx), %eax
incl %eax
movw %ax, 0xa8(%rbx)
andl $0x3ff, %eax            # imm = 0x3FF
leaq (,%rax,4), %r15
addq %rbp, %r15
jmp 0x13de1
movzwl %r14w, %eax
leal -0xa(%rax), %r14d
movzwl %r14w, %r12d
addl $-0x1b, %eax
cmpw $0x2, %ax
ja 0x145ab
callq 0x16854
leaq 0x1f9a2(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
movq %r12, (%rsp)
movq (%rsp), %rcx
leal -0x11(%rcx), %r12d
xorl %edi, %edi
xorl %esi, %esi
leaq 0x9148(%rip), %rdx      # 0x1d690
movq %rax, %rcx
movl %r12d, %r9d
xorl %eax, %eax
callq 0x19ca8
shll $0xc, %r12d
leal 0xb58004(%r12), %eax
movzbl 0x263c9(%rip), %ecx     # 0x3a931
addl $0x2001, %ecx           # imm = 0x2001
movl %ecx, (%r13,%rax)
movl $0x1, %edi
callq 0xd460
addl $0xb5803c, %r12d        # imm = 0xB5803C
cmpb $0x0, 0x263a6(%rip)     # 0x3a931
movl $0x60, %eax
movl $0x180, %ecx            # imm = 0x180
cmovnel %ecx, %eax
movl %eax, (%r13,%r12)
movq (%rsp), %r12
movl $0x1, %edi
callq 0xd460
cmpw $0x15, %r14w
ja 0x144de
movl %r12d, %eax
leaq 0x8520(%rip), %rcx      # 0x1cae0
movq %r12, %r14
movzbl (%rax,%rcx), %r12d
movl $0x1, %eax
movl %r14d, %ecx
shll %cl, %eax
movl %eax, 0xb80890(%r13)
movl $0x1, %edi
callq 0xd460
movl $0x1, %eax
movl %r12d, %ecx
shll %cl, %eax
movl %eax, 0xb80044(%r13)
movl $0x1, %edi
callq 0xd460
movl $0x0, 0xb80040(%r13)
movl $0x1, %edi
callq 0xd460
callq 0x16854
leaq 0x1f8b1(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
subq $0x8, %rsp
xorl %edi, %edi
xorl %esi, %esi
leaq 0x9081(%rip), %rdx      # 0x1d6b2
movq %rax, %rcx
movl %r14d, %r9d
xorl %eax, %eax
pushq %r12
callq 0x19ca8
addq $0x10, %rsp
jmp 0x144de
movl $0x540, %eax            # imm = 0x540
addq %rbx, %rax
movl %r14d, %ecx
shrl $0x10, %ecx
movl (%rax,%rcx,4), %eax
movq 0xb0(%rbx), %rcx
movl %r12d, %edx
shll $0x8, %edx
movl %eax, 0xc80008(%rcx,%rdx)
movl $0x0, 0xc84000(%rcx)
cmpl $0x2, %r14d
jne 0x146c3
movl %r12d, %eax
cmpq $0x3, 0xf0(%rbx,%rax,8)
jne 0x146c3
movq $0x4, 0xf0(%rbx,%rax,8)
callq 0x16854
leaq 0x1f82c(%rip), %rcx     # 0x33ed0
movq 0x10(%rcx), %r8
movl $0x2, %edi
xorl %esi, %esi
leaq 0x7dbd(%rip), %rdx      # 0x1c473
movq %rax, %rcx
movl %r12d, %r9d
xorl %eax, %eax
callq 0x19ca8
callq 0x16854
leaq 0x1f801(%rip), %rcx     # 0x33ed0
movq 0x18(%rcx), %r8
movl $0x3, %edi
xorl %esi, %esi
leaq 0x6e43(%rip), %rdx      # 0x1b524
movq %rax, %rcx
leaq 0x8eba(%rip), %r9       # 0x1d5a5
xorl %eax, %eax
callq 0x19ca8
jmp 0x144de