	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sunrast_image_write_image
_sunrast_image_write_image:             ## @sunrast_image_write_image
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r11d
	movq	%rsi, %rax
	movq	%rdi, %r13
	movq	8(%rdi), %r15
	movl	(%r15), %ebx
	testl	%ebx, %ebx
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, -104(%rbp)                ## 8-byte Spill
	je	LBB0_5
## %bb.1:
	movq	%rdx, %r12
	movl	%r11d, -64(%rbp)                ## 4-byte Spill
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movslq	%ebx, %rax
	imulq	$1431655766, %rax, %r14         ## imm = 0x55555556
	movq	%r14, %rax
	shrq	$63, %rax
	shrq	$32, %r14
	addl	%eax, %r14d
	leaq	20(%r15), %r13
	movl	20(%r15), %eax
	movl	%eax, -92(%rbp)
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_bytestream2_skip_p
	movl	20(%r15), %eax
	movl	%eax, -88(%rbp)
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_bytestream2_skip_p
	cmpl	$3, %ebx
	jl	LBB0_4
## %bb.2:
	movl	%r14d, %r14d
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12,%r15,4), %ebx
	movl	%ebx, %eax
	shrl	$16, %eax
	movzbl	%al, %esi
	leaq	-92(%rbp), %rdi
	callq	_bytestream2_put_byteu
	movzbl	%bh, %esi
	leaq	-88(%rbp), %rdi
	callq	_bytestream2_put_byteu
	movzbl	%bl, %esi
	movq	%r13, %rdi
	callq	_bytestream2_put_byteu
	incq	%r15
	cmpq	%r15, %r14
	jne	LBB0_3
LBB0_4:
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	-104(%rbp), %r13                ## 8-byte Reload
	movl	-64(%rbp), %r11d                ## 4-byte Reload
LBB0_5:
	movl	(%r13), %ecx
	imull	4(%r15), %ecx
	movl	4(%r13), %r9d
	leal	7(%rcx), %edx
	sarl	$3, %edx
	movl	%edx, %r10d
	andl	$1, %r10d
	movq	8(%r15), %r8
	movq	_RT_BYTE_ENCODED@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %r8
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	jne	LBB0_6
## %bb.11:
	testl	%r9d, %r9d
	jle	LBB0_29
## %bb.12:
	addl	%edx, %r10d
	leal	-1(%rdx), %esi
	xorl	%r8d, %r8d
	testl	%ecx, %ecx
	movslq	%esi, %rcx
	movq	%rcx, -112(%rbp)                ## 8-byte Spill
	cmovgl	%r8d, %esi
	movslq	%esi, %rcx
	movl	(%rax,%rcx,4), %r13d
	movslq	%r11d, %rbx
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	addq	$20, %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	movl	%r10d, -44(%rbp)                ## 4-byte Spill
	movq	%rbx, -120(%rbp)                ## 8-byte Spill
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_27:                                ##   in Loop: Header=BB0_13 Depth=1
	movl	%r11d, %esi
	shll	$8, %esi
	orl	%r11d, %esi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_bytestream2_put_be16u
LBB0_28:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movl	4(%rax), %r9d
	cmpl	%r9d, %r15d
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	-44(%rbp), %r10d                ## 4-byte Reload
	movq	-120(%rbp), %rbx                ## 8-byte Reload
	jge	LBB0_29
LBB0_13:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_17 Depth 2
	movl	%r15d, %r8d
	movl	%r13d, %r11d
	incl	%r12d
	xorl	%r15d, %r15d
	cmpl	%r10d, %r12d
	setge	%r15b
	movl	$0, %ecx
	cmovgel	%ecx, %r12d
	movq	%rbx, %rsi
	cmovlq	%rcx, %rsi
	addl	%r8d, %r15d
	leaq	(%rax,%rsi,4), %rax
	movl	$1, %r14d
	cmpl	%r9d, %r15d
	jge	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=1
	cmpl	%edx, %r12d
	movslq	%r12d, %rcx
	movq	-112(%rbp), %rdi                ## 8-byte Reload
	cmovgeq	%rdi, %rcx
	movl	(%rax,%rcx,4), %r13d
	cmpl	%r11d, %r13d
	jne	LBB0_21
## %bb.16:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	$1, %ecx
	.p2align	4, 0x90
LBB0_17:                                ##   Parent Loop BB0_13 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%r15d, %esi
	movl	%ecx, %r14d
	incl	%r12d
	xorl	%r13d, %r13d
	xorl	%r15d, %r15d
	cmpl	%r10d, %r12d
	cmovgel	%r13d, %r12d
	movq	%rbx, %rcx
	cmovlq	%r13, %rcx
	setge	%r15b
	addl	%esi, %r15d
	leaq	(%rax,%rcx,4), %rax
	cmpl	%r9d, %r15d
	jge	LBB0_20
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=2
	cmpl	%edx, %r12d
	movslq	%r12d, %rcx
	cmovgeq	%rdi, %rcx
	movl	(%rax,%rcx,4), %r13d
	cmpl	%r11d, %r13d
	jne	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_17 Depth=2
	leal	1(%r14), %ecx
	cmpl	$255, %r14d
	jb	LBB0_17
