	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AVIFILE_CreateAVITempFile      ## -- Begin function AVIFILE_CreateAVITempFile
	.p2align	4, 0x90
_AVIFILE_CreateAVITempFile:             ## @AVIFILE_CreateAVITempFile
	.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
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movl	%edi, %r12d
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	_HEAP_ZERO_MEMORY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	movl	$72, %edx
	callq	_HeapAlloc
	testq	%rax, %rax
	je	LBB0_26
## %bb.1:
	movq	%rax, %rbx
	movq	_itmpft@GOTPCREL(%rip), %rax
	movq	%rax, 8(%rbx)
	movl	$1, (%rbx)
	leaq	16(%rbx), %rdi
	xorl	%esi, %esi
	movl	$48, %edx
	callq	_memset
	movl	%r12d, 16(%rbx)
	xorl	%eax, %eax
	callq	_GetProcessHeap
	leal	(,%r12,4), %edx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapAlloc
	movq	%rax, 64(%rbx)
	testq	%rax, %rax
	je	LBB0_27
## %bb.2:
	movq	%rbx, %r15
	addq	$8, %r15
	testl	%r12d, %r12d
	jle	LBB0_26
## %bb.3:
	movl	(%r14), %ecx
	movl	%ecx, (%rax)
	movl	(%r14), %edi
	callq	_AVIStreamAddRef
	movl	(%r14), %edi
	leaq	-96(%rbp), %rsi
	movl	$56, %edx
	callq	_AVIStreamInfoW
	movl	-96(%rbp), %ecx
	movl	%ecx, 20(%rbx)
	movl	-92(%rbp), %eax
	movl	%eax, 24(%rbx)
	testl	%ecx, %ecx
	je	LBB0_5
## %bb.4:
	testl	%eax, %eax
	jne	LBB0_6
LBB0_5:
	movabsq	$429496729601, %rax             ## imm = 0x6400000001
	movq	%rax, 20(%rbx)
LBB0_6:
	movq	-88(%rbp), %rax
	cmpq	%rax, 32(%rbx)
	jge	LBB0_8
## %bb.7:
	movq	%rax, 32(%rbx)
LBB0_8:
	movl	(%r14), %edi
	movl	-48(%rbp), %esi
	callq	_AVIStreamSampleToTime
	movl	20(%rbx), %esi
	imull	$1000, 24(%rbx), %edx           ## imm = 0x3E8
	movl	%eax, %edi
	callq	_MulDiv
	cmpq	%rax, 40(%rbx)
	jge	LBB0_10
## %bb.9:
	movq	%rax, 40(%rbx)
LBB0_10:
	movq	-80(%rbp), %rax
	subq	-72(%rbp), %rax
	cmpq	%rax, 48(%rbx)
	jge	LBB0_12
## %bb.11:
	movq	%rax, 48(%rbx)
LBB0_12:
	movq	-64(%rbp), %rax
	subq	-56(%rbp), %rax
	cmpq	%rax, 56(%rbx)
	jge	LBB0_14
## %bb.13:
	movq	%rax, 56(%rbx)
LBB0_14:
	cmpl	$1, %r12d
	je	LBB0_26
## %bb.15:
	movq	%r15, -104(%rbp)                ## 8-byte Spill
	movl	%r12d, %r13d
	movl	$1, %r15d
	leaq	-96(%rbp), %r12
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_16 Depth=1
	incq	%r15
	cmpq	%r15, %r13
	je	LBB0_25
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14,%r15,4), %eax
	movq	64(%rbx), %rcx
	movl	%eax, (%rcx,%r15,4)
	movl	(%r14,%r15,4), %edi
	callq	_AVIStreamAddRef
	movl	(%r14,%r15,4), %edi
	movq	%r12, %rsi
	movl	$56, %edx
	callq	_AVIStreamInfoW
	movq	-88(%rbp), %rax
	cmpq	%rax, 32(%rbx)
	jge	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	%rax, 32(%rbx)
LBB0_18:                                ##   in Loop: Header=BB0_16 Depth=1
	movl	(%r14,%r15,4), %edi
	movl	-48(%rbp), %esi
	callq	_AVIStreamSampleToTime
	movl	20(%rbx), %esi
	imull	$1000, 24(%rbx), %edx           ## imm = 0x3E8
	movl	%eax, %edi
	callq	_MulDiv
	cmpq	%rax, 40(%rbx)
	jge	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	%rax, 40(%rbx)
LBB0_20:                                ##   in Loop: Header=BB0_16 Depth=1
	movq	-80(%rbp), %rax
	subq	-72(%rbp), %rax
	cmpq	%rax, 48(%rbx)
	jge	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	%rax, 48(%rbx)
LBB0_22:                                ##   in Loop: Header=BB0_16 Depth=1
	movq	-64(%rbp), %rax
	subq	-56(%rbp), %rax
	cmpq	%rax, 56(%rbx)
	jge	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	%rax, 56(%rbx)
	jmp	LBB0_24
LBB0_27:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	_HeapFree
	jmp	LBB0_26
LBB0_25:
	movq	-104(%rbp), %r15                ## 8-byte Reload
LBB0_26:
	movq	%r15, %rax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HEAP_ZERO_MEMORY,4,2           ## @HEAP_ZERO_MEMORY
	.comm	_itmpft,4,2                     ## @itmpft
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function AVIFILE_CreateAVITempFile
lCPI0_0:
	.long	1                               ; 0x1
	.long	100                             ; 0x64
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_AVIFILE_CreateAVITempFile
	.p2align	2
