	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dw_i3c_clk_cfg
_dw_i3c_clk_cfg:                        ## @dw_i3c_clk_cfg
	.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, %r14
	movl	8(%rdi), %edi
	callq	_clk_get_rate
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movl	$1000000000, %edi               ## imm = 0x3B9ACA00
	movq	%rax, %rsi
	callq	_DIV_ROUND_UP
	movslq	%eax, %rsi
	movq	_I3C_BUS_THIGH_MAX_NS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	callq	_DIV_ROUND_UP
                                        ## kill: def $eax killed $eax def $rax
	leal	-1(%rax), %r13d
	movq	_SCL_I3C_TIMING_CNT_MIN@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	cmpl	%ecx, %eax
	cmovlel	%ecx, %r13d
	movq	_I3C_BUS_TYP_I3C_SCL_RATE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_DIV_ROUND_UP
	movl	%eax, %ebx
	subl	%r13d, %ebx
	movl	(%r12), %eax
	cmpl	%eax, %ebx
	cmovlel	%eax, %ebx
	movl	%r13d, %edi
	callq	_SCL_I3C_TIMING_HCNT
	movl	%eax, %r12d
	movl	%ebx, %edi
	callq	_SCL_I3C_TIMING_LCNT
	orl	%eax, %r12d
	movq	_SCL_I3C_PP_TIMING@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	movl	%r12d, %edi
	callq	_writel
	movq	_DEVICE_CTRL@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	callq	_readl
	movq	_DEV_CTRL_I2C_SLAVE_PRESENT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_4
## %bb.3:
	movl	%ebx, %edi
	callq	_BUS_I3C_MST_FREE
	movq	_BUS_FREE_TIMING@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	(%r14), %rsi
	movl	%eax, %edi
	callq	_writel
LBB0_4:
	movq	_I3C_BUS_TLOW_OD_MIN_NS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_DIV_ROUND_UP
	movl	%eax, %r12d
	movl	%r13d, %edi
	callq	_SCL_I3C_TIMING_HCNT
	movl	%eax, %ebx
	movl	%r12d, %edi
	callq	_SCL_I3C_TIMING_LCNT
	orl	%eax, %ebx
	movq	_SCL_I3C_OD_TIMING@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	movl	%ebx, %edi
	callq	_writel
	movq	_I3C_BUS_SDR1_SCL_RATE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_DIV_ROUND_UP
	subl	%r13d, %eax
	movl	%eax, %edi
	callq	_SCL_EXT_LCNT_1
	movl	%eax, %r12d
	movq	_I3C_BUS_SDR2_SCL_RATE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_DIV_ROUND_UP
	subl	%r13d, %eax
	movl	%eax, %edi
	callq	_SCL_EXT_LCNT_2
	orl	%eax, %r12d
	movq	_I3C_BUS_SDR3_SCL_RATE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_DIV_ROUND_UP
	subl	%r13d, %eax
	movl	%eax, %edi
	callq	_SCL_EXT_LCNT_3
	movl	%eax, %ebx
	movq	_I3C_BUS_SDR4_SCL_RATE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_DIV_ROUND_UP
	subl	%r13d, %eax
	movl	%eax, %edi
	callq	_SCL_EXT_LCNT_4
	orl	%eax, %ebx
	orl	%r12d, %ebx
	movq	_SCL_EXT_LCNT_TIMING@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	movl	%ebx, %edi
	callq	_writel
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_I3C_BUS_THIGH_MAX_NS,8,3       ## @I3C_BUS_THIGH_MAX_NS
	.comm	_SCL_I3C_TIMING_CNT_MIN,4,2     ## @SCL_I3C_TIMING_CNT_MIN
	.comm	_I3C_BUS_TYP_I3C_SCL_RATE,8,3   ## @I3C_BUS_TYP_I3C_SCL_RATE
	.comm	_SCL_I3C_PP_TIMING,8,3          ## @SCL_I3C_PP_TIMING
	.comm	_DEVICE_CTRL,8,3                ## @DEVICE_CTRL
	.comm	_DEV_CTRL_I2C_SLAVE_PRESENT,4,2 ## @DEV_CTRL_I2C_SLAVE_PRESENT
	.comm	_BUS_FREE_TIMING,8,3            ## @BUS_FREE_TIMING
	.comm	_I3C_BUS_TLOW_OD_MIN_NS,8,3     ## @I3C_BUS_TLOW_OD_MIN_NS
	.comm	_SCL_I3C_OD_TIMING,8,3          ## @SCL_I3C_OD_TIMING
	.comm	_I3C_BUS_SDR1_SCL_RATE,8,3      ## @I3C_BUS_SDR1_SCL_RATE
	.comm	_I3C_BUS_SDR2_SCL_RATE,8,3      ## @I3C_BUS_SDR2_SCL_RATE
	.comm	_I3C_BUS_SDR3_SCL_RATE,8,3      ## @I3C_BUS_SDR3_SCL_RATE
	.comm	_I3C_BUS_SDR4_SCL_RATE,8,3      ## @I3C_BUS_SDR4_SCL_RATE
	.comm	_SCL_EXT_LCNT_TIMING,8,3        ## @SCL_EXT_LCNT_TIMING
	.no_dead_strip	_dw_i3c_clk_cfg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dw_i3c_clk_cfg
