	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function DSOUND_AmpFactorToVolPan
LCPI0_0:
	.quad	0xc0c3880000000000              ## double -1.0E+4
LCPI0_1:
	.quad	0x40efffe000000000              ## double 65535
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_DSOUND_AmpFactorToVolPan
	.p2align	4, 0x90
_DSOUND_AmpFactorToVolPan:              ## @DSOUND_AmpFactorToVolPan
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_TRACE
	movq	(%rbx), %rsi
	movq	8(%rbx), %rdx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
	movq	(%rbx), %rax
	movsd	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero
	movapd	%xmm0, %xmm3
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	divsd	LCPI0_1(%rip), %xmm0
	cvttsd2si	%xmm0, %edi
	callq	_log
	imull	$600, %eax, %r14d               ## imm = 0x258
	movl	$2, %edi
	callq	_log
	movsd	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero
	movl	%eax, %ecx
	movl	%r14d, %eax
	cltd
	idivl	%ecx
	xorps	%xmm3, %xmm3
	cvtsi2sd	%eax, %xmm3
LBB0_2:
	movq	8(%rbx), %rax
	movapd	%xmm0, %xmm1
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	divsd	LCPI0_1(%rip), %xmm0
	cvttsd2si	%xmm0, %edi
	movsd	%xmm3, -24(%rbp)                ## 8-byte Spill
	callq	_log
	imull	$600, %eax, %r14d               ## imm = 0x258
	movl	$2, %edi
	callq	_log
	movsd	-24(%rbp), %xmm3                ## 8-byte Reload
                                        ## xmm3 = mem[0],zero
	movsd	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero
	movl	%eax, %ecx
	movl	%r14d, %eax
	cltd
	idivl	%ecx
	xorps	%xmm1, %xmm1
	cvtsi2sd	%eax, %xmm1
LBB0_4:
	xorl	%eax, %eax
	ucomisd	%xmm3, %xmm1
	seta	%al
	movapd	%xmm1, %xmm2
	maxsd	%xmm3, %xmm2
	movq	(%rbx,%rax,8), %rax
	movsd	%xmm2, 16(%rbx)
	movq	%rax, 24(%rbx)
	ucomisd	%xmm2, %xmm0
	jbe	LBB0_6
## %bb.5:
	movabsq	$-4556648864387432448, %rax     ## imm = 0xC0C3880000000000
	movq	%rax, 16(%rbx)
	movsd	LCPI0_0(%rip), %xmm2            ## xmm2 = mem[0],zero
LBB0_6:
	subsd	%xmm3, %xmm1
	movsd	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero
	maxsd	%xmm1, %xmm0
	movsd	%xmm0, 32(%rbx)
	cvttsd2si	%xmm2, %rsi
	leaq	L_.str.2(%rip), %rdi
	movb	$1, %al
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_TRACE                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(%p)\n"

L_.str.1:                               ## @.str.1
	.asciz	"left=%x, right=%x\n"

L_.str.2:                               ## @.str.2
	.asciz	"Vol=%d Pan=%d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DSOUND_AmpFactorToVolPan       ; -- Begin function DSOUND_AmpFactorToVolPan
	.p2align	2
_DSOUND_AmpFactorToVolPan:              ; @DSOUND_AmpFactorToVolPan
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	d9, d8, [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 b8, -40
	.cfi_offset b9, -48
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_TRACE
	ldp	x1, x8, [x19]
	str	x8, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_TRACE
	ldr	x8, [x19]
	cbz	x8, LBB0_3
; %bb.1:
	scvtf	d0, x8
	mov	x8, #281337537757184
	movk	x8, #16623, lsl #48
	fmov	d1, x8
	fdiv	d0, d0, d1
	fcvtzs	w0, d0
	bl	_log
	mov	w8, #600
	mul	w20, w0, w8
	mov	w0, #2
	bl	_log
	sdiv	w8, w20, w0
	scvtf	d8, w8
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_4
LBB0_2:
	scvtf	d0, x8
	mov	x8, #281337537757184
	movk	x8, #16623, lsl #48
	fmov	d1, x8
	fdiv	d0, d0, d1
	fcvtzs	w0, d0
	bl	_log
	mov	w8, #600
	mul	w20, w0, w8
	mov	w0, #2
	bl	_log
	sdiv	w8, w20, w0
	scvtf	d0, w8
	b	LBB0_5
LBB0_3:
	mov	x8, #149533581377536
	movk	x8, #49347, lsl #48
	fmov	d8, x8
	ldr	x8, [x19, #8]
	cbnz	x8, LBB0_2
LBB0_4:
	mov	x8, #149533581377536
	movk	x8, #49347, lsl #48
	fmov	d0, x8
LBB0_5:
	fcmp	d8, d0
	cset	w8, mi
	ldr	x8, [x19, w8, uxtw #3]
	fcsel	d1, d0, d8, mi
	str	d1, [x19, #16]
	str	x8, [x19, #24]
	mov	x8, #149533581377536
	movk	x8, #49347, lsl #48
	fmov	d2, x8
	fcmp	d1, d2
	b.pl	LBB0_7
; %bb.6:
	str	x8, [x19, #16]
	fmov	d1, x8
LBB0_7:
	fsub	d0, d0, d8
	mov	x8, #149533581377536
	movk	x8, #49347, lsl #48
	fmov	d2, x8
	fmax	d0, d0, d2
	str	d0, [x19, #32]
	fcvtzs	x1, d1
	str	d0, [sp]
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_TRACE
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #16]               ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(%p)\n"

l_.str.1:                               ; @.str.1
	.asciz	"left=%x, right=%x\n"

l_.str.2:                               ; @.str.2
	.asciz	"Vol=%d Pan=%d\n"

.subsections_via_symbols
