	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lpi2c_imx_config
_lpi2c_imx_config:                      ## @lpi2c_imx_config
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	callq	_lpi2c_imx_set_mode
	movl	24(%r12), %edi
	callq	_clk_get_rate
	movq	(%r12), %r8
	movq	_HS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %r8
	setne	%dl
	movq	_ULTRA_FAST@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r10
	cmpq	%r10, %r8
	setne	%cl
	andb	%dl, %cl
	movzbl	%cl, %r14d
	movl	8(%r12), %ecx
	movl	%r14d, %edi
	xorl	$-3, %edi
	movq	_I2C_CLK_RATIO@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	leal	1(%rsi), %ebx
	xorl	%r11d, %r11d
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %r15d
	addl	%edi, %r15d
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	leal	(%r15,%rsi), %eax
	xorl	%edx, %edx
	movl	%ebx, %r9d
	divl	%ebx
	movl	%eax, %ebx
	subl	%eax, %r15d
	movl	$0, %eax
	cmpl	$64, %r15d
	jl	LBB0_4
## %bb.1:
	movq	%rcx, %r13
	movl	%edi, %ecx
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	%r10, -56(%rbp)                 ## 8-byte Spill
	movq	%r8, -64(%rbp)                  ## 8-byte Spill
	leal	(%r13,%r13), %edi
	movl	-68(%rbp), %r10d                ## 4-byte Reload
	movl	%r10d, %eax
	xorl	%edx, %edx
	divl	%edi
	movl	%eax, %r15d
	addl	%ecx, %r15d
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	leal	(%r15,%rsi), %eax
	xorl	%edx, %edx
	divl	%r9d
	subl	%eax, %r15d
	cmpl	$64, %r15d
	jge	LBB0_6
## %bb.2:
	movl	%eax, %ebx
	movl	$1, %eax
	jmp	LBB0_3
LBB0_6:
	leal	(,%r13,4), %edi
	movl	%r10d, %eax
	xorl	%edx, %edx
	divl	%edi
	movl	%eax, %r15d
	addl	%ecx, %r15d
	leal	(%r15,%rsi), %eax
	xorl	%edx, %edx
	divl	%r9d
	subl	%eax, %r15d
	cmpl	$64, %r15d
	jge	LBB0_8
## %bb.7:
	movl	%eax, %ebx
	movl	$2, %eax
	jmp	LBB0_3
LBB0_8:
	leal	(,%r13,8), %edi
	movl	%r10d, %eax
	xorl	%edx, %edx
	divl	%edi
	movl	%eax, %r15d
	addl	%ecx, %r15d
	leal	(%r15,%rsi), %eax
	xorl	%edx, %edx
	divl	%r9d
	subl	%eax, %r15d
	cmpl	$64, %r15d
	jge	LBB0_10
## %bb.9:
	movl	%eax, %ebx
	movl	$3, %eax
	jmp	LBB0_3
LBB0_10:
	movl	%r13d, %edi
	shll	$4, %edi
	movl	%r10d, %eax
	xorl	%edx, %edx
	divl	%edi
	movl	%eax, %r15d
	addl	%ecx, %r15d
	leal	(%r15,%rsi), %eax
	xorl	%edx, %edx
	divl	%r9d
	subl	%eax, %r15d
	cmpl	$64, %r15d
	jge	LBB0_12
## %bb.11:
	movl	%eax, %ebx
	movl	$4, %eax
	jmp	LBB0_3
LBB0_12:
	movl	%r13d, %edi
	shll	$5, %edi
	movl	%r10d, %eax
	xorl	%edx, %edx
	divl	%edi
	movl	%eax, %r15d
	addl	%ecx, %r15d
	leal	(%r15,%rsi), %eax
	xorl	%edx, %edx
	divl	%r9d
	subl	%eax, %r15d
	cmpl	$64, %r15d
	jge	LBB0_14
## %bb.13:
	movl	%eax, %ebx
	movl	$5, %eax
	jmp	LBB0_3
LBB0_14:
	movl	%r13d, %edi
	shll	$6, %edi
	movl	%r10d, %eax
	xorl	%edx, %edx
	divl	%edi
	movl	%eax, %r15d
	addl	%ecx, %r15d
	leal	(%r15,%rsi), %eax
	xorl	%edx, %edx
	divl	%r9d
	subl	%eax, %r15d
	cmpl	$64, %r15d
	jge	LBB0_16
## %bb.15:
	movl	%eax, %ebx
	movl	$6, %eax
	jmp	LBB0_3
LBB0_16:
	shll	$7, %r13d
	xorl	%edi, %edi
	movl	%r10d, %eax
	xorl	%edx, %edx
	divl	%r13d
	addl	%eax, %ecx
	addl	%ecx, %esi
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	%r9d
	movl	%ecx, %r15d
	subl	%eax, %r15d
	cmpl	$64, %r15d
	jge	LBB0_18
