	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stm32_fmc2_nand_callbacks_setup
_stm32_fmc2_nand_callbacks_setup:       ## @stm32_fmc2_nand_callbacks_setup
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movl	56(%rdi), %edi
	callq	_to_stm32_nfc
	cmpq	$0, 16(%rax)
	je	LBB0_4
## %bb.1:
	cmpq	$0, 8(%rax)
	je	LBB0_4
## %bb.2:
	cmpq	$0, (%rax)
	je	LBB0_4
## %bb.3:
	movq	_stm32_fmc2_sequencer_correct@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movq	_stm32_fmc2_sequencer_write_page@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%rbx)
	movq	_stm32_fmc2_sequencer_read_page@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movq	_stm32_fmc2_sequencer_write_page_raw@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 44(%rbx)
	movq	_stm32_fmc2_sequencer_read_page_raw@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
	movq	8(%rbx), %rax
	movq	_FMC2_ECC_HAM@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	je	LBB0_8
	jmp	LBB0_9
LBB0_4:
	movq	_stm32_fmc2_hwctl@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%rbx)
	movq	8(%rbx), %rax
	movq	_FMC2_ECC_HAM@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	jne	LBB0_6
## %bb.5:
	movq	_stm32_fmc2_ham_calculate@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rbx)
	movq	_stm32_fmc2_ham_correct@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movq	_NAND_ECC_GENERIC_ERASED_CHECK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 32(%rbx)
	jmp	LBB0_8
LBB0_6:
	movq	_stm32_fmc2_bch_calculate@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, 28(%rbx)
	movq	_stm32_fmc2_bch_correct@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, 24(%rbx)
	movq	_stm32_fmc2_read_page@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, 20(%rbx)
	cmpq	%rcx, %rax
	jne	LBB0_9
LBB0_8:
	movq	_NAND_BUSWIDTH_16@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%rbx), %eax
	cmpl	$1, %eax
	movl	$4, %eax
LBB0_12:
	sbbl	$0, %eax
	movl	%eax, 16(%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_9:
	movq	_FMC2_ECC_BCH8@GOTPCREL(%rip), %rdx
	movq	_NAND_BUSWIDTH_16@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%rbx), %ecx
	cmpq	(%rdx), %rax
	jne	LBB0_11
## %bb.10:
	cmpl	$1, %ecx
	movl	$14, %eax
	jmp	LBB0_12
LBB0_11:
	cmpl	$1, %ecx
	movl	$8, %eax
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_stm32_fmc2_sequencer_correct,4,2 ## @stm32_fmc2_sequencer_correct
	.comm	_stm32_fmc2_sequencer_write_page,4,2 ## @stm32_fmc2_sequencer_write_page
	.comm	_stm32_fmc2_sequencer_read_page,4,2 ## @stm32_fmc2_sequencer_read_page
	.comm	_stm32_fmc2_sequencer_write_page_raw,4,2 ## @stm32_fmc2_sequencer_write_page_raw
	.comm	_stm32_fmc2_sequencer_read_page_raw,4,2 ## @stm32_fmc2_sequencer_read_page_raw
	.comm	_stm32_fmc2_hwctl,4,2           ## @stm32_fmc2_hwctl
	.comm	_FMC2_ECC_HAM,8,3               ## @FMC2_ECC_HAM
	.comm	_stm32_fmc2_ham_calculate,4,2   ## @stm32_fmc2_ham_calculate
	.comm	_stm32_fmc2_ham_correct,4,2     ## @stm32_fmc2_ham_correct
	.comm	_NAND_ECC_GENERIC_ERASED_CHECK,4,2 ## @NAND_ECC_GENERIC_ERASED_CHECK
	.comm	_stm32_fmc2_bch_calculate,4,2   ## @stm32_fmc2_bch_calculate
	.comm	_stm32_fmc2_bch_correct,4,2     ## @stm32_fmc2_bch_correct
	.comm	_stm32_fmc2_read_page,4,2       ## @stm32_fmc2_read_page
	.comm	_NAND_BUSWIDTH_16,4,2           ## @NAND_BUSWIDTH_16
	.comm	_FMC2_ECC_BCH8,8,3              ## @FMC2_ECC_BCH8
	.no_dead_strip	_stm32_fmc2_nand_callbacks_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stm32_fmc2_nand_callbacks_setup
