	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function b53_switch_reset
_b53_switch_reset:                      ## @b53_switch_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	%rdi, %rbx
	callq	_b53_switch_reset_gpio
	movq	%rbx, %rdi
	callq	_is539x
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_B53_CTRL_PAGE@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_B53_SOFTRESET@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movq	%rbx, %rdi
	movl	$131, %ecx
	callq	_b53_write8
	movl	(%r14), %esi
	movl	(%r15), %edx
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_b53_write8
LBB0_2:
	movq	(%rbx), %rax
	movq	_BCM58XX_DEVICE_ID@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_4
## %bb.3:
	movq	_BCM583XX_DEVICE_ID@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
LBB0_4:
	movq	_B53_CTRL_PAGE@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_B53_SOFTRESET@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	leaq	-44(%rbp), %rcx
	movq	%rbx, %rdi
	callq	_b53_read8
	movq	_SW_RST@GOTPCREL(%rip), %r13
	movq	_EN_SW_RST@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	orl	(%r13), %ecx
	movq	_EN_CH_RST@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	orl	-44(%rbp), %ecx
	movl	%ecx, -44(%rbp)
	movq	%r15, %r14
	movl	(%r15), %esi
	movl	(%r12), %edx
	movq	%rbx, %rdi
	callq	_b53_write8
	movl	$1001, %r15d                    ## imm = 0x3E9
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %esi
	movl	(%r12), %edx
	movq	%rbx, %rdi
	leaq	-44(%rbp), %rcx
	callq	_b53_read8
	movl	(%r13), %eax
	testl	%eax, -44(%rbp)
	je	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$2000, %esi                     ## imm = 0x7D0
	callq	_usleep_range
	decl	%r15d
	jne	LBB0_5
	jmp	LBB0_7
LBB0_10:
	cmpl	$1, %r15d
	jne	LBB0_7
## %bb.11:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	jmp	LBB0_12
LBB0_7:
	movq	_B53_CTRL_PAGE@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_B53_SWITCH_MODE@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	leaq	-48(%rbp), %rcx
	movq	%rbx, %rdi
	callq	_b53_read8
	movl	-48(%rbp), %ecx
	movq	_SM_SW_FWD_EN@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%ecx, %eax
	jne	LBB0_13
## %bb.8:
	movq	_SM_SW_FWD_MODE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	notl	%edx
	andl	%edx, %ecx
	orl	%eax, %ecx
	movl	%ecx, -48(%rbp)
	movl	(%r14), %esi
	movl	(%r15), %edx
	movq	%rbx, %rdi
	callq	_b53_write8
	movl	(%r14), %esi
	movl	(%r15), %edx
	leaq	-48(%rbp), %rcx
	movq	%rbx, %rdi
	callq	_b53_read8
	movl	(%r12), %eax
	testl	%eax, -48(%rbp)
	je	LBB0_9
LBB0_13:
	movq	%rbx, %rdi
	callq	_b53_enable_mib
	movq	_FAST_AGE_STATIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_b53_flush_arl
	jmp	LBB0_14
