	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sap_fetch_packet
_sap_fetch_packet:                      ## @sap_fetch_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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	8(%rdi), %r14
	movl	24(%r14), %edi
	callq	_ffurl_get_file_handle
	movq	%rsp, %r12
	movl	%eax, -80(%rbp)
	movq	_POLLIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -76(%rbp)
	movq	$0, -72(%rbp)
	movq	_RTP_MAX_PACKET_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	leaq	(,%r15,4), %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	cmpl	$0, (%r14)
	je	LBB0_1
## %bb.18:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%r12, %rcx
	jmp	LBB0_16
LBB0_1:
	movq	%r13, -88(%rbp)                 ## 8-byte Spill
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	leaq	-80(%rbp), %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_poll
	testl	%eax, %eax
	movq	_POLLIN@GOTPCREL(%rip), %r12
	jle	LBB0_9
## %bb.2:
	shll	$2, %r15d
	movq	%rbx, %r13
	addq	$8, %r13
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	leaq	-80(%rbp), %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_poll
	testl	%eax, %eax
	jle	LBB0_9
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %eax
	testl	%eax, -72(%rbp)
	je	LBB0_9
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	24(%r14), %edi
	movq	%rbx, %rsi
	movl	%r15d, %edx
	callq	_ffurl_read
	cmpl	$8, %eax
	jl	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %rdi
	callq	_AV_RB16
	testb	$4, (%rbx)
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	8(%r14), %rax
	jne	LBB0_8
## %bb.7:
	movl	$1, (%r14)
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_15
LBB0_9:
	movq	16(%r14), %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_av_read_frame
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_15
## %bb.10:
	movq	_AVFMTCTX_NOHEADER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-88(%rbp), %r13                 ## 8-byte Reload
	testl	%eax, (%r13)
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	je	LBB0_16
## %bb.11:
	movq	16(%r14), %rax
	movl	4(%r13), %r12d
	cmpl	%r12d, (%rax)
	jle	LBB0_16
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_avformat_new_stream
	testq	%rax, %rax
	je	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	%rax, %rbx
	movl	%r12d, (%rax)
	movl	8(%rax), %edi
	movq	16(%r14), %rax
	movq	8(%rax), %rax
	movslq	%r12d, %r12
	movq	(%rax,%r12,8), %rax
	movl	4(%rax), %esi
	callq	_avcodec_parameters_copy
	movq	16(%r14), %rax
	movq	8(%rax), %rcx
	movq	(%rcx,%r12,8), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 4(%rbx)
	movl	4(%r13), %r12d
	cmpl	%r12d, (%rax)
	jg	LBB0_12
	jmp	LBB0_15
LBB0_13:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_av_packet_unref
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %r15d
LBB0_15:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
LBB0_16:
	movq	%rcx, %rsp
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_19
## %bb.17:
	movl	%r15d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_POLLIN,4,2                     ## @POLLIN
	.comm	_RTP_MAX_PACKET_LENGTH,4,2      ## @RTP_MAX_PACKET_LENGTH
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.comm	_AVFMTCTX_NOHEADER,4,2          ## @AVFMTCTX_NOHEADER
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_sap_fetch_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sap_fetch_packet
_sap_fetch_packet:                      ; @sap_fetch_packet
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	sub	sp, sp, #32
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	ldr	x25, [x0, #8]
	ldr	w0, [x25, #24]
	bl	_ffurl_get_file_handle
	mov	x24, sp
Lloh3:
	adrp	x26, _POLLIN@GOTPAGE
Lloh4:
	ldr	x26, [x26, _POLLIN@GOTPAGEOFF]
	ldr	w8, [x26]
	stp	w0, w8, [x29, #-88]
	stur	xzr, [x29, #-80]
Lloh5:
	adrp	x8, _RTP_MAX_PACKET_LENGTH@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RTP_MAX_PACKET_LENGTH@GOTPAGEOFF]
Lloh7:
	ldr	w22, [x8]
	lsl	x8, x22, #2
	mov	x9, x8
Lloh8:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh9:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x21, x9, x8
	mov	sp, x21
	ldr	w8, [x25]
	cbz	w8, LBB0_4
LBB0_1:
Lloh10:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh11:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
Lloh12:
	ldr	w21, [x8]
LBB0_2:
	mov	sp, x24
	ldur	x8, [x29, #-72]
Lloh13:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh14:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_19
; %bb.3:
	mov	x0, x21
	sub	sp, x29, #64
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_4:
	sub	x0, x29, #88
	mov	w1, #1
	mov	w2, #0
	bl	_poll
	cmp	w0, #1
	b.lt	LBB0_12
; %bb.5:
	lsl	w22, w22, #2
	add	x23, x21, #8
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	sub	x0, x29, #88
	mov	w1, #1
	mov	w2, #0
	bl	_poll
	cmp	w0, #0
	b.le	LBB0_12
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w8, [x29, #-80]
	ldr	w9, [x26]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w0, [x25, #24]
	mov	x1, x21
	mov	x2, x22
	bl	_ffurl_read
	cmp	w0, #8
	b.lt	LBB0_6
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x23
	bl	_AV_RB16
	ldrb	w8, [x21]
	tbz	w8, #2, LBB0_6
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x25, #8]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.11:
	mov	w8, #1
	str	w8, [x25]
	b	LBB0_1
LBB0_12:
	ldr	x0, [x25, #16]
	mov	x1, x19
	bl	_av_read_frame
	mov	x21, x0
	tbnz	w0, #31, LBB0_2
; %bb.13:
	ldr	w8, [x20]
Lloh16:
	adrp	x9, _AVFMTCTX_NOHEADER@GOTPAGE
Lloh17:
	ldr	x9, [x9, _AVFMTCTX_NOHEADER@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.14:
	ldr	x8, [x25, #16]
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x8]
	ldr	w23, [x20, #4]
	cmp	w8, w23
	b.le	LBB0_2
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x20
	mov	x1, #0
	bl	_avformat_new_stream
	cbz	x0, LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x22, x0
	str	w23, [x0]
	ldr	w0, [x0, #8]
	ldr	x8, [x25, #16]
	ldr	x8, [x8, #8]
	sbfiz	x23, x23, #3, #32
	ldr	x8, [x8, x23]
	ldr	w1, [x8, #4]
	bl	_avcodec_parameters_copy
	ldr	x8, [x25, #16]
	ldr	x9, [x8, #8]
	ldr	x9, [x9, x23]
	ldr	w9, [x9]
	str	w9, [x22, #4]
	b	LBB0_15
LBB0_18:
	mov	x0, x19
	bl	_av_packet_unref
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x21, x0
	b	LBB0_2
LBB0_19:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_POLLIN,4,2                     ; @POLLIN
	.comm	_RTP_MAX_PACKET_LENGTH,4,2      ; @RTP_MAX_PACKET_LENGTH
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.comm	_AVFMTCTX_NOHEADER,4,2          ; @AVFMTCTX_NOHEADER
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_sap_fetch_packet
.subsections_via_symbols