_stm32_fmc2_nand_callbacks_setup:       ; @stm32_fmc2_nand_callbacks_setup
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w0, [x0, #56]
	bl	_to_stm32_nfc
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_4
; %bb.1:
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_4
; %bb.2:
	ldr	x8, [x0]
	cbz	x8, LBB0_4
; %bb.3:
Lloh0:
	adrp	x8, _stm32_fmc2_sequencer_correct@GOTPAGE
Lloh1:
	ldr	x8, [x8, _stm32_fmc2_sequencer_correct@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _stm32_fmc2_sequencer_write_page@GOTPAGE
Lloh4:
	ldr	x9, [x9, _stm32_fmc2_sequencer_write_page@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	str	w9, [x19, #48]
Lloh6:
	adrp	x9, _stm32_fmc2_sequencer_read_page@GOTPAGE
Lloh7:
	ldr	x9, [x9, _stm32_fmc2_sequencer_read_page@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #20]
Lloh9:
	adrp	x8, _stm32_fmc2_sequencer_write_page_raw@GOTPAGE
Lloh10:
	ldr	x8, [x8, _stm32_fmc2_sequencer_write_page_raw@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _stm32_fmc2_sequencer_read_page_raw@GOTPAGE
Lloh13:
	ldr	x9, [x9, _stm32_fmc2_sequencer_read_page_raw@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #40]
	ldr	x8, [x19, #8]
Lloh15:
	adrp	x9, _FMC2_ECC_HAM@GOTPAGE
Lloh16:
	ldr	x9, [x9, _FMC2_ECC_HAM@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_7
	b	LBB0_8
LBB0_4:
Lloh18:
	adrp	x8, _stm32_fmc2_hwctl@GOTPAGE
Lloh19:
	ldr	x8, [x8, _stm32_fmc2_hwctl@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [x19, #36]
	ldr	x8, [x19, #8]
Lloh21:
	adrp	x9, _FMC2_ECC_HAM@GOTPAGE
Lloh22:
	ldr	x9, [x9, _FMC2_ECC_HAM@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
Lloh24:
	adrp	x8, _stm32_fmc2_ham_calculate@GOTPAGE
Lloh25:
	ldr	x8, [x8, _stm32_fmc2_ham_calculate@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
Lloh27:
	adrp	x9, _stm32_fmc2_ham_correct@GOTPAGE
Lloh28:
	ldr	x9, [x9, _stm32_fmc2_ham_correct@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #24]
Lloh30:
	adrp	x8, _NAND_ECC_GENERIC_ERASED_CHECK@GOTPAGE
Lloh31:
	ldr	x8, [x8, _NAND_ECC_GENERIC_ERASED_CHECK@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	ldr	w9, [x19, #32]
	orr	w8, w9, w8
	str	w8, [x19, #32]
	b	LBB0_7
LBB0_6:
Lloh33:
	adrp	x10, _stm32_fmc2_bch_calculate@GOTPAGE
Lloh34:
	ldr	x10, [x10, _stm32_fmc2_bch_calculate@GOTPAGEOFF]
Lloh35:
	ldr	w10, [x10]
	str	w10, [x19, #28]
Lloh36:
	adrp	x10, _stm32_fmc2_bch_correct@GOTPAGE
Lloh37:
	ldr	x10, [x10, _stm32_fmc2_bch_correct@GOTPAGEOFF]
Lloh38:
	ldr	w10, [x10]
Lloh39:
	adrp	x11, _stm32_fmc2_read_page@GOTPAGE
Lloh40:
	ldr	x11, [x11, _stm32_fmc2_read_page@GOTPAGEOFF]
Lloh41:
	ldr	w11, [x11]
	stp	w11, w10, [x19, #20]
	cmp	x8, x9
	b.ne	LBB0_8
LBB0_7:
	ldr	w8, [x19]
Lloh42:
	adrp	x9, _NAND_BUSWIDTH_16@GOTPAGE
Lloh43:
	ldr	x9, [x9, _NAND_BUSWIDTH_16@GOTPAGEOFF]
Lloh44:
	ldr	w9, [x9]
	tst	w9, w8
	mov	w8, #3
	cinc	w8, w8, ne
	b	LBB0_9
LBB0_8:
Lloh45:
	adrp	x9, _FMC2_ECC_BCH8@GOTPAGE
Lloh46:
	ldr	x9, [x9, _FMC2_ECC_BCH8@GOTPAGEOFF]
Lloh47:
	ldr	x9, [x9]
	ldr	w10, [x19]
Lloh48:
	adrp	x11, _NAND_BUSWIDTH_16@GOTPAGE
Lloh49:
	ldr	x11, [x11, _NAND_BUSWIDTH_16@GOTPAGEOFF]
Lloh50:
	ldr	w11, [x11]
	and	w10, w11, w10
	cmp	w10, #0
	mov	w10, #7
	cinc	w10, w10, ne
	mov	w11, #13
	cinc	w11, w11, ne
	cmp	x8, x9
	csel	w8, w10, w11, ne
LBB0_9:
	str	w8, [x19, #16]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.cfi_endproc
                                        ; -- End function
	.comm	_stm32_fmc2_sequencer_correct,4,2 ; @stm32_fmc2_sequencer_correct
	.comm	_stm32_fmc2_sequencer_write_page,4,2 ; @stm32_fmc2_sequencer_write_page
	.comm	_stm32_fmc2_sequencer_read_page,4,2 ; @stm32_fmc2_sequencer_read_page
	.comm	_stm32_fmc2_sequencer_write_page_raw,4,2 ; @stm32_fmc2_sequencer_write_page_raw
	.comm	_stm32_fmc2_sequencer_read_page_raw,4,2 ; @stm32_fmc2_sequencer_read_page_raw
	.comm	_stm32_fmc2_hwctl,4,2           ; @stm32_fmc2_hwctl
	.comm	_FMC2_ECC_HAM,8,3               ; @FMC2_ECC_HAM
	.comm	_stm32_fmc2_ham_calculate,4,2   ; @stm32_fmc2_ham_calculate
	.comm	_stm32_fmc2_ham_correct,4,2     ; @stm32_fmc2_ham_correct
	.comm	_NAND_ECC_GENERIC_ERASED_CHECK,4,2 ; @NAND_ECC_GENERIC_ERASED_CHECK
	.comm	_stm32_fmc2_bch_calculate,4,2   ; @stm32_fmc2_bch_calculate
	.comm	_stm32_fmc2_bch_correct,4,2     ; @stm32_fmc2_bch_correct
	.comm	_stm32_fmc2_read_page,4,2       ; @stm32_fmc2_read_page
	.comm	_NAND_BUSWIDTH_16,4,2           ; @NAND_BUSWIDTH_16
	.comm	_FMC2_ECC_BCH8,8,3              ; @FMC2_ECC_BCH8
	.no_dead_strip	_stm32_fmc2_nand_callbacks_setup
.subsections_via_symbols
