	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function guest_alloc_irq_ranges
_guest_alloc_irq_ranges:                ## @guest_alloc_irq_ranges
	.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, %r15d
	movq	%rsi, %r13
	movq	%rdi, %r14
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movq	(%r13), %rdi
	callq	_spin_lock
	movq	_CXL_IRQ_RANGES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%r15d, %r15d
	setne	%cl
	testl	%eax, %eax
	jle	LBB0_13
## %bb.1:
	testl	%r15d, %r15d
	je	LBB0_13
## %bb.2:
	xorl	%edx, %edx
	leaq	-44(%rbp), %r12
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	%r15d, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r13, %rdi
	movl	%ebx, %esi
	movq	%r12, %rdx
	callq	_irq_alloc_range
	testq	%rax, %rax
	je	LBB0_11
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	%ebx, %eax
	shrl	$31, %eax
	addl	%ebx, %eax
	sarl	%eax
	incl	%ebx
	cmpl	$3, %ebx
	movl	%eax, %ebx
	jae	LBB0_4
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	-44(%rbp), %eax
	movq	(%r14), %rcx
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, (%rcx,%rdx,4)
	movq	8(%r14), %rax
	movl	%ebx, (%rax,%rdx,4)
	incq	%rdx
	subl	%ebx, %r15d
	movq	_CXL_IRQ_RANGES@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	setne	%cl
	cmpq	%rax, %rdx
	jge	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_3 Depth=1
	testl	%r15d, %r15d
	jne	LBB0_3
LBB0_13:
	testb	%cl, %cl
	movq	_CXL_IRQ_RANGES@GOTPCREL(%rip), %r15
	jne	LBB0_7
## %bb.14:
	movq	(%r13), %rdi
	callq	_spin_unlock
	xorl	%eax, %eax
	jmp	LBB0_15
LBB0_6:
	movq	_CXL_IRQ_RANGES@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
LBB0_7:
	testl	%eax, %eax
	jle	LBB0_10
## %bb.8:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rax
	movq	8(%r14), %rcx
	movl	(%rax,%rbx,4), %esi
	movl	(%rcx,%rbx,4), %edx
	movq	%r13, %rdi
	callq	_irq_free_range
	incq	%rbx
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_9
LBB0_10:
	movq	(%r13), %rdi
	callq	_spin_unlock
	movq	_ENOSPC@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_15:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CXL_IRQ_RANGES,4,2             ## @CXL_IRQ_RANGES
	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.no_dead_strip	_guest_alloc_irq_ranges
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function guest_alloc_irq_ranges
_guest_alloc_irq_ranges:                ; @guest_alloc_irq_ranges
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	ldr	x0, [x19]
	bl	_spin_lock
Lloh0:
	adrp	x23, _CXL_IRQ_RANGES@GOTPAGE
Lloh1:
	ldr	x23, [x23, _CXL_IRQ_RANGES@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w21, #0
	cset	w9, ne
	cmp	w8, #1
	ccmp	w21, #0, #4, ge
	b.ne	LBB0_3
LBB0_1:
	tbnz	w9, #0, LBB0_9
; %bb.2:
	ldr	x0, [x19]
	bl	_spin_unlock
	mov	w0, #0
	b	LBB0_13
LBB0_3:
	mov	x24, #0
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	mov	x22, x21
LBB0_5:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x2, sp, #12
	mov	x0, x19
	mov	x1, x22
	bl	_irq_alloc_range
	cbz	x0, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	cmp	w22, #0
	cinc	w8, w22, lt
	add	w9, w22, #1
	asr	w22, w8, #1
	cmp	w9, #3
	b.hs	LBB0_5
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [sp, #12]
	lsl	x9, x24, #2
	ldp	x10, x11, [x20]
	str	w8, [x10, x9]
	str	w22, [x11, x9]
	subs	w21, w21, w22
	add	x24, x24, #1
	ldrsw	x8, [x23]
	cset	w9, ne
	cmp	x24, x8
	ccmp	w21, #0, #4, lt
	b.ne	LBB0_4
	b	LBB0_1
LBB0_8:
	ldr	w8, [x23]
LBB0_9:
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.10:
	mov	x21, #0
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	lsl	x8, x21, #2
	ldp	x9, x10, [x20]
	ldr	w1, [x9, x8]
	ldr	w2, [x10, x8]
	mov	x0, x19
	bl	_irq_free_range
	add	x21, x21, #1
	ldrsw	x8, [x23]
	cmp	x21, x8
	b.lt	LBB0_11
LBB0_12:
	ldr	x0, [x19]
	bl	_spin_unlock
Lloh2:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_CXL_IRQ_RANGES,4,2             ; @CXL_IRQ_RANGES
	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.no_dead_strip	_guest_alloc_irq_ranges
.subsections_via_symbols
