	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xlp_pci_attach
_xlp_pci_attach:                        ## @xlp_pci_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, %ebx
	callq	_device_get_parent
	movl	%eax, %r14d
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edi
	callq	_pcib_get_bus
	movl	%eax, %r15d
	movl	%r14d, %edi
	callq	_PCIB_MAXSLOTS
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	js	LBB0_14
## %bb.1:
	xorl	%ebx, %ebx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	leal	1(%rbx), %eax
	cmpl	-48(%rbp), %ebx                 ## 4-byte Folded Reload
	movl	%eax, %ebx
	je	LBB0_14
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	movq	_PCIR_HDRTYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	%r14d, %edi
	movl	%r15d, %esi
	movl	%ebx, %edx
	xorl	%ecx, %ecx
	movl	$1, %r9d
	callq	_PCIB_READ_CONFIG
	movl	%eax, %r12d
	movq	_PCIM_HDRTYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r12d, %eax
	movq	_PCI_MAXHDRTYPE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jg	LBB0_13
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_PCIM_MFDEV@GOTPCREL(%rip), %rax
	andl	(%rax), %r12d
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_PCI_FUNCMAX@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	testl	%r12d, %r12d
	js	LBB0_13
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, %eax
	shrl	$3, %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	%ebx, %eax
	andl	$7, %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	incl	%r12d
	xorl	%r13d, %r13d
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_7
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=2
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	callq	_pcib_get_domain
	movl	%r14d, %edi
	movl	%ebx, %esi
	movl	%eax, %edx
	movl	%r15d, %ecx
	movq	-64(%rbp), %r8                  ## 8-byte Reload
                                        ## kill: def $r8d killed $r8d killed $r8
	movl	%r13d, %r9d
	callq	_pci_read_device
	movl	%ebx, %edi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rax, %rsi
	callq	_pci_add_child
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=2
	incl	%r13d
	cmpl	%r13d, %r12d
	je	LBB0_13
LBB0_7:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	xorl	%esi, %esi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	movl	%r13d, %ecx
	callq	_XLP_HDR_OFFSET
	movl	%eax, %edi
	callq	_nlm_dev_exists
	testl	%eax, %eax
	je	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=2
	movq	_PCIR_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	%r14d, %edi
	movl	%r15d, %esi
	movl	%ebx, %edx
	movl	%r13d, %ecx
	movl	$2, %r9d
	callq	_PCIB_READ_CONFIG
                                        ## kill: def $eax killed $eax def $rax
	leal	-128(%rax), %ecx
	cmpl	$7, %ecx
	jb	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=2
	cmpl	$135, %eax
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=2
	movl	%r13d, %edi
	callq	_PIC_USB_IRQ
	movq	_XLP_PCI_DEVSCRATCH_REG0@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	shll	$2, %r8d
	orl	$256, %eax                      ## imm = 0x100
	movl	$4, (%rsp)
	movl	%r14d, %edi
	movl	%r15d, %esi
	movl	%ebx, %edx
	movl	%r13d, %ecx
	movl	%eax, %r9d
	callq	_PCIB_WRITE_CONFIG
	jmp	LBB0_11
LBB0_14:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bus_generic_attach             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PCIR_HDRTYPE,4,2               ## @PCIR_HDRTYPE
	.comm	_PCIM_HDRTYPE,4,2               ## @PCIM_HDRTYPE
	.comm	_PCI_MAXHDRTYPE,4,2             ## @PCI_MAXHDRTYPE
	.comm	_PCIM_MFDEV,4,2                 ## @PCIM_MFDEV
	.comm	_PCI_FUNCMAX,4,2                ## @PCI_FUNCMAX
	.comm	_PCIR_DEVICE,4,2                ## @PCIR_DEVICE
	.comm	_XLP_PCI_DEVSCRATCH_REG0,4,2    ## @XLP_PCI_DEVSCRATCH_REG0
	.no_dead_strip	_xlp_pci_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xlp_pci_attach