LBB0_20:                                ##   in Loop: Header=BB0_13 Depth=1
	incl	%r14d
	jmp	LBB0_21
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_13 Depth=1
	xorl	%r13d, %r13d
LBB0_21:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	_RLE_TRIGGER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	cmpl	$2, %r14d
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	ja	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_13 Depth=1
	cmpl	%esi, %r11d
	je	LBB0_23
## %bb.25:                              ##   in Loop: Header=BB0_13 Depth=1
	cmpl	$1, %r14d
	jne	LBB0_27
## %bb.26:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r11d, %esi
	callq	_bytestream2_put_byteu
	jmp	LBB0_28
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_13 Depth=1
	movl	%r11d, -84(%rbp)                ## 4-byte Spill
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_bytestream2_put_byteu
	leal	-1(%r14), %esi
	movq	%rbx, %rdi
	callq	_bytestream2_put_byteu
	cmpl	$2, %r14d
	jb	LBB0_28
## %bb.24:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	-84(%rbp), %esi                 ## 4-byte Reload
	callq	_bytestream2_put_byteu
	jmp	LBB0_28
LBB0_6:
	movl	%r10d, -44(%rbp)                ## 4-byte Spill
	testl	%r9d, %r9d
	jle	LBB0_30
## %bb.7:
	addq	$20, %r15
	movslq	%r11d, %r14
	shlq	$2, %r14
	xorl	%ebx, %ebx
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	incl	%ebx
	addq	%r14, %r12
	cmpl	4(%r13), %ebx
	movq	%r12, %rax
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	jge	LBB0_30
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movq	%rax, %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	movq	%rax, %r12
	callq	_bytestream2_put_buffer
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_bytestream2_put_byteu
	jmp	LBB0_10
LBB0_29:
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	leaq	20(%rbx), %rdi
	callq	_bytestream2_tell_p
	subl	(%rbx), %eax
	addl	$-32, %eax
	movl	%eax, 16(%rbx)
