	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stm32_fmc2_hwctl
_stm32_fmc2_hwctl:                      ## @stm32_fmc2_hwctl
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	8(%rdi), %edi
	callq	_to_stm32_nfc
	movq	%rax, %r15
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_stm32_fmc2_set_ecc
	movq	(%rbx), %rax
	movq	_FMC2_ECC_HAM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_2
## %bb.1:
	movq	_FMC2_PCR@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	addq	8(%r15), %rdi
	callq	_readl_relaxed
	movq	_NAND_ECC_WRITE@GOTPCREL(%rip), %rcx
	movq	_FMC2_PCR_WEN@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edi
	movl	%edi, %edx
	orl	%eax, %edx
	notl	%edi
	andl	%eax, %edi
	cmpl	%r14d, (%rcx)
	cmovel	%edx, %edi
	movq	(%rbx), %rsi
	addq	8(%r15), %rsi
	callq	_writel_relaxed
	movq	%r15, %rdi
	callq	_reinit_completion
	movq	%r15, %rdi
	callq	_stm32_fmc2_clear_bch_irq
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_stm32_fmc2_enable_bch_irq
LBB0_2:
	movq	%r15, %rdi
	movl	$1, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_stm32_fmc2_set_ecc             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_FMC2_ECC_HAM,8,3               ## @FMC2_ECC_HAM
	.comm	_FMC2_PCR,8,3                   ## @FMC2_PCR
	.comm	_NAND_ECC_WRITE,4,2             ## @NAND_ECC_WRITE
	.comm	_FMC2_PCR_WEN,4,2               ## @FMC2_PCR_WEN
	.no_dead_strip	_stm32_fmc2_hwctl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stm32_fmc2_hwctl
_stm32_fmc2_hwctl:                      ; @stm32_fmc2_hwctl
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x21, x0
	ldr	w0, [x0, #8]
	bl	_to_stm32_nfc
	mov	x20, x0
	mov	w1, #0
	bl	_stm32_fmc2_set_ecc
	ldr	x8, [x21]
Lloh0:
	adrp	x9, _FMC2_ECC_HAM@GOTPAGE
Lloh1:
	ldr	x9, [x9, _FMC2_ECC_HAM@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_2
; %bb.1:
	ldr	x8, [x20, #8]
Lloh3:
	adrp	x21, _FMC2_PCR@GOTPAGE
Lloh4:
	ldr	x21, [x21, _FMC2_PCR@GOTPAGEOFF]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl_relaxed
Lloh5:
	adrp	x8, _NAND_ECC_WRITE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _NAND_ECC_WRITE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _FMC2_PCR_WEN@GOTPAGE
Lloh9:
	ldr	x9, [x9, _FMC2_PCR_WEN@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w10, w9, w0
	bic	w9, w0, w9
	cmp	w8, w19
	csel	w0, w10, w9, eq
	ldr	x8, [x20, #8]
	ldr	x9, [x21]
	add	x1, x9, x8
	bl	_writel_relaxed
	mov	x0, x20
	bl	_reinit_completion
	mov	x0, x20
	bl	_stm32_fmc2_clear_bch_irq
	mov	x0, x20
	mov	x1, x19
	bl	_stm32_fmc2_enable_bch_irq
LBB0_2:
	mov	x0, x20
	mov	w1, #1
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_stm32_fmc2_set_ecc
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_FMC2_ECC_HAM,8,3               ; @FMC2_ECC_HAM
	.comm	_FMC2_PCR,8,3                   ; @FMC2_PCR
	.comm	_NAND_ECC_WRITE,4,2             ; @NAND_ECC_WRITE
	.comm	_FMC2_PCR_WEN,4,2               ; @FMC2_PCR_WEN
	.no_dead_strip	_stm32_fmc2_hwctl
.subsections_via_symbols
