	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_i2c_init
_mtk_i2c_init:                          ## @mtk_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movl	8(%rdi), %edi
	callq	_clk_get_rate
	cltd
	idivl	4(%rbx)
                                        ## kill: def $eax killed $eax def $rax
	leal	-1(%rax), %ecx
	cmpl	$100, %eax
	movl	$99, %eax
	cmovgel	%ecx, %eax
	movl	%eax, (%rbx)
	movq	_SM0CTL0_CLK_DIV_MAX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %eax
	cmovgel	%ecx, %eax
	movl	%eax, (%rbx)
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_mtk_i2c_reset                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_SM0CTL0_CLK_DIV_MAX,4,2        ## @SM0CTL0_CLK_DIV_MAX
	.no_dead_strip	_mtk_i2c_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_i2c_init
_mtk_i2c_init:                          ; @mtk_i2c_init
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w0, [x0, #8]
	bl	_clk_get_rate
	ldr	w8, [x19, #4]
	sdiv	w8, w0, w8
	sub	w9, w8, #1
	mov	w10, #99
	cmp	w8, #99
	csel	w8, w9, w10, gt
Lloh0:
	adrp	x9, _SM0CTL0_CLK_DIV_MAX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SM0CTL0_CLK_DIV_MAX@GOTPAGEOFF]
	str	w8, [x19]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	csel	w8, w8, w9, lt
	str	w8, [x19]
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_mtk_i2c_reset
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_SM0CTL0_CLK_DIV_MAX,4,2        ; @SM0CTL0_CLK_DIV_MAX
	.no_dead_strip	_mtk_i2c_init
.subsections_via_symbols