LBB0_30:
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RT_BYTE_ENCODED,8,3            ## @RT_BYTE_ENCODED
	.comm	_RLE_TRIGGER,4,2                ## @RLE_TRIGGER
	.comm	_GET_VALUE,4,2                  ## @GET_VALUE
	.no_dead_strip	_sunrast_image_write_image
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sunrast_image_write_image
_sunrast_image_write_image:             ; @sunrast_image_write_image
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x22, x3
	mov	x19, x1
	mov	x25, x0
	ldr	x26, [x0, #8]
	ldr	w20, [x26]
	cbz	w20, LBB0_3
; %bb.1:
	mov	x21, x2
	mov	w8, #21846
	movk	w8, #21845, lsl #16
	smull	x8, w20, w8
	lsr	x9, x8, #63
	lsr	x8, x8, #32
	add	w23, w8, w9
	mov	x24, x26
	ldr	w8, [x24, #20]!
	str	w8, [sp, #44]
	mov	x0, x24
	mov	x1, x23
	bl	_bytestream2_skip_p
	ldr	w8, [x24]
	str	w8, [sp, #40]
	mov	x0, x24
	mov	x1, x23
	bl	_bytestream2_skip_p
	cmp	w20, #3
	b.lt	LBB0_3
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w20, [x21], #4
	ubfx	w1, w20, #16, #8
	add	x0, sp, #44
	bl	_bytestream2_put_byteu
	ubfx	w1, w20, #8, #8
	add	x0, sp, #40
	bl	_bytestream2_put_byteu
	and	w1, w20, #0xff
	mov	x0, x24
	bl	_bytestream2_put_byteu
	subs	x23, x23, #1
	b.ne	LBB0_2
LBB0_3:
	ldr	w9, [x26, #4]
	ldp	w10, w8, [x25]
	mul	w9, w10, w9
	add	w10, w9, #7
	asr	w21, w10, #3
	and	w20, w21, #0x1
	ldr	x10, [x26, #8]
Lloh0:
	adrp	x11, _RT_BYTE_ENCODED@GOTPAGE
Lloh1:
	ldr	x11, [x11, _RT_BYTE_ENCODED@GOTPAGEOFF]
Lloh2:
	ldr	x11, [x11]
	cmp	x10, x11
	b.ne	LBB0_23
; %bb.4:
	str	x26, [sp, #8]                   ; 8-byte Folded Spill
	str	x25, [sp, #24]                  ; 8-byte Folded Spill
	cmp	w8, #1
	b.lt	LBB0_28
; %bb.5:
	mov	w24, #0
	mov	w26, #0
	add	w27, w20, w21
	sub	w10, w21, #1
	cmp	w9, #0
	csel	w9, wzr, w10, gt
	ldr	w23, [x19, w9, sxtw #2]
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	sxtw	x28, w22
	sxtw	x25, w10
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	add	x9, x9, #20
	str	x9, [sp, #32]                   ; 8-byte Folded Spill
	str	x28, [sp, #16]                  ; 8-byte Folded Spill
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=1
	orr	w1, w20, w20, lsl #8
	ldr	x0, [sp, #32]                   ; 8-byte Folded Reload
	bl	_bytestream2_put_be16u
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	ldr	w8, [x8, #4]
	cmp	w26, w8
	b.ge	LBB0_28
LBB0_8:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
	mov	x20, x23
	add	w9, w24, #1
	cmp	w9, w27
	cinc	w26, w26, ge
	csinc	w24, wzr, w24, ge
	csel	x9, xzr, x28, lt
	add	x19, x19, x9, lsl #2
	cmp	w26, w8
	b.ge	LBB0_14
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x9, x24
	sxtw	x9, w9
	cmp	w24, w21
	csel	x9, x9, x25, lt
	ldr	w23, [x19, x9, lsl #2]
	cmp	w23, w20
	b.ne	LBB0_15
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	w10, #1
LBB0_11:                                ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x9, x10
	add	w10, w24, #1
	cmp	w10, w27
	cinc	w26, w26, ge
	csinc	w24, wzr, w24, ge
	csel	x10, xzr, x28, lt
	add	x19, x19, x10, lsl #2
	cmp	w26, w8
	b.ge	LBB0_16
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=2
	sxtw	x10, w24
	cmp	w24, w21
	csel	x10, x10, x25, lt
	ldr	w23, [x19, x10, lsl #2]
	cmp	w23, w20
	b.ne	LBB0_17
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=2
	add	w10, w9, #1
	cmp	w9, #255
	b.lo	LBB0_11
	b	LBB0_17
LBB0_14:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	w23, #0
LBB0_15:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	w22, #1
	b	LBB0_18
LBB0_16:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	w23, #0
LBB0_17:                                ;   in Loop: Header=BB0_8 Depth=1
	add	w22, w9, #1
LBB0_18:                                ;   in Loop: Header=BB0_8 Depth=1
Lloh3:
	adrp	x8, _RLE_TRIGGER@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RLE_TRIGGER@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	cmp	w22, #2
	b.hi	LBB0_21
; %bb.19:                               ;   in Loop: Header=BB0_8 Depth=1
	cmp	w20, w1
	b.eq	LBB0_21
; %bb.20:                               ;   in Loop: Header=BB0_8 Depth=1
	cmp	w22, #1
	b.ne	LBB0_6
	b	LBB0_22
LBB0_21:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x28, x27
	mov	x27, x25
	mov	x25, x21
	ldr	x21, [sp, #32]                  ; 8-byte Folded Reload
	mov	x0, x21
	bl	_bytestream2_put_byteu
	sub	w1, w22, #1
	mov	x0, x21
	mov	x21, x25
	mov	x25, x27
	mov	x27, x28
	ldr	x28, [sp, #16]                  ; 8-byte Folded Reload
	bl	_bytestream2_put_byteu
	cmp	w22, #2
	b.lo	LBB0_7
LBB0_22:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x0, [sp, #32]                   ; 8-byte Folded Reload
	mov	x1, x20
	bl	_bytestream2_put_byteu
	b	LBB0_7
LBB0_23:
	cmp	w8, #1
	b.lt	LBB0_29
; %bb.24:
	mov	w24, #0
	add	x23, x26, #20
	sbfiz	x22, x22, #2, #32
	b	LBB0_26
LBB0_25:                                ;   in Loop: Header=BB0_26 Depth=1
	add	w24, w24, #1
	ldr	w8, [x25, #4]
	add	x19, x19, x22
	cmp	w24, w8
	b.ge	LBB0_29
LBB0_26:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	mov	x1, x19
	mov	x2, x21
	bl	_bytestream2_put_buffer
	cbz	w20, LBB0_25
; %bb.27:                               ;   in Loop: Header=BB0_26 Depth=1
	mov	x0, x23
	mov	w1, #0
	bl	_bytestream2_put_byteu
	b	LBB0_25
LBB0_28:
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
	add	x0, x19, #20
	bl	_bytestream2_tell_p
	ldr	w8, [x19]
	sub	w8, w0, w8
	sub	w8, w8, #32
	str	w8, [x19, #16]
LBB0_29:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_RT_BYTE_ENCODED,8,3            ; @RT_BYTE_ENCODED
	.comm	_RLE_TRIGGER,4,2                ; @RLE_TRIGGER
	.comm	_GET_VALUE,4,2                  ; @GET_VALUE
	.no_dead_strip	_sunrast_image_write_image
.subsections_via_symbols
