	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function samsung_nand_decode_id
_samsung_nand_decode_id:                ## @samsung_nand_decode_id
	.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, %r13
	leaq	24(%rbx), %r14
	movq	%r14, %rdi
	callq	_nanddev_get_memorg
	cmpl	$6, 8(%rbx)
	jne	LBB0_21
## %bb.1:
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_nand_is_slc
	testq	%rax, %rax
	je	LBB0_2
LBB0_21:
	movq	%rbx, %rdi
	callq	_nand_decode_ext_id
	movq	%rbx, %rdi
	callq	_nand_is_slc
	testq	%rax, %rax
	je	LBB0_28
## %bb.22:
	movq	16(%rbx), %rax
	movl	4(%rax), %ecx
	cmpl	$241, %ecx
	je	LBB0_25
## %bb.23:
	cmpl	$220, %ecx
	jne	LBB0_28
## %bb.24:
	movabsq	$4294967808, %rax               ## imm = 0x100000200
	movq	%rax, 24(%rbx)
	jmp	LBB0_28
LBB0_2:
	movq	16(%rbx), %r8
	cmpl	$0, 20(%r8)
	je	LBB0_21
## %bb.3:
	movl	12(%r8), %r15d
	movl	%r15d, %ecx
	andb	$3, %cl
	movl	$2048, %edi                     ## imm = 0x800
	shll	%cl, %edi
	movl	%edi, (%r12)
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movl	%edi, (%r13)
	movl	%r15d, %eax
	shrl	$2, %eax
	movl	%r15d, %r13d
	sarl	$4, %r13d
	movl	%r13d, %ecx
	andl	$4, %ecx
	andl	$3, %eax
	addl	%ecx, %eax
	decl	%eax
	cmpl	$5, %eax
	ja	LBB0_11
## %bb.4:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_5:
	movl	$128, 4(%r12)
	movl	$128, %eax
	jmp	LBB0_12
LBB0_25:
	cmpl	$5, 8(%rbx)
	jl	LBB0_28
## %bb.26:
	movl	16(%rax), %r14d
	movl	$1, %edi
	xorl	%esi, %esi
	callq	_GENMASK
	andl	%r14d, %eax
	cmpl	$1, %eax
	jne	LBB0_28
## %bb.27:
	movq	_NAND_NO_SUBPAGE_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rbx)
	jmp	LBB0_28
LBB0_11:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_WARN
	movl	(%r12), %edi
	movl	4(%r12), %eax
	movq	16(%rbx), %r8
	jmp	LBB0_12
LBB0_6:
	movl	$218, 4(%r12)
	movl	$218, %eax
	jmp	LBB0_12
LBB0_7:
	movl	$400, 4(%r12)                   ## imm = 0x190
	movl	$400, %eax                      ## imm = 0x190
	jmp	LBB0_12
LBB0_8:
	movl	$436, 4(%r12)                   ## imm = 0x1B4
	movl	$436, %eax                      ## imm = 0x1B4
	jmp	LBB0_12
LBB0_9:
	movl	$512, 4(%r12)                   ## imm = 0x200
	movl	$512, %eax                      ## imm = 0x200
	jmp	LBB0_12
LBB0_10:
	movl	$640, 4(%r12)                   ## imm = 0x280
	movl	$640, %eax                      ## imm = 0x280
LBB0_12:
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	%eax, 4(%rsi)
	shrl	$5, %r15d
	andl	$4, %r15d
	andl	$3, %r13d
	orl	%r15d, %r13d
	movl	%r13d, %eax
	xorl	%edx, %edx
	idivl	%edi
	movl	$131072, %edx                   ## imm = 0x20000
	movl	$131072, %edi                   ## imm = 0x20000
	movl	%eax, %ecx
	shll	%cl, %edi
	movl	%edi, 8(%r12)
	movl	%r13d, %ecx
	shll	%cl, %edx
	movl	%edx, 8(%rsi)
	movl	16(%r8), %ecx
	shrl	$4, %ecx
	andl	$7, %ecx
	cmpl	$4, %ecx
	ja	LBB0_14
## %bb.13:
	movl	$512, 24(%rbx)                  ## imm = 0x200
	movl	$1, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	movl	%eax, 28(%rbx)
	jmp	LBB0_28
LBB0_14:
	movl	$1024, (%r14)                   ## imm = 0x400
	cmpl	$7, %ecx
	je	LBB0_19
## %bb.15:
	cmpl	$6, %ecx
	je	LBB0_18
## %bb.16:
	cmpl	$5, %ecx
	jne	LBB0_20
## %bb.17:
	movl	$24, 28(%rbx)
	jmp	LBB0_28
LBB0_19:
	movl	$60, 28(%rbx)
	jmp	LBB0_28
LBB0_18:
	movl	$40, 28(%rbx)
	jmp	LBB0_28
LBB0_20:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	callq	_WARN
	movl	$0, (%r14)
LBB0_28:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
LJTI0_0:
	.long	L0_0_set_5
	.long	L0_0_set_6
	.long	L0_0_set_7
	.long	L0_0_set_8
	.long	L0_0_set_9
	.long	L0_0_set_10
	.end_data_region
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid OOB size value"

L_.str.1:                               ## @.str.1
	.asciz	"Could not decode ECC info"

	.comm	_NAND_NO_SUBPAGE_WRITE,4,2      ## @NAND_NO_SUBPAGE_WRITE
	.no_dead_strip	_samsung_nand_decode_id
