	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_S_AdjustSoundParams            ## -- Begin function S_AdjustSoundParams
	.p2align	4, 0x90
_S_AdjustSoundParams:                   ## @S_AdjustSoundParams
	.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
	movq	%rcx, %r15
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r13
	movq	%rdi, %r12
	movq	16(%rdi), %rdi
	subq	16(%rsi), %rdi
	callq	_abs
	movl	%eax, %ebx
	movq	8(%r12), %rdi
	subq	8(%r13), %rdi
	callq	_abs
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%rbx), %r14d
	cmpl	%eax, %ebx
	cmovll	%ebx, %eax
	sarl	%eax
	subl	%eax, %r14d
	movq	_gamemap@GOTPCREL(%rip), %rbx
	cmpl	$8, (%rbx)
	movq	_S_CLIPPING_DIST@GOTPCREL(%rip), %rax
	je	LBB0_2
## %bb.1:
	xorl	%ecx, %ecx
	cmpl	(%rax), %r14d
	jg	LBB0_8
LBB0_2:
	movq	8(%r12), %rsi
	movq	16(%r12), %rdi
	movq	8(%r13), %rcx
	movq	16(%r13), %rdx
	callq	_R_PointToAngle2
	subq	(%r12), %rax
	movl	$4294967295, %ecx               ## imm = 0xFFFFFFFF
	leaq	(%rax,%rcx), %rdx
	cmovaq	%rax, %rdx
	movq	_ANGLETOFINESHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shrq	%cl, %rdx
	movq	_S_STEREO_SWING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_finesine@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%rdx,4), %esi
	callq	_FixedMul
	movq	_FRACBITS@GOTPCREL(%rip), %rdx
	movb	(%rdx), %cl
	sarl	%cl, %eax
	movl	$128, %ecx
	subl	%eax, %ecx
	movl	%ecx, (%r15)
	movq	_S_CLOSE_DIST@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jge	LBB0_4
## %bb.3:
	movq	_snd_SfxVolume@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_7
LBB0_4:
	cmpl	$8, (%rbx)
	jne	LBB0_6
## %bb.5:
	movq	_S_CLIPPING_DIST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %r14d
	cmovgel	%eax, %r14d
	movq	_snd_SfxVolume@GOTPCREL(%rip), %rsi
	subl	%r14d, %eax
	movb	(%rdx), %cl
	sarl	%cl, %eax
	movl	(%rsi), %ecx
	addl	$-15, %ecx
	imull	%ecx, %eax
	movq	_S_ATTENUATOR@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	addl	$15, %eax
	jmp	LBB0_7
LBB0_6:
	movq	_S_CLIPPING_DIST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	subl	%r14d, %eax
	movb	(%rdx), %cl
	sarl	%cl, %eax
	movq	_snd_SfxVolume@GOTPCREL(%rip), %rcx
	imull	(%rcx), %eax
	movq	_S_ATTENUATOR@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
LBB0_7:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	xorl	%ecx, %ecx
	testl	%eax, %eax
	setg	%cl
LBB0_8:
	movl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_gamemap,4,2                    ## @gamemap
	.comm	_S_CLIPPING_DIST,4,2            ## @S_CLIPPING_DIST
	.comm	_ANGLETOFINESHIFT,8,3           ## @ANGLETOFINESHIFT
	.comm	_S_STEREO_SWING,4,2             ## @S_STEREO_SWING
	.comm	_finesine,8,3                   ## @finesine
	.comm	_FRACBITS,4,2                   ## @FRACBITS
	.comm	_S_CLOSE_DIST,4,2               ## @S_CLOSE_DIST
	.comm	_snd_SfxVolume,4,2              ## @snd_SfxVolume
	.comm	_S_ATTENUATOR,4,2               ## @S_ATTENUATOR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_S_AdjustSoundParams            ; -- Begin function S_AdjustSoundParams
	.p2align	2
