	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxs_i2c_derive_timing
_mxs_i2c_derive_timing:                 ## @mxs_i2c_derive_timing
	.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
	movl	%esi, %ebx
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movq	16(%rdi), %r14
	movl	$24000000, %edi                 ## imm = 0x16E3600
	callq	_DIV_ROUND_UP
	cmpl	$24, %eax
	jg	LBB0_2
## %bb.1:
	movslq	%ebx, %rax
	imulq	$274877907, %rax, %rdx          ## imm = 0x10624DD3
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$38, %rdx
	addl	%eax, %edx
	imull	$1000, %edx, %eax               ## imm = 0x3E8
	movl	%ebx, %ecx
	subl	%eax, %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	movl	$960, %r8d                      ## imm = 0x3C0
	xorl	%r9d, %r9d
	callq	_dev_warn
	movl	$25, %r13d
	jmp	LBB0_4
LBB0_2:
	movl	%eax, %r13d
	cmpl	$1898, %eax                     ## imm = 0x76A
	jb	LBB0_4
## %bb.3:
	movslq	%ebx, %rax
	imulq	$274877907, %rax, %rdx          ## imm = 0x10624DD3
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$38, %rdx
	addl	%eax, %edx
	imull	$1000, %edx, %eax               ## imm = 0x3E8
	movl	%ebx, %ecx
	subl	%eax, %ecx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	movl	$12, %r8d
	movl	$651, %r9d                      ## imm = 0x28B
	callq	_dev_warn
	movl	$1897, %r13d                    ## imm = 0x769
LBB0_4:
	cmpl	$100001, %ebx                   ## imm = 0x186A1
	movl	$13, %ecx
	movl	$47, %edi
	cmovgel	%ecx, %edi
	movl	$19, %ecx
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movl	$87, %r14d
	cmovgel	%ecx, %r14d
	movl	$6, %ecx
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	movl	$40, %ebx
	cmovgel	%ecx, %ebx
	movl	$14400, %r12d                   ## imm = 0x3840
	movl	$112800, %ecx                   ## imm = 0x1B8A0
	cmovll	%ecx, %r12d
	movl	$31200, %edx                    ## imm = 0x79E0
	cmovll	%ecx, %edx
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	imull	%r13d, %edi
	movl	%r14d, %esi
	movl	%r13d, -48(%rbp)                ## 4-byte Spill
	callq	_DIV_ROUND_CLOSEST
	movl	%eax, %r15d
	imull	%r13d, %ebx
	movl	%ebx, %edi
	movl	%r14d, %esi
	callq	_DIV_ROUND_CLOSEST
	movl	%eax, %r14d
	movl	%r12d, %edi
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_DIV_ROUND_UP
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_DIV_ROUND_UP
	movl	%eax, %r12d
	leal	(%r14,%r14,2), %eax
	leal	(%r14,%r14,2), %r13d
	addl	$7, %r13d
	testl	%eax, %eax
	cmovnsl	%eax, %r13d
	sarl	$3, %r13d
	leal	(%r15,%r15,2), %eax
	leal	(%r15,%r15,2), %ebx
	addl	$7, %ebx
	testl	%eax, %eax
	cmovnsl	%eax, %ebx
	sarl	$3, %ebx
	movl	$24000000, %eax                 ## imm = 0x16E3600
	xorl	%edx, %edx
	movl	-48(%rbp), %r8d                 ## 4-byte Reload
	divl	%r8d
	subq	$8, %rsp
	leaq	L_.str.2(%rip), %rsi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	movl	%eax, %ecx
	movl	%r15d, %r9d
	pushq	%r12
	pushq	-64(%rbp)                       ## 8-byte Folded Reload
	pushq	%r13
	pushq	%rbx
	pushq	%r14
	callq	_dev_dbg
	addq	$48, %rsp
	shll	$16, %r14d
	addl	$-458752, %r14d                 ## imm = 0xFFF90000
	orl	%r13d, %r14d
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	%r14d, (%rax)
	shll	$16, %r15d
	addl	$-131072, %r15d                 ## imm = 0xFFFE0000
	orl	%ebx, %r15d
	movl	%r15d, 4(%rax)
	shll	$16, %r12d
	orl	-64(%rbp), %r12d                ## 4-byte Folded Reload
	movl	%r12d, 8(%rax)
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Speed too high (%u.%03u kHz), using %u.%03u kHz\n"

