	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aw_clk_nkmp_set_freq
_aw_clk_nkmp_set_freq:                  ## @aw_clk_nkmp_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, -80(%rbp)                  ## 8-byte Spill
	movl	%ecx, %r15d
	movq	%rdx, %r13
	movq	%rsi, %rbx
	movq	%rdi, %r12
	callq	_clknode_get_softc
	movq	%rax, %r14
	leaq	-48(%rbp), %rax
	movq	%rax, (%rsp)
	leaq	-60(%rbp), %rcx
	leaq	-56(%rbp), %r8
	leaq	-52(%rbp), %r9
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%r13, %rdx
	callq	_aw_clk_nkmp_find_best
	movq	_CLK_SET_DRYRUN@GOTPCREL(%rip), %rcx
	testl	%r15d, (%rcx)
	je	LBB0_2
## %bb.1:
	movq	%rax, (%r13)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	jmp	LBB0_13
LBB0_2:
	movl	%r15d, %esi
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movq	(%r13), %rdx
	cmpq	%rdx, %rax
	jge	LBB0_5
## %bb.3:
	movq	_CLK_SET_ROUND_DOWN@GOTPCREL(%rip), %rcx
	testl	%esi, (%rcx)
	jne	LBB0_8
LBB0_5:
	cmpq	%rdx, %rax
	jle	LBB0_10
## %bb.6:
	movq	_CLK_SET_ROUND_UP@GOTPCREL(%rip), %rdx
	testl	%esi, (%rdx)
	je	LBB0_10
## %bb.7:
	movq	%r15, %rcx
LBB0_8:
	movl	$1, (%r15)
	movq	_ERANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_14
LBB0_10:
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movq	_AW_CLK_SCALE_CHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%r14, %rbx
	testl	%eax, (%r14)
	je	LBB0_15
## %bb.11:
	movl	-60(%rbp), %edx
	movl	-56(%rbp), %ecx
	movl	-52(%rbp), %r8d
	movl	-48(%rbp), %r9d
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_aw_clk_nkmp_set_freq_scale
LBB0_12:
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movq	%rax, (%r13)
	movl	$1, (%r15)
LBB0_13:
	xorl	%eax, %eax
LBB0_14:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	callq	_DEVICE_LOCK
	movl	16(%rbx), %esi
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	callq	_READ4
	leaq	44(%rbx), %rdi
	movl	44(%rbx), %eax
	orl	36(%rbx), %eax
	leaq	36(%rbx), %rcx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	leaq	28(%rbx), %rcx
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	orl	28(%rbx), %eax
	movq	%rbx, %r14
	addq	$20, %r14
	orl	20(%rbx), %eax
	notl	%eax
	andl	%eax, -44(%rbp)
	movl	-60(%rbp), %esi
	callq	_aw_clk_factor_get_value
	movb	48(%rbx), %cl
	shll	%cl, %eax
	orl	%eax, -44(%rbp)
	movl	-56(%rbp), %esi
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	callq	_aw_clk_factor_get_value
	movb	40(%rbx), %cl
	shll	%cl, %eax
	orl	%eax, -44(%rbp)
	movl	-52(%rbp), %esi
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	callq	_aw_clk_factor_get_value
	movb	32(%rbx), %cl
	shll	%cl, %eax
	orl	%eax, -44(%rbp)
	movl	-48(%rbp), %esi
	movq	%r14, %rdi
	callq	_aw_clk_factor_get_value
	movb	24(%rbx), %cl
	shll	%cl, %eax
	orl	-44(%rbp), %eax
	movl	%eax, -44(%rbp)
	movl	16(%rbx), %esi
	movq	%r12, %rdi
	movl	%eax, %edx
	callq	_WRITE4
	movl	$2000, %edi                     ## imm = 0x7D0
	callq	_DELAY
	movq	%r12, %rdi
	callq	_DEVICE_UNLOCK
	movl	(%rbx), %eax
	movq	_AW_CLK_HAS_UPDATE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_17
## %bb.16:
	movq	%r12, %rdi
	callq	_DEVICE_LOCK
	movl	16(%rbx), %esi
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	callq	_READ4
	movb	4(%rbx), %al
	movl	-44(%rbp), %edx
	btsl	%eax, %edx
	movl	%edx, -44(%rbp)
	movl	16(%rbx), %esi
	movq	%r12, %rdi
	callq	_WRITE4
	movl	$2000, %edi                     ## imm = 0x7D0
	callq	_DELAY
	movq	%r12, %rdi
	callq	_DEVICE_UNLOCK
	movl	(%rbx), %eax
LBB0_17:
	movq	_AW_CLK_HAS_LOCK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_12
## %bb.18:
	cmpl	$0, 8(%rbx)
	jle	LBB0_12
## %bb.19:
	xorl	%r14d, %r14d
	leaq	-44(%rbp), %r12
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movl	16(%rbx), %esi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rdx
	callq	_READ4
	movl	-44(%rbp), %eax
	movl	12(%rbx), %ecx
	btl	%ecx, %eax
	jb	LBB0_12
## %bb.21:                              ##   in Loop: Header=BB0_20 Depth=1
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_DELAY
	incl	%r14d
	cmpl	8(%rbx), %r14d
	jl	LBB0_20
	jmp	LBB0_12
	.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_SCALE_CHANGE,4,2        ## @AW_CLK_SCALE_CHANGE
	.comm	_AW_CLK_HAS_UPDATE,4,2          ## @AW_CLK_HAS_UPDATE
	.comm	_AW_CLK_HAS_LOCK,4,2            ## @AW_CLK_HAS_LOCK
	.no_dead_strip	_aw_clk_nkmp_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_nkmp_set_freq
