	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rk3x_i2c_v1_calc_timings
_rk3x_i2c_v1_calc_timings:              ## @rk3x_i2c_v1_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	%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
	movq	%rsi, %r15
	movq	%rdi, %r14
	xorl	%edi, %edi
	cmpl	$1000001, (%rsi)                ## imm = 0xF4241
	setge	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	$1000000, (%r15)                ## imm = 0xF4240
	xorl	%edi, %edi
	jmp	LBB0_3
LBB0_1:
	xorl	%edi, %edi
	cmpl	$1000, (%r15)                   ## imm = 0x3E8
	setl	%dil
LBB0_3:
	callq	_WARN_ON
	testq	%rax, %rax
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_4
## %bb.5:
	movl	$1000, (%r15)                   ## imm = 0x3E8
	movl	$1000, %edi                     ## imm = 0x3E8
	jmp	LBB0_6
LBB0_4:
	movl	(%r15), %edi
LBB0_6:
	callq	_rk3x_i2c_get_spec
	movq	%rax, %r12
	movq	%r14, %rdi
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_DIV_ROUND_UP
	movq	%rax, %r13
	movslq	(%r15), %rax
	imulq	$274877907, %rax, %rsi          ## imm = 0x10624DD3
	movq	%rsi, %rax
	shrq	$63, %rax
	sarq	$38, %rsi
	addl	%eax, %esi
	shll	$3, %esi
	movq	%r13, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_DIV_ROUND_UP
	movq	%rax, %r14
	movq	(%r12), %rdi
	addq	8(%r15), %rdi
	imulq	%r13, %rdi
	movl	$8000000, %esi                  ## imm = 0x7A1200
	callq	_DIV_ROUND_UP
	movq	%rax, %rbx
	movq	8(%r12), %rdi
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	addq	16(%r15), %rdi
	imulq	%r13, %rdi
	movl	$8000000, %esi                  ## imm = 0x7A1200
	callq	_DIV_ROUND_UP
	movq	%rax, %r15
	testq	%rbx, %rbx
	movl	$2, %eax
	cmoveq	%rax, %rbx
	testq	%r15, %r15
	cmoveq	%rax, %r15
	leaq	(%r15,%rbx), %rsi
	subq	%rsi, %r14
	jbe	LBB0_8
## %bb.7:
	movq	%r14, %rdi
	imulq	%r15, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_DIV_ROUND_UP
	addq	%rax, %r15
	addq	%r14, %rbx
	subq	%rax, %rbx
LBB0_8:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%r15, (%rax)
	movq	%rbx, 8(%rax)
	imulq	$3000000, %r15, %rdi            ## imm = 0x2DC6C0
	movq	%rax, %r15
	addq	$1000000, %rdi                  ## imm = 0xF4240
	movl	%r13d, %esi
	callq	_DIV_ROUND_UP
	movq	%rax, %rbx
	imulq	$5000000, (%r15), %rdi          ## imm = 0x4C4B40
	addq	$1000000, %rdi                  ## imm = 0xF4240
	movl	%r13d, %esi
	callq	_DIV_ROUND_UP
	cmpq	16(%r12), %rbx
	jae	LBB0_10
## %bb.9:
	movl	$2, %r14d
	cmpq	24(%r12), %rax
	ja	LBB0_16
LBB0_10:
	imulq	$2000000, (%r15), %rdi          ## imm = 0x1E8480
	addq	$1000000, %rdi                  ## imm = 0xF4240
	movl	%r13d, %esi
	callq	_DIV_ROUND_UP
	movq	%rax, %rbx
	imulq	$6000000, (%r15), %rdi          ## imm = 0x5B8D80
	addq	$1000000, %rdi                  ## imm = 0xF4240
	movl	%r13d, %esi
	callq	_DIV_ROUND_UP
	cmpq	16(%r12), %rbx
	jae	LBB0_12
## %bb.11:
	movl	$1, %r14d
	cmpq	24(%r12), %rax
	ja	LBB0_16
LBB0_12:
	imulq	$1000000, (%r15), %rdi          ## imm = 0xF4240
	addq	$1000000, %rdi                  ## imm = 0xF4240
	movl	%r13d, %esi
	callq	_DIV_ROUND_UP
	movq	%rax, %rbx
	imulq	$7000000, (%r15), %rdi          ## imm = 0x6ACFC0
	addq	$1000000, %rdi                  ## imm = 0xF4240
	movl	%r13d, %esi
	callq	_DIV_ROUND_UP
	cmpq	16(%r12), %rbx
	jae	LBB0_15
