	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function decode_frame
_decode_frame:                          ## @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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %rbx
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	8(%rdi), %r12
	leaq	12(%r12), %r15
	movl	(%rcx), %edx
	movl	4(%rcx), %esi
	movq	%r15, %rdi
	callq	_bytestream2_init
	movq	%r15, %rdi
	callq	_bytestream2_get_bytes_left
	movq	_SGI_HEADER_SIZE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_2
## %bb.1:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %ecx
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_14
LBB0_2:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_bytestream2_get_be16u
	movq	_SGI_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_4
## %bb.3:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	jmp	LBB0_12
LBB0_4:
	movq	%r15, %r13
	movq	%r15, %rdi
	callq	_bytestream2_get_byteu
	movq	%rax, %r15
	movq	%r13, %rdi
	callq	_bytestream2_get_byteu
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movl	%eax, (%r12)
	movq	%r13, %rdi
	callq	_bytestream2_get_be16u
	movq	%rax, %r14
	movq	%r13, %rdi
	callq	_bytestream2_get_be16u
	movq	%rax, 16(%r12)
	movq	%r13, %rdi
	callq	_bytestream2_get_be16u
	movl	%eax, 4(%r12)
	movq	%r13, %rdi
	callq	_bytestream2_get_be16u
	movq	%rax, 24(%r12)
	movl	(%r12), %ecx
	leal	-1(%rcx), %edx
	cmpl	$2, %edx
	jae	LBB0_10
## %bb.5:
	andl	$-2, %r14d
	cmpl	$2, %r14d
	jne	LBB0_11
## %bb.6:
	movq	%r12, %rdi
	movq	%r15, %r12
	movq	_SGI_GRAYSCALE@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_17
## %bb.7:
	movq	_SGI_RGB@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	je	LBB0_18
## %bb.8:
	movq	_SGI_RGBA@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	je	LBB0_19
## %bb.9:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.4(%rip), %rdx
	movq	%r14, %rdi
	jmp	LBB0_13
LBB0_10:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	jmp	LBB0_12
LBB0_11:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
LBB0_12:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_13:
	xorl	%eax, %eax
	callq	_av_log
LBB0_14:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rbx
LBB0_15:
	movl	(%rbx), %eax
LBB0_16:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	_AV_PIX_FMT_GRAY8@GOTPCREL(%rip), %rax
	movq	_AV_PIX_FMT_GRAY16BE@GOTPCREL(%rip), %rdx
	jmp	LBB0_20
LBB0_18:
	movq	_AV_PIX_FMT_RGB24@GOTPCREL(%rip), %rax
	movq	_AV_PIX_FMT_RGB48BE@GOTPCREL(%rip), %rdx
	jmp	LBB0_20
LBB0_19:
	movq	_AV_PIX_FMT_RGBA@GOTPCREL(%rip), %rax
	movq	_AV_PIX_FMT_RGBA64BE@GOTPCREL(%rip), %rdx
LBB0_20:
	cmpl	$2, %ecx
	cmovneq	%rax, %rdx
	movl	(%rdx), %eax
	movl	%eax, (%r14)
	movq	16(%rdi), %rsi
	movl	4(%rdi), %edx
	movq	%r14, %rdi
	callq	_ff_set_dimensions
	testl	%eax, %eax
	js	LBB0_16
## %bb.21:
	movq	%r14, %rdi
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_ff_get_buffer
	testl	%eax, %eax
	js	LBB0_16
## %bb.22:
	movq	_AV_PICTURE_TYPE_I@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r14)
	movl	$1, (%r14)
	movq	8(%r14), %rax
	movq	16(%r14), %rcx
	movq	(%rcx), %rbx
	movslq	(%rax), %rax
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movslq	4(%r15), %r14
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	%eax, 8(%r15)
	movq	_SGI_HEADER_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_bytestream2_seek
	testl	%r12d, %r12d
	je	LBB0_24
## %bb.23:
	imulq	-48(%rbp), %r14                 ## 8-byte Folded Reload
	leaq	(%rbx,%r14,4), %rdi
	movq	%r15, %rsi
	callq	_read_rle_sgi
	jmp	LBB0_25
LBB0_24:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_read_uncompressed_sgi
LBB0_25:
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	testl	%eax, %eax
	jne	LBB0_16
## %bb.26:
	movl	$1, (%rcx)
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_SGI_HEADER_SIZE,8,3            ## @SGI_HEADER_SIZE
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"buf_size too small (%d)\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_SGI_MAGIC,8,3                  ## @SGI_MAGIC
L_.str.1:                               ## @.str.1
	.asciz	"bad magic number\n"

L_.str.2:                               ## @.str.2
	.asciz	"wrong channel number\n"

