	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s3c_onenand_check_lock_status
_s3c_onenand_check_lock_status:         ## @s3c_onenand_check_lock_status
	.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
	movq	(%rdi), %rax
	movl	(%rax), %r12d
	movb	4(%rax), %cl
	shrl	%cl, %r12d
	testl	%r12d, %r12d
	je	LBB0_6
## %bb.1:
	movq	_onenand@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movq	8(%rax), %r14
	decl	%r12d
	xorl	%ebx, %ebx
	movq	_LOCKED_BLK@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	*(%rax)
	movq	(%r13), %rdi
	movl	%eax, %esi
	callq	_CMD_MAP_01
	movl	%eax, %edi
	callq	_s3c_read_cmd
	movq	_INT_ERR_STAT_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_s3c_read_reg
	testl	%eax, (%r15)
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_err
	movl	(%r15), %edi
	movq	_INT_ERR_ACK_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_s3c_write_reg
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpl	%ebx, %r12d
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r13), %rax
	incl	%ebx
	jmp	LBB0_2
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_onenand,8,3                    ## @onenand
	.comm	_INT_ERR_STAT_OFFSET,4,2        ## @INT_ERR_STAT_OFFSET
	.comm	_LOCKED_BLK,4,2                 ## @LOCKED_BLK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"block %d is write-protected!\n"

	.comm	_INT_ERR_ACK_OFFSET,4,2         ## @INT_ERR_ACK_OFFSET
	.no_dead_strip	_s3c_onenand_check_lock_status
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s3c_onenand_check_lock_status
_s3c_onenand_check_lock_status:         ; @s3c_onenand_check_lock_status
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldr	x8, [x0]
	ldp	w9, w8, [x8]
	lsr	w9, w9, w8
	cbz	w9, LBB0_6
; %bb.1:
	mov	w19, #0
Lloh0:
	adrp	x22, _onenand@GOTPAGE
Lloh1:
	ldr	x22, [x22, _onenand@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	x20, [x8, #8]
	sub	w23, w9, #1
Lloh2:
	adrp	x24, _INT_ERR_STAT_OFFSET@GOTPAGE
Lloh3:
	ldr	x24, [x24, _INT_ERR_STAT_OFFSET@GOTPAGEOFF]
Lloh4:
	adrp	x25, _LOCKED_BLK@GOTPAGE
Lloh5:
	ldr	x25, [x25, _LOCKED_BLK@GOTPAGEOFF]
Lloh6:
	adrp	x21, l_.str@PAGE
Lloh7:
	add	x21, x21, l_.str@PAGEOFF
Lloh8:
	adrp	x26, _INT_ERR_ACK_OFFSET@GOTPAGE
Lloh9:
	ldr	x26, [x26, _INT_ERR_ACK_OFFSET@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x8]
	mov	x0, x19
	mov	w1, #0
	mov	w2, #0
	blr	x8
	mov	x1, x0
	ldr	x0, [x22]
	bl	_CMD_MAP_01
	bl	_s3c_read_cmd
	ldr	w0, [x24]
	bl	_s3c_read_reg
	ldr	w8, [x25]
	tst	w8, w0
	b.eq	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	bl	_dev_err
	ldr	w0, [x25]
	ldr	w1, [x26]
	bl	_s3c_write_reg
LBB0_4:                                 ;   in Loop: Header=BB0_2 Depth=1
	cmp	w23, w19
	b.eq	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x22]
	add	w19, w19, #1
	b	LBB0_2
LBB0_6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_onenand,8,3                    ; @onenand
	.comm	_INT_ERR_STAT_OFFSET,4,2        ; @INT_ERR_STAT_OFFSET
	.comm	_LOCKED_BLK,4,2                 ; @LOCKED_BLK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"block %d is write-protected!\n"

	.comm	_INT_ERR_ACK_OFFSET,4,2         ; @INT_ERR_ACK_OFFSET
	.no_dead_strip	_s3c_onenand_check_lock_status
.subsections_via_symbols
