	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function open_audio
LCPI0_0:
	.quad	0x405b800000000000              ## double 110
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_open_audio:                            ## @open_audio
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	$0, -40(%rbp)
	movq	48(%rdx), %rbx
	leaq	-40(%rbp), %r12
	movq	%r12, %rdi
	movq	%rcx, %rsi
	xorl	%edx, %edx
	callq	_av_dict_copy
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	callq	_avcodec_open2
	movl	%eax, %r15d
	movq	%r12, %rdi
	callq	_av_dict_free
	testl	%r15d, %r15d
	js	LBB0_11
## %bb.1:
	movq	$0, 40(%r14)
	movq	_M_PI@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	addl	%ecx, %ecx
	cvtsi2sd	%ecx, %xmm0
	movsd	LCPI0_0(%rip), %xmm1            ## xmm1 = mem[0],zero
	mulsd	%xmm1, %xmm0
	movl	(%rbx), %edx
	cvtsi2sd	%edx, %xmm2
	divsd	%xmm2, %xmm0
	cvttsd2si	%xmm0, %ecx
	movl	%ecx, (%r14)
	movl	(%rax), %eax
	addl	%eax, %eax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	mulsd	%xmm1, %xmm0
	divsd	%xmm2, %xmm0
	divsd	%xmm2, %xmm0
	cvttsd2si	%xmm0, %eax
	movl	%eax, 4(%r14)
	movq	24(%rbx), %rax
	movq	_AV_CODEC_CAP_VARIABLE_FRAME_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	$10000, %r15d                   ## imm = 0x2710
	testl	%ecx, (%rax)
	jne	LBB0_3
## %bb.2:
	movl	4(%rbx), %r15d
LBB0_3:
	movl	12(%rbx), %edi
	movl	16(%rbx), %esi
	movl	%r15d, %ecx
	callq	_alloc_audio_frame
	movq	%rax, 32(%r14)
	movq	_AV_SAMPLE_FMT_S16@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movl	(%rbx), %edx
	movl	16(%rbx), %esi
	movl	%r15d, %ecx
	callq	_alloc_audio_frame
	movq	%rax, 24(%r14)
	movq	16(%r14), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_avcodec_parameters_from_context
	testl	%eax, %eax
	js	LBB0_4
## %bb.6:
	xorl	%eax, %eax
	callq	_swr_alloc
	movl	%eax, 8(%r14)
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	movl	8(%rbx), %edx
	leaq	L_.str.3(%rip), %rsi
	movl	%eax, %edi
	xorl	%ecx, %ecx
	callq	_av_opt_set_int
	movl	8(%r14), %edi
	movl	(%rbx), %edx
	leaq	L_.str.4(%rip), %rsi
	xorl	%ecx, %ecx
	callq	_av_opt_set_int
	movl	8(%r14), %edi
	movl	(%r12), %edx
	leaq	L_.str.5(%rip), %rsi
	xorl	%ecx, %ecx
	callq	_av_opt_set_sample_fmt
	movl	8(%r14), %edi
	movl	8(%rbx), %edx
	leaq	L_.str.6(%rip), %rsi
	xorl	%ecx, %ecx
	callq	_av_opt_set_int
	movl	8(%r14), %edi
	movl	(%rbx), %edx
	leaq	L_.str.7(%rip), %rsi
	xorl	%ecx, %ecx
	callq	_av_opt_set_int
	movl	8(%r14), %edi
	movl	12(%rbx), %edx
	leaq	L_.str.8(%rip), %rsi
	xorl	%ecx, %ecx
	callq	_av_opt_set_sample_fmt
	movl	8(%r14), %edi
	callq	_swr_init
	testl	%eax, %eax
	js	LBB0_9
## %bb.10:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r15d, %edi
	callq	_av_err2str
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_fprintf
	movl	$1, %edi
	callq	_exit