L_.str.1:                               ## @.str.1
	.asciz	"Speed too low (%u.%03u kHz), using %u.%03u kHz\n"

L_.str.2:                               ## @.str.2
	.asciz	"speed=%u(actual %u) divider=%u low=%u high=%u xmit=%u rcv=%u leadin=%u bus_free=%u\n"

	.no_dead_strip	_mxs_i2c_derive_timing
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mxs_i2c_derive_timing
_mxs_i2c_derive_timing:                 ; @mxs_i2c_derive_timing
	.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, x1
	mov	x19, x0
	ldr	x21, [x0, #16]
	mov	w0, #13824
	movk	w0, #366, lsl #16
	bl	_DIV_ROUND_UP
	cmp	w0, #24
	b.gt	LBB0_2
; %bb.1:
	mov	w8, #19923
	movk	w8, #4194, lsl #16
	smull	x8, w20, w8
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w2, w8, w9
	mov	w8, #1000
	msub	w3, w2, w8, w20
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	w4, #960
	mov	w5, #0
	bl	_dev_warn
	mov	w22, #25
	b	LBB0_4
LBB0_2:
	mov	x22, x0
	cmp	w0, #1898
	b.lo	LBB0_4
; %bb.3:
	mov	w8, #19923
	movk	w8, #4194, lsl #16
	smull	x8, w20, w8
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w2, w8, w9
	mov	w8, #1000
	msub	w3, w2, w8, w20
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	mov	w4, #12
	mov	w5, #651
	bl	_dev_warn
	mov	w22, #1897
LBB0_4:
	mov	w8, #34464
	movk	w8, #1, lsl #16
	mov	w9, #47
	mov	w10, #13
	cmp	w20, w8
	csel	w8, w10, w9, gt
	mov	w9, #87
	mov	w10, #19
	csel	w23, w10, w9, gt
	mov	w9, #40
	mov	w10, #6
	csel	w27, w10, w9, gt
	mov	w9, #47264
	movk	w9, #1, lsl #16
	mov	w10, #14400
	csel	w24, w10, w9, gt
	mov	w10, #31200
	csel	w25, w10, w9, gt
	mul	w0, w22, w8
	mov	x1, x23
	bl	_DIV_ROUND_CLOSEST
	mov	x26, x0
	mul	w0, w22, w27
	mov	x1, x23
	bl	_DIV_ROUND_CLOSEST
	mov	x23, x0
	mov	x0, x24
	mov	w1, #1000
	bl	_DIV_ROUND_UP
	mov	x24, x0
	mov	x0, x25
	mov	w1, #1000
	bl	_DIV_ROUND_UP
	mov	x25, x0
	add	w8, w23, w23, lsl #1
	add	w9, w8, #7
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w28, w8, #3
	add	w8, w26, w26, lsl #1
	add	w9, w8, #7
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w27, w8, #3
	mov	w8, #13824
	movk	w8, #366, lsl #16
	udiv	w3, w8, w22
	stp	w24, w0, [sp, #4]
	str	w28, [sp]
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	mov	x2, x20
	mov	x4, x22
	mov	x5, x26
	mov	x6, x23
	mov	x7, x27
	bl	_dev_dbg
	lsl	w8, w23, #16
	sub	w8, w8, #112, lsl #12           ; =458752
	orr	w8, w8, w28
	lsl	w9, w26, #16
	sub	w9, w9, #32, lsl #12            ; =131072
	orr	w9, w9, w27
	stp	w8, w9, [x19]
	orr	w8, w24, w25, lsl #16
	str	w8, [x19, #8]
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Speed too high (%u.%03u kHz), using %u.%03u kHz\n"

l_.str.1:                               ; @.str.1
	.asciz	"Speed too low (%u.%03u kHz), using %u.%03u kHz\n"

l_.str.2:                               ; @.str.2
	.asciz	"speed=%u(actual %u) divider=%u low=%u high=%u xmit=%u rcv=%u leadin=%u bus_free=%u\n"

	.no_dead_strip	_mxs_i2c_derive_timing
.subsections_via_symbols
