	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function zl10036_set_params
_zl10036_set_params:                    ## @zl10036_set_params
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	24(%rdi), %ecx
	movl	8(%rdi), %eax
	movq	_kHz@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	cltd
	idivl	%esi
	cmpl	%eax, %ecx
	jl	LBB0_3
## %bb.1:
	movq	%rdi, %r15
	movl	12(%rdi), %eax
	cltd
	idivl	%esi
	cmpl	%eax, %ecx
	jg	LBB0_3
## %bb.2:
	cmpl	$949999, %ecx                   ## imm = 0xE7EEF
	jg	LBB0_5
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_4:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	16(%r15), %r14
	movl	28(%r15), %r12d
	xorl	%ebx, %ebx
	cmpl	$1250000, %ecx                  ## imm = 0x1312D0
	jb	LBB0_8
## %bb.6:
	movl	$1, %ebx
	cmpl	$1750000, %ecx                  ## imm = 0x1AB3F0
	jb	LBB0_8
## %bb.7:
	movl	$2, %ebx
	cmpl	$2175000, %ecx                  ## imm = 0x213018
	jae	LBB0_3
LBB0_8:
	movq	(%r15), %rax
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	%r15, %rdi
	movl	$1, %esi
	callq	*%rax
LBB0_10:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_zl10036_set_gain_params
	testl	%eax, %eax
	js	LBB0_19
## %bb.11:
	movl	24(%r15), %esi
	movq	%r14, %rdi
	callq	_zl10036_set_frequency
	testl	%eax, %eax
	js	LBB0_19
## %bb.12:
	leal	(%r12,%r12,8), %eax
	leal	(%rax,%rax,2), %eax
	cltq
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	sarq	$43, %rcx
	shrq	$63, %rax
	leal	(%rcx,%rax), %esi
	addl	$3000, %esi                     ## imm = 0xBB8
	movq	%r14, %rdi
	callq	_zl10036_set_bandwidth
	testl	%eax, %eax
	js	LBB0_19
## %bb.13:
	movl	$20, %r12d
	movq	_STATUS_FL@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_zl10036_read_status_reg
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_20
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	testl	%ebx, (%r13)
	jne	LBB0_20
## %bb.16:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	$10, %edi
	callq	_msleep
	decl	%r12d
	jne	LBB0_14
	jmp	LBB0_20
LBB0_19:
	movl	%eax, %ebx
LBB0_20:
	movq	(%r15), %rcx
	testq	%rcx, %rcx
	je	LBB0_4
## %bb.21:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	*%rcx
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_kHz,4,2                        ## @kHz
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_STATUS_FL,4,2                  ## @STATUS_FL
	.no_dead_strip	_zl10036_set_params
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function zl10036_set_params
_zl10036_set_params:                    ; @zl10036_set_params
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	ldr	w8, [x0, #24]
	ldr	w10, [x0, #8]
Lloh0:
	adrp	x9, _kHz@GOTPAGE
Lloh1:
	ldr	x9, [x9, _kHz@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	sdiv	w10, w10, w9
	cmp	w8, w10
	b.lt	LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	w10, [x0, #12]
	sdiv	w9, w10, w9
	cmp	w8, w9
	b.gt	LBB0_3
; %bb.2:
	mov	w9, #32495
	movk	w9, #14, lsl #16
	cmp	w8, w9
	b.gt	LBB0_5
LBB0_3:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_4:
	mov	x0, x21
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_5:
	ldr	x20, [x19, #16]
	ldr	w22, [x19, #28]
	mov	w9, #4816
	movk	w9, #19, lsl #16
	cmp	w8, w9
	b.hs	LBB0_18
; %bb.6:
	mov	w21, #0
	ldr	x8, [x19]
	cbz	x8, LBB0_8
LBB0_7:
	mov	x0, x19
	mov	w1, #1
	blr	x8
LBB0_8:
	mov	x0, x20
	mov	x1, x21
	bl	_zl10036_set_gain_params
	tbnz	w0, #31, LBB0_15
; %bb.9:
	ldr	w1, [x19, #24]
	mov	x0, x20
	bl	_zl10036_set_frequency
	tbnz	w0, #31, LBB0_15
; %bb.10:
	mov	w8, #27
	mul	w8, w22, w8
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #43
	add	w8, w8, w9
	add	w1, w8, #3000
	mov	x0, x20
	bl	_zl10036_set_bandwidth
	tbnz	w0, #31, LBB0_15
; %bb.11:
	mov	w22, #20
Lloh6:
	adrp	x23, _STATUS_FL@GOTPAGE
Lloh7:
	ldr	x23, [x23, _STATUS_FL@GOTPAGEOFF]
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_zl10036_read_status_reg
	mov	x21, x0
	tbnz	w0, #31, LBB0_16
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w8, [x23]
	tst	w8, w21
	b.ne	LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	w0, #10
	bl	_msleep
	subs	w22, w22, #1
	b.ne	LBB0_12
	b	LBB0_16
LBB0_15:
	mov	x21, x0
LBB0_16:
	ldr	x8, [x19]
	cbz	x8, LBB0_4
; %bb.17:
	mov	x0, x19
	mov	w1, #0
	blr	x8
	b	LBB0_4
LBB0_18:
	mov	w9, #46064
	movk	w9, #26, lsl #16
	cmp	w8, w9
	b.hs	LBB0_20
; %bb.19:
	mov	w21, #1
	ldr	x8, [x19]
	cbnz	x8, LBB0_7
	b	LBB0_8
LBB0_20:
	mov	w9, #12312
	movk	w9, #33, lsl #16
	cmp	w8, w9
	b.hs	LBB0_3
; %bb.21:
	mov	w21, #2
	ldr	x8, [x19]
	cbnz	x8, LBB0_7
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_kHz,4,2                        ; @kHz
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_STATUS_FL,4,2                  ; @STATUS_FL
	.no_dead_strip	_zl10036_set_params
.subsections_via_symbols