LBB0_4:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_5
LBB0_7:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_5
LBB0_9:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.9(%rip), %rsi
LBB0_5:
	xorl	%eax, %eax
	callq	_fprintf
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not open audio codec: %s\n"

	.comm	_M_PI,4,2                       ## @M_PI
	.comm	_AV_CODEC_CAP_VARIABLE_FRAME_SIZE,4,2 ## @AV_CODEC_CAP_VARIABLE_FRAME_SIZE
	.comm	_AV_SAMPLE_FMT_S16,4,2          ## @AV_SAMPLE_FMT_S16
L_.str.1:                               ## @.str.1
	.asciz	"Could not copy the stream parameters\n"

L_.str.2:                               ## @.str.2
	.asciz	"Could not allocate resampler context\n"

L_.str.3:                               ## @.str.3
	.asciz	"in_channel_count"

L_.str.4:                               ## @.str.4
	.asciz	"in_sample_rate"

L_.str.5:                               ## @.str.5
	.asciz	"in_sample_fmt"

L_.str.6:                               ## @.str.6
	.asciz	"out_channel_count"

L_.str.7:                               ## @.str.7
	.asciz	"out_sample_rate"

L_.str.8:                               ## @.str.8
	.asciz	"out_sample_fmt"

L_.str.9:                               ## @.str.9
	.asciz	"Failed to initialize the resampling context\n"

	.no_dead_strip	_open_audio
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function open_audio
_open_audio:                            ; @open_audio
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x2
	mov	x21, x1
	str	xzr, [sp, #8]
	ldr	x20, [x2, #48]
	add	x0, sp, #8
	mov	x1, x3
	mov	w2, #0
	bl	_av_dict_copy
	add	x2, sp, #8
	mov	x0, x20
	mov	x1, x21
	bl	_avcodec_open2
	mov	x21, x0
	add	x0, sp, #8
	bl	_av_dict_free
	tbnz	w21, #31, LBB0_8
; %bb.1:
Lloh0:
	adrp	x8, _M_PI@GOTPAGE
Lloh1:
	ldr	x8, [x8, _M_PI@GOTPAGEOFF]
	ldr	w9, [x8]
	lsl	w9, w9, #1
	scvtf	d0, w9
	mov	x9, #140737488355328
	movk	x9, #16475, lsl #48
	fmov	d1, x9
	fmul	d0, d0, d1
	ldr	w2, [x20]
	scvtf	d2, w2
	fdiv	d0, d0, d2
	fcvtzs	w9, d0
	str	xzr, [x19, #40]
	str	w9, [x19]
	ldr	w8, [x8]
	lsl	w8, w8, #1
	scvtf	d0, w8
	fmul	d0, d0, d1
	fdiv	d0, d0, d2
	fdiv	d0, d0, d2
	fcvtzs	w8, d0
	str	w8, [x19, #4]
	ldr	x8, [x20, #24]
	ldr	w8, [x8]
Lloh2:
	adrp	x9, _AV_CODEC_CAP_VARIABLE_FRAME_SIZE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _AV_CODEC_CAP_VARIABLE_FRAME_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
	mov	w21, #10000
	b	LBB0_4
LBB0_3:
	ldr	w21, [x20, #4]
LBB0_4:
	ldp	w0, w1, [x20, #12]
	mov	x3, x21
	bl	_alloc_audio_frame
	str	x0, [x19, #32]
Lloh5:
	adrp	x22, _AV_SAMPLE_FMT_S16@GOTPAGE
Lloh6:
	ldr	x22, [x22, _AV_SAMPLE_FMT_S16@GOTPAGEOFF]
	ldr	w0, [x22]
	ldr	w1, [x20, #16]
	ldr	w2, [x20]
	mov	x3, x21
	bl	_alloc_audio_frame
	str	x0, [x19, #24]
	ldr	x8, [x19, #16]
	ldr	w0, [x8]
	mov	x1, x20
	bl	_avcodec_parameters_from_context
	tbnz	w0, #31, LBB0_9
; %bb.5:
	bl	_swr_alloc
	str	w0, [x19, #8]
	cbz	w0, LBB0_10
; %bb.6:
	ldr	w2, [x20, #8]
Lloh7:
	adrp	x1, l_.str.3@PAGE
Lloh8:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w3, #0
	bl	_av_opt_set_int
	ldr	w0, [x19, #8]
	ldr	w2, [x20]
Lloh9:
	adrp	x1, l_.str.4@PAGE
Lloh10:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w3, #0
	bl	_av_opt_set_int
	ldr	w0, [x19, #8]
	ldr	w2, [x22]
Lloh11:
	adrp	x1, l_.str.5@PAGE
Lloh12:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	w3, #0
	bl	_av_opt_set_sample_fmt
	ldr	w0, [x19, #8]
	ldr	w2, [x20, #8]
Lloh13:
	adrp	x1, l_.str.6@PAGE
Lloh14:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w3, #0
	bl	_av_opt_set_int
	ldr	w0, [x19, #8]
	ldr	w2, [x20]
Lloh15:
	adrp	x1, l_.str.7@PAGE
Lloh16:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	w3, #0
	bl	_av_opt_set_int
	ldr	w0, [x19, #8]
	ldr	w2, [x20, #12]
Lloh17:
	adrp	x1, l_.str.8@PAGE
Lloh18:
	add	x1, x1, l_.str.8@PAGEOFF
	mov	w3, #0
	bl	_av_opt_set_sample_fmt
	ldr	w0, [x19, #8]
	bl	_swr_init
	tbnz	w0, #31, LBB0_11
; %bb.7:
	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
	add	sp, sp, #64
	ret
LBB0_8:
Lloh19:
	adrp	x8, _stderr@GOTPAGE
Lloh20:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh21:
	ldr	w19, [x8]
	mov	x0, x21
	bl	_av_err2str
	str	x0, [sp]
Lloh22:
	adrp	x1, l_.str@PAGE
Lloh23:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	b	LBB0_12
LBB0_9:
Lloh24:
	adrp	x8, _stderr@GOTPAGE
Lloh25:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
Lloh27:
	adrp	x1, l_.str.1@PAGE
Lloh28:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_12
LBB0_10:
Lloh29:
	adrp	x8, _stderr@GOTPAGE
Lloh30:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
Lloh32:
	adrp	x1, l_.str.2@PAGE
Lloh33:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_12
LBB0_11:
Lloh34:
	adrp	x8, _stderr@GOTPAGE
Lloh35:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh36:
	ldr	w0, [x8]
Lloh37:
	adrp	x1, l_.str.9@PAGE
Lloh38:
	add	x1, x1, l_.str.9@PAGEOFF
LBB0_12:
	bl	_fprintf
	mov	w0, #1
	bl	_exit
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not open audio codec: %s\n"

	.comm	_M_PI,4,2                       ; @M_PI
	.comm	_AV_CODEC_CAP_VARIABLE_FRAME_SIZE,4,2 ; @AV_CODEC_CAP_VARIABLE_FRAME_SIZE
	.comm	_AV_SAMPLE_FMT_S16,4,2          ; @AV_SAMPLE_FMT_S16
l_.str.1:                               ; @.str.1
	.asciz	"Could not copy the stream parameters\n"

l_.str.2:                               ; @.str.2
	.asciz	"Could not allocate resampler context\n"

l_.str.3:                               ; @.str.3
	.asciz	"in_channel_count"

l_.str.4:                               ; @.str.4
	.asciz	"in_sample_rate"

l_.str.5:                               ; @.str.5
	.asciz	"in_sample_fmt"

l_.str.6:                               ; @.str.6
	.asciz	"out_channel_count"

l_.str.7:                               ; @.str.7
	.asciz	"out_sample_rate"

l_.str.8:                               ; @.str.8
	.asciz	"out_sample_fmt"

l_.str.9:                               ; @.str.9
	.asciz	"Failed to initialize the resampling context\n"

	.no_dead_strip	_open_audio
.subsections_via_symbols
