	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stm32_fmc2_bch_correct
_stm32_fmc2_bch_correct:                ## @stm32_fmc2_bch_correct
	.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
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movl	4(%rdi), %edi
	callq	_to_stm32_nfc
	movq	%rax, %rbx
	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_BCHDSR0@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%rbx), %rdi
	callq	_readl_relaxed
	movl	%eax, -64(%rbp)
	movq	_FMC2_BCHDSR1@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%rbx), %rdi
	callq	_readl_relaxed
	movl	%eax, -60(%rbp)
	movq	_FMC2_BCHDSR2@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%rbx), %rdi
	callq	_readl_relaxed
	movl	%eax, -56(%rbp)
	movq	_FMC2_BCHDSR3@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%rbx), %rdi
	callq	_readl_relaxed
	movl	%eax, -52(%rbp)
	movq	_FMC2_BCHDSR4@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%rbx), %rdi
	callq	_readl_relaxed
	movl	%eax, -48(%rbp)
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_stm32_fmc2_set_ecc
	movl	(%r15), %edi
	leaq	-64(%rbp), %rdx
	movq	%r14, %rsi
	callq	_stm32_fmc2_bch_decode
	jmp	LBB0_3
LBB0_1:
	movl	8(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	%rbx, %rdi
	callq	_stm32_fmc2_disable_bch_irq
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_3:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-40(%rbp), %rcx
	jne	LBB0_5
## %bb.4:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	callq	___stack_chk_fail
	.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_BCHDSR0,8,3               ## @FMC2_BCHDSR0
	.comm	_FMC2_BCHDSR1,8,3               ## @FMC2_BCHDSR1
	.comm	_FMC2_BCHDSR2,8,3               ## @FMC2_BCHDSR2
	.comm	_FMC2_BCHDSR3,8,3               ## @FMC2_BCHDSR3
	.comm	_FMC2_BCHDSR4,8,3               ## @FMC2_BCHDSR4
	.no_dead_strip	_stm32_fmc2_bch_correct
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stm32_fmc2_bch_correct
_stm32_fmc2_bch_correct:                ; @stm32_fmc2_bch_correct
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	w0, [x0, #4]
	bl	_to_stm32_nfc
	mov	x21, x0
	add	x22, x0, #12
Lloh3:
	adrp	x8, _FMC2_TIMEOUT_MS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FMC2_TIMEOUT_MS@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x22
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_2
; %bb.1:
	ldr	x8, [x21]
Lloh6:
	adrp	x9, _FMC2_BCHDSR0@GOTPAGE
Lloh7:
	ldr	x9, [x9, _FMC2_BCHDSR0@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl_relaxed
	str	w0, [sp, #4]
	ldr	x8, [x21]
Lloh9:
	adrp	x9, _FMC2_BCHDSR1@GOTPAGE
Lloh10:
	ldr	x9, [x9, _FMC2_BCHDSR1@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl_relaxed
	str	w0, [sp, #8]
	ldr	x8, [x21]
Lloh12:
	adrp	x9, _FMC2_BCHDSR2@GOTPAGE
Lloh13:
	ldr	x9, [x9, _FMC2_BCHDSR2@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl_relaxed
	str	w0, [sp, #12]
	ldr	x8, [x21]
Lloh15:
	adrp	x9, _FMC2_BCHDSR3@GOTPAGE
Lloh16:
	ldr	x9, [x9, _FMC2_BCHDSR3@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl_relaxed
	str	w0, [sp, #16]
	ldr	x8, [x21]
Lloh18:
	adrp	x9, _FMC2_BCHDSR4@GOTPAGE
Lloh19:
	ldr	x9, [x9, _FMC2_BCHDSR4@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl_relaxed
	str	w0, [sp, #20]
	mov	x0, x21
	mov	w1, #0
	bl	_stm32_fmc2_set_ecc
	ldr	w0, [x20]
	add	x2, sp, #4
	mov	x1, x19
	bl	_stm32_fmc2_bch_decode
	b	LBB0_3
LBB0_2:
	ldr	w0, [x21, #8]
Lloh21:
	adrp	x1, l_.str@PAGE
Lloh22:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	x0, x21
	bl	_stm32_fmc2_disable_bch_irq
Lloh23:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldr	x8, [sp, #24]
Lloh26:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh27:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh28:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_5
; %bb.4:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_5:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.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_BCHDSR0,8,3               ; @FMC2_BCHDSR0
	.comm	_FMC2_BCHDSR1,8,3               ; @FMC2_BCHDSR1
	.comm	_FMC2_BCHDSR2,8,3               ; @FMC2_BCHDSR2
	.comm	_FMC2_BCHDSR3,8,3               ; @FMC2_BCHDSR3
	.comm	_FMC2_BCHDSR4,8,3               ; @FMC2_BCHDSR4
	.no_dead_strip	_stm32_fmc2_bch_correct
.subsections_via_symbols