.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 samsung_nand_decode_id
lCPI0_0:
	.long	512                             ; 0x200
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_samsung_nand_decode_id:                ; @samsung_nand_decode_id
	.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	x19, x0
	bl	_nand_to_mtd
	mov	x21, x0
	add	x20, x19, #24
	mov	x0, x20
	bl	_nanddev_get_memorg
	ldr	w8, [x19, #8]
	cmp	w8, #6
	b.ne	LBB0_2
; %bb.1:
	mov	x22, x0
	mov	x0, x19
	bl	_nand_is_slc
	cbz	x0, LBB0_6
LBB0_2:
	mov	x0, x19
	bl	_nand_decode_ext_id
	mov	x0, x19
	bl	_nand_is_slc
	cbz	x0, LBB0_29
; %bb.3:
	ldr	x8, [x19, #16]
	ldr	w9, [x8, #4]
	cmp	w9, #241
	b.eq	LBB0_10
; %bb.4:
	cmp	w9, #220
	b.ne	LBB0_29
; %bb.5:
Lloh0:
	adrp	x8, lCPI0_0@PAGE
Lloh1:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x20]
	b	LBB0_29
LBB0_6:
	ldr	x8, [x19, #16]
	ldr	w9, [x8, #20]
	cbz	w9, LBB0_2
; %bb.7:
	ldr	w23, [x8, #12]
	and	x9, x23, #0x3
	mov	w10, #2048
	lsl	w9, w10, w9
	str	w9, [x22]
	str	w9, [x21]
	ubfx	x10, x23, #4, #28
	and	w10, w10, #0x4
	bfxil	w10, w23, #2, #2
	sub	w10, w10, #1
	cmp	w10, #5
	b.hi	LBB0_13
; %bb.8:
Lloh2:
	adrp	x11, lJTI0_0@PAGE
Lloh3:
	add	x11, x11, lJTI0_0@PAGEOFF
	adr	x12, LBB0_9
	ldrb	w13, [x11, x10]
	add	x12, x12, x13, lsl #2
	br	x12
LBB0_9:
	mov	w10, #128
	b	LBB0_19
LBB0_10:
	ldr	w9, [x19, #8]
	cmp	w9, #5
	b.lt	LBB0_29
; %bb.11:
	ldr	w20, [x8, #16]
	mov	w0, #1
	mov	w1, #0
	bl	_GENMASK
	and	w8, w0, w20
	cmp	w8, #1
	b.ne	LBB0_29
; %bb.12:
Lloh4:
	adrp	x8, _NAND_NO_SUBPAGE_WRITE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _NAND_NO_SUBPAGE_WRITE@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	b	LBB0_29
LBB0_13:
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_WARN
	ldp	w9, w10, [x22]
	ldr	x8, [x19, #16]
	b	LBB0_20
LBB0_14:
	mov	w10, #218
	b	LBB0_19
LBB0_15:
	mov	w10, #400
	b	LBB0_19
LBB0_16:
	mov	w10, #436
	b	LBB0_19
LBB0_17:
	mov	w10, #512
	b	LBB0_19
LBB0_18:
	mov	w10, #640
LBB0_19:
	str	w10, [x22, #4]
LBB0_20:
	lsr	w11, w23, #5
	and	w11, w11, #0x4
	bfxil	w11, w23, #4, #2
	sdiv	w9, w11, w9
	mov	w12, #131072
	lsl	w9, w12, w9
	str	w9, [x22, #8]
	lsl	w9, w12, w11
	stp	w10, w9, [x21, #4]
	ldr	w8, [x8, #16]
	ubfx	w8, w8, #4, #3
	cmp	w8, #4
	b.hi	LBB0_22
; %bb.21:
	mov	w9, #512
	mov	w10, #1
	lsl	w8, w10, w8
	stp	w9, w8, [x19, #24]
	b	LBB0_29
LBB0_22:
	mov	w9, #1024
	str	w9, [x20]
	cmp	w8, #7
	b.eq	LBB0_26
; %bb.23:
	cmp	w8, #6
	b.eq	LBB0_27
; %bb.24:
	cmp	w8, #5
	b.ne	LBB0_28
; %bb.25:
	mov	w8, #24
	str	w8, [x19, #28]
	b	LBB0_29
LBB0_26:
	mov	w8, #60
	str	w8, [x19, #28]
	b	LBB0_29
LBB0_27:
	mov	w8, #40
	str	w8, [x19, #28]
	b	LBB0_29
LBB0_28:
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_WARN
	str	wzr, [x20]
LBB0_29:
	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 AdrpLdr	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_9-LBB0_9)>>2
	.byte	(LBB0_14-LBB0_9)>>2
	.byte	(LBB0_15-LBB0_9)>>2
	.byte	(LBB0_16-LBB0_9)>>2
	.byte	(LBB0_17-LBB0_9)>>2
	.byte	(LBB0_18-LBB0_9)>>2
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid OOB size value"

l_.str.1:                               ; @.str.1
	.asciz	"Could not decode ECC info"

	.comm	_NAND_NO_SUBPAGE_WRITE,4,2      ; @NAND_NO_SUBPAGE_WRITE
	.no_dead_strip	_samsung_nand_decode_id
.subsections_via_symbols
