	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sgi_rle_encode
_sgi_rle_encode:                        ## @sgi_rle_encode
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movl	%edx, %r14d
	movq	%rsi, %r13
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_bytestream2_tell_p
	movl	%eax, -92(%rbp)                 ## 4-byte Spill
	cmpl	$1, %r15d
	jne	LBB0_2
## %bb.1:
	movq	_bytestream2_put_byte@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_2:
	movq	_bytestream2_put_be16@GOTPCREL(%rip), %rax
LBB0_3:
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	testl	%r14d, %r14d
	jle	LBB0_21
## %bb.4:
	leal	(%r15,%r15), %eax
	movl	%eax, -96(%rbp)                 ## 4-byte Spill
	movslq	%r15d, %rax
	shlq	$2, %rax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	xorl	%r12d, %r12d
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_7 Depth=1
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
LBB0_6:                                 ##   in Loop: Header=BB0_7 Depth=1
	movl	%ebx, %eax
	imull	%r15d, %eax
	cltq
	leaq	(%r13,%rax,4), %r13
	addl	%ebx, %r12d
	cmpl	%r14d, %r12d
	jge	LBB0_21
LBB0_7:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_16 Depth 2
	subl	%r12d, %r14d
	movq	%r13, %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	movl	$1, %ecx
	callq	_ff_rle_count_pixels
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	cmpl	$2, %eax
	jl	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_bytestream2_get_bytes_left_p
	cmpl	-96(%rbp), %eax                 ## 4-byte Folded Reload
	jl	LBB0_22
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	cmpl	$1, %r15d
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	jne	LBB0_18
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r13), %eax
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%r13, %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	xorl	%ecx, %ecx
	callq	_ff_rle_count_pixels
	movl	%eax, %ebx
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_bytestream2_get_bytes_left_p
	leal	1(%rbx), %ecx
	imull	%r15d, %ecx
	cmpl	%ecx, %eax
	jl	LBB0_22
## %bb.12:                              ##   in Loop: Header=BB0_7 Depth=1
	leal	128(%rbx), %esi
	movq	%r14, %rdi
	callq	*-72(%rbp)                      ## 8-byte Folded Reload
	testl	%ebx, %ebx
	jle	LBB0_20
## %bb.13:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movq	%r14, %r12
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	movl	%ebx, %ebx
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_16 Depth=2
	movq	%r13, %rdi
	callq	_AV_RB16
	movl	%eax, %esi
LBB0_15:                                ##   in Loop: Header=BB0_16 Depth=2
	movq	%r12, %rdi
	callq	*-72(%rbp)                      ## 8-byte Folded Reload
	incq	%r14
	addq	-104(%rbp), %r13                ## 8-byte Folded Reload
	cmpq	%r14, %rbx
	je	LBB0_5
LBB0_16:                                ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpl	$1, %r15d
	jne	LBB0_14
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=2
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax,%r14,4), %esi
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%r13, %rdi
	callq	_AV_RB16
LBB0_19:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movl	%ebx, %esi
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	callq	*%r12
	movq	%r14, %rdi
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	callq	*%r12
	movq	-80(%rbp), %r12                 ## 8-byte Reload
LBB0_20:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	jmp	LBB0_6
LBB0_21:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_bytestream2_tell_p
	subl	-92(%rbp), %eax                 ## 4-byte Folded Reload
	jmp	LBB0_23
LBB0_22:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_23:
	addq	$72, %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
	.no_dead_strip	_sgi_rle_encode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sgi_rle_encode
_sgi_rle_encode:                        ; @sgi_rle_encode
	.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	x23, x2
	mov	x21, x1
	mov	x20, x0
	bl	_bytestream2_tell_p
	str	w0, [sp, #4]                    ; 4-byte Folded Spill
Lloh0:
	adrp	x8, _bytestream2_put_be16@GOTPAGE
Lloh1:
	ldr	x8, [x8, _bytestream2_put_be16@GOTPAGEOFF]
Lloh2:
	adrp	x9, _bytestream2_put_byte@GOTPAGE
Lloh3:
	ldr	x9, [x9, _bytestream2_put_byte@GOTPAGEOFF]
	cmp	w19, #1
	csel	x26, x9, x8, eq
	cmp	w23, #1
	b.lt	LBB0_17
; %bb.1:
	mov	w27, #0
	lsl	w8, w19, #1
	stp	w23, w8, [sp, #8]               ; 8-byte Folded Spill
	sbfiz	x22, x19, #2, #32
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w23, [sp, #8]                   ; 4-byte Folded Reload
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mul	w8, w24, w19
	add	x21, x21, w8, sxtw #2
	add	w27, w24, w27
	cmp	w27, w23
	b.ge	LBB0_17
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_13 Depth 2
	sub	w25, w23, w27
	mov	x0, x21
	mov	x1, x25
	mov	x2, x19
	mov	w3, #1
	bl	_ff_rle_count_pixels
	cmp	w0, #2
	b.lt	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x24, x0
	mov	x0, x20
	bl	_bytestream2_get_bytes_left_p
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	cmp	w0, w8
	b.lt	LBB0_18
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w19, #1
	b.ne	LBB0_15
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w25, [x21]
	b	LBB0_16
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	mov	x1, x25
	mov	x2, x19
	mov	w3, #0
	bl	_ff_rle_count_pixels
	mov	x24, x0
	mov	x0, x20
	bl	_bytestream2_get_bytes_left_p
	madd	w8, w19, w24, w19
	cmp	w0, w8
	b.lt	LBB0_18
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	add	w1, w24, #128
	mov	x0, x20
	blr	x26
	cmp	w24, #1
	b.lt	LBB0_3
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	w28, w24
	mov	x23, x21
	mov	x25, x21
	b	LBB0_13
LBB0_11:                                ;   in Loop: Header=BB0_13 Depth=2
	mov	x0, x25
	bl	_AV_RB16
	mov	x1, x0
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=2
	mov	x0, x20
	blr	x26
	add	x25, x25, x22
	add	x23, x23, #4
	subs	x28, x28, #1
	b.eq	LBB0_2
LBB0_13:                                ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	w19, #1
	b.ne	LBB0_11
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=2
	ldr	w1, [x23]
	b	LBB0_12
LBB0_15:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	bl	_AV_RB16
	mov	x25, x0
LBB0_16:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	mov	x1, x24
	blr	x26
	mov	x0, x20
	mov	x1, x25
	blr	x26
	b	LBB0_3
LBB0_17:
	mov	x0, x20
	bl	_bytestream2_tell_p
	ldr	w8, [sp, #4]                    ; 4-byte Folded Reload
	sub	w0, w0, w8
	b	LBB0_19
LBB0_18:
Lloh4:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh5:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
LBB0_19:
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.no_dead_strip	_sgi_rle_encode
.subsections_via_symbols
