	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mpjpeg_read_packet
_mpjpeg_read_packet:                    ## @mpjpeg_read_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	$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
	movq	8(%rdi), %r12
	movq	16(%r12), %rdx
	testq	%rdx, %rdx
	je	LBB0_1
LBB0_8:
	movl	(%r15), %edi
	leaq	-52(%rbp), %rsi
	movq	%r15, %rcx
	callq	_parse_multipart_header
	testl	%eax, %eax
	js	LBB0_25
## %bb.9:
	movl	-52(%rbp), %edx
	testl	%edx, %edx
	jle	LBB0_11
## %bb.10:
	movl	(%r15), %edi
	movq	%r14, %rsi
	callq	_av_get_packet
	jmp	LBB0_25
LBB0_1:
	leaq	16(%r12), %r13
	movq	$0, -64(%rbp)
	cmpq	$0, 24(%r12)
	je	LBB0_4
## %bb.2:
	movl	(%r15), %edi
	callq	_mpjpeg_get_boundary
	movq	%rax, -64(%rbp)
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%rax, %rbx
	leaq	L_.str(%rip), %rdi
	movq	%rax, %rsi
	callq	_av_asprintf
	movq	%rax, 16(%r12)
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rsi
	callq	_av_asprintf
	movq	%rax, 8(%r12)
	leaq	-64(%rbp), %rdi
	callq	_av_freep
	cmpq	$0, (%r13)
	jne	LBB0_6
	jmp	LBB0_27
LBB0_4:
	leaq	L_.str.2(%rip), %rdi
	callq	_av_strdup
	movq	%rax, 16(%r12)
	leaq	L_.str.3(%rip), %rdi
	callq	_av_strdup
	movq	%rax, 8(%r12)
	cmpq	$0, (%r13)
	je	LBB0_27
