	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sm_attach_chip
_sm_attach_chip:                        ## @sm_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	callq	_nand_to_mtd
	movabsq	$30064771077, %rcx              ## imm = 0x700000005
	movq	%rcx, (%rbx)
	movq	_sm_block_markbad@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 8(%rbx)
	movq	(%rax), %rcx
	movq	_SM_SECTOR_SIZE@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_3
## %bb.1:
	movq	_oob_sm_ops@GOTPCREL(%rip), %rsi
	jmp	LBB0_2
LBB0_3:
	movq	_SM_SMALL_PAGE@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_5
## %bb.4:
	movq	_oob_sm_small_ops@GOTPCREL(%rip), %rsi
LBB0_2:
	movq	%rax, %rdi
	callq	_mtd_set_ooblayout
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_5:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_sm_block_markbad,4,2           ## @sm_block_markbad
	.comm	_SM_SECTOR_SIZE,8,3             ## @SM_SECTOR_SIZE
	.comm	_oob_sm_ops,4,2                 ## @oob_sm_ops
	.comm	_SM_SMALL_PAGE,8,3              ## @SM_SMALL_PAGE
	.comm	_oob_sm_small_ops,4,2           ## @oob_sm_small_ops
	.comm	_ENODEV,4,2                     ## @ENODEV
	.no_dead_strip	_sm_attach_chip
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function sm_attach_chip
lCPI0_0:
	.long	5                               ; 0x5
	.long	7                               ; 0x7
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_sm_attach_chip:                        ; @sm_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
Lloh0:
	adrp	x8, lCPI0_0@PAGE
Lloh1:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x19]
Lloh2:
	adrp	x8, _sm_block_markbad@GOTPAGE
Lloh3:
	ldr	x8, [x8, _sm_block_markbad@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [x19, #8]
	ldr	x8, [x0]
Lloh5:
	adrp	x9, _SM_SECTOR_SIZE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SM_SECTOR_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh8:
	adrp	x1, _oob_sm_ops@GOTPAGE
Lloh9:
	ldr	x1, [x1, _oob_sm_ops@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:
Lloh10:
	adrp	x9, _SM_SMALL_PAGE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _SM_SMALL_PAGE@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.3:
Lloh13:
	adrp	x1, _oob_sm_small_ops@GOTPAGE
Lloh14:
	ldr	x1, [x1, _oob_sm_small_ops@GOTPAGEOFF]
LBB0_4:
	bl	_mtd_set_ooblayout
	mov	w0, #0
	b	LBB0_6
LBB0_5:
Lloh15:
	adrp	x8, _ENODEV@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdrp	Lloh0, Lloh2
	.loh AdrpLdr	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_sm_block_markbad,4,2           ; @sm_block_markbad
	.comm	_SM_SECTOR_SIZE,8,3             ; @SM_SECTOR_SIZE
	.comm	_oob_sm_ops,4,2                 ; @oob_sm_ops
	.comm	_SM_SMALL_PAGE,8,3              ; @SM_SMALL_PAGE
	.comm	_oob_sm_small_ops,4,2           ; @oob_sm_small_ops
	.comm	_ENODEV,4,2                     ; @ENODEV
	.no_dead_strip	_sm_attach_chip
.subsections_via_symbols
