	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r14
	movl	%edx, %r12d
	movl	%esi, %r15d
	movq	%r8, %rdi
	callq	_rman_activate_resource
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.1:
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	je	LBB0_3
## %bb.2:
	movq	_SYS_RES_IOPORT@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	je	LBB0_3
## %bb.5:
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	cmpl	%r12d, (%rax)
	jne	LBB0_8
## %bb.6:
	movl	%r15d, %edi
	movq	%r14, %rsi
	callq	_intr_activate_irq
	testl	%eax, %eax
	jne	LBB0_7
	jmp	LBB0_8
LBB0_3:
	movq	%r14, %rdi
	callq	_rman_get_start
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_rman_get_size
	movq	_memmap_bus@GOTPCREL(%rip), %rdi
	xorl	%ebx, %ebx
	leaq	-40(%rbp), %r8
	movq	%r15, %rsi
	movq	%rax, %rdx
	xorl	%ecx, %ecx
	callq	_bus_space_map
	testl	%eax, %eax
	je	LBB0_4
LBB0_7:
	movl	%eax, %r15d
	movq	%r14, %rdi
	callq	_rman_deactivate_resource
	movl	%r15d, %ebx
	jmp	LBB0_8
LBB0_4:
	movq	_memmap_bus@GOTPCREL(%rip), %rsi
	movq	%r14, %rdi
	callq	_rman_set_bustag
	movq	-40(%rbp), %rsi
	movq	%r14, %rdi
	callq	_rman_set_virtual
	movq	-40(%rbp), %rsi
	movq	%r14, %rdi
	callq	_rman_set_bushandle
LBB0_8:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	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	_memmap_bus,4,2                 ## @memmap_bus
	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
	.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:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x4
	mov	x22, x2
	mov	x21, x1
	mov	x0, x4
	bl	_rman_activate_resource
	mov	x20, x0
	cbnz	w0, LBB0_8
; %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, w22
	ccmp	w9, w22, #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	x2, x0
Lloh6:
	adrp	x0, _memmap_bus@GOTPAGE
Lloh7:
	ldr	x0, [x0, _memmap_bus@GOTPAGEOFF]
	add	x4, sp, #8
	mov	x1, x20
	mov	w3, #0
	bl	_bus_space_map
	mov	x20, x0
	cbnz	w0, LBB0_6
; %bb.3:
Lloh8:
	adrp	x1, _memmap_bus@GOTPAGE
Lloh9:
	ldr	x1, [x1, _memmap_bus@GOTPAGEOFF]
	mov	x0, x19
	bl	_rman_set_bustag
	ldr	x1, [sp, #8]
	mov	x0, x19
	bl	_rman_set_virtual
	ldr	x1, [sp, #8]
	mov	x0, x19
	bl	_rman_set_bushandle
	b	LBB0_8
LBB0_4:
Lloh10:
	adrp	x8, _SYS_RES_IRQ@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SYS_RES_IRQ@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_7
; %bb.5:
	mov	x0, x21
	mov	x1, x19
	bl	_intr_activate_irq
	mov	x20, x0
	cbz	w0, LBB0_8
LBB0_6:
	mov	x0, x19
	bl	_rman_deactivate_resource
	b	LBB0_8
LBB0_7:
	mov	w20, #0
LBB0_8:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_SYS_RES_IOPORT,4,2             ; @SYS_RES_IOPORT
	.comm	_memmap_bus,4,2                 ; @memmap_bus
	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
	.no_dead_strip	_nexus_activate_resource
.subsections_via_symbols