L_.str.3:                               ## @.str.3
	.asciz	"wrong dimension number\n"

	.comm	_SGI_GRAYSCALE,8,3              ## @SGI_GRAYSCALE
	.comm	_AV_PIX_FMT_GRAY16BE,4,2        ## @AV_PIX_FMT_GRAY16BE
	.comm	_AV_PIX_FMT_GRAY8,4,2           ## @AV_PIX_FMT_GRAY8
	.comm	_SGI_RGB,8,3                    ## @SGI_RGB
	.comm	_AV_PIX_FMT_RGB48BE,4,2         ## @AV_PIX_FMT_RGB48BE
	.comm	_AV_PIX_FMT_RGB24,4,2           ## @AV_PIX_FMT_RGB24
	.comm	_SGI_RGBA,8,3                   ## @SGI_RGBA
	.comm	_AV_PIX_FMT_RGBA64BE,4,2        ## @AV_PIX_FMT_RGBA64BE
	.comm	_AV_PIX_FMT_RGBA,4,2            ## @AV_PIX_FMT_RGBA
L_.str.4:                               ## @.str.4
	.asciz	"wrong picture format\n"

	.comm	_AV_PICTURE_TYPE_I,4,2          ## @AV_PICTURE_TYPE_I
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.no_dead_strip	_decode_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function decode_frame
_decode_frame:                          ; @decode_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x3
	mov	x20, x2
	mov	x24, x1
	mov	x22, x0
	ldr	x21, [x0, #8]
	add	x23, x21, #12
	ldp	w2, w1, [x3]
	mov	x0, x23
	bl	_bytestream2_init
	mov	x0, x23
	bl	_bytestream2_get_bytes_left
Lloh0:
	adrp	x27, _SGI_HEADER_SIZE@GOTPAGE
Lloh1:
	ldr	x27, [x27, _SGI_HEADER_SIZE@GOTPAGEOFF]
	ldr	x8, [x27]
	cmp	x0, x8
	b.ge	LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	ldr	w8, [x19]
	str	x8, [sp]
Lloh5:
	adrp	x2, l_.str@PAGE
Lloh6:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_12
LBB0_2:
	mov	x0, x23
	bl	_bytestream2_get_be16u
Lloh7:
	adrp	x8, _SGI_MAGIC@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SGI_MAGIC@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_4
; %bb.3:
Lloh10:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	adrp	x2, l_.str.1@PAGE
Lloh14:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_12
LBB0_4:
	mov	x0, x23
	bl	_bytestream2_get_byteu
	mov	x25, x0
	mov	x0, x23
	bl	_bytestream2_get_byteu
	str	w0, [x21]
	mov	x0, x23
	bl	_bytestream2_get_be16u
	mov	x26, x0
	mov	x0, x23
	bl	_bytestream2_get_be16u
	str	x0, [x21, #16]
	mov	x0, x23
	bl	_bytestream2_get_be16u
	str	w0, [x21, #4]
	mov	x0, x23
	bl	_bytestream2_get_be16u
	str	x0, [x21, #24]
	ldr	w8, [x21]
	sub	w9, w8, #1
	cmp	w9, #2
	b.hs	LBB0_10
; %bb.5:
	and	x9, x26, #0xfffffffe
	cmp	x9, #2
	b.ne	LBB0_11
; %bb.6:
Lloh15:
	adrp	x9, _SGI_GRAYSCALE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _SGI_GRAYSCALE@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x0, x9
	b.eq	LBB0_15
; %bb.7:
Lloh18:
	adrp	x9, _SGI_RGB@GOTPAGE
Lloh19:
	ldr	x9, [x9, _SGI_RGB@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x0, x9
	b.eq	LBB0_16
; %bb.8:
Lloh21:
	adrp	x9, _SGI_RGBA@GOTPAGE
Lloh22:
	ldr	x9, [x9, _SGI_RGBA@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x0, x9
	b.eq	LBB0_17
; %bb.9:
Lloh24:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh25:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
Lloh27:
	adrp	x2, l_.str.4@PAGE
Lloh28:
	add	x2, x2, l_.str.4@PAGEOFF
	b	LBB0_12
LBB0_10:
Lloh29:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh30:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
Lloh32:
	adrp	x2, l_.str.2@PAGE
Lloh33:
	add	x2, x2, l_.str.2@PAGEOFF
	b	LBB0_12
LBB0_11:
Lloh34:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh35:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
Lloh37:
	adrp	x2, l_.str.3@PAGE
Lloh38:
	add	x2, x2, l_.str.3@PAGEOFF
LBB0_12:
	mov	x0, x22
	bl	_av_log
Lloh39:
	adrp	x19, _AVERROR_INVALIDDATA@GOTPAGE
Lloh40:
	ldr	x19, [x19, _AVERROR_INVALIDDATA@GOTPAGEOFF]
LBB0_13:
	ldr	w0, [x19]
LBB0_14:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_15:
Lloh41:
	adrp	x9, _AV_PIX_FMT_GRAY8@GOTPAGE
Lloh42:
	ldr	x9, [x9, _AV_PIX_FMT_GRAY8@GOTPAGEOFF]
Lloh43:
	adrp	x10, _AV_PIX_FMT_GRAY16BE@GOTPAGE
Lloh44:
	ldr	x10, [x10, _AV_PIX_FMT_GRAY16BE@GOTPAGEOFF]
	b	LBB0_18
LBB0_16:
Lloh45:
	adrp	x9, _AV_PIX_FMT_RGB24@GOTPAGE
Lloh46:
	ldr	x9, [x9, _AV_PIX_FMT_RGB24@GOTPAGEOFF]
Lloh47:
	adrp	x10, _AV_PIX_FMT_RGB48BE@GOTPAGE
Lloh48:
	ldr	x10, [x10, _AV_PIX_FMT_RGB48BE@GOTPAGEOFF]
	b	LBB0_18
LBB0_17:
Lloh49:
	adrp	x9, _AV_PIX_FMT_RGBA@GOTPAGE
Lloh50:
	ldr	x9, [x9, _AV_PIX_FMT_RGBA@GOTPAGEOFF]
Lloh51:
	adrp	x10, _AV_PIX_FMT_RGBA64BE@GOTPAGE
Lloh52:
	ldr	x10, [x10, _AV_PIX_FMT_RGBA64BE@GOTPAGEOFF]
LBB0_18:
	cmp	w8, #2
	csel	x8, x10, x9, eq
	ldr	w8, [x8]
	str	w8, [x22]
	ldr	x1, [x21, #16]
	ldr	w2, [x21, #4]
	mov	x0, x22
	bl	_ff_set_dimensions
	tbnz	w0, #31, LBB0_14
; %bb.19:
	mov	x0, x22
	mov	x1, x24
	mov	w2, #0
	bl	_ff_get_buffer
	tbnz	w0, #31, LBB0_14
; %bb.20:
Lloh53:
	adrp	x8, _AV_PICTURE_TYPE_I@GOTPAGE
Lloh54:
	ldr	x8, [x8, _AV_PICTURE_TYPE_I@GOTPAGEOFF]
Lloh55:
	ldr	w8, [x8]
	str	w8, [x24, #24]
	mov	w8, #1
	str	w8, [x24]
	ldp	x9, x8, [x24, #8]
	ldr	x22, [x8]
	ldr	w24, [x9]
	ldr	w26, [x21, #4]
	str	w24, [x21, #8]
	ldr	x1, [x27]
Lloh56:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh57:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh58:
	ldr	w2, [x8]
	mov	x0, x23
	bl	_bytestream2_seek
	cbz	w25, LBB0_22
; %bb.21:
	mul	w8, w26, w24
	add	x0, x22, w8, sxtw #2
	mov	x1, x21
	bl	_read_rle_sgi
	b	LBB0_23
LBB0_22:
	mov	x0, x22
	mov	x1, x21
	bl	_read_uncompressed_sgi
LBB0_23:
	cbnz	w0, LBB0_14
; %bb.24:
	mov	w8, #1
	str	w8, [x20]
	b	LBB0_13
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpLdrGot	Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh47, Lloh48
	.loh AdrpLdrGot	Lloh45, Lloh46
	.loh AdrpLdrGot	Lloh51, Lloh52
	.loh AdrpLdrGot	Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh58
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.cfi_endproc
                                        ; -- End function
	.comm	_SGI_HEADER_SIZE,8,3            ; @SGI_HEADER_SIZE
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"buf_size too small (%d)\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_SGI_MAGIC,8,3                  ; @SGI_MAGIC
l_.str.1:                               ; @.str.1
	.asciz	"bad magic number\n"

l_.str.2:                               ; @.str.2
	.asciz	"wrong channel number\n"

l_.str.3:                               ; @.str.3
	.asciz	"wrong dimension number\n"

	.comm	_SGI_GRAYSCALE,8,3              ; @SGI_GRAYSCALE
	.comm	_AV_PIX_FMT_GRAY16BE,4,2        ; @AV_PIX_FMT_GRAY16BE
	.comm	_AV_PIX_FMT_GRAY8,4,2           ; @AV_PIX_FMT_GRAY8
	.comm	_SGI_RGB,8,3                    ; @SGI_RGB
	.comm	_AV_PIX_FMT_RGB48BE,4,2         ; @AV_PIX_FMT_RGB48BE
	.comm	_AV_PIX_FMT_RGB24,4,2           ; @AV_PIX_FMT_RGB24
	.comm	_SGI_RGBA,8,3                   ; @SGI_RGBA
	.comm	_AV_PIX_FMT_RGBA64BE,4,2        ; @AV_PIX_FMT_RGBA64BE
	.comm	_AV_PIX_FMT_RGBA,4,2            ; @AV_PIX_FMT_RGBA
l_.str.4:                               ; @.str.4
	.asciz	"wrong picture format\n"

	.comm	_AV_PICTURE_TYPE_I,4,2          ; @AV_PICTURE_TYPE_I
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.no_dead_strip	_decode_frame
.subsections_via_symbols
