	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function thread_job
_thread_job:                            ## @thread_job
	.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
	testq	%rdi, %rdi
	je	LBB0_23
## %bb.1:
	movq	%rdi, %r13
	cmpq	$0, 48(%rdi)
	je	LBB0_23
## %bb.2:
	leaq	12(%r13), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	leaq	8(%r13), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	leaq	4(%r13), %r14
	xorl	%eax, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_3 Depth=1
	xorl	%ebx, %ebx
LBB0_21:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_svcSleepThread
	cmpq	$0, 48(%r13)
	je	LBB0_23
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	testq	%rbx, %rbx
	je	LBB0_4
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutexLock
	cmpq	$0, 24(%r13)
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_3 Depth=1
	xorl	%edi, %edi
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_BUFFER_COUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testq	%rax, %rax
	je	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	40(%r13), %rbx
	movq	_AudioDriverWaveBufState_Free@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movq	_AudioDriverWaveBufState_Done@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%rbx), %rdi
	cmpq	%rdx, %rdi
	je	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	cmpq	%rsi, %rdi
	je	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=2
	incq	%rcx
	addq	$8, %rbx
	cmpq	%rcx, %rax
	jne	LBB0_6
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	callq	_audrvUpdate
	xorl	%eax, %eax
	callq	_audrenWaitFrame
	xorl	%ebx, %ebx
	cmpq	$0, 48(%r13)
	jne	LBB0_3
	jmp	LBB0_23
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	16(%r13), %edi
	callq	_fifo_read_avail
	movq	%rax, %rdi
LBB0_14:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r13), %esi
	subq	%r12, %rsi
	callq	_MIN
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%rax, %r15
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r12), %r14
	movl	16(%r13), %edi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_fifo_read
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutexUnlock
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_condvarWakeAll
	addq	%r15, %r12
	movq	%r14, %rdi
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r15, %rsi
	callq	_armDCacheFlush
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutexUnlock
LBB0_17:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r13), %eax
	cmpq	%rax, %r12
	jne	LBB0_21
## %bb.18:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	_audrvVoiceAddWaveBuf
	movq	%r14, %rdi
	callq	_audrvUpdate
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_audrvVoiceIsPlaying
	testl	%eax, %eax
	jne	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_audrvVoiceStart
	jmp	LBB0_20
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	imull	(%r13), %ecx
	addq	32(%r13), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	jmp	LBB0_11
LBB0_23:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BUFFER_COUNT,4,2               ## @BUFFER_COUNT
	.comm	_AudioDriverWaveBufState_Free,8,3 ## @AudioDriverWaveBufState_Free
	.comm	_AudioDriverWaveBufState_Done,8,3 ## @AudioDriverWaveBufState_Done
	.no_dead_strip	_thread_job
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function thread_job
_thread_job:                            ; @thread_job
	.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
	cbz	x0, LBB0_21
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #48]
	cbz	x8, LBB0_21
; %bb.2:
	mov	x27, #0
	mov	x23, #0
	mov	x26, #0
	add	x20, x19, #12
	add	x21, x19, #8
	add	x22, x19, #4
Lloh0:
	adrp	x28, _BUFFER_COUNT@GOTPAGE
Lloh1:
	ldr	x28, [x28, _BUFFER_COUNT@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x23, #0
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #1000
	bl	_svcSleepThread
	ldr	x8, [x19, #48]
	cbz	x8, LBB0_21
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	cbz	x23, LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
	bl	_mutexLock
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_13
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, #0
	b	LBB0_14
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x28]
	cbz	w8, LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x9, #0
	ldr	x23, [x19, #40]
Lloh2:
	adrp	x10, _AudioDriverWaveBufState_Free@GOTPAGE
Lloh3:
	ldr	x10, [x10, _AudioDriverWaveBufState_Free@GOTPAGEOFF]
Lloh4:
	ldr	x10, [x10]
Lloh5:
	adrp	x11, _AudioDriverWaveBufState_Done@GOTPAGE
Lloh6:
	ldr	x11, [x11, _AudioDriverWaveBufState_Done@GOTPAGEOFF]
Lloh7:
	ldr	x11, [x11]
LBB0_10:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x12, [x23]
	cmp	x12, x10
	ccmp	x12, x11, #4, ne
	b.eq	LBB0_20
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	add	x9, x9, #1
	add	x23, x23, #8
	cmp	x8, x9
	b.ne	LBB0_10
LBB0_12:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	bl	_audrvUpdate
	bl	_audrenWaitFrame
	mov	x23, #0
	ldr	x8, [x19, #48]
	cbnz	x8, LBB0_5
	b	LBB0_21
LBB0_13:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x19, #16]
	bl	_fifo_read_avail
LBB0_14:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x19]
	sub	x1, x8, x26
	bl	_MIN
	cbz	x0, LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x24, x0
	add	x25, x27, x26
	ldr	w0, [x19, #16]
	mov	x1, x25
	mov	x2, x24
	bl	_fifo_read
	mov	x0, x20
	bl	_mutexUnlock
	mov	x0, x21
	bl	_condvarWakeAll
	add	x26, x24, x26
	mov	x0, x25
	mov	x1, x24
	bl	_armDCacheFlush
	b	LBB0_17
LBB0_16:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
	bl	_mutexUnlock
LBB0_17:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x19]
	cmp	x26, x8
	b.ne	LBB0_4
; %bb.18:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	mov	w1, #0
	mov	x2, x23
	bl	_audrvVoiceAddWaveBuf
	mov	x0, x22
	bl	_audrvUpdate
	mov	x0, x22
	mov	w1, #0
	bl	_audrvVoiceIsPlaying
	cbnz	w0, LBB0_3
; %bb.19:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	mov	w1, #0
	bl	_audrvVoiceStart
	b	LBB0_3
LBB0_20:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x26, #0
	ldr	x8, [x19, #32]
	ldr	w10, [x19]
	mul	w9, w10, w9
	add	x27, x8, x9
	b	LBB0_6
LBB0_21:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_BUFFER_COUNT,4,2               ; @BUFFER_COUNT
	.comm	_AudioDriverWaveBufState_Free,8,3 ; @AudioDriverWaveBufState_Free
	.comm	_AudioDriverWaveBufState_Done,8,3 ; @AudioDriverWaveBufState_Done
	.no_dead_strip	_thread_job
.subsections_via_symbols
