	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -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	_B53_CTRL_PAGE@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_B53_SWITCH_MODE@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	leaq	-36(%rbp), %rcx
	movq	%rbx, %rdi
	callq	_b53_read8
	movl	-36(%rbp), %ecx
	movq	_SM_SW_FWD_EN@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%ecx, %eax
	jne	LBB0_5
## %bb.3:
	movq	_SM_SW_FWD_MODE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	notl	%edx
	andl	%edx, %ecx
	orl	%eax, %ecx
	movl	%ecx, -36(%rbp)
	movl	(%r14), %esi
	movl	(%r15), %edx
	movq	%rbx, %rdi
	callq	_b53_write8
	movl	(%r14), %esi
	movl	(%r15), %edx
	leaq	-36(%rbp), %rcx
	movq	%rbx, %rdi
	callq	_b53_read8
	movl	(%r12), %eax
	testl	%eax, -36(%rbp)
	je	LBB0_4
LBB0_5:
	movq	%rbx, %rdi
	callq	_b53_enable_ports
	movq	(%rbx), %rax
	cmpq	$0, (%rax)
	je	LBB0_7
## %bb.6:
	movq	%rbx, %rdi
	callq	_b53_configure_ports_of
	testl	%eax, %eax
	jne	LBB0_10
	jmp	LBB0_9
LBB0_7:
	movq	%rbx, %rdi
	callq	_b53_configure_ports
	testl	%eax, %eax
	jne	LBB0_10
LBB0_9:
	movq	%rbx, %rdi
	callq	_b53_enable_mib
	movq	%rbx, %rdi
	callq	_b53_flush_arl
	jmp	LBB0_10
LBB0_4:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	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	_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
	.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, #64
	.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
	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]
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w1, [x20]
Lloh2:
	adrp	x21, _B53_SOFTRESET@GOTPAGE
Lloh3:
	ldr	x21, [x21, _B53_SOFTRESET@GOTPAGEOFF]
	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	w1, [x20]
Lloh4:
	adrp	x21, _B53_SWITCH_MODE@GOTPAGE
Lloh5:
	ldr	x21, [x21, _B53_SWITCH_MODE@GOTPAGEOFF]
	ldr	w2, [x21]
	add	x3, sp, #12
	mov	x0, x19
	bl	_b53_read8
	ldr	w8, [sp, #12]
Lloh6:
	adrp	x22, _SM_SW_FWD_EN@GOTPAGE
Lloh7:
	ldr	x22, [x22, _SM_SW_FWD_EN@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.ne	LBB0_4
; %bb.3:
Lloh8:
	adrp	x10, _SM_SW_FWD_MODE@GOTPAGE
Lloh9:
	ldr	x10, [x10, _SM_SW_FWD_MODE@GOTPAGEOFF]
Lloh10:
	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_8
LBB0_4:
	mov	x0, x19
	bl	_b53_enable_ports
	ldr	x8, [x19]
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_b53_configure_ports_of
	cbnz	w0, LBB0_9
	b	LBB0_7
LBB0_6:
	mov	x0, x19
	bl	_b53_configure_ports
	cbnz	w0, LBB0_9
LBB0_7:
	mov	x0, x19
	bl	_b53_enable_mib
	mov	x0, x19
	bl	_b53_flush_arl
	b	LBB0_9
LBB0_8:
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_B53_CTRL_PAGE,4,2              ; @B53_CTRL_PAGE
	.comm	_B53_SOFTRESET,4,2              ; @B53_SOFTRESET
	.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
	.no_dead_strip	_b53_switch_reset
.subsections_via_symbols
