	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gpmi_nfc_compute_timings
_gpmi_nfc_compute_timings:              ## @gpmi_nfc_compute_timings
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	(%rdi), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	(%rsi), %eax
	cmpl	$30000, %eax                    ## imm = 0x7530
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	jl	LBB0_2
## %bb.1:
	movl	$22000000, 8(%rdi)              ## imm = 0x14FB180
	movq	_BV_GPMI_CTRL1_WRN_DLY_SEL_4_TO_8NS@GOTPCREL(%rip), %rax
	movl	$22000000, %esi                 ## imm = 0x14FB180
	jmp	LBB0_5
LBB0_2:
	cmpl	$25000, %eax                    ## imm = 0x61A8
	jl	LBB0_4
## %bb.3:
	movl	$80000000, 8(%rdi)              ## imm = 0x4C4B400
	movq	_BV_GPMI_CTRL1_WRN_DLY_SEL_NO_DELAY@GOTPCREL(%rip), %rax
	movl	$80000000, %esi                 ## imm = 0x4C4B400
	jmp	LBB0_5
LBB0_4:
	movl	$100000000, 8(%rdi)             ## imm = 0x5F5E100
	movq	_BV_GPMI_CTRL1_WRN_DLY_SEL_NO_DELAY@GOTPCREL(%rip), %rax
	movl	$100000000, %esi                ## imm = 0x5F5E100
LBB0_5:
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_NSEC_PER_SEC@GOTPCREL(%rip), %rax
	imull	$1000, (%rax), %edi             ## imm = 0x3E8
	callq	_div_u64
	movl	%eax, %r13d
	movq	40(%rbx), %rdi
	movl	%eax, %esi
	callq	_TO_CYCLES
	movq	%rax, %r15
	movq	32(%rbx), %rdi
	movl	%r13d, %esi
	callq	_TO_CYCLES
	movq	%rax, %r12
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	24(%rbx), %rdi
	movl	%r13d, %esi
	callq	_TO_CYCLES
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	8(%rbx), %rdi
	addq	16(%rbx), %rdi
	movl	%r13d, %esi
	callq	_TO_CYCLES
	movq	%rax, %r14
	movl	%r15d, %edi
	callq	_BF_GPMI_TIMING0_ADDRESS_SETUP
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_BF_GPMI_TIMING0_DATA_HOLD
	movl	%eax, %r15d
	orl	-52(%rbp), %r15d                ## 4-byte Folded Reload
	movl	%r12d, %edi
	callq	_BF_GPMI_TIMING0_DATA_SETUP
	orl	%r15d, %eax
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movl	%eax, 12(%r12)
	shll	$12, %r14d
	movl	%r14d, %edi
	callq	_BF_GPMI_TIMING1_BUSY_TIMEOUT
	movl	%eax, 20(%r12)
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	imull	%r13d, %ecx
	movl	4(%rbx), %eax
	subl	%ecx, %eax
	leal	32000(,%rax,8), %r15d
	testl	%r15d, %r15d
	jle	LBB0_6
## %bb.7:
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	cmpl	%r14d, %r13d
	seta	%cl
	movl	%r13d, %ebx
	shrl	%cl, %ebx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_BF_GPMI_CTRL1_WRN_DLY_SEL
	movl	%eax, 16(%r12)
	cmpl	%r15d, %ebx
	ja	LBB0_11
## %bb.8:
	movl	%r13d, %r12d
	xorl	%r13d, %r13d
	movl	%r15d, %eax
	xorl	%edx, %edx
	divl	%ebx
	movl	%eax, %edi
	callq	_BF_GPMI_CTRL1_RDN_DELAY
	movq	_BM_GPMI_CTRL1_DLL_ENABLE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	cmpl	%r14d, %r12d
	jbe	LBB0_10
## %bb.9:
	movq	_BM_GPMI_CTRL1_HALF_PERIOD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
LBB0_10:
	orl	%r13d, %eax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	orl	%eax, 16(%rcx)
	jmp	LBB0_11
LBB0_6:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_BF_GPMI_CTRL1_WRN_DLY_SEL
	movl	%eax, 16(%r12)
LBB0_11:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BV_GPMI_CTRL1_WRN_DLY_SEL_4_TO_8NS,4,2 ## @BV_GPMI_CTRL1_WRN_DLY_SEL_4_TO_8NS
	.comm	_BV_GPMI_CTRL1_WRN_DLY_SEL_NO_DELAY,4,2 ## @BV_GPMI_CTRL1_WRN_DLY_SEL_NO_DELAY
	.comm	_NSEC_PER_SEC,8,3               ## @NSEC_PER_SEC
	.comm	_BM_GPMI_CTRL1_DLL_ENABLE,4,2   ## @BM_GPMI_CTRL1_DLL_ENABLE
	.comm	_BM_GPMI_CTRL1_HALF_PERIOD,4,2  ## @BM_GPMI_CTRL1_HALF_PERIOD
	.no_dead_strip	_gpmi_nfc_compute_timings
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gpmi_nfc_compute_timings
_gpmi_nfc_compute_timings:              ; @gpmi_nfc_compute_timings
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x1
	mov	x19, x0
	ldr	x8, [x0]
	ldr	w27, [x8]
	ldr	w8, [x1]
	mov	w9, #30000
	cmp	w8, w9
	b.lt	LBB0_2
