	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_avi_writer_open                ## -- Begin function avi_writer_open
	.p2align	4, 0x90
_avi_writer_open:                       ## @avi_writer_open
	.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	%rdi, %r15
	movq	16(%rdi), %rax
	movl	24(%rax), %edi
	callq	_vc_uri_path_extension
	movq	%rax, -40(%rbp)
	movq	16(%r15), %rax
	movl	24(%rax), %edi
	leaq	L_.str(%rip), %rdx
	leaq	-40(%rbp), %rcx
	xorl	%esi, %esi
	callq	_vc_uri_find_query
	movq	-40(%rbp), %rbx
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.2:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcasecmp
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcasecmp
	testq	%rax, %rax
	je	LBB0_4
LBB0_1:
	movq	_VC_CONTAINER_ERROR_FORMAT_NOT_SUPPORTED@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	jmp	LBB0_15
LBB0_4:
	movl	$32, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_16
## %bb.5:
	movq	%rax, %r14
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movq	16(%r15), %rax
	movq	%r14, 16(%rax)
	leaq	28(%r14), %rsi
	movq	%r15, %rdi
	callq	_vc_container_writer_extraio_create_null
	movq	%rax, %rbx
	movq	_VC_CONTAINER_SUCCESS@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	jne	LBB0_12
## %bb.6:
	movq	%r15, %rdi
	callq	_STREAM_SEEKABLE
	testq	%rax, %rax
	je	LBB0_10
## %bb.7:
	movq	%r14, %rsi
	addq	$24, %rsi
	movq	%r15, %rdi
	callq	_vc_container_writer_extraio_create_temp
	movq	%rax, %rbx
	cmpq	(%r12), %rax
	je	LBB0_8
	jmp	LBB0_12
LBB0_16:
	movq	_VC_CONTAINER_ERROR_OUT_OF_MEMORY@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	leaq	L_.str.6(%rip), %rsi
	movq	%r15, %rdi
	callq	_LOG_DEBUG
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r15)
	jmp	LBB0_15
LBB0_10:
	movq	_AVI_FRAME_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_malloc
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_11
LBB0_8:
	movq	$0, 16(%r14)
	movq	8(%r14), %rax
	movq	%rax, (%r15)
	movl	$82, %edi
	movl	$73, %esi
	movl	$70, %edx
	movl	$70, %ecx
	callq	_VC_FOURCC
	leaq	L_.str.3(%rip), %rdx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_WRITE_FOURCC
	leaq	L_.str.4(%rip), %rdx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_WRITE_U32
	movl	$65, %edi
	movl	$86, %esi
	movl	$73, %edx
	movl	$32, %ecx
	callq	_VC_FOURCC
	leaq	L_.str.5(%rip), %rdx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_WRITE_FOURCC
	movq	%r15, %rdi
	callq	_STREAM_STATUS
	movq	%rax, %rbx
	cmpq	(%r12), %rax
	jne	LBB0_12
## %bb.9:
	movq	_avi_writer_close@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	16(%r15), %rcx
	movl	%eax, 8(%rcx)
	movq	_avi_writer_write@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rcx)
	movq	_avi_writer_control@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rcx)
	jmp	LBB0_15
LBB0_11:
	movq	_VC_CONTAINER_ERROR_OUT_OF_MEMORY@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