## %bb.17:
	movl	%eax, %ebx
	movl	$7, %eax
LBB0_3:
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	movq	-56(%rbp), %r10                 ## 8-byte Reload
	xorl	%r11d, %r11d
	movq	-48(%rbp), %r12                 ## 8-byte Reload
LBB0_4:
	addl	%r14d, %r14d
	cmpq	%r10, %r8
	movq	_TWO_PIN_OD@GOTPCREL(%rip), %rcx
	cmoveq	_TWO_PIN_OO@GOTPCREL(%rip), %rcx
	movq	_MCFGR1_IGNACK@GOTPCREL(%rip), %rdx
	cmovel	(%rdx), %r11d
	movl	(%rcx), %edi
	shll	$24, %edi
	orl	%eax, %edi
	orl	%r11d, %edi
	movq	_LPI2C_MCFGR1@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r12), %rsi
	callq	_writel
	imull	$16842752, %r14d, %edi          ## imm = 0x1010000
	movq	_LPI2C_MCFGR2@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r12), %rsi
	callq	_writel
	movl	%ebx, %eax
	andl	$-2, %eax
	shll	$23, %eax
	movl	%ebx, %ecx
	shll	$16, %ecx
	shll	$8, %ebx
	orl	%ecx, %ebx
	orl	%r15d, %ebx
	orl	%eax, %ebx
	movq	(%r12), %rax
	movq	16(%r12), %rsi
	movq	_HS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_19
## %bb.5:
	movq	_LPI2C_MCCR1@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_19:
	movq	_LPI2C_MCCR0@GOTPCREL(%rip), %rax
LBB0_20:
	addq	(%rax), %rsi
	movl	%ebx, %edi
	callq	_writel
	xorl	%edi, %edi
LBB0_21:
	movl	%edi, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %edi
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_HS,8,3                         ## @HS
	.comm	_ULTRA_FAST,8,3                 ## @ULTRA_FAST
	.comm	_I2C_CLK_RATIO,4,2              ## @I2C_CLK_RATIO
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_TWO_PIN_OO,4,2                 ## @TWO_PIN_OO
	.comm	_TWO_PIN_OD,4,2                 ## @TWO_PIN_OD
	.comm	_MCFGR1_IGNACK,4,2              ## @MCFGR1_IGNACK
	.comm	_LPI2C_MCFGR1,8,3               ## @LPI2C_MCFGR1
	.comm	_LPI2C_MCFGR2,8,3               ## @LPI2C_MCFGR2
	.comm	_LPI2C_MCCR1,8,3                ## @LPI2C_MCCR1
	.comm	_LPI2C_MCCR0,8,3                ## @LPI2C_MCCR0
	.no_dead_strip	_lpi2c_imx_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lpi2c_imx_config