## %bb.13:
	cmpq	24(%r12), %rax
	jbe	LBB0_15
## %bb.14:
	xorl	%r14d, %r14d
	jmp	LBB0_16
LBB0_15:
	movq	$-1, %r14
LBB0_16:
	movq	32(%r12), %rdi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	addq	8(%rbx), %rdi
	imulq	%r13, %rdi
	addq	$-1000000, %rdi                 ## imm = 0xFFF0BDC0
	imull	$8000000, 8(%r15), %esi         ## imm = 0x7A1200
	callq	_DIV_ROUND_UP
	movq	%rax, %r15
	movq	40(%r12), %rdi
	addq	8(%rbx), %rdi
	imulq	%r13, %rdi
	addq	$-1000000, %rdi                 ## imm = 0xFFF0BDC0
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	imull	$8000000, 8(%rax), %esi         ## imm = 0x7A1200
	callq	_DIV_ROUND_UP
	movq	%rax, %r12
	movq	%r14, %rdi
	callq	_REG_CON_SDA_CFG
	movl	%eax, %r14d
	decq	%r15
	movq	%r15, %rdi
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	callq	_REG_CON_STA_CFG
	movl	%eax, %ebx
	orl	%r14d, %ebx
	decq	%r12
	movq	%r12, %rdi
	callq	_REG_CON_STO_CFG
	orl	%ebx, %eax
	movl	%eax, 16(%r15)
	movdqu	(%r15), %xmm1
	pcmpeqd	%xmm0, %xmm0
	paddq	%xmm1, %xmm0
	movdqu	%xmm0, (%r15)
	movq	%xmm0, %rcx
	xorl	%eax, %eax
	cmpq	$65536, %rcx                    ## imm = 0x10000
	jb	LBB0_18
## %bb.17:
	movq	$65535, (%r15)                  ## imm = 0xFFFF
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_18:
	pextrq	$1, %xmm0, %rcx
	cmpq	$65536, %rcx                    ## imm = 0x10000
	jb	LBB0_20
## %bb.19:
	movq	$65535, 8(%r15)                 ## imm = 0xFFFF
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_20:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_rk3x_i2c_v1_calc_timings
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rk3x_i2c_v1_calc_timings
_rk3x_i2c_v1_calc_timings:              ; @rk3x_i2c_v1_calc_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	x19, x2
	mov	x20, x1
	mov	x22, x0
	mov	w21, #16960
	movk	w21, #15, lsl #16
	ldr	w8, [x1]
	cmp	w8, w21
	cset	w0, gt
	bl	_WARN_ON
	cbz	x0, LBB0_3
; %bb.1:
	mov	w0, #0
	str	w21, [x20]
	bl	_WARN_ON
	cbz	x0, LBB0_4
LBB0_2:
	mov	w0, #1000
	str	w0, [x20]
	b	LBB0_5
LBB0_3:
	ldr	w8, [x20]
	cmp	w8, #1000
	cset	w0, lt
	bl	_WARN_ON
	cbnz	x0, LBB0_2
LBB0_4:
	ldr	w0, [x20]
