	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function samsung_nand_init
_samsung_nand_init:                     ## @samsung_nand_init
	.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
	cmpl	$513, (%rax)                    ## imm = 0x201
	jl	LBB0_2
## %bb.1:
	movq	_NAND_SAMSUNG_LP_OPTIONS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rbx)
LBB0_2:
	movq	%rbx, %rdi
	callq	_nand_is_slc
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movq	_NAND_BBM_FIRSTPAGE@GOTPCREL(%rip), %rcx
	movq	_NAND_BBM_SECONDPAGE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	movq	%rbx, %rcx
	jmp	LBB0_5
LBB0_3:
	movl	(%rbx), %eax
	movq	_NAND_BBM_LASTPAGE@GOTPCREL(%rip), %rcx
LBB0_5:
	orl	(%rcx), %eax
	movl	%eax, (%rbx)
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_SAMSUNG_LP_OPTIONS,4,2    ## @NAND_SAMSUNG_LP_OPTIONS
	.comm	_NAND_BBM_LASTPAGE,4,2          ## @NAND_BBM_LASTPAGE
	.comm	_NAND_BBM_FIRSTPAGE,4,2         ## @NAND_BBM_FIRSTPAGE
	.comm	_NAND_BBM_SECONDPAGE,4,2        ## @NAND_BBM_SECONDPAGE
	.no_dead_strip	_samsung_nand_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function samsung_nand_init
_samsung_nand_init:                     ; @samsung_nand_init
	.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
	ldr	w8, [x0]
	cmp	w8, #513
	b.lt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _NAND_SAMSUNG_LP_OPTIONS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NAND_SAMSUNG_LP_OPTIONS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_2:
	mov	x0, x19
	bl	_nand_is_slc
	cbz	w0, LBB0_4
; %bb.3:
Lloh3:
	adrp	x8, _NAND_BBM_FIRSTPAGE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NAND_BBM_FIRSTPAGE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _NAND_BBM_SECONDPAGE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _NAND_BBM_SECONDPAGE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8
	mov	x9, x19
	b	LBB0_5
LBB0_4:
	ldr	w8, [x19]
Lloh9:
	adrp	x9, _NAND_BBM_LASTPAGE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _NAND_BBM_LASTPAGE@GOTPAGEOFF]
LBB0_5:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x19]
	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 AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_SAMSUNG_LP_OPTIONS,4,2    ; @NAND_SAMSUNG_LP_OPTIONS
	.comm	_NAND_BBM_LASTPAGE,4,2          ; @NAND_BBM_LASTPAGE
	.comm	_NAND_BBM_FIRSTPAGE,4,2         ; @NAND_BBM_FIRSTPAGE
	.comm	_NAND_BBM_SECONDPAGE,4,2        ; @NAND_BBM_SECONDPAGE
	.no_dead_strip	_samsung_nand_init
.subsections_via_symbols
