	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vc_container_waveformatex_to_es_format ## -- Begin function vc_container_waveformatex_to_es_format
	.p2align	4, 0x90
_vc_container_waveformatex_to_es_format: ## @vc_container_waveformatex_to_es_format
	.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
	movq	_VC_CONTAINER_ERROR_INVALID_ARGUMENT@GOTPCREL(%rip), %rax
	testq	%rdi, %rdi
	je	LBB0_24
## %bb.1:
	cmpl	$16, %esi
	jb	LBB0_24
## %bb.2:
	movq	%rdi, %r15
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rcx, %r13
	movq	%r8, %r12
	movl	4(%rdi), %ebx
	shll	$8, %ebx
	orl	(%rdi), %ebx
	movl	%ebx, %edi
	movq	%rdx, %r14
	callq	_waveformat_to_codec
	testq	%r14, %r14
	je	LBB0_4
## %bb.3:
	movl	$16, (%r14)
LBB0_4:
	testq	%r13, %r13
	je	LBB0_6
## %bb.5:
	movl	$0, (%r13)
LBB0_6:
	movl	8(%r15), %edx
	movq	16(%r12), %rcx
	movl	%edx, (%rcx)
	movl	28(%r15), %edx
	shll	$24, %edx
	movl	20(%r15), %esi
	movl	24(%r15), %edi
	shll	$16, %edi
	orl	%edx, %edi
	shll	$8, %esi
	orl	%edi, %esi
	orl	16(%r15), %esi
	movl	%esi, 4(%rcx)
	movl	44(%r15), %edx
	shll	$24, %edx
	movl	36(%r15), %esi
	movl	40(%r15), %edi
	shll	$16, %edi
	orl	%edx, %edi
	shll	$8, %esi
	orl	%edi, %esi
	orl	32(%r15), %esi
	shll	$3, %esi
	movl	%esi, (%r12)
	movl	52(%r15), %edx
	shll	$8, %edx
	orl	48(%r15), %edx
	movl	%edx, 8(%rcx)
	movl	60(%r15), %edx
	shll	$8, %edx
	orl	56(%r15), %edx
	movl	%edx, 12(%rcx)
	movq	_WAVE_FORMAT_PCM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%ebx, %ecx
	xorl	$8, %edx
	orl	%ecx, %edx
	jne	LBB0_8
## %bb.7:
	movq	_VC_CONTAINER_CODEC_PCM_UNSIGNED_LE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_8:
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	cmpl	$18, %edx
	jb	LBB0_15
## %bb.9:
	testq	%r13, %r13
	je	LBB0_12
## %bb.10:
	movl	68(%r15), %ecx
	shll	$8, %ecx
	orl	64(%r15), %ecx
	movl	%ecx, (%r13)
	addl	$18, %ecx
	cmpl	%edx, %ecx
	jbe	LBB0_12
## %bb.11:
	addl	$-18, %edx
	movl	%edx, (%r13)
LBB0_12:
	testq	%r14, %r14
	je	LBB0_13
## %bb.19:
	movl	$18, (%r14)
	testq	%r13, %r13
	je	LBB0_23
## %bb.20:
	movq	_WAVE_FORMAT_MPEGLAYER3@GOTPCREL(%rip), %rdx
	movl	$18, %ecx
	cmpl	(%rdx), %ebx
	je	LBB0_21
	jmp	LBB0_23
LBB0_15:
	testq	%r13, %r13
	je	LBB0_23
## %bb.16:
	movq	_WAVE_FORMAT_MPEGLAYER3@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	jne	LBB0_23
## %bb.17:
	testq	%r14, %r14
	je	LBB0_22
## %bb.18:
	movl	(%r14), %ecx
LBB0_21:
	addl	(%r13), %ecx
	movl	%ecx, (%r14)
	jmp	LBB0_22
LBB0_13:
	testq	%r13, %r13
	je	LBB0_23
## %bb.14:
	movq	_WAVE_FORMAT_MPEGLAYER3@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	jne	LBB0_23
LBB0_22:
	movl	$0, (%r13)
LBB0_23:
	movq	_VC_CONTAINER_ES_TYPE_AUDIO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 8(%r12)
	movl	%eax, 4(%r12)
	movq	_VC_CONTAINER_SUCCESS@GOTPCREL(%rip), %rax
LBB0_24:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VC_CONTAINER_ERROR_INVALID_ARGUMENT,4,2 ## @VC_CONTAINER_ERROR_INVALID_ARGUMENT
	.comm	_WAVE_FORMAT_PCM,4,2            ## @WAVE_FORMAT_PCM
	.comm	_VC_CONTAINER_CODEC_PCM_UNSIGNED_LE,4,2 ## @VC_CONTAINER_CODEC_PCM_UNSIGNED_LE
	.comm	_WAVE_FORMAT_MPEGLAYER3,4,2     ## @WAVE_FORMAT_MPEGLAYER3
	.comm	_VC_CONTAINER_ES_TYPE_AUDIO,4,2 ## @VC_CONTAINER_ES_TYPE_AUDIO
	.comm	_VC_CONTAINER_SUCCESS,4,2       ## @VC_CONTAINER_SUCCESS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vc_container_waveformatex_to_es_format ; -- Begin function vc_container_waveformatex_to_es_format
	.p2align	2
_vc_container_waveformatex_to_es_format: ; @vc_container_waveformatex_to_es_format
	.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
Lloh0:
	adrp	x8, _VC_CONTAINER_ERROR_INVALID_ARGUMENT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VC_CONTAINER_ERROR_INVALID_ARGUMENT@GOTPAGEOFF]
	cbz	x0, LBB0_22
