	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alpine_msix_middle_domain_alloc
_alpine_msix_middle_domain_alloc:       ## @alpine_msix_middle_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	%edx, %ebx
	movl	%esi, %r12d
	movq	%rdi, %r15
	movq	(%rdi), %rdi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movl	%edx, %esi
	callq	_alpine_msix_allocate_sgi
	testl	%eax, %eax
	js	LBB0_10
## %bb.1:
	testl	%ebx, %ebx
	je	LBB0_9
## %bb.2:
	movl	$-1, %r13d
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	%eax, %r14d
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	%r14d, %edx
	callq	_alpine_msix_gic_domain_alloc
	testl	%eax, %eax
	jne	LBB0_4
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	%r14d, %edx
	movq	_middle_irq_chip@GOTPCREL(%rip), %rcx
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	callq	_irq_domain_set_hwirq_and_chip
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	leal	(%rbx,%r13), %eax
	decl	%eax
	movl	%r13d, %ecx
	decl	%ecx
	incl	%r14d
	incl	%r12d
	movl	%ecx, %r13d
	cmpl	$-1, %eax
	jne	LBB0_3
LBB0_9:
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_4:
	movl	%eax, %ebx
	cmpl	$-1, %r13d
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	je	LBB0_7
## %bb.5:
	negl	%r13d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	leal	-2(%r13), %edx
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_irq_domain_free_irqs_parent
	decl	%r13d
	cmpl	$1, %r13d
	jg	LBB0_6
LBB0_7:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_alpine_msix_free_sgi
	movl	%ebx, %eax
LBB0_10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_middle_irq_chip,4,2            ## @middle_irq_chip
	.no_dead_strip	_alpine_msix_middle_domain_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alpine_msix_middle_domain_alloc
_alpine_msix_middle_domain_alloc:       ; @alpine_msix_middle_domain_alloc
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x2
	mov	x22, x1
	mov	x23, x0
	ldr	x21, [x0]
	mov	x0, x21
	mov	x1, x2
	bl	_alpine_msix_allocate_sgi
	mov	x20, x0
	tbnz	w0, #31, LBB0_10
; %bb.1:
	cbz	w19, LBB0_5
; %bb.2:
	mov	w28, #0
Lloh0:
	adrp	x25, _middle_irq_chip@GOTPAGE
Lloh1:
	ldr	x25, [x25, _middle_irq_chip@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	w26, w22, w28
	add	w27, w20, w28
	mov	x0, x23
	mov	x1, x26
	mov	x2, x27
	bl	_alpine_msix_gic_domain_alloc
	cbnz	w0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x23
	mov	x1, x26
	mov	x2, x27
	mov	x3, x25
	mov	x4, x21
	bl	_irq_domain_set_hwirq_and_chip
	add	w28, w28, #1
	cmp	w19, w28
	b.ne	LBB0_3
LBB0_5:
	mov	w20, #0
	b	LBB0_10
LBB0_6:
	mov	x24, x0
	cbz	w28, LBB0_9
; %bb.7:
	add	w25, w28, #1
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	sub	w2, w25, #2
	mov	x0, x23
	mov	x1, x22
	bl	_irq_domain_free_irqs_parent
	sub	w25, w25, #1
	cmp	w25, #1
	b.gt	LBB0_8
LBB0_9:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_alpine_msix_free_sgi
	mov	x20, x24
LBB0_10:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_middle_irq_chip,4,2            ; @middle_irq_chip
	.no_dead_strip	_alpine_msix_middle_domain_alloc
.subsections_via_symbols
