	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alauda_write
_alauda_write:                          ## @alauda_write
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	8(%rdi), %r14
	movq	%rdx, %rax
	orq	%rsi, %rax
	testq	%rax, (%r14)
	je	LBB0_3
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_13
## %bb.12:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%rdx, %r15
	movq	%rdx, (%rcx)
	xorl	%eax, %eax
	testq	%rdx, %rdx
	je	LBB0_11
## %bb.4:
	movq	%r8, %rbx
	movq	%rsi, %r12
	movq	%rdi, %r13
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r14), %rax
	movzbl	(%rax), %ecx
	movq	%r12, %rax
	sarq	%cl, %rax
	andq	8(%r14), %rax
	movaps	L___const.alauda_write.oob(%rip), %xmm0
	movaps	%xmm0, -64(%rbp)
	jne	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_alauda_isbad
	testl	%eax, %eax
	jne	LBB0_7
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	%r13, %rdi
	movq	%rbx, %rsi
	leaq	-51(%rbp), %rdx
	callq	_nand_calculate_ecc
	leaq	1024(%rbx), %rsi
	movq	%r13, %rdi
	leaq	-56(%rbp), %rdx
	callq	_nand_calculate_ecc
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	leaq	-64(%rbp), %rcx
	callq	_alauda_write_page
	testl	%eax, %eax
	jne	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	(%r13), %rax
	leaq	(%rbx,%rax,4), %rbx
	addq	%rax, %r12
	subq	%rax, %r15
	jne	LBB0_5
## %bb.10:
	xorl	%eax, %eax
	jmp	LBB0_11
LBB0_7:
	movq	_EIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## @__const.alauda_write.oob
L___const.alauda_write.oob:
	.ascii	"hello\377\377\377\377\377\377\377\377\377\377\377"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_alauda_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alauda_write
_alauda_write:                          ; @alauda_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	ldr	x25, [x0, #8]
	ldr	x8, [x25]
	orr	x9, x2, x1
	tst	x8, x9
	b.eq	LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_3:
	mov	x20, x2
	str	x2, [x3]
	cbz	x2, LBB0_9
; %bb.4:
	mov	x19, x4
	mov	x21, x1
	mov	x22, x0
	add	x8, sp, #16
	add	x23, x8, #13
	add	x24, x8, #8
Lloh5:
	adrp	x8, l___const.alauda_write.oob@PAGE
Lloh6:
	add	x8, x8, l___const.alauda_write.oob@PAGEOFF
Lloh7:
	ldr	q0, [x8]
	str	q0, [sp]                        ; 16-byte Folded Spill
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x9, x8, [x25, #8]
	ldr	x8, [x8]
	asr	x8, x21, x8
	ldr	q0, [sp]                        ; 16-byte Folded Reload
	str	q0, [sp, #16]
	tst	x8, x9
	b.ne	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	mov	x1, x21
	bl	_alauda_isbad
	cbnz	w0, LBB0_12
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	mov	x1, x19
	mov	x2, x23
	bl	_nand_calculate_ecc
	add	x1, x19, #1024
	mov	x0, x22
	mov	x2, x24
	bl	_nand_calculate_ecc
	add	x3, sp, #16
	mov	x0, x22
	mov	x1, x21
	mov	x2, x19
	bl	_alauda_write_page
	cbnz	w0, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x22]
	add	x19, x19, x8, lsl #2
	add	x21, x8, x21
	subs	x20, x20, x8
	b.ne	LBB0_5
LBB0_9:
	mov	w0, #0
LBB0_10:
	ldr	x8, [sp, #40]
Lloh8:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.11:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_12:
Lloh11:
	adrp	x8, _EIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_2
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAddLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__literal16,16byte_literals
l___const.alauda_write.oob:             ; @__const.alauda_write.oob
	.ascii	"hello\377\377\377\377\377\377\377\377\377\377\377"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_alauda_write
.subsections_via_symbols
