	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function rcar_i2c_clock_calculate
LCPI0_0:
	.long	100000                          ## 0x186a0
	.long	35                              ## 0x23
	.long	200                             ## 0xc8
	.long	50                              ## 0x32
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_rcar_i2c_clock_calculate:              ## @rcar_i2c_clock_calculate
	.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	%rsi, %rbx
	movq	%rdi, %r13
	callq	_rcar_i2c_priv_to_dev
	movq	%rax, %r14
	movdqu	(%rbx), %xmm1
	pxor	%xmm0, %xmm0
	pcmpeqd	%xmm1, %xmm0
	blendvps	%xmm0, LCPI0_0(%rip), %xmm1
	movups	%xmm1, (%rbx)
	movl	(%r13), %eax
	addl	$-128, %eax
	cmpl	$3, %eax
	jae	LBB0_1
## %bb.4:
	cltq
	leaq	l_switch.table.rcar_i2c_clock_calculate(%rip), %rcx
	movl	(%rcx,%rax,4), %r15d
	movl	8(%r13), %edi
	callq	_clk_get_rate
	movq	%rax, %r8
	movabsq	$-2972493582642298179, %rcx     ## imm = 0xD6BF94D5E57A42BD
	mulq	%rcx
	movq	%rdx, %r12
	shrq	$24, %r12
	movl	%r12d, %eax
	movl	%r15d, %ecx
	shrl	%cl, %eax
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	movq	%r8, %rdx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_3
LBB0_1:
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
LBB0_2:
	xorl	%eax, %eax
	callq	_dev_err
LBB0_3:
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_17:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	%r12d, %ecx
	incl	%ecx
	movq	%r8, %rax
	shrq	$32, %rax
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	je	LBB0_7
## %bb.8:
	movq	%r8, %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %rcx
	jmp	LBB0_9
LBB0_7:
	movl	%r8d, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %ecx
LBB0_9:
	movl	8(%rbx), %eax
	addl	4(%rbx), %eax
	movl	(%rbx), %r15d
	addl	12(%rbx), %eax
	leal	500000(%rcx), %edx
	imulq	$1125899907, %rdx, %rdx         ## imm = 0x431BDE83
	shrq	$50, %rdx
	imull	%eax, %edx
	addl	$500, %edx                      ## imm = 0x1F4
	imulq	$274877907, %rdx, %r8           ## imm = 0x10624DD3
	shrq	$38, %r8
	leal	20(%r8), %esi
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	leal	(%rsi,%r14,8), %edi
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%edi
	cmpl	%r15d, %eax
	jbe	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	leal	(,%r14,8), %edi
	orl	$8, %edi
	addl	%esi, %edi
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%edi
	cmpl	%r15d, %eax
	jbe	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=1
	addl	$2, %r14d
	cmpl	$64, %r14d
	jne	LBB0_10
