	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aw_clk_nm_set_freq
_aw_clk_nm_set_freq:                    ## @aw_clk_nm_set_freq
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r13
	movl	%ecx, -76(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r15
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rsi, -96(%rbp)
	callq	_clknode_get_softc
	movq	_AW_CLK_REPARENT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_8
## %bb.1:
	movq	%r15, %rbx
	movq	%r14, %rdi
	callq	_clknode_get_parent_names
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_clknode_get_parents_num
	testl	%eax, %eax
	movq	%r13, -104(%rbp)                ## 8-byte Spill
	je	LBB0_2
## %bb.3:
	xorl	%r13d, %r13d
	leaq	-88(%rbp), %r14
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	xorl	%r12d, %r12d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%r13
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_clknode_get_parents_num
	movl	%eax, %eax
	cmpq	%rax, %r13
	je	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15,%r13,8), %rdi
	callq	_clknode_find_by_name
	movq	%rax, %rdi
	leaq	-96(%rbp), %rsi
	callq	_clknode_get_freq
	movq	-96(%rbp), %rsi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rdx
	leaq	-52(%rbp), %rcx
	movq	%r14, %r8
	callq	_aw_clk_nm_find_best
	cmpq	%rax, %r12
	jge	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	-52(%rbp), %ecx
	movl	%ecx, -80(%rbp)
	movl	-88(%rbp), %ecx
	movl	%ecx, -84(%rbp)
	movq	%rax, %r12
	movl	%r13d, %eax
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	jmp	LBB0_6
LBB0_8:
	leaq	-80(%rbp), %rcx
	leaq	-84(%rbp), %r8
	movq	%rax, %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	callq	_aw_clk_nm_find_best
	movq	%rax, %r12
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
                                        ## implicit-def: $r14d
	jmp	LBB0_9
LBB0_2:
	xorl	%r12d, %r12d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_7:
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	callq	_clknode_get_parent_idx
	movl	%eax, %r14d
	movq	%r15, %rdi
	callq	_clknode_get_parent
	leaq	-96(%rbp), %rsi
	movq	%rax, %rdi
	callq	_clknode_get_freq
	movq	-104(%rbp), %r13                ## 8-byte Reload
	movq	%rbx, %r15
LBB0_9:
	movl	-76(%rbp), %edx                 ## 4-byte Reload
	movq	_CLK_SET_DRYRUN@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	je	LBB0_10
LBB0_23:
	movq	%r12, (%r15)
	movl	$1, (%r13)
	xorl	%eax, %eax
LBB0_24:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	(%r15), %rax
	cmpq	%rax, %r12
	jge	LBB0_13
## %bb.11:
	movq	_CLK_SET_ROUND_DOWN@GOTPCREL(%rip), %rcx
	testl	%edx, (%rcx)
	je	LBB0_12
LBB0_13:
	cmpq	%rax, %r12
	jle	LBB0_15
## %bb.14:
	movq	_CLK_SET_ROUND_UP@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	je	LBB0_12
LBB0_15:
	movq	_AW_CLK_REPARENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	testl	%eax, (%rcx)
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	je	LBB0_18
## %bb.16:
	cmpl	%esi, %r14d
	je	LBB0_18
## %bb.17:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_clknode_set_parent_by_idx
LBB0_18:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_DEVICE_LOCK
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movl	12(%rbx), %esi
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	callq	_READ4
	leaq	24(%rbx), %rdi
	movl	-80(%rbp), %esi
	callq	_aw_clk_factor_get_value
	movl	%eax, -52(%rbp)
	movq	%rbx, %rdi
	addq	$16, %rdi
	movl	-84(%rbp), %esi
	callq	_aw_clk_factor_get_value
	movl	%eax, -88(%rbp)
	movl	24(%rbx), %esi
	orl	16(%rbx), %esi
	notl	%esi
	andl	-48(%rbp), %esi
	movl	-52(%rbp), %edx
	movb	28(%rbx), %cl
	shll	%cl, %edx
	movb	20(%rbx), %cl
	shll	%cl, %eax
	orl	%eax, %edx
	orl	%esi, %edx
	movl	%edx, -48(%rbp)
	movl	12(%rbx), %esi
	movq	%r14, %rdi
	callq	_WRITE4
	movq	%r14, %rdi
	callq	_DEVICE_UNLOCK
	movq	_AW_CLK_HAS_LOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_23
