	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setup_i2c_controller
_setup_i2c_controller:                  ## @setup_i2c_controller
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	_I2C_CR@GOTPCREL(%rip), %r12
	movq	(%r12), %rsi
	addq	16(%rdi), %rsi
	xorl	%edi, %edi
	callq	_writel
	movq	_I2C_HSMCR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r15), %rsi
	xorl	%edi, %edi
	callq	_writel
	movq	_I2C_TFTR@GOTPCREL(%rip), %r13
	movq	(%r13), %rsi
	addq	16(%r15), %rsi
	xorl	%edi, %edi
	callq	_writel
	movq	_I2C_RFTR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r15), %rsi
	xorl	%edi, %edi
	callq	_writel
	movq	_I2C_DMAR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r15), %rsi
	xorl	%edi, %edi
	callq	_writel
	movl	32(%r15), %edi
	callq	_clk_get_rate
	movl	%eax, %r14d
	movl	$1000000000, %edi               ## imm = 0x3B9ACA00
	movl	%eax, %esi
	callq	_DIV_ROUND_UP_ULL
	movl	$-129, %ecx
	addl	(%r15), %ecx
	movl	$250, %edi
	cmpl	$2, %ecx
	ja	LBB0_2
## %bb.1:
	movslq	%ecx, %rcx
	leaq	l_switch.table.setup_i2c_controller(%rip), %rdx
	movl	(%rdx,%rcx,4), %edi
LBB0_2:
	movl	%eax, %esi
	callq	_DIV_ROUND_UP
                                        ## kill: def $eax killed $eax def $rax
	leal	1(%rax), %ebx
	movq	24(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_dbg
	shll	$16, %ebx
	movq	_I2C_SCR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r15), %rsi
	movl	%ebx, %edi
	callq	_writel
	movl	4(%r15), %eax
	xorl	%ecx, %ecx
	cmpl	$100001, %eax                   ## imm = 0x186A1
	setge	%cl
	orl	$2, %ecx
	imull	%eax, %ecx
	movl	%r14d, %eax
	cltd
	idivl	%ecx
	movzwl	%ax, %edi
	movq	_I2C_BRCR@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rsi
	addq	16(%r15), %rsi
	callq	_writel
	movl	(%r15), %edi
	cmpl	$132, %edi
	jl	LBB0_4
## %bb.3:
	movq	24(%r15), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movslq	%r14d, %rax
	imulq	$351843721, %rax, %rax          ## imm = 0x14F8B589
	movq	%rax, %rcx
	shrq	$63, %rcx
	shrq	$46, %rax
	addl	%ecx, %eax
	movzwl	%ax, %edi
	movq	(%rbx), %rsi
	addq	16(%r15), %rsi
	callq	_writel
	movq	(%r12), %rsi
	addq	16(%r15), %rsi
	movl	$2048, %edi                     ## imm = 0x800
	callq	_writel
	movl	(%r15), %edi
LBB0_4:
	shll	$4, %edi
	movq	(%r12), %rsi
	addq	16(%r15), %rsi
	callq	_writel
	movl	8(%r15), %edi
	movq	(%r13), %rsi
	addq	16(%r15), %rsi
	callq	_writel
	movl	12(%r15), %edi
	movq	_I2C_RFTR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r15), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_writel                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_CR,8,3                     ## @I2C_CR
	.comm	_I2C_HSMCR,8,3                  ## @I2C_HSMCR
	.comm	_I2C_TFTR,8,3                   ## @I2C_TFTR
	.comm	_I2C_RFTR,8,3                   ## @I2C_RFTR
	.comm	_I2C_DMAR,8,3                   ## @I2C_DMAR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"calculated SLSU = %04x\n"

	.comm	_I2C_SCR,8,3                    ## @I2C_SCR
	.comm	_I2C_BRCR,8,3                   ## @I2C_BRCR
L_.str.1:                               ## @.str.1
	.asciz	"do not support this mode defaulting to std. mode\n"

	.no_dead_strip	_setup_i2c_controller
	.section	__TEXT,__const
	.p2align	2                               ## @switch.table.setup_i2c_controller
