	.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	%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, %r12
	callq	_nand_to_mtd
	movq	%rax, %r14
	movq	%r12, %rdi
	callq	_nand_get_controller_data
	movq	%rax, %r15
	movq	24(%rax), %rbx
	movl	(%r14), %esi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	%rbx, %rdi
	callq	_devm_kzalloc
	movq	%rax, 16(%r15)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	(%r14), %esi
	movl	(%r13), %edx
	movq	%rbx, %rdi
	callq	_devm_kzalloc
	movq	%rax, 8(%r15)
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	_NAND_ECC_HW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r12)
	movl	$512, (%r12)                    ## imm = 0x200
	movq	_lpc32xx_ooblayout_ops@GOTPCREL(%rip), %rsi
	movq	%r14, %rdi
	callq	_mtd_set_ooblayout
	movl	(%r14), %eax
	leal	511(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$9, %ecx
	movl	%ecx, (%r15)
	xorl	%eax, %eax
	jmp	LBB0_4
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_NAND_ECC_HW,4,2                ## @NAND_ECC_HW
	.comm	_lpc32xx_ooblayout_ops,4,2      ## @lpc32xx_ooblayout_ops
	.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	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x21, x0
	bl	_nand_to_mtd
	mov	x19, x0
	mov	x0, x21
	bl	_nand_get_controller_data
	mov	x20, x0
	ldr	x22, [x0, #24]
	ldr	w1, [x19]
Lloh0:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x22
	bl	_devm_kzalloc
	str	x0, [x20, #16]
	cbz	x0, LBB0_3
; %bb.1:
	ldr	w1, [x19]
	ldr	w2, [x23]
	mov	x0, x22
	bl	_devm_kzalloc
	str	x0, [x20, #8]
	cbz	x0, LBB0_3
; %bb.2:
Lloh2:
	adrp	x8, _NAND_ECC_HW@GOTPAGE
Lloh3:
	ldr	x8, [x8, _NAND_ECC_HW@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	mov	w9, #512
	stp	w9, w8, [x21]
Lloh5:
	adrp	x1, _lpc32xx_ooblayout_ops@GOTPAGE
Lloh6:
	ldr	x1, [x1, _lpc32xx_ooblayout_ops@GOTPAGEOFF]
	mov	x0, x19
	bl	_mtd_set_ooblayout
	mov	w0, #0
	ldr	w8, [x19]
	add	w9, w8, #511
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #9
	str	w8, [x20]
	b	LBB0_4
LBB0_3:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_NAND_ECC_HW,4,2                ; @NAND_ECC_HW
	.comm	_lpc32xx_ooblayout_ops,4,2      ; @lpc32xx_ooblayout_ops
	.no_dead_strip	_lpc32xx_nand_attach_chip
.subsections_via_symbols
