	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stm32_fmc2_bch_calculate
_stm32_fmc2_bch_calculate:              ## @stm32_fmc2_bch_calculate
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rdi, %r15
	movl	8(%rdi), %edi
	callq	_to_stm32_nfc
	movq	%rax, %r14
	leaq	12(%rax), %r12
	movq	_FMC2_TIMEOUT_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	_FMC2_BCHPBR1@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	callq	_readl_relaxed
	movl	%eax, (%rbx)
	movl	%eax, %ecx
	sarl	$8, %ecx
	movl	%ecx, 4(%rbx)
	movl	%eax, %ecx
	sarl	$16, %ecx
	movl	%ecx, 8(%rbx)
	sarl	$24, %eax
	movl	%eax, 12(%rbx)
	movq	_FMC2_BCHPBR2@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	callq	_readl_relaxed
	movl	%eax, 16(%rbx)
	movl	%eax, %ecx
	sarl	$8, %ecx
	movl	%ecx, 20(%rbx)
	movl	%eax, %ecx
	sarl	$16, %ecx
	movl	%ecx, 24(%rbx)
	movq	(%r15), %rcx
	movq	_FMC2_ECC_BCH8@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_4
## %bb.3:
	sarl	$24, %eax
	movl	%eax, 28(%rbx)
	movq	_FMC2_BCHPBR3@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	callq	_readl_relaxed
	movl	%eax, 32(%rbx)
	movl	%eax, %ecx
	sarl	$8, %ecx
	movl	%ecx, 36(%rbx)
	movl	%eax, %ecx
	sarl	$16, %ecx
	movl	%ecx, 40(%rbx)
	sarl	$24, %eax
	movl	%eax, 44(%rbx)
	movq	_FMC2_BCHPBR4@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	callq	_readl_relaxed
	movl	%eax, 48(%rbx)
LBB0_4:
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_stm32_fmc2_set_ecc
	jmp	LBB0_5
LBB0_1:
	movl	8(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	%r14, %rdi
	callq	_stm32_fmc2_disable_bch_irq
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_5:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FMC2_TIMEOUT_MS,4,2            ## @FMC2_TIMEOUT_MS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bch timeout\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_FMC2_BCHPBR1,8,3               ## @FMC2_BCHPBR1
	.comm	_FMC2_BCHPBR2,8,3               ## @FMC2_BCHPBR2
	.comm	_FMC2_ECC_BCH8,8,3              ## @FMC2_ECC_BCH8
	.comm	_FMC2_BCHPBR3,8,3               ## @FMC2_BCHPBR3
	.comm	_FMC2_BCHPBR4,8,3               ## @FMC2_BCHPBR4
	.no_dead_strip	_stm32_fmc2_bch_calculate
.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 stm32_fmc2_bch_calculate
lCPI0_0:
	.long	4294967288                      ; 0xfffffff8
	.long	4294967280                      ; 0xfffffff0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_stm32_fmc2_bch_calculate:              ; @stm32_fmc2_bch_calculate
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [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 b8, -56
	.cfi_offset b9, -64
	mov	x20, x2
	mov	x21, x0
	ldr	w0, [x0, #8]
	bl	_to_stm32_nfc
	mov	x19, x0
	add	x22, x0, #12
Lloh0:
	adrp	x8, _FMC2_TIMEOUT_MS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FMC2_TIMEOUT_MS@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x22
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_4
; %bb.1:
	ldr	x8, [x19]
Lloh3:
	adrp	x9, _FMC2_BCHPBR1@GOTPAGE
Lloh4:
	ldr	x9, [x9, _FMC2_BCHPBR1@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl_relaxed
	dup.2s	v0, w0
	str	w0, [x20]
Lloh6:
	adrp	x8, lCPI0_0@PAGE
Lloh7:
	ldr	d8, [x8, lCPI0_0@PAGEOFF]
	sshl.2s	v0, v0, v8
	stur	d0, [x20, #4]
	asr	w8, w0, #24
	str	w8, [x20, #12]
	ldr	x8, [x19]
Lloh8:
	adrp	x9, _FMC2_BCHPBR2@GOTPAGE
Lloh9:
	ldr	x9, [x9, _FMC2_BCHPBR2@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl_relaxed
	str	w0, [x20, #16]
	dup.2s	v0, w0
	sshl.2s	v0, v0, v8
	stur	d0, [x20, #20]
	ldr	x8, [x21]
Lloh11:
	adrp	x9, _FMC2_ECC_BCH8@GOTPAGE
Lloh12:
	ldr	x9, [x9, _FMC2_ECC_BCH8@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
	asr	w8, w0, #24
	str	w8, [x20, #28]
	ldr	x8, [x19]
Lloh14:
	adrp	x9, _FMC2_BCHPBR3@GOTPAGE
Lloh15:
	ldr	x9, [x9, _FMC2_BCHPBR3@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl_relaxed
	str	w0, [x20, #32]
	dup.2s	v0, w0
	sshl.2s	v0, v0, v8
	stur	d0, [x20, #36]
	asr	w8, w0, #24
	str	w8, [x20, #44]
	ldr	x8, [x19]
Lloh17:
	adrp	x9, _FMC2_BCHPBR4@GOTPAGE
Lloh18:
	ldr	x9, [x9, _FMC2_BCHPBR4@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl_relaxed
	str	w0, [x20, #48]
LBB0_3:
	mov	x0, x19
	mov	w1, #0
	bl	_stm32_fmc2_set_ecc
	mov	w0, #0
	b	LBB0_5
LBB0_4:
	ldr	w0, [x19, #8]
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	x0, x19
	bl	_stm32_fmc2_disable_bch_irq
Lloh22:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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	d9, d8, [sp], #64               ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdr	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_FMC2_TIMEOUT_MS,4,2            ; @FMC2_TIMEOUT_MS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bch timeout\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_FMC2_BCHPBR1,8,3               ; @FMC2_BCHPBR1
	.comm	_FMC2_BCHPBR2,8,3               ; @FMC2_BCHPBR2
	.comm	_FMC2_ECC_BCH8,8,3              ; @FMC2_ECC_BCH8
	.comm	_FMC2_BCHPBR3,8,3               ; @FMC2_BCHPBR3
	.comm	_FMC2_BCHPBR4,8,3               ; @FMC2_BCHPBR4
	.no_dead_strip	_stm32_fmc2_bch_calculate
.subsections_via_symbols
