	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sunxi_nfc_setup_data_interface
_sunxi_nfc_setup_data_interface:        ## @sunxi_nfc_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
	subq	$24, %rsp
	.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, %r15d
	callq	_to_sunxi_nand
	movq	%rax, %r12
	movl	20(%rax), %edi
	callq	_to_sunxi_nfc
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_nand_get_sdr_timings
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_ENOTSUPP@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	jmp	LBB0_26
LBB0_2:
	movdqu	(%r13), %xmm0
	movdqu	16(%r13), %xmm1
	pmaxsd	%xmm0, %xmm1
	movl	32(%r13), %eax
	pshufd	$238, %xmm1, %xmm0              ## xmm0 = xmm1[2,3,2,3]
	pmaxsd	%xmm1, %xmm0
	pshufd	$85, %xmm0, %xmm1               ## xmm1 = xmm0[1,1,1,1]
	pmaxsd	%xmm0, %xmm1
	movd	%xmm1, %ecx
	cmpl	%eax, %ecx
	cmovgl	%ecx, %eax
	xorl	%ebx, %ebx
	testl	%eax, %eax
	cmovgl	%eax, %ebx
	movl	36(%r13), %edi
	leal	(%rbx,%rbx,2), %eax
	cmpl	%eax, %edi
	jle	LBB0_4
## %bb.3:
	movl	$3, %esi
	callq	_DIV_ROUND_UP
	movl	%eax, %ebx
LBB0_4:
	movl	40(%r13), %eax
	cmpl	%ebx, %eax
	cmovgl	%eax, %ebx
	movl	44(%r13), %eax
	cmpl	%ebx, %eax
	cmovgl	%eax, %ebx
	movl	48(%r13), %eax
	cmpl	%ebx, %eax
	cmovgl	%eax, %ebx
	movl	52(%r13), %edi
	leal	(%rbx,%rbx), %eax
	cmpl	%eax, %edi
	jle	LBB0_6
## %bb.5:
	movl	$2, %esi
	callq	_DIV_ROUND_UP
	movl	%eax, %ebx
	addl	%eax, %eax
LBB0_6:
	movl	56(%r13), %edi
	cmpl	%eax, %edi
	jle	LBB0_8
## %bb.7:
	movl	$2, %esi
	callq	_DIV_ROUND_UP
	movl	%eax, %ebx
LBB0_8:
	movl	60(%r13), %edi
	leal	(,%rbx,4), %eax
	leal	(%rax,%rax,4), %eax
	cmpl	%eax, %edi
	jle	LBB0_10
## %bb.9:
	movl	$20, %esi
	callq	_DIV_ROUND_UP
	movl	%eax, %ebx
LBB0_10:
	movl	64(%r13), %edi
	movl	%ebx, %eax
	shll	$5, %eax
	cmpl	%eax, %edi
	jle	LBB0_12
## %bb.11:
	movl	$32, %esi
	callq	_DIV_ROUND_UP
	movl	%eax, %ebx
	shll	$5, %eax
LBB0_12:
	movl	68(%r13), %edi
	cmpl	%eax, %edi
	jle	LBB0_14
## %bb.13:
	movl	$32, %esi
	callq	_DIV_ROUND_UP
	movl	%eax, %ebx
LBB0_14:
	movl	72(%r13), %edi
	leal	(,%rbx,4), %eax
	leal	(%rax,%rax,4), %eax
	cmpl	%eax, %edi
	jle	LBB0_16
## %bb.15:
	movl	$20, %esi
	callq	_DIV_ROUND_UP
	movl	%eax, %ebx
LBB0_16:
	movl	76(%r13), %eax
	cmpl	%ebx, %eax
	movl	%r15d, -56(%rbp)                ## 4-byte Spill
	jle	LBB0_18
## %bb.17:
	cmpl	$0, 80(%r13)
	cmovel	%eax, %ebx
