	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function brcmnand_wr_corr_thresh
_brcmnand_wr_corr_thresh:               ## @brcmnand_wr_corr_thresh
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movl	%esi, %r8d
	movq	%rdi, %rax
	movq	8(%rdi), %rdi
	movq	_BRCMNAND_CORR_THRESHOLD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	(%rax), %ecx
	movl	(%rdi), %eax
	movl	$7, %edx
	cmpl	$1794, %eax                     ## imm = 0x702
	jne	LBB0_1
LBB0_3:
	cmpl	$4, %ecx
	jl	LBB0_5
## %bb.4:
	movq	_BRCMNAND_CORR_THRESHOLD_EXT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
LBB0_5:
	leal	3(%rcx), %eax
	testl	%ecx, %ecx
	cmovnsl	%ecx, %eax
	andl	$-4, %eax
	subl	%eax, %ecx
	imull	%edx, %ecx
	jmp	LBB0_10
LBB0_1:
	cmpl	$1536, %eax                     ## imm = 0x600
	jl	LBB0_6
## %bb.2:
	movl	$6, %edx
	cmpl	$1794, %eax                     ## imm = 0x702
	jae	LBB0_3
## %bb.7:
	cmpl	$5, %ecx
	jl	LBB0_9
## %bb.8:
	movq	_BRCMNAND_CORR_THRESHOLD_EXT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
LBB0_9:
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax         ## imm = 0x66666667
	movq	%rax, %rdx
	shrq	$63, %rdx
	sarq	$33, %rax
	addl	%edx, %eax
	leal	(%rax,%rax,4), %eax
	subl	%eax, %ecx
	addl	%ecx, %ecx
	leal	(%rcx,%rcx,2), %ecx
	movl	$6, %edx
	jmp	LBB0_10
LBB0_6:
	xorl	%edx, %edx
	cmpl	$1280, %eax                     ## imm = 0x500
	setge	%dl
	orl	$4, %edx
	xorl	%ecx, %ecx
LBB0_10:
	decl	%edx
	shll	%cl, %edx
                                        ## kill: def $ecx killed $ecx killed $rcx
	popq	%rbp
	jmp	_brcmnand_rmw_reg               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_BRCMNAND_CORR_THRESHOLD,4,2    ## @BRCMNAND_CORR_THRESHOLD
	.comm	_BRCMNAND_CORR_THRESHOLD_EXT,4,2 ## @BRCMNAND_CORR_THRESHOLD_EXT
	.no_dead_strip	_brcmnand_wr_corr_thresh
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function brcmnand_wr_corr_thresh
_brcmnand_wr_corr_thresh:               ; @brcmnand_wr_corr_thresh
	.cfi_startproc
; %bb.0:
	mov	x4, x1
	mov	x8, x0
	ldr	x0, [x0, #8]
Lloh0:
	adrp	x9, _BRCMNAND_CORR_THRESHOLD@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BRCMNAND_CORR_THRESHOLD@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x9]
	ldr	w8, [x8]
	ldr	w9, [x0]
	cmp	w9, #1794
	b.ne	LBB0_2
; %bb.1:
	mov	w9, #7
	b	LBB0_5
LBB0_2:
	cmp	w9, #1536
	b.lt	LBB0_6
; %bb.3:
	cmp	w9, #1794
	b.lo	LBB0_7
; %bb.4:
	mov	w9, #6
LBB0_5:
Lloh3:
	adrp	x10, _BRCMNAND_CORR_THRESHOLD_EXT@GOTPAGE
Lloh4:
	ldr	x10, [x10, _BRCMNAND_CORR_THRESHOLD_EXT@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	cmp	w8, #3
	csel	w1, w10, w1, gt
	negs	w10, w8
	and	w10, w10, #0x3
	and	w8, w8, #0x3
	csneg	w8, w8, w10, mi
	mul	w3, w9, w8
	b	LBB0_8
LBB0_6:
	mov	w3, #0
	cmp	w9, #1279
	mov	w8, #4
	cinc	w9, w8, gt
	b	LBB0_8
LBB0_7:
Lloh6:
	adrp	x9, _BRCMNAND_CORR_THRESHOLD_EXT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _BRCMNAND_CORR_THRESHOLD_EXT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w8, #4
	csel	w1, w9, w1, gt
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	smull	x9, w8, w9
	lsr	x10, x9, #63
	asr	x9, x9, #33
	add	w9, w9, w10
	add	w9, w9, w9, lsl #2
	sub	w8, w8, w9
	add	w8, w8, w8, lsl #1
	lsl	w3, w8, #1
	mov	w9, #6
LBB0_8:
	sub	w8, w9, #1
	lsl	w2, w8, w3
	b	_brcmnand_rmw_reg
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_BRCMNAND_CORR_THRESHOLD,4,2    ; @BRCMNAND_CORR_THRESHOLD
	.comm	_BRCMNAND_CORR_THRESHOLD_EXT,4,2 ; @BRCMNAND_CORR_THRESHOLD_EXT
	.no_dead_strip	_brcmnand_wr_corr_thresh
.subsections_via_symbols