_lpi2c_imx_config:                      ; @lpi2c_imx_config
	.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
	bl	_lpi2c_imx_set_mode
	ldr	w0, [x19, #24]
	bl	_clk_get_rate
	ldr	x8, [x19]
Lloh0:
	adrp	x20, _HS@GOTPAGE
Lloh1:
	ldr	x20, [x20, _HS@GOTPAGEOFF]
	ldr	x10, [x20]
Lloh2:
	adrp	x9, _ULTRA_FAST@GOTPAGE
Lloh3:
	ldr	x9, [x9, _ULTRA_FAST@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	mov	w10, #2
	csel	w21, wzr, w10, eq
	ldr	w10, [x19, #8]
	mov	w11, #-3
	sub	w11, w11, w21, lsr #1
Lloh5:
	adrp	x12, _I2C_CLK_RATIO@GOTPAGE
Lloh6:
	ldr	x12, [x12, _I2C_CLK_RATIO@GOTPAGEOFF]
Lloh7:
	ldr	w12, [x12]
	add	w13, w12, #1
	udiv	w14, w0, w10
	add	w14, w11, w14
	add	w15, w14, w12
	udiv	w22, w15, w13
	sub	w23, w14, w22
	cmp	w23, #64
	b.ge	LBB0_2
; %bb.1:
	mov	w10, #0
	b	LBB0_16
LBB0_2:
	lsl	w14, w10, #1
	udiv	w14, w0, w14
	add	w14, w11, w14
	add	w15, w14, w12
	udiv	w22, w15, w13
	sub	w23, w14, w22
	cmp	w23, #64
	b.ge	LBB0_4
; %bb.3:
	mov	w10, #1
	b	LBB0_16
LBB0_4:
	lsl	w14, w10, #2
	udiv	w14, w0, w14
	add	w14, w11, w14
	add	w15, w14, w12
	udiv	w22, w15, w13
	sub	w23, w14, w22
	cmp	w23, #64
	b.ge	LBB0_6
; %bb.5:
	mov	w10, #2
	b	LBB0_16
LBB0_6:
	lsl	w14, w10, #3
	udiv	w14, w0, w14
	add	w14, w11, w14
	add	w15, w14, w12
	udiv	w22, w15, w13
	sub	w23, w14, w22
	cmp	w23, #64
	b.ge	LBB0_8
; %bb.7:
	mov	w10, #3
	b	LBB0_16
LBB0_8:
	lsl	w14, w10, #4
	udiv	w14, w0, w14
	add	w14, w11, w14
	add	w15, w14, w12
	udiv	w22, w15, w13
	sub	w23, w14, w22
	cmp	w23, #64
	b.ge	LBB0_10
; %bb.9:
	mov	w10, #4
	b	LBB0_16
LBB0_10:
	lsl	w14, w10, #5
	udiv	w14, w0, w14
	add	w14, w11, w14
	add	w15, w14, w12
	udiv	w22, w15, w13
	sub	w23, w14, w22
	cmp	w23, #64
	b.ge	LBB0_12
; %bb.11:
	mov	w10, #5
	b	LBB0_16
LBB0_12:
	lsl	w14, w10, #6
	udiv	w14, w0, w14
	add	w14, w11, w14
	add	w15, w14, w12
	udiv	w22, w15, w13
	sub	w23, w14, w22
	cmp	w23, #64
	b.ge	LBB0_14
; %bb.13:
	mov	w10, #6
	b	LBB0_16
LBB0_14:
	lsl	w10, w10, #7
	udiv	w10, w0, w10
	add	w10, w11, w10
	add	w11, w10, w12
	udiv	w22, w11, w13
	sub	w23, w10, w22
	cmp	w23, #64
	b.ge	LBB0_21
; %bb.15:
	mov	w10, #7
LBB0_16:
Lloh8:
	adrp	x11, _TWO_PIN_OO@GOTPAGE
Lloh9:
	ldr	x11, [x11, _TWO_PIN_OO@GOTPAGEOFF]
Lloh10:
	adrp	x12, _TWO_PIN_OD@GOTPAGE
Lloh11:
	ldr	x12, [x12, _TWO_PIN_OD@GOTPAGEOFF]
	cmp	x8, x9
	csel	x8, x11, x12, eq
	ldr	w8, [x8]
	bfi	w10, w8, #24, #8
Lloh12:
	adrp	x8, _MCFGR1_IGNACK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MCFGR1_IGNACK@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	csel	w8, w8, wzr, eq
	orr	w0, w10, w8
	ldr	x8, [x19, #16]
Lloh15:
	adrp	x9, _LPI2C_MCFGR1@GOTPAGE
Lloh16:
	ldr	x9, [x9, _LPI2C_MCFGR1@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	bfi	w21, w21, #8, #2
	lsl	w0, w21, #16
	ldr	x8, [x19, #16]
Lloh18:
	adrp	x9, _LPI2C_MCFGR2@GOTPAGE
Lloh19:
	ldr	x9, [x9, _LPI2C_MCFGR2@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	lsl	w8, w22, #23
	and	w8, w8, #0xff000000
	lsl	w9, w22, #8
	orr	w9, w9, w22, lsl #16
	orr	w9, w9, w23
	orr	w0, w9, w8
	ldr	x9, [x19]
	ldr	x10, [x20]
	ldr	x8, [x19, #16]
	cmp	x9, x10
	b.ne	LBB0_18
; %bb.17:
Lloh21:
	adrp	x9, _LPI2C_MCCR1@GOTPAGE
Lloh22:
	ldr	x9, [x9, _LPI2C_MCCR1@GOTPAGEOFF]
	b	LBB0_19
LBB0_18:
Lloh23:
	adrp	x9, _LPI2C_MCCR0@GOTPAGE
Lloh24:
	ldr	x9, [x9, _LPI2C_MCCR0@GOTPAGEOFF]
LBB0_19:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	mov	w0, #0
LBB0_20:
	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
	ret
LBB0_21:
Lloh25:
	adrp	x8, _EINVAL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_20
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_HS,8,3                         ; @HS
	.comm	_ULTRA_FAST,8,3                 ; @ULTRA_FAST
	.comm	_I2C_CLK_RATIO,4,2              ; @I2C_CLK_RATIO
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_TWO_PIN_OO,4,2                 ; @TWO_PIN_OO
	.comm	_TWO_PIN_OD,4,2                 ; @TWO_PIN_OD
	.comm	_MCFGR1_IGNACK,4,2              ; @MCFGR1_IGNACK
	.comm	_LPI2C_MCFGR1,8,3               ; @LPI2C_MCFGR1
	.comm	_LPI2C_MCFGR2,8,3               ; @LPI2C_MCFGR2
	.comm	_LPI2C_MCCR1,8,3                ; @LPI2C_MCCR1
	.comm	_LPI2C_MCCR0,8,3                ; @LPI2C_MCCR0
	.no_dead_strip	_lpi2c_imx_config
.subsections_via_symbols
