	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ls_scfg_msi_domain_irq_alloc
_ls_scfg_msi_domain_irq_alloc:          ## @ls_scfg_msi_domain_irq_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%esi, %r12d
	movq	%rdi, %r15
	movq	(%rdi), %rbx
	xorl	%edi, %edi
	cmpl	$1, %edx
	setne	%dil
	callq	_WARN_ON
	leaq	8(%rbx), %r14
	movq	%r14, %rdi
	callq	_spin_lock
	movl	(%rbx), %esi
	movl	12(%rbx), %edi
	callq	_find_first_zero_bit
	movl	%eax, %r13d
	cmpl	(%rbx), %eax
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	jge	LBB0_4
## %bb.1:
	movl	12(%rbx), %esi
	movl	%r13d, %edi
	callq	___set_bit
	movq	%r14, %rdi
	callq	_spin_unlock
	jmp	LBB0_2
LBB0_4:
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%r14, %rdi
	callq	_spin_unlock
	testl	%r12d, %r12d
	je	LBB0_2
## %bb.5:
	negl	%r12d
	jmp	LBB0_6
LBB0_2:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movl	4(%rbx), %esi
	callq	_iommu_dma_prepare_msi
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_6
## %bb.3:
	movq	_handle_simple_irq@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rsp)
	movq	_ls_scfg_msi_parent_chip@GOTPCREL(%rip), %rcx
	movq	%r15, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%r13d, %edx
	movq	%rbx, %r8
	callq	_irq_domain_set_info
	xorl	%r12d, %r12d
LBB0_6:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.comm	_ls_scfg_msi_parent_chip,4,2    ## @ls_scfg_msi_parent_chip
	.comm	_handle_simple_irq,4,2          ## @handle_simple_irq
	.no_dead_strip	_ls_scfg_msi_domain_irq_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ls_scfg_msi_domain_irq_alloc
_ls_scfg_msi_domain_irq_alloc:          ; @ls_scfg_msi_domain_irq_alloc
	.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, x3
	mov	x20, x1
	mov	x21, x0
	ldr	x19, [x0]
	cmp	w2, #1
	cset	w0, ne
	bl	_WARN_ON
	add	x24, x19, #8
	mov	x0, x24
	bl	_spin_lock
	ldr	w0, [x19, #12]
	ldr	w1, [x19]
	bl	_find_first_zero_bit
	mov	x23, x0
	ldr	w8, [x19]
	cmp	w0, w8
	b.ge	LBB0_2
; %bb.1:
	ldr	w1, [x19, #12]
	mov	x0, x23
	bl	___set_bit
	mov	x0, x24
	bl	_spin_unlock
	b	LBB0_4
LBB0_2:
Lloh0:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh2:
	ldr	w25, [x8]
	mov	x0, x24
	bl	_spin_unlock
	cbz	w25, LBB0_4
; %bb.3:
	neg	w0, w25
	b	LBB0_6
LBB0_4:
	ldr	w0, [x22]
	ldr	w1, [x19, #4]
	bl	_iommu_dma_prepare_msi
	cbnz	w0, LBB0_6
; %bb.5:
Lloh3:
	adrp	x8, _handle_simple_irq@GOTPAGE
Lloh4:
	ldr	x8, [x8, _handle_simple_irq@GOTPAGEOFF]
Lloh5:
	ldr	w5, [x8]
Lloh6:
	adrp	x3, _ls_scfg_msi_parent_chip@GOTPAGE
Lloh7:
	ldr	x3, [x3, _ls_scfg_msi_parent_chip@GOTPAGEOFF]
	mov	x0, x21
	mov	x1, x20
	mov	x2, x23
	mov	x4, x19
	mov	x6, #0
	mov	x7, #0
	bl	_irq_domain_set_info
	mov	w0, #0
LBB0_6:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.comm	_ls_scfg_msi_parent_chip,4,2    ; @ls_scfg_msi_parent_chip
	.comm	_handle_simple_irq,4,2          ; @handle_simple_irq
	.no_dead_strip	_ls_scfg_msi_domain_irq_alloc
.subsections_via_symbols
