	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lpc32xx_nand_attach_chip
_lpc32xx_nand_attach_chip:              ## @lpc32xx_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, %rbx
	callq	_nand_to_mtd
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_nand_get_controller_data
	movq	_LPC32XX_DMA_DATA_SIZE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	addq	(%rax), %rcx
	movq	%rcx, 8(%rax)
	cmpl	$512, (%r14)                    ## imm = 0x200
	jg	LBB0_2
## %bb.1:
	movq	_lpc32xx_ooblayout_ops@GOTPCREL(%rip), %rsi
	movq	%r14, %rdi
	callq	_mtd_set_ooblayout
LBB0_2:
	movl	$256, 24(%rbx)                  ## imm = 0x100
	movq	_LPC32XX_SLC_DEV_ECC_BYTES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 32(%rbx)
	movq	_NAND_BBT_USE_FLASH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_5
## %bb.3:
	cmpl	$512, (%r14)                    ## imm = 0x200
	jg	LBB0_5
## %bb.4:
	movq	_bbt_smallpage_main_descr@GOTPCREL(%rip), %rax
	movq	%rax, 16(%rbx)
	movq	_bbt_smallpage_mirror_descr@GOTPCREL(%rip), %rax
	movq	%rax, 8(%rbx)
LBB0_5:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LPC32XX_DMA_DATA_SIZE,8,3      ## @LPC32XX_DMA_DATA_SIZE
	.comm	_lpc32xx_ooblayout_ops,4,2      ## @lpc32xx_ooblayout_ops
	.comm	_LPC32XX_SLC_DEV_ECC_BYTES,4,2  ## @LPC32XX_SLC_DEV_ECC_BYTES
	.comm	_NAND_BBT_USE_FLASH,4,2         ## @NAND_BBT_USE_FLASH
	.comm	_bbt_smallpage_main_descr,4,2   ## @bbt_smallpage_main_descr
	.comm	_bbt_smallpage_mirror_descr,4,2 ## @bbt_smallpage_mirror_descr
	.no_dead_strip	_lpc32xx_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 lpc32xx_nand_attach_chip
_lpc32xx_nand_attach_chip:              ; @lpc32xx_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_to_mtd
	mov	x20, x0
	mov	x0, x19
	bl	_nand_get_controller_data
Lloh0:
	adrp	x8, _LPC32XX_DMA_DATA_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LPC32XX_DMA_DATA_SIZE@GOTPAGEOFF]
	ldr	x9, [x0]
Lloh2:
	ldr	x8, [x8]
	add	x8, x8, x9
	str	x8, [x0, #8]
	ldr	w8, [x20]
	cmp	w8, #512
	b.gt	LBB0_2
; %bb.1:
Lloh3:
	adrp	x1, _lpc32xx_ooblayout_ops@GOTPAGE
Lloh4:
	ldr	x1, [x1, _lpc32xx_ooblayout_ops@GOTPAGEOFF]
	mov	x0, x20
	bl	_mtd_set_ooblayout
LBB0_2:
	mov	w8, #256
	str	w8, [x19, #24]
Lloh5:
	adrp	x8, _LPC32XX_SLC_DEV_ECC_BYTES@GOTPAGE
Lloh6:
	ldr	x8, [x8, _LPC32XX_SLC_DEV_ECC_BYTES@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [x19, #48]
	stp	xzr, xzr, [x19, #32]
	ldr	w8, [x19]
Lloh8:
	adrp	x9, _NAND_BBT_USE_FLASH@GOTPAGE
Lloh9:
	ldr	x9, [x9, _NAND_BBT_USE_FLASH@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.3:
	ldr	w8, [x20]
	cmp	w8, #512
	b.gt	LBB0_5
; %bb.4:
Lloh11:
	adrp	x8, _bbt_smallpage_main_descr@GOTPAGE
Lloh12:
	ldr	x8, [x8, _bbt_smallpage_main_descr@GOTPAGEOFF]
Lloh13:
	adrp	x9, _bbt_smallpage_mirror_descr@GOTPAGE
Lloh14:
	ldr	x9, [x9, _bbt_smallpage_mirror_descr@GOTPAGEOFF]
	stp	x9, x8, [x19, #8]
LBB0_5:
	mov	w0, #0
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_LPC32XX_DMA_DATA_SIZE,8,3      ; @LPC32XX_DMA_DATA_SIZE
	.comm	_lpc32xx_ooblayout_ops,4,2      ; @lpc32xx_ooblayout_ops
	.comm	_LPC32XX_SLC_DEV_ECC_BYTES,4,2  ; @LPC32XX_SLC_DEV_ECC_BYTES
	.comm	_NAND_BBT_USE_FLASH,4,2         ; @NAND_BBT_USE_FLASH
	.comm	_bbt_smallpage_main_descr,4,2   ; @bbt_smallpage_main_descr
	.comm	_bbt_smallpage_mirror_descr,4,2 ; @bbt_smallpage_mirror_descr
	.no_dead_strip	_lpc32xx_nand_attach_chip
.subsections_via_symbols
