	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aw_clk_np_set_freq
_aw_clk_np_set_freq:                    ## @aw_clk_np_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -64(%rbp)                  ## 8-byte Spill
	movl	%ecx, %r15d
	movq	%rdx, %r12
	movq	%rsi, %r13
	movq	%rdi, %r14
	callq	_clknode_get_softc
	movq	%rax, %rbx
	leaq	-52(%rbp), %rcx
	leaq	-48(%rbp), %r8
	movq	%rax, %rdi
	movq	%r13, %rsi
	movq	%r12, %rdx
	callq	_aw_clk_np_find_best
	movq	%rax, %r13
	movq	_CLK_SET_DRYRUN@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_2
## %bb.1:
	movq	%r13, (%r12)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	jmp	LBB0_13
LBB0_2:
	movl	%r15d, %edx
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	(%r12), %rax
	cmpq	%rax, %r13
	jge	LBB0_5
## %bb.3:
	movq	_CLK_SET_ROUND_DOWN@GOTPCREL(%rip), %rcx
	testl	%edx, (%rcx)
	je	LBB0_4
LBB0_5:
	cmpq	%rax, %r13
	jle	LBB0_7
## %bb.6:
	movq	_CLK_SET_ROUND_UP@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	je	LBB0_4
LBB0_7:
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	callq	_DEVICE_LOCK
	movl	12(%rbx), %esi
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	callq	_READ4
	leaq	24(%rbx), %rdi
	movl	-52(%rbp), %esi
	callq	_aw_clk_factor_get_value
	movl	%eax, %r14d
	movq	%rbx, %rdi
	addq	$16, %rdi
	movl	-48(%rbp), %esi
	callq	_aw_clk_factor_get_value
	movl	24(%rbx), %edx
	orl	16(%rbx), %edx
	notl	%edx
	andl	-44(%rbp), %edx
	movb	28(%rbx), %cl
	shll	%cl, %r14d
	movb	20(%rbx), %cl
	shll	%cl, %eax
	orl	%eax, %r14d
	orl	%edx, %r14d
	movl	%r14d, -44(%rbp)
	movl	12(%rbx), %esi
	movq	%r12, %rdi
	movl	%r14d, %edx
	callq	_WRITE4
	movq	%r12, %rdi
	callq	_DEVICE_UNLOCK
	movq	_AW_CLK_HAS_LOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_12
## %bb.8:
	cmpl	$0, 4(%rbx)
	jle	LBB0_12
## %bb.9:
	xorl	%r14d, %r14d
	leaq	-44(%rbp), %r12
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	12(%rbx), %esi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rdx
	callq	_READ4
	movl	-44(%rbp), %eax
	movl	8(%rbx), %ecx
	btl	%ecx, %eax
	jb	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_DELAY
	incl	%r14d
	cmpl	4(%rbx), %r14d
	jl	LBB0_10
LBB0_12:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	%r13, (%rax)
	movl	$1, (%r15)
LBB0_13:
	xorl	%eax, %eax
LBB0_14:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	$1, (%r15)
	movq	_ERANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.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_np_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_np_set_freq
_aw_clk_np_set_freq:                    ; @aw_clk_np_set_freq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x4
	mov	x24, x3
	mov	x20, x2
	mov	x23, x1
	mov	x21, x0
	bl	_clknode_get_softc
	mov	x22, x0
	add	x3, sp, #8
	add	x4, sp, #4
	mov	x1, x23
	mov	x2, x20
	bl	_aw_clk_np_find_best
	mov	x23, x0
Lloh0:
	adrp	x8, _CLK_SET_DRYRUN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CLK_SET_DRYRUN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w24
	b.eq	LBB0_3
LBB0_1:
	mov	w0, #0
	str	x23, [x20]
	mov	w8, #1
	str	w8, [x19]
LBB0_2:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_3:
	ldr	x8, [x20]
	cmp	x23, x8
	b.ge	LBB0_5
; %bb.4:
Lloh3:
	adrp	x9, _CLK_SET_ROUND_DOWN@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CLK_SET_ROUND_DOWN@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w24
	b.eq	LBB0_12
LBB0_5:
	cmp	x23, x8
	b.le	LBB0_7
; %bb.6:
Lloh6:
	adrp	x8, _CLK_SET_ROUND_UP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CLK_SET_ROUND_UP@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w24
	b.eq	LBB0_12
LBB0_7:
	mov	x0, x21
	bl	_DEVICE_LOCK
	ldr	w1, [x22, #12]
	add	x2, sp, #12
	mov	x0, x21
	bl	_READ4
	add	x0, x22, #24
	ldr	w1, [sp, #8]
	bl	_aw_clk_factor_get_value
	mov	x24, x0
	add	x0, x22, #16
	ldr	w1, [sp, #4]
	bl	_aw_clk_factor_get_value
	ldr	w8, [sp, #12]
	ldp	w10, w9, [x22, #20]
	ldp	w1, w11, [x22, #12]
	orr	w9, w9, w11
	bic	w8, w8, w9
	ldr	w9, [x22, #28]
	lsl	w9, w24, w9
	orr	w8, w9, w8
	lsl	w9, w0, w10
	orr	w2, w9, w8
	str	w2, [sp, #12]
	mov	x0, x21
	bl	_WRITE4
	mov	x0, x21
	bl	_DEVICE_UNLOCK
	ldr	w8, [x22]
Lloh9:
	adrp	x9, _AW_CLK_HAS_LOCK@GOTPAGE
Lloh10:
	ldr	x9, [x9, _AW_CLK_HAS_LOCK@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_1
; %bb.8:
	ldr	w8, [x22, #4]
	cmp	w8, #1
	b.lt	LBB0_1
; %bb.9:
	mov	w24, #0
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22, #12]
	add	x2, sp, #12
	mov	x0, x21
	bl	_READ4
	ldr	w8, [sp, #12]
	ldr	w9, [x22, #8]
	lsr	w8, w8, w9
	tbnz	w8, #0, LBB0_1
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	w0, #1000
	bl	_DELAY
	add	w24, w24, #1
	ldr	w8, [x22, #4]
	cmp	w24, w8
	b.lt	LBB0_10
	b	LBB0_1
LBB0_12:
	mov	w8, #1
	str	w8, [x19]
Lloh12:
	adrp	x8, _ERANGE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.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_np_set_freq
.subsections_via_symbols