LBB0_18:
	movq	_tWB_lut@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	60(%r13), %esi
	movl	%ebx, %edx
	callq	_sunxi_nand_lookup_timing
	movq	%rax, %r15
	testq	%rax, %rax
	js	LBB0_21
## %bb.19:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movl	64(%r13), %edi
	movl	%ebx, %esi
	callq	_DIV_ROUND_UP
	cmpl	$32, %eax
	jl	LBB0_22
## %bb.20:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_24
LBB0_21:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	movl	%r15d, %r12d
	jmp	LBB0_27
LBB0_22:
	movl	%eax, %r14d
	movl	68(%r13), %edi
	movl	%ebx, %esi
	callq	_DIV_ROUND_UP
	cmpl	$32, %eax
	jl	LBB0_28
## %bb.23:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_24:
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_dev_err
LBB0_25:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_26:
	subl	(%rax), %r12d
LBB0_27:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_28:
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	_tRHW_lut@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	72(%r13), %esi
	movl	%ebx, %edx
	callq	_sunxi_nand_lookup_timing
	movq	%rax, %r9
	testq	%rax, %rax
	js	LBB0_33
## %bb.29:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	_NAND_DATA_IFACE_CHECK_ONLY@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	movl	-56(%rbp), %ecx                 ## 4-byte Reload
	cmpl	%ecx, (%rax)
	je	LBB0_27
## %bb.30:
	sarl	$3, %r14d
	movslq	%r14d, %rsi
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	sarl	$3, %eax
	movslq	%eax, %rdx
	movl	$7, %r8d
	movq	%r15, %rdi
	movq	%r9, %rcx
	callq	_NFC_TIMING_CFG
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movl	%eax, 16(%r14)
	movl	%ebx, %edi
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_DIV_ROUND_UP
	movl	%eax, %ecx
	movq	_NSEC_PER_SEC@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	cltd
	idivl	%ecx
	movl	%eax, (%r14)
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	4(%rbx), %edi
	movl	%eax, %esi
	callq	_clk_round_rate
	testq	%rax, %rax
	jle	LBB0_34
## %bb.31:
	movq	%rax, %rcx
	movq	$0, 8(%r14)
	movslq	(%r15), %rax
	movq	%rcx, %rdx
	orq	%rax, %rdx
	shrq	$32, %rdx
	je	LBB0_35
## %bb.32:
	cqto
	idivq	%rcx
	jmp	LBB0_36
LBB0_33:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	movq	%r9, %rbx
	callq	_dev_err
	movl	%ebx, %r12d
	jmp	LBB0_27
LBB0_34:
	movl	(%rbx), %edi
	movl	(%r14), %edx
	leaq	L_.str.4(%rip), %rsi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_25
LBB0_35:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_36:
	cmpl	$15, %eax
	jl	LBB0_38
## %bb.37:
	imull	$1000, %eax, %eax               ## imm = 0x3E8
	cmpl	76(%r13), %eax
	jge	LBB0_27
LBB0_38:
	movq	_NFC_TIMING_CTL_EDO@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, 8(%rcx)
	jmp	LBB0_27
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOTSUPP,4,2                   ## @ENOTSUPP
	.comm	_tWB_lut,4,2                    ## @tWB_lut
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unsupported tWB\n"

L_.str.1:                               ## @.str.1
	.asciz	"unsupported tADL\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"unsupported tWHR\n"

	.comm	_tRHW_lut,4,2                   ## @tRHW_lut
L_.str.3:                               ## @.str.3
	.asciz	"unsupported tRHW\n"

	.comm	_NAND_DATA_IFACE_CHECK_ONLY,4,2 ## @NAND_DATA_IFACE_CHECK_ONLY
	.comm	_NSEC_PER_SEC,4,2               ## @NSEC_PER_SEC
L_.str.4:                               ## @.str.4
	.asciz	"Unable to round clk %lu\n"

	.comm	_NFC_TIMING_CTL_EDO,8,3         ## @NFC_TIMING_CTL_EDO
	.no_dead_strip	_sunxi_nfc_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 sunxi_nfc_setup_data_interface