LBB0_12:
	leaq	L_.str.6(%rip), %rsi
	movq	%r15, %rdi
	callq	_LOG_DEBUG
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r15)
	movq	(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_14
## %bb.13:
	callq	_free
LBB0_14:
	movq	%r14, %rdi
	callq	_free
LBB0_15:
	movq	%rbx, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VC_CONTAINER_SUCCESS,8,3       ## @VC_CONTAINER_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"container"

	.comm	_VC_CONTAINER_ERROR_FORMAT_NOT_SUPPORTED,8,3 ## @VC_CONTAINER_ERROR_FORMAT_NOT_SUPPORTED
L_.str.1:                               ## @.str.1
	.asciz	"avi"

L_.str.2:                               ## @.str.2
	.asciz	"divx"

	.comm	_VC_CONTAINER_ERROR_OUT_OF_MEMORY,8,3 ## @VC_CONTAINER_ERROR_OUT_OF_MEMORY
	.comm	_AVI_FRAME_BUFFER_SIZE,4,2      ## @AVI_FRAME_BUFFER_SIZE
L_.str.3:                               ## @.str.3
	.asciz	"RIFF ID"

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

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

	.comm	_avi_writer_close,4,2           ## @avi_writer_close
	.comm	_avi_writer_write,4,2           ## @avi_writer_write
	.comm	_avi_writer_control,4,2         ## @avi_writer_control
L_.str.6:                               ## @.str.6
	.asciz	"error opening stream"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_avi_writer_open                ; -- Begin function avi_writer_open
	.p2align	2
_avi_writer_open:                       ; @avi_writer_open
	.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, x0
	ldr	x8, [x0, #16]
	ldr	w0, [x8, #24]
	bl	_vc_uri_path_extension
	str	x0, [sp, #8]
	ldr	x8, [x19, #16]
	ldr	w0, [x8, #24]
Lloh0:
	adrp	x2, l_.str@PAGE
Lloh1:
	add	x2, x2, l_.str@PAGEOFF
	add	x3, sp, #8
	mov	w1, #0
	bl	_vc_uri_find_query
	ldr	x20, [sp, #8]
	cbz	x20, LBB0_3
; %bb.1:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_strcasecmp
	cbz	x0, LBB0_4
; %bb.2:
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_strcasecmp
	cbz	x0, LBB0_4
LBB0_3:
Lloh6:
	adrp	x8, _VC_CONTAINER_ERROR_FORMAT_NOT_SUPPORTED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VC_CONTAINER_ERROR_FORMAT_NOT_SUPPORTED@GOTPAGEOFF]
Lloh8:
	ldr	x21, [x8]
	b	LBB0_16
LBB0_4:
	mov	w0, #32
	bl	_malloc
	cbz	x0, LBB0_8
; %bb.5:
	mov	x20, x0
	mov	w1, #0
	mov	w2, #32
	bl	_memset
	ldr	x8, [x19, #16]
	str	x20, [x8, #16]
	add	x1, x20, #28
	mov	x0, x19
	bl	_vc_container_writer_extraio_create_null
	mov	x21, x0
Lloh9:
	adrp	x22, _VC_CONTAINER_SUCCESS@GOTPAGE
Lloh10:
	ldr	x22, [x22, _VC_CONTAINER_SUCCESS@GOTPAGEOFF]
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_13
; %bb.6:
	mov	x0, x19
	bl	_STREAM_SEEKABLE
	cbz	x0, LBB0_9
; %bb.7:
	add	x1, x20, #24
	mov	x0, x19
	bl	_vc_container_writer_extraio_create_temp
	mov	x21, x0
	ldr	x8, [x22]
	cmp	x0, x8
	b.eq	LBB0_10
	b	LBB0_13
LBB0_8:
Lloh11:
	adrp	x8, _VC_CONTAINER_ERROR_OUT_OF_MEMORY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _VC_CONTAINER_ERROR_OUT_OF_MEMORY@GOTPAGEOFF]
Lloh13:
	ldr	x21, [x8]
Lloh14:
	adrp	x1, l_.str.6@PAGE
Lloh15:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_LOG_DEBUG
	stp	xzr, xzr, [x19]
	b	LBB0_16
LBB0_9:
Lloh16:
	adrp	x8, _AVI_FRAME_BUFFER_SIZE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _AVI_FRAME_BUFFER_SIZE@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	bl	_malloc
	str	x0, [x20]
	cbz	x0, LBB0_12
LBB0_10:
	str	xzr, [x20, #16]
	ldr	x8, [x20, #8]
	str	x8, [x19]
	mov	w0, #82
	mov	w1, #73
	mov	w2, #70
	mov	w3, #70
	bl	_VC_FOURCC
	mov	x1, x0
Lloh19:
	adrp	x2, l_.str.3@PAGE
Lloh20:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_WRITE_FOURCC
Lloh21:
	adrp	x2, l_.str.4@PAGE
Lloh22:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x0, x19
	mov	w1, #0
	bl	_WRITE_U32
	mov	w0, #65
	mov	w1, #86
	mov	w2, #73
	mov	w3, #32
	bl	_VC_FOURCC
	mov	x1, x0
Lloh23:
	adrp	x2, l_.str.5@PAGE
Lloh24:
	add	x2, x2, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_WRITE_FOURCC
	mov	x0, x19
	bl	_STREAM_STATUS
	mov	x21, x0
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_13
; %bb.11:
Lloh25:
	adrp	x8, _avi_writer_close@GOTPAGE
Lloh26:
	ldr	x8, [x8, _avi_writer_close@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	ldr	x9, [x19, #16]
	str	w8, [x9, #8]
Lloh28:
	adrp	x8, _avi_writer_write@GOTPAGE
Lloh29:
	ldr	x8, [x8, _avi_writer_write@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
Lloh31:
	adrp	x10, _avi_writer_control@GOTPAGE
Lloh32:
	ldr	x10, [x10, _avi_writer_control@GOTPAGEOFF]
Lloh33:
	ldr	w10, [x10]
	stp	w10, w8, [x9]
	b	LBB0_16
LBB0_12:
Lloh34:
	adrp	x8, _VC_CONTAINER_ERROR_OUT_OF_MEMORY@GOTPAGE
Lloh35:
	ldr	x8, [x8, _VC_CONTAINER_ERROR_OUT_OF_MEMORY@GOTPAGEOFF]
Lloh36:
	ldr	x21, [x8]
LBB0_13:
Lloh37:
	adrp	x1, l_.str.6@PAGE
Lloh38:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_LOG_DEBUG
	stp	xzr, xzr, [x19]
	ldr	x0, [x20]
	cbz	x0, LBB0_15
; %bb.14:
	bl	_free
LBB0_15:
	mov	x0, x20
	bl	_free
LBB0_16:
	mov	x0, x21
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_VC_CONTAINER_SUCCESS,8,3       ; @VC_CONTAINER_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"container"

	.comm	_VC_CONTAINER_ERROR_FORMAT_NOT_SUPPORTED,8,3 ; @VC_CONTAINER_ERROR_FORMAT_NOT_SUPPORTED
l_.str.1:                               ; @.str.1
	.asciz	"avi"

l_.str.2:                               ; @.str.2
	.asciz	"divx"

	.comm	_VC_CONTAINER_ERROR_OUT_OF_MEMORY,8,3 ; @VC_CONTAINER_ERROR_OUT_OF_MEMORY
	.comm	_AVI_FRAME_BUFFER_SIZE,4,2      ; @AVI_FRAME_BUFFER_SIZE
l_.str.3:                               ; @.str.3
	.asciz	"RIFF ID"

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

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

	.comm	_avi_writer_close,4,2           ; @avi_writer_close
	.comm	_avi_writer_write,4,2           ; @avi_writer_write
	.comm	_avi_writer_control,4,2         ; @avi_writer_control
l_.str.6:                               ; @.str.6
	.asciz	"error opening stream"

.subsections_via_symbols
