	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlxsw_pci_sw_reset
_mlxsw_pci_sw_reset:                    ## @mlxsw_pci_sw_reset
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MLXSW_REG_MRSR_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	movq	%rbx, %rdi
	callq	_mlxsw_reg_mrsr_pack
	movl	(%r14), %r12d
	movq	_mrsr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_MLXSW_REG
	movl	%r12d, %edi
	movl	%eax, %esi
	movq	%rbx, %rdx
	callq	_mlxsw_reg_write
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_7
## %bb.1:
	movq	(%r15), %rax
	movq	_PCI_DEVICE_ID_MELLANOX_SWITCHX2@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	movq	_MLXSW_PCI_SW_RESET_TIMEOUT_MSECS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msleep
	xorl	%r12d, %r12d
	jmp	LBB0_7
LBB0_3:
	movq	_MLXSW_PCI_SW_RESET_WAIT_MSECS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msleep
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	_MLXSW_PCI_SW_RESET_TIMEOUT_MSECS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movq	%rax, %rbx
	addq	%r15, %rbx
	movq	_MLXSW_PCI_FW_READY_MASK@GOTPCREL(%rip), %r15
	movq	_MLXSW_PCI_FW_READY_MAGIC@GOTPCREL(%rip), %r13
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_FW_READY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_mlxsw_pci_read32
	andl	(%r15), %eax
	cmpl	(%r13), %eax
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	xorl	%eax, %eax
	callq	_cond_resched
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%rbx, %rsi
	callq	_time_before
	testq	%rax, %rax
	jne	LBB0_4
## %bb.6:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_7:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_9
## %bb.8:
	movl	%r12d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MLXSW_REG_MRSR_LEN,4,2         ## @MLXSW_REG_MRSR_LEN
	.comm	_mrsr,4,2                       ## @mrsr
	.comm	_PCI_DEVICE_ID_MELLANOX_SWITCHX2,8,3 ## @PCI_DEVICE_ID_MELLANOX_SWITCHX2
	.comm	_MLXSW_PCI_SW_RESET_TIMEOUT_MSECS,4,2 ## @MLXSW_PCI_SW_RESET_TIMEOUT_MSECS
	.comm	_MLXSW_PCI_SW_RESET_WAIT_MSECS,4,2 ## @MLXSW_PCI_SW_RESET_WAIT_MSECS
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_FW_READY,4,2                   ## @FW_READY
	.comm	_MLXSW_PCI_FW_READY_MASK,4,2    ## @MLXSW_PCI_FW_READY_MASK
	.comm	_MLXSW_PCI_FW_READY_MAGIC,4,2   ## @MLXSW_PCI_FW_READY_MAGIC
	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_mlxsw_pci_sw_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlxsw_pci_sw_reset
_mlxsw_pci_sw_reset:                    ; @mlxsw_pci_sw_reset
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	sub	sp, sp, #16
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x8, _MLXSW_REG_MRSR_LEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MLXSW_REG_MRSR_LEN@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x21, x9, x8
	mov	sp, x21
	mov	x0, x21
	bl	_mlxsw_reg_mrsr_pack
	ldr	w22, [x19]
Lloh8:
	adrp	x8, _mrsr@GOTPAGE
Lloh9:
	ldr	x8, [x8, _mrsr@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_MLXSW_REG
	mov	x1, x0
	mov	x0, x22
	mov	x2, x21
	bl	_mlxsw_reg_write
	cbnz	w0, LBB0_8
; %bb.1:
	ldr	x8, [x20]
Lloh11:
	adrp	x9, _PCI_DEVICE_ID_MELLANOX_SWITCHX2@GOTPAGE
Lloh12:
	ldr	x9, [x9, _PCI_DEVICE_ID_MELLANOX_SWITCHX2@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
Lloh14:
	adrp	x8, _MLXSW_PCI_SW_RESET_TIMEOUT_MSECS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MLXSW_PCI_SW_RESET_TIMEOUT_MSECS@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_msleep
LBB0_3:
	mov	w0, #0
	b	LBB0_8
LBB0_4:
Lloh17:
	adrp	x8, _MLXSW_PCI_SW_RESET_WAIT_MSECS@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MLXSW_PCI_SW_RESET_WAIT_MSECS@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	bl	_msleep
Lloh20:
	adrp	x21, _jiffies@GOTPAGE
Lloh21:
	ldr	x21, [x21, _jiffies@GOTPAGEOFF]
	ldr	x20, [x21]
Lloh22:
	adrp	x8, _MLXSW_PCI_SW_RESET_TIMEOUT_MSECS@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MLXSW_PCI_SW_RESET_TIMEOUT_MSECS@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	add	x20, x0, x20
Lloh25:
	adrp	x22, _FW_READY@GOTPAGE
Lloh26:
	ldr	x22, [x22, _FW_READY@GOTPAGEOFF]
Lloh27:
	adrp	x23, _MLXSW_PCI_FW_READY_MASK@GOTPAGE
Lloh28:
	ldr	x23, [x23, _MLXSW_PCI_FW_READY_MASK@GOTPAGEOFF]
Lloh29:
	adrp	x24, _MLXSW_PCI_FW_READY_MAGIC@GOTPAGE
Lloh30:
	ldr	x24, [x24, _MLXSW_PCI_FW_READY_MAGIC@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	mov	x0, x19
	bl	_mlxsw_pci_read32
	ldr	w8, [x23]
	and	w8, w8, w0
	ldr	w9, [x24]
	cmp	w8, w9
	b.eq	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	bl	_cond_resched
	ldr	x0, [x21]
	mov	x1, x20
	bl	_time_before
	cbnz	x0, LBB0_5
; %bb.7:
Lloh31:
	adrp	x8, _EBUSY@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldur	x8, [x29, #-56]
Lloh34:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh35:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh36:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.9:
	sub	sp, x29, #48
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_10:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_MLXSW_REG_MRSR_LEN,4,2         ; @MLXSW_REG_MRSR_LEN
	.comm	_mrsr,4,2                       ; @mrsr
	.comm	_PCI_DEVICE_ID_MELLANOX_SWITCHX2,8,3 ; @PCI_DEVICE_ID_MELLANOX_SWITCHX2
	.comm	_MLXSW_PCI_SW_RESET_TIMEOUT_MSECS,4,2 ; @MLXSW_PCI_SW_RESET_TIMEOUT_MSECS
	.comm	_MLXSW_PCI_SW_RESET_WAIT_MSECS,4,2 ; @MLXSW_PCI_SW_RESET_WAIT_MSECS
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_FW_READY,4,2                   ; @FW_READY
	.comm	_MLXSW_PCI_FW_READY_MASK,4,2    ; @MLXSW_PCI_FW_READY_MASK
	.comm	_MLXSW_PCI_FW_READY_MAGIC,4,2   ; @MLXSW_PCI_FW_READY_MAGIC
	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_mlxsw_pci_sw_reset
.subsections_via_symbols