## %bb.19:
	movq	%rbx, %rcx
	cmpl	$0, 4(%rbx)
	jle	LBB0_23
## %bb.20:
	xorl	%ebx, %ebx
	leaq	-48(%rbp), %r14
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movl	12(%rcx), %esi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rdx
	callq	_READ4
	movl	-48(%rbp), %eax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	8(%rcx), %ecx
	btl	%ecx, %eax
	jb	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_21 Depth=1
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_DELAY
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	incl	%ebx
	cmpl	4(%rcx), %ebx
	jl	LBB0_21
	jmp	LBB0_23
LBB0_12:
	movl	$1, (%r13)
	movq	_ERANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_AW_CLK_REPARENT,4,2            ## @AW_CLK_REPARENT
	.comm	_CLK_SET_DRYRUN,4,2             ## @CLK_SET_DRYRUN
	.comm	_CLK_SET_ROUND_DOWN,4,2         ## @CLK_SET_ROUND_DOWN
	.comm	_ERANGE,4,2                     ## @ERANGE
	.comm	_CLK_SET_ROUND_UP,4,2           ## @CLK_SET_ROUND_UP
	.comm	_AW_CLK_HAS_LOCK,4,2            ## @AW_CLK_HAS_LOCK
	.no_dead_strip	_aw_clk_nm_set_freq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aw_clk_nm_set_freq
