	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function packet_alloc
_packet_alloc:                          ## @packet_alloc
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%esi, %esi
	js	LBB0_6
## %bb.1:
	movl	%esi, %ebx
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_AV_INPUT_BUFFER_PADDING_SIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	subl	%esi, %eax
	cmpl	%ebx, %eax
	jle	LBB0_6
## %bb.2:
	movq	%rdi, %r14
	addl	%ebx, %esi
	callq	_av_buffer_realloc
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movq	(%r14), %rax
	movl	%ebx, %edi
	addq	(%rax), %rdi
	movl	(%r12), %edx
	xorl	%r15d, %r15d
	xorl	%esi, %esi
	callq	_memset
	jmp	LBB0_5
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_3:
	movl	%eax, %r15d
LBB0_5:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INT_MAX,4,2                    ## @INT_MAX
	.comm	_AV_INPUT_BUFFER_PADDING_SIZE,4,2 ## @AV_INPUT_BUFFER_PADDING_SIZE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_packet_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function packet_alloc
_packet_alloc:                          ; @packet_alloc
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	tbnz	w1, #31, LBB0_5
; %bb.1:
	mov	x19, x1
Lloh0:
	adrp	x8, _INT_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _INT_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
Lloh3:
	adrp	x21, _AV_INPUT_BUFFER_PADDING_SIZE@GOTPAGE
Lloh4:
	ldr	x21, [x21, _AV_INPUT_BUFFER_PADDING_SIZE@GOTPAGEOFF]
	ldr	w8, [x21]
	sub	w9, w9, w8
	cmp	w9, w1
	b.le	LBB0_5
; %bb.2:
	mov	x20, x0
	add	w1, w8, w19
	bl	_av_buffer_realloc
	tbnz	w0, #31, LBB0_4
; %bb.3:
	ldr	x8, [x20]
	ldr	x8, [x8]
	add	x0, x8, w19, uxtw
	ldr	w2, [x21]
	mov	w1, #0
	bl	_memset
	mov	w0, #0
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_5:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_AVERROR
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_INT_MAX,4,2                    ; @INT_MAX
	.comm	_AV_INPUT_BUFFER_PADDING_SIZE,4,2 ; @AV_INPUT_BUFFER_PADDING_SIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_packet_alloc
.subsections_via_symbols
