	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vf610_nfc_attach_chip
_vf610_nfc_attach_chip:                 ## @vf610_nfc_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	%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	%rdi, %rbx
	callq	_nand_to_mtd
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_chip_to_nfc
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_vf610_nfc_init_controller
	movl	(%rbx), %eax
	movq	_NAND_BBT_USE_FLASH@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.1:
	movq	_NAND_BBT_NO_OOB@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%rbx)
LBB0_2:
	movl	(%r12), %ecx
	movl	4(%r12), %eax
	leal	(%rax,%rcx), %esi
	movq	_PAGE_2K@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	_OOB_MAX@GOTPCREL(%rip), %rdi
	movl	(%rdi), %edi
	addl	%edx, %edi
	addl	$-8, %edi
	cmpl	%edi, %esi
	jle	LBB0_5
## %bb.3:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_4
LBB0_5:
	movq	8(%rbx), %rsi
	movq	_NAND_ECC_HW@GOTPCREL(%rip), %rdi
	xorl	%r14d, %r14d
	cmpq	(%rdi), %rsi
	jne	LBB0_18
## %bb.6:
	cmpl	%edx, %ecx
	je	LBB0_9
## %bb.7:
	cmpl	$63, %eax
	jg	LBB0_9
## %bb.8:
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_4
LBB0_9:
	cmpl	%ecx, 16(%rbx)
	jne	LBB0_10
## %bb.11:
	cmpl	$65, %eax
	jl	LBB0_13
## %bb.12:
	movl	$64, 4(%r12)
LBB0_13:
	movq	_nand_ooblayout_lp_ops@GOTPCREL(%rip), %rsi
	movq	%r12, %rdi
	callq	_mtd_set_ooblayout
	movl	20(%rbx), %eax
	cmpl	$32, %eax
	je	LBB0_14
## %bb.15:
	cmpl	$24, %eax
	jne	LBB0_19
## %bb.16:
	movl	$45, %eax
	movq	_ECC_45_BYTE@GOTPCREL(%rip), %rcx
	jmp	LBB0_17
LBB0_10:
	movl	(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_4
LBB0_14:
	movl	$60, %eax
	movq	_ECC_60_BYTE@GOTPCREL(%rip), %rcx
LBB0_17:
	movl	(%rcx), %ecx
	movl	%ecx, 4(%r15)
	movl	%eax, 24(%rbx)
	movq	_vf610_nfc_read_page@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%rbx)
	movq	_vf610_nfc_write_page@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 44(%rbx)
	movq	_vf610_nfc_read_page_raw@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
	movq	_vf610_nfc_write_page_raw@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%rbx)
	movq	_vf610_nfc_read_oob@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movq	_vf610_nfc_write_oob@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rbx)
	movl	(%r13), %eax
	movl	%eax, 16(%rbx)
	jmp	LBB0_18
LBB0_19:
	movl	(%r15), %edi
	leaq	L_.str.3(%rip), %rsi
LBB0_4:
	callq	_dev_err
	movq	_ENXIO@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_18:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	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
	.comm	_PAGE_2K,4,2                    ## @PAGE_2K
	.comm	_OOB_MAX,4,2                    ## @OOB_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unsupported flash page size\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_NAND_ECC_HW,8,3                ## @NAND_ECC_HW
L_.str.1:                               ## @.str.1
	.asciz	"Unsupported flash with hwecc\n"

L_.str.2:                               ## @.str.2
	.asciz	"Step size needs to be page size\n"

	.comm	_nand_ooblayout_lp_ops,4,2      ## @nand_ooblayout_lp_ops
	.comm	_ECC_60_BYTE,4,2                ## @ECC_60_BYTE
	.comm	_ECC_45_BYTE,4,2                ## @ECC_45_BYTE
L_.str.3:                               ## @.str.3
	.asciz	"Unsupported ECC strength\n"

	.comm	_vf610_nfc_read_page,4,2        ## @vf610_nfc_read_page
	.comm	_vf610_nfc_write_page,4,2       ## @vf610_nfc_write_page
	.comm	_vf610_nfc_read_page_raw,4,2    ## @vf610_nfc_read_page_raw
	.comm	_vf610_nfc_write_page_raw,4,2   ## @vf610_nfc_write_page_raw
	.comm	_vf610_nfc_read_oob,4,2         ## @vf610_nfc_read_oob
	.comm	_vf610_nfc_write_oob,4,2        ## @vf610_nfc_write_oob
	.no_dead_strip	_vf610_nfc_attach_chip
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vf610_nfc_attach_chip
_vf610_nfc_attach_chip:                 ; @vf610_nfc_attach_chip
	.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
	bl	_nand_to_mtd
	mov	x21, x0
	mov	x0, x19
	bl	_chip_to_nfc
	mov	x20, x0
	bl	_vf610_nfc_init_controller
	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_2
; %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]
LBB0_2:
	ldp	w9, w8, [x21]
Lloh6:
	adrp	x22, _PAGE_2K@GOTPAGE
Lloh7:
	ldr	x22, [x22, _PAGE_2K@GOTPAGEOFF]
Lloh8:
	adrp	x11, _OOB_MAX@GOTPAGE
Lloh9:
	ldr	x11, [x11, _OOB_MAX@GOTPAGEOFF]
	ldr	w10, [x22]
Lloh10:
	ldr	w11, [x11]
	add	w11, w10, w11
	sub	w11, w11, #8
	add	w12, w8, w9
	cmp	w12, w11
	b.le	LBB0_4
; %bb.3:
	ldr	w0, [x20]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_19