_aw_clk_nm_set_freq:                    ; @aw_clk_nm_set_freq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x19, x4
	mov	x24, x3
	mov	x20, x2
	mov	x23, x1
	mov	x21, x0
	str	x1, [sp, #24]
	bl	_clknode_get_softc
	mov	x22, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x27, _AW_CLK_REPARENT@GOTPAGE
Lloh1:
	ldr	x27, [x27, _AW_CLK_REPARENT@GOTPAGEOFF]
	ldr	w9, [x27]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.1:
	mov	x0, x21
	bl	_clknode_get_parent_names
	mov	x26, x0
	mov	x0, x21
	bl	_clknode_get_parents_num
	cbz	w0, LBB0_7
; %bb.2:
	mov	x28, #0
	mov	w25, #0
	mov	x23, #0
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x28, x28, #1
	mov	x0, x21
	bl	_clknode_get_parents_num
	cmp	x28, w0, uxtw
	b.eq	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x26, x28, lsl #3]
	bl	_clknode_find_by_name
	add	x1, sp, #24
	bl	_clknode_get_freq
	ldr	x1, [sp, #24]
	add	x3, sp, #12
	add	x4, sp, #16
	mov	x0, x22
	mov	x2, x20
	bl	_aw_clk_nm_find_best
	cmp	x23, x0
	b.ge	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w9, [sp, #12]
	ldr	w8, [sp, #16]
	stp	w9, w8, [sp, #4]
	mov	x23, x0
	mov	x25, x28
	b	LBB0_3
LBB0_6:
	add	x3, sp, #4
	add	x4, sp, #8
	mov	x0, x22
	mov	x1, x23
	mov	x2, x20
	bl	_aw_clk_nm_find_best
	mov	x23, x0
	mov	w25, #0
                                        ; implicit-def: $w26
	b	LBB0_9
LBB0_7:
	mov	x23, #0
	mov	w25, #0
LBB0_8:
	mov	x0, x21
	bl	_clknode_get_parent_idx
	mov	x26, x0
	mov	x0, x21
	bl	_clknode_get_parent
	add	x1, sp, #24
	bl	_clknode_get_freq
LBB0_9:
Lloh2:
	adrp	x8, _CLK_SET_DRYRUN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CLK_SET_DRYRUN@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	tst	w8, w24
	b.eq	LBB0_12
LBB0_10:
	mov	w0, #0
	str	x23, [x20]
	mov	w8, #1
	str	w8, [x19]
LBB0_11:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_12:
	ldr	x8, [x20]
	cmp	x23, x8
	b.ge	LBB0_14
; %bb.13:
Lloh5:
	adrp	x9, _CLK_SET_ROUND_DOWN@GOTPAGE
Lloh6:
	ldr	x9, [x9, _CLK_SET_ROUND_DOWN@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w24
	b.eq	LBB0_23
LBB0_14:
	cmp	x23, x8
	b.le	LBB0_16
; %bb.15:
Lloh8:
	adrp	x8, _CLK_SET_ROUND_UP@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CLK_SET_ROUND_UP@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w24
	b.eq	LBB0_23
LBB0_16:
	ldr	w8, [x22]
	ldr	w9, [x27]
	and	w8, w9, w8
	cmp	w8, #0
	ccmp	w26, w25, #4, ne
	b.eq	LBB0_18
; %bb.17:
	mov	x0, x21
	mov	x1, x25
	bl	_clknode_set_parent_by_idx
LBB0_18:
	mov	x0, x21
	bl	_DEVICE_LOCK
	ldr	w1, [x22, #12]
	add	x2, sp, #20
	mov	x0, x21
	bl	_READ4
	add	x0, x22, #24
	ldr	w1, [sp, #4]
	bl	_aw_clk_factor_get_value
	str	w0, [sp, #12]
	add	x0, x22, #16
	ldr	w1, [sp, #8]
	bl	_aw_clk_factor_get_value
	ldr	w8, [sp, #20]
	ldp	w10, w9, [x22, #20]
	ldp	w1, w11, [x22, #12]
	orr	w9, w9, w11
	bic	w8, w8, w9
	ldr	w9, [sp, #12]
	ldr	w11, [x22, #28]
	lsl	w9, w9, w11
	orr	w8, w9, w8
	lsl	w9, w0, w10
	orr	w2, w9, w8
	stp	w0, w2, [sp, #16]
	mov	x0, x21
	bl	_WRITE4
	mov	x0, x21
	bl	_DEVICE_UNLOCK
	ldr	w8, [x22]
Lloh11:
	adrp	x9, _AW_CLK_HAS_LOCK@GOTPAGE
Lloh12:
	ldr	x9, [x9, _AW_CLK_HAS_LOCK@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.19:
	ldr	w8, [x22, #4]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.20:
	mov	w24, #0
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22, #12]
	add	x2, sp, #20
	mov	x0, x21
	bl	_READ4
	ldr	w8, [sp, #20]
	ldr	w9, [x22, #8]
	lsr	w8, w8, w9
	tbnz	w8, #0, LBB0_10
; %bb.22:                               ;   in Loop: Header=BB0_21 Depth=1
	mov	w0, #1000
	bl	_DELAY
	add	w24, w24, #1
	ldr	w8, [x22, #4]
	cmp	w24, w8
	b.lt	LBB0_21
	b	LBB0_10
LBB0_23:
	mov	w8, #1
	str	w8, [x19]
Lloh14:
	adrp	x8, _ERANGE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	b	LBB0_11
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_AW_CLK_REPARENT,4,2            ; @AW_CLK_REPARENT
	.comm	_CLK_SET_DRYRUN,4,2             ; @CLK_SET_DRYRUN
	.comm	_CLK_SET_ROUND_DOWN,4,2         ; @CLK_SET_ROUND_DOWN
	.comm	_ERANGE,4,2                     ; @ERANGE
	.comm	_CLK_SET_ROUND_UP,4,2           ; @CLK_SET_ROUND_UP
	.comm	_AW_CLK_HAS_LOCK,4,2            ; @AW_CLK_HAS_LOCK
	.no_dead_strip	_aw_clk_nm_set_freq
.subsections_via_symbols
