	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function uninorth_attach
_uninorth_attach:                       ## @uninorth_attach
	.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	%edi, %r12d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_ofw_bus_get_node
	movl	%eax, %r13d
	movl	%r12d, %edi
	callq	_device_get_softc
	movq	%rax, %r14
	movl	%r12d, %edi
	callq	_device_get_name
	movq	%rax, %r15
	movl	%r12d, %edi
	callq	_device_get_unit
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	leaq	-60(%rbp), %rdx
	movl	%r13d, %edi
	movl	$12, %ecx
	callq	_OF_getprop
	cmpl	$7, %eax
	jg	LBB0_2
## %bb.1:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_9
LBB0_2:
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	movl	%ebx, -64(%rbp)                 ## 4-byte Spill
	movl	$0, (%r14)
	movl	%r12d, %edi
	callq	_ofw_bus_get_compat
	movq	%rax, %r15
	leaq	L_.str.1(%rip), %rsi
	movq	%rax, %rdi
	callq	_strcmp
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movl	$3, (%r14)
LBB0_4:
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	callq	_strcmp
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	movl	$4, (%r14)
LBB0_6:
	movl	$1, -68(%rbp)
	movl	%r13d, %edi
	callq	_OF_parent
	leaq	L_.str.3(%rip), %rsi
	leaq	-68(%rbp), %rdx
	movl	%eax, %edi
	movl	$4, %ecx
	callq	_OF_getprop
	movl	-60(%rbp), %ebx
	leal	8388608(%rbx), %edi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_pmap_mapdev
	movq	%rax, 24(%r14)
	addl	$12582912, %ebx                 ## imm = 0xC00000
	movl	(%r15), %esi
	movl	%ebx, %edi
	callq	_pmap_mapdev
	movq	%rax, 16(%r14)
	leaq	4(%r14), %r15
	leaq	L_.str.4(%rip), %rdx
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movl	-64(%rbp), %esi                 ## 4-byte Reload
	movq	%r15, %rcx
	callq	_resource_int_value
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movl	$-1, (%r15)
LBB0_8:
	addq	$8, %r14
	movq	_MTX_SPIN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str.5(%rip), %rsi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_mtx_init
	movl	%r12d, %edi
	callq	_ofw_pci_attach
LBB0_9:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_11
## %bb.10:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"reg"

	.comm	_ENXIO,4,2                      ## @ENXIO
L_.str.1:                               ## @.str.1
	.asciz	"u3-agp"

L_.str.2:                               ## @.str.2
	.asciz	"u4-pcie"

L_.str.3:                               ## @.str.3
	.asciz	"#address-cells"

	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
L_.str.4:                               ## @.str.4
	.asciz	"skipslot"

L_.str.5:                               ## @.str.5
	.asciz	"uninorth pcicfg"

	.comm	_MTX_SPIN,4,2                   ## @MTX_SPIN
	.no_dead_strip	_uninorth_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function uninorth_attach
_uninorth_attach:                       ; @uninorth_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	bl	_ofw_bus_get_node
	mov	x23, x0
	mov	x0, x19
	bl	_device_get_softc
	mov	x20, x0
	mov	x0, x19
	bl	_device_get_name
	mov	x21, x0
	mov	x0, x19
	bl	_device_get_unit
	mov	x22, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	add	x2, sp, #12
	mov	x0, x23
	mov	w3, #12
	bl	_OF_getprop
	cmp	w0, #7
	b.gt	LBB0_2
; %bb.1:
Lloh5:
	adrp	x8, _ENXIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	b	LBB0_9
LBB0_2:
	str	wzr, [x20]
	mov	x0, x19
	bl	_ofw_bus_get_compat
	mov	x24, x0
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_strcmp
	cbnz	x0, LBB0_4
; %bb.3:
	mov	w8, #3
	str	w8, [x20]
LBB0_4:
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x24
	bl	_strcmp
	cbnz	x0, LBB0_6
; %bb.5:
	mov	w8, #4
	str	w8, [x20]
LBB0_6:
	mov	w8, #1
	str	w8, [sp, #8]
	mov	x0, x23
	bl	_OF_parent
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	add	x2, sp, #8
	mov	w3, #4
	bl	_OF_getprop
	ldr	w23, [sp, #12]
	add	w0, w23, #2048, lsl #12         ; =8388608
Lloh14:
	adrp	x24, _PAGE_SIZE@GOTPAGE
Lloh15:
	ldr	x24, [x24, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w1, [x24]
	bl	_pmap_mapdev
	str	x0, [x20, #24]
	add	w0, w23, #3072, lsl #12         ; =12582912
	ldr	w1, [x24]
	bl	_pmap_mapdev
	str	x0, [x20, #16]
	add	x23, x20, #4
Lloh16:
	adrp	x2, l_.str.4@PAGE
Lloh17:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x0, x21
	mov	x1, x22
	mov	x3, x23
	bl	_resource_int_value
	cbz	x0, LBB0_8
; %bb.7:
	mov	w8, #-1
	str	w8, [x23]
LBB0_8:
	add	x0, x20, #8
Lloh18:
	adrp	x8, _MTX_SPIN@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MTX_SPIN@GOTPAGEOFF]
Lloh20:
	ldr	w3, [x8]
Lloh21:
	adrp	x1, l_.str.5@PAGE
Lloh22:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x2, #0
	bl	_mtx_init
	mov	x0, x19
	bl	_ofw_pci_attach
LBB0_9:
	ldr	x8, [sp, #24]
Lloh23:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	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
	add	sp, sp, #96
	ret
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reg"

	.comm	_ENXIO,4,2                      ; @ENXIO
l_.str.1:                               ; @.str.1
	.asciz	"u3-agp"

l_.str.2:                               ; @.str.2
	.asciz	"u4-pcie"

l_.str.3:                               ; @.str.3
	.asciz	"#address-cells"

	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
l_.str.4:                               ; @.str.4
	.asciz	"skipslot"

l_.str.5:                               ; @.str.5
	.asciz	"uninorth pcicfg"

	.comm	_MTX_SPIN,4,2                   ; @MTX_SPIN
	.no_dead_strip	_uninorth_attach
.subsections_via_symbols