_dw_i3c_clk_cfg:                        ; @dw_i3c_clk_cfg
	.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	w0, [x0, #8]
	bl	_clk_get_rate
	cbz	x0, LBB0_4
; %bb.1:
	mov	x20, x0
	mov	w0, #51712
	movk	w0, #15258, lsl #16
	mov	x1, x20
	bl	_DIV_ROUND_UP
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x22, w0
Lloh0:
	adrp	x8, _I3C_BUS_THIGH_MAX_NS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I3C_BUS_THIGH_MAX_NS@GOTPAGEOFF]
Lloh2:
	ldr	x0, [x8]
	mov	x1, x22
	bl	_DIV_ROUND_UP
	sub	w8, w0, #1
Lloh3:
	adrp	x23, _SCL_I3C_TIMING_CNT_MIN@GOTPAGE
Lloh4:
	ldr	x23, [x23, _SCL_I3C_TIMING_CNT_MIN@GOTPAGEOFF]
	ldr	w9, [x23]
	cmp	w0, w9
	csel	w21, w8, w9, gt
Lloh5:
	adrp	x8, _I3C_BUS_TYP_I3C_SCL_RATE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _I3C_BUS_TYP_I3C_SCL_RATE@GOTPAGEOFF]
Lloh7:
	ldr	x1, [x8]
	mov	x0, x20
	bl	_DIV_ROUND_UP
	ldr	w8, [x23]
	sub	w9, w0, w21
	cmp	w9, w8
	csel	w23, w9, w8, gt
	mov	x0, x21
	bl	_SCL_I3C_TIMING_HCNT
	mov	x24, x0
	mov	x0, x23
	bl	_SCL_I3C_TIMING_LCNT
	orr	w0, w0, w24
	ldr	x8, [x19]
Lloh8:
	adrp	x9, _SCL_I3C_PP_TIMING@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SCL_I3C_PP_TIMING@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x19]
Lloh11:
	adrp	x9, _DEVICE_CTRL@GOTPAGE
