	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function AVIFILE_OpenCompressor
_AVIFILE_OpenCompressor:                ## @AVIFILE_OpenCompressor
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	xorl	%edi, %edi
	testq	%r14, %r14
	setne	%dil
	callq	_assert
	xorl	%edi, %edi
	cmpq	$0, 72(%r14)
	setne	%dil
	callq	_assert
	cmpq	$0, 64(%r14)
	je	LBB0_1
LBB0_15:
	movq	_AVIERR_OK@GOTPCREL(%rip), %rax
LBB0_16:
	movl	(%rax), %ebx
LBB0_17:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_1:
	cmpq	$0, 56(%r14)
	je	LBB0_2
## %bb.12:
	movq	48(%r14), %rcx
	testq	%rcx, %rcx
	je	LBB0_13
LBB0_10:
	leaq	64(%r14), %rdi
	movq	56(%r14), %rdx
	movq	_ACM_STREAMOPENF_NONREALTIME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%esi, %esi
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	pushq	%rax
	pushq	$0
	callq	_acmStreamOpen
	addq	$16, %rsp
	movq	_S_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.14:
	movq	48(%r14), %rax
	movl	4(%rax), %ecx
	leaq	8(%r14), %rbx
	movl	%ecx, 40(%r14)
	movl	%ecx, 36(%r14)
	movl	(%rax), %eax
	movl	%eax, 32(%r14)
	movq	_ICQUALITY_DEFAULT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 24(%r14)
	leaq	20(%r14), %rdi
	callq	_SetRectEmpty
	leaq	16(%r14), %rdi
	callq	_CONVERT_STREAM_to_THIS
	addq	$12, %r14
	movq	%r14, %rdi
	callq	_CONVERT_STREAM_to_THIS
	movq	%rbx, %rdi
	callq	_CONVERT_STREAM_to_THIS
	jmp	LBB0_15
LBB0_2:
	movq	72(%r14), %rdi
	movl	16(%r14), %esi
	movq	%r14, %rdx
	callq	_AVIStreamFormatSize
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_17
## %bb.3:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	(%r14), %edx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapAlloc
	movq	%rax, 56(%r14)
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	72(%r14), %rdi
	movl	16(%r14), %esi
	movq	%rax, %rdx
	movq	%r14, %rcx
	callq	_IAVIStream_ReadFormat
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_17
## %bb.6:
	movq	48(%r14), %rcx
	testq	%rcx, %rcx
	jne	LBB0_10
## %bb.7:
	movl	$4, 4(%r14)
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	4(%r14), %edx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapAlloc
	movq	%rax, 48(%r14)
	testq	%rax, %rax
	je	LBB0_4
## %bb.8:
	movq	_WAVE_FORMAT_PCM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 8(%rax)
	movq	56(%r14), %rsi
	movl	4(%r14), %ecx
	movq	_ACM_FORMATSUGGESTF_WFORMATTAG@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r8d
	xorl	%edi, %edi
	movq	%rax, %rdx
	callq	_acmFormatSuggest
	movq	_S_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.9:
	movq	48(%r14), %rcx
	jmp	LBB0_10
