	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function add_segment
_add_segment:                           ## @add_segment
	.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	%r9, -72(%rbp)                  ## 8-byte Spill
	movq	%r8, -64(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r15
	movq	%rdx, %r12
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movl	24(%rbp), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	16(%rbp), %r13
	movl	4(%rdi), %eax
	cmpl	%eax, (%rdi)
	jl	LBB0_3
## %bb.1:
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %eax
	addl	$2, %eax
	movl	%eax, 4(%rbx)
	leaq	16(%rbx), %rdi
	leal	16(,%rcx,8), %esi
	callq	_av_reallocp
	testl	%eax, %eax
	js	LBB0_2
LBB0_3:
	movl	$48, %edi
	callq	_av_mallocz
	testq	%rax, %rax
	je	LBB0_9
## %bb.4:
	movq	%rax, %r14
	movl	40(%rax), %edi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	$4, %edx
	callq	_av_strlcpy
	movq	%r12, (%r14)
	movq	%r15, 32(%r14)
	testq	%r12, %r12
	jns	LBB0_6
## %bb.5:
	addq	%r12, %r15
	movq	%r15, 32(%r14)
	movq	$0, (%r14)
LBB0_6:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 24(%r14)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 16(%r14)
	movq	%r13, 8(%r14)
	movq	16(%rbx), %rax
	movslq	(%rbx), %rcx
	leal	1(%rcx), %edx
	movl	%edx, (%rbx)
	movq	%r14, (%rax,%rcx,8)
	movl	8(%rbx), %r8d
	incl	%r8d
	movl	%r8d, 8(%rbx)
	xorl	%r14d, %r14d
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	cmpl	%r15d, %r8d
	jge	LBB0_8
## %bb.7:
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	xorl	%r14d, %r14d
	xorl	%edi, %edi
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%r15d, %r9d
	callq	_av_log
	movl	%r15d, 8(%rbx)
	jmp	LBB0_8
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_2:
	movl	%eax, %r14d
	movq	$0, (%rbx)
LBB0_8:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AV_LOG_WARNING,4,2             ## @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Correcting the segment index after file %s: current=%d corrected=%d\n"

	.no_dead_strip	_add_segment
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function add_segment
_add_segment:                           ; @add_segment
	.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, x7
	mov	x22, x6
	mov	x23, x5
	mov	x24, x4
	mov	x25, x3
	mov	x26, x2
	mov	x21, x1
	mov	x20, x0
	ldp	w9, w8, [x0]
	cmp	w9, w8
	b.lt	LBB0_2
; %bb.1:
	lsl	w8, w8, #1
	add	w8, w8, #2
	str	w8, [x20, #4]
	add	x0, x20, #16
	lsl	w1, w8, #3
	bl	_av_reallocp
	tbnz	w0, #31, LBB0_9
LBB0_2:
	mov	w0, #48
	bl	_av_mallocz
	cbz	x0, LBB0_7
; %bb.3:
	mov	x27, x0
	ldr	w0, [x0, #40]
	mov	x1, x21
	mov	w2, #4
	bl	_av_strlcpy
	str	x26, [x27]
	str	x25, [x27, #32]
	tbz	x26, #63, LBB0_5
; %bb.4:
	add	x8, x25, x26
	str	x8, [x27, #32]
	str	xzr, [x27]
LBB0_5:
	stp	x23, x24, [x27, #16]
	str	x22, [x27, #8]
	ldr	x8, [x20, #16]
	ldrsw	x9, [x20]
	add	w10, w9, #1
	str	w10, [x20]
	str	x27, [x8, x9, lsl #3]
	ldr	w8, [x20, #8]
	add	w4, w8, #1
	str	w4, [x20, #8]
	cmp	w4, w19
	b.ge	LBB0_8
; %bb.6:
Lloh0:
	adrp	x8, _AV_LOG_WARNING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, #0
	mov	x3, x21
	mov	x5, x19
	bl	_av_log
	mov	w0, #0
	str	w19, [x20, #8]
	b	LBB0_10
LBB0_7:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	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	_AVERROR
LBB0_8:
	mov	w0, #0
	b	LBB0_10
LBB0_9:
	str	xzr, [x20]
LBB0_10:
	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
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AV_LOG_WARNING,4,2             ; @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Correcting the segment index after file %s: current=%d corrected=%d\n"

	.no_dead_strip	_add_segment
.subsections_via_symbols
