	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gxf_write_map_packet
_gxf_write_map_packet:                  ## @gxf_write_map_packet
	.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
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	(%rdi), %r13
	movq	8(%rdi), %r12
	movq	%r13, %rdi
	callq	_avio_tell
	movl	%eax, %r15d
	testl	%ebx, %ebx
	jne	LBB0_5
## %bb.1:
	movl	(%r12), %esi
	imull	$-286331153, %esi, %eax         ## imm = 0xEEEEEEEF
	addl	$143165576, %eax                ## imm = 0x8888888
	rorl	%eax
	cmpl	$143165576, %eax                ## imm = 0x8888888
	ja	LBB0_4
## %bb.2:
	leaq	8(%r12), %rdi
	addl	$30, %esi
                                        ## kill: def $esi killed $esi killed $rsi
	movl	$4, %edx
	callq	_av_reallocp_array
	testl	%eax, %eax
	js	LBB0_6
## %bb.3:
	movl	(%r12), %esi
LBB0_4:
	movq	8(%r12), %rax
	leal	1(%rsi), %ecx
	movl	%ecx, (%r12)
	movslq	%esi, %rcx
	movl	%r15d, (%rax,%rcx,4)
LBB0_5:
	movq	_PKT_MAP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_gxf_write_packet_header
	movq	%r13, %rdi
	movl	$224, %esi
	callq	_avio_w8
	movq	%r13, %rdi
	movl	$255, %esi
	callq	_avio_w8
	movq	%r14, %rdi
	callq	_gxf_write_material_data_section
	movq	%r14, %rdi
	callq	_gxf_write_track_description_section
	movq	%r13, %rdi
	movl	%r15d, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_updatePacketSize               ## TAILCALL
LBB0_6:
	movl	%eax, %ebx
	movl	$0, (%r12)
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	callq	_av_log
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not realloc map offsets\n"

	.comm	_PKT_MAP,4,2                    ## @PKT_MAP
	.no_dead_strip	_gxf_write_map_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gxf_write_map_packet
_gxf_write_map_packet:                  ; @gxf_write_map_packet
	.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
	mov	x22, x1
	mov	x19, x0
	ldp	x20, x23, [x0]
	mov	x0, x20
	bl	_avio_tell
	mov	x21, x0
	cbnz	w22, LBB0_5
; %bb.1:
	ldr	w8, [x23]
	mov	w9, #61167
	movk	w9, #61166, lsl #16
	mov	w10, #34952
	movk	w10, #2184, lsl #16
	madd	w9, w8, w9, w10
	ror	w9, w9, #1
	cmp	w9, w10
	b.hi	LBB0_4
; %bb.2:
	add	x0, x23, #8
	add	w1, w8, #30
	mov	w2, #4
	bl	_av_reallocp_array
	tbnz	w0, #31, LBB0_6
; %bb.3:
	ldr	w8, [x23]
LBB0_4:
	ldr	x9, [x23, #8]
	add	w10, w8, #1
	str	w10, [x23]
	str	w21, [x9, w8, sxtw #2]
LBB0_5:
Lloh0:
	adrp	x8, _PKT_MAP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PKT_MAP@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_gxf_write_packet_header
	mov	x0, x20
	mov	w1, #224
	bl	_avio_w8
	mov	x0, x20
	mov	w1, #255
	bl	_avio_w8
	mov	x0, x19
	bl	_gxf_write_material_data_section
	mov	x0, x19
	bl	_gxf_write_track_description_section
	mov	x0, x20
	mov	x1, 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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_updatePacketSize
LBB0_6:
	mov	x22, x0
	str	wzr, [x23]
Lloh3:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_av_log
	mov	x0, x22
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not realloc map offsets\n"

	.comm	_PKT_MAP,4,2                    ; @PKT_MAP
	.no_dead_strip	_gxf_write_map_packet
.subsections_via_symbols
