	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bgx_probe
_bgx_probe:                             ## @bgx_probe
	.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	%rdi, %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$40, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	%r15, 32(%rax)
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_pci_set_drvdata
	movq	%r15, %rdi
	callq	_pci_enable_device
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_25
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_26
LBB0_4:
	movq	_DRV_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_pci_request_regions
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_24
LBB0_6:
	movq	_PCI_CFG_REG_BAR_NUM@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_pcim_iomap
	movl	%eax, 24(%r14)
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	movq	%r15, %rdi
	callq	_set_max_bgx_per_node
	movq	_PCI_DEVICE_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_word
	movq	-40(%rbp), %rax
	movq	_PCI_DEVICE_ID_THUNDER_RGX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.10:
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, 4(%r14)
	movq	_MAX_BGX_PER_CN81XX@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	leaq	-1(%rax), %rcx
	movl	%ecx, (%r14)
	movq	_bgx_vnic@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%r14, -8(%rcx,%rax,8)
	xorl	%eax, %eax
	callq	_xcv_init_hw
	jmp	LBB0_11
LBB0_7:
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_23
LBB0_9:
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_pci_resource_start
	sarl	$24, %eax
	movq	_BGX_ID_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movl	%eax, (%r14)
	movq	%r15, %rdi
	callq	_nic_get_node_id
	movq	_max_bgx_per_node@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	cltq
	imulq	%rcx, %rax
	movslq	(%r14), %rcx
	addq	%rax, %rcx
	movl	%ecx, (%r14)
	movq	_MAX_LMAC_PER_BGX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r14)
	movq	_bgx_vnic@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%r14, (%rax,%rcx,8)
LBB0_11:
	movq	_PCI_SUBSYSTEM_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_word
	movq	-40(%rbp), %rax
	movq	_PCI_SUBSYS_DEVID_81XX_BGX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_14
## %bb.12:
	movq	_PCI_SUBSYS_DEVID_83XX_BGX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_15
## %bb.13:
	cmpl	$2, (%r14)
	jne	LBB0_15
LBB0_14:
	movl	$1, 12(%r14)
LBB0_15:
	movq	%r14, %rdi
	callq	_bgx_get_qlm_mode
	movq	%r14, %rdi
	callq	_bgx_init_phy
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_16
LBB0_22:
	movq	_bgx_vnic@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	(%r14), %rcx
	movq	$0, (%rax,%rcx,8)
LBB0_23:
	movq	%r15, %rdi
	callq	_pci_release_regions
LBB0_24:
	movq	%r15, %rdi
	callq	_pci_disable_device
LBB0_25:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_pci_set_drvdata
LBB0_26:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	%r14, %rdi
	callq	_bgx_init_hw
	cmpq	$0, 16(%r14)
	jle	LBB0_17
## %bb.18:
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_bgx_lmac_enable
	testl	%eax, %eax
	jne	LBB0_20
## %bb.27:                              ##   in Loop: Header=BB0_19 Depth=1
	incq	%r12
	xorl	%ebx, %ebx
	cmpq	16(%r14), %r12
	jl	LBB0_19
	jmp	LBB0_26
LBB0_17:
	xorl	%ebx, %ebx
	jmp	LBB0_26
LBB0_20:
	movl	%eax, %ebx
	movl	(%r14), %edx
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	movq	%r12, %rcx
	xorl	%eax, %eax
	callq	_dev_err
	subq	$1, %r12
	jb	LBB0_22
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_bgx_lmac_disable
	addq	$-1, %r12
	jb	LBB0_21
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to enable PCI device\n"

	.comm	_DRV_NAME,4,2                   ## @DRV_NAME
L_.str.1:                               ## @.str.1
	.asciz	"PCI request regions failed 0x%x\n"

	.comm	_PCI_CFG_REG_BAR_NUM,4,2        ## @PCI_CFG_REG_BAR_NUM
L_.str.2:                               ## @.str.2
	.asciz	"BGX: Cannot map CSR memory space, aborting\n"

	.comm	_PCI_DEVICE_ID,4,2              ## @PCI_DEVICE_ID
	.comm	_PCI_DEVICE_ID_THUNDER_RGX,8,3  ## @PCI_DEVICE_ID_THUNDER_RGX
	.comm	_BGX_ID_MASK,4,2                ## @BGX_ID_MASK
	.comm	_max_bgx_per_node,4,2           ## @max_bgx_per_node
	.comm	_MAX_LMAC_PER_BGX,4,2           ## @MAX_LMAC_PER_BGX
	.comm	_bgx_vnic,8,3                   ## @bgx_vnic
	.comm	_MAX_BGX_PER_CN81XX,4,2         ## @MAX_BGX_PER_CN81XX
	.comm	_PCI_SUBSYSTEM_ID,4,2           ## @PCI_SUBSYSTEM_ID
	.comm	_PCI_SUBSYS_DEVID_81XX_BGX,8,3  ## @PCI_SUBSYS_DEVID_81XX_BGX
	.comm	_PCI_SUBSYS_DEVID_83XX_BGX,8,3  ## @PCI_SUBSYS_DEVID_83XX_BGX
