	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wm8739_s_ctrl
_wm8739_s_ctrl:                         ## @wm8739_s_ctrl
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_to_sd
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_to_state
	cmpl	$128, (%rbx)
	jne	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	16(%rax), %rax
	movl	$65536, %edi                    ## imm = 0x10000
	subq	(%rax), %rdi
	movl	$32768, %esi                    ## imm = 0x8000
	callq	_min
                                        ## kill: def $eax killed $eax def $rax
	movq	8(%r15), %rcx
	movq	16(%r15), %rdx
	imull	(%rcx), %eax
	leal	32767(%rax), %ebx
	testl	%eax, %eax
	cmovnsl	%eax, %ebx
	sarl	$15, %ebx
	movq	(%rdx), %rdi
	movl	$32768, %esi                    ## imm = 0x8000
	callq	_min
                                        ## kill: def $eax killed $eax def $rax
	movq	(%r15), %rsi
	movq	8(%r15), %rcx
	imull	(%rcx), %eax
	leal	32767(%rax), %edi
	testl	%eax, %eax
	cmovnsl	%eax, %edi
	movq	%rbx, %rax
	shlq	$5, %rax
	subq	%rbx, %rax
	movabsq	$-9223231297218904063, %rbx     ## imm = 0x8000800080008001
	mulq	%rbx
	movq	%rdx, %rcx
	sarl	$15, %edi
	shrl	$15, %ecx
	movq	%rdi, %rax
	shlq	$5, %rax
	subq	%rdi, %rax
	mulq	%rbx
	movq	%rdx, %r15
	shrl	$15, %r15d
	xorl	%ebx, %ebx
	cmpq	$0, (%rsi)
	setne	%bl
	shll	$7, %ebx
	movq	_R0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	andl	$31, %ecx
	orl	%ebx, %ecx
	movq	%r14, %rdi
	movl	%ecx, %edx
	callq	_wm8739_write
	movq	_R1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	andl	$31, %r15d
	orl	%ebx, %r15d
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_wm8739_write
	xorl	%eax, %eax
	jmp	LBB0_3
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_R0,4,2                         ## @R0
	.comm	_R1,4,2                         ## @R1
	.no_dead_strip	_wm8739_s_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wm8739_s_ctrl
_wm8739_s_ctrl:                         ; @wm8739_s_ctrl
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x21, x0
	bl	_to_sd
	mov	x19, x0
	bl	_to_state
	ldr	w8, [x21]
	cmp	w8, #128
	b.ne	LBB0_2
; %bb.1:
	mov	x20, x0
	ldr	x8, [x0, #16]
	ldr	x8, [x8]
	mov	w9, #65536
	sub	x0, x9, x8
	mov	w1, #32768
	bl	_min
	ldp	x8, x9, [x20, #8]
	ldr	w8, [x8]
	mul	w8, w8, w0
	mov	w21, #32767
	add	w10, w8, w21
	cmp	w8, #0
	csel	w8, w10, w8, lt
	asr	w22, w8, #15
	ldr	x0, [x9]
	mov	w1, #32768
	bl	_min
	ldp	x9, x8, [x20]
	ldr	w8, [x8]
	mul	w8, w8, w0
	add	w10, w8, w21
	cmp	w8, #0
	csel	w8, w10, w8, lt
	asr	w8, w8, #15
	lsl	x10, x22, #5
	sub	x10, x10, x22
	mov	x11, #-9223231297218904064
	movk	x11, #32769
	umulh	x10, x10, x11
	lsl	x12, x8, #5
	sub	x8, x12, x8
	umulh	x21, x8, x11
	ldr	x8, [x9]
	cmp	x8, #0
	cset	w8, ne
	lsl	w20, w8, #7
Lloh0:
	adrp	x8, _R0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _R0@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x2, x20
	bfxil	w2, w10, #15, #5
	mov	x0, x19
	bl	_wm8739_write
Lloh3:
	adrp	x8, _R1@GOTPAGE
Lloh4:
	ldr	x8, [x8, _R1@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bfxil	w20, w21, #15, #5
	mov	x0, x19
	mov	x2, x20
	bl	_wm8739_write
	mov	w0, #0
	b	LBB0_3
LBB0_2:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_R0,4,2                         ; @R0
	.comm	_R1,4,2                         ; @R1
	.no_dead_strip	_wm8739_s_ctrl
.subsections_via_symbols
