	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_mainheader
_write_mainheader:                      ## @write_mainheader
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	(%rdi), %esi
	movq	%r14, %rdi
	callq	_ff_put_v
	cmpl	$4, (%r15)
	jl	LBB0_2
## %bb.1:
	movl	$1, 4(%r15)
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_ff_put_v
LBB0_2:
	movq	64(%r15), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_ff_put_v
	movl	8(%r15), %esi
	movq	%r14, %rdi
	callq	_ff_put_v
	movl	12(%r15), %esi
	movq	%r14, %rdi
	callq	_ff_put_v
	cmpl	$0, 12(%r15)
	jle	LBB0_5
## %bb.3:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	56(%r15), %rax
	movl	(%rax,%rbx,8), %esi
	movq	%r14, %rdi
	callq	_ff_put_v
	movq	56(%r15), %rax
	movl	4(%rax,%rbx,8), %esi
	movq	%r14, %rdi
	callq	_ff_put_v
	incq	%rbx
	movslq	12(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_4
LBB0_5:
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movl	$1, %esi
	xorl	%r9d, %r9d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	xorl	%edx, %edx
	xorl	%r12d, %r12d
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	cmpl	$256, %r9d                      ## imm = 0x100
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movl	-64(%rbp), %esi                 ## 4-byte Reload
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	jge	LBB0_26
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	movl	%r12d, %ecx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movq	48(%r15), %rbx
	movslq	%r9d, %rax
	leaq	(%rax,%rax,2), %rdi
	movl	(%rbx,%rdi,8), %r12d
	movl	4(%rbx,%rdi,8), %r10d
	xorl	%r15d, %r15d
	cmpl	%r12d, %ecx
	setne	%r15b
	cmpl	%r10d, %esi
	movl	$2, %ecx
	cmovnel	%ecx, %r15d
	movl	8(%rbx,%rdi,8), %r11d
	cmpl	%r11d, %edx
	movl	$3, %ecx
	cmovnel	%ecx, %r15d
	movl	12(%rbx,%rdi,8), %r14d
	testl	%r14d, %r14d
	movl	$4, %ecx
	cmovnel	%ecx, %r15d
	movl	16(%rbx,%rdi,8), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	cmpl	%ecx, %r8d
	movl	$8, %ecx
	cmovnel	%ecx, %r15d
	leaq	(%rbx,%rdi,8), %rdx
	addq	$20, %rdx
	movl	20(%rbx,%rdi,8), %esi
	leaq	-78(%rax), %rdi
	addq	$-256, %rax
	xorl	%ecx, %ecx
	xorl	%r13d, %r13d
	movl	%r11d, -60(%rbp)                ## 4-byte Spill
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_7 Depth=2
	decl	%r13d
LBB0_15:                                ##   in Loop: Header=BB0_7 Depth=2
	incl	%r13d
	decq	%rcx
	addq	$24, %rdx
	cmpq	%rcx, %rax
	je	LBB0_16
LBB0_7:                                 ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	%rcx, %rdi
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=2
	cmpl	%r12d, -20(%rdx)
	jne	LBB0_17
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=2
	cmpl	%esi, (%rdx)
	jne	LBB0_17
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=2
	cmpl	%r11d, -12(%rdx)
	jne	LBB0_17
## %bb.12:                              ##   in Loop: Header=BB0_7 Depth=2
	cmpl	%r10d, -16(%rdx)
	jne	LBB0_17
## %bb.13:                              ##   in Loop: Header=BB0_7 Depth=2
	leal	(%r14,%r13), %ebx
	cmpl	%ebx, -8(%rdx)
	jne	LBB0_17
## %bb.14:                              ##   in Loop: Header=BB0_7 Depth=2
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	cmpl	%ebx, -4(%rdx)
	je	LBB0_15
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_6 Depth=1
	subl	%ecx, %r9d
	movq	%r9, -56(%rbp)                  ## 8-byte Spill
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	$256, %eax                      ## imm = 0x100
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
LBB0_18:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	%r10d, -64(%rbp)                ## 4-byte Spill
	movl	%r10d, %eax
	subl	%r14d, %eax
	cmpl	%eax, %r13d
	movl	$6, %eax
	cmovnel	%eax, %r15d
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_ff_put_v
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_ff_put_v
	testl	%r15d, %r15d
	je	LBB0_25
## %bb.19:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_put_s
	cmpl	$1, %r15d
	je	LBB0_25
## %bb.20:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %rdi
	movl	-64(%rbp), %esi                 ## 4-byte Reload
	callq	_ff_put_v
	cmpl	$3, %r15d
	jb	LBB0_25
## %bb.21:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %rdi
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	callq	_ff_put_v
	cmpl	$3, %r15d
	je	LBB0_25
## %bb.22:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_ff_put_v
	cmpl	$5, %r15d
	jb	LBB0_25
## %bb.23:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_ff_put_v
	movq	%rbx, %rdi
	movl	%r13d, %esi
	callq	_ff_put_v
	cmpl	$7, %r15d
	jb	LBB0_25
## %bb.24:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_ff_put_v
	movq	%rbx, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_ff_put_v
	jmp	LBB0_25
LBB0_26:
	movl	16(%r15), %esi
	decl	%esi
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_ff_put_v
	cmpl	$2, 16(%r15)
	jl	LBB0_29
## %bb.27:
	movl	$1, %ebx
	.p2align	4, 0x90
LBB0_28:                                ## =>This Inner Loop Header: Depth=1
	movq	24(%r15), %rax
	movl	(%rax,%rbx,4), %esi
	movq	%r14, %rdi
	callq	_ff_put_v
	movq	24(%r15), %rax
	movq	40(%r15), %rcx
	movl	(%rcx,%rbx,4), %esi
	movl	(%rax,%rbx,4), %edx
	movq	%r14, %rdi
	callq	_avio_write
	incq	%rbx
	movslq	16(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_28
LBB0_29:
	cmpl	$4, (%r15)
	jl	LBB0_30
## %bb.31:
	movl	32(%r15), %esi
	movq	%r14, %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ff_put_v                       ## TAILCALL
LBB0_30:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_write_mainheader
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_mainheader
_write_mainheader:                      ; @write_mainheader
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	mov	x20, x0
	ldr	w1, [x0]
	mov	x0, x19
	bl	_ff_put_v
	ldr	w8, [x20]
	cmp	w8, #4
	b.lt	LBB0_2
; %bb.1:
	mov	w8, #1
	str	w8, [x20, #4]
	mov	x0, x19
	mov	w1, #1
	bl	_ff_put_v
LBB0_2:
	ldr	x8, [x20, #64]
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ff_put_v
	ldr	w1, [x20, #8]
	mov	x0, x19
	bl	_ff_put_v
	ldr	w1, [x20, #12]
	mov	x0, x19
	bl	_ff_put_v
	ldr	w8, [x20, #12]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.3:
	mov	x21, #0
	mov	x22, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #56]
	ldr	w1, [x8, x21]
	mov	x0, x19
	bl	_ff_put_v
	ldr	x8, [x20, #56]
	add	x8, x8, x21
	ldr	w1, [x8, #4]
	mov	x0, x19
	bl	_ff_put_v
	add	x22, x22, #1
	ldrsw	x8, [x20, #12]
	add	x21, x21, #8
	cmp	x22, x8
	b.lt	LBB0_4
LBB0_5:
	mov	w28, #0
	mov	w24, #0
	mov	w23, #0
	mov	w21, #0
	mov	w22, #1
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	cmp	w28, #256
	b.ge	LBB0_25
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	mov	w25, #0
	mov	x8, x21
	mov	x10, x23
	mov	x9, x22
	mov	x11, x24
	ldr	x12, [x20, #48]
	sxtw	x13, w28
	mov	w14, #24
	smaddl	x12, w28, w14, x12
	ldp	w21, w22, [x12]
	cmp	w8, w21
	cset	w8, ne
	cmp	w9, w22
	mov	w9, #2
	csel	w8, w8, w9, eq
	ldr	w23, [x12, #8]
	ldp	w24, w1, [x12, #16]
	mov	x9, x12
	ldr	w26, [x9, #12]!
	cmp	w10, w23
	mov	w10, #3
	csel	w8, w8, w10, eq
	cmp	w26, #0
	mov	w10, #4
	csel	w8, w8, w10, eq
	cmp	w11, w24
	mov	w10, #8
	csel	w8, w8, w10, eq
	sub	x10, x13, #78
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=2
	sub	w25, w25, #1
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=2
	add	w25, w25, #1
	add	w28, w28, #1
	add	x10, x10, #1
	add	x9, x9, #24
	cmp	x10, #178
	b.eq	LBB0_17
LBB0_10:                                ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cbz	x10, LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	ldur	w11, [x9, #-12]
	cmp	w11, w21
	b.ne	LBB0_18
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=2
	ldr	w11, [x9, #8]
	cmp	w11, w1
	b.ne	LBB0_18
; %bb.13:                               ;   in Loop: Header=BB0_10 Depth=2
	ldur	w11, [x9, #-4]
	cmp	w11, w23
	b.ne	LBB0_18
; %bb.14:                               ;   in Loop: Header=BB0_10 Depth=2
	ldur	w11, [x9, #-8]
	cmp	w11, w22
	b.ne	LBB0_18
; %bb.15:                               ;   in Loop: Header=BB0_10 Depth=2
	ldr	w11, [x9]
	add	w12, w25, w26
	cmp	w11, w12
	b.ne	LBB0_18
; %bb.16:                               ;   in Loop: Header=BB0_10 Depth=2
	ldr	w11, [x9, #4]
	cmp	w11, w24
	b.eq	LBB0_9
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	w28, #256
LBB0_18:                                ;   in Loop: Header=BB0_7 Depth=1
	sub	w9, w22, w26
	cmp	w25, w9
	mov	w9, #6
	csel	w27, w8, w9, eq
	mov	x0, x19
	bl	_ff_put_v
	mov	x0, x19
	mov	x1, x27
	bl	_ff_put_v
	cbz	w27, LBB0_6
; %bb.19:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_put_s
	cmp	w27, #1
	b.eq	LBB0_6
; %bb.20:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x19
	mov	x1, x22
	bl	_ff_put_v
	cmp	w27, #3
	b.lo	LBB0_6
; %bb.21:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x19
	mov	x1, x23
	bl	_ff_put_v
	cmp	w27, #3
	b.eq	LBB0_6
; %bb.22:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x19
	mov	x1, x26
	bl	_ff_put_v
	cmp	w27, #5
	b.lo	LBB0_6
; %bb.23:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x19
	mov	w1, #0
	bl	_ff_put_v
	mov	x0, x19
	mov	x1, x25
	bl	_ff_put_v
	cmp	w27, #7
	b.lo	LBB0_6
; %bb.24:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x19
	mov	w1, #1
	bl	_ff_put_v
	mov	x0, x19
	mov	x1, x24
	bl	_ff_put_v
	b	LBB0_6
LBB0_25:
	ldr	w8, [x20, #16]
	sub	w1, w8, #1
	mov	x0, x19
	bl	_ff_put_v
	ldr	w8, [x20, #16]
	cmp	w8, #2
	b.lt	LBB0_28
; %bb.26:
	mov	w21, #1
LBB0_27:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #24]
	lsl	x22, x21, #2
	ldr	w1, [x8, x22]
	mov	x0, x19
	bl	_ff_put_v
	ldr	x8, [x20, #40]
	ldr	w1, [x8, x22]
	ldr	x8, [x20, #24]
	ldr	w2, [x8, x22]
	mov	x0, x19
	bl	_avio_write
	add	x21, x21, #1
	ldrsw	x8, [x20, #16]
	cmp	x21, x8
	b.lt	LBB0_27
LBB0_28:
	ldr	w8, [x20]
	cmp	w8, #4
	b.lt	LBB0_30
; %bb.29:
	ldr	w1, [x20, #32]
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_ff_put_v
LBB0_30:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_write_mainheader
.subsections_via_symbols