L_.str.3:                               ## @.str.3
	.asciz	"BGX%d failed to enable lmac%d\n"

	.no_dead_strip	_bgx_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bgx_probe
_bgx_probe:                             ; @bgx_probe
	.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, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #40
	bl	_devm_kzalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	str	x19, [x0, #32]
	mov	x0, x19
	mov	x1, x20
	bl	_pci_set_drvdata
	mov	x0, x19
	bl	_pci_enable_device
	cbz	w0, LBB0_4
; %bb.2:
	mov	x21, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_19
LBB0_3:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_20
LBB0_4:
Lloh8:
	adrp	x8, _DRV_NAME@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DRV_NAME@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_pci_request_regions
	cbz	w0, LBB0_6
; %bb.5:
	mov	x21, x0
	str	x21, [sp]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_18
LBB0_6:
Lloh13:
	adrp	x21, _PCI_CFG_REG_BAR_NUM@GOTPAGE
Lloh14:
	ldr	x21, [x21, _PCI_CFG_REG_BAR_NUM@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	mov	w2, #0
	bl	_pcim_iomap
	str	w0, [x20, #24]
	cbz	w0, LBB0_9
; %bb.7:
	mov	x0, x19
	bl	_set_max_bgx_per_node
Lloh15:
	adrp	x8, _PCI_DEVICE_ID@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PCI_DEVICE_ID@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	add	x2, sp, #24
	mov	x0, x19
	bl	_pci_read_config_word
	ldr	x8, [sp, #24]
Lloh18:
	adrp	x9, _PCI_DEVICE_ID_THUNDER_RGX@GOTPAGE
Lloh19:
	ldr	x9, [x9, _PCI_DEVICE_ID_THUNDER_RGX@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
Lloh21:
	adrp	x23, _bgx_vnic@GOTPAGE
Lloh22:
	ldr	x23, [x23, _bgx_vnic@GOTPAGEOFF]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.8:
	movi.2s	v0, #1
	stur	d0, [x20, #4]
Lloh23:
	adrp	x8, _MAX_BGX_PER_CN81XX@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MAX_BGX_PER_CN81XX@GOTPAGEOFF]
Lloh25:
	ldrsw	x8, [x8]
	sub	x8, x8, #1
	str	w8, [x20]
	ldr	x9, [x23]
	str	x20, [x9, x8, lsl #3]
	bl	_xcv_init_hw
	b	LBB0_11
LBB0_9:
Lloh26:
	adrp	x1, l_.str.2@PAGE
Lloh27:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh28:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_17
LBB0_10:
	ldr	w1, [x21]
	mov	x0, x19
	bl	_pci_resource_start
Lloh31:
	adrp	x8, _BGX_ID_MASK@GOTPAGE
Lloh32:
	ldr	x8, [x8, _BGX_ID_MASK@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	and	w8, w8, w0, asr #24
	str	w8, [x20]
	mov	x0, x19
	bl	_nic_get_node_id
Lloh34:
	adrp	x8, _max_bgx_per_node@GOTPAGE
Lloh35:
	ldr	x8, [x8, _max_bgx_per_node@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	ldr	w9, [x20]
	madd	w8, w8, w0, w9
Lloh37:
	adrp	x9, _MAX_LMAC_PER_BGX@GOTPAGE
Lloh38:
	ldr	x9, [x9, _MAX_LMAC_PER_BGX@GOTPAGEOFF]
	str	w8, [x20]
Lloh39:
	ldr	w9, [x9]
	str	w9, [x20, #4]
	ldr	x9, [x23]
	str	x20, [x9, w8, sxtw #3]
LBB0_11:
Lloh40:
	adrp	x8, _PCI_SUBSYSTEM_ID@GOTPAGE
Lloh41:
	ldr	x8, [x8, _PCI_SUBSYSTEM_ID@GOTPAGEOFF]
Lloh42:
	ldr	w1, [x8]
	add	x2, sp, #24
	mov	x0, x19
	bl	_pci_read_config_word
	ldr	x8, [sp, #24]
Lloh43:
	adrp	x9, _PCI_SUBSYS_DEVID_81XX_BGX@GOTPAGE
Lloh44:
	ldr	x9, [x9, _PCI_SUBSYS_DEVID_81XX_BGX@GOTPAGEOFF]
Lloh45:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_14
; %bb.12:
Lloh46:
	adrp	x9, _PCI_SUBSYS_DEVID_83XX_BGX@GOTPAGE
Lloh47:
	ldr	x9, [x9, _PCI_SUBSYS_DEVID_83XX_BGX@GOTPAGEOFF]
Lloh48:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_15
; %bb.13:
	ldr	w8, [x20]
	cmp	w8, #2
	b.ne	LBB0_15
LBB0_14:
	mov	w8, #1
	str	w8, [x20, #12]
LBB0_15:
	mov	x0, x20
	bl	_bgx_get_qlm_mode
	mov	x0, x20
	bl	_bgx_init_phy
	mov	x21, x0
	cbz	w0, LBB0_21
LBB0_16:
	ldr	x8, [x23]
	ldrsw	x9, [x20]
	str	xzr, [x8, x9, lsl #3]
LBB0_17:
	mov	x0, x19
	bl	_pci_release_regions
LBB0_18:
	mov	x0, x19
	bl	_pci_disable_device
LBB0_19:
	mov	x0, x19
	mov	x1, #0
	bl	_pci_set_drvdata
LBB0_20:
	mov	x0, x21
	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_21:
	mov	x0, x20
	bl	_bgx_init_hw
	ldr	x8, [x20, #16]
	cmp	x8, #1
	b.lt	LBB0_25
; %bb.22:
	mov	x22, #0
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x22
	bl	_bgx_lmac_enable
	mov	x21, x0
	cbnz	w0, LBB0_26
; %bb.24:                               ;   in Loop: Header=BB0_23 Depth=1
	add	x22, x22, #1
	ldr	x8, [x20, #16]
	cmp	x22, x8
	b.lt	LBB0_23
	b	LBB0_20
LBB0_25:
	mov	w21, #0
	b	LBB0_20
LBB0_26:
	ldr	w8, [x20]
	stp	x8, x22, [sp]
Lloh49:
	adrp	x1, l_.str.3@PAGE
Lloh50:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	cbz	x22, LBB0_16
; %bb.27:
	sub	x22, x22, #1
LBB0_28:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x22
	bl	_bgx_lmac_disable
	sub	x22, x22, #1
	cmn	x22, #1
	b.ne	LBB0_28
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpAdd	Lloh49, Lloh50
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to enable PCI device\n"

	.comm	_DRV_NAME,4,2                   ; @DRV_NAME
l_.str.1:                               ; @.str.1
	.asciz	"PCI request regions failed 0x%x\n"

	.comm	_PCI_CFG_REG_BAR_NUM,4,2        ; @PCI_CFG_REG_BAR_NUM
l_.str.2:                               ; @.str.2
	.asciz	"BGX: Cannot map CSR memory space, aborting\n"

	.comm	_PCI_DEVICE_ID,4,2              ; @PCI_DEVICE_ID
	.comm	_PCI_DEVICE_ID_THUNDER_RGX,8,3  ; @PCI_DEVICE_ID_THUNDER_RGX
	.comm	_BGX_ID_MASK,4,2                ; @BGX_ID_MASK
	.comm	_max_bgx_per_node,4,2           ; @max_bgx_per_node
	.comm	_MAX_LMAC_PER_BGX,4,2           ; @MAX_LMAC_PER_BGX
	.comm	_bgx_vnic,8,3                   ; @bgx_vnic
	.comm	_MAX_BGX_PER_CN81XX,4,2         ; @MAX_BGX_PER_CN81XX
	.comm	_PCI_SUBSYSTEM_ID,4,2           ; @PCI_SUBSYSTEM_ID
	.comm	_PCI_SUBSYS_DEVID_81XX_BGX,8,3  ; @PCI_SUBSYS_DEVID_81XX_BGX
	.comm	_PCI_SUBSYS_DEVID_83XX_BGX,8,3  ; @PCI_SUBSYS_DEVID_83XX_BGX
l_.str.3:                               ; @.str.3
	.asciz	"BGX%d failed to enable lmac%d\n"

	.no_dead_strip	_bgx_probe
.subsections_via_symbols
