	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_state_action
_do_state_action:                       ## @do_state_action
	.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
                                        ## kill: def $esi killed $esi def $rsi
	movq	%rdi, %rbx
	xorl	%ecx, %ecx
	cmpl	$8, (%rdi)
	sete	%dl
	movq	_ACTION_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %esi
	cmpl	$129, %esi
	jne	LBB0_1
## %bb.13:
	cmpl	$0, 72(%rbx)
	je	LBB0_16
## %bb.14:
	leaq	L_.str.6(%rip), %rdi
LBB0_15:
	xorl	%eax, %eax
	callq	_NS_ERR
	movl	$-1, %r14d
	jmp	LBB0_37
LBB0_1:
	movq	48(%rbx), %rax
	cmpq	8(%rbx), %rax
	jge	LBB0_2
## %bb.3:
	addl	$-128, %esi
	cmpl	$5, %esi
	ja	LBB0_36
## %bb.4:
	movb	%dl, %cl
	movl	$2, %r15d
	subl	%ecx, %r15d
	leaq	LJTI0_0(%rip), %rax
	movslq	(%rax,%rsi,4), %rcx
	addq	%rax, %rcx
	jmpq	*%rcx
LBB0_31:
	leaq	L_.str.16(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_NS_DBG
	movl	$0, 60(%rbx)
	jmp	LBB0_37
LBB0_2:
	leaq	L_.str(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_NS_WARN
	movl	$-1, %r14d
	jmp	LBB0_37
LBB0_16:
	movq	48(%rbx), %rsi
	movq	8(%rbx), %rax
	movl	24(%rbx), %ecx
	subq	%rcx, %rax
	cmpq	%rax, %rsi
	jge	LBB0_18
## %bb.17:
	xorl	%eax, %eax
	subl	44(%rbx), %eax
	cltq
	testq	%rax, %rsi
	je	LBB0_19
LBB0_18:
	leaq	L_.str.7(%rip), %rdi
	xorl	%eax, %eax
	callq	_NS_ERR
	movl	$-1, %r14d
	jmp	LBB0_37
LBB0_36:
	leaq	L_.str.19(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_NS_DBG
	jmp	LBB0_37
LBB0_24:
	cmpl	$0, 72(%rbx)
	je	LBB0_26
## %bb.25:
	leaq	L_.str.11(%rip), %rdi
	xorl	%eax, %eax
	callq	_NS_WARN
	movl	$-1, %r14d
	jmp	LBB0_37
LBB0_35:
	movl	20(%rbx), %esi
	leaq	L_.str.18(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_NS_DBG
	movl	20(%rbx), %eax
	movl	%eax, 60(%rbx)
	jmp	LBB0_37
LBB0_32:
	movq	_OPT_PAGE512_8BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%rbx)
	je	LBB0_33
## %bb.34:
	movl	20(%rbx), %eax
	movl	%eax, %esi
	shrl	$31, %esi
	addl	%eax, %esi
	sarl	%esi
	leaq	L_.str.18(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_NS_DBG
	movl	20(%rbx), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	movl	%ecx, 60(%rbx)
	jmp	LBB0_37
LBB0_5:
	movl	16(%rbx), %r14d
	subl	60(%rbx), %r14d
	subl	56(%rbx), %r14d
	jle	LBB0_6
## %bb.7:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_read_page
	movq	%rbx, %rdi
	callq	_NS_RAW_OFFSET
	addl	60(%rbx), %eax
	leaq	L_.str.2(%rip), %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_NS_DBG
	movl	60(%rbx), %eax
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	movl	48(%rbx), %esi
	cmpl	20(%rbx), %eax
	jge	LBB0_11
## %bb.10:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_12
LBB0_19:
	movl	28(%rbx), %ecx
	subl	32(%rbx), %ecx
	shll	$3, %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shlq	%cl, %rsi
	movl	36(%rbx), %ecx
	movslq	56(%rbx), %r12
	orq	%rsi, %r12
	movq	%r12, 48(%rbx)
	movl	$0, 56(%rbx)
	subl	40(%rbx), %ecx
	movq	%r12, %r15
                                        ## kill: def $cl killed $cl killed $ecx
	sarq	%cl, %r15
	movq	%rbx, %rdi
	callq	_NS_RAW_OFFSET
	leaq	L_.str.8(%rip), %rdi
	xorl	%r14d, %r14d
	movq	%r12, %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_NS_DBG
	leaq	L_.str.9(%rip), %rdi
	movl	%r15d, %esi
	callq	_NS_LOG
	movq	%rbx, %rdi
	callq	_erase_sector
	movq	_erase_delay@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_NS_MDELAY
	movq	_erase_block_wear@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_21
## %bb.20:
	movl	%r15d, %edi
	callq	_update_wear
LBB0_21:
	movl	%r15d, %edi
	callq	_erase_error
	testl	%eax, %eax
	je	LBB0_37
## %bb.22:
	leaq	L_.str.10(%rip), %rdi
	movl	%r15d, %esi
LBB0_23:
	xorl	%eax, %eax
	callq	_NS_WARN
	movl	$-1, %r14d
	jmp	LBB0_37
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_NS_ERR
	jmp	LBB0_37
LBB0_26:
	movl	60(%rbx), %eax
	addl	56(%rbx), %eax
	movl	16(%rbx), %r12d
	subl	%eax, %r12d
	movl	64(%rbx), %esi
	cmpl	%esi, %r12d
	jne	LBB0_27
## %bb.28:
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_prog_page
	movl	$-1, %r14d
	cmpl	$-1, %eax
	je	LBB0_37
## %bb.29:
	movq	48(%rbx), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	56(%rbx), %r13d
	movq	%rbx, %rdi
	callq	_NS_RAW_OFFSET
	addl	60(%rbx), %eax
	leaq	L_.str.13(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%r12d, %esi
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdx
	movl	%r13d, %ecx
	movl	%eax, %r8d
	xorl	%eax, %eax
	callq	_NS_DBG
	movl	48(%rbx), %esi
	leaq	L_.str.14(%rip), %rdi
	callq	_NS_LOG
	movq	_programm_delay@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_NS_UDELAY
	movq	_output_cycle@GOTPCREL(%rip), %rax
	movl	20(%rbx), %ecx
	imull	(%rax), %ecx
	movslq	%ecx, %rax
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$38, %rax
	addl	%ecx, %eax
                                        ## kill: def $eax killed $eax killed $rax
	cltd
	idivl	%r15d
	movl	%eax, %edi
	callq	_NS_UDELAY
	movl	%r12d, %edi
	callq	_write_error
	testl	%eax, %eax
	je	LBB0_37
## %bb.30:
	leaq	L_.str.15(%rip), %rdi
	movl	%r12d, %esi
	jmp	LBB0_23
LBB0_33:
	leaq	L_.str.17(%rip), %rdi
	jmp	LBB0_15
LBB0_8:
	movl	48(%rbx), %esi
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_12
LBB0_27:
	leaq	L_.str.12(%rip), %rdi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_NS_ERR
	movl	$-1, %r14d
	jmp	LBB0_37
LBB0_11:
	leaq	L_.str.5(%rip), %rdi
LBB0_12:
	callq	_NS_LOG
	movq	_access_delay@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_NS_UDELAY
	movq	_input_cycle@GOTPCREL(%rip), %rax
	movl	20(%rbx), %ecx
	imull	(%rax), %ecx
	movslq	%ecx, %rax
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$38, %rax
	addl	%ecx, %eax
                                        ## kill: def $eax killed $eax killed $rax
	cltd
	idivl	%r15d
	movl	%eax, %edi
	callq	_NS_UDELAY
	xorl	%r14d, %r14d
LBB0_37:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_31, LBB0_31-LJTI0_0
.set L0_0_set_36, LBB0_36-LJTI0_0
.set L0_0_set_24, LBB0_24-LJTI0_0
.set L0_0_set_35, LBB0_35-LJTI0_0
.set L0_0_set_32, LBB0_32-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
LJTI0_0:
	.long	L0_0_set_31
	.long	L0_0_set_36
	.long	L0_0_set_24
	.long	L0_0_set_35
	.long	L0_0_set_32
	.long	L0_0_set_5
	.end_data_region
                                        ## -- End function
	.comm	_ACTION_MASK,4,2                ## @ACTION_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"do_state_action: wrong page number (%#x)\n"

L_.str.1:                               ## @.str.1
	.asciz	"do_state_action: column number is too large\n"

L_.str.2:                               ## @.str.2
	.asciz	"do_state_action: (ACTION_CPY:) copy %d bytes to int buf, raw offset %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"read page %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"read page %d (second half)\n"

L_.str.5:                               ## @.str.5
	.asciz	"read OOB of page %d\n"

	.comm	_access_delay,4,2               ## @access_delay
	.comm	_input_cycle,4,2                ## @input_cycle
L_.str.6:                               ## @.str.6
	.asciz	"do_state_action: device is write-protected, ignore sector erase\n"

L_.str.7:                               ## @.str.7
	.asciz	"do_state_action: wrong sector address (%#x)\n"

L_.str.8:                               ## @.str.8
	.asciz	"do_state_action: erase sector at address %#x, off = %d\n"

L_.str.9:                               ## @.str.9
	.asciz	"erase sector %u\n"

	.comm	_erase_delay,4,2                ## @erase_delay
	.comm	_erase_block_wear,4,2           ## @erase_block_wear
L_.str.10:                              ## @.str.10
	.asciz	"simulating erase failure in erase block %u\n"

L_.str.11:                              ## @.str.11
	.asciz	"do_state_action: device is write-protected, programm\n"

L_.str.12:                              ## @.str.12
	.asciz	"do_state_action: too few bytes were input (%d instead of %d)\n"

L_.str.13:                              ## @.str.13
	.asciz	"do_state_action: copy %d bytes from int buf to (%#x, %#x), raw off = %d\n"

L_.str.14:                              ## @.str.14
	.asciz	"programm page %d\n"

	.comm	_programm_delay,4,2             ## @programm_delay
	.comm	_output_cycle,4,2               ## @output_cycle
L_.str.15:                              ## @.str.15
	.asciz	"simulating write failure in page %u\n"

L_.str.16:                              ## @.str.16
	.asciz	"do_state_action: set internal offset to 0\n"

	.comm	_OPT_PAGE512_8BIT,4,2           ## @OPT_PAGE512_8BIT
L_.str.17:                              ## @.str.17
	.asciz	"do_state_action: BUG! can't skip half of page for non-512byte page size 8x chips\n"

L_.str.18:                              ## @.str.18
	.asciz	"do_state_action: set internal offset to %d\n"

L_.str.19:                              ## @.str.19
	.asciz	"do_state_action: BUG! unknown action\n"

	.no_dead_strip	_do_state_action
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_state_action
_do_state_action:                       ; @do_state_action
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	ldr	w8, [x0]
	cmp	w8, #8
	mov	w8, #1
	cinc	w22, w8, ne
Lloh0:
	adrp	x8, _ACTION_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ACTION_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w8, w8, w1
	cmp	w8, #129
	b.ne	LBB0_3
; %bb.1:
	ldr	w8, [x19, #72]
	cbz	w8, LBB0_9
; %bb.2:
Lloh3:
	adrp	x0, l_.str.6@PAGE
Lloh4:
	add	x0, x0, l_.str.6@PAGEOFF
	b	LBB0_12
LBB0_3:
	ldr	x9, [x19, #48]
	ldr	x10, [x19, #8]
	cmp	x9, x10
	b.ge	LBB0_7
; %bb.4:
	sub	w8, w8, #128
	cmp	w8, #5
	b.hi	LBB0_15
; %bb.5:
Lloh5:
	adrp	x9, lJTI0_0@PAGE
Lloh6:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_6
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_6:
Lloh7:
	adrp	x0, l_.str.16@PAGE
Lloh8:
	add	x0, x0, l_.str.16@PAGEOFF
	bl	_NS_DBG
	mov	w0, #0
	str	wzr, [x19, #60]
	b	LBB0_14
LBB0_7:
	str	x9, [sp]
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
LBB0_8:
	bl	_NS_WARN
	b	LBB0_13
LBB0_9:
	ldr	x8, [x19, #48]
	ldr	x9, [x19, #8]
	ldr	w10, [x19, #24]
	sub	x9, x9, x10
	cmp	x8, x9
	b.ge	LBB0_11
; %bb.10:
	ldr	w9, [x19, #44]
	neg	w9, w9
	sxtw	x9, w9
	tst	x8, x9
	b.eq	LBB0_25
LBB0_11:
	str	x8, [sp]
Lloh11:
	adrp	x0, l_.str.7@PAGE
Lloh12:
	add	x0, x0, l_.str.7@PAGEOFF
LBB0_12:
	bl	_NS_ERR
LBB0_13:
	mov	w0, #-1
LBB0_14:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_15:
Lloh13:
	adrp	x0, l_.str.19@PAGE
Lloh14:
	add	x0, x0, l_.str.19@PAGEOFF
	bl	_NS_DBG
	b	LBB0_39
LBB0_16:
	ldr	w8, [x19, #72]
	cbz	w8, LBB0_30
; %bb.17:
Lloh15:
	adrp	x0, l_.str.11@PAGE
Lloh16:
	add	x0, x0, l_.str.11@PAGEOFF
	b	LBB0_8
LBB0_18:
	ldr	w8, [x19, #20]
	str	x8, [sp]
Lloh17:
	adrp	x0, l_.str.18@PAGE
Lloh18:
	add	x0, x0, l_.str.18@PAGEOFF
	bl	_NS_DBG
	mov	w0, #0
	ldr	w8, [x19, #20]
	str	w8, [x19, #60]
	b	LBB0_14
LBB0_19:
	ldr	w8, [x19, #4]
Lloh19:
	adrp	x9, _OPT_PAGE512_8BIT@GOTPAGE
Lloh20:
	ldr	x9, [x9, _OPT_PAGE512_8BIT@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_34
; %bb.20:
	ldr	w8, [x19, #20]
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	str	x8, [sp]
Lloh22:
	adrp	x0, l_.str.18@PAGE
Lloh23:
	add	x0, x0, l_.str.18@PAGEOFF
	bl	_NS_DBG
	mov	w0, #0
	ldr	w8, [x19, #20]
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	str	w8, [x19, #60]
	b	LBB0_14
LBB0_21:
	ldr	w8, [x19, #16]
	ldp	w9, w10, [x19, #56]
	sub	w8, w8, w10
	subs	w20, w8, w9
	b.le	LBB0_29
; %bb.22:
	mov	x0, x19
	mov	x1, x20
	bl	_read_page
	mov	x0, x19
	bl	_NS_RAW_OFFSET
	ldr	w8, [x19, #60]
	add	w8, w8, w0
	stp	x20, x8, [sp]
Lloh24:
	adrp	x0, l_.str.2@PAGE
Lloh25:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_NS_DBG
	ldr	w8, [x19, #60]
	cbz	w8, LBB0_35
; %bb.23:
	ldr	w9, [x19, #20]
	ldr	w1, [x19, #48]
	cmp	w8, w9
	b.ge	LBB0_37
; %bb.24:
Lloh26:
	adrp	x0, l_.str.4@PAGE
Lloh27:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_38
LBB0_25:
	ldp	w9, w10, [x19, #28]
	sub	w9, w9, w10
	lsl	w9, w9, #3
	lsl	x8, x8, x9
	ldrsw	x9, [x19, #56]
	orr	x21, x8, x9
	str	x21, [x19, #48]
	str	wzr, [x19, #56]
	ldp	w8, w9, [x19, #36]
	sub	w8, w8, w9
	asr	x20, x21, x8
	mov	x0, x19
	bl	_NS_RAW_OFFSET
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x21, x0, [sp]
Lloh28:
	adrp	x0, l_.str.8@PAGE
Lloh29:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_NS_DBG
Lloh30:
	adrp	x0, l_.str.9@PAGE
Lloh31:
	add	x0, x0, l_.str.9@PAGEOFF
	mov	x1, x20
	bl	_NS_LOG
	mov	x0, x19
	bl	_erase_sector
Lloh32:
	adrp	x8, _erase_delay@GOTPAGE
Lloh33:
	ldr	x8, [x8, _erase_delay@GOTPAGEOFF]
Lloh34:
	ldr	w0, [x8]
	bl	_NS_MDELAY
Lloh35:
	adrp	x8, _erase_block_wear@GOTPAGE
Lloh36:
	ldr	x8, [x8, _erase_block_wear@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	cbz	w8, LBB0_27
; %bb.26:
	mov	x0, x20
	bl	_update_wear
LBB0_27:
	mov	x0, x20
	bl	_erase_error
	cbz	w0, LBB0_14
; %bb.28:
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	str	x20, [sp]
Lloh38:
	adrp	x0, l_.str.10@PAGE
Lloh39:
	add	x0, x0, l_.str.10@PAGEOFF
	b	LBB0_8
LBB0_29:
Lloh40:
	adrp	x0, l_.str.1@PAGE
Lloh41:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_NS_ERR
	b	LBB0_39
LBB0_30:
	ldr	w8, [x19, #16]
	ldp	w10, w9, [x19, #56]
	add	w9, w9, w10
	sub	w21, w8, w9
	ldr	w8, [x19, #64]
	cmp	w21, w8
	b.ne	LBB0_36
; %bb.31:
	mov	x0, x19
	mov	x1, x21
	bl	_prog_page
	cmn	w0, #1
	b.eq	LBB0_14
; %bb.32:
	ldr	x20, [x19, #48]
	ldr	w23, [x19, #56]
	mov	x0, x19
	bl	_NS_RAW_OFFSET
	ldr	w8, [x19, #60]
	add	w8, w8, w0
	stp	x23, x8, [sp, #16]
	stp	x21, x20, [sp]
Lloh42:
	adrp	x0, l_.str.13@PAGE
Lloh43:
	add	x0, x0, l_.str.13@PAGEOFF
	bl	_NS_DBG
	ldr	w1, [x19, #48]
Lloh44:
	adrp	x0, l_.str.14@PAGE
Lloh45:
	add	x0, x0, l_.str.14@PAGEOFF
	bl	_NS_LOG
Lloh46:
	adrp	x8, _programm_delay@GOTPAGE
Lloh47:
	ldr	x8, [x8, _programm_delay@GOTPAGEOFF]
Lloh48:
	ldr	w0, [x8]
	bl	_NS_UDELAY
Lloh49:
	adrp	x8, _output_cycle@GOTPAGE
Lloh50:
	ldr	x8, [x8, _output_cycle@GOTPAGEOFF]
Lloh51:
	ldr	w8, [x8]
	ldr	w9, [x19, #20]
	mul	w8, w9, w8
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w9
	sdiv	w0, w8, w22
	bl	_NS_UDELAY
	mov	x0, x20
	bl	_write_error
	cbz	w0, LBB0_14
; %bb.33:
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	str	x20, [sp]
Lloh52:
	adrp	x0, l_.str.15@PAGE
Lloh53:
	add	x0, x0, l_.str.15@PAGEOFF
	b	LBB0_8
LBB0_34:
Lloh54:
	adrp	x0, l_.str.17@PAGE
Lloh55:
	add	x0, x0, l_.str.17@PAGEOFF
	b	LBB0_12
LBB0_35:
	ldr	w1, [x19, #48]
Lloh56:
	adrp	x0, l_.str.3@PAGE
Lloh57:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_38
LBB0_36:
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	stp	x8, x21, [sp]
Lloh58:
	adrp	x0, l_.str.12@PAGE
Lloh59:
	add	x0, x0, l_.str.12@PAGEOFF
	b	LBB0_12
LBB0_37:
Lloh60:
	adrp	x0, l_.str.5@PAGE
Lloh61:
	add	x0, x0, l_.str.5@PAGEOFF
LBB0_38:
	bl	_NS_LOG
Lloh62:
	adrp	x8, _access_delay@GOTPAGE
Lloh63:
	ldr	x8, [x8, _access_delay@GOTPAGEOFF]
Lloh64:
	ldr	w0, [x8]
	bl	_NS_UDELAY
Lloh65:
	adrp	x8, _input_cycle@GOTPAGE
Lloh66:
	ldr	x8, [x8, _input_cycle@GOTPAGEOFF]
Lloh67:
	ldr	w8, [x8]
	ldr	w9, [x19, #20]
	mul	w8, w9, w8
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w9
	sdiv	w0, w8, w22
	bl	_NS_UDELAY
LBB0_39:
	mov	w0, #0
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpAdd	Lloh52, Lloh53
	.loh AdrpAdd	Lloh54, Lloh55
	.loh AdrpAdd	Lloh56, Lloh57
	.loh AdrpAdd	Lloh58, Lloh59
	.loh AdrpAdd	Lloh60, Lloh61
	.loh AdrpLdrGotLdr	Lloh65, Lloh66, Lloh67
	.loh AdrpLdrGotLdr	Lloh62, Lloh63, Lloh64
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_6-LBB0_6)>>2
	.byte	(LBB0_15-LBB0_6)>>2
	.byte	(LBB0_16-LBB0_6)>>2
	.byte	(LBB0_18-LBB0_6)>>2
	.byte	(LBB0_19-LBB0_6)>>2
	.byte	(LBB0_21-LBB0_6)>>2
                                        ; -- End function
	.comm	_ACTION_MASK,4,2                ; @ACTION_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"do_state_action: wrong page number (%#x)\n"

l_.str.1:                               ; @.str.1
	.asciz	"do_state_action: column number is too large\n"

l_.str.2:                               ; @.str.2
	.asciz	"do_state_action: (ACTION_CPY:) copy %d bytes to int buf, raw offset %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"read page %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"read page %d (second half)\n"

l_.str.5:                               ; @.str.5
	.asciz	"read OOB of page %d\n"

	.comm	_access_delay,4,2               ; @access_delay
	.comm	_input_cycle,4,2                ; @input_cycle
l_.str.6:                               ; @.str.6
	.asciz	"do_state_action: device is write-protected, ignore sector erase\n"

l_.str.7:                               ; @.str.7
	.asciz	"do_state_action: wrong sector address (%#x)\n"

l_.str.8:                               ; @.str.8
	.asciz	"do_state_action: erase sector at address %#x, off = %d\n"

l_.str.9:                               ; @.str.9
	.asciz	"erase sector %u\n"

	.comm	_erase_delay,4,2                ; @erase_delay
	.comm	_erase_block_wear,4,2           ; @erase_block_wear
l_.str.10:                              ; @.str.10
	.asciz	"simulating erase failure in erase block %u\n"

l_.str.11:                              ; @.str.11
	.asciz	"do_state_action: device is write-protected, programm\n"

l_.str.12:                              ; @.str.12
	.asciz	"do_state_action: too few bytes were input (%d instead of %d)\n"

l_.str.13:                              ; @.str.13
	.asciz	"do_state_action: copy %d bytes from int buf to (%#x, %#x), raw off = %d\n"

l_.str.14:                              ; @.str.14
	.asciz	"programm page %d\n"

	.comm	_programm_delay,4,2             ; @programm_delay
	.comm	_output_cycle,4,2               ; @output_cycle
l_.str.15:                              ; @.str.15
	.asciz	"simulating write failure in page %u\n"

l_.str.16:                              ; @.str.16
	.asciz	"do_state_action: set internal offset to 0\n"

	.comm	_OPT_PAGE512_8BIT,4,2           ; @OPT_PAGE512_8BIT
l_.str.17:                              ; @.str.17
	.asciz	"do_state_action: BUG! can't skip half of page for non-512byte page size 8x chips\n"

l_.str.18:                              ; @.str.18
	.asciz	"do_state_action: set internal offset to %d\n"

l_.str.19:                              ; @.str.19
	.asciz	"do_state_action: BUG! unknown action\n"

	.no_dead_strip	_do_state_action
.subsections_via_symbols