_aw_clk_nkmp_set_freq:                  ; @aw_clk_nkmp_set_freq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	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, #24
	add	x4, sp, #20
	add	x5, sp, #16
	add	x6, sp, #12
	mov	x1, x23
	mov	x2, x20
	bl	_aw_clk_nkmp_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, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	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.ne	LBB0_7
LBB0_5:
	cmp	x23, x8
	b.le	LBB0_8
; %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_8
LBB0_7:
	mov	w8, #1
	str	w8, [x19]
Lloh9:
	adrp	x8, _ERANGE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	b	LBB0_2
LBB0_8:
	ldr	w8, [x22]
Lloh12:
	adrp	x9, _AW_CLK_SCALE_CHANGE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _AW_CLK_SCALE_CHANGE@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:
	ldp	w3, w2, [sp, #20]
	ldp	w5, w4, [sp, #12]
	mov	x0, x21
	mov	x1, x22
	bl	_aw_clk_nkmp_set_freq_scale
	b	LBB0_1
LBB0_10:
	mov	x0, x21
	bl	_DEVICE_LOCK
	ldr	w1, [x22, #16]
	add	x2, sp, #28
	mov	x0, x21
	bl	_READ4
	mov	x0, x22
	ldr	w8, [x0, #44]!
	ldp	w1, w9, [sp, #24]
	mov	x24, x22
	ldr	w10, [x24, #36]!
	orr	w8, w8, w10
	mov	x25, x22
	ldr	w10, [x25, #28]!
	orr	w8, w8, w10
	mov	x26, x22
	ldr	w10, [x26, #20]!
	orr	w8, w8, w10
	bic	w8, w9, w8
	str	w8, [sp, #28]
	bl	_aw_clk_factor_get_value
	ldr	w8, [x22, #48]
	lsl	w8, w0, w8
	ldr	w9, [sp, #28]
	orr	w8, w9, w8
	str	w8, [sp, #28]
	ldr	w1, [sp, #20]
	mov	x0, x24
	bl	_aw_clk_factor_get_value
	ldr	w8, [x22, #40]
	lsl	w8, w0, w8
	ldr	w9, [sp, #28]
	orr	w8, w9, w8
	str	w8, [sp, #28]
	ldr	w1, [sp, #16]
	mov	x0, x25
	bl	_aw_clk_factor_get_value
	ldr	w8, [x22, #32]
	lsl	w8, w0, w8
	ldr	w9, [sp, #28]
	orr	w8, w9, w8
	str	w8, [sp, #28]
	ldr	w1, [sp, #12]
	mov	x0, x26
	bl	_aw_clk_factor_get_value
	ldr	w8, [x22, #24]
	lsl	w8, w0, w8
	ldr	w9, [sp, #28]
	orr	w2, w9, w8
	str	w2, [sp, #28]
	ldr	w1, [x22, #16]
	mov	x0, x21
	bl	_WRITE4
	mov	w0, #2000
	bl	_DELAY
	mov	x0, x21
	bl	_DEVICE_UNLOCK
	ldr	w8, [x22]
Lloh15:
	adrp	x9, _AW_CLK_HAS_UPDATE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _AW_CLK_HAS_UPDATE@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.11:
	mov	x0, x21
	bl	_DEVICE_LOCK
	ldr	w1, [x22, #16]
	add	x2, sp, #28
	mov	x0, x21
	bl	_READ4
	ldr	w8, [x22, #4]
	mov	w9, #1
	lsl	w8, w9, w8
	ldr	w9, [sp, #28]
	orr	w2, w9, w8
	str	w2, [sp, #28]
	ldr	w1, [x22, #16]
	mov	x0, x21
	bl	_WRITE4
	mov	w0, #2000
	bl	_DELAY
	mov	x0, x21
	bl	_DEVICE_UNLOCK
	ldr	w8, [x22]
LBB0_12:
Lloh18:
	adrp	x9, _AW_CLK_HAS_LOCK@GOTPAGE
Lloh19:
	ldr	x9, [x9, _AW_CLK_HAS_LOCK@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_1
; %bb.13:
	ldr	w8, [x22, #8]
	cmp	w8, #1
	b.lt	LBB0_1
; %bb.14:
	mov	w24, #0
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22, #16]
	add	x2, sp, #28
	mov	x0, x21
	bl	_READ4
	ldr	w8, [sp, #28]
	ldr	w9, [x22, #12]
	lsr	w8, w8, w9
	tbnz	w8, #0, LBB0_1
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	w0, #1000
	bl	_DELAY
	add	w24, w24, #1
	ldr	w8, [x22, #8]
	cmp	w24, w8
	b.lt	LBB0_15
	b	LBB0_1
	.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
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.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_SCALE_CHANGE,4,2        ; @AW_CLK_SCALE_CHANGE
	.comm	_AW_CLK_HAS_UPDATE,4,2          ; @AW_CLK_HAS_UPDATE
	.comm	_AW_CLK_HAS_LOCK,4,2            ; @AW_CLK_HAS_LOCK
	.no_dead_strip	_aw_clk_nkmp_set_freq
.subsections_via_symbols
