	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function repaper_gray8_to_mono_reversed
_repaper_gray8_to_mono_reversed:        ## @repaper_gray8_to_mono_reversed
	.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
                                        ## kill: def $esi killed $esi def $rsi
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	testl	%edx, %edx
	jle	LBB0_22
## %bb.1:
	movq	%rdi, %r12
	leal	7(%rsi), %eax
	testl	%esi, %esi
	cmovnsl	%esi, %eax
	sarl	$3, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	movq	%rdi, %r14
	xorl	%ecx, %ecx
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_21:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	incl	%ecx
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	addl	%esi, %eax
	cmpl	-44(%rbp), %ecx                 ## 4-byte Folded Reload
	je	LBB0_22
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	cmpl	$8, %esi
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	jl	LBB0_21
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movl	%eax, %r15d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_4 Depth=2
	movl	%ebx, (%r14)
	addq	$4, %r14
	addl	$8, %r15d
	decq	%r13
	je	LBB0_21
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movslq	%r15d, %rax
	xorl	%ebx, %ebx
	cmpl	$128, (%r12,%rax,4)
	jb	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	$7, %edi
	callq	_BIT
	movl	%eax, %ebx
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=2
	sarl	%ebx
	leal	1(%r15), %eax
	cltq
	cmpl	$128, (%r12,%rax,4)
	jb	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	$7, %edi
	callq	_BIT
	orl	%eax, %ebx
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=2
	sarl	%ebx
	leal	2(%r15), %eax
	cltq
	cmpl	$128, (%r12,%rax,4)
	jb	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	$7, %edi
	callq	_BIT
	orl	%eax, %ebx
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=2
	sarl	%ebx
	leal	3(%r15), %eax
	cltq
	cmpl	$128, (%r12,%rax,4)
	jb	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=2
	movl	$7, %edi
	callq	_BIT
	orl	%eax, %ebx
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=2
	sarl	%ebx
	leal	4(%r15), %eax
	cltq
	cmpl	$128, (%r12,%rax,4)
	jb	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_4 Depth=2
	movl	$7, %edi
	callq	_BIT
	orl	%eax, %ebx
LBB0_14:                                ##   in Loop: Header=BB0_4 Depth=2
	sarl	%ebx
	leal	5(%r15), %eax
	cltq
	cmpl	$128, (%r12,%rax,4)
	jb	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_4 Depth=2
	movl	$7, %edi
	callq	_BIT
	orl	%eax, %ebx
LBB0_16:                                ##   in Loop: Header=BB0_4 Depth=2
	sarl	%ebx
	leal	6(%r15), %eax
	cltq
	cmpl	$128, (%r12,%rax,4)
	jb	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_4 Depth=2
	movl	$7, %edi
	callq	_BIT
	orl	%eax, %ebx
LBB0_18:                                ##   in Loop: Header=BB0_4 Depth=2
	sarl	%ebx
	leal	7(%r15), %eax
	cltq
	cmpl	$128, (%r12,%rax,4)
	jb	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_4 Depth=2
	movl	$7, %edi
	callq	_BIT
	orl	%eax, %ebx
	jmp	LBB0_20
LBB0_22:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_repaper_gray8_to_mono_reversed
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function repaper_gray8_to_mono_reversed
_repaper_gray8_to_mono_reversed:        ; @repaper_gray8_to_mono_reversed
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	cmp	w2, #1
	b.lt	LBB0_23
; %bb.1:
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	mov	w22, #0
	mov	w23, #0
	add	w8, w1, #7
	cmp	w1, #0
	csel	w8, w8, w1, lt
	asr	w24, w8, #3
	mov	x25, x0
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w23, w23, #1
	add	w22, w22, w20
	cmp	w23, w19
	b.eq	LBB0_23
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	cmp	w20, #8
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x26, x24
	mov	x27, x22
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=2
	str	w28, [x25], #4
	add	w27, w27, #8
	subs	x26, x26, #1
	b.eq	LBB0_2
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [x21, w27, sxtw #2]
	cmp	w8, #128
	b.hs	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	mov	w0, #0
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=2
	mov	w0, #7
	bl	_BIT
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=2
	asr	w28, w0, #1
	add	w8, w27, #1
	ldr	w8, [x21, w8, sxtw #2]
	cmp	w8, #128
	b.lo	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=2
	mov	w0, #7
	bl	_BIT
	orr	w28, w0, w28
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=2
	asr	w28, w28, #1
	add	w8, w27, #2
	ldr	w8, [x21, w8, sxtw #2]
	cmp	w8, #128
	b.lo	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_6 Depth=2
	mov	w0, #7
	bl	_BIT
	orr	w28, w0, w28
LBB0_13:                                ;   in Loop: Header=BB0_6 Depth=2
	asr	w28, w28, #1
	add	w8, w27, #3
	ldr	w8, [x21, w8, sxtw #2]
	cmp	w8, #128
	b.lo	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_6 Depth=2
	mov	w0, #7
	bl	_BIT
	orr	w28, w0, w28
LBB0_15:                                ;   in Loop: Header=BB0_6 Depth=2
	asr	w28, w28, #1
	add	w8, w27, #4
	ldr	w8, [x21, w8, sxtw #2]
	cmp	w8, #128
	b.lo	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_6 Depth=2
	mov	w0, #7
	bl	_BIT
	orr	w28, w0, w28
LBB0_17:                                ;   in Loop: Header=BB0_6 Depth=2
	asr	w28, w28, #1
	add	w8, w27, #5
	ldr	w8, [x21, w8, sxtw #2]
	cmp	w8, #128
	b.lo	LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_6 Depth=2
	mov	w0, #7
	bl	_BIT
	orr	w28, w0, w28
LBB0_19:                                ;   in Loop: Header=BB0_6 Depth=2
	asr	w28, w28, #1
	add	w8, w27, #6
	ldr	w8, [x21, w8, sxtw #2]
	cmp	w8, #128
	b.lo	LBB0_21
; %bb.20:                               ;   in Loop: Header=BB0_6 Depth=2
	mov	w0, #7
	bl	_BIT
	orr	w28, w0, w28
LBB0_21:                                ;   in Loop: Header=BB0_6 Depth=2
	asr	w28, w28, #1
	add	w8, w27, #7
	ldr	w8, [x21, w8, sxtw #2]
	cmp	w8, #128
	b.lo	LBB0_5
; %bb.22:                               ;   in Loop: Header=BB0_6 Depth=2
	mov	w0, #7
	bl	_BIT
	orr	w28, w0, w28
	b	LBB0_5
LBB0_23:
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_repaper_gray8_to_mono_reversed
.subsections_via_symbols
