	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function jpeg2000_decode_frame
_jpeg2000_decode_frame:                 ## @jpeg2000_decode_frame
	.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	%rdx, %r13
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	32(%rdi), %r15
	movq	%rsi, -56(%rbp)
	movq	%rdi, 40(%r15)
	leaq	12(%r15), %rbx
	movl	(%rcx), %edx
	movl	4(%rcx), %esi
	movq	%rbx, %rdi
	callq	_bytestream2_init
	movl	$-1, (%r15)
	movl	48(%r15), %edi
	movl	$-1, %esi
	movl	$4, %edx
	callq	_memset
	movq	%rbx, %rdi
	callq	_bytestream2_get_bytes_left
	cmpl	$1, %eax
	jle	LBB0_1
## %bb.3:
	movq	%rbx, %rdi
	callq	_bytestream2_get_bytes_left
	cmpl	$12, %eax
	jl	LBB0_10
## %bb.4:
	movq	%rbx, %rdi
	callq	_bytestream2_get_be32u
	cmpl	$12, %eax
	jne	LBB0_10
## %bb.5:
	movq	%rbx, %rdi
	callq	_bytestream2_get_be32u
	movq	_JP2_SIG_TYPE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_10
## %bb.6:
	movq	%rbx, %rdi
	callq	_bytestream2_get_be32u
	movq	_JP2_SIG_VALUE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_10
## %bb.7:
	movq	%r15, %rdi
	callq	_jp2_find_codestream
	testl	%eax, %eax
	jne	LBB0_11
## %bb.8:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	jmp	LBB0_9
LBB0_10:
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_bytestream2_seek
LBB0_11:
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_bytestream2_get_bytes_left
	cmpl	$3, %eax
	jl	LBB0_15
## %bb.12:
	movq	_JPEG2000_SOC@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_bytestream2_peek_be16
	cmpq	(%r13), %rax
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_bytestream2_skip
	movq	%rbx, %rdi
	callq	_bytestream2_get_bytes_left
	cmpl	$2, %eax
	jg	LBB0_13
LBB0_15:
	movq	%rbx, %rdi
	callq	_bytestream2_get_be16u
	movq	_JPEG2000_SOC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_16
## %bb.17:
	movq	%r15, %rdi
	callq	_jpeg2000_read_main_headers
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_2
## %bb.18:
	leaq	-56(%rbp), %rsi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_ff_thread_get_buffer
	testl	%eax, %eax
	js	LBB0_19
## %bb.20:
	movq	_AV_PICTURE_TYPE_I@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r12)
	movl	$1, (%r12)
	movq	%r15, %rdi
	callq	_jpeg2000_read_bitstream_packets
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_2
## %bb.21:
	movq	_jpeg2000_decode_tile@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r15), %r8d
	imull	4(%r15), %r8d
	movq	%r14, %rdi
	movq	%r12, %rdx
	xorl	%ecx, %ecx
	callq	*24(%r14)
	movq	%r15, %rdi
	callq	_jpeg2000_dec_cleanup
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	movq	40(%r15), %rax
	movq	(%rax), %rax
	movq	_AV_PIX_FMT_PAL8@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_23
## %bb.22:
	movq	8(%r12), %rax
	movl	4(%rax), %edi
	movl	32(%r15), %esi
	movl	$1024, %edx                     ## imm = 0x400
	callq	_memcpy
LBB0_23:
	leaq	16(%r15), %rax
	cmpq	$0, 24(%r15)
	je	LBB0_26
## %bb.24:
	cmpq	$0, (%rax)
	je	LBB0_26
## %bb.25:
	movups	(%rax), %xmm0
	movups	%xmm0, 8(%r14)
LBB0_26:
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rax)
	movq	%rbx, %rdi
	callq	_bytestream2_tell
	movl	%eax, %r13d
	jmp	LBB0_27
LBB0_16:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
LBB0_9:
	movq	%r14, %rdi
	callq	_av_log
LBB0_1:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_2:
	movq	%r15, %rdi
	callq	_jpeg2000_dec_cleanup
LBB0_27:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movl	%eax, %r13d
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_JP2_SIG_TYPE,4,2               ## @JP2_SIG_TYPE
	.comm	_JP2_SIG_VALUE,4,2              ## @JP2_SIG_VALUE
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not find Jpeg2000 codestream atom.\n"

	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_JPEG2000_SOC,8,3               ## @JPEG2000_SOC
L_.str.1:                               ## @.str.1
	.asciz	"SOC marker not present\n"

	.comm	_AV_PICTURE_TYPE_I,4,2          ## @AV_PICTURE_TYPE_I
	.comm	_jpeg2000_decode_tile,4,2       ## @jpeg2000_decode_tile
	.comm	_AV_PIX_FMT_PAL8,8,3            ## @AV_PIX_FMT_PAL8
	.no_dead_strip	_jpeg2000_decode_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function jpeg2000_decode_frame
