	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxc_nand_v2_setup_data_interface
_mxc_nand_v2_setup_data_interface:      ## @mxc_nand_v2_setup_data_interface
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movl	%esi, %r14d
	callq	_nand_get_controller_data
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_nand_get_sdr_timings
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_ENOTSUPP@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_23
LBB0_2:
	movq	_NFC_V1_V2_CONFIG1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_readw
	movl	%eax, %r15d
	movslq	(%rbx), %rcx
	imulq	$274877907, %rcx, %rsi          ## imm = 0x10624DD3
	movq	%rsi, %rax
	shrq	$63, %rax
	sarq	$38, %rsi
	addl	%eax, %esi
	movl	$1000000000, %eax               ## imm = 0x3B9ACA00
	xorl	%edx, %edx
	idivl	%esi
	movslq	%eax, %r13
	cmpq	$29999, %rcx                    ## imm = 0x752F
	jg	LBB0_5
## %bb.3:
	movl	4(%r12), %edi
	movq	%r13, %rsi
	callq	_clk_round_rate
	movq	%rax, %rsi
	movq	_NFC_V2_CONFIG1_ONE_CYCLE@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movq	%rsi, %rax
	shrq	$3, %rax
	movabsq	$2361183241434822607, %rcx      ## imm = 0x20C49BA5E353F7CF
	mulq	%rcx
	movq	%rdx, %rcx
	shrq	$4, %rcx
	cmpq	$1000000000, %rcx               ## imm = 0x3B9ACA00
	jbe	LBB0_6
LBB0_4:
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_5:
	addq	%r13, %r13
	movl	4(%r12), %edi
	movq	%r13, %rsi
	callq	_clk_round_rate
	movq	%rax, %rsi
	movq	_NFC_V2_CONFIG1_ONE_CYCLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, %r15d
	movq	%rsi, %rax
	shrq	$4, %rax
	movabsq	$147573952589676413, %rcx       ## imm = 0x20C49BA5E353F7D
	mulq	%rcx
	movq	%rdx, %rcx
	cmpq	$1000000000, %rcx               ## imm = 0x3B9ACA00
	ja	LBB0_4
LBB0_6:
	movl	$1000000000, %eax               ## imm = 0x3B9ACA00
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_7:
	leal	-1000(%rax), %ecx
	cmpl	%ecx, 4(%rbx)
	jg	LBB0_22
## %bb.8:
	leal	-2000(%rax), %edx
	cmpl	%edx, 8(%rbx)
	jg	LBB0_22
## %bb.9:
	cmpl	%ecx, 12(%rbx)
	jg	LBB0_22
## %bb.10:
	cmpl	%edx, 16(%rbx)
	jg	LBB0_22
## %bb.11:
	leal	-1500(%rax), %ecx
	cmpl	%ecx, 20(%rbx)
	jg	LBB0_22
## %bb.12:
	cmpl	%eax, 24(%rbx)
	jg	LBB0_22
## %bb.13:
	leal	-3000(%rax), %ecx
	cmpl	%ecx, 28(%rbx)
	jg	LBB0_22
## %bb.14:
	cmpl	%eax, 32(%rbx)
	jg	LBB0_22
## %bb.15:
	leal	-5000(%rax), %ecx
	cmpl	%ecx, 36(%rbx)
	jg	LBB0_22
## %bb.16:
	leal	(%rax,%rax), %ecx
	cmpl	%ecx, 40(%rbx)
	jg	LBB0_22
## %bb.17:
	leal	-2500(%rax), %edx
	cmpl	%edx, 44(%rbx)
	jg	LBB0_22
## %bb.18:
	leal	(%rcx,%rcx,2), %edx
	cmpl	%edx, 48(%rbx)
	jg	LBB0_22
## %bb.19:
	leal	(%rax,%rax,2), %edx
	shrl	%edx
	cmpl	%edx, 52(%rbx)
	jg	LBB0_22
## %bb.20:
	cmpl	%ecx, (%rbx)
	jg	LBB0_22
## %bb.21:
	shrl	%eax
	addl	$-2500, %eax                    ## imm = 0xF63C
	cmpl	%eax, 56(%rbx)
	jle	LBB0_25
LBB0_22:
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_23:
	subl	(%rax), %ebx