; %bb.1:
	mov	w1, #45440
	movk	w1, #335, lsl #16
	str	w1, [x19, #8]
Lloh0:
	adrp	x8, _BV_GPMI_CTRL1_WRN_DLY_SEL_4_TO_8NS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BV_GPMI_CTRL1_WRN_DLY_SEL_4_TO_8NS@GOTPAGEOFF]
	b	LBB0_6
LBB0_2:
	mov	w9, #25000
	cmp	w8, w9
	b.lt	LBB0_4
; %bb.3:
	mov	w1, #46080
	movk	w1, #1220, lsl #16
	b	LBB0_5
LBB0_4:
	mov	w1, #57600
	movk	w1, #1525, lsl #16
LBB0_5:
	str	w1, [x19, #8]
Lloh2:
	adrp	x8, _BV_GPMI_CTRL1_WRN_DLY_SEL_NO_DELAY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BV_GPMI_CTRL1_WRN_DLY_SEL_NO_DELAY@GOTPAGEOFF]
LBB0_6:
	ldr	w22, [x8]
Lloh4:
	adrp	x8, _NSEC_PER_SEC@GOTPAGE
Lloh5:
	ldr	x8, [x8, _NSEC_PER_SEC@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	mov	w9, #1000
	mul	w0, w8, w9
	bl	_div_u64
	mov	x21, x0
	ldr	x0, [x20, #40]
	mov	x1, x21
	bl	_TO_CYCLES
	mov	x23, x0
	ldr	x0, [x20, #32]
	mov	x1, x21
	bl	_TO_CYCLES
	mov	x24, x0
	ldr	x0, [x20, #24]
	mov	x1, x21
	bl	_TO_CYCLES
	mov	x25, x0
	ldp	x9, x8, [x20, #8]
	add	x0, x9, x8
	mov	x1, x21
	bl	_TO_CYCLES
	mov	x26, x0
	mov	x0, x23
	bl	_BF_GPMI_TIMING0_ADDRESS_SETUP
	mov	x23, x0
	mov	x0, x25
	bl	_BF_GPMI_TIMING0_DATA_HOLD
	orr	w23, w0, w23
	mov	x0, x24
	bl	_BF_GPMI_TIMING0_DATA_SETUP
	orr	w8, w23, w0
	str	w8, [x19, #12]
	lsl	w0, w26, #12
	bl	_BF_GPMI_TIMING1_BUSY_TIMEOUT
	str	w0, [x19, #20]
	ldr	w8, [x20, #4]
	msub	w8, w21, w24, w8
	mov	w9, #32000
	add	w20, w9, w8, lsl #3
	cmp	w20, #0
	b.le	LBB0_9
; %bb.7:
	cmp	w21, w27
	cset	w8, hi
	lsr	w23, w21, w8
	mov	x0, x22
	bl	_BF_GPMI_CTRL1_WRN_DLY_SEL
	str	w0, [x19, #16]
	cmp	w23, w20
	b.hi	LBB0_10
; %bb.8:
	udiv	w0, w20, w23
	bl	_BF_GPMI_CTRL1_RDN_DELAY
Lloh7:
	adrp	x8, _BM_GPMI_CTRL1_DLL_ENABLE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _BM_GPMI_CTRL1_DLL_ENABLE@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	orr	w8, w8, w0
Lloh10:
	adrp	x9, _BM_GPMI_CTRL1_HALF_PERIOD@GOTPAGE
Lloh11:
	ldr	x9, [x9, _BM_GPMI_CTRL1_HALF_PERIOD@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	cmp	w21, w27
	csel	w9, w9, wzr, hi
	orr	w8, w8, w9
	ldr	w9, [x19, #16]
	orr	w8, w8, w9
	str	w8, [x19, #16]
	b	LBB0_10
LBB0_9:
	mov	x0, x22
	bl	_BF_GPMI_CTRL1_WRN_DLY_SEL
	str	w0, [x19, #16]
LBB0_10:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_BV_GPMI_CTRL1_WRN_DLY_SEL_4_TO_8NS,4,2 ; @BV_GPMI_CTRL1_WRN_DLY_SEL_4_TO_8NS
	.comm	_BV_GPMI_CTRL1_WRN_DLY_SEL_NO_DELAY,4,2 ; @BV_GPMI_CTRL1_WRN_DLY_SEL_NO_DELAY
	.comm	_NSEC_PER_SEC,8,3               ; @NSEC_PER_SEC
	.comm	_BM_GPMI_CTRL1_DLL_ENABLE,4,2   ; @BM_GPMI_CTRL1_DLL_ENABLE
	.comm	_BM_GPMI_CTRL1_HALF_PERIOD,4,2  ; @BM_GPMI_CTRL1_HALF_PERIOD
	.no_dead_strip	_gpmi_nfc_compute_timings
.subsections_via_symbols
