	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dsi_set_lp_clk_divisor
_dsi_set_lp_clk_divisor:                ## @dsi_set_lp_clk_divisor
	.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
	movl	16(%rdi), %r12d
	testq	%r12, %r12
	je	LBB0_2
## %bb.1:
	movq	%rdi, %r14
	movq	24(%rdi), %rax
	cmpl	(%rax), %r12d
	jbe	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_3:
	movq	%r14, %rdi
	callq	_dsi_fclk_rate
	movq	%rax, %r15
	shrq	%rax
	movabsq	$9223372032559808512, %rcx      ## imm = 0x7FFFFFFF00000000
	testq	%rcx, %rax
	je	LBB0_4
## %bb.5:
	xorl	%edx, %edx
	divq	%r12
	movq	%rax, %rbx
	jmp	LBB0_6
LBB0_4:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r12d
	movl	%eax, %ebx
LBB0_6:
	leaq	L_.str(%rip), %rdi
	movl	%r12d, %esi
	movq	%rbx, %rdx
	callq	_DSSDBG
	movq	%rbx, (%r14)
	movl	%r12d, 8(%r14)
	movq	_DSI_CLK_CTRL@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	movl	%r12d, %edx
	movl	$12, %ecx
	xorl	%r8d, %r8d
	callq	_REG_FLD_MOD
	movl	(%r13), %esi
	xorl	%edx, %edx
	cmpq	$30000001, %r15                 ## imm = 0x1C9C381
	setae	%dl
	movq	%r14, %rdi
	movl	$21, %ecx
	movl	$21, %r8d
	callq	_REG_FLD_MOD
LBB0_7:
	movl	%ebx, %eax
	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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"LP_CLK_DIV %u, LP_CLK %lu\n"

	.comm	_DSI_CLK_CTRL,4,2               ## @DSI_CLK_CTRL
	.no_dead_strip	_dsi_set_lp_clk_divisor
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dsi_set_lp_clk_divisor
_dsi_set_lp_clk_divisor:                ; @dsi_set_lp_clk_divisor
	.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
	ldr	w20, [x0, #16]
	cbz	w20, LBB0_2
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #24]
	ldr	w8, [x8]
	cmp	w20, w8
	b.ls	LBB0_3
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_4
LBB0_3:
	mov	x0, x19
	bl	_dsi_fclk_rate
	mov	x21, x0
	lsr	x8, x0, #1
	udiv	x22, x8, x20
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x22
	bl	_DSSDBG
	str	x22, [x19]
	str	w20, [x19, #8]
Lloh5:
	adrp	x22, _DSI_CLK_CTRL@GOTPAGE
Lloh6:
	ldr	x22, [x22, _DSI_CLK_CTRL@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	mov	x2, x20
	mov	w3, #12
	mov	w4, #0
	bl	_REG_FLD_MOD
	ldr	w1, [x22]
	mov	w8, #50048
	movk	w8, #457, lsl #16
	cmp	x21, x8
	cset	w2, hi
	mov	x0, x19
	mov	w3, #21
	mov	w4, #21
	bl	_REG_FLD_MOD
	mov	w0, #0
LBB0_4:
	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 AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"LP_CLK_DIV %u, LP_CLK %lu\n"

	.comm	_DSI_CLK_CTRL,4,2               ; @DSI_CLK_CTRL
	.no_dead_strip	_dsi_set_lp_clk_divisor
.subsections_via_symbols
