	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function r852_write_buf
_r852_write_buf:                        ## @r852_write_buf
	.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
	movl	%edx, %r15d
	movq	%rsi, %rbx
	callq	_nand_to_mtd
	movl	%eax, %edi
	callq	_r852_get_dev
	cmpq	$0, 8(%rax)
	je	LBB0_1
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rax, %r14
	movq	_R852_DMA_LEN@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_3
## %bb.2:
	cmpq	$0, (%r14)
	je	LBB0_3
## %bb.10:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_r852_do_dma                    ## TAILCALL
LBB0_3:
	cmpl	$4, %r15d
	jl	LBB0_6
## %bb.4:
	movq	_R852_DATALINE@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %r13d
	movl	4(%rbx), %eax
	movl	8(%rbx), %ecx
	shll	$8, %eax
	orl	(%rbx), %eax
	shll	$16, %ecx
	movl	12(%rbx), %edx
	shll	$24, %edx
	orl	%ecx, %edx
	orl	%eax, %edx
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_r852_write_reg_dword
	addq	$16, %rbx
	leal	-4(%r13), %r15d
	cmpl	$7, %r13d
	ja	LBB0_5
LBB0_6:
	testl	%r15d, %r15d
	jle	LBB0_9
## %bb.7:
	incl	%r15d
	movq	_R852_DATALINE@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	movl	(%rbx), %edx
	addq	$4, %rbx
	movq	%r14, %rdi
	callq	_r852_write_reg
	decl	%r15d
	cmpl	$1, %r15d
	ja	LBB0_8
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_R852_DMA_LEN,4,2               ## @R852_DMA_LEN
	.comm	_R852_DATALINE,4,2              ## @R852_DATALINE
	.no_dead_strip	_r852_write_buf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function r852_write_buf
_r852_write_buf:                        ; @r852_write_buf
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x21, x2
	mov	x19, x1
	bl	_nand_to_mtd
	bl	_r852_get_dev
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_2
LBB0_1:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_2:
	mov	x20, x0
Lloh0:
	adrp	x8, _R852_DMA_LEN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _R852_DMA_LEN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_5
; %bb.3:
	ldr	x8, [x20]
	cbz	x8, LBB0_5
; %bb.4:
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_r852_do_dma
LBB0_5:
	cmp	w21, #4
	b.lt	LBB0_8
; %bb.6:
Lloh3:
	adrp	x22, _R852_DATALINE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _R852_DATALINE@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x23, x21
	ldp	w8, w9, [x19]
	orr	w8, w8, w9, lsl #8
	ldp	w9, w10, [x19, #8]
	orr	w8, w8, w9, lsl #16
	orr	w2, w8, w10, lsl #24
	ldr	w1, [x22]
	mov	x0, x20
	bl	_r852_write_reg_dword
	add	x19, x19, #16
	sub	w21, w21, #4
	cmp	w23, #7
	b.hi	LBB0_7
LBB0_8:
	cmp	w21, #1
	b.lt	LBB0_1
; %bb.9:
	add	w21, w21, #1
Lloh5:
	adrp	x22, _R852_DATALINE@GOTPAGE
Lloh6:
	ldr	x22, [x22, _R852_DATALINE@GOTPAGEOFF]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	ldr	w2, [x19], #4
	mov	x0, x20
	bl	_r852_write_reg
	sub	w21, w21, #1
	cmp	w21, #1
	b.hi	LBB0_10
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_R852_DMA_LEN,4,2               ; @R852_DMA_LEN
	.comm	_R852_DATALINE,4,2              ; @R852_DATALINE
	.no_dead_strip	_r852_write_buf
.subsections_via_symbols
