	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function InitAudio
_InitAudio:                             ## @InitAudio
	.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
	movl	%esi, %r14d
	movq	%rdi, %r12
	movq	16(%rdi), %rax
	movl	4(%rax), %edi
	callq	_hb_list_item
	cmpq	$0, 56(%rax)
	je	LBB0_7
## %bb.1:
	movq	%rax, %rbx
	movl	$1, %edi
	movl	$48, %esi
	callq	_calloc
	movq	%rax, %r13
	testq	%rax, %rax
	je	LBB0_8
## %bb.2:
	movq	16(%r12), %rax
	movl	(%rax), %edi
	movq	_WORK_SYNC_AUDIO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_hb_get_work
	movq	%rax, %r15
	movq	%r13, 40(%rax)
	movq	%rbx, 32(%rax)
	movq	56(%rbx), %rax
	movq	%rax, 24(%r15)
	movq	_HB_ACODEC_PASS_FLAG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ecx, %ecx
	andl	(%rbx), %eax
	setne	%cl
	movl	48(%rbx,%rcx,4), %eax
	movl	%eax, 8(%r15)
	movq	%r12, 16(%r13)
	movq	8(%r12), %rax
	movslq	%r14d, %rcx
	shlq	$7, %rcx
	leaq	(%rcx,%rax), %rdx
	addq	$128, %rdx
	movq	%rdx, (%r13)
	movq	%r12, 248(%rcx,%rax)
	xorl	%eax, %eax
	callq	_hb_list_init
	movq	(%r13), %rcx
	movq	%rax, 8(%rcx)
	xorl	%eax, %eax
	callq	_hb_list_init
	movq	(%r13), %rcx
	movq	%rax, 112(%rcx)
	movq	_SYNC_MAX_AUDIO_QUEUE_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 104(%rcx)
	movq	_SYNC_MIN_AUDIO_QUEUE_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 100(%rcx)
	cmpq	$0, 8(%rcx)
	je	LBB0_14
## %bb.3:
	xorl	%eax, %eax
	callq	_hb_list_init
	movq	(%r13), %rdi
	movq	%rax, 16(%rdi)
	testq	%rax, %rax
	je	LBB0_15
## %bb.4:
	movq	_SYNC_TYPE_AUDIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 96(%rdi)
	movq	_AV_NOPTS_VALUE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 88(%rdi)
	movq	%rax, 80(%rdi)
	movq	%rax, 72(%rdi)
	movq	%rax, 64(%rdi)
	movl	$-1, (%rdi)
	movq	%rax, 56(%rdi)
	movq	%rbx, 40(%rdi)
	movl	8(%r15), %eax
	movl	%eax, 48(%rdi)
	movq	_HB_ACODEC_PASS_FLAG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	jne	LBB0_6
## %bb.5:
	movq	8(%rbx), %rsi
	cmpq	%rsi, 32(%rbx)
	jne	LBB0_9
LBB0_6:
	movslq	16(%rbx), %rax
	imulq	$1717986919, %rax, %rsi         ## imm = 0x66666667
	movq	%rsi, %rax
	shrq	$63, %rax
	sarq	$35, %rsi
	addl	%eax, %esi
	movl	$10, %edi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_pow
	movq	(%r13), %rcx
	movl	%eax, 32(%rcx)
	movl	(%r12), %edi
	movq	%r15, %rsi
	callq	_hb_list_add
LBB0_7:
	xorl	%ebx, %ebx
	jmp	LBB0_20
LBB0_8:
	xorl	%r15d, %r15d
	jmp	LBB0_18
LBB0_9:
	movq	_AV_SAMPLE_FMT_FLT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	20(%rbx), %ecx
	movl	24(%rbx), %edx
	callq	_hb_audio_resample_init
	movq	(%r13), %rcx
	movq	%rax, 24(%rcx)
	testq	%rax, %rax
	je	LBB0_12
## %bb.10:
	movq	32(%rbx), %rsi
	movq	%rax, %rdi
	callq	_hb_audio_resample_set_sample_rate
	movq	(%r13), %rax
	movq	24(%rax), %rdi
	callq	_hb_audio_resample_update
	testq	%rax, %rax
	je	LBB0_6