LBB0_9:
	movl	8(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_12:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_B53_CTRL_PAGE,4,2              ## @B53_CTRL_PAGE
	.comm	_B53_SOFTRESET,4,2              ## @B53_SOFTRESET
	.comm	_BCM58XX_DEVICE_ID,8,3          ## @BCM58XX_DEVICE_ID
	.comm	_BCM583XX_DEVICE_ID,8,3         ## @BCM583XX_DEVICE_ID
	.comm	_SW_RST,4,2                     ## @SW_RST
	.comm	_EN_SW_RST,4,2                  ## @EN_SW_RST
	.comm	_EN_CH_RST,4,2                  ## @EN_CH_RST
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_B53_SWITCH_MODE,4,2            ## @B53_SWITCH_MODE
	.comm	_SM_SW_FWD_EN,4,2               ## @SM_SW_FWD_EN
	.comm	_SM_SW_FWD_MODE,4,2             ## @SM_SW_FWD_MODE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to enable switch!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_FAST_AGE_STATIC,4,2            ## @FAST_AGE_STATIC
	.no_dead_strip	_b53_switch_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function b53_switch_reset
_b53_switch_reset:                      ; @b53_switch_reset
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	bl	_b53_switch_reset_gpio
	mov	x0, x19
	bl	_is539x
Lloh0:
	adrp	x20, _B53_CTRL_PAGE@GOTPAGE
Lloh1:
	ldr	x20, [x20, _B53_CTRL_PAGE@GOTPAGEOFF]
Lloh2:
	adrp	x21, _B53_SOFTRESET@GOTPAGE
Lloh3:
	ldr	x21, [x21, _B53_SOFTRESET@GOTPAGEOFF]
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w1, [x20]
	ldr	w2, [x21]
	mov	x0, x19
	mov	w3, #131
	bl	_b53_write8
	ldr	w1, [x20]
	ldr	w2, [x21]
	mov	x0, x19
	mov	w3, #0
	bl	_b53_write8
LBB0_2:
	ldr	x8, [x19]
Lloh4:
	adrp	x9, _BCM58XX_DEVICE_ID@GOTPAGE
Lloh5:
	ldr	x9, [x9, _BCM58XX_DEVICE_ID@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
Lloh7:
	adrp	x10, _BCM583XX_DEVICE_ID@GOTPAGE
Lloh8:
	ldr	x10, [x10, _BCM583XX_DEVICE_ID@GOTPAGEOFF]
Lloh9:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_8
; %bb.3:
	ldr	w1, [x20]
	ldr	w2, [x21]
	add	x3, sp, #8
	mov	x0, x19
	bl	_b53_read8
Lloh10:
	adrp	x22, _SW_RST@GOTPAGE
Lloh11:
	ldr	x22, [x22, _SW_RST@GOTPAGEOFF]
Lloh12:
	adrp	x8, _EN_SW_RST@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EN_SW_RST@GOTPAGEOFF]
	ldr	w9, [x22]
Lloh14:
	ldr	w8, [x8]
	orr	w8, w8, w9
Lloh15:
	adrp	x9, _EN_CH_RST@GOTPAGE
Lloh16:
	ldr	x9, [x9, _EN_CH_RST@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [sp, #8]
	orr	w3, w8, w9
	str	w3, [sp, #8]
	ldr	w1, [x20]
	ldr	w2, [x21]
	mov	x0, x19
	bl	_b53_write8
	mov	w23, #1001
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x20]
	ldr	w2, [x21]
	add	x3, sp, #8
	mov	x0, x19
	bl	_b53_read8
	ldr	w8, [sp, #8]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #1000
	mov	w1, #2000
	bl	_usleep_range
	subs	w23, w23, #1
	b.ne	LBB0_4
	b	LBB0_8
LBB0_6:
	cmp	w23, #1
	b.ne	LBB0_8
; %bb.7:
Lloh18:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_12
LBB0_8:
	ldr	w1, [x20]
Lloh20:
	adrp	x21, _B53_SWITCH_MODE@GOTPAGE
Lloh21:
	ldr	x21, [x21, _B53_SWITCH_MODE@GOTPAGEOFF]
	ldr	w2, [x21]
	add	x3, sp, #12
	mov	x0, x19
	bl	_b53_read8
	ldr	w8, [sp, #12]
Lloh22:
	adrp	x22, _SM_SW_FWD_EN@GOTPAGE
Lloh23:
	ldr	x22, [x22, _SM_SW_FWD_EN@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.ne	LBB0_10
; %bb.9:
Lloh24:
	adrp	x10, _SM_SW_FWD_MODE@GOTPAGE
Lloh25:
	ldr	x10, [x10, _SM_SW_FWD_MODE@GOTPAGEOFF]
Lloh26:
	ldr	w10, [x10]
	bic	w8, w8, w10
	orr	w3, w8, w9
	str	w3, [sp, #12]
	ldr	w1, [x20]
	ldr	w2, [x21]
	mov	x0, x19
	bl	_b53_write8
	ldr	w1, [x20]
	ldr	w2, [x21]
	add	x3, sp, #12
	mov	x0, x19
	bl	_b53_read8
	ldr	w8, [sp, #12]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_11
LBB0_10:
	mov	x0, x19
	bl	_b53_enable_mib
Lloh27:
	adrp	x8, _FAST_AGE_STATIC@GOTPAGE
Lloh28:
	ldr	x8, [x8, _FAST_AGE_STATIC@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_b53_flush_arl
	b	LBB0_13
LBB0_11:
	ldr	w0, [x19, #8]
Lloh30:
	adrp	x1, l_.str@PAGE
Lloh31:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh32:
	adrp	x8, _EINVAL@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_B53_CTRL_PAGE,4,2              ; @B53_CTRL_PAGE
	.comm	_B53_SOFTRESET,4,2              ; @B53_SOFTRESET
	.comm	_BCM58XX_DEVICE_ID,8,3          ; @BCM58XX_DEVICE_ID
	.comm	_BCM583XX_DEVICE_ID,8,3         ; @BCM583XX_DEVICE_ID
	.comm	_SW_RST,4,2                     ; @SW_RST
	.comm	_EN_SW_RST,4,2                  ; @EN_SW_RST
	.comm	_EN_CH_RST,4,2                  ; @EN_CH_RST
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_B53_SWITCH_MODE,4,2            ; @B53_SWITCH_MODE
	.comm	_SM_SW_FWD_EN,4,2               ; @SM_SW_FWD_EN
	.comm	_SM_SW_FWD_MODE,4,2             ; @SM_SW_FWD_MODE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to enable switch!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_FAST_AGE_STATIC,4,2            ; @FAST_AGE_STATIC
	.no_dead_strip	_b53_switch_reset
.subsections_via_symbols
