// File: /workspace/github_c_makefile_star2_O2/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), %r12
movq 0xb0(%rdi), %rax
movq %rax, 0x18(%rsp)
movzwl 0xa8(%rdi), %eax
andl $0x3ff, %eax            # imm = 0x3FF
leaq (%r12,%rax,4), %r15
callq 0x16020
leaq 0x21678(%rip), %r13     # 0x34ed0
movq 0x18(%r13), %r8
movzwl 0xa8(%rbx), %r10d
subq $0x8, %rsp
leaq 0x8f8e(%rip), %rdx      # 0x1c7fd
leaq 0x92ea(%rip), %r14      # 0x1cb60
pushq $0x3
popq %rbp
movl %ebp, %edi
xorl %esi, %esi
movq %rax, %rcx
movq %r14, %r9
xorl %eax, %eax
pushq %r10
callq 0x19400
popq %rcx
popq %rdx
callq 0x16020
movq 0x18(%r13), %r8
subq $0x8, %rsp
leaq 0x92cf(%rip), %rdx      # 0x1cb71
movl %ebp, %edi
xorl %esi, %esi
movq %rax, %rcx
movq %r14, %r9
xorl %eax, %eax
pushq %r12
callq 0x19400
popq %rcx
popq %rdx
callq 0x16020
movq 0x18(%r13), %r8
subq $0x8, %rsp
leaq 0x92c9(%rip), %rdx      # 0x1cb94
movl %ebp, %edi
xorl %esi, %esi
movq %rax, %rcx
movq %r14, %r9
xorl %eax, %eax
pushq %r15
callq 0x19400
popq %rcx
popq %rdx
cmpl $0x0, (%r15)
js 0x13976
movq 0x18(%rsp), %rax
movl 0xc8401c(%rax), %r14d
shrl $0x2, %r14d
andl $0x3ff, %r14d           # imm = 0x3FF
cmpw 0xa8(%rbx), %r14w
je 0x1391b
movw %r14w, 0xa8(%rbx)
movzwl %r14w, %eax
leaq (%r12,%rax,4), %r15
callq 0x16020
leaq 0x215a9(%rip), %rcx     # 0x34ed0
movq 0x18(%rcx), %r8
movzwl 0xa8(%rbx), %r10d
leaq 0x927d(%rip), %rdx      # 0x1cbb7
leaq 0x921f(%rip), %r9       # 0x1cb60
pushq $0x3
popq %rdi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
pushq %r10
pushq %r14
callq 0x19400
popq %rcx
popq %rdx
pushq $0x1f
popq %rsi
movq %rbx, %rdi
callq 0x14226
testb %al, %al
je 0x13976
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, 0x8(%rsp)
movl (%r15), %ebp
testl %ebp, %ebp
jns 0x13965
movl %ebp, %r13d
shrl $0x11, %r13d
andl $0x3f, %r13d
cmpl $0x20, %r13d
jb 0x139f0
callq 0x16020
leaq 0x21531(%rip), %rcx     # 0x34ed0
movq 0x10(%rcx), %r8
movl (%r15), %r10d
movl %r10d, %r11d
shrl $0x17, %r11d
andl $0x1, %r11d
shrl $0x1e, %r10d
andl $0x1, %r10d
pushq $0x2
popq %rdi
xorl %esi, %esi
leaq 0x9224(%rip), %rdx      # 0x1cbe9
movq %rax, %rcx
movl %r13d, %r9d
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x19400
popq %rcx
popq %rdx
movq %rbx, %rdi
pushq $0x1f
popq %rsi
callq 0x14226
testb %al, %al
je 0x13af8
jmp 0x13965
movl %r13d, %eax
shll $0x4, %eax
leaq 0x1fde3(%rip), %rcx     # 0x337e0
leaq (%rcx,%rax), %r12
cmpb $0x1, 0x8(%rax,%rcx)
jne 0x13a7c
cmpl $0x1c, %r13d
ja 0x13dcd
movl %r13d, %eax
leaq 0x9014(%rip), %rcx      # 0x1ca30
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x16020
leaq 0x2149f(%rip), %rcx     # 0x34ed0
movq 0x10(%rcx), %r8
movq (%r12), %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
pushq $0x2
popq %rdi
xorl %esi, %esi
leaq 0x91b9(%rip), %rdx      # 0x1cc1f
movq %rax, %rcx
xorl %eax, %eax
pushq %r10
pushq %r14
pushq %r11
callq 0x19400
addq $0x20, %rsp
jmp 0x13ae0
callq 0x16020
leaq 0x21448(%rip), %rcx     # 0x34ed0
movq 0x10(%rcx), %r8
movl (%r15), %r11d
movl %r11d, %r10d
shrl $0x17, %r10d
andl $0x1, %r10d
movl %r11d, %r14d
shrl $0x1e, %r14d
andl $0x1, %r14d
shrl $0x18, %r11d
andl $0x3f, %r11d
movzwl 0xa8(%rbx), %ebp
subq $0x8, %rsp
pushq $0x2
popq %rdi
xorl %esi, %esi
leaq 0x9410(%rip), %rdx      # 0x1ced4
movq %rax, %rcx
movl %r13d, %r9d
xorl %eax, %eax
pushq %rbp
pushq %r11
pushq %r14
pushq %r10
pushq (%r12)
callq 0x19400
addq $0x30, %rsp
movq %rbx, %rdi
movl %r13d, %esi
callq 0x14226
testb %al, %al
movq 0x8(%rsp), %r12
jne 0x13965
andl $0x0, (%r15)
movl 0xa8(%rbx), %eax
incl %eax
movw %ax, 0xa8(%rbx)
andl $0x3ff, %eax            # imm = 0x3FF
leaq (%r12,%rax,4), %r15
jmp 0x1397b
callq 0x16020
leaq 0x213ab(%rip), %rcx     # 0x34ed0
movq 0x10(%rcx), %r8
movq (%r12), %r9
movl (%r15), %r10d
andl $0x7ff, %r10d           # imm = 0x7FF
subq $0x8, %rsp
pushq $0x2
popq %rdi
xorl %esi, %esi
leaq 0x925a(%rip), %rdx      # 0x1cda1
movq %rax, %rcx
xorl %eax, %eax
pushq %r10
callq 0x19400
jmp 0x13e06
movl %ebp, %r13d
shrl $0x18, %r13d
andl $0x3f, %r13d
movl %ebp, %r12d
andl $0x1ffff, %r12d         # imm = 0x1FFFF
callq 0x16020
leaq 0x21357(%rip), %rcx     # 0x34ed0
movq 0x18(%rcx), %r8
subq $0x8, %rsp
pushq $0x3
popq %rdi
xorl %esi, %esi
leaq 0x885c(%rip), %rdx      # 0x1c3e9
movq %rax, %rcx
leaq 0x99de(%rip), %r9       # 0x1d575
xorl %eax, %eax
pushq %r12
callq 0x19400
popq %rcx
popq %rdx
cmpl $0x3, %r12d
je 0x14134
cmpl $0x1, %r12d
jne 0x14162
movq 0xf0(%rbx,%r13,8), %rax
movq 0xb0(%rbx), %rcx
movl %r13d, %edx
shll $0x8, %edx
movl %eax, 0xc80008(%rcx,%rdx)
movl $0x0, 0xc84000(%rcx)
cmpq %rax, 0x2f0(%rbx,%r13,8)
je 0x13c3e
callq 0x16020
movq %rax, %r14
leaq 0x212db(%rip), %rax     # 0x34ed0
movq 0x10(%rax), %rbp
movq 0xf0(%rbx,%r13,8), %r12
movl %r12d, %edi
callq 0x196f4
movq %rax, %r10
pushq $0x2
popq %rdi
xorl %esi, %esi
leaq 0x87fa(%rip), %rdx      # 0x1c412
movq %r14, %rcx
movq %rbp, %r8
movl %r13d, %r9d
xorl %eax, %eax
pushq %r10
pushq %r12
callq 0x19400
popq %rcx
popq %rdx
movq 0xf0(%rbx,%r13,8), %rax
movq %rax, 0x2f0(%rbx,%r13,8)
addq $-0x6, %rax
cmpq $0x2, %rax
movq 0x8(%rsp), %r12
ja 0x141f4
movq $0x3, 0xf0(%rbx,%r13,8)
jmp 0x141f4
movl %ebp, %r13d
shrl $0x18, %r13d
andl $0x3f, %r13d
andl $0x1ffff, %ebp          # imm = 0x1FFFF
callq 0x16020
leaq 0x21251(%rip), %rcx     # 0x34ed0
movq 0x10(%rcx), %r8
movq (%r12), %r9
movl (%r15), %r10d
pushq $0x2
popq %rdi
xorl %esi, %esi
leaq 0x9137(%rip), %rdx      # 0x1cdcd
movq %rax, %rcx
xorl %eax, %eax
pushq %r13
pushq %r10
callq 0x19400
popq %rcx
popq %rdx
cmpl $0x4, %r13d
movl $0x0, %esi
adcl $0x1a, %esi
cmpl $0x4800, %ebp           # imm = 0x4800
jne 0x13ce5
callq 0x16020
leaq 0x2120a(%rip), %rcx     # 0x34ed0
movq (%rcx), %r8
leal -0xa(%r13), %r9d
xorl %edi, %edi
xorl %esi, %esi
leaq 0x9120(%rip), %rdx      # 0x1cdf8
movq %rax, %rcx
xorl %eax, %eax
callq 0x19400
pushq $0x1b
popq %rsi
cmpl $0xa, %r13d
jb 0x13d29
movq 0x18(%rsp), %rax
movl 0xb80890(%rax), %eax
leal -0xa(%r13), %ecx
movzbl %cl, %ecx
btl %ecx, %eax
jb 0x13d29
callq 0x16020
leaq 0x211c2(%rip), %rcx     # 0x34ed0
movq (%rcx), %r8
xorl %edi, %edi
xorl %esi, %esi
leaq 0x910b(%rip), %rdx      # 0x1ce27
movq %rax, %rcx
xorl %eax, %eax
callq 0x19400
pushq $0x1b
popq %rsi
movq %rbx, %rdi
callq 0x14226
testb %al, %al
jne 0x13965
movq 0xb0(%rbx), %r14
movl 0xb80040(%r14), %r12d
testl %r12d, %r12d
je 0x13d73
callq 0x16020
leaq 0x21178(%rip), %rcx     # 0x34ed0
movq (%rcx), %r8
xorl %edi, %edi
xorl %esi, %esi
leaq 0x9819(%rip), %rdx      # 0x1d57f
movq %rax, %rcx
movl %r12d, %r9d
xorl %eax, %eax
callq 0x19400
movq %r14, 0x10(%rsp)
leaq 0xb80c0c(%r14), %rbp
xorl %r12d, %r12d
cmpq $0x20, %r12
je 0x13f9b
movl (%rbp), %r14d
testl %r14d, %r14d
je 0x13dc4
callq 0x16020
leaq 0x2112f(%rip), %rcx     # 0x34ed0
movq (%rcx), %r8
subq $0x8, %rsp
xorl %edi, %edi
xorl %esi, %esi
leaq 0x97fa(%rip), %rdx      # 0x1d5ad
movq %rax, %rcx
movl %r12d, %r9d
xorl %eax, %eax
pushq %r14
callq 0x19400
popq %rcx
popq %rdx
incq %r12
addq $0x10, %rbp
jmp 0x13d82
callq 0x16020
leaq 0x210f7(%rip), %rcx     # 0x34ed0
movq 0x10(%rcx), %r8
movl (%r15), %r10d
andl $0x1ffff, %r10d         # imm = 0x1FFFF
pushq $0x2
popq %rdi
xorl %esi, %esi
leaq 0x90ab(%rip), %rdx      # 0x1ce9e
movq %rax, %rcx
movl %r13d, %r9d
xorl %eax, %eax
pushq %r10
pushq (%r12)
callq 0x19400
popq %rcx
popq %rdx
jmp 0x13ae0
callq 0x16020
leaq 0x210b7(%rip), %rcx     # 0x34ed0
movq 0x10(%rcx), %r8
movq (%r12), %r9
movl (%r15), %r11d
movl %r11d, %r10d
shrl $0x18, %r10d
andl $0x3f, %r10d
movl %r11d, %r14d
andl $0x3f, %r14d
movl %r11d, %r12d
shrl $0x6, %r12d
andl $0x1f, %r12d
shrl $0xb, %r11d
andl $0x3f, %r11d
pushq $0x2
popq %rdi
xorl %esi, %esi
leaq 0x8e11(%rip), %rdx      # 0x1cc66
movq %rax, %rcx
xorl %eax, %eax
pushq %r11
pushq %r12
pushq %r14
pushq %r10
callq 0x19400
addq $0x20, %rsp
movq %rbx, %rdi
pushq $0xb
jmp 0x13f95
callq 0x16020
leaq 0x2104f(%rip), %rcx     # 0x34ed0
movq 0x10(%rcx), %r8
movq (%r12), %r9
movl (%r15), %r11d
movl %r11d, %r10d
andl $0x3, %r10d
movl %r11d, %r14d
shrl $0x2, %r14d
andl $0x3, %r14d
movl %r11d, %r12d
shrl $0x4, %r12d
andl $0x1, %r12d
shrl $0x5, %r11d
andl $0x1f, %r11d
pushq $0x2
popq %rdi
xorl %esi, %esi
leaq 0x8f99(%rip), %rdx      # 0x1ce56
movq %rax, %rcx
xorl %eax, %eax
pushq %r11
pushq %r12
pushq %r14
pushq %r10
callq 0x19400
addq $0x20, %rsp
movq %rbx, %rdi
pushq $0x1c
jmp 0x13f95
callq 0x16020
leaq 0x20fe7(%rip), %rcx     # 0x34ed0
movq 0x10(%rcx), %r8
movq (%r12), %r9
movl (%r15), %r10d
movl %r10d, %r11d
shrl $0x18, %r11d
andl $0x3f, %r11d
andl $0x1ffff, %r10d         # imm = 0x1FFFF
pushq $0x2
popq %rdi
xorl %esi, %esi
leaq 0x8d9d(%rip), %rdx      # 0x1ccaf
movq %rax, %rcx
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x19400
popq %rcx
popq %rdx
movq %rbx, %rdi
pushq $0xd
jmp 0x13f95
shrl $0x18, %ebp
andl $0x3f, %ebp
callq 0x16020
leaq 0x20f95(%rip), %rcx     # 0x34ed0
movq 0x10(%rcx), %r8
movl (%r15), %r10d
movl %r10d, %r11d
shrl $0x18, %r11d
andl $0x3f, %r11d
andl $0x1ffff, %r10d         # imm = 0x1FFFF
cmpl $0x5, %ebp
leaq 0x8e00(%rip), %rdx      # 0x1cd5e
leaq 0x8db9(%rip), %rcx      # 0x1cd1e
cmoveq %rcx, %rdx
movq (%r12), %r9
cmpl $0x4, %ebp
leaq 0x8d68(%rip), %rcx      # 0x1ccdf
cmoveq %rcx, %rdx
pushq $0x2
popq %rdi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x19400
popq %rcx
popq %rdx
movq %rbx, %rdi
pushq $0xf
popq %rsi
jmp 0x13ae6
movq 0x10(%rsp), %r14
movl 0xb80818(%r14), %r12d
testl %r12d, %r12d
je 0x13fd3
callq 0x16020
leaq 0x20f18(%rip), %rcx     # 0x34ed0
movq (%rcx), %r8
xorl %edi, %edi
xorl %esi, %esi
leaq 0x961d(%rip), %rdx      # 0x1d5e3
movq %rax, %rcx
movl %r12d, %r9d
xorl %eax, %eax
callq 0x19400
movl 0xb80890(%r14), %r12d
testl %r12d, %r12d
je 0x14006
callq 0x16020
leaq 0x20ee5(%rip), %rcx     # 0x34ed0
movq (%rcx), %r8
xorl %edi, %edi
xorl %esi, %esi
leaq 0x960c(%rip), %rdx      # 0x1d605
movq %rax, %rcx
movl %r12d, %r9d
xorl %eax, %eax
callq 0x19400
movq %rbx, %rdi
pushq $0x8
popq %rsi
callq 0x19a78
cmpw $0x8, %r13w
jne 0x14046
callq 0x16020
leaq 0x20eac(%rip), %rcx     # 0x34ed0
movq (%rcx), %r8
xorl %edi, %edi
xorl %esi, %esi
leaq 0x95fe(%rip), %rdx      # 0x1d630
movq %rax, %rcx
xorl %eax, %eax
callq 0x19400
movq 0x8(%rsp), %r12
jmp 0x13af8
movzwl %r13w, %eax
leal -0xa(%rax), %ebp
movzwl %bp, %r14d
addl $-0x1b, %eax
cmpw $0x2, %ax
ja 0x14097
callq 0x16020
leaq 0x20e6a(%rip), %rcx     # 0x34ed0
movq (%rcx), %r8
leal -0x11(%r14), %r12d
xorl %edi, %edi
xorl %esi, %esi
leaq 0x95e8(%rip), %rdx      # 0x1d660
movq %rax, %rcx
movl %r12d, %r9d
xorl %eax, %eax
callq 0x19400
movq 0x10(%rsp), %rdi
movl %r12d, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x160d0
cmpw $0x15, %bp
movq 0x8(%rsp), %r12
ja 0x13af8
movl %r14d, %eax
leaq 0x8a10(%rip), %rcx      # 0x1cac0
movzbl (%rax,%rcx), %r13d
pushq $0x1
popq %rbp
movl %ebp, %eax
movl %r14d, %ecx
shll %cl, %eax
movq %r14, 0x20(%rsp)
movq 0x10(%rsp), %r14
movl %eax, 0xb80890(%r14)
movl %ebp, %edi
callq 0xd460
movl %ebp, %eax
movl %r13d, %ecx
shll %cl, %eax
movl %eax, 0xb80044(%r14)
movl %ebp, %edi
callq 0xd460
movl $0x0, 0xb80040(%r14)
movl %ebp, %edi
callq 0xd460
callq 0x16020
leaq 0x20dc6(%rip), %rcx     # 0x34ed0
movq (%rcx), %r8
subq $0x8, %rsp
xorl %edi, %edi
xorl %esi, %esi
leaq 0x9566(%rip), %rdx      # 0x1d682
movq %rax, %rcx
movq 0x28(%rsp), %r9
xorl %eax, %eax
pushq %r13
callq 0x19400
popq %rcx
popq %rdx
jmp 0x13af8
movzwl 0x4fc(%rbx), %eax
movq 0xb0(%rbx), %rcx
shll $0x8, %r13d
movl %eax, 0xc80008(%rcx,%r13)
movl $0x0, 0xc84000(%rcx)
movq 0x8(%rsp), %r12
jmp 0x141f4
cmpw $0x4, %bp
je 0x14177
movzwl %bp, %eax
cmpl $0x5, %eax
jne 0x141a6
movl $0x500, %eax            # imm = 0x500
jmp 0x1417c
movl $0x540, %eax            # imm = 0x540
addq %rbx, %rax
movl %r12d, %ecx
shrl $0x10, %ecx
movl (%rax,%rcx,4), %eax
movq 0xb0(%rbx), %rcx
movl %r13d, %edx
shll $0x8, %edx
movl %eax, 0xc80008(%rcx,%rdx)
movl $0x0, 0xc84000(%rcx)
cmpl $0x2, %r12d
movq 0x8(%rsp), %r12
jne 0x141f4
movl %r13d, %eax
cmpq $0x3, 0xf0(%rbx,%rax,8)
jne 0x141f4
movq $0x4, 0xf0(%rbx,%rax,8)
callq 0x16020
leaq 0x20cf9(%rip), %rcx     # 0x34ed0
movq 0x10(%rcx), %r8
pushq $0x2
popq %rdi
xorl %esi, %esi
leaq 0x825c(%rip), %rdx      # 0x1c443
movq %rax, %rcx
movl %r13d, %r9d
xorl %eax, %eax
callq 0x19400
callq 0x16020
leaq 0x20cd0(%rip), %rcx     # 0x34ed0
movq 0x18(%rcx), %r8
pushq $0x3
popq %rdi
xorl %esi, %esi
leaq 0x7314(%rip), %rdx      # 0x1b524
movq %rax, %rcx
leaq 0x935b(%rip), %r9       # 0x1d575
xorl %eax, %eax
callq 0x19400
jmp 0x13af8