	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function arm_gic_alloc_resource
_arm_gic_alloc_resource:                ## @arm_gic_alloc_resource
	.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
	movq	%r9, %r14
	movq	%r8, %r12
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movl	%edx, %r13d
	movl	%esi, %r15d
	movl	%edi, %ebx
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpl	%edx, (%rax)
	sete	%dil
	movslq	%edx, %rsi
	callq	_KASSERT
	movl	%ebx, %edi
	callq	_device_get_softc
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_RMAN_IS_DEFAULT_RANGE
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	%ebx, %edi
	movl	%r15d, %esi
	callq	_BUS_GET_RESOURCE_LIST
	movq	_SYS_RES_IOPORT@GOTPCREL(%rip), %rcx
	cmpl	%r13d, (%rcx)
	jne	LBB0_4
## %bb.3:
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
LBB0_4:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %edx
	movq	%rax, %rdi
	movl	%r13d, %esi
	callq	_resource_list_find
	testq	%rax, %rax
	je	LBB0_5
## %bb.7:
	movl	%ebx, %edi
	movq	(%rax), %r12
	movq	8(%rax), %r14
	movq	16(%rax), %r10
	jmp	LBB0_8
LBB0_1:
	movl	%ebx, %edi
	movq	16(%rbp), %r10
LBB0_8:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %r8d
	testl	%r8d, %r8d
	jle	LBB0_9
## %bb.10:
	movq	8(%rax), %rax
	addq	$16, %rax
	xorl	%edx, %edx
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_11 Depth=1
	incq	%rdx
	addq	$24, %rax
	cmpq	%rdx, %r8
	je	LBB0_15
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	-16(%rax), %r9
	movq	%r12, %rcx
	subq	%r9, %rcx
	jl	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	-8(%rax), %rbx
	addq	%r9, %rbx
	cmpq	%rbx, %r14
	jge	LBB0_14
## %bb.13:
	movq	(%rax), %rax
	addq	%rax, %rcx
	subq	%r9, %r14
	addq	%rax, %r14
	movq	%rcx, %r12
	cmpl	%r8d, %edx
	je	LBB0_17
	jmp	LBB0_23
LBB0_15:
	movl	%r8d, %edx
	cmpl	%r8d, %edx
	je	LBB0_17
	jmp	LBB0_23
LBB0_9:
	xorl	%edx, %edx
	cmpl	%r8d, %edx
	jne	LBB0_23
LBB0_17:
	testl	%r8d, %r8d
	je	LBB0_23
## %bb.18:
	movq	_bootverbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_21
## %bb.19:
	leaq	L_.str.2(%rip), %rsi
	movl	%r12d, %edx
	movl	%r14d, %ecx
	jmp	LBB0_20
LBB0_23:
	movl	24(%rbp), %eax
	movl	%r15d, %esi
	movl	%r13d, %edx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%r12, %r8
	movq	%r14, %r9
	pushq	%rax
	pushq	%r10
	callq	_bus_generic_alloc_resource
	addq	$40, %rsp
	jmp	LBB0_22
LBB0_5:
	movq	_bootverbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_21
## %bb.6:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	movl	%r13d, %ecx
LBB0_20:
	callq	_device_printf
LBB0_21:
	xorl	%eax, %eax
	addq	$24, %rsp
LBB0_22:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.comm	_SYS_RES_IOPORT,4,2             ## @SYS_RES_IOPORT
	.comm	_bootverbose,8,3                ## @bootverbose
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"no default resources for rid = %d, type = %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Could not map resource %#jx-%#jx\n"

	.no_dead_strip	_arm_gic_alloc_resource
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function arm_gic_alloc_resource
_arm_gic_alloc_resource:                ; @arm_gic_alloc_resource
	.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	x21, x7
	mov	x26, x6
	mov	x24, x5
	mov	x25, x4
	mov	x22, x3
	mov	x20, x2
	mov	x23, x1
	mov	x19, x0
Lloh0:
	adrp	x28, _SYS_RES_MEMORY@GOTPAGE
Lloh1:
	ldr	x28, [x28, _SYS_RES_MEMORY@GOTPAGEOFF]
	ldr	w8, [x28]
	cmp	w8, w2
	cset	w0, eq
	sxtw	x1, w20
	bl	_KASSERT
	mov	x0, x19
	bl	_device_get_softc
	mov	x27, x0
	mov	x0, x25
	mov	x1, x24
	bl	_RMAN_IS_DEFAULT_RANGE
	cbz	x0, LBB0_3
; %bb.1:
	mov	x0, x19
	mov	x1, x23
	bl	_BUS_GET_RESOURCE_LIST
Lloh2:
	adrp	x8, _SYS_RES_IOPORT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SYS_RES_IOPORT@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	w9, [x28]
	cmp	w8, w20
	csel	w20, w9, w20, eq
	ldr	w2, [x22]
	mov	x1, x20
	bl	_resource_list_find
	cbz	x0, LBB0_15
; %bb.2:
	ldp	x25, x24, [x0]
	ldr	x26, [x0, #16]
LBB0_3:
	ldr	w8, [x27]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.4:
	mov	x9, #0
	ldr	x10, [x27, #8]
	add	x10, x10, #16
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x9, x9, #1
	add	x10, x10, #24
	cmp	x8, x9
	b.eq	LBB0_9
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldur	x11, [x10, #-16]
	subs	x12, x25, x11
	b.lt	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldur	x13, [x10, #-8]
	add	x13, x13, x11
	cmp	x24, x13
	b.ge	LBB0_5
; %bb.8:
	ldr	x10, [x10]
	add	x25, x12, x10
	sub	x11, x24, x11
	add	x24, x11, x10
	cmp	w9, w8
	b.eq	LBB0_11
	b	LBB0_14
LBB0_9:
	mov	x9, x8
	cmp	w9, w8
	b.eq	LBB0_11
	b	LBB0_14
LBB0_10:
	mov	w9, #0
	cmp	w9, w8
	b.ne	LBB0_14
LBB0_11:
	cbz	w8, LBB0_14
; %bb.12:
Lloh5:
	adrp	x8, _bootverbose@GOTPAGE
Lloh6:
	ldr	x8, [x8, _bootverbose@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cbz	x8, LBB0_18
; %bb.13:
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x2, x25
	mov	x3, x24
	b	LBB0_17
LBB0_14:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x20
	mov	x3, x22
	mov	x4, x25
	mov	x5, x24
	mov	x6, x26
	mov	x7, x21
	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
	b	_bus_generic_alloc_resource
LBB0_15:
Lloh10:
	adrp	x8, _bootverbose@GOTPAGE
Lloh11:
	ldr	x8, [x8, _bootverbose@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	cbz	x8, LBB0_18
; %bb.16:
	ldr	w2, [x22]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x3, x20
LBB0_17:
	bl	_device_printf
LBB0_18:
	mov	x0, #0
	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
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_SYS_RES_IOPORT,4,2             ; @SYS_RES_IOPORT
	.comm	_bootverbose,8,3                ; @bootverbose
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"no default resources for rid = %d, type = %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Could not map resource %#jx-%#jx\n"

	.no_dead_strip	_arm_gic_alloc_resource
.subsections_via_symbols