_S_AdjustSoundParams:                   ; @S_AdjustSoundParams
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x3
	mov	x19, x2
	mov	x22, x1
	mov	x21, x0
	ldr	x8, [x0, #16]
	ldr	x9, [x1, #16]
	sub	x0, x8, x9
	bl	_abs
	mov	x23, x0
	ldr	x8, [x21, #8]
	ldr	x9, [x22, #8]
	sub	x0, x8, x9
	bl	_abs
	add	w8, w0, w23
	cmp	w23, w0
	csel	w9, w23, w0, lt
	sub	w23, w8, w9, asr #1
Lloh0:
	adrp	x25, _gamemap@GOTPAGE
Lloh1:
	ldr	x25, [x25, _gamemap@GOTPAGEOFF]
	ldr	w8, [x25]
Lloh2:
	adrp	x24, _S_CLIPPING_DIST@GOTPAGE
Lloh3:
	ldr	x24, [x24, _S_CLIPPING_DIST@GOTPAGEOFF]
	ldr	w9, [x24]
	cmp	w8, #8
	ccmp	w23, w9, #4, ne
	b.gt	LBB0_3
; %bb.1:
	ldp	x1, x0, [x21, #8]
	ldp	x3, x2, [x22, #8]
	bl	_R_PointToAngle2
	ldr	x8, [x21]
	mov	w9, #-1
	subs	x8, x0, x8
	csel	x9, xzr, x9, hi
	add	x8, x8, x9
Lloh4:
	adrp	x9, _ANGLETOFINESHIFT@GOTPAGE
Lloh5:
	ldr	x9, [x9, _ANGLETOFINESHIFT@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	lsr	x8, x8, x9
Lloh7:
	adrp	x9, _S_STEREO_SWING@GOTPAGE
Lloh8:
	ldr	x9, [x9, _S_STEREO_SWING@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x9]
Lloh10:
	adrp	x9, _finesine@GOTPAGE
Lloh11:
	ldr	x9, [x9, _finesine@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	ldr	w1, [x9, x8, lsl #2]
	bl	_FixedMul
Lloh13:
	adrp	x8, _FRACBITS@GOTPAGE
Lloh14:
	ldr	x8, [x8, _FRACBITS@GOTPAGEOFF]
	ldr	w9, [x8]
	asr	w9, w0, w9
	mov	w10, #128
	sub	w9, w10, w9
	str	w9, [x20]
Lloh15:
	adrp	x9, _S_CLOSE_DIST@GOTPAGE
Lloh16:
	ldr	x9, [x9, _S_CLOSE_DIST@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	cmp	w23, w9
	b.ge	LBB0_4
; %bb.2:
Lloh18:
	adrp	x8, _snd_SfxVolume@GOTPAGE
Lloh19:
	ldr	x8, [x8, _snd_SfxVolume@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	b	LBB0_7
LBB0_3:
	mov	w0, #0
	b	LBB0_8
LBB0_4:
	ldr	w9, [x25]
	cmp	w9, #8
	b.ne	LBB0_6
; %bb.5:
	ldr	w9, [x24]
Lloh21:
	adrp	x10, _snd_SfxVolume@GOTPAGE
Lloh22:
	ldr	x10, [x10, _snd_SfxVolume@GOTPAGEOFF]
	cmp	w23, w9
	csel	w11, w23, w9, lt
Lloh23:
	ldr	w10, [x10]
	sub	w10, w10, #15
	sub	w9, w9, w11
	ldr	w8, [x8]
	asr	w8, w9, w8
	mul	w8, w8, w10
Lloh24:
	adrp	x9, _S_ATTENUATOR@GOTPAGE
Lloh25:
	ldr	x9, [x9, _S_ATTENUATOR@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	sdiv	w8, w8, w9
	add	w8, w8, #15
	b	LBB0_7
LBB0_6:
Lloh27:
	adrp	x9, _snd_SfxVolume@GOTPAGE
Lloh28:
	ldr	x9, [x9, _snd_SfxVolume@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	ldr	w10, [x24]
	sub	w10, w10, w23
	ldr	w8, [x8]
	asr	w8, w10, w8
	mul	w8, w8, w9
Lloh30:
	adrp	x9, _S_ATTENUATOR@GOTPAGE
Lloh31:
	ldr	x9, [x9, _S_ATTENUATOR@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	sdiv	w8, w8, w9
LBB0_7:
	str	w8, [x19]
	cmp	w8, #0
	cset	w0, gt
LBB0_8:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_gamemap,4,2                    ; @gamemap
	.comm	_S_CLIPPING_DIST,4,2            ; @S_CLIPPING_DIST
	.comm	_ANGLETOFINESHIFT,8,3           ; @ANGLETOFINESHIFT
	.comm	_S_STEREO_SWING,4,2             ; @S_STEREO_SWING
	.comm	_finesine,8,3                   ; @finesine
	.comm	_FRACBITS,4,2                   ; @FRACBITS
	.comm	_S_CLOSE_DIST,4,2               ; @S_CLOSE_DIST
	.comm	_snd_SfxVolume,4,2              ; @snd_SfxVolume
	.comm	_S_ATTENUATOR,4,2               ; @S_ATTENUATOR
.subsections_via_symbols
