	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rockchip_pcie_ep_send_msi_irq
_rockchip_pcie_ep_send_msi_irq:         ## @rockchip_pcie_ep_send_msi_irq
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movl	%esi, %r14d
	movq	%rdi, %r15
	leaq	32(%rdi), %r12
	movl	%esi, %edi
	callq	_ROCKCHIP_PCIE_EP_FUNC_BASE
	movq	_ROCKCHIP_PCIE_EP_MSI_CTRL_REG@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rax
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_rockchip_pcie_read
	movq	_ROCKCHIP_PCIE_EP_MSI_CTRL_ME@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_1
## %bb.2:
	movq	_ROCKCHIP_PCIE_EP_MSI_CTRL_MME_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_ROCKCHIP_PCIE_EP_MSI_CTRL_MME_OFFSET@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movl	$1, %r13d
	movl	%eax, %ecx
	shll	%cl, %r13d
	testl	%ebx, %ebx
	je	LBB0_1
## %bb.3:
	cmpl	%ebx, %r13d
	jl	LBB0_1
## %bb.4:
	leal	-1(%r13), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%r14d, %edi
	callq	_ROCKCHIP_PCIE_EP_FUNC_BASE
	movq	_ROCKCHIP_PCIE_EP_MSI_CTRL_REG@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rax
	movq	_PCI_MSI_DATA_64@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rax
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_rockchip_pcie_read
	negl	%r13d
	andl	%eax, %r13d
	decl	%ebx
	andl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	orl	%r13d, %ebx
	movl	%r14d, %edi
	callq	_ROCKCHIP_PCIE_EP_FUNC_BASE
	movq	_ROCKCHIP_PCIE_EP_MSI_CTRL_REG@GOTPCREL(%rip), %r13
	addq	(%r13), %rax
	movq	_PCI_MSI_ADDRESS_HI@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rax
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_rockchip_pcie_read
	movl	%r14d, %edi
	callq	_ROCKCHIP_PCIE_EP_FUNC_BASE
	addq	(%r13), %rax
	movq	_PCI_MSI_ADDRESS_LO@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rax
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_rockchip_pcie_read
	movl	$63, %edi
	movl	$2, %esi
	callq	_GENMASK_ULL
	xorl	%edi, %edi
	cmpl	%r14d, 4(%r15)
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	24(%r15), %rdx
	decq	%rdx
	movq	_AXI_WRAPPER_MEM_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	16(%r15), %r8d
	movl	$256, (%rsp)                    ## imm = 0x100
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_rockchip_pcie_prog_ep_ob_atu
	movl	%r14d, 4(%r15)
LBB0_6:
	movl	%ebx, %edi
	callq	_writew
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ROCKCHIP_PCIE_EP_MSI_CTRL_REG,8,3 ## @ROCKCHIP_PCIE_EP_MSI_CTRL_REG
	.comm	_ROCKCHIP_PCIE_EP_MSI_CTRL_ME,4,2 ## @ROCKCHIP_PCIE_EP_MSI_CTRL_ME
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ROCKCHIP_PCIE_EP_MSI_CTRL_MME_MASK,4,2 ## @ROCKCHIP_PCIE_EP_MSI_CTRL_MME_MASK
	.comm	_ROCKCHIP_PCIE_EP_MSI_CTRL_MME_OFFSET,4,2 ## @ROCKCHIP_PCIE_EP_MSI_CTRL_MME_OFFSET
	.comm	_PCI_MSI_DATA_64,8,3            ## @PCI_MSI_DATA_64
	.comm	_PCI_MSI_ADDRESS_HI,8,3         ## @PCI_MSI_ADDRESS_HI
	.comm	_PCI_MSI_ADDRESS_LO,8,3         ## @PCI_MSI_ADDRESS_LO
	.comm	_AXI_WRAPPER_MEM_WRITE,4,2      ## @AXI_WRAPPER_MEM_WRITE
	.no_dead_strip	_rockchip_pcie_ep_send_msi_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rockchip_pcie_ep_send_msi_irq
_rockchip_pcie_ep_send_msi_irq:         ; @rockchip_pcie_ep_send_msi_irq
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
	add	x21, x0, #32
	mov	x0, x1
	bl	_ROCKCHIP_PCIE_EP_FUNC_BASE
Lloh0:
	adrp	x23, _ROCKCHIP_PCIE_EP_MSI_CTRL_REG@GOTPAGE
Lloh1:
	ldr	x23, [x23, _ROCKCHIP_PCIE_EP_MSI_CTRL_REG@GOTPAGEOFF]
	ldr	x8, [x23]
	add	x1, x8, x0
	mov	x0, x21
	bl	_rockchip_pcie_read
