	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_pcie_irq_domain_alloc
_mtk_pcie_irq_domain_alloc:             ## @mtk_pcie_irq_domain_alloc
	.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	%esi, %r14d
	movq	%rdi, %r15
	movq	(%rdi), %rbx
	xorl	%edi, %edi
	cmpl	$1, %edx
	setne	%dil
	callq	_WARN_ON
	movq	%rbx, %rdi
	callq	_mutex_lock
	movl	4(%rbx), %edi
	movq	_MTK_MSI_IRQS_NUM@GOTPCREL(%rip), %r13
	movq	(%r13), %rsi
	callq	_find_first_zero_bit
	cmpq	(%r13), %rax
	jae	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movl	4(%rbx), %esi
	movq	%rax, %rdi
	callq	___set_bit
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movq	(%r15), %r8
	movq	_handle_edge_irq@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rsp)
	movq	_mtk_msi_bottom_irq_chip@GOTPCREL(%rip), %rcx
	movq	%r15, %rdi
	movl	%r14d, %esi
	movq	%r12, %rdx
	callq	_irq_domain_set_info
	xorl	%eax, %eax
	jmp	LBB0_3
LBB0_1:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movq	_ENOSPC@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_3:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTK_MSI_IRQS_NUM,8,3           ## @MTK_MSI_IRQS_NUM
	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.comm	_mtk_msi_bottom_irq_chip,4,2    ## @mtk_msi_bottom_irq_chip
	.comm	_handle_edge_irq,4,2            ## @handle_edge_irq
	.no_dead_strip	_mtk_pcie_irq_domain_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_pcie_irq_domain_alloc
_mtk_pcie_irq_domain_alloc:             ; @mtk_pcie_irq_domain_alloc
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	x21, [x0]
	cmp	w2, #1
	cset	w0, ne
	bl	_WARN_ON
	mov	x0, x21
	bl	_mutex_lock
	ldr	w0, [x21, #4]
Lloh0:
	adrp	x23, _MTK_MSI_IRQS_NUM@GOTPAGE
Lloh1:
	ldr	x23, [x23, _MTK_MSI_IRQS_NUM@GOTPAGEOFF]
	ldr	x1, [x23]
	bl	_find_first_zero_bit
	ldr	x8, [x23]
	cmp	x0, x8
	b.hs	LBB0_2
; %bb.1:
	mov	x22, x0
	ldr	w1, [x21, #4]
	bl	___set_bit
	mov	x0, x21
	bl	_mutex_unlock
	ldr	x4, [x20]
Lloh2:
	adrp	x8, _handle_edge_irq@GOTPAGE
Lloh3:
	ldr	x8, [x8, _handle_edge_irq@GOTPAGEOFF]
Lloh4:
	ldr	w5, [x8]
Lloh5:
	adrp	x3, _mtk_msi_bottom_irq_chip@GOTPAGE
Lloh6:
	ldr	x3, [x3, _mtk_msi_bottom_irq_chip@GOTPAGEOFF]
	mov	x0, x20
	mov	x1, x19
	mov	x2, x22
	mov	x6, #0
	mov	x7, #0
	bl	_irq_domain_set_info
	mov	w0, #0
	b	LBB0_3
LBB0_2:
	mov	x0, x21
	bl	_mutex_unlock
Lloh7:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_MTK_MSI_IRQS_NUM,8,3           ; @MTK_MSI_IRQS_NUM
	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.comm	_mtk_msi_bottom_irq_chip,4,2    ; @mtk_msi_bottom_irq_chip
	.comm	_handle_edge_irq,4,2            ; @handle_edge_irq
	.no_dead_strip	_mtk_pcie_irq_domain_alloc
.subsections_via_symbols