LBB0_13:
	movq	_AVIERR_ERROR@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_11:
	movq	_AVIERR_NOCOMPRESSOR@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_4:
	movq	_AVIERR_MEMORY@GOTPCREL(%rip), %rax
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_AVIERR_OK,4,2                  ## @AVIERR_OK
	.comm	_AVIERR_MEMORY,4,2              ## @AVIERR_MEMORY
	.comm	_WAVE_FORMAT_PCM,4,2            ## @WAVE_FORMAT_PCM
	.comm	_ACM_FORMATSUGGESTF_WFORMATTAG,4,2 ## @ACM_FORMATSUGGESTF_WFORMATTAG
	.comm	_S_OK,8,3                       ## @S_OK
	.comm	_AVIERR_NOCOMPRESSOR,4,2        ## @AVIERR_NOCOMPRESSOR
	.comm	_AVIERR_ERROR,4,2               ## @AVIERR_ERROR
	.comm	_ACM_STREAMOPENF_NONREALTIME,4,2 ## @ACM_STREAMOPENF_NONREALTIME
	.comm	_ICQUALITY_DEFAULT,8,3          ## @ICQUALITY_DEFAULT
	.no_dead_strip	_AVIFILE_OpenCompressor
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function AVIFILE_OpenCompressor
_AVIFILE_OpenCompressor:                ; @AVIFILE_OpenCompressor
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_assert
	ldr	x8, [x19, #72]
	cmp	x8, #0
	cset	w0, ne
	bl	_assert
	mov	x20, x19
	ldr	x8, [x20, #64]!
	cbz	x8, LBB0_4
LBB0_1:
Lloh0:
	adrp	x8, _AVIERR_OK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVIERR_OK@GOTPAGEOFF]
LBB0_2:
	ldr	w21, [x8]
LBB0_3:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_4:
	ldr	x8, [x19, #56]
	cbz	x8, LBB0_8
; %bb.5:
	ldr	x3, [x19, #48]
	cbz	x3, LBB0_15
LBB0_6:
	ldr	x2, [x19, #56]
Lloh2:
	adrp	x8, _ACM_STREAMOPENF_NONREALTIME@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ACM_STREAMOPENF_NONREALTIME@GOTPAGEOFF]
Lloh4:
	ldr	w7, [x8]
	mov	x0, x20
	mov	x1, #0
	mov	x4, #0
	mov	w5, #0
	mov	w6, #0
	bl	_acmStreamOpen
Lloh5:
	adrp	x8, _S_OK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _S_OK@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_16
; %bb.7:
	ldr	x8, [x19, #48]
	add	x20, x19, #8
	ldp	w8, w9, [x8]
	stp	w9, w9, [x19, #36]
	str	w8, [x19, #32]
Lloh8:
	adrp	x8, _ICQUALITY_DEFAULT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ICQUALITY_DEFAULT@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	str	x8, [x19, #24]
	add	x0, x19, #20
	bl	_SetRectEmpty
	add	x0, x19, #16
	bl	_CONVERT_STREAM_to_THIS
	add	x0, x19, #12
	bl	_CONVERT_STREAM_to_THIS
	mov	x0, x20
	bl	_CONVERT_STREAM_to_THIS
	b	LBB0_1
LBB0_8:
	ldr	x0, [x19, #72]
	ldr	w1, [x19, #16]
	mov	x2, x19
	bl	_AVIStreamFormatSize
	mov	x21, x0
	bl	_FAILED
	cbnz	x0, LBB0_3
; %bb.9:
	bl	_GetProcessHeap
	ldr	w2, [x19]
	mov	w1, #0
	bl	_HeapAlloc
	str	x0, [x19, #56]
	cbz	x0, LBB0_17
; %bb.10:
	mov	x2, x0
	ldr	x0, [x19, #72]
	ldr	w1, [x19, #16]
	mov	x3, x19
	bl	_IAVIStream_ReadFormat
	mov	x21, x0
	bl	_FAILED
	cbnz	x0, LBB0_3
; %bb.11:
	ldr	x3, [x19, #48]
	cbnz	x3, LBB0_6
; %bb.12:
	mov	w8, #4
	str	w8, [x19, #4]
	bl	_GetProcessHeap
	ldr	w2, [x19, #4]
	mov	w1, #0
	bl	_HeapAlloc
	str	x0, [x19, #48]
	cbz	x0, LBB0_17
; %bb.13:
	mov	x2, x0
Lloh11:
	adrp	x8, _WAVE_FORMAT_PCM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _WAVE_FORMAT_PCM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	str	w8, [x0, #8]
	ldr	x1, [x19, #56]
	ldr	w3, [x19, #4]
Lloh14:
	adrp	x8, _ACM_FORMATSUGGESTF_WFORMATTAG@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ACM_FORMATSUGGESTF_WFORMATTAG@GOTPAGEOFF]
Lloh16:
	ldr	w4, [x8]
	mov	x0, #0
	bl	_acmFormatSuggest
Lloh17:
	adrp	x8, _S_OK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _S_OK@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_16
; %bb.14:
	ldr	x3, [x19, #48]
	b	LBB0_6
LBB0_15:
Lloh20:
	adrp	x8, _AVIERR_ERROR@GOTPAGE
Lloh21:
	ldr	x8, [x8, _AVIERR_ERROR@GOTPAGEOFF]
	b	LBB0_2
LBB0_16:
Lloh22:
	adrp	x8, _AVIERR_NOCOMPRESSOR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _AVIERR_NOCOMPRESSOR@GOTPAGEOFF]
	b	LBB0_2
LBB0_17:
Lloh24:
	adrp	x8, _AVIERR_MEMORY@GOTPAGE
Lloh25:
	ldr	x8, [x8, _AVIERR_MEMORY@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_AVIERR_OK,4,2                  ; @AVIERR_OK
	.comm	_AVIERR_MEMORY,4,2              ; @AVIERR_MEMORY
	.comm	_WAVE_FORMAT_PCM,4,2            ; @WAVE_FORMAT_PCM
	.comm	_ACM_FORMATSUGGESTF_WFORMATTAG,4,2 ; @ACM_FORMATSUGGESTF_WFORMATTAG
	.comm	_S_OK,8,3                       ; @S_OK
	.comm	_AVIERR_NOCOMPRESSOR,4,2        ; @AVIERR_NOCOMPRESSOR
	.comm	_AVIERR_ERROR,4,2               ; @AVIERR_ERROR
	.comm	_ACM_STREAMOPENF_NONREALTIME,4,2 ; @ACM_STREAMOPENF_NONREALTIME
	.comm	_ICQUALITY_DEFAULT,8,3          ; @ICQUALITY_DEFAULT
	.no_dead_strip	_AVIFILE_OpenCompressor
.subsections_via_symbols