LBB0_24:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_25:
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	_NAND_DATA_IFACE_CHECK_ONLY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	cmpl	%r14d, (%rax)
	je	LBB0_24
## %bb.26:
	movl	4(%r12), %edi
	movq	%r13, %rsi
	callq	_clk_set_rate
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_24
## %bb.27:
	movq	_NFC_V1_V2_CONFIG1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	callq	_writew
	movl	(%r12), %edi
	movq	_NFC_V2_CONFIG1_ONE_CYCLE@GOTPCREL(%rip), %rax
	andl	(%rax), %r15d
	leaq	L_.str.3(%rip), %rax
	leaq	L_.str.2(%rip), %rcx
	cmoveq	%rax, %rcx
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_dbg
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOTSUPP,4,2                   ## @ENOTSUPP
	.comm	_NFC_V1_V2_CONFIG1,4,2          ## @NFC_V1_V2_CONFIG1
	.comm	_NFC_V2_CONFIG1_ONE_CYCLE,4,2   ## @NFC_V2_CONFIG1_ONE_CYCLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timing out of bounds\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_NAND_DATA_IFACE_CHECK_ONLY,4,2 ## @NAND_DATA_IFACE_CHECK_ONLY
L_.str.1:                               ## @.str.1
	.asciz	"Setting rate to %ldHz, %s mode\n"

L_.str.2:                               ## @.str.2
	.asciz	"One cycle (EDO)"

L_.str.3:                               ## @.str.3
	.asciz	"normal"

	.no_dead_strip	_mxc_nand_v2_setup_data_interface
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mxc_nand_v2_setup_data_interface
_mxc_nand_v2_setup_data_interface:      ; @mxc_nand_v2_setup_data_interface
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x2
	mov	x20, x1
	bl	_nand_get_controller_data
	mov	x19, x0
	mov	x0, x21
	bl	_nand_get_sdr_timings
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ENOTSUPP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOTSUPP@GOTPAGEOFF]
	b	LBB0_21
LBB0_2:
Lloh2:
	adrp	x24, _NFC_V1_V2_CONFIG1@GOTPAGE
Lloh3:
	ldr	x24, [x24, _NFC_V1_V2_CONFIG1@GOTPAGEOFF]
	ldr	w0, [x24]
	bl	_readw
	mov	x23, x0
	ldrsw	x8, [x21]
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	mul	x9, x8, x9
	lsr	x10, x9, #63
	asr	x9, x9, #38
	add	w9, w9, w10
	mov	w10, #51712
	movk	w10, #15258, lsl #16
	sdiv	w9, w10, w9
	sxtw	x22, w9
	mov	w9, #29999
	cmp	w8, w9
	b.gt	LBB0_4
