	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cafe_write_buf
_cafe_write_buf:                        ## @cafe_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edx, %r14d
	movq	(%rdi), %rbx
	movq	_usedma@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movq	(%rbx), %rdi
	addq	24(%rbx), %rdi
	movl	%r14d, %edx
	callq	_memcpy
	jmp	LBB0_3
LBB0_2:
	movq	_CAFE_NAND_WRITE_DATA@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%rbx), %rdi
	addq	(%rbx), %rdi
	movl	%r14d, %edx
	callq	_memcpy_toio
LBB0_3:
	movslq	%r14d, %rcx
	addq	(%rbx), %rcx
	movq	%rcx, (%rbx)
	movq	8(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_cafe_dev_dbg                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_usedma,8,3                     ## @usedma
	.comm	_CAFE_NAND_WRITE_DATA,8,3       ## @CAFE_NAND_WRITE_DATA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Copy 0x%x bytes to write buffer. datalen 0x%x\n"

	.no_dead_strip	_cafe_write_buf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cafe_write_buf
_cafe_write_buf:                        ; @cafe_write_buf
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x2
	ldr	x20, [x0]
Lloh0:
	adrp	x8, _usedma@GOTPAGE
Lloh1:
	ldr	x8, [x8, _usedma@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	x8, [x20, #24]
	ldr	x9, [x20]
	add	x0, x9, x8
	mov	x2, x19
	bl	_memcpy
	b	LBB0_3
LBB0_2:
	ldr	x8, [x20, #16]
Lloh3:
	adrp	x9, _CAFE_NAND_WRITE_DATA@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CAFE_NAND_WRITE_DATA@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	ldr	x10, [x20]
	add	x8, x9, x8
	add	x0, x8, x10
	mov	x2, x19
	bl	_memcpy_toio
LBB0_3:
	ldp	x8, x0, [x20]
	add	x3, x8, w19, sxtw
	str	x3, [x20]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_cafe_dev_dbg
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_usedma,8,3                     ; @usedma
	.comm	_CAFE_NAND_WRITE_DATA,8,3       ; @CAFE_NAND_WRITE_DATA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Copy 0x%x bytes to write buffer. datalen 0x%x\n"

	.no_dead_strip	_cafe_write_buf
.subsections_via_symbols