LBB0_5:
	mov	w25, #4608
	movk	w25, #122, lsl #16
	bl	_rk3x_i2c_get_spec
	mov	x21, x0
	mov	x0, x22
	mov	w1, #1000
	bl	_DIV_ROUND_UP
	mov	x22, x0
	ldrsw	x8, [x20]
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w9
	lsl	w1, w8, #3
	bl	_DIV_ROUND_UP
	mov	x23, x0
	ldr	x8, [x20, #8]
	ldr	x9, [x21]
	add	x8, x9, x8
	mul	x0, x8, x22
	mov	w1, #4608
	movk	w1, #122, lsl #16
	bl	_DIV_ROUND_UP
	mov	x24, x0
	ldr	x8, [x20, #16]
	ldr	x9, [x21, #8]
	add	x8, x9, x8
	mul	x0, x8, x22
	mov	w1, #4608
	movk	w1, #122, lsl #16
	bl	_DIV_ROUND_UP
	mov	w8, #2
	cmp	x24, #0
	csel	x27, x8, x24, eq
	cmp	x0, #0
	csel	x26, x8, x0, eq
	add	x1, x26, x27
	subs	x23, x23, x1
	b.ls	LBB0_7
; %bb.6:
	mul	x0, x23, x26
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_DIV_ROUND_UP
	add	x26, x0, x26
	add	x8, x23, x27
	sub	x27, x8, x0
LBB0_7:
	mov	w24, #16960
	movk	w24, #15, lsl #16
	stp	x26, x27, [x19]
	mov	w8, #50880
	movk	w8, #45, lsl #16
	madd	x0, x26, x8, x24
	mov	x1, x22
	bl	_DIV_ROUND_UP
	mov	x23, x0
	ldr	x8, [x19]
	mov	w9, #19264
	movk	w9, #76, lsl #16
	madd	x0, x8, x9, x24
	mov	x1, x22
	bl	_DIV_ROUND_UP
	ldr	x8, [x21, #16]
	cmp	x23, x8
	b.hs	LBB0_10
; %bb.8:
	ldr	x8, [x21, #24]
	cmp	x0, x8
	b.ls	LBB0_10
; %bb.9:
	mov	w23, #2
	b	LBB0_17
LBB0_10:
	ldr	x8, [x19]
	mov	w9, #33920
	movk	w9, #30, lsl #16
	madd	x0, x8, x9, x24
	mov	x1, x22
	bl	_DIV_ROUND_UP
	mov	x23, x0
	ldr	x8, [x19]
	mov	w9, #36224
	movk	w9, #91, lsl #16
	madd	x0, x8, x9, x24
	mov	x1, x22
	bl	_DIV_ROUND_UP
	ldr	x8, [x21, #16]
	cmp	x23, x8
	b.hs	LBB0_13
; %bb.11:
	ldr	x8, [x21, #24]
	cmp	x0, x8
	b.ls	LBB0_13
; %bb.12:
	mov	w23, #1
	b	LBB0_17
LBB0_13:
	ldr	x8, [x19]
	madd	x0, x8, x24, x24
	mov	x1, x22
	bl	_DIV_ROUND_UP
	mov	x23, x0
	ldr	x8, [x19]
	mov	w9, #53184
	movk	w9, #106, lsl #16
	madd	x0, x8, x9, x24
	mov	x1, x22
	bl	_DIV_ROUND_UP
	ldr	x8, [x21, #16]
	cmp	x23, x8
	b.hs	LBB0_16
; %bb.14:
	ldr	x8, [x21, #24]
	cmp	x0, x8
	b.ls	LBB0_16
; %bb.15:
	mov	x23, #0
	b	LBB0_17
LBB0_16:
	mov	x23, #-1
LBB0_17:
	ldr	x8, [x20, #8]
	ldr	x9, [x21, #32]
	add	x8, x9, x8
	mov	x26, #-16960
	movk	x26, #65520, lsl #16
	madd	x0, x8, x22, x26
	ldr	w8, [x19, #8]
	mul	w1, w8, w25
	bl	_DIV_ROUND_UP
	mov	x24, x0
	ldr	x8, [x20, #8]
	ldr	x9, [x21, #40]
	add	x8, x9, x8
	madd	x0, x8, x22, x26
	ldr	w8, [x19, #8]
	mul	w1, w8, w25
	bl	_DIV_ROUND_UP
	mov	x20, x0
	mov	x0, x23
	bl	_REG_CON_SDA_CFG
	mov	x21, x0
	sub	x0, x24, #1
	bl	_REG_CON_STA_CFG
	orr	w21, w0, w21
	sub	x0, x20, #1
	bl	_REG_CON_STO_CFG
	orr	w8, w21, w0
	str	w8, [x19, #16]
	ldp	x8, x9, [x19]
	sub	x10, x8, #1
	sub	x9, x9, #1
	stp	x10, x9, [x19]
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	cmp	x10, #16, lsl #12               ; =65536
	b.lo	LBB0_19
; %bb.18:
	mov	w10, #65535
	str	x10, [x19]
	ldr	w10, [x8]
	neg	w0, w10
	cmp	x9, #16, lsl #12                ; =65536
	b.hs	LBB0_20
	b	LBB0_21
LBB0_19:
	mov	w0, #0
	cmp	x9, #16, lsl #12                ; =65536
	b.lo	LBB0_21
LBB0_20:
	mov	w9, #65535
	str	x9, [x19, #8]
	ldr	w8, [x8]
	neg	w0, w8
LBB0_21:
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_rk3x_i2c_v1_calc_timings
.subsections_via_symbols