Lloh2:
	adrp	x8, _ROCKCHIP_PCIE_EP_MSI_CTRL_ME@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ROCKCHIP_PCIE_EP_MSI_CTRL_ME@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_6
; %bb.1:
	cbz	w22, LBB0_6
; %bb.2:
Lloh5:
	adrp	x8, _ROCKCHIP_PCIE_EP_MSI_CTRL_MME_MASK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ROCKCHIP_PCIE_EP_MSI_CTRL_MME_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _ROCKCHIP_PCIE_EP_MSI_CTRL_MME_OFFSET@GOTPAGE
Lloh9:
	ldr	x9, [x9, _ROCKCHIP_PCIE_EP_MSI_CTRL_MME_OFFSET@GOTPAGEOFF]
	and	w8, w8, w0
Lloh10:
	ldr	w9, [x9]
	asr	w8, w8, w9
	mov	w9, #1
	lsl	w24, w9, w8
	cmp	w24, w22
	b.lt	LBB0_6
; %bb.3:
	sub	w25, w24, #1
	mov	x0, x19
	bl	_ROCKCHIP_PCIE_EP_FUNC_BASE
	ldr	x8, [x23]
Lloh11:
	adrp	x9, _PCI_MSI_DATA_64@GOTPAGE
Lloh12:
	ldr	x9, [x9, _PCI_MSI_DATA_64@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	add	x8, x8, x0
	add	x1, x8, x9
	mov	x0, x21
	bl	_rockchip_pcie_read
	neg	w8, w24
	and	w8, w0, w8
	sub	w9, w22, #1
	and	w9, w25, w9
	orr	w22, w8, w9
	mov	x0, x19
	bl	_ROCKCHIP_PCIE_EP_FUNC_BASE
	ldr	x8, [x23]
Lloh14:
	adrp	x9, _PCI_MSI_ADDRESS_HI@GOTPAGE
Lloh15:
	ldr	x9, [x9, _PCI_MSI_ADDRESS_HI@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	add	x8, x8, x0
	add	x1, x8, x9
	mov	x0, x21
	bl	_rockchip_pcie_read
	mov	x0, x19
	bl	_ROCKCHIP_PCIE_EP_FUNC_BASE
	ldr	x8, [x23]
Lloh17:
	adrp	x9, _PCI_MSI_ADDRESS_LO@GOTPAGE
Lloh18:
	ldr	x9, [x9, _PCI_MSI_ADDRESS_LO@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	add	x8, x8, x0
	add	x1, x8, x9
	mov	x0, x21
	bl	_rockchip_pcie_read
	mov	w0, #63
	mov	w1, #2
	bl	_GENMASK_ULL
	ldr	w8, [x20, #4]
	cmp	w8, w19
	cset	w0, ne
	bl	_unlikely
	cbz	x0, LBB0_5
; %bb.4:
	ldr	x8, [x20, #24]
	sub	x2, x8, #1
Lloh20:
	adrp	x8, _AXI_WRAPPER_MEM_WRITE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _AXI_WRAPPER_MEM_WRITE@GOTPAGEOFF]
Lloh22:
	ldr	w3, [x8]
	ldr	w4, [x20, #16]
	mov	x0, x21
	mov	x1, x19
	mov	w6, #256
	bl	_rockchip_pcie_prog_ep_ob_atu
	str	w19, [x20, #4]
LBB0_5:
	mov	x0, x22
	bl	_writew
	mov	w0, #0
	b	LBB0_7
LBB0_6:
Lloh23:
	adrp	x8, _EINVAL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_ROCKCHIP_PCIE_EP_MSI_CTRL_REG,8,3 ; @ROCKCHIP_PCIE_EP_MSI_CTRL_REG
	.comm	_ROCKCHIP_PCIE_EP_MSI_CTRL_ME,4,2 ; @ROCKCHIP_PCIE_EP_MSI_CTRL_ME
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ROCKCHIP_PCIE_EP_MSI_CTRL_MME_MASK,4,2 ; @ROCKCHIP_PCIE_EP_MSI_CTRL_MME_MASK
	.comm	_ROCKCHIP_PCIE_EP_MSI_CTRL_MME_OFFSET,4,2 ; @ROCKCHIP_PCIE_EP_MSI_CTRL_MME_OFFSET
	.comm	_PCI_MSI_DATA_64,8,3            ; @PCI_MSI_DATA_64
	.comm	_PCI_MSI_ADDRESS_HI,8,3         ; @PCI_MSI_ADDRESS_HI
	.comm	_PCI_MSI_ADDRESS_LO,8,3         ; @PCI_MSI_ADDRESS_LO
	.comm	_AXI_WRAPPER_MEM_WRITE,4,2      ; @AXI_WRAPPER_MEM_WRITE
	.no_dead_strip	_rockchip_pcie_ep_send_msi_irq
.subsections_via_symbols