_sunxi_nfc_setup_data_interface:        ; @sunxi_nfc_setup_data_interface
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x2
	mov	x22, x1
	bl	_to_sunxi_nand
	mov	x19, x0
	ldr	w0, [x0, #20]
	bl	_to_sunxi_nfc
	mov	x21, x0
	mov	x0, x20
	bl	_nand_get_sdr_timings
	mov	x20, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ENOTSUPP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOTSUPP@GOTPAGEOFF]
	b	LBB0_25
LBB0_2:
	ldp	q1, q0, [x20]
	smax.4s	v0, v1, v0
	smaxv.4s	s0, v0
	fmov	w9, s0
	ldp	w10, w8, [x20, #32]
	cmp	w9, w10
	csel	w9, w9, w10, gt
	cmp	w9, #0
	csel	w0, w9, wzr, gt
	add	w9, w0, w0, lsl #1
	cmp	w8, w9
	b.le	LBB0_4
; %bb.3:
	mov	x0, x8
	mov	w1, #3
	bl	_DIV_ROUND_UP
LBB0_4:
	ldp	w8, w9, [x20, #40]
	cmp	w8, w0
	csel	w8, w8, w0, gt
	cmp	w9, w8
	csel	w8, w9, w8, gt
	ldp	w9, w0, [x20, #48]
	cmp	w9, w8
	csel	w23, w9, w8, gt
	lsl	w8, w23, #1
	cmp	w0, w8
	b.le	LBB0_6
; %bb.5:
	mov	w1, #2
	bl	_DIV_ROUND_UP
	mov	x23, x0
	lsl	w8, w0, #1
LBB0_6:
	ldr	w0, [x20, #56]
	cmp	w0, w8
	b.le	LBB0_8
; %bb.7:
	mov	w1, #2
	bl	_DIV_ROUND_UP
	mov	x23, x0
LBB0_8:
	ldr	w0, [x20, #60]
	add	w8, w23, w23, lsl #2
	cmp	w0, w8, lsl #2
	b.le	LBB0_10
; %bb.9:
	mov	w1, #20
	bl	_DIV_ROUND_UP
	mov	x23, x0
LBB0_10:
	ldr	w0, [x20, #64]
	lsl	w8, w23, #5
	cmp	w0, w8
	b.le	LBB0_12
; %bb.11:
	mov	w1, #32
	bl	_DIV_ROUND_UP
	mov	x23, x0
	lsl	w8, w0, #5
LBB0_12:
	ldr	w0, [x20, #68]
	cmp	w0, w8
	b.le	LBB0_14
; %bb.13:
	mov	w1, #32
	bl	_DIV_ROUND_UP
	mov	x23, x0
LBB0_14:
	ldr	w0, [x20, #72]
	add	w8, w23, w23, lsl #2
	cmp	w0, w8, lsl #2
	b.le	LBB0_16
; %bb.15:
	mov	w1, #20
	bl	_DIV_ROUND_UP
	mov	x23, x0
LBB0_16:
	ldr	w8, [x20, #76]
	cmp	w8, w23
	b.le	LBB0_18
; %bb.17:
	ldr	w9, [x20, #80]
	cmp	w9, #0
	csel	w23, w8, w23, eq
LBB0_18:
Lloh2:
	adrp	x8, _tWB_lut@GOTPAGE
Lloh3:
	ldr	x8, [x8, _tWB_lut@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	ldr	w1, [x20, #60]
	mov	x2, x23
	bl	_sunxi_nand_lookup_timing
	mov	x24, x0
	tbnz	x0, #63, LBB0_21
; %bb.19:
	ldr	w0, [x20, #64]
	mov	x1, x23
	bl	_DIV_ROUND_UP
	cmp	w0, #32
	b.lt	LBB0_22
; %bb.20:
	ldr	w0, [x21]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_24
LBB0_21:
	ldr	w0, [x21]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_26
LBB0_22:
	mov	x25, x0
	ldr	w0, [x20, #68]
	mov	x1, x23
	bl	_DIV_ROUND_UP
	cmp	w0, #32
	b.lt	LBB0_27
; %bb.23:
	ldr	w0, [x21]
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_24:
	bl	_dev_err
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_25:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_26:
	mov	x0, x24
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_27:
	mov	x27, x0
Lloh13:
	adrp	x8, _tRHW_lut@GOTPAGE
Lloh14:
	ldr	x8, [x8, _tRHW_lut@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	ldr	w1, [x20, #72]
	mov	x2, x23
	bl	_sunxi_nand_lookup_timing
	mov	x26, x0
	tbnz	x0, #63, LBB0_30
; %bb.28:
Lloh16:
	adrp	x8, _NAND_DATA_IFACE_CHECK_ONLY@GOTPAGE
Lloh17:
	ldr	x8, [x8, _NAND_DATA_IFACE_CHECK_ONLY@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_31
LBB0_29:
	mov	w24, #0
	b	LBB0_26
LBB0_30:
	ldr	w0, [x21]
Lloh19:
	adrp	x1, l_.str.3@PAGE
Lloh20:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
	mov	x24, x26
	b	LBB0_26
LBB0_31:
	sbfx	x1, x25, #3, #29
	sbfx	x2, x27, #3, #29
	mov	x0, x24
	mov	x3, x26
	mov	w4, #7
	bl	_NFC_TIMING_CFG
	str	w0, [x19, #16]
	mov	x0, x23
	mov	w1, #1000
	bl	_DIV_ROUND_UP
Lloh21:
	adrp	x22, _NSEC_PER_SEC@GOTPAGE
Lloh22:
	ldr	x22, [x22, _NSEC_PER_SEC@GOTPAGEOFF]
	ldr	w8, [x22]
	sdiv	w1, w8, w0
	str	w1, [x19]
	ldr	w0, [x21, #4]
	bl	_clk_round_rate
	cmp	x0, #0
	b.le	LBB0_35
; %bb.32:
	str	xzr, [x19, #8]
	ldrsw	x8, [x22]
	sdiv	x8, x8, x0
	cmp	w8, #15
	b.lt	LBB0_34
; %bb.33:
	mov	w9, #1000
	mul	w8, w8, w9
	ldr	w9, [x20, #76]
	cmp	w8, w9
	b.ge	LBB0_29
LBB0_34:
	mov	w24, #0
Lloh23:
	adrp	x8, _NFC_TIMING_CTL_EDO@GOTPAGE
Lloh24:
	ldr	x8, [x8, _NFC_TIMING_CTL_EDO@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	str	x8, [x19, #8]
	b	LBB0_26
LBB0_35:
	ldr	w0, [x21]
	ldr	w8, [x19]
	str	x8, [sp]
Lloh26:
	adrp	x1, l_.str.4@PAGE
Lloh27:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_24
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOTSUPP,4,2                   ; @ENOTSUPP
	.comm	_tWB_lut,4,2                    ; @tWB_lut
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unsupported tWB\n"

l_.str.1:                               ; @.str.1
	.asciz	"unsupported tADL\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"unsupported tWHR\n"

	.comm	_tRHW_lut,4,2                   ; @tRHW_lut
l_.str.3:                               ; @.str.3
	.asciz	"unsupported tRHW\n"

	.comm	_NAND_DATA_IFACE_CHECK_ONLY,4,2 ; @NAND_DATA_IFACE_CHECK_ONLY
	.comm	_NSEC_PER_SEC,4,2               ; @NSEC_PER_SEC
l_.str.4:                               ; @.str.4
	.asciz	"Unable to round clk %lu\n"

	.comm	_NFC_TIMING_CTL_EDO,8,3         ; @NFC_TIMING_CTL_EDO
	.no_dead_strip	_sunxi_nfc_setup_data_interface
.subsections_via_symbols
