	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpcht_attach
_cpcht_attach:                          ## @cpcht_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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r12d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	callq	_ofw_bus_get_node
	movq	%rax, %r15
	movl	%r12d, %edi
	callq	_device_get_softc
	movq	%rax, %r14
	leaq	L_.str(%rip), %rsi
	leaq	-52(%rbp), %rdx
	movq	%r15, %rdi
	movl	$12, %ecx
	callq	_OF_getencprop
	cmpl	$11, %eax
	jg	LBB0_2
## %bb.1:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_8
LBB0_2:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_OF_getproplen
	testq	%rax, %rax
	jg	LBB0_4
## %bb.3:
	movq	_OFW_PCI_QUIRK_RANGES_ON_CHILDREN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r14)
LBB0_4:
	movq	$0, 32(%r14)
	movl	-48(%rbp), %edi
	movl	-44(%rbp), %esi
	callq	_pmap_mapdev
	movq	%rax, 24(%r14)
	movq	(%r14), %rdi
	movl	$8, %esi
	callq	_bzero
	movq	%r14, %rdi
	addq	$8, %rdi
	movq	_MTX_DEF@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str.2(%rip), %rsi
	xorl	%edx, %edx
	callq	_mtx_init
	movq	(%r14), %rax
	movq	_IRQ_INTERNAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%edx, (%rax)
	movl	(%rcx), %ecx
	movd	%ecx, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	movdqu	%xmm0, 4(%rax)
	movl	%ecx, 20(%rax)
	movl	%ecx, 24(%rax)
	movl	%ecx, 28(%rax)
	movq	%r15, %rdi
	callq	_OF_child
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	movq	%rax, %rbx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %edi
	movq	%rbx, %rsi
	callq	_cpcht_configure_htbridge
	movq	%rbx, %rdi
	callq	_OF_peer
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_6
LBB0_7:
	movq	(%r14), %rax
	movq	_cpcht_irqmap@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movl	%r12d, %edi
	callq	_ofw_pci_attach
LBB0_8:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-40(%rbp), %rcx
	jne	LBB0_10
## %bb.9:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	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	"ranges"

	.comm	_OFW_PCI_QUIRK_RANGES_ON_CHILDREN,4,2 ## @OFW_PCI_QUIRK_RANGES_ON_CHILDREN
L_.str.2:                               ## @.str.2
	.asciz	"cpcht irq"

	.comm	_MTX_DEF,4,2                    ## @MTX_DEF
	.comm	_IRQ_INTERNAL,4,2               ## @IRQ_INTERNAL
	.comm	_cpcht_irqmap,8,3               ## @cpcht_irqmap
	.comm	_CPCHT_IOPORT_SIZE,8,3          ## @CPCHT_IOPORT_SIZE
	.no_dead_strip	_cpcht_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpcht_attach
_cpcht_attach:                          ; @cpcht_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, 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	x21, x0
	mov	x0, x19
	bl	_device_get_softc
	mov	x20, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	add	x2, sp, #12
	mov	x0, x21
	mov	w3, #12
	bl	_OF_getencprop
	cmp	w0, #11
	b.gt	LBB0_2
; %bb.1:
Lloh5:
	adrp	x8, _ENXIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	b	LBB0_8
LBB0_2:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_OF_getproplen
	cmp	x0, #0
	b.gt	LBB0_4
; %bb.3:
Lloh10:
	adrp	x8, _OFW_PCI_QUIRK_RANGES_ON_CHILDREN@GOTPAGE
Lloh11:
	ldr	x8, [x8, _OFW_PCI_QUIRK_RANGES_ON_CHILDREN@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	w8, [x20, #16]
LBB0_4:
	str	xzr, [x20, #32]
	ldp	w0, w1, [sp, #16]
	bl	_pmap_mapdev
	str	x0, [x20, #24]
	ldr	x0, [x20]
	mov	w1, #8
	bl	_bzero
	add	x0, x20, #8
Lloh13:
	adrp	x8, _MTX_DEF@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MTX_DEF@GOTPAGEOFF]
Lloh15:
	ldr	w3, [x8]
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, #0
	bl	_mtx_init
	ldr	x8, [x20]
Lloh18:
	adrp	x9, _IRQ_INTERNAL@GOTPAGE
Lloh19:
	ldr	x9, [x9, _IRQ_INTERNAL@GOTPAGEOFF]
	ldr	w10, [x9]
	str	w10, [x8]
	ldr	w9, [x9]
	dup.4s	v0, w9
	stur	q0, [x8, #4]
	stp	w9, w9, [x8, #20]
	str	w9, [x8, #28]
	mov	x0, x21
	bl	_OF_child
	cbz	x0, LBB0_7
; %bb.5:
	mov	x21, x0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_cpcht_configure_htbridge
	mov	x0, x21
	bl	_OF_peer
	mov	x21, x0
	cbnz	x0, LBB0_6
LBB0_7:
	ldr	x8, [x20]
Lloh20:
	adrp	x9, _cpcht_irqmap@GOTPAGE
Lloh21:
	ldr	x9, [x9, _cpcht_irqmap@GOTPAGEOFF]
Lloh22:
	str	x8, [x9]
	mov	x0, x19
	bl	_ofw_pci_attach
LBB0_8:
	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_10
; %bb.9:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_10:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotStr	Lloh20, Lloh21, Lloh22
	.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	"ranges"

	.comm	_OFW_PCI_QUIRK_RANGES_ON_CHILDREN,4,2 ; @OFW_PCI_QUIRK_RANGES_ON_CHILDREN
l_.str.2:                               ; @.str.2
	.asciz	"cpcht irq"

	.comm	_MTX_DEF,4,2                    ; @MTX_DEF
	.comm	_IRQ_INTERNAL,4,2               ; @IRQ_INTERNAL
	.comm	_cpcht_irqmap,8,3               ; @cpcht_irqmap
	.comm	_CPCHT_IOPORT_SIZE,8,3          ; @CPCHT_IOPORT_SIZE
	.no_dead_strip	_cpcht_attach
.subsections_via_symbols
