	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fsmc_calc_timings
_fsmc_calc_timings:                     ## @fsmc_calc_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movl	(%rdi), %edi
	callq	_clk_get_rate
	movq	%rax, %rcx
	movq	_NSEC_PER_SEC@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rcx, %rdx
	orq	%rax, %rdx
	shrq	$32, %rdx
	je	LBB0_1
## %bb.2:
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %r15
	cmpl	$29999, (%rbx)                  ## imm = 0x752F
	jg	LBB0_5
LBB0_4:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_17
LBB0_1:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %r15d
	cmpl	$29999, (%rbx)                  ## imm = 0x752F
	jle	LBB0_4
LBB0_5:
	movslq	4(%rbx), %rax
	imulq	$274877907, %rax, %rdi          ## imm = 0x10624DD3
	movq	%rdi, %rax
	shrq	$63, %rax
	sarq	$38, %rdi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	movq	%r15, %rsi
	callq	_DIV_ROUND_UP
	decq	%rax
	movq	%rax, (%r14)
	movq	_FSMC_TAR_MASK@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rax, %rcx
	cmovlq	%rcx, %rax
	movq	%rax, (%r14)
	movslq	8(%rbx), %rax
	imulq	$274877907, %rax, %rdi          ## imm = 0x10624DD3
	movq	%rdi, %rax
	shrq	$63, %rax
	sarq	$38, %rdi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	movq	%r15, %rsi
	callq	_DIV_ROUND_UP
	decq	%rax
	movq	_FSMC_TCLR_MASK@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rax, %rcx
	cmovlq	%rcx, %rax
	movq	%rax, 8(%r14)
	movl	12(%rbx), %eax
	subl	16(%rbx), %eax
	cltq
	imulq	$274877907, %rax, %rdi          ## imm = 0x10624DD3
	movq	%rdi, %rax
	shrq	$63, %rax
	sarq	$38, %rdi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	movq	%r15, %rsi
	callq	_DIV_ROUND_UP
	movq	%rax, 40(%r14)
	movdqu	20(%rbx), %xmm0
	movl	36(%rbx), %eax
	movl	40(%rbx), %ecx
	pshufd	$238, %xmm0, %xmm1              ## xmm1 = xmm0[2,3,2,3]
	pmaxsd	%xmm0, %xmm1
	pshufd	$85, %xmm1, %xmm0               ## xmm0 = xmm1[1,1,1,1]
	pmaxsd	%xmm1, %xmm0
	movd	%xmm0, %edx
	cmpl	%eax, %edx
	cmovgl	%edx, %eax
	cmpl	%ecx, %eax
	cmovlel	%ecx, %eax
	cltq
	imulq	$274877907, %rax, %rdi          ## imm = 0x10624DD3
	movq	%rdi, %rax
	shrq	$63, %rax
	sarq	$38, %rdi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	movq	%r15, %rsi
	callq	_DIV_ROUND_UP
	movq	%rax, 16(%r14)
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	_FSMC_THOLD_MASK@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	cmpq	%rcx, %rax
	jg	LBB0_8
	jmp	LBB0_9
LBB0_6:
	movl	$1, %ecx
LBB0_8:
	movq	%rcx, 16(%r14)
LBB0_9:
	movl	16(%rbx), %esi
	movl	44(%rbx), %edi
	callq	_max
	cltq
	imulq	$274877907, %rax, %rdi          ## imm = 0x10624DD3
	movq	%rdi, %rax
	shrq	$63, %rax
	sarq	$38, %rdi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	movq	%r15, %rsi
	callq	_DIV_ROUND_UP
	decq	%rax
	movq	%rax, 24(%r14)
	je	LBB0_10
## %bb.11:
	movq	_FSMC_TWAIT_MASK@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	cmpq	%rcx, %rax
	jg	LBB0_12
	jmp	LBB0_13
LBB0_10:
	movl	$1, %ecx
LBB0_12:
	movq	%rcx, 24(%r14)
LBB0_13:
	movl	12(%rbx), %edi
	movl	48(%rbx), %esi
	subl	16(%rbx), %edi
	subl	52(%rbx), %esi
	callq	_max
	cltq
	imulq	$274877907, %rax, %rdi          ## imm = 0x10624DD3
	movq	%rdi, %rax
	shrq	$63, %rax
	sarq	$38, %rdi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	movq	%r15, %rsi
	callq	_DIV_ROUND_UP
	movq	%rax, %rcx
	decq	%rcx
	movq	%rcx, 32(%r14)
	je	LBB0_14
## %bb.15:
	movq	_FSMC_TSET_MASK@GOTPCREL(%rip), %rax
	movslq	(%rax), %rdx
	xorl	%eax, %eax
	cmpq	%rdx, %rcx
	jle	LBB0_17
## %bb.16:
	movq	%rdx, 32(%r14)
	jmp	LBB0_17
LBB0_14:
	movq	$1, 32(%r14)
	xorl	%eax, %eax
LBB0_17:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NSEC_PER_SEC,8,3               ## @NSEC_PER_SEC
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_FSMC_TAR_MASK,8,3              ## @FSMC_TAR_MASK
	.comm	_FSMC_TCLR_MASK,8,3             ## @FSMC_TCLR_MASK
	.comm	_FSMC_THOLD_MASK,4,2            ## @FSMC_THOLD_MASK
	.comm	_FSMC_TWAIT_MASK,4,2            ## @FSMC_TWAIT_MASK
	.comm	_FSMC_TSET_MASK,4,2             ## @FSMC_TSET_MASK
	.no_dead_strip	_fsmc_calc_timings
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fsmc_calc_timings
_fsmc_calc_timings:                     ; @fsmc_calc_timings
	.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, x2
	mov	x20, x1
	ldr	w0, [x0]
	bl	_clk_get_rate
	ldr	w8, [x20]
	mov	w9, #29999
	cmp	w8, w9
	b.gt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_15