l_switch.table.setup_i2c_controller:
	.long	10                              ## 0xa
	.long	100                             ## 0x64
	.long	100                             ## 0x64

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setup_i2c_controller
_setup_i2c_controller:                  ; @setup_i2c_controller
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	x8, [x0, #16]
Lloh0:
	adrp	x22, _I2C_CR@GOTPAGE
Lloh1:
	ldr	x22, [x22, _I2C_CR@GOTPAGEOFF]
	ldr	x9, [x22]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writel
	ldr	x8, [x19, #16]
Lloh2:
	adrp	x9, _I2C_HSMCR@GOTPAGE
Lloh3:
	ldr	x9, [x9, _I2C_HSMCR@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writel
	ldr	x8, [x19, #16]
Lloh5:
	adrp	x23, _I2C_TFTR@GOTPAGE
Lloh6:
	ldr	x23, [x23, _I2C_TFTR@GOTPAGEOFF]
	ldr	x9, [x23]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writel
	ldr	x8, [x19, #16]
Lloh7:
	adrp	x24, _I2C_RFTR@GOTPAGE
Lloh8:
	ldr	x24, [x24, _I2C_RFTR@GOTPAGEOFF]
	ldr	x9, [x24]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writel
	ldr	x8, [x19, #16]
Lloh9:
	adrp	x9, _I2C_DMAR@GOTPAGE
Lloh10:
	ldr	x9, [x9, _I2C_DMAR@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writel
	ldr	w0, [x19, #32]
	bl	_clk_get_rate
	mov	x20, x0
	mov	w0, #51712
	movk	w0, #15258, lsl #16
	mov	x1, x20
	bl	_DIV_ROUND_UP_ULL
	mov	x1, x0
	ldr	w8, [x19]
	sub	w8, w8, #129
	cmp	w8, #2
	b.hi	LBB0_2
; %bb.1:
Lloh12:
	adrp	x9, l_switch.table.setup_i2c_controller@PAGE
Lloh13:
	add	x9, x9, l_switch.table.setup_i2c_controller@PAGEOFF
	ldr	w0, [x9, w8, sxtw #2]
	b	LBB0_3
LBB0_2:
	mov	w0, #250
LBB0_3:
	bl	_DIV_ROUND_UP
	add	w21, w0, #1
	ldr	x0, [x19, #24]
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_dbg
	lsl	w0, w21, #16
	ldr	x8, [x19, #16]
Lloh16:
	adrp	x9, _I2C_SCR@GOTPAGE
Lloh17:
	ldr	x9, [x9, _I2C_SCR@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	w8, [x19, #4]
	mov	w9, #34464
	movk	w9, #1, lsl #16
	cmp	w8, w9
	mov	w9, #2
	cinc	w9, w9, gt
	mul	w8, w9, w8
	sdiv	w8, w20, w8
	and	w0, w8, #0xffff
	ldr	x8, [x19, #16]
Lloh19:
	adrp	x21, _I2C_BRCR@GOTPAGE
Lloh20:
	ldr	x21, [x21, _I2C_BRCR@GOTPAGEOFF]
	ldr	x9, [x21]
	add	x1, x9, x8
	bl	_writel
	ldr	w8, [x19]
	cmp	w8, #132
	b.lt	LBB0_5
; %bb.4:
	ldr	x0, [x19, #24]
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	mov	w8, #46473
	movk	w8, #5368, lsl #16
	smull	x8, w20, w8
	lsr	x9, x8, #63
	lsr	x8, x8, #46
	add	w8, w8, w9
	and	w0, w8, #0xffff
	ldr	x8, [x19, #16]
	ldr	x9, [x21]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x19, #16]
	ldr	x9, [x22]
	add	x1, x9, x8
	mov	w0, #2048
	bl	_writel
	ldr	w8, [x19]
LBB0_5:
	lsl	w0, w8, #4
	ldr	x8, [x19, #16]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_writel
	ldr	w0, [x19, #8]
	ldr	x8, [x19, #16]
	ldr	x9, [x23]
	add	x1, x9, x8
	bl	_writel
	ldr	w0, [x19, #12]
	ldr	x8, [x19, #16]
	ldr	x9, [x24]
	add	x1, x9, x8
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_writel
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_CR,8,3                     ; @I2C_CR
	.comm	_I2C_HSMCR,8,3                  ; @I2C_HSMCR
	.comm	_I2C_TFTR,8,3                   ; @I2C_TFTR
	.comm	_I2C_RFTR,8,3                   ; @I2C_RFTR
	.comm	_I2C_DMAR,8,3                   ; @I2C_DMAR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"calculated SLSU = %04x\n"

	.comm	_I2C_SCR,8,3                    ; @I2C_SCR
	.comm	_I2C_BRCR,8,3                   ; @I2C_BRCR
l_.str.1:                               ; @.str.1
	.asciz	"do not support this mode defaulting to std. mode\n"

	.no_dead_strip	_setup_i2c_controller
	.section	__TEXT,__const
	.p2align	2                               ; @switch.table.setup_i2c_controller
l_switch.table.setup_i2c_controller:
	.long	10                              ; 0xa
	.long	100                             ; 0x64
	.long	100                             ; 0x64

.subsections_via_symbols
