	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_clock_rate
_set_clock_rate:                        ## @set_clock_rate
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	movq	_clk_mgt_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock_irqsave
	movq	_PRCM_SEM@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	callq	_readl
	movq	_PRCM_SEM_PRCM_SEM@GOTPCREL(%rip), %rbx
	testl	%eax, (%rbx)
	je	LBB0_3
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_cpu_relax
	movq	(%r14), %rdi
	callq	_readl
	testl	%eax, (%rbx)
	jne	LBB0_1
LBB0_3:
	movq	_prcmu_base@GOTPCREL(%rip), %rcx
	movq	_clk_mgt@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	shlq	$5, %r15
	movq	8(%rax,%r15), %rdi
	addq	(%rcx), %rdi
	callq	_readl
	movl	%eax, %r12d
	movq	(%rbx), %rax
	movl	(%rax,%r15), %edi
	orl	%r12d, %edi
	movl	24(%rax,%r15), %esi
	callq	_clock_source_rate
	movq	%rax, %r13
	movq	%rax, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_clock_divider
	movq	_PRCM_CLK_MGT_CLK38@GOTPCREL(%rip), %rcx
	testl	%r12d, (%rcx)
	je	LBB0_9
## %bb.4:
	movq	_clk_mgt@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rcx
	cmpq	$0, 16(%rcx,%r15)
	je	LBB0_5
## %bb.6:
	movq	_PRCM_CLK_MGT_CLK38DIV@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	cmpl	$2, %eax
	jl	LBB0_8
## %bb.7:
	orl	%r12d, %edi
	jmp	LBB0_17
LBB0_9:
	movq	_PRCMU_SGACLK@GOTPCREL(%rip), %rdx
	movq	_PRCM_CLK_MGT_CLKPLLDIV_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	cmpq	%rsi, (%rdx)
	jne	LBB0_16
## %bb.10:
	movq	_PRCM_SGACLK_MGT_SGACLKDIV_BY_2_5_EN@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	notl	%ecx
	andl	%ecx, %r12d
	cmpl	$3, %eax
	jne	LBB0_11
## %bb.12:
	addq	%r13, %r13
	leaq	(,%r13,4), %rbx
	addq	%r13, %rbx
	movq	%rbx, %rdi
	movl	$25, %esi
	callq	_do_div
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	cmpq	-48(%rbp), %rbx                 ## 8-byte Folded Reload
	seta	%al
	ja	LBB0_14
## %bb.13:
	movq	_PRCM_SGACLK_MGT_SGACLKDIV_BY_2_5_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_14:
	leal	(%rax,%rax,2), %eax
	orl	%ecx, %r12d
	movq	_prcmu_base@GOTPCREL(%rip), %r13
	movq	_clk_mgt@GOTPCREL(%rip), %rbx
	jmp	LBB0_15
LBB0_5:
	movl	%r12d, %edi
	jmp	LBB0_17
LBB0_8:
	notl	%edi
	andl	%r12d, %edi
	jmp	LBB0_17
LBB0_16:
	notl	%ecx
	andl	%ecx, %r12d
	movl	%eax, %edi
	movl	$31, %esi
	callq	_min
	movl	%eax, %edi
	orl	%r12d, %edi
	movq	_clk_mgt@GOTPCREL(%rip), %rbx
LBB0_17:
	movq	_prcmu_base@GOTPCREL(%rip), %r13
LBB0_18:
	movq	(%rbx), %rax
	movq	8(%rax,%r15), %rsi
	addq	(%r13), %rsi
	callq	_writel
	movq	(%r14), %rsi
	xorl	%edi, %edi
	callq	_writel
	movq	_clk_mgt_lock@GOTPCREL(%rip), %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
LBB0_11:
	movq	_clk_mgt@GOTPCREL(%rip), %rbx
	movq	_prcmu_base@GOTPCREL(%rip), %r13
LBB0_15:
	movl	%eax, %edi
	movl	$31, %esi
	callq	_min
	movl	%eax, %edi
	orl	%r12d, %edi
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_clk_mgt_lock,4,2               ## @clk_mgt_lock
	.comm	_PRCM_SEM,8,3                   ## @PRCM_SEM
	.comm	_PRCM_SEM_PRCM_SEM,4,2          ## @PRCM_SEM_PRCM_SEM
	.comm	_prcmu_base,8,3                 ## @prcmu_base
	.comm	_clk_mgt,8,3                    ## @clk_mgt
	.comm	_PRCM_CLK_MGT_CLK38,4,2         ## @PRCM_CLK_MGT_CLK38
	.comm	_PRCM_CLK_MGT_CLK38DIV,4,2      ## @PRCM_CLK_MGT_CLK38DIV
	.comm	_PRCMU_SGACLK,8,3               ## @PRCMU_SGACLK
	.comm	_PRCM_CLK_MGT_CLKPLLDIV_MASK,4,2 ## @PRCM_CLK_MGT_CLKPLLDIV_MASK
	.comm	_PRCM_SGACLK_MGT_SGACLKDIV_BY_2_5_EN,4,2 ## @PRCM_SGACLK_MGT_SGACLKDIV_BY_2_5_EN
	.no_dead_strip	_set_clock_rate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_clock_rate
_set_clock_rate:                        ; @set_clock_rate
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x0, _clk_mgt_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _clk_mgt_lock@GOTPAGEOFF]
	bl	_spin_lock_irqsave
