	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ml_combine_effects
_ml_combine_effects:                    ## @ml_combine_effects
	.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	%edx, %r15d
	movq	%rdi, %r14
	movq	(%rsi), %r13
	movl	(%r13), %eax
	cmpl	$128, %eax
	je	LBB0_4
## %bb.1:
	cmpl	$129, %eax
	je	LBB0_10
## %bb.2:
	cmpl	$130, %eax
	jne	LBB0_16
## %bb.3:
	imull	$360, 4(%r13), %eax             ## imm = 0x168
	movslq	%eax, %r12
	imulq	$-2147450879, %r12, %rax        ## imm = 0x80008001
	shrq	$32, %rax
	addl	%eax, %r12d
	movl	%r12d, %eax
	shrl	$31, %eax
	sarl	$15, %r12d
	addl	%eax, %r12d
	movl	52(%r13), %eax
	addq	$48, %r13
	movq	%rsi, %rdi
	movl	%eax, %esi
	movq	%r13, %rdx
	callq	_apply_envelope
	movl	%eax, %edi
	callq	_fixp_new16
	movl	%eax, %ebx
	movl	%r12d, %edi
	callq	_fixp_sin16
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_fixp_mult
	imull	%r15d, %eax
	movslq	%eax, %r13
	imulq	$-2147450879, %r13, %rax        ## imm = 0x80008001
	shrq	$32, %rax
	addl	%eax, %r13d
	movl	%r13d, %eax
	shrl	$31, %eax
	sarl	$15, %r13d
	addl	%eax, %r13d
	movl	%r12d, %edi
	callq	_fixp_cos16
	negl	%eax
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_fixp_mult
	imull	%r15d, %eax
	movslq	%eax, %rbx
	imulq	$-2147450879, %rbx, %rax        ## imm = 0x80008001
	shrq	$32, %rax
	addl	%eax, %ebx
	movl	%ebx, %eax
	shrl	$31, %eax
	sarl	$15, %ebx
	addl	%eax, %ebx
	addl	40(%r14), %r13d
	movl	%r13d, %edi
	movl	$-128, %esi
	movl	$127, %edx
	callq	_clamp_val
	movq	%rax, 40(%r14)
	addl	32(%r14), %ebx
	movl	%ebx, %edi
	movl	$-128, %esi
	movl	$127, %edx
	callq	_clamp_val
	movq	%rax, 32(%r14)
	jmp	LBB0_15
LBB0_4:
	movl	16(%r13), %eax
	imull	%r15d, %eax
	movslq	%eax, %r12
	imulq	$-2147450879, %r12, %rax        ## imm = 0x80008001
	shrq	$32, %rax
	addl	%eax, %r12d
	movl	%r12d, %eax
	shrl	$31, %eax
	sarl	$15, %r12d
	addl	%eax, %r12d
	imull	8(%r13), %r15d
	movslq	%r15d, %rbx
	imulq	$-2147450879, %rbx, %rax        ## imm = 0x80008001
	shrq	$32, %rax
	addl	%eax, %ebx
	movl	%ebx, %eax
	shrl	$31, %eax
	sarl	$15, %ebx
	addl	%eax, %ebx
	movq	16(%r14), %rsi
	movq	%rsi, %rax
	addq	%r12, %rax
	je	LBB0_6
## %bb.5:
	movl	4(%r14), %edi
	movl	4(%r13), %edx
	movl	%r12d, %ecx
	callq	_ml_calculate_direction
	movl	%eax, 4(%r14)
	movl	%ebx, %r15d
	jmp	LBB0_9
LBB0_10:
	leaq	24(%r13), %rdx
	movl	28(%r13), %ecx
	movl	%ecx, %eax
	negl	%eax
	cmovsl	%ecx, %eax
	movq	%rsi, %rdi
	movl	%eax, %esi
	callq	_apply_envelope
	movl	%eax, %ebx
	imull	%r15d, %ebx
	imulq	$131077, %rbx, %rax             ## imm = 0x20005
	shrq	$32, %rax
	subl	%eax, %ebx
	shrl	%ebx
	addl	%eax, %ebx
	shrl	$14, %ebx
	movq	16(%r14), %rsi
	movq	%rsi, %rax
	addq	%rbx, %rax
	je	LBB0_12
## %bb.11:
	movl	4(%r14), %edi
	movl	4(%r13), %edx
	movl	%ebx, %ecx
	callq	_ml_calculate_direction
	movl	%eax, 4(%r14)
	movq	16(%r14), %rsi
	jmp	LBB0_13
LBB0_16:
	leaq	L_.str(%rip), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pr_err                         ## TAILCALL
LBB0_6:
	movq	8(%r14), %rsi
	movl	%ebx, %r15d
	movq	%rsi, %rax
	addq	%r15, %rax
	je	LBB0_8
## %bb.7:
	movl	4(%r14), %edi
	movl	4(%r13), %edx
	movl	%ebx, %ecx
	callq	_ml_calculate_direction
	movl	%eax, 4(%r14)
	jmp	LBB0_9
LBB0_12:
	movl	$0, 4(%r14)
LBB0_13:
	addl	%ebx, %esi
	movl	%esi, %edi
	movl	$65535, %esi                    ## imm = 0xFFFF
	callq	_min
	movq	%rax, 16(%r14)
	addl	8(%r14), %ebx
	movl	%ebx, %edi
	jmp	LBB0_14