_AVIFILE_CreateAVITempFile:             ; @AVIFILE_CreateAVITempFile
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x1
	mov	x22, x0
	bl	_GetProcessHeap
Lloh0:
	adrp	x8, _HEAP_ZERO_MEMORY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HEAP_ZERO_MEMORY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #72
	bl	_HeapAlloc
	cbz	x0, LBB0_26
; %bb.1:
	mov	x20, x0
Lloh3:
	adrp	x8, _itmpft@GOTPAGE
Lloh4:
	ldr	x8, [x8, _itmpft@GOTPAGEOFF]
	mov	x21, x0
	str	x8, [x21, #8]!
	mov	w8, #1
	str	w8, [x0], #16
	mov	w1, #0
	mov	w2, #48
	bl	_memset
	str	w22, [x20, #16]
	bl	_GetProcessHeap
	lsl	w2, w22, #2
	mov	w1, #0
	bl	_HeapAlloc
	str	x0, [x20, #64]
	cbz	x0, LBB0_25
; %bb.2:
	cmp	w22, #1
	b.lt	LBB0_27
; %bb.3:
	ldr	w8, [x19]
	str	w8, [x0]
	ldr	w0, [x19]
	bl	_AVIStreamAddRef
	ldr	w0, [x19]
	add	x1, sp, #8
	mov	w2, #56
	bl	_AVIStreamInfoW
	ldp	w9, w8, [sp, #8]
	stp	w9, w8, [x20, #20]
	cbz	w9, LBB0_5
; %bb.4:
	cbnz	w8, LBB0_6
LBB0_5:
Lloh5:
	adrp	x8, lCPI0_0@PAGE
Lloh6:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	stur	d0, [x20, #20]
LBB0_6:
	ldr	x9, [x20, #32]
	ldr	x8, [sp, #16]
	cmp	x9, x8
	b.ge	LBB0_8
; %bb.7:
	str	x8, [x20, #32]
LBB0_8:
	ldr	w0, [x19]
	ldr	w1, [sp, #56]
	bl	_AVIStreamSampleToTime
	ldp	w1, w8, [x20, #20]
	mov	w9, #1000
	mul	w2, w8, w9
	bl	_MulDiv
	ldr	x8, [x20, #40]
	cmp	x8, x0
	b.ge	LBB0_10
; %bb.9:
	str	x0, [x20, #40]
LBB0_10:
	ldp	x8, x9, [sp, #24]
	ldr	x10, [x20, #48]
	sub	x8, x8, x9
	cmp	x10, x8
	b.ge	LBB0_12
; %bb.11:
	str	x8, [x20, #48]
LBB0_12:
	ldp	x8, x9, [sp, #40]
	ldr	x10, [x20, #56]
	sub	x8, x8, x9
	cmp	x10, x8
	b.ge	LBB0_14
; %bb.13:
	str	x8, [x20, #56]
LBB0_14:
	cmp	w22, #1
	b.eq	LBB0_27
; %bb.15:
	mov	w22, w22
	mov	w23, #1
	mov	w24, #1000
	b	LBB0_17
LBB0_16:                                ;   in Loop: Header=BB0_17 Depth=1
	add	x23, x23, #1
	cmp	x22, x23
	b.eq	LBB0_27
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	lsl	x25, x23, #2
	ldr	w8, [x19, x25]
	ldr	x9, [x20, #64]
	str	w8, [x9, x25]
	ldr	w0, [x19, x25]
	bl	_AVIStreamAddRef
	ldr	w0, [x19, x25]
	add	x1, sp, #8
	mov	w2, #56
	bl	_AVIStreamInfoW
	ldr	x9, [x20, #32]
	ldr	x8, [sp, #16]
	cmp	x9, x8
	b.ge	LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	str	x8, [x20, #32]
LBB0_19:                                ;   in Loop: Header=BB0_17 Depth=1
	ldr	w0, [x19, x23, lsl #2]
	ldr	w1, [sp, #56]
	bl	_AVIStreamSampleToTime
	ldp	w1, w8, [x20, #20]
	mul	w2, w8, w24
	bl	_MulDiv
	ldr	x8, [x20, #40]
	cmp	x8, x0
	b.ge	LBB0_21
; %bb.20:                               ;   in Loop: Header=BB0_17 Depth=1
	str	x0, [x20, #40]
LBB0_21:                                ;   in Loop: Header=BB0_17 Depth=1
	ldp	x8, x9, [sp, #24]
	ldr	x10, [x20, #48]
	sub	x8, x8, x9
	cmp	x10, x8
	b.ge	LBB0_23
; %bb.22:                               ;   in Loop: Header=BB0_17 Depth=1
	str	x8, [x20, #48]
LBB0_23:                                ;   in Loop: Header=BB0_17 Depth=1
	ldp	x8, x9, [sp, #40]
	ldr	x10, [x20, #56]
	sub	x8, x8, x9
	cmp	x10, x8
	b.ge	LBB0_16
; %bb.24:                               ;   in Loop: Header=BB0_17 Depth=1
	str	x8, [x20, #56]
	b	LBB0_16
LBB0_25:
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x20
	bl	_HeapFree
LBB0_26:
	mov	x21, #0
LBB0_27:
	mov	x0, x21
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdr	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_HEAP_ZERO_MEMORY,4,2           ; @HEAP_ZERO_MEMORY
	.comm	_itmpft,4,2                     ; @itmpft
.subsections_via_symbols