## %bb.14:
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_2
LBB0_11:
	movl	%eax, %ebx
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	jmp	LBB0_16
LBB0_15:
	movl	%eax, %ebx
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	incl	%r14d
LBB0_16:
	movl	8(%r13), %edi
	callq	_clk_get_rate
	leaq	L_.str.3(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %edx
	movl	%r15d, %ecx
	movq	%rax, %r8
	movq	-56(%rbp), %r9                  ## 8-byte Reload
                                        ## kill: def $r9d killed $r9d killed $r9
	pushq	%r14
	pushq	%r12
	callq	_dev_dbg
	addq	$16, %rsp
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r14d
	orl	%r12d, %r14d
	movl	%r14d, 4(%r13)
	xorl	%ebx, %ebx
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"device type error\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.1:                               ## @.str.1
	.asciz	"Input clock %lu too high\n"

L_.str.2:                               ## @.str.2
	.asciz	"it is impossible to calculate best SCL\n"

L_.str.3:                               ## @.str.3
	.asciz	"clk %d/%d(%lu), round %u, CDF:0x%x, SCGD: 0x%x\n"

	.no_dead_strip	_rcar_i2c_clock_calculate
	.section	__TEXT,__const
	.p2align	2                               ## @switch.table.rcar_i2c_clock_calculate
l_switch.table.rcar_i2c_clock_calculate:
	.long	3                               ## 0x3
	.long	3                               ## 0x3
	.long	2                               ## 0x2

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function rcar_i2c_clock_calculate
lCPI0_0:
	.long	100000                          ; 0x186a0
	.long	35                              ; 0x23
	.long	200                             ; 0xc8
	.long	50                              ; 0x32
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_rcar_i2c_clock_calculate:              ; @rcar_i2c_clock_calculate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x23, x1
	mov	x19, x0
	bl	_rcar_i2c_priv_to_dev
	mov	x20, x0
	ldr	q0, [x23]
	cmeq.4s	v1, v0, #0
Lloh0:
	adrp	x8, lCPI0_0@PAGE
Lloh1:
	ldr	q2, [x8, lCPI0_0@PAGEOFF]
	bit.16b	v0, v2, v1
	str	q0, [x23]
	ldr	w8, [x19]
	sub	w8, w8, #128
	cmp	w8, #3
	b.hs	LBB0_3
; %bb.1:
Lloh2:
	adrp	x9, l_switch.table.rcar_i2c_clock_calculate@PAGE
Lloh3:
	add	x9, x9, l_switch.table.rcar_i2c_clock_calculate@PAGEOFF
	ldr	w26, [x9, w8, sxtw #2]
	ldr	w0, [x19, #8]
	bl	_clk_get_rate
	mov	x8, #17085
	movk	x8, #58746, lsl #16
	movk	x8, #38101, lsl #32
	movk	x8, #54975, lsl #48
	umulh	x8, x0, x8
	lsr	x21, x8, #24
	lsr	w8, w21, w26
	cbz	w8, LBB0_6
; %bb.2:
	str	x0, [sp]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_3:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
LBB0_4:
	mov	x0, x20
	bl	_dev_err
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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
	add	sp, sp, #96
	ret
LBB0_6:
	mov	w22, #0
	add	w8, w21, #1
	udiv	x8, x0, x8
	ldp	w9, w10, [x23, #8]
	ldp	w23, w11, [x23]
	add	w9, w9, w11
	add	w9, w9, w10
	add	w10, w8, #122, lsl #12          ; =499712
	add	w10, w10, #288
	mov	w11, #56963
	movk	w11, #17179, lsl #16
	umull	x10, w10, w11
	lsr	x10, x10, #50
	mul	w9, w9, w10
	add	w9, w9, #500
	mov	w10, #19923
	movk	w10, #4194, lsl #16
	umull	x9, w9, w10
	lsr	x24, x9, #38
	add	w9, w24, #20
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	add	w10, w9, w22, lsl #3
	udiv	w25, w8, w10
	cmp	w25, w23
	b.ls	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	w22, w22, #1
	cmp	w22, #64
	b.ne	LBB0_7
; %bb.9:
Lloh11:
	adrp	x1, l_.str.2@PAGE
Lloh12:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_4
LBB0_10:
	ldr	w0, [x19, #8]
	bl	_clk_get_rate
	mov	x4, x0
Lloh13:
	adrp	x1, l_.str.3@PAGE
Lloh14:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	mov	x2, x25
	mov	x3, x23
	mov	x5, x24
	mov	x6, x21
	mov	x7, x22
	bl	_dev_dbg
	mov	w0, #0
	lsl	w8, w22, w26
	orr	w8, w8, w21
	str	w8, [x19, #4]
	b	LBB0_5
	.loh AdrpLdr	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"device type error\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"Input clock %lu too high\n"

l_.str.2:                               ; @.str.2
	.asciz	"it is impossible to calculate best SCL\n"

l_.str.3:                               ; @.str.3
	.asciz	"clk %d/%d(%lu), round %u, CDF:0x%x, SCGD: 0x%x\n"

	.no_dead_strip	_rcar_i2c_clock_calculate
	.section	__TEXT,__const
	.p2align	2                               ; @switch.table.rcar_i2c_clock_calculate
l_switch.table.rcar_i2c_clock_calculate:
	.long	3                               ; 0x3
	.long	3                               ; 0x3
	.long	2                               ; 0x2

.subsections_via_symbols