LBB0_4:
	ldr	x11, [x19, #8]
Lloh13:
	adrp	x12, _NAND_ECC_HW@GOTPAGE
Lloh14:
	ldr	x12, [x12, _NAND_ECC_HW@GOTPAGEOFF]
Lloh15:
	ldr	x12, [x12]
	cmp	x11, x12
	b.ne	LBB0_8
; %bb.5:
	cmp	w9, w10
	b.eq	LBB0_9
; %bb.6:
	cmp	w8, #63
	b.gt	LBB0_9
; %bb.7:
	ldr	w0, [x20]
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_19
LBB0_8:
	mov	w0, #0
	b	LBB0_20
LBB0_9:
	ldr	w10, [x19, #16]
	cmp	w10, w9
	b.ne	LBB0_15
; %bb.10:
	cmp	w8, #65
	b.lt	LBB0_12
; %bb.11:
	mov	w8, #64
	str	w8, [x21, #4]
LBB0_12:
Lloh18:
	adrp	x1, _nand_ooblayout_lp_ops@GOTPAGE
Lloh19:
	ldr	x1, [x1, _nand_ooblayout_lp_ops@GOTPAGEOFF]
	mov	x0, x21
	bl	_mtd_set_ooblayout
	ldr	w8, [x19, #20]
	cmp	w8, #32
	b.eq	LBB0_16
; %bb.13:
	cmp	w8, #24
	b.ne	LBB0_18
; %bb.14:
	mov	w8, #45
Lloh20:
	adrp	x9, _ECC_45_BYTE@GOTPAGE
Lloh21:
	ldr	x9, [x9, _ECC_45_BYTE@GOTPAGEOFF]
	b	LBB0_17
LBB0_15:
	ldr	w0, [x20]
Lloh22:
	adrp	x1, l_.str.2@PAGE
Lloh23:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_19
LBB0_16:
	mov	w8, #60
Lloh24:
	adrp	x9, _ECC_60_BYTE@GOTPAGE
Lloh25:
	ldr	x9, [x9, _ECC_60_BYTE@GOTPAGEOFF]
LBB0_17:
	mov	w0, #0
	ldr	w9, [x9]
	str	w9, [x20, #4]
Lloh26:
	adrp	x9, _vf610_nfc_read_page@GOTPAGE
Lloh27:
	ldr	x9, [x9, _vf610_nfc_read_page@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	str	w9, [x19, #48]
Lloh29:
	adrp	x9, _vf610_nfc_write_page@GOTPAGE
Lloh30:
	ldr	x9, [x9, _vf610_nfc_write_page@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
Lloh32:
	adrp	x10, _vf610_nfc_read_page_raw@GOTPAGE
Lloh33:
	ldr	x10, [x10, _vf610_nfc_read_page_raw@GOTPAGEOFF]
Lloh34:
	ldr	w10, [x10]
	stp	w10, w9, [x19, #40]
Lloh35:
	adrp	x9, _vf610_nfc_write_page_raw@GOTPAGE
Lloh36:
	ldr	x9, [x9, _vf610_nfc_write_page_raw@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
Lloh38:
	adrp	x10, _vf610_nfc_read_oob@GOTPAGE
Lloh39:
	ldr	x10, [x10, _vf610_nfc_read_oob@GOTPAGEOFF]
Lloh40:
	ldr	w10, [x10]
Lloh41:
	adrp	x11, _vf610_nfc_write_oob@GOTPAGE
Lloh42:
	ldr	x11, [x11, _vf610_nfc_write_oob@GOTPAGEOFF]
	stp	w10, w9, [x19, #32]
Lloh43:
	ldr	w9, [x11]
	stp	w8, w9, [x19, #24]
	ldr	w8, [x22]
	str	w8, [x19, #16]
	b	LBB0_20
LBB0_18:
	ldr	w0, [x20]
Lloh44:
	adrp	x1, l_.str.3@PAGE
Lloh45:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_19:
	bl	_dev_err
Lloh46:
	adrp	x8, _ENXIO@GOTPAGE
Lloh47:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh48:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_20:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.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
	.comm	_PAGE_2K,4,2                    ; @PAGE_2K
	.comm	_OOB_MAX,4,2                    ; @OOB_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unsupported flash page size\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_NAND_ECC_HW,8,3                ; @NAND_ECC_HW
l_.str.1:                               ; @.str.1
	.asciz	"Unsupported flash with hwecc\n"

l_.str.2:                               ; @.str.2
	.asciz	"Step size needs to be page size\n"

	.comm	_nand_ooblayout_lp_ops,4,2      ; @nand_ooblayout_lp_ops
	.comm	_ECC_60_BYTE,4,2                ; @ECC_60_BYTE
	.comm	_ECC_45_BYTE,4,2                ; @ECC_45_BYTE
l_.str.3:                               ; @.str.3
	.asciz	"Unsupported ECC strength\n"

	.comm	_vf610_nfc_read_page,4,2        ; @vf610_nfc_read_page
	.comm	_vf610_nfc_write_page,4,2       ; @vf610_nfc_write_page
	.comm	_vf610_nfc_read_page_raw,4,2    ; @vf610_nfc_read_page_raw
	.comm	_vf610_nfc_write_page_raw,4,2   ; @vf610_nfc_write_page_raw
	.comm	_vf610_nfc_read_oob,4,2         ; @vf610_nfc_read_oob
	.comm	_vf610_nfc_write_oob,4,2        ; @vf610_nfc_write_oob
	.no_dead_strip	_vf610_nfc_attach_chip
.subsections_via_symbols