LBB0_2:
Lloh3:
	adrp	x8, _NSEC_PER_SEC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NSEC_PER_SEC@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x8]
	ldrsw	x8, [x20, #4]
	mov	w22, #19923
	movk	w22, #4194, lsl #16
	mul	x8, x8, x22
	lsr	x10, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w10
	udiv	x21, x9, x0
	mov	x0, x8
	mov	x1, x21
	bl	_DIV_ROUND_UP
	sub	x8, x0, #1
	str	x8, [x19]
Lloh6:
	adrp	x9, _FSMC_TAR_MASK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _FSMC_TAR_MASK@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x9, x8
	csel	x8, x9, x8, lt
	str	x8, [x19]
	ldrsw	x8, [x20, #8]
	mul	x8, x8, x22
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w0, w8, w9
	mov	x1, x21
	bl	_DIV_ROUND_UP
Lloh9:
	adrp	x8, _FSMC_TCLR_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _FSMC_TCLR_MASK@GOTPAGEOFF]
	sub	x9, x0, #1
Lloh11:
	ldr	x8, [x8]
	cmp	x8, x9
	csel	x8, x8, x9, lt
	str	x8, [x19, #8]
	ldp	w8, w9, [x20, #12]
	sub	w8, w8, w9
	smull	x8, w8, w22
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w0, w8, w9
	mov	x1, x21
	bl	_DIV_ROUND_UP
	str	x0, [x19, #40]
	ldur	q0, [x20, #20]
	ldp	w8, w9, [x20, #36]
	smaxv.4s	s0, v0
	fmov	w10, s0
	cmp	w10, w8
	csel	w8, w10, w8, gt
	cmp	w8, w9
	csel	w8, w8, w9, gt
	smull	x8, w8, w22
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w0, w8, w9
	mov	x1, x21
	bl	_DIV_ROUND_UP
	str	x0, [x19, #16]
	cbz	x0, LBB0_4
; %bb.3:
Lloh12:
	adrp	x8, _FSMC_THOLD_MASK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _FSMC_THOLD_MASK@GOTPAGEOFF]
Lloh14:
	ldrsw	x8, [x8]
	cmp	x0, x8
	b.gt	LBB0_5
	b	LBB0_6
LBB0_4:
	mov	w8, #1
LBB0_5:
	str	x8, [x19, #16]
LBB0_6:
	ldr	w0, [x20, #44]
	ldr	w1, [x20, #16]
	bl	_max
	mov	w8, #19923
	movk	w8, #4194, lsl #16
	smull	x8, w0, w8
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w0, w8, w9
	mov	x1, x21
	bl	_DIV_ROUND_UP
	subs	x9, x0, #1
	str	x9, [x19, #24]
	b.eq	LBB0_8
; %bb.7:
Lloh15:
	adrp	x8, _FSMC_TWAIT_MASK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _FSMC_TWAIT_MASK@GOTPAGEOFF]
Lloh17:
	ldrsw	x8, [x8]
	cmp	x9, x8
	b.gt	LBB0_9
	b	LBB0_10
LBB0_8:
	mov	w8, #1
LBB0_9:
	str	x8, [x19, #24]
LBB0_10:
	ldp	w8, w9, [x20, #12]
	sub	w0, w8, w9
	ldp	w8, w9, [x20, #48]
	sub	w1, w8, w9
	bl	_max
	mov	w8, #19923
	movk	w8, #4194, lsl #16
	smull	x8, w0, w8
	lsr	x9, x8, #32
	lsr	x8, x8, #63
	add	w0, w8, w9, asr #6
	mov	x1, x21
	bl	_DIV_ROUND_UP
	subs	x8, x0, #1
	str	x8, [x19, #32]
	b.eq	LBB0_13
; %bb.11:
Lloh18:
	adrp	x9, _FSMC_TSET_MASK@GOTPAGE
Lloh19:
	ldr	x9, [x9, _FSMC_TSET_MASK@GOTPAGEOFF]
Lloh20:
	ldrsw	x9, [x9]
	cmp	x8, x9
	b.le	LBB0_14
; %bb.12:
	mov	w0, #0
	str	x9, [x19, #32]
	b	LBB0_15
LBB0_13:
	mov	w0, #0
	mov	w8, #1
	str	x8, [x19, #32]
	b	LBB0_15
LBB0_14:
	mov	w0, #0
LBB0_15:
	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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_NSEC_PER_SEC,8,3               ; @NSEC_PER_SEC
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_FSMC_TAR_MASK,8,3              ; @FSMC_TAR_MASK
	.comm	_FSMC_TCLR_MASK,8,3             ; @FSMC_TCLR_MASK
	.comm	_FSMC_THOLD_MASK,4,2            ; @FSMC_THOLD_MASK
	.comm	_FSMC_TWAIT_MASK,4,2            ; @FSMC_TWAIT_MASK
	.comm	_FSMC_TSET_MASK,4,2             ; @FSMC_TSET_MASK
	.no_dead_strip	_fsmc_calc_timings
.subsections_via_symbols
