	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rsnd_cb_thread
_rsnd_cb_thread:                        ## @rsnd_cb_thread
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %rax
	movq	48(%rdi), %rbx
	cmpq	%rbx, %rax
	movq	%rbx, %rcx
	cmovbq	%rax, %rcx
	testq	%rax, %rax
	cmoveq	%rbx, %rcx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	leaq	(,%rbx,4), %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -56(%rbp)                 ## 8-byte Spill
	cmpq	$0, 80(%r13)
	je	LBB0_12
## %bb.1:
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	testq	%rbx, %rbx
	je	LBB0_3
	.p2align	4, 0x90
LBB0_4:
	xorl	%r14d, %r14d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	$1, %edi
	callq	_retro_sleep
	movq	-64(%rbp), %rax                 ## 8-byte Reload
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movq	48(%r13), %rbx
	movq	%rax, %r14
	cmpq	%rax, %rbx
	jbe	LBB0_10
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	subq	%r14, %rbx
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	cmpq	%rbx, %rax
	cmovbq	%rax, %rbx
	movq	%r13, %rdi
	callq	_rsd_callback_lock
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r14,4), %rdi
	movl	60(%r13), %edx
	movq	%rbx, %rsi
	callq	*8(%r13)
	movq	%rax, %r15
	movq	%r13, %rdi
	callq	_rsd_callback_unlock
	leaq	(%r15,%r14), %rax
	movq	%rbx, %r12
	subq	%r15, %r12
	jbe	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	callq	_rsd_delay_ms
	movl	16(%r13), %ecx
	movl	%ecx, %edx
	shrl	$31, %edx
	addl	%ecx, %edx
	sarl	%edx
	cmpl	%eax, %edx
	jle	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	movl	%r15d, %edx
	callq	_RSD_DEBUG
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rax,%rcx,4), %rdi
	xorl	%esi, %esi
	movq	%r12, %rdx
	callq	_memset
	addq	%rbx, %r14
	movq	%r14, %rax
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_3:
	xorl	%ebx, %ebx
LBB0_10:
	movl	76(%r13), %edi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%rbx, %rdx
	movl	$1, %ecx
	callq	_rsnd_send_chunk
	cmpq	48(%r13), %rax
	jne	LBB0_11
## %bb.14:
	cmpl	$0, 20(%r13)
	jne	LBB0_16
## %bb.15:
	xorl	%eax, %eax
	callq	_rsnd_get_time_usec
	movl	%eax, 56(%r13)
	movl	$1, 20(%r13)
	movq	48(%r13), %rax
LBB0_16:
	addl	24(%r13), %eax
	movl	%eax, 24(%r13)
	movq	_RSD_CONN_PROTO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 28(%r13)
	je	LBB0_19
## %bb.17:
	movl	36(%r13), %ecx
	imull	32(%r13), %ecx
	imull	40(%r13), %ecx
	cmpl	%ecx, %eax
	jle	LBB0_19
## %bb.18:
	movq	%r13, %rdi
	callq	_rsnd_send_info_query
	movq	%r13, %rdi
	callq	_rsnd_update_server_info
	cmpl	$0, 20(%r13)
	je	LBB0_20
LBB0_19:
	movq	%r13, %rdi
	callq	_rsd_delay_wait
LBB0_20:
	cmpq	$0, 80(%r13)
	je	LBB0_12
## %bb.21:
	movq	48(%r13), %rbx
	testq	%rbx, %rbx
	jne	LBB0_4
	jmp	LBB0_3