LBB0_6:
	movq	8(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_27
## %bb.7:
	callq	_strlen
	movl	%eax, (%r12)
	movq	16(%r12), %rdx
	jmp	LBB0_8
LBB0_27:
	movq	%r13, %rdi
	callq	_av_freep
	addq	$8, %r12
	movq	%r12, %rdi
	callq	_av_freep
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	jmp	LBB0_25
LBB0_11:
	movq	%r14, %rdi
	callq	_av_init_packet
	movq	$0, (%r14)
	movl	$0, 8(%r14)
	movl	(%r15), %edi
	callq	_avio_tell
	movl	%eax, 12(%r14)
	movl	(%r15), %edi
	movl	$2048, %ebx                     ## imm = 0x800
	movl	$2048, %esi                     ## imm = 0x800
	callq	_ffio_ensure_seekback
	testl	%eax, %eax
	js	LBB0_12
## %bb.17:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
LBB0_18:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_21 Depth 2
	movl	(%r15), %edi
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_av_append_packet
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_19
## %bb.20:                              ##   in Loop: Header=BB0_18 Depth=1
	movslq	8(%r15), %rbx
	addq	(%r15), %rbx
	addl	%r14d, %r13d
	movslq	%r13d, %rax
	subq	%rax, %rbx
	movl	(%r12), %edx
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_21:                                ##   Parent Loop BB0_18 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%r12), %rsi
	movq	%rbx, %rdi
	callq	_memcmp
	testl	%eax, %eax
	je	LBB0_24
## %bb.22:                              ##   in Loop: Header=BB0_21 Depth=2
	leal	-1(%r13), %r14d
	incq	%rbx
	movl	(%r12), %edx
	cmpl	%edx, %r13d
	movl	%r14d, %r13d
	jg	LBB0_21
## %bb.15:                              ##   in Loop: Header=BB0_18 Depth=1
	movl	(%r15), %edi
	movl	$2048, %ebx                     ## imm = 0x800
	subl	%r14d, %ebx
	movl	%ebx, %esi
	callq	_ffio_ensure_seekback
	testl	%eax, %eax
	jns	LBB0_18
## %bb.16:
	movl	%eax, %r13d
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_13
LBB0_24:
	movl	(%r15), %edi
	movl	%r13d, %esi
	negl	%esi
	movq	_SEEK_CUR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_avio_seek
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	8(%rcx), %eax
	subl	%r13d, %eax
	movl	%eax, 8(%rcx)
LBB0_25:
	movl	%eax, %r13d
LBB0_26:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movl	%eax, %r13d
LBB0_13:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jne	LBB0_23
## %bb.14:
	movl	8(%r14), %eax
	testl	%eax, %eax
	cmovgl	%eax, %r13d
	jmp	LBB0_26
LBB0_23:
	movq	%r14, %rdi
	callq	_av_packet_unref
	jmp	LBB0_26
LBB0_19:
	movq	%r15, %r14
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"--%s"

L_.str.1:                               ## @.str.1
	.asciz	"\r\n--%s\r\n"

L_.str.2:                               ## @.str.2
	.asciz	"--"

L_.str.3:                               ## @.str.3
	.asciz	"\r\n--"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_SEEK_CUR,4,2                   ## @SEEK_CUR
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.no_dead_strip	_mpjpeg_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mpjpeg_read_packet
_mpjpeg_read_packet:                    ; @mpjpeg_read_packet
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	x23, [x0, #8]
	mov	x21, x23
	ldr	x2, [x21, #16]!
	cbz	x2, LBB0_4
LBB0_1:
	ldr	w0, [x20]
	add	x1, sp, #12
	mov	x3, x20
	bl	_parse_multipart_header
	tbnz	w0, #31, LBB0_7
; %bb.2:
	ldr	w2, [sp, #12]
	cmp	w2, #1
	b.lt	LBB0_12
; %bb.3:
	ldr	w0, [x20]
	mov	x1, x19
	bl	_av_get_packet
	mov	x21, x0
	b	LBB0_24
LBB0_4:
	str	xzr, [sp]
	ldr	x8, [x23, #24]
	cbz	x8, LBB0_8
; %bb.5:
	ldr	w0, [x20]
	bl	_mpjpeg_get_boundary
	str	x0, [sp]
	cbz	x0, LBB0_8
; %bb.6:
	mov	x22, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x22
	bl	_av_asprintf
	str	x0, [x23, #16]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x22
	bl	_av_asprintf
	str	x0, [x23, #8]
	mov	x0, sp
	bl	_av_freep
	ldr	x8, [x21]
	cbnz	x8, LBB0_9
	b	LBB0_11
LBB0_7:
	mov	x21, x0
	b	LBB0_24
LBB0_8:
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_av_strdup
	str	x0, [x23, #16]
Lloh6:
	adrp	x0, l_.str.3@PAGE
Lloh7:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_av_strdup
	str	x0, [x23, #8]
	ldr	x8, [x21]
	cbz	x8, LBB0_11
LBB0_9:
	ldr	x0, [x23, #8]
	cbz	x0, LBB0_11
; %bb.10:
	bl	_strlen
	str	w0, [x23]
	ldr	x2, [x23, #16]
	b	LBB0_1
LBB0_11:
	mov	x0, x21
	bl	_av_freep
	add	x0, x23, #8
	bl	_av_freep
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x21, x0
	b	LBB0_24
LBB0_12:
	mov	x0, x19
	bl	_av_init_packet
	str	xzr, [x19]
	str	wzr, [x19, #8]
	ldr	w0, [x20]
	bl	_avio_tell
	str	w0, [x19, #12]
	ldr	w0, [x20]
	mov	w24, #2048
	mov	w1, #2048
	bl	_ffio_ensure_seekback
	tbnz	w0, #31, LBB0_19
; %bb.13:
	mov	w25, #0
	mov	w22, #2048
LBB0_14:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_16 Depth 2
	ldr	w0, [x20]
	mov	x1, x19
	mov	x2, x22
	bl	_av_append_packet
	mov	x21, x0
	tbnz	w0, #31, LBB0_20
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	add	w22, w21, w25
	ldr	x8, [x19]
	ldrsw	x9, [x19, #8]
	add	x8, x8, x9
	sub	x21, x8, w22, sxtw
	ldr	w2, [x23]
LBB0_16:                                ;   Parent Loop BB0_14 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x1, [x23, #8]
	mov	x0, x21
	bl	_memcmp
	cbz	w0, LBB0_22
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=2
	sub	w25, w22, #1
	add	x21, x21, #1
	ldr	w2, [x23]
	cmp	w22, w2
	mov	x22, x25
	b.gt	LBB0_16
; %bb.18:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w0, [x20]
	sub	w22, w24, w25
	mov	x1, x22
	bl	_ffio_ensure_seekback
	tbz	w0, #31, LBB0_14
LBB0_19:
	mov	x21, x0
LBB0_20:
Lloh11:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w21, w8
	b.ne	LBB0_23
; %bb.21:
	ldr	w8, [x19, #8]
	cmp	w8, #0
	csel	w21, w8, w21, gt
	b	LBB0_24
LBB0_22:
	ldr	w0, [x20]
	neg	w1, w22
Lloh14:
	adrp	x8, _SEEK_CUR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SEEK_CUR@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	bl	_avio_seek
	ldr	w8, [x19, #8]
	sub	w21, w8, w22
	str	w21, [x19, #8]
	b	LBB0_24
LBB0_23:
	mov	x0, x19
	bl	_av_packet_unref
LBB0_24:
	mov	x0, x21
	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
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"--%s"

l_.str.1:                               ; @.str.1
	.asciz	"\r\n--%s\r\n"

l_.str.2:                               ; @.str.2
	.asciz	"--"

l_.str.3:                               ; @.str.3
	.asciz	"\r\n--"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_SEEK_CUR,4,2                   ; @SEEK_CUR
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.no_dead_strip	_mpjpeg_read_packet
.subsections_via_symbols