## %bb.11:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_13
LBB0_12:
	leaq	L_.str(%rip), %rdi
LBB0_13:
	movl	40(%rbx), %esi
	callq	_hb_error
LBB0_14:
	movq	(%r13), %rdi
	testq	%rdi, %rdi
	je	LBB0_18
LBB0_15:
	movq	24(%rdi), %rax
	testq	%rax, %rax
	movl	$1, %ebx
	je	LBB0_17
## %bb.16:
	movq	%rax, %rdi
	callq	_hb_audio_resample_free
	movq	(%r13), %rdi
LBB0_17:
	addq	$16, %rdi
	callq	_hb_list_close
	movq	(%r13), %rdi
	addq	$8, %rdi
	callq	_hb_list_close
	jmp	LBB0_19
LBB0_18:
	movl	$1, %ebx
LBB0_19:
	movq	%r13, %rdi
	callq	_free
	movq	%r15, %rdi
	callq	_free
LBB0_20:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WORK_SYNC_AUDIO,4,2            ## @WORK_SYNC_AUDIO
	.comm	_HB_ACODEC_PASS_FLAG,4,2        ## @HB_ACODEC_PASS_FLAG
	.comm	_SYNC_MAX_AUDIO_QUEUE_LEN,4,2   ## @SYNC_MAX_AUDIO_QUEUE_LEN
	.comm	_SYNC_MIN_AUDIO_QUEUE_LEN,4,2   ## @SYNC_MIN_AUDIO_QUEUE_LEN
	.comm	_SYNC_TYPE_AUDIO,4,2            ## @SYNC_TYPE_AUDIO
	.comm	_AV_NOPTS_VALUE,8,3             ## @AV_NOPTS_VALUE
	.comm	_AV_SAMPLE_FMT_FLT,4,2          ## @AV_SAMPLE_FMT_FLT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sync: audio 0x%x resample init failed"

