	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pxa3xx_nand_init_buff
_pxa3xx_nand_init_buff:                 ## @pxa3xx_nand_init_buff
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_MAX_BUFF_SIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %r15d
	movq	_use_dma@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_1
## %bb.3:
	movq	48(%rbx), %r14
	leaq	16(%rbx), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_dma_alloc_coherent
	movq	%rax, 24(%rbx)
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	addl	$-4, %r15d
	movl	(%r12), %ecx
	movl	%ecx, (%rbx)
	movslq	%r15d, %rcx
	addq	%rcx, %rax
	movq	%rax, 40(%rbx)
	movslq	16(%rbx), %rax
	addq	%rcx, %rax
	movq	%rax, 32(%rbx)
	movq	_DMA_PRIO_LOW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_pxa3xx_nand_data_dma_irq@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rcx
	callq	_pxa_request_dma
	movq	%rax, %rcx
	movq	%rax, 8(%rbx)
	xorl	%eax, %eax
	testq	%rcx, %rcx
	jns	LBB0_7
## %bb.6:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	24(%rbx), %rdx
	movl	(%rbx), %esi
	movl	16(%rbx), %ecx
	movq	%r14, %rdi
	callq	_dma_free_coherent
	movl	8(%rbx), %eax
	jmp	LBB0_7
LBB0_1:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	callq	_kmalloc
	movq	%rax, %rcx
	movq	%rax, 24(%rbx)
	xorl	%eax, %eax
	testq	%rcx, %rcx
	jne	LBB0_7
	jmp	LBB0_2
LBB0_4:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_BUFF_SIZE,4,2              ## @MAX_BUFF_SIZE
	.comm	_use_dma,8,3                    ## @use_dma
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to allocate dma buffer\n"

L_.str.1:                               ## @.str.1
	.asciz	"nand-data"

	.comm	_DMA_PRIO_LOW,4,2               ## @DMA_PRIO_LOW
	.comm	_pxa3xx_nand_data_dma_irq,4,2   ## @pxa3xx_nand_data_dma_irq
L_.str.2:                               ## @.str.2
	.asciz	"failed to request data dma\n"

	.no_dead_strip	_pxa3xx_nand_init_buff
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pxa3xx_nand_init_buff
_pxa3xx_nand_init_buff:                 ; @pxa3xx_nand_init_buff
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
Lloh0:
	adrp	x22, _MAX_BUFF_SIZE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _MAX_BUFF_SIZE@GOTPAGEOFF]
	ldr	w21, [x22]
Lloh2:
	adrp	x8, _use_dma@GOTPAGE
Lloh3:
	ldr	x8, [x8, _use_dma@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cbz	x8, LBB0_4
; %bb.1:
	ldr	x20, [x19, #48]
	add	x2, x19, #16
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x21
	bl	_dma_alloc_coherent
	str	x0, [x19, #24]
	cbz	x0, LBB0_6
; %bb.2:
	sub	w8, w21, #4
	ldr	w9, [x22]
	str	w9, [x19]
	sxtw	x8, w8
	add	x9, x0, x8
	ldrsw	x10, [x19, #16]
	add	x8, x10, x8
	stp	x8, x9, [x19, #32]
Lloh8:
	adrp	x8, _DMA_PRIO_LOW@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DMA_PRIO_LOW@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x8, _pxa3xx_nand_data_dma_irq@GOTPAGE
Lloh12:
	ldr	x8, [x8, _pxa3xx_nand_data_dma_irq@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x3, x19
	bl	_pxa_request_dma
	str	x0, [x19, #8]
	tbz	x0, #63, LBB0_5
; %bb.3:
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	ldr	w1, [x19]
	ldr	x2, [x19, #24]
	ldr	w3, [x19, #16]
	mov	x0, x20
	bl	_dma_free_coherent
	ldr	w0, [x19, #8]
	b	LBB0_8
LBB0_4:
Lloh18:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_kmalloc
	str	x0, [x19, #24]
	cbz	x0, LBB0_7
LBB0_5:
	mov	w0, #0
	b	LBB0_8
LBB0_6:
Lloh21:
	adrp	x1, l_.str@PAGE
Lloh22:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
LBB0_7:
Lloh23:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_BUFF_SIZE,4,2              ; @MAX_BUFF_SIZE
	.comm	_use_dma,8,3                    ; @use_dma
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to allocate dma buffer\n"

l_.str.1:                               ; @.str.1
	.asciz	"nand-data"

	.comm	_DMA_PRIO_LOW,4,2               ; @DMA_PRIO_LOW
	.comm	_pxa3xx_nand_data_dma_irq,4,2   ; @pxa3xx_nand_data_dma_irq
l_.str.2:                               ; @.str.2
	.asciz	"failed to request data dma\n"

	.no_dead_strip	_pxa3xx_nand_init_buff
.subsections_via_symbols
