	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s3c_onenand_reset
_s3c_onenand_reset:                     ## @s3c_onenand_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_ONENAND_MEM_RESET_COLD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_MEM_RESET_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_s3c_write_reg
	movq	$-65537, %rbx                   ## imm = 0xFFFEFFFF
	movq	_INT_ERR_STAT_OFFSET@GOTPCREL(%rip), %r14
	movq	_RST_CMP@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	incq	%rbx
	je	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r14), %edi
	callq	_s3c_read_reg
	testl	%eax, (%r15)
	je	LBB0_1
LBB0_3:
	movl	(%r14), %edi
	callq	_s3c_read_reg
	movq	_INT_ERR_ACK_OFFSET@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movl	%eax, %edi
	callq	_s3c_write_reg
	movl	(%rbx), %esi
	xorl	%edi, %edi
	callq	_s3c_write_reg
	movq	_ECC_ERR_STAT_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_s3c_write_reg                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ONENAND_MEM_RESET_COLD,4,2     ## @ONENAND_MEM_RESET_COLD
	.comm	_MEM_RESET_OFFSET,4,2           ## @MEM_RESET_OFFSET
	.comm	_INT_ERR_STAT_OFFSET,4,2        ## @INT_ERR_STAT_OFFSET
	.comm	_RST_CMP,4,2                    ## @RST_CMP
	.comm	_INT_ERR_ACK_OFFSET,4,2         ## @INT_ERR_ACK_OFFSET
	.comm	_ECC_ERR_STAT_OFFSET,4,2        ## @ECC_ERR_STAT_OFFSET
	.no_dead_strip	_s3c_onenand_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s3c_onenand_reset
_s3c_onenand_reset:                     ; @s3c_onenand_reset
	.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
Lloh0:
	adrp	x8, _ONENAND_MEM_RESET_COLD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ONENAND_MEM_RESET_COLD@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _MEM_RESET_OFFSET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MEM_RESET_OFFSET@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_s3c_write_reg
	mov	x19, #-65537
Lloh6:
	adrp	x20, _INT_ERR_STAT_OFFSET@GOTPAGE
Lloh7:
	ldr	x20, [x20, _INT_ERR_STAT_OFFSET@GOTPAGEOFF]
Lloh8:
	adrp	x21, _RST_CMP@GOTPAGE
Lloh9:
	ldr	x21, [x21, _RST_CMP@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	adds	x19, x19, #1
	b.hs	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w0, [x20]
	bl	_s3c_read_reg
	ldr	w8, [x21]
	tst	w8, w0
	b.eq	LBB0_1
LBB0_3:
	ldr	w0, [x20]
	bl	_s3c_read_reg
Lloh10:
	adrp	x19, _INT_ERR_ACK_OFFSET@GOTPAGE
Lloh11:
	ldr	x19, [x19, _INT_ERR_ACK_OFFSET@GOTPAGEOFF]
	ldr	w1, [x19]
	bl	_s3c_write_reg
	ldr	w1, [x19]
	mov	w0, #0
	bl	_s3c_write_reg
Lloh12:
	adrp	x8, _ECC_ERR_STAT_OFFSET@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ECC_ERR_STAT_OFFSET@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	w0, #0
	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	_s3c_write_reg
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_ONENAND_MEM_RESET_COLD,4,2     ; @ONENAND_MEM_RESET_COLD
	.comm	_MEM_RESET_OFFSET,4,2           ; @MEM_RESET_OFFSET
	.comm	_INT_ERR_STAT_OFFSET,4,2        ; @INT_ERR_STAT_OFFSET
	.comm	_RST_CMP,4,2                    ; @RST_CMP
	.comm	_INT_ERR_ACK_OFFSET,4,2         ; @INT_ERR_ACK_OFFSET
	.comm	_ECC_ERR_STAT_OFFSET,4,2        ; @ECC_ERR_STAT_OFFSET
	.no_dead_strip	_s3c_onenand_reset
.subsections_via_symbols