L_.str.1:                               ## @.str.1
	.asciz	"sync: audio 0x%x resample update failed"

	.no_dead_strip	_InitAudio
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function InitAudio
_InitAudio:                             ; @InitAudio
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [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 w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x23, x1
	mov	x21, x0
	ldr	x8, [x0, #16]
	ldr	w0, [x8, #4]
	bl	_hb_list_item
	ldr	x8, [x0, #56]
	cbz	x8, LBB0_7
; %bb.1:
	mov	x22, x0
	mov	w0, #1
	mov	w1, #48
	bl	_calloc
	mov	x19, x0
	cbz	x0, LBB0_8
; %bb.2:
	ldr	x8, [x21, #16]
	ldr	w0, [x8]
Lloh0:
	adrp	x8, _WORK_SYNC_AUDIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WORK_SYNC_AUDIO@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_hb_get_work
	mov	x20, x0
	str	x19, [x0, #40]
	ldr	x8, [x22, #56]
	stp	x8, x22, [x0, #24]
	ldr	w8, [x22]
Lloh3:
	adrp	x24, _HB_ACODEC_PASS_FLAG@GOTPAGE
Lloh4:
	ldr	x24, [x24, _HB_ACODEC_PASS_FLAG@GOTPAGEOFF]
	ldr	w9, [x24]
	tst	w9, w8
	mov	w8, #52
	mov	w9, #48
	csel	x8, x9, x8, eq
	ldr	w8, [x22, x8]
	str	w8, [x0, #8]
	str	x21, [x19, #16]
	ldr	x8, [x21, #8]
	sxtw	x9, w23
	add	x8, x8, x9, lsl #7
	add	x9, x8, #128
	str	x9, [x19]
	str	x21, [x8, #248]
	bl	_hb_list_init
	ldr	x8, [x19]
	str	x0, [x8, #8]
	bl	_hb_list_init
	ldr	x8, [x19]
	str	x0, [x8, #112]
Lloh5:
	adrp	x9, _SYNC_MAX_AUDIO_QUEUE_LEN@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SYNC_MAX_AUDIO_QUEUE_LEN@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
Lloh8:
	adrp	x10, _SYNC_MIN_AUDIO_QUEUE_LEN@GOTPAGE
Lloh9:
	ldr	x10, [x10, _SYNC_MIN_AUDIO_QUEUE_LEN@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	stp	w10, w9, [x8, #100]
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_14
; %bb.3:
	bl	_hb_list_init
	ldr	x8, [x19]
	str	x0, [x8, #16]
	cbz	x0, LBB0_15
; %bb.4:
Lloh11:
	adrp	x9, _SYNC_TYPE_AUDIO@GOTPAGE
Lloh12:
	ldr	x9, [x9, _SYNC_TYPE_AUDIO@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	str	w9, [x8, #96]
Lloh14:
	adrp	x9, _AV_NOPTS_VALUE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _AV_NOPTS_VALUE@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	stp	x9, x9, [x8, #80]
	stp	x9, x9, [x8, #64]
	mov	w10, #-1
	str	w10, [x8]
	str	x9, [x8, #56]
	str	x22, [x8, #40]
	ldr	w9, [x20, #8]
	str	w9, [x8, #48]
	ldr	w8, [x22]
	ldr	w9, [x24]
	tst	w9, w8
	b.ne	LBB0_6
; %bb.5:
	ldr	x8, [x22, #32]
	ldr	x1, [x22, #8]
	cmp	x8, x1
	b.ne	LBB0_9
LBB0_6:
	ldrsw	x8, [x22, #16]
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #32
	lsr	x8, x8, #63
	add	w1, w8, w9, asr #3
	mov	w0, #10
	bl	_pow
	ldr	x8, [x19]
	str	w0, [x8, #32]
	ldr	w0, [x21]
	mov	x1, x20
	bl	_hb_list_add
LBB0_7:
	mov	w0, #0
	b	LBB0_19
LBB0_8:
	mov	x20, #0
	b	LBB0_18
LBB0_9:
Lloh17:
	adrp	x8, _AV_SAMPLE_FMT_FLT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AV_SAMPLE_FMT_FLT@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	ldp	w3, w2, [x22, #20]
	bl	_hb_audio_resample_init
	ldr	x8, [x19]
	str	x0, [x8, #24]
	cbz	x0, LBB0_12
; %bb.10:
	ldr	x1, [x22, #32]
	bl	_hb_audio_resample_set_sample_rate
	ldr	x8, [x19]
	ldr	x0, [x8, #24]
	bl	_hb_audio_resample_update
	cbz	x0, LBB0_6
; %bb.11:
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_13
LBB0_12:
Lloh22:
	adrp	x0, l_.str@PAGE
Lloh23:
	add	x0, x0, l_.str@PAGEOFF
LBB0_13:
	ldr	w1, [x22, #40]
	bl	_hb_error
LBB0_14:
	ldr	x8, [x19]
	cbz	x8, LBB0_18
LBB0_15:
	ldr	x0, [x8, #24]
	cbz	x0, LBB0_17
; %bb.16:
	bl	_hb_audio_resample_free
	ldr	x8, [x19]
LBB0_17:
	add	x0, x8, #16
	bl	_hb_list_close
	ldr	x8, [x19]
	add	x0, x8, #8
	bl	_hb_list_close
LBB0_18:
	mov	x0, x19
	bl	_free
	mov	x0, x20
	bl	_free
	mov	w0, #1
LBB0_19:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_WORK_SYNC_AUDIO,4,2            ; @WORK_SYNC_AUDIO
	.comm	_HB_ACODEC_PASS_FLAG,4,2        ; @HB_ACODEC_PASS_FLAG
	.comm	_SYNC_MAX_AUDIO_QUEUE_LEN,4,2   ; @SYNC_MAX_AUDIO_QUEUE_LEN
	.comm	_SYNC_MIN_AUDIO_QUEUE_LEN,4,2   ; @SYNC_MIN_AUDIO_QUEUE_LEN
	.comm	_SYNC_TYPE_AUDIO,4,2            ; @SYNC_TYPE_AUDIO
	.comm	_AV_NOPTS_VALUE,8,3             ; @AV_NOPTS_VALUE
	.comm	_AV_SAMPLE_FMT_FLT,4,2          ; @AV_SAMPLE_FMT_FLT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sync: audio 0x%x resample init failed"

l_.str.1:                               ; @.str.1
	.asciz	"sync: audio 0x%x resample update failed"

	.no_dead_strip	_InitAudio
.subsections_via_symbols
