	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function delta_mjpeg_decode
_delta_mjpeg_decode:                    ## @delta_mjpeg_decode
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	8(%rdi), %r13
	callq	_to_ctx
	movq	%rax, %r15
	movq	%rax, %r12
	movl	8(%rbx), %eax
	movl	%eax, -48(%rbp)
	movq	(%rbx), %rax
	movq	%rax, -56(%rbp)
	movl	$0, -44(%rbp)
	movq	(%r15), %rcx
	testq	%rcx, %rcx
	je	LBB0_4
## %bb.1:
	cmpl	$0, 8(%r12)
	je	LBB0_6
LBB0_2:
	movl	-56(%rbp), %ebx
	movl	-48(%rbp), %edx
	leaq	-44(%rbp), %r8
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_delta_mjpeg_read_header
	testl	%eax, %eax
	jne	LBB0_5
## %bb.8:
	movl	-44(%rbp), %eax
	addl	%eax, -52(%rbp)
	addl	%eax, %ebx
	movl	%ebx, -56(%rbp)
	leaq	-56(%rbp), %rsi
	movq	%r14, %rdi
	callq	_delta_mjpeg_ipc_decode
	testl	%eax, %eax
	jne	LBB0_13
	jmp	LBB0_12
LBB0_4:
	addq	$12, %r15
	movl	-56(%rbp), %esi
	movl	-48(%rbp), %edx
	leaq	-44(%rbp), %r8
	movq	%r14, %rdi
	movq	%r15, %rcx
	callq	_delta_mjpeg_read_header
	testl	%eax, %eax
	je	LBB0_9
LBB0_5:
	incl	(%r14)
	jmp	LBB0_13
LBB0_6:
	movq	%r14, %rdi
	callq	_delta_mjpeg_ipc_open
	testl	%eax, %eax
	jne	LBB0_13
## %bb.7:
	movq	(%r12), %rcx
	jmp	LBB0_2
LBB0_9:
	movl	12(%r12), %ecx
	movl	16(%r12), %r8d
	movl	%r8d, %eax
	imull	%ecx, %eax
	movq	_DELTA_MJPEG_MAX_RESO@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r9d
	cmpl	%r9d, %eax
	jle	LBB0_11
## %bb.10:
	movl	(%r13), %edi
	movl	4(%r14), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_13
LBB0_11:
	movq	%r15, (%r12)
LBB0_12:
	xorl	%eax, %eax
LBB0_13:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DELTA_MJPEG_MAX_RESO,4,2       ## @DELTA_MJPEG_MAX_RESO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s  stream resolution too large: %dx%d > %d pixels budget\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_delta_mjpeg_decode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function delta_mjpeg_decode
_delta_mjpeg_decode:                    ; @delta_mjpeg_decode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x21, x1
	mov	x19, x0
	ldr	x22, [x0, #8]
	bl	_to_ctx
	mov	x20, x0
	ldr	x8, [x21]
	str	x8, [sp, #16]
	ldr	w8, [x21, #8]
	str	w8, [sp, #24]
	str	wzr, [sp, #12]
	mov	x21, x0
	ldr	x3, [x21], #12
	cbz	x3, LBB0_4
; %bb.1:
	ldr	w8, [x20, #8]
	cbz	w8, LBB0_6
LBB0_2:
	ldr	w20, [sp, #16]
	ldr	w2, [sp, #24]
	add	x4, sp, #12
	mov	x0, x19
	mov	x1, x20
	bl	_delta_mjpeg_read_header
	cbnz	w0, LBB0_5
; %bb.3:
	ldr	w8, [sp, #12]
	ldr	w9, [sp, #20]
	add	w9, w9, w8
	add	w8, w20, w8
	stp	w8, w9, [sp, #16]
	add	x1, sp, #16
	mov	x0, x19
	bl	_delta_mjpeg_ipc_decode
	b	LBB0_11
LBB0_4:
	ldr	w1, [sp, #16]
	ldr	w2, [sp, #24]
	add	x4, sp, #12
	mov	x0, x19
	mov	x3, x21
	bl	_delta_mjpeg_read_header
	cbz	w0, LBB0_8
LBB0_5:
	ldr	w8, [x19]
	add	w8, w8, #1
	str	w8, [x19]
	b	LBB0_11
LBB0_6:
	mov	x0, x19
	bl	_delta_mjpeg_ipc_open
	cbnz	w0, LBB0_11
; %bb.7:
	ldr	x3, [x20]
	b	LBB0_2
LBB0_8:
	ldp	w3, w4, [x20, #12]
	mul	w8, w4, w3
Lloh0:
	adrp	x9, _DELTA_MJPEG_MAX_RESO@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DELTA_MJPEG_MAX_RESO@GOTPAGEOFF]
Lloh2:
	ldr	w5, [x9]
	cmp	w8, w5
	b.le	LBB0_10
; %bb.9:
	ldr	w0, [x22]
	ldr	w2, [x19, #4]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_10:
	mov	w0, #0
	str	x21, [x20]
LBB0_11:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_DELTA_MJPEG_MAX_RESO,4,2       ; @DELTA_MJPEG_MAX_RESO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s  stream resolution too large: %dx%d > %d pixels budget\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_delta_mjpeg_decode
.subsections_via_symbols
