	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpc_closech
_cpc_closech:                           ## @cpc_closech
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r12
	movq	8(%r12), %r15
	movl	(%r12), %r14d
	movq	32(%r15), %rbx
	movq	_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r14d, %esi
	callq	_M_REG
	addq	%rax, %rbx
	movq	_CMD_CH_RST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_cpc_writeb
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_rx_dma_stop
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_tx_dma_stop
	movq	(%r15), %rax
	movq	_PC300_TE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.2:
	addq	$4, %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	24(%r15), %rbx
	addq	16(%r15), %rbx
	movq	%rbx, %rdi
	callq	_cpc_readb
	movq	_CPLD_REG2_FALC_TX_CLK@GOTPCREL(%rip), %rcx
	movq	_CPLD_REG2_FALC_RX_CLK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	orl	(%rcx), %esi
	movq	_CPLD_REG2_FALC_LED2@GOTPCREL(%rip), %rcx
	orl	(%rcx), %esi
	addl	%r14d, %r14d
	movl	%r14d, %ecx
	shll	%cl, %esi
	notl	%esi
	andl	%eax, %esi
	movq	%rbx, %rdi
	callq	_cpc_writeb
	movq	8(%r15), %rbx
	addq	16(%r15), %rbx
	movq	%rbx, %rdi
	callq	_cpc_readb
	movq	_CPLD_REG1_FALC_RESET@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movl	%r14d, %ecx
	shll	%cl, %esi
	orl	%eax, %esi
	movq	%rbx, %rdi
	callq	_cpc_writeb
	movl	$10000, %edi                    ## imm = 0x2710
	callq	_udelay
	movq	8(%r15), %rbx
	addq	16(%r15), %rbx
	movq	%rbx, %rdi
	callq	_cpc_readb
	movl	(%r12), %esi
	movl	%r14d, %ecx
	shll	%cl, %esi
	notl	%esi
	andl	%eax, %esi
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_cpc_writeb                     ## TAILCALL
LBB0_1:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CMD,4,2                        ## @CMD
	.comm	_CMD_CH_RST,4,2                 ## @CMD_CH_RST
	.comm	_PC300_TE,8,3                   ## @PC300_TE
	.comm	_CPLD_REG2_FALC_TX_CLK,4,2      ## @CPLD_REG2_FALC_TX_CLK
	.comm	_CPLD_REG2_FALC_RX_CLK,4,2      ## @CPLD_REG2_FALC_RX_CLK
	.comm	_CPLD_REG2_FALC_LED2,4,2        ## @CPLD_REG2_FALC_LED2
	.comm	_CPLD_REG1_FALC_RESET,4,2       ## @CPLD_REG1_FALC_RESET
	.no_dead_strip	_cpc_closech
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpc_closech
_cpc_closech:                           ; @cpc_closech
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x21, [x0]
	ldr	x19, [x21, #8]
	ldr	w20, [x21]
	ldr	x22, [x19, #32]
Lloh0:
	adrp	x8, _CMD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CMD@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_M_REG
	add	x0, x0, x22
Lloh3:
	adrp	x8, _CMD_CH_RST@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CMD_CH_RST@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_cpc_writeb
	mov	x0, x19
	mov	x1, x20
	bl	_rx_dma_stop
	mov	x0, x19
	mov	x1, x20
	bl	_tx_dma_stop
	ldr	x8, [x19]
Lloh6:
	adrp	x9, _PC300_TE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PC300_TE@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	add	x0, x21, #4
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldp	x8, x9, [x19, #16]
	add	x21, x9, x8
	mov	x0, x21
	bl	_cpc_readb
Lloh9:
	adrp	x8, _CPLD_REG2_FALC_TX_CLK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CPLD_REG2_FALC_TX_CLK@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _CPLD_REG2_FALC_RX_CLK@GOTPAGE
Lloh13:
	ldr	x9, [x9, _CPLD_REG2_FALC_RX_CLK@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
Lloh15:
	adrp	x10, _CPLD_REG2_FALC_LED2@GOTPAGE
Lloh16:
	ldr	x10, [x10, _CPLD_REG2_FALC_LED2@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh17:
	ldr	w9, [x10]
	orr	w8, w8, w9
	lsl	w22, w20, #1
	lsl	w8, w8, w22
	bic	w1, w0, w8
	mov	x0, x21
	bl	_cpc_writeb
	ldp	x9, x8, [x19, #8]
	add	x20, x9, x8
	mov	x0, x20
	bl	_cpc_readb
Lloh18:
	adrp	x21, _CPLD_REG1_FALC_RESET@GOTPAGE
Lloh19:
	ldr	x21, [x21, _CPLD_REG1_FALC_RESET@GOTPAGEOFF]
	ldr	w8, [x21]
	lsl	w8, w8, w22
	orr	w1, w8, w0
	mov	x0, x20
	bl	_cpc_writeb
	mov	w0, #10000
	bl	_udelay
	ldp	x9, x8, [x19, #8]
	add	x19, x9, x8
	mov	x0, x19
	bl	_cpc_readb
	ldr	w8, [x21]
	lsl	w8, w8, w22
	bic	w1, w0, w8
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_cpc_writeb
LBB0_2:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_CMD,4,2                        ; @CMD
	.comm	_CMD_CH_RST,4,2                 ; @CMD_CH_RST
	.comm	_PC300_TE,8,3                   ; @PC300_TE
	.comm	_CPLD_REG2_FALC_TX_CLK,4,2      ; @CPLD_REG2_FALC_TX_CLK
	.comm	_CPLD_REG2_FALC_RX_CLK,4,2      ; @CPLD_REG2_FALC_RX_CLK
	.comm	_CPLD_REG2_FALC_LED2,4,2        ; @CPLD_REG2_FALC_LED2
	.comm	_CPLD_REG1_FALC_RESET,4,2       ; @CPLD_REG1_FALC_RESET
	.no_dead_strip	_cpc_closech
.subsections_via_symbols
