	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nexus_activate_resource
_nexus_activate_resource:               ## @nexus_activate_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r14
	movl	%edx, %r15d
	movq	%r8, %rdi
	callq	_rman_activate_resource
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_6
## %bb.1:
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	cmpl	%r15d, (%rax)
	je	LBB0_3
## %bb.2:
	movq	_SYS_RES_IOPORT@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_6
LBB0_3:
	movq	%r14, %rdi
	callq	_rman_get_start
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_rman_get_size
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_pmap_mapdev
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %r15
	movl	$1, %esi
	movq	%r14, %rdi
	callq	_rman_set_bustag
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_rman_set_virtual
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_rman_set_bushandle
	jmp	LBB0_6
LBB0_4:
	movq	%r14, %rdi
	callq	_rman_deactivate_resource
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	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	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
	.comm	_fdtbus_bs_tag,8,3              ## @fdtbus_bs_tag
	.no_dead_strip	_nexus_activate_resource
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nexus_activate_resource
_nexus_activate_resource:               ; @nexus_activate_resource
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x4
	mov	x20, x2
	mov	x0, x4
	bl	_rman_activate_resource
	cbnz	w0, LBB0_6
; %bb.1:
Lloh0:
	adrp	x8, _SYS_RES_MEMORY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SYS_RES_MEMORY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _SYS_RES_IOPORT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SYS_RES_IOPORT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w20
	ccmp	w9, w20, #4, ne
	b.ne	LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_rman_get_start
	mov	x20, x0
	mov	x0, x19
	bl	_rman_get_size
	mov	x1, x0
	mov	x0, x20
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_pmap_mapdev
	cbz	x0, LBB0_5
; %bb.3:
	mov	x20, x0
	mov	x0, x19
	mov	w1, #1
	bl	_rman_set_bustag
	mov	x0, x19
	mov	x1, x20
	bl	_rman_set_virtual
	mov	x0, x19
	mov	x1, x20
	bl	_rman_set_bushandle
LBB0_4:
	mov	w0, #0
	b	LBB0_6
LBB0_5:
	mov	x0, x19
	bl	_rman_deactivate_resource
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_SYS_RES_IOPORT,4,2             ; @SYS_RES_IOPORT
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
	.comm	_fdtbus_bs_tag,8,3              ; @fdtbus_bs_tag
	.no_dead_strip	_nexus_activate_resource
.subsections_via_symbols