LBB0_8:
	movl	$0, 4(%r14)
LBB0_9:
	addl	16(%r14), %r12d
	movl	%r12d, %edi
	movl	$65535, %esi                    ## imm = 0xFFFF
	callq	_min
	movq	%rax, 16(%r14)
	addl	8(%r14), %r15d
	movl	%r15d, %edi
LBB0_14:
	movl	$65535, %esi                    ## imm = 0xFFFF
	callq	_min
	movq	%rax, 8(%r14)
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid type in ml_combine_effects()\n"

	.no_dead_strip	_ml_combine_effects
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ml_combine_effects
_ml_combine_effects:                    ; @ml_combine_effects
	.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
	mov	x20, x2
	mov	x19, x0
	ldr	x22, [x1]
	ldr	w8, [x22]
	cmp	w8, #128
	b.eq	LBB0_4
; %bb.1:
	cmp	w8, #129
	b.eq	LBB0_6
; %bb.2:
	cmp	w8, #130
	b.ne	LBB0_8
; %bb.3:
	ldr	w8, [x22, #4]
	mov	w9, #360
	mul	w8, w8, w9
	mov	w23, #32769
	movk	w23, #32768, lsl #16
	smull	x9, w8, w23
	lsr	x9, x9, #32
	add	w8, w9, w8
	asr	w9, w8, #15
	add	w21, w9, w8, lsr #31
	add	x2, x22, #48
	ldr	w8, [x22, #52]
	mov	x0, x1
	mov	x1, x8
	bl	_apply_envelope
	bl	_fixp_new16
	mov	x22, x0
	mov	x0, x21
	bl	_fixp_sin16
	mov	x1, x22
	bl	_fixp_mult
	mul	w8, w0, w20
	smull	x9, w8, w23
	lsr	x9, x9, #32
	add	w8, w9, w8
	asr	w9, w8, #15
	add	w24, w9, w8, lsr #31
	mov	x0, x21
	bl	_fixp_cos16
	neg	w0, w0
	mov	x1, x22
	bl	_fixp_mult
	mul	w8, w0, w20
	smull	x9, w8, w23
	lsr	x9, x9, #32
	add	w8, w9, w8
	asr	w9, w8, #15
	add	w20, w9, w8, lsr #31
	ldr	w8, [x19, #40]
	add	w0, w8, w24
	mov	w1, #-128
	mov	w2, #127
	bl	_clamp_val
	str	x0, [x19, #40]
	ldr	w8, [x19, #32]
	add	w0, w8, w20
	mov	w1, #-128
	mov	w2, #127
	bl	_clamp_val
	str	x0, [x19, #32]
	b	LBB0_16
LBB0_4:
	ldr	w8, [x22, #16]
	mul	w8, w8, w20
	mov	w9, #32769
	movk	w9, #32768, lsl #16
	smull	x10, w8, w9
	lsr	x10, x10, #32
	add	w8, w10, w8
	asr	w10, w8, #15
	add	w21, w10, w8, lsr #31
	ldr	w8, [x22, #8]
	mul	w8, w8, w20
	smull	x9, w8, w9
	lsr	x9, x9, #32
	add	w8, w9, w8
	asr	w9, w8, #15
	add	w20, w9, w8, lsr #31
	ldr	x1, [x19, #16]
	cmn	x1, x21
	b.eq	LBB0_9
; %bb.5:
	ldr	w0, [x19, #4]
	ldr	w2, [x22, #4]
	mov	x3, x21
	b	LBB0_11
LBB0_6:
	add	x2, x22, #24
	ldr	w8, [x22, #28]
	cmp	w8, #0
	cneg	w8, w8, mi
	mov	x0, x1
	mov	x1, x8
	bl	_apply_envelope
	mul	w8, w0, w20
	mov	w9, #5
	movk	w9, #2, lsl #16
	umull	x9, w8, w9
	lsr	x9, x9, #32
	sub	w8, w8, w9
	add	w8, w9, w8, lsr #1
	lsr	w20, w8, #14
	ldr	x1, [x19, #16]
	cmn	x1, x20
	b.eq	LBB0_13
; %bb.7:
	ldr	w0, [x19, #4]
	ldr	w2, [x22, #4]
	mov	x3, x20
	bl	_ml_calculate_direction
	str	w0, [x19, #4]
	ldr	x1, [x19, #16]
	b	LBB0_14
LBB0_8:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	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
	b	_pr_err
LBB0_9:
	ldr	x1, [x19, #8]
	cmn	x1, x20
	b.eq	LBB0_17
; %bb.10:
	ldr	w0, [x19, #4]
	ldr	w2, [x22, #4]
	mov	x3, x20
LBB0_11:
	bl	_ml_calculate_direction
	str	w0, [x19, #4]
LBB0_12:
	ldr	w8, [x19, #16]
	add	w0, w8, w21
	b	LBB0_15
LBB0_13:
	str	wzr, [x19, #4]
LBB0_14:
	add	w0, w1, w20
LBB0_15:
	mov	w1, #65535
	bl	_min
	str	x0, [x19, #16]
	ldr	w8, [x19, #8]
	add	w0, w8, w20
	mov	w1, #65535
	bl	_min
	str	x0, [x19, #8]
LBB0_16:
	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_17:
	str	wzr, [x19, #4]
	b	LBB0_12
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid type in ml_combine_effects()\n"

	.no_dead_strip	_ml_combine_effects
.subsections_via_symbols