; %bb.1:
	mov	x23, x1
	cmp	w1, #16
	b.lo	LBB0_22
; %bb.2:
	mov	x19, x4
	mov	x20, x3
	mov	x21, x2
	mov	x24, x0
	ldp	w9, w8, [x0]
	orr	w22, w9, w8, lsl #8
	mov	x0, x22
	bl	_waveformat_to_codec
	cbz	x21, LBB0_4
; %bb.3:
	mov	w8, #16
	str	w8, [x21]
LBB0_4:
	cbz	x20, LBB0_6
; %bb.5:
	str	wzr, [x20]
LBB0_6:
	ldr	w8, [x24, #8]
	ldr	x9, [x19, #16]
	str	w8, [x9]
	ldp	w10, w8, [x24, #24]
	lsl	w10, w10, #16
	orr	w8, w10, w8, lsl #24
	ldp	w11, w10, [x24, #16]
	orr	w8, w8, w10, lsl #8
	orr	w8, w8, w11
	str	w8, [x9, #4]
	ldp	w10, w8, [x24, #40]
	lsl	w10, w10, #16
	orr	w8, w10, w8, lsl #24
	ldp	w11, w10, [x24, #32]
	orr	w8, w8, w10, lsl #8
	orr	w8, w8, w11
	lsl	w8, w8, #3
	str	w8, [x19]
	ldp	w10, w8, [x24, #48]
	orr	w8, w10, w8, lsl #8
	str	w8, [x9, #8]
	ldp	w10, w8, [x24, #56]
	orr	w8, w10, w8, lsl #8
	str	w8, [x9, #12]
Lloh2:
	adrp	x9, _WAVE_FORMAT_PCM@GOTPAGE
Lloh3:
	ldr	x9, [x9, _WAVE_FORMAT_PCM@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmp	w8, #8
	ccmp	w22, w9, #0, eq
Lloh5:
	adrp	x8, _VC_CONTAINER_CODEC_PCM_UNSIGNED_LE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _VC_CONTAINER_CODEC_PCM_UNSIGNED_LE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	csel	w8, w8, w0, eq
	subs	w9, w23, #18
	b.lo	LBB0_13
; %bb.7:
	cbz	x20, LBB0_10
; %bb.8:
	ldp	w11, w10, [x24, #64]
	orr	w10, w11, w10, lsl #8
	str	w10, [x20]
	add	w10, w10, #18
	cmp	w10, w23
	b.ls	LBB0_10
; %bb.9:
	str	w9, [x20]
LBB0_10:
	cbz	x21, LBB0_18
; %bb.11:
	mov	w9, #18
	str	w9, [x21]
	cbz	x20, LBB0_21
; %bb.12:
Lloh8:
	adrp	x10, _WAVE_FORMAT_MPEGLAYER3@GOTPAGE
Lloh9:
	ldr	x10, [x10, _WAVE_FORMAT_MPEGLAYER3@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	cmp	w22, w10
	b.eq	LBB0_17
	b	LBB0_21
LBB0_13:
	cbz	x20, LBB0_21
; %bb.14:
Lloh11:
	adrp	x9, _WAVE_FORMAT_MPEGLAYER3@GOTPAGE
Lloh12:
	ldr	x9, [x9, _WAVE_FORMAT_MPEGLAYER3@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	cmp	w22, w9
	b.ne	LBB0_21
; %bb.15:
	cbz	x21, LBB0_20
; %bb.16:
	ldr	w9, [x21]
LBB0_17:
	ldr	w10, [x20]
	add	w9, w9, w10
	str	w9, [x21]
	b	LBB0_20
LBB0_18:
	cbz	x20, LBB0_21
; %bb.19:
Lloh14:
	adrp	x9, _WAVE_FORMAT_MPEGLAYER3@GOTPAGE
Lloh15:
	ldr	x9, [x9, _WAVE_FORMAT_MPEGLAYER3@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	cmp	w22, w9
	b.ne	LBB0_21
LBB0_20:
	str	wzr, [x20]
LBB0_21:
Lloh17:
	adrp	x9, _VC_CONTAINER_ES_TYPE_AUDIO@GOTPAGE
Lloh18:
	ldr	x9, [x9, _VC_CONTAINER_ES_TYPE_AUDIO@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	stp	w8, w9, [x19, #4]
Lloh20:
	adrp	x8, _VC_CONTAINER_SUCCESS@GOTPAGE
Lloh21:
	ldr	x8, [x8, _VC_CONTAINER_SUCCESS@GOTPAGEOFF]
LBB0_22:
	ldr	w0, [x8]
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_VC_CONTAINER_ERROR_INVALID_ARGUMENT,4,2 ; @VC_CONTAINER_ERROR_INVALID_ARGUMENT
	.comm	_WAVE_FORMAT_PCM,4,2            ; @WAVE_FORMAT_PCM
	.comm	_VC_CONTAINER_CODEC_PCM_UNSIGNED_LE,4,2 ; @VC_CONTAINER_CODEC_PCM_UNSIGNED_LE
	.comm	_WAVE_FORMAT_MPEGLAYER3,4,2     ; @WAVE_FORMAT_MPEGLAYER3
	.comm	_VC_CONTAINER_ES_TYPE_AUDIO,4,2 ; @VC_CONTAINER_ES_TYPE_AUDIO
	.comm	_VC_CONTAINER_SUCCESS,4,2       ; @VC_CONTAINER_SUCCESS
.subsections_via_symbols
