	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ts7250_hwcontrol
_ts7250_hwcontrol:                      ## @ts7250_hwcontrol
	.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
	movl	%esi, %r14d
	movq	(%rdi), %r12
	movq	_NAND_CTRL_CHANGE@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	je	LBB0_2
## %bb.1:
	movl	%edx, %ebx
	movq	_TS72XX_NAND_CONTROL_VIRT_BASE@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	_NAND_NCE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%edx, %eax
	shll	$2, %eax
	movq	_NAND_CLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%edx, %ecx
	orl	%eax, %ecx
	movq	_NAND_ALE@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	shrl	$2, %ebx
	orl	%ecx, %ebx
	movq	%r15, %rdi
	callq	___raw_readb
	andl	$-8, %eax
	movzbl	%bl, %edi
	orl	%eax, %edi
	movq	%r15, %rsi
	callq	___raw_writeb
LBB0_2:
	movq	_NAND_CMD_NONE@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_4
## %bb.3:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	(%r12), %esi
	movl	%r14d, %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_writeb                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_CTRL_CHANGE,4,2           ## @NAND_CTRL_CHANGE
	.comm	_TS72XX_NAND_CONTROL_VIRT_BASE,8,3 ## @TS72XX_NAND_CONTROL_VIRT_BASE
	.comm	_NAND_NCE,4,2                   ## @NAND_NCE
	.comm	_NAND_CLE,4,2                   ## @NAND_CLE
	.comm	_NAND_ALE,4,2                   ## @NAND_ALE
	.comm	_NAND_CMD_NONE,4,2              ## @NAND_CMD_NONE
	.no_dead_strip	_ts7250_hwcontrol
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ts7250_hwcontrol
_ts7250_hwcontrol:                      ; @ts7250_hwcontrol
	.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
	mov	x19, x1
	ldr	x21, [x0]
Lloh0:
	adrp	x8, _NAND_CTRL_CHANGE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NAND_CTRL_CHANGE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w2
	b.eq	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _TS72XX_NAND_CONTROL_VIRT_BASE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TS72XX_NAND_CONTROL_VIRT_BASE@GOTPAGEOFF]
Lloh5:
	ldr	x20, [x8]
Lloh6:
	adrp	x8, _NAND_NCE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NAND_NCE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	and	w8, w8, w2
Lloh9:
	adrp	x9, _NAND_CLE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _NAND_CLE@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	and	w9, w9, w2
	orr	w8, w9, w8, lsl #2
Lloh12:
	adrp	x9, _NAND_ALE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _NAND_ALE@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	and	w9, w9, w2
	orr	w22, w8, w9, lsr #2
	mov	x0, x20
	bl	___raw_readb
	and	w8, w0, #0xfffffff8
	and	w9, w22, #0xff
	orr	w0, w9, w8
	mov	x1, x20
	bl	___raw_writeb
LBB0_2:
Lloh15:
	adrp	x8, _NAND_CMD_NONE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _NAND_CMD_NONE@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_4
; %bb.3:
	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
LBB0_4:
	ldr	w1, [x21]
	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	_writeb
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_CTRL_CHANGE,4,2           ; @NAND_CTRL_CHANGE
	.comm	_TS72XX_NAND_CONTROL_VIRT_BASE,8,3 ; @TS72XX_NAND_CONTROL_VIRT_BASE
	.comm	_NAND_NCE,4,2                   ; @NAND_NCE
	.comm	_NAND_CLE,4,2                   ; @NAND_CLE
	.comm	_NAND_ALE,4,2                   ; @NAND_ALE
	.comm	_NAND_CMD_NONE,4,2              ; @NAND_CMD_NONE
	.no_dead_strip	_ts7250_hwcontrol
.subsections_via_symbols
