	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pxa3xx_nand_detect_flash
_pxa3xx_nand_detect_flash:              ## @pxa3xx_nand_detect_flash
	.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	%rsi, %r12
	movq	%rdi, %r14
	movq	$-1, -48(%rbp)
	cmpq	$0, 16(%rsi)
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_pxa3xx_nand_detect_config
	testq	%rax, %rax
	je	LBB0_12
LBB0_2:
	cmpl	$0, (%r12)
	jle	LBB0_10
## %bb.3:
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	incq	%rbx
	movslq	(%r12), %rax
	addq	$8, %r13
	cmpq	%rax, %rbx
	jge	LBB0_9
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %r15
	leaq	(%r15,%r13), %rsi
	movq	%r14, %rdi
	callq	_pxa3xx_nand_config_flash
	testq	%rax, %rax
	jne	LBB0_4
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r14, %rdi
	leaq	-48(%rbp), %rsi
	callq	___readid
	testq	%rax, %rax
	jne	LBB0_4
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	-48(%rbp), %rax
	cmpq	(%r15,%r13), %rax
	jne	LBB0_4
LBB0_12:
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_9:
	movq	-48(%rbp), %rdx
	jmp	LBB0_11
LBB0_10:
	movq	$-1, %rdx
LBB0_11:
	movq	(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to detect configured nand flash; found %04x instead of\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_builtin_flash_types,8,3        ## @builtin_flash_types
	.no_dead_strip	_pxa3xx_nand_detect_flash
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pxa3xx_nand_detect_flash
_pxa3xx_nand_detect_flash:              ; @pxa3xx_nand_detect_flash
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x1
	mov	x19, x0
	mov	x8, #-1
	str	x8, [sp, #8]
	ldr	x8, [x1, #16]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_pxa3xx_nand_detect_config
	cbz	x0, LBB0_12
LBB0_2:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.3:
	mov	x21, #0
	mov	x22, #0
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x22, x22, #1
	ldrsw	x8, [x20]
	add	x21, x21, #8
	cmp	x22, x8
	b.ge	LBB0_9
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x23, [x20, #8]
	add	x1, x23, x21
	mov	x0, x19
	bl	_pxa3xx_nand_config_flash
	cbnz	x0, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x1, sp, #8
	mov	x0, x19
	bl	___readid
	cbnz	x0, LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [sp, #8]
	ldr	x9, [x23, x21]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.8:
	mov	w0, #0
	b	LBB0_12
LBB0_9:
	ldr	x2, [sp, #8]
	b	LBB0_11
LBB0_10:
	mov	x2, #-1
LBB0_11:
	ldr	x0, [x19]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
Lloh2:
	adrp	x8, _ENODEV@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to detect configured nand flash; found %04x instead of\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_builtin_flash_types,8,3        ; @builtin_flash_types
	.no_dead_strip	_pxa3xx_nand_detect_flash
.subsections_via_symbols