_jpeg2000_decode_frame:                 ; @jpeg2000_decode_frame
	.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	x23, x2
	mov	x22, x1
	mov	x20, x0
	ldr	x19, [x0, #32]
	str	x1, [sp, #8]
	str	x0, [x19, #40]
	add	x21, x19, #12
	ldp	w2, w1, [x3]
	mov	x0, x21
	bl	_bytestream2_init
	mov	w8, #-1
	str	w8, [x19]
	ldr	w0, [x19, #48]
	mov	w1, #-1
	mov	w2, #4
	bl	_memset
	mov	x0, x21
	bl	_bytestream2_get_bytes_left
	cmp	w0, #1
	b.le	LBB0_23
; %bb.1:
	mov	x0, x21
	bl	_bytestream2_get_bytes_left
	cmp	w0, #12
	b.lt	LBB0_7
; %bb.2:
	mov	x0, x21
	bl	_bytestream2_get_be32u
	cmp	w0, #12
	b.ne	LBB0_7
; %bb.3:
	mov	x0, x21
	bl	_bytestream2_get_be32u
Lloh0:
	adrp	x8, _JP2_SIG_TYPE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _JP2_SIG_TYPE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_7
; %bb.4:
	mov	x0, x21
	bl	_bytestream2_get_be32u
Lloh3:
	adrp	x8, _JP2_SIG_VALUE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _JP2_SIG_VALUE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_7
; %bb.5:
	mov	x0, x19
	bl	_jp2_find_codestream
	cbnz	w0, LBB0_8
; %bb.6:
Lloh6:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x2, l_.str@PAGE
Lloh10:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_22
LBB0_7:
Lloh11:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	x0, x21
	mov	w1, #0
	bl	_bytestream2_seek
LBB0_8:
	mov	x0, x21
	bl	_bytestream2_get_bytes_left
Lloh14:
	adrp	x24, _JPEG2000_SOC@GOTPAGE
Lloh15:
	ldr	x24, [x24, _JPEG2000_SOC@GOTPAGEOFF]
	cmp	w0, #3
	b.lt	LBB0_11
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_bytestream2_peek_be16
	ldr	x8, [x24]
	cmp	x0, x8
	b.eq	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x21
	mov	w1, #1
	bl	_bytestream2_skip
	mov	x0, x21
	bl	_bytestream2_get_bytes_left
	cmp	w0, #2
	b.gt	LBB0_9
LBB0_11:
	mov	x0, x21
	bl	_bytestream2_get_be16u
	ldr	x8, [x24]
	cmp	x0, x8
	b.ne	LBB0_21
; %bb.12:
	mov	x0, x19
	bl	_jpeg2000_read_main_headers
	mov	x24, x0
	cbnz	w0, LBB0_24
; %bb.13:
	add	x1, sp, #8
	mov	x0, x20
	mov	w2, #0
	bl	_ff_thread_get_buffer
	tbnz	w0, #31, LBB0_26
; %bb.14:
Lloh16:
	adrp	x8, _AV_PICTURE_TYPE_I@GOTPAGE
Lloh17:
	ldr	x8, [x8, _AV_PICTURE_TYPE_I@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	str	w8, [x22, #16]
	mov	w25, #1
	str	w25, [x22]
	mov	x0, x19
	bl	_jpeg2000_read_bitstream_packets
	mov	x24, x0
	cbnz	w0, LBB0_24
; %bb.15:
	ldr	x8, [x20, #24]
Lloh19:
	adrp	x9, _jpeg2000_decode_tile@GOTPAGE
Lloh20:
	ldr	x9, [x9, _jpeg2000_decode_tile@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x9]
	ldp	w9, w10, [x19, #4]
	mul	w4, w10, w9
	mov	x0, x20
	mov	x2, x22
	mov	x3, #0
	blr	x8
	mov	x0, x19
	bl	_jpeg2000_dec_cleanup
	str	w25, [x23]
	ldr	x8, [x19, #40]
	ldr	x8, [x8]
Lloh22:
	adrp	x9, _AV_PIX_FMT_PAL8@GOTPAGE
Lloh23:
	ldr	x9, [x9, _AV_PIX_FMT_PAL8@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_17
; %bb.16:
	ldr	x8, [x22, #8]
	ldr	w0, [x8, #4]
	ldr	w1, [x19, #32]
	mov	w2, #1024
	bl	_memcpy
LBB0_17:
	add	x8, x19, #16
	ldr	x9, [x19, #24]
	cbz	x9, LBB0_20
; %bb.18:
	ldr	x9, [x8]
	cbz	x9, LBB0_20
; %bb.19:
	ldr	q0, [x8]
	stur	q0, [x20, #8]
LBB0_20:
	stp	xzr, xzr, [x8]
	mov	x0, x21
	bl	_bytestream2_tell
	mov	x24, x0
	b	LBB0_25
LBB0_21:
Lloh25:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh26:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
Lloh28:
	adrp	x2, l_.str.1@PAGE
Lloh29:
	add	x2, x2, l_.str.1@PAGEOFF
LBB0_22:
	mov	x0, x20
	bl	_av_log
LBB0_23:
Lloh30:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh31:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh32:
	ldr	w24, [x8]
LBB0_24:
	mov	x0, x19
	bl	_jpeg2000_dec_cleanup
LBB0_25:
	mov	x0, x24
	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
LBB0_26:
	mov	x24, x0
	b	LBB0_24
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_JP2_SIG_TYPE,4,2               ; @JP2_SIG_TYPE
	.comm	_JP2_SIG_VALUE,4,2              ; @JP2_SIG_VALUE
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not find Jpeg2000 codestream atom.\n"

	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_JPEG2000_SOC,8,3               ; @JPEG2000_SOC
l_.str.1:                               ; @.str.1
	.asciz	"SOC marker not present\n"

	.comm	_AV_PICTURE_TYPE_I,4,2          ; @AV_PICTURE_TYPE_I
	.comm	_jpeg2000_decode_tile,4,2       ; @jpeg2000_decode_tile
	.comm	_AV_PIX_FMT_PAL8,8,3            ; @AV_PIX_FMT_PAL8
	.no_dead_strip	_jpeg2000_decode_frame
.subsections_via_symbols
