	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gpmi_nand_attach_chip
_gpmi_nand_attach_chip:                 ## @gpmi_nand_attach_chip
	.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
	movq	%rdi, %r14
	callq	_nand_get_controller_data
	movq	%rax, %rbx
	movl	(%r14), %eax
	movq	_NAND_BBT_USE_FLASH@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_3
## %bb.1:
	movq	_NAND_BBT_NO_OOB@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%r14)
	movq	8(%rbx), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_of_property_read_bool
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movl	$0, (%rbx)
LBB0_3:
	movq	8(%rbx), %rdi
	cmpl	$0, (%rbx)
	leaq	L_.str.3(%rip), %rax
	leaq	L_.str.2(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_dbg
	movq	%rbx, %rdi
	callq	_gpmi_init_last
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movq	_NAND_SKIP_BBTSCAN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, 4(%r14)
LBB0_5:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_BBT_USE_FLASH,4,2         ## @NAND_BBT_USE_FLASH
	.comm	_NAND_BBT_NO_OOB,4,2            ## @NAND_BBT_NO_OOB
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fsl,no-blockmark-swap"

L_.str.1:                               ## @.str.1
	.asciz	"Blockmark swapping %sabled\n"

L_.str.2:                               ## @.str.2
	.asciz	"en"

L_.str.3:                               ## @.str.3
	.asciz	"dis"

	.comm	_NAND_SKIP_BBTSCAN,4,2          ## @NAND_SKIP_BBTSCAN
	.no_dead_strip	_gpmi_nand_attach_chip
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gpmi_nand_attach_chip
_gpmi_nand_attach_chip:                 ; @gpmi_nand_attach_chip
	.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, x0
	bl	_nand_get_controller_data
	mov	x20, x0
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _NAND_BBT_USE_FLASH@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NAND_BBT_USE_FLASH@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.1:
Lloh3:
	adrp	x9, _NAND_BBT_NO_OOB@GOTPAGE
Lloh4:
	ldr	x9, [x9, _NAND_BBT_NO_OOB@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x19]
	ldr	x8, [x20, #8]
	ldr	w0, [x8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_of_property_read_bool
	cbz	x0, LBB0_3
; %bb.2:
	str	wzr, [x20]
LBB0_3:
	ldr	x0, [x20, #8]
	ldr	w8, [x20]
Lloh8:
	adrp	x9, l_.str.2@PAGE
Lloh9:
	add	x9, x9, l_.str.2@PAGEOFF
Lloh10:
	adrp	x10, l_.str.3@PAGE
Lloh11:
	add	x10, x10, l_.str.3@PAGEOFF
	cmp	w8, #0
	csel	x2, x10, x9, eq
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	mov	x0, x20
	bl	_gpmi_init_last
	cbnz	w0, LBB0_5
; %bb.4:
Lloh14:
	adrp	x8, _NAND_SKIP_BBTSCAN@GOTPAGE
Lloh15:
	ldr	x8, [x8, _NAND_SKIP_BBTSCAN@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	ldr	w9, [x19, #4]
	orr	w8, w9, w8
	str	w8, [x19, #4]
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_BBT_USE_FLASH,4,2         ; @NAND_BBT_USE_FLASH
	.comm	_NAND_BBT_NO_OOB,4,2            ; @NAND_BBT_NO_OOB
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fsl,no-blockmark-swap"

l_.str.1:                               ; @.str.1
	.asciz	"Blockmark swapping %sabled\n"

l_.str.2:                               ; @.str.2
	.asciz	"en"

l_.str.3:                               ; @.str.3
	.asciz	"dis"

	.comm	_NAND_SKIP_BBTSCAN,4,2          ; @NAND_SKIP_BBTSCAN
	.no_dead_strip	_gpmi_nand_attach_chip
.subsections_via_symbols