_xlp_pci_attach:                        ; @xlp_pci_attach
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	bl	_device_get_parent
	mov	x20, x0
	mov	x0, x19
	bl	_pcib_get_bus
	mov	x21, x0
	mov	x0, x20
	bl	_PCIB_MAXSLOTS
	tbnz	w0, #31, LBB0_12
; %bb.1:
	mov	x22, x0
	mov	w23, #0
Lloh0:
	adrp	x28, _PCIR_DEVICE@GOTPAGE
Lloh1:
	ldr	x28, [x28, _PCIR_DEVICE@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w8, w23, #1
	cmp	w23, w22
	mov	x23, x8
	b.eq	LBB0_12
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
Lloh2:
	adrp	x8, _PCIR_HDRTYPE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PCIR_HDRTYPE@GOTPAGEOFF]
Lloh4:
	ldr	w4, [x8]
	mov	x0, x20
	mov	x1, x21
	mov	x2, x23
	mov	w3, #0
	mov	w5, #1
	bl	_PCIB_READ_CONFIG
Lloh5:
	adrp	x8, _PCIM_HDRTYPE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PCIM_HDRTYPE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh8:
	adrp	x9, _PCI_MAXHDRTYPE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PCI_MAXHDRTYPE@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	cmp	w8, w9
	b.gt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh11:
	adrp	x8, _PCIM_MFDEV@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PCIM_MFDEV@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _PCI_FUNCMAX@GOTPAGE
Lloh15:
	ldr	x9, [x9, _PCI_FUNCMAX@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	tst	w8, w0
	csel	w8, wzr, w9, eq
	tbnz	w8, #31, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w24, #0
	lsr	w25, w23, #3
	and	w26, w23, #0x7
	add	w27, w8, #1
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=2
	mov	x0, x19
	bl	_pcib_get_domain
	mov	x2, x0
	mov	x0, x20
	mov	x1, x19
	mov	x3, x21
	mov	x4, x23
	mov	x5, x24
	bl	_pci_read_device
	mov	x1, x0
	mov	x0, x19
	bl	_pci_add_child
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=2
	add	w24, w24, #1
	cmp	w27, w24
	b.eq	LBB0_2
LBB0_8:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x25
	mov	w1, #0
	mov	x2, x26
	mov	x3, x24
	bl	_XLP_HDR_OFFSET
	bl	_nlm_dev_exists
	cbz	w0, LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	ldr	w4, [x28]
	mov	x0, x20
	mov	x1, x21
	mov	x2, x23
	mov	x3, x24
	mov	w5, #2
	bl	_PCIB_READ_CONFIG
	sub	w8, w0, #128
	cmp	w8, #7
	b.lo	LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=2
	cmp	w0, #135
	b.ne	LBB0_6
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=2
	mov	x0, x24
	bl	_PIC_USB_IRQ
Lloh17:
	adrp	x8, _XLP_PCI_DEVSCRATCH_REG0@GOTPAGE
Lloh18:
	ldr	x8, [x8, _XLP_PCI_DEVSCRATCH_REG0@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	lsl	w4, w8, #2
	orr	w5, w0, #0x100
	mov	x0, x20
	mov	x1, x21
	mov	x2, x23
	mov	x3, x24
	mov	w6, #4
	bl	_PCIB_WRITE_CONFIG
	b	LBB0_6
LBB0_12:
	mov	x0, x19
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_bus_generic_attach
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_PCIR_HDRTYPE,4,2               ; @PCIR_HDRTYPE
	.comm	_PCIM_HDRTYPE,4,2               ; @PCIM_HDRTYPE
	.comm	_PCI_MAXHDRTYPE,4,2             ; @PCI_MAXHDRTYPE
	.comm	_PCIM_MFDEV,4,2                 ; @PCIM_MFDEV
	.comm	_PCI_FUNCMAX,4,2                ; @PCI_FUNCMAX
	.comm	_PCIR_DEVICE,4,2                ; @PCIR_DEVICE
	.comm	_XLP_PCI_DEVSCRATCH_REG0,4,2    ; @XLP_PCI_DEVSCRATCH_REG0
	.no_dead_strip	_xlp_pci_attach
.subsections_via_symbols