; %bb.3:
	ldr	w0, [x19, #4]
	mov	x1, x22
	bl	_clk_round_rate
Lloh4:
	adrp	x8, _NFC_V2_CONFIG1_ONE_CYCLE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _NFC_V2_CONFIG1_ONE_CYCLE@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	orr	w8, w8, w23
	lsr	x9, x0, #3
	mov	x10, #63439
	movk	x10, #58195, lsl #16
	movk	x10, #39845, lsl #32
	movk	x10, #8388, lsl #48
	umulh	x9, x9, x10
	lsr	x9, x9, #4
	b	LBB0_5
LBB0_4:
	lsl	x22, x22, #1
	ldr	w0, [x19, #4]
	mov	x1, x22
	bl	_clk_round_rate
Lloh7:
	adrp	x8, _NFC_V2_CONFIG1_ONE_CYCLE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _NFC_V2_CONFIG1_ONE_CYCLE@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	bic	w8, w23, w8
	lsr	x9, x0, #4
	mov	x10, #16253
	movk	x10, #24117, lsl #16
	movk	x10, #18874, lsl #32
	movk	x10, #524, lsl #48
	umulh	x9, x9, x10
LBB0_5:
	mov	w10, #51712
	movk	w10, #15258, lsl #16
	udiv	x9, x10, x9
	ldr	w11, [x21, #4]
	sub	w10, w9, #1000
	cmp	w11, w10
	b.gt	LBB0_20
; %bb.6:
	ldr	w12, [x21, #8]
	sub	w11, w9, #2000
	cmp	w12, w11
	b.gt	LBB0_20
; %bb.7:
	ldr	w12, [x21, #12]
	cmp	w12, w10
	b.gt	LBB0_20
; %bb.8:
	ldr	w10, [x21, #16]
	cmp	w10, w11
	b.gt	LBB0_20
; %bb.9:
	ldr	w10, [x21, #20]
	sub	w11, w9, #1500
	cmp	w10, w11
	b.gt	LBB0_20
; %bb.10:
	ldr	w10, [x21, #24]
	cmp	w10, w9
	b.gt	LBB0_20
; %bb.11:
	ldr	w10, [x21, #28]
	sub	w11, w9, #3000
	cmp	w10, w11
	b.gt	LBB0_20
; %bb.12:
	ldr	w10, [x21, #32]
	cmp	w10, w9
	b.gt	LBB0_20
; %bb.13:
	ldr	w10, [x21, #36]
	mov	w11, #-5000
	add	w11, w9, w11
	cmp	w10, w11
	b.gt	LBB0_20
; %bb.14:
	ldr	w11, [x21, #40]
	lsl	w10, w9, #1
	cmp	w11, w10
	b.gt	LBB0_20
; %bb.15:
	ldr	w11, [x21, #44]
	sub	w12, w9, #2500
	cmp	w11, w12
	b.gt	LBB0_20
; %bb.16:
	ldr	w12, [x21, #48]
	add	w11, w9, w9, lsl #1
	cmp	w12, w11, lsl #1
	b.gt	LBB0_20
; %bb.17:
	ldr	w12, [x21, #52]
	cmp	w12, w11, lsr #1
	b.gt	LBB0_20
; %bb.18:
	ldr	w11, [x21]
	cmp	w11, w10
	b.gt	LBB0_20
; %bb.19:
	ldr	w10, [x21, #56]
	lsr	w9, w9, #1
	sub	w9, w9, #2500
	cmp	w10, w9
	b.le	LBB0_23
LBB0_20:
	ldr	w0, [x19]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_21:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_22:
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_23:
	mov	x23, x8
Lloh14:
	adrp	x8, _NAND_DATA_IFACE_CHECK_ONLY@GOTPAGE
Lloh15:
	ldr	x8, [x8, _NAND_DATA_IFACE_CHECK_ONLY@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	cmp	w8, w20
	b.eq	LBB0_26
; %bb.24:
	mov	x21, x0
	ldr	w0, [x19, #4]
	mov	x1, x22
	bl	_clk_set_rate
	cbnz	w0, LBB0_22
; %bb.25:
	ldr	w1, [x24]
	mov	x20, x23
	mov	x0, x23
	bl	_writew
	ldr	w0, [x19]
Lloh17:
	adrp	x8, _NFC_V2_CONFIG1_ONE_CYCLE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _NFC_V2_CONFIG1_ONE_CYCLE@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	adrp	x9, l_.str.2@PAGE
Lloh21:
	add	x9, x9, l_.str.2@PAGEOFF
Lloh22:
	adrp	x10, l_.str.3@PAGE
Lloh23:
	add	x10, x10, l_.str.3@PAGEOFF
	tst	w8, w23
	csel	x8, x10, x9, eq
	stp	x21, x8, [sp]
Lloh24:
	adrp	x1, l_.str.1@PAGE
Lloh25:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
LBB0_26:
	mov	w0, #0
	b	LBB0_22
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOTSUPP,4,2                   ; @ENOTSUPP
	.comm	_NFC_V1_V2_CONFIG1,4,2          ; @NFC_V1_V2_CONFIG1
	.comm	_NFC_V2_CONFIG1_ONE_CYCLE,4,2   ; @NFC_V2_CONFIG1_ONE_CYCLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timing out of bounds\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_NAND_DATA_IFACE_CHECK_ONLY,4,2 ; @NAND_DATA_IFACE_CHECK_ONLY
l_.str.1:                               ; @.str.1
	.asciz	"Setting rate to %ldHz, %s mode\n"

l_.str.2:                               ; @.str.2
	.asciz	"One cycle (EDO)"

l_.str.3:                               ; @.str.3
	.asciz	"normal"

	.no_dead_strip	_mxc_nand_v2_setup_data_interface
.subsections_via_symbols
