	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nexus_alloc_resource
_nexus_alloc_resource:                  ## @nexus_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r13d
	movl	%r8d, %r14d
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r12
	movl	16(%rbp), %r15d
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rdi
	callq	_DEVTONX
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r14d, %edi
	movl	%r13d, %esi
	callq	_RMAN_IS_DEFAULT_RANGE
	cmpl	$1, %r15d
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	jne	LBB0_6
## %bb.1:
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_device_get_parent
	xorl	%ebx, %ebx
	cmpq	%r12, %rax
	jne	LBB0_12
## %bb.3:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	testq	%rdi, %rdi
	je	LBB0_12
## %bb.4:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_resource_list_find
	testq	%rax, %rax
	je	LBB0_11
## %bb.5:
	movl	(%rax), %r14d
	movl	4(%rax), %r13d
	movl	8(%rax), %r15d
LBB0_6:
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_nexus_rman
	testq	%rax, %rax
	je	LBB0_11
## %bb.7:
	movl	24(%rbp), %r12d
	notl	%ebx
	andl	%r12d, %ebx
	movq	%rax, %rdi
	movl	%r14d, %esi
	movl	%r13d, %edx
	movl	%r15d, %ecx
	movl	%ebx, %r8d
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %r9
	callq	_rman_reserve_resource
	testq	%rax, %rax
	je	LBB0_11
## %bb.8:
	movq	%rax, %rbx
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movl	(%r15), %esi
	movq	%rax, %rdi
	callq	_rman_set_rid
	testl	%r12d, -48(%rbp)                ## 4-byte Folded Reload
	je	LBB0_12
## %bb.9:
	movl	(%r15), %edx
	movq	%r14, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	%rbx, %rcx
	callq	_bus_activate_resource
	testq	%rax, %rax
	je	LBB0_12
## %bb.10:
	movq	%rbx, %rdi
	callq	_rman_release_resource
LBB0_11:
	xorl	%ebx, %ebx
LBB0_12:
	movq	%rbx, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
	.no_dead_strip	_nexus_alloc_resource
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nexus_alloc_resource
_nexus_alloc_resource:                  ; @nexus_alloc_resource
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x22, x7
	mov	x23, x6
	mov	x24, x5
	mov	x25, x4
	mov	x21, x3
	mov	x19, x2
	mov	x20, x1
	mov	x27, x0
	mov	x0, x1
	bl	_DEVTONX
	mov	x26, x0
Lloh0:
	adrp	x28, _RF_ACTIVE@GOTPAGE
Lloh1:
	ldr	x28, [x28, _RF_ACTIVE@GOTPAGEOFF]
	ldr	w8, [x28]
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	mov	x0, x25
	mov	x1, x24
	bl	_RMAN_IS_DEFAULT_RANGE
	cmp	w23, #1
	b.ne	LBB0_6
; %bb.1:
	cbz	x0, LBB0_6
; %bb.2:
	mov	x0, x20
	bl	_device_get_parent
	mov	x23, #0
	cmp	x0, x27
	b.ne	LBB0_12
; %bb.3:
	cbz	x26, LBB0_12
; %bb.4:
	ldr	w2, [x21]
	mov	x0, x26
	mov	x1, x19
	bl	_resource_list_find
	cbz	x0, LBB0_11
; %bb.5:
	ldp	w25, w24, [x0]
	ldr	w23, [x0, #8]
LBB0_6:
	ldr	w26, [x28]
	mov	x0, x19
	bl	_nexus_rman
	cbz	x0, LBB0_11
; %bb.7:
	bic	w4, w22, w26
	mov	x1, x25
	mov	x2, x24
	mov	x3, x23
	mov	x5, x20
	bl	_rman_reserve_resource
	mov	x23, x0
	cbz	x0, LBB0_12
; %bb.8:
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	and	w22, w8, w22
	ldr	w1, [x21]
	mov	x0, x23
	bl	_rman_set_rid
	cbz	w22, LBB0_12
; %bb.9:
	ldr	w2, [x21]
	mov	x0, x20
	mov	x1, x19
	mov	x3, x23
	bl	_bus_activate_resource
	cbz	x0, LBB0_12
; %bb.10:
	mov	x0, x23
	bl	_rman_release_resource
LBB0_11:
	mov	x23, #0
LBB0_12:
	mov	x0, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
	.no_dead_strip	_nexus_alloc_resource
.subsections_via_symbols