LBB0_11:
	movq	%r13, %rdi
	callq	_rsnd_reset
	movl	72(%r13), %edi
	callq	_sthread_detach
	movl	60(%r13), %edi
	callq	*64(%r13)
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_13
## %bb.22:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[RSound] Callback thread: Requested %d bytes, got %d.\n"

	.comm	_RSD_CONN_PROTO,4,2             ## @RSD_CONN_PROTO
	.no_dead_strip	_rsnd_cb_thread
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rsnd_cb_thread
_rsnd_cb_thread:                        ; @rsnd_cb_thread
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	sub	sp, sp, #16
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	ldr	x2, [x0, #48]
	ldr	x8, [x0]
	cmp	x8, x2
	ccmp	x8, #0, #4, lo
	csel	x25, x8, x2, ne
	lsl	x8, x2, #2
	mov	x9, x8
Lloh3:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh4:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0xfffffffffffffff0
	sub	x20, x9, x8
	mov	sp, x20
	ldr	x8, [x0, #80]
	cbz	x8, LBB0_18
; %bb.1:
Lloh5:
	adrp	x27, _RSD_CONN_PROTO@GOTPAGE
Lloh6:
	ldr	x27, [x27, _RSD_CONN_PROTO@GOTPAGEOFF]
Lloh7:
	adrp	x21, l_.str@PAGE
Lloh8:
	add	x21, x21, l_.str@PAGEOFF
	cbz	x2, LBB0_8
LBB0_2:
	mov	x28, #0
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #1
	bl	_retro_sleep
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x2, [x19, #48]
	mov	x28, x26
	cmp	x2, x26
	b.ls	LBB0_8
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	sub	x8, x2, x28
	cmp	x25, x8
	csel	x22, x25, x8, lo
	mov	x0, x19
	bl	_rsd_callback_lock
	ldr	x8, [x19, #8]
	add	x0, x20, x28, lsl #2
	ldr	w2, [x19, #60]
	mov	x1, x22
	blr	x8
	mov	x24, x0
	mov	x0, x19
	bl	_rsd_callback_unlock
	add	x26, x24, x28
	subs	x23, x22, x24
	b.ls	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	bl	_rsd_delay_ms
	ldr	w8, [x19, #16]
	cmp	w8, #0
	cinc	w8, w8, lt
	cmp	w0, w8, asr #1
	b.ge	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x21
	mov	x1, x22
	mov	x2, x24
	bl	_RSD_DEBUG
	add	x0, x20, x26, lsl #2
	mov	w1, #0
	mov	x2, x23
	bl	_memset
	add	x26, x22, x28
	b	LBB0_4
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #76]
	mov	x1, x20
	mov	w3, #1
	bl	_rsnd_send_chunk
	ldr	x8, [x19, #48]
	cmp	x0, x8
	b.ne	LBB0_17
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x19, #20]
	cbnz	w8, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	bl	_rsnd_get_time_usec
	str	w0, [x19, #56]
	mov	w8, #1
	str	w8, [x19, #20]
	ldr	x0, [x19, #48]
LBB0_11:                                ;   in Loop: Header=BB0_8 Depth=1
	ldp	w8, w9, [x19, #24]
	add	w8, w8, w0
	str	w8, [x19, #24]
	ldr	w10, [x27]
	tst	w10, w9
	b.eq	LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	ldp	w9, w10, [x19, #32]
	mul	w9, w10, w9
	ldr	w10, [x19, #40]
	mul	w9, w9, w10
	cmp	w8, w9
	b.le	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x19
	bl	_rsnd_send_info_query
	mov	x0, x19
	bl	_rsnd_update_server_info
	ldr	w8, [x19, #20]
	cbz	w8, LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x19
	bl	_rsd_delay_wait
LBB0_15:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x19, #80]
	cbz	x8, LBB0_18
; %bb.16:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	x2, [x19, #48]
	cbnz	x2, LBB0_2
	b	LBB0_8
LBB0_17:
	mov	x0, x19
	bl	_rsnd_reset
	ldr	w0, [x19, #72]
	bl	_sthread_detach
	ldr	x8, [x19, #64]
	ldr	w0, [x19, #60]
	blr	x8
LBB0_18:
	ldur	x8, [x29, #-88]
Lloh9:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh10:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_20
; %bb.19:
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_20:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[RSound] Callback thread: Requested %d bytes, got %d.\n"

	.comm	_RSD_CONN_PROTO,4,2             ; @RSD_CONN_PROTO
	.no_dead_strip	_rsnd_cb_thread
.subsections_via_symbols
