	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_rle_sgi
_read_rle_sgi:                          ## @read_rle_sgi
	.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, %r13
	movq	%rdi, %r14
	movl	(%rsi), %ebx
	imull	4(%rsi), %ebx
	leaq	16(%rsi), %rdi
	movl	16(%rsi), %eax
	movl	%eax, -44(%rbp)
	shll	$3, %ebx
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_bytestream2_get_bytes_left
	cmpl	%eax, %ebx
	jbe	LBB0_1
LBB0_13:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_14
LBB0_1:
	movl	4(%r13), %ebx
	testl	%ebx, %ebx
	je	LBB0_2
## %bb.3:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	(%r13), %ecx
	xorl	%r14d, %r14d
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
	testl	%ecx, %ecx
	je	LBB0_5
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	8(%r13), %eax
	xorl	%r12d, %r12d
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	imull	%eax, %ebx
	movslq	20(%r13), %rax
	shlq	$2, %rax
	subq	%rax, %r15
	leaq	-44(%rbp), %rdi
	callq	_bytestream2_get_be32
	movq	_SEEK_SET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_bytestream2_seek
	movl	4(%r13), %ecx
	cmpl	$1, 12(%r13)
	leaq	(%r15,%r14,4), %rsi
	movq	%r13, %rdi
	movl	%ebx, %edx
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=2
	callq	_expand_rle_row8
	cmpl	8(%r13), %eax
	je	LBB0_8
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=2
	callq	_expand_rle_row16
	cmpl	8(%r13), %eax
	jne	LBB0_13
LBB0_8:                                 ##   in Loop: Header=BB0_9 Depth=2
	incl	%r12d
	movl	(%r13), %ecx
	movl	4(%r13), %ebx
	cmpl	%ecx, %r12d
	jb	LBB0_9
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_4 Depth=1
	xorl	%ecx, %ecx
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%r14
	movl	%ebx, %edx
	xorl	%eax, %eax
	cmpq	%rdx, %r14
	jb	LBB0_4
	jmp	LBB0_14
LBB0_2:
	xorl	%eax, %eax
LBB0_14:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.no_dead_strip	_read_rle_sgi
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_rle_sgi
_read_rle_sgi:                          ; @read_rle_sgi
	.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
	ldp	w8, w9, [x1]
	mov	x21, x1
	ldr	w10, [x21, #16]!
	str	w10, [sp, #12]
	mul	w22, w8, w9
	mov	x0, x21
	bl	_bytestream2_get_bytes_left
	cmp	w0, w22, lsl #3
	b.hs	LBB0_2
LBB0_1:
Lloh0:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	b	LBB0_13
LBB0_2:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_12
; %bb.3:
	mov	x23, #0
	ldr	w9, [x19]
Lloh3:
	adrp	x24, _SEEK_SET@GOTPAGE
Lloh4:
	ldr	x24, [x24, _SEEK_SET@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #0
	add	x23, x23, #1
	cmp	x23, w8, uxtw
	b.hs	LBB0_13
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	cbz	w9, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w25, #0
	ldr	w0, [x19, #8]
	mov	x26, x20
LBB0_7:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mul	w22, w8, w0
	ldrsw	x8, [x19, #20]
	sub	x26, x26, x8, lsl #2
	add	x0, sp, #12
	bl	_bytestream2_get_be32
	mov	x1, x0
	ldr	w2, [x24]
	mov	x0, x21
	bl	_bytestream2_seek
	ldr	w8, [x19, #12]
	add	x1, x26, x23, lsl #2
	ldr	w3, [x19, #4]
	mov	x0, x19
	mov	x2, x22
	cmp	w8, #1
	b.ne	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	bl	_expand_rle_row8
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_7 Depth=2
	bl	_expand_rle_row16
LBB0_10:                                ;   in Loop: Header=BB0_7 Depth=2
	ldr	w8, [x19, #8]
	cmp	w0, w8
	b.ne	LBB0_1
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=2
	add	w25, w25, #1
	ldp	w9, w8, [x19]
	cmp	w25, w9
	b.lo	LBB0_7
	b	LBB0_4
LBB0_12:
	mov	w0, #0
LBB0_13:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.no_dead_strip	_read_rle_sgi
.subsections_via_symbols
