	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function drv2667_set_waveform_freq
_drv2667_set_waveform_freq:             ## @drv2667_set_waveform_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	imull	$1000, (%rdi), %eax             ## imm = 0x3E8
	cltq
	imulq	$1801439851, %rax, %rbx         ## imm = 0x6B5FCA6B
	movq	%rbx, %rcx
	shrq	$63, %rcx
	sarq	$47, %rbx
	addl	%ecx, %ebx
	cmpl	$78124, %eax                    ## imm = 0x1312C
	jg	LBB0_2
## %bb.1:
	movq	8(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_2:
	movl	16(%r14), %edi
	movq	_DRV2667_PAGE@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	-36(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movq	8(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_14
LBB0_4:
	movl	-36(%rbp), %eax
	movq	_DRV2667_PAGE_0@GOTPCREL(%rip), %r12
	movl	4(%r14), %edx
	cmpl	(%r12), %eax
	je	LBB0_6
## %bb.5:
	cmpl	%eax, %edx
	je	LBB0_7
LBB0_6:
	movl	16(%r14), %edi
	movl	(%r15), %esi
	callq	_regmap_write
	testl	%eax, %eax
	jne	LBB0_13
LBB0_7:
	movl	16(%r14), %edi
	movq	_DRV2667_RAM_FREQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edx
	callq	_regmap_write
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movq	8(%r14), %rdi
	leaq	L_.str.3(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_err
LBB0_9:
	movl	-36(%rbp), %edx
	cmpl	(%r12), %edx
	je	LBB0_11
## %bb.10:
	cmpl	%edx, 4(%r14)
	je	LBB0_16
LBB0_11:
	movl	16(%r14), %edi
	movl	(%r15), %esi
	callq	_regmap_write
	testl	%eax, %eax
	je	LBB0_12
LBB0_13:
	movq	8(%r14), %rdi
	leaq	L_.str.2(%rip), %rsi
LBB0_14:
	movl	%eax, %edx
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_15:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_16:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	xorl	%ebx, %ebx
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ERROR: Frequency calculated to %i\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DRV2667_PAGE,4,2               ## @DRV2667_PAGE
L_.str.1:                               ## @.str.1
	.asciz	"Failed to read the page number: %d\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_DRV2667_PAGE_0,4,2             ## @DRV2667_PAGE_0
L_.str.2:                               ## @.str.2
	.asciz	"Failed to set the page: %d\n"

	.comm	_DRV2667_RAM_FREQ,4,2           ## @DRV2667_RAM_FREQ
L_.str.3:                               ## @.str.3
	.asciz	"Failed to set the frequency: %d\n"

	.no_dead_strip	_drv2667_set_waveform_freq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function drv2667_set_waveform_freq
_drv2667_set_waveform_freq:             ; @drv2667_set_waveform_freq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	w8, [x0]
	mov	w9, #1000
	mul	w8, w8, w9
	mov	w9, #51819
	movk	w9, #27487, lsl #16
	smull	x9, w8, w9
	lsr	x10, x9, #63
	asr	x9, x9, #47
	add	w20, w9, w10
	mov	w9, #12589
	movk	w9, #1, lsl #16
	cmp	w8, w9
	b.ge	LBB0_2
; %bb.1:
	ldr	x0, [x19, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_err
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_13
LBB0_2:
	ldr	w0, [x19, #16]
Lloh4:
	adrp	x21, _DRV2667_PAGE@GOTPAGE
Lloh5:
	ldr	x21, [x21, _DRV2667_PAGE@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	bl	_regmap_read
	cbz	w0, LBB0_4
; %bb.3:
	mov	x2, x0
	ldr	x0, [x19, #8]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_12
LBB0_4:
	ldr	w8, [sp, #12]
Lloh8:
	adrp	x22, _DRV2667_PAGE_0@GOTPAGE
Lloh9:
	ldr	x22, [x22, _DRV2667_PAGE_0@GOTPAGEOFF]
	ldr	w9, [x22]
	ldr	w2, [x19, #4]
	cmp	w8, w9
	ccmp	w2, w8, #0, ne
	b.eq	LBB0_6
; %bb.5:
	ldr	w0, [x19, #16]
	ldr	w1, [x21]
	bl	_regmap_write
	cbnz	w0, LBB0_11
LBB0_6:
	ldr	w0, [x19, #16]
Lloh10:
	adrp	x8, _DRV2667_RAM_FREQ@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DRV2667_RAM_FREQ@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x2, x20
	bl	_regmap_write
	mov	x20, x0
	cbz	w0, LBB0_8
; %bb.7:
	ldr	x0, [x19, #8]
Lloh13:
	adrp	x1, l_.str.3@PAGE
Lloh14:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, x20
	bl	_dev_err
LBB0_8:
	ldr	w2, [sp, #12]
	ldr	w8, [x22]
	cmp	w2, w8
	b.eq	LBB0_10
; %bb.9:
	ldr	w8, [x19, #4]
	cmp	w8, w2
	b.eq	LBB0_14
LBB0_10:
	ldr	w0, [x19, #16]
	ldr	w1, [x21]
	bl	_regmap_write
	cbz	w0, LBB0_15
LBB0_11:
	mov	x2, x0
	ldr	x0, [x19, #8]
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_12:
	bl	_dev_err
Lloh17:
	adrp	x8, _EIO@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_14:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_15:
	mov	w20, #0
	b	LBB0_14
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ERROR: Frequency calculated to %i\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DRV2667_PAGE,4,2               ; @DRV2667_PAGE
l_.str.1:                               ; @.str.1
	.asciz	"Failed to read the page number: %d\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_DRV2667_PAGE_0,4,2             ; @DRV2667_PAGE_0
l_.str.2:                               ; @.str.2
	.asciz	"Failed to set the page: %d\n"

	.comm	_DRV2667_RAM_FREQ,4,2           ; @DRV2667_RAM_FREQ
l_.str.3:                               ; @.str.3
	.asciz	"Failed to set the frequency: %d\n"

	.no_dead_strip	_drv2667_set_waveform_freq
.subsections_via_symbols
