	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_play_api_test                  ## -- Begin function play_api_test
	.p2align	4, 0x90
_play_api_test:                         ## @play_api_test
	.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
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -64(%rbp)                 ## 4-byte Spill
	movl	%edx, %r15d
	movl	%esi, %ebx
	movl	%edi, %r14d
	movl	%edi, -68(%rbp)                 ## 4-byte Spill
	movq	_BUFFER_SIZE_SAMPLES@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	imull	%esi, %r12d
	movl	%edx, %edi
	callq	_OUT_CHANNELS
	movl	%eax, %r13d
	imull	%r12d, %r13d
	shrl	$3, %r13d
	xorl	%edi, %edi
	movl	-64(%rbp), %r12d                ## 4-byte Reload
	cmpl	$2, %r12d
	setb	%dil
	callq	_assert
	leaq	-56(%rbp), %rdi
	movl	%r14d, %esi
	movl	%r15d, %r14d
	movl	%r15d, %edx
	movl	%ebx, -96(%rbp)                 ## 4-byte Spill
	movl	%ebx, %ecx
	movl	$10, %r8d
	movl	%r13d, -80(%rbp)                ## 4-byte Spill
	movl	%r13d, %r9d
	callq	_audioplay_create
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_assert
	movq	-56(%rbp), %rdi
	movq	_audio_dest@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%r12d, %rcx
	movl	(%rax,%rcx,4), %esi
	callq	_audioplay_set_dest
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_assert
	movl	-68(%rbp), %eax                 ## 4-byte Reload
	imull	$1000, %eax, %eax               ## imm = 0x3E8
	movl	%eax, -76(%rbp)                 ## 4-byte Spill
	cltd
	movq	_BUFFER_SIZE_SAMPLES@GOTPCREL(%rip), %rsi
	idivl	(%rsi)
	testl	%eax, %eax
	je	LBB0_17
## %bb.1:
	movl	$16777216, -72(%rbp)            ## 4-byte Folded Spill
                                        ## imm = 0x1000000
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rdi
	movq	-104(%rbp), %rsi                ## 8-byte Reload
	movl	-80(%rbp), %edx                 ## 4-byte Reload
	callq	_audioplay_play_buffer
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_assert
	movl	-84(%rbp), %r15d                ## 4-byte Reload
	incl	%r15d
	movl	-76(%rbp), %eax                 ## 4-byte Reload
	cltd
	movq	_BUFFER_SIZE_SAMPLES@GOTPCREL(%rip), %rcx
	idivl	(%rcx)
	cmpl	%eax, %r15d
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	jae	LBB0_17
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_12 Depth 2
                                        ##     Child Loop BB0_5 Depth 2
                                        ##       Child Loop BB0_7 Depth 3
                                        ##     Child Loop BB0_15 Depth 2
	movq	-56(%rbp), %rdi
	callq	_audioplay_get_buffer
	movq	%rax, %r13
	testq	%rax, %rax
	jne	LBB0_3
	.p2align	4, 0x90
LBB0_12:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	$10000, %edi                    ## imm = 0x2710
	callq	_usleep
	movq	-56(%rbp), %rdi
	callq	_audioplay_get_buffer
	testq	%rax, %rax
	je	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %r13
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_BUFFER_SIZE_SAMPLES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	movl	%r15d, -84(%rbp)                ## 4-byte Spill
	movq	%r13, -104(%rbp)                ## 8-byte Spill
	je	LBB0_11
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%ecx, %ecx
	movl	%r12d, %edi
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=2
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	addl	-88(%rbp), %r12d                ## 4-byte Folded Reload
	xorl	%eax, %eax
	movb	-41(%rbp), %cl                  ## 1-byte Reload
	movb	%cl, %al
	leal	(%rbx,%rax,2), %ebx
	decl	%ebx
	movl	-92(%rbp), %ecx                 ## 4-byte Reload
	incl	%ecx
	movl	%r12d, %edi
	movq	_BUFFER_SIZE_SAMPLES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jae	LBB0_11