Lloh2:
	adrp	x23, _PRCM_SEM@GOTPAGE
Lloh3:
	ldr	x23, [x23, _PRCM_SEM@GOTPAGEOFF]
	ldr	x0, [x23]
	bl	_readl
Lloh4:
	adrp	x21, _PRCM_SEM_PRCM_SEM@GOTPAGE
Lloh5:
	ldr	x21, [x21, _PRCM_SEM_PRCM_SEM@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x21]
	tst	w8, w0
	b.eq	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	bl	_cpu_relax
	ldr	x0, [x23]
	bl	_readl
	b	LBB0_1
LBB0_3:
Lloh6:
	adrp	x24, _prcmu_base@GOTPAGE
Lloh7:
	ldr	x24, [x24, _prcmu_base@GOTPAGEOFF]
Lloh8:
	adrp	x25, _clk_mgt@GOTPAGE
Lloh9:
	ldr	x25, [x25, _clk_mgt@GOTPAGEOFF]
	ldr	x8, [x24]
	ldr	x9, [x25]
	lsl	x22, x19, #5
	add	x9, x9, x22
	ldr	x9, [x9, #8]
	add	x0, x9, x8
	bl	_readl
	mov	x21, x0
	ldr	x8, [x25]
	add	x8, x8, x22
	ldr	w9, [x8]
	orr	w0, w9, w0
	ldr	w1, [x8, #24]
	bl	_clock_source_rate
	mov	x22, x0
	mov	x1, x20
	bl	_clock_divider
Lloh10:
	adrp	x8, _PRCM_CLK_MGT_CLK38@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PRCM_CLK_MGT_CLK38@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_6
; %bb.4:
	ldr	x8, [x25]
	add	x8, x8, x19, lsl #5
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_11
; %bb.5:
Lloh13:
	adrp	x8, _PRCM_CLK_MGT_CLK38DIV@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PRCM_CLK_MGT_CLK38DIV@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	bic	w9, w21, w8
	orr	w8, w8, w21
	cmp	w0, #2
	csel	w21, w9, w8, lt
	b	LBB0_11
LBB0_6:
Lloh16:
	adrp	x8, _PRCMU_SGACLK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PRCMU_SGACLK@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x8]
Lloh19:
	adrp	x8, _PRCM_CLK_MGT_CLKPLLDIV_MASK@GOTPAGE
Lloh20:
	ldr	x8, [x8, _PRCM_CLK_MGT_CLKPLLDIV_MASK@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	cmp	x9, x19
	b.ne	LBB0_10
; %bb.7:
Lloh22:
	adrp	x27, _PRCM_SGACLK_MGT_SGACLKDIV_BY_2_5_EN@GOTPAGE
Lloh23:
	ldr	x27, [x27, _PRCM_SGACLK_MGT_SGACLKDIV_BY_2_5_EN@GOTPAGEOFF]
	ldr	w9, [x27]
	orr	w8, w9, w8
	bic	w26, w21, w8
	cmp	w0, #3
	b.ne	LBB0_9
; %bb.8:
	add	x8, x22, x22, lsl #2
	lsl	x21, x8, #1
	mov	x0, x21
	mov	w1, #25
	bl	_do_div
	ldr	w8, [x27]
	cmp	x21, x20
	mov	w9, #3
	csel	w0, w9, wzr, hi
	csel	w8, wzr, w8, hi
	orr	w26, w8, w26
LBB0_9:
	mov	w1, #31
	bl	_min
	orr	w21, w0, w26
	b	LBB0_11
LBB0_10:
	bic	w20, w21, w8
	mov	w1, #31
	bl	_min
	orr	w21, w20, w0
LBB0_11:
	ldr	x8, [x24]
	ldr	x9, [x25]
	add	x9, x9, x19, lsl #5
	ldr	x9, [x9, #8]
	add	x1, x9, x8
	mov	x0, x21
	bl	_writel
	ldr	x1, [x23]
	mov	w0, #0
	bl	_writel
Lloh24:
	adrp	x0, _clk_mgt_lock@GOTPAGE
Lloh25:
	ldr	x0, [x0, _clk_mgt_lock@GOTPAGEOFF]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_spin_unlock_irqrestore
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_clk_mgt_lock,4,2               ; @clk_mgt_lock
	.comm	_PRCM_SEM,8,3                   ; @PRCM_SEM
	.comm	_PRCM_SEM_PRCM_SEM,4,2          ; @PRCM_SEM_PRCM_SEM
	.comm	_prcmu_base,8,3                 ; @prcmu_base
	.comm	_clk_mgt,8,3                    ; @clk_mgt
	.comm	_PRCM_CLK_MGT_CLK38,4,2         ; @PRCM_CLK_MGT_CLK38
	.comm	_PRCM_CLK_MGT_CLK38DIV,4,2      ; @PRCM_CLK_MGT_CLK38DIV
	.comm	_PRCMU_SGACLK,8,3               ; @PRCMU_SGACLK
	.comm	_PRCM_CLK_MGT_CLKPLLDIV_MASK,4,2 ; @PRCM_CLK_MGT_CLKPLLDIV_MASK
	.comm	_PRCM_SGACLK_MGT_SGACLKDIV_BY_2_5_EN,4,2 ; @PRCM_SGACLK_MGT_SGACLKDIV_BY_2_5_EN
	.no_dead_strip	_set_clock_rate
.subsections_via_symbols