Lloh12:
	ldr	x9, [x9, _DEVICE_CTRL@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
Lloh14:
	adrp	x8, _DEV_CTRL_I2C_SLAVE_PRESENT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _DEV_CTRL_I2C_SLAVE_PRESENT@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	tst	w8, w0
	b.ne	LBB0_3
; %bb.2:
	mov	x0, x23
	bl	_BUS_I3C_MST_FREE
	ldr	x8, [x19]
Lloh17:
	adrp	x9, _BUS_FREE_TIMING@GOTPAGE
Lloh18:
	ldr	x9, [x9, _BUS_FREE_TIMING@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
LBB0_3:
Lloh20:
	adrp	x8, _I3C_BUS_TLOW_OD_MIN_NS@GOTPAGE
Lloh21:
	ldr	x8, [x8, _I3C_BUS_TLOW_OD_MIN_NS@GOTPAGEOFF]
Lloh22:
	ldr	x0, [x8]
	mov	x1, x22
	bl	_DIV_ROUND_UP
	mov	x22, x0
	mov	x0, x21
	bl	_SCL_I3C_TIMING_HCNT
	mov	x23, x0
	mov	x0, x22
	bl	_SCL_I3C_TIMING_LCNT
	orr	w0, w0, w23
	ldr	x8, [x19]
Lloh23:
	adrp	x9, _SCL_I3C_OD_TIMING@GOTPAGE
Lloh24:
	ldr	x9, [x9, _SCL_I3C_OD_TIMING@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
Lloh26:
	adrp	x8, _I3C_BUS_SDR1_SCL_RATE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _I3C_BUS_SDR1_SCL_RATE@GOTPAGEOFF]
Lloh28:
	ldr	x1, [x8]
	mov	x0, x20
	bl	_DIV_ROUND_UP
	sub	w0, w0, w21
	bl	_SCL_EXT_LCNT_1
	mov	x22, x0
Lloh29:
	adrp	x8, _I3C_BUS_SDR2_SCL_RATE@GOTPAGE
Lloh30:
	ldr	x8, [x8, _I3C_BUS_SDR2_SCL_RATE@GOTPAGEOFF]
Lloh31:
	ldr	x1, [x8]
	mov	x0, x20
	bl	_DIV_ROUND_UP
	sub	w0, w0, w21
	bl	_SCL_EXT_LCNT_2
	orr	w22, w0, w22
Lloh32:
	adrp	x8, _I3C_BUS_SDR3_SCL_RATE@GOTPAGE
Lloh33:
	ldr	x8, [x8, _I3C_BUS_SDR3_SCL_RATE@GOTPAGEOFF]
Lloh34:
	ldr	x1, [x8]
	mov	x0, x20
	bl	_DIV_ROUND_UP
	sub	w0, w0, w21
	bl	_SCL_EXT_LCNT_3
	orr	w22, w22, w0
Lloh35:
	adrp	x8, _I3C_BUS_SDR4_SCL_RATE@GOTPAGE
Lloh36:
	ldr	x8, [x8, _I3C_BUS_SDR4_SCL_RATE@GOTPAGEOFF]
Lloh37:
	ldr	x1, [x8]
	mov	x0, x20
	bl	_DIV_ROUND_UP
	sub	w0, w0, w21
	bl	_SCL_EXT_LCNT_4
	orr	w0, w22, w0
	ldr	x8, [x19]
Lloh38:
	adrp	x9, _SCL_EXT_LCNT_TIMING@GOTPAGE
Lloh39:
	ldr	x9, [x9, _SCL_EXT_LCNT_TIMING@GOTPAGEOFF]
Lloh40:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	mov	w0, #0
	b	LBB0_5
LBB0_4:
Lloh41:
	adrp	x8, _EINVAL@GOTPAGE
Lloh42:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh43:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_I3C_BUS_THIGH_MAX_NS,8,3       ; @I3C_BUS_THIGH_MAX_NS
	.comm	_SCL_I3C_TIMING_CNT_MIN,4,2     ; @SCL_I3C_TIMING_CNT_MIN
	.comm	_I3C_BUS_TYP_I3C_SCL_RATE,8,3   ; @I3C_BUS_TYP_I3C_SCL_RATE
	.comm	_SCL_I3C_PP_TIMING,8,3          ; @SCL_I3C_PP_TIMING
	.comm	_DEVICE_CTRL,8,3                ; @DEVICE_CTRL
	.comm	_DEV_CTRL_I2C_SLAVE_PRESENT,4,2 ; @DEV_CTRL_I2C_SLAVE_PRESENT
	.comm	_BUS_FREE_TIMING,8,3            ; @BUS_FREE_TIMING
	.comm	_I3C_BUS_TLOW_OD_MIN_NS,8,3     ; @I3C_BUS_TLOW_OD_MIN_NS
	.comm	_SCL_I3C_OD_TIMING,8,3          ; @SCL_I3C_OD_TIMING
	.comm	_I3C_BUS_SDR1_SCL_RATE,8,3      ; @I3C_BUS_SDR1_SCL_RATE
	.comm	_I3C_BUS_SDR2_SCL_RATE,8,3      ; @I3C_BUS_SDR2_SCL_RATE
	.comm	_I3C_BUS_SDR3_SCL_RATE,8,3      ; @I3C_BUS_SDR3_SCL_RATE
	.comm	_I3C_BUS_SDR4_SCL_RATE,8,3      ; @I3C_BUS_SDR4_SCL_RATE
	.comm	_SCL_EXT_LCNT_TIMING,8,3        ; @SCL_EXT_LCNT_TIMING
	.no_dead_strip	_dw_i3c_clk_cfg
.subsections_via_symbols