LBB0_5:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_7 Depth 3
	movl	%ecx, -92(%rbp)                 ## 4-byte Spill
	movl	-72(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, %r12d
	movl	%edi, -88(%rbp)                 ## 4-byte Spill
	callq	_SIN
	movl	%eax, %r15d
	leal	(%rbx,%r12), %eax
	sarl	$16, %r12d
	movl	%eax, -72(%rbp)                 ## 4-byte Spill
	cmpl	$33554432, %eax                 ## imm = 0x2000000
	setl	-41(%rbp)                       ## 1-byte Folded Spill
	movl	%r14d, %edi
	callq	_OUT_CHANNELS
	testl	%eax, %eax
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	xorl	%r12d, %r12d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=3
	movl	%r15d, (%r13)
	addq	$4, %r13
	incl	%r12d
	movl	%r14d, %edi
	callq	_OUT_CHANNELS
	cmpl	%eax, %r12d
	jae	LBB0_10
LBB0_7:                                 ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_5 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	cmpl	$32, -96(%rbp)                  ## 4-byte Folded Reload
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=3
	movl	$0, (%r13)
	addq	$4, %r13
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %rdi
	callq	_audioplay_get_latency
	movq	_CTTW_SLEEP_TIME@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	movq	_MIN_LATENCY_TIME@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	addl	%ecx, %edx
	movl	-68(%rbp), %r15d                ## 4-byte Reload
	.p2align	4, 0x90
LBB0_15:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	imull	%r15d, %edx
	movslq	%edx, %rdx
	imulq	$274877907, %rdx, %rdx          ## imm = 0x10624DD3
	movq	%rdx, %rsi
	shrq	$63, %rsi
	sarq	$38, %rdx
	addl	%esi, %edx
	cmpl	%edx, %eax
	jle	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_15 Depth=2
	imull	$1000, %ecx, %edi               ## imm = 0x3E8
	callq	_usleep
	movq	-56(%rbp), %rdi
	callq	_audioplay_get_latency
	movl	(%r13), %ecx
	movl	(%r12), %edx
	addl	%ecx, %edx
	jmp	LBB0_15
LBB0_17:
	movq	-56(%rbp), %rdi
	callq	_audioplay_delete
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BUFFER_SIZE_SAMPLES,4,2        ## @BUFFER_SIZE_SAMPLES
	.comm	_audio_dest,8,3                 ## @audio_dest
	.comm	_MIN_LATENCY_TIME,4,2           ## @MIN_LATENCY_TIME
	.comm	_CTTW_SLEEP_TIME,4,2            ## @CTTW_SLEEP_TIME
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_play_api_test                  ; -- Begin function play_api_test
	.p2align	2
_play_api_test:                         ; @play_api_test
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x3
	mov	x19, x2
	mov	x20, x1
	mov	x22, x0
Lloh0:
	adrp	x24, _BUFFER_SIZE_SAMPLES@GOTPAGE
Lloh1:
	ldr	x24, [x24, _BUFFER_SIZE_SAMPLES@GOTPAGEOFF]
	ldr	w8, [x24]
	mul	w21, w8, w1
	mov	x0, x2
	bl	_OUT_CHANNELS
	mul	w8, w21, w0
	lsr	w21, w8, #3
	cmp	w23, #2
	cset	w0, lo
	bl	_assert
	add	x0, sp, #40
	mov	x1, x22
	mov	x2, x19
	mov	x3, x20
	mov	w4, #10
	str	w21, [sp, #20]                  ; 4-byte Folded Spill
	mov	x5, x21
	bl	_audioplay_create
	cmp	x0, #0
	cset	w0, eq
	bl	_assert
	ldr	x0, [sp, #40]
Lloh2:
	adrp	x8, _audio_dest@GOTPAGE
Lloh3:
	ldr	x8, [x8, _audio_dest@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	ldr	w1, [x8, w23, sxtw #2]
	bl	_audioplay_set_dest
	cmp	x0, #0
	cset	w0, eq
	bl	_assert
	mov	w8, #1000
	mul	w9, w22, w8
	ldr	w8, [x24]
	str	w9, [sp, #16]                   ; 4-byte Folded Spill
	sdiv	w8, w9, w8
	cbz	w8, LBB0_15
; %bb.1:
	mov	w21, #0
	mov	w28, #0
	mov	w23, #0
	mov	w27, #16777216
	str	w22, [sp, #12]                  ; 4-byte Folded Spill
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #10000
	bl	_usleep
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
                                        ;       Child Loop BB0_10 Depth 3
                                        ;     Child Loop BB0_13 Depth 2
	ldr	x0, [sp, #40]
	bl	_audioplay_get_buffer
	cbz	x0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh5:
	adrp	x8, _BUFFER_SIZE_SAMPLES@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BUFFER_SIZE_SAMPLES@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w21, [sp, #36]                  ; 4-byte Folded Spill
	str	x0, [sp, #24]                   ; 8-byte Folded Spill
	cbz	w8, LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w26, #0
	mov	x24, x0
	mov	x22, x27
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=2
	add	w23, w23, w22, asr #16
	add	w26, w26, #1
Lloh8:
	adrp	x8, _BUFFER_SIZE_SAMPLES@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BUFFER_SIZE_SAMPLES@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	mov	x22, x27
	cmp	w26, w8
	b.hs	LBB0_12
LBB0_7:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_10 Depth 3
	mov	x0, x23
	bl	_SIN
	mov	x25, x0
	sub	w8, w28, #1
	add	w10, w28, w22
	mov	w9, #33554432
	mov	x27, x10
	cmp	w10, w9
	csinc	w28, w8, w28, ge
	mov	x0, x19
	bl	_OUT_CHANNELS
	cbz	w0, LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	mov	w21, #0
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=3
	str	w25, [x24], #4
	add	w21, w21, #1
	mov	x0, x19
	bl	_OUT_CHANNELS
	cmp	w21, w0
	b.hs	LBB0_6
LBB0_10:                                ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_7 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	cmp	w20, #32
	b.ne	LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=3
	str	wzr, [x24], #4
	b	LBB0_9
LBB0_12:                                ;   in Loop: Header=BB0_3 Depth=1
	str	w27, [sp, #32]                  ; 4-byte Folded Spill
	ldr	x0, [sp, #40]
	bl	_audioplay_get_latency
Lloh11:
	adrp	x24, _MIN_LATENCY_TIME@GOTPAGE
Lloh12:
	ldr	x24, [x24, _MIN_LATENCY_TIME@GOTPAGEOFF]
	ldr	w9, [x24]
Lloh13:
	adrp	x25, _CTTW_SLEEP_TIME@GOTPAGE
Lloh14:
	ldr	x25, [x25, _CTTW_SLEEP_TIME@GOTPAGEOFF]
	ldr	w8, [x25]
	add	w9, w8, w9
	ldr	w21, [sp, #12]                  ; 4-byte Folded Reload
	mul	w9, w9, w21
	mov	w26, #19923
	movk	w26, #4194, lsl #16
	smull	x9, w9, w26
	lsr	x10, x9, #63
	asr	x9, x9, #38
	add	w9, w9, w10
	cmp	w0, w9
	mov	w22, #1000
	b.le	LBB0_14
LBB0_13:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mul	w0, w8, w22
	bl	_usleep
	ldr	x0, [sp, #40]
	bl	_audioplay_get_latency
	ldr	w9, [x24]
	ldr	w8, [x25]
	add	w9, w8, w9
	mul	w9, w9, w21
	smull	x9, w9, w26
	lsr	x10, x9, #63
	asr	x9, x9, #38
	add	w9, w9, w10
	cmp	w0, w9
	b.gt	LBB0_13
LBB0_14:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [sp, #40]
	ldr	x1, [sp, #24]                   ; 8-byte Folded Reload
	ldr	w2, [sp, #20]                   ; 4-byte Folded Reload
	bl	_audioplay_play_buffer
	cmp	x0, #0
	cset	w0, eq
	bl	_assert
	ldp	w27, w21, [sp, #32]             ; 8-byte Folded Reload
	add	w21, w21, #1
Lloh15:
	adrp	x8, _BUFFER_SIZE_SAMPLES@GOTPAGE
Lloh16:
	ldr	x8, [x8, _BUFFER_SIZE_SAMPLES@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	ldr	w9, [sp, #16]                   ; 4-byte Folded Reload
	sdiv	w8, w9, w8
	cmp	w21, w8
	b.lo	LBB0_3
LBB0_15:
	ldr	x0, [sp, #40]
	bl	_audioplay_delete
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_BUFFER_SIZE_SAMPLES,4,2        ; @BUFFER_SIZE_SAMPLES
	.comm	_audio_dest,8,3                 ; @audio_dest
	.comm	_MIN_LATENCY_TIME,4,2           ; @MIN_LATENCY_TIME
	.comm	_CTTW_SLEEP_TIME,4,2            ; @CTTW_SLEEP_TIME
.subsections_via_symbols
