	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sh_mobile_i2c_init
_sh_mobile_i2c_init:                    ## @sh_mobile_i2c_init
	.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	%rdi, %rbx
	movl	28(%rdi), %edi
	callq	_clk_get_rate
	cltq
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$38, %rax
	addl	%ecx, %eax
                                        ## kill: def $eax killed $eax killed $rax
	cltd
	idivl	(%rbx)
	movq	8(%rbx), %rdx
	movq	_STANDARD_MODE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	jne	LBB0_2
## %bb.1:
	movl	$47, %esi
	movl	$40, %r14d
	jmp	LBB0_4
LBB0_2:
	movq	_FAST_MODE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	jne	LBB0_5
## %bb.3:
	movl	$13, %esi
	movl	$6, %r14d
LBB0_4:
	movslq	%eax, %r15
	movq	%r15, %rdi
	movl	$3, %edx
	callq	_sh_mobile_i2c_iccl
	movl	%eax, 20(%rbx)
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	$3, %edx
	callq	_sh_mobile_i2c_icch
	movl	%eax, 16(%rbx)
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sh_mobile_i2c_check_timing     ## TAILCALL
LBB0_5:
	movl	24(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STANDARD_MODE,8,3              ## @STANDARD_MODE
	.comm	_FAST_MODE,8,3                  ## @FAST_MODE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unrecognized bus speed %lu Hz\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_sh_mobile_i2c_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sh_mobile_i2c_init
_sh_mobile_i2c_init:                    ; @sh_mobile_i2c_init
	.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, x0
	ldr	w0, [x0, #28]
	bl	_clk_get_rate
	ldr	w8, [x19]
	ldr	x2, [x19, #8]
Lloh0:
	adrp	x9, _STANDARD_MODE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _STANDARD_MODE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x2, x9
	b.ne	LBB0_2
; %bb.1:
	mov	w1, #47
	mov	w20, #40
	b	LBB0_4
LBB0_2:
Lloh3:
	adrp	x9, _FAST_MODE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _FAST_MODE@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x2, x9
	b.ne	LBB0_5
; %bb.3:
	mov	w1, #13
	mov	w20, #6
LBB0_4:
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x9, w0, w9
	lsr	x10, x9, #63
	asr	x9, x9, #38
	add	w9, w9, w10
	sdiv	w8, w9, w8
	sxtw	x21, w8
	mov	x0, x21
	mov	w2, #3
	bl	_sh_mobile_i2c_iccl
	str	w0, [x19, #20]
	mov	x0, x21
	mov	x1, x20
	mov	w2, #3
	bl	_sh_mobile_i2c_icch
	str	w0, [x19, #16]
	mov	x0, x19
	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
	b	_sh_mobile_i2c_check_timing
LBB0_5:
	ldr	w0, [x19, #24]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_STANDARD_MODE,8,3              ; @STANDARD_MODE
	.comm	_FAST_MODE,8,3                  ; @FAST_MODE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unrecognized bus speed %lu Hz\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_sh_mobile_i2c_init
.subsections_via_symbols
