	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function convert
_convert:                               ## @convert
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %r13
	movq	(%rsi), %r8
	movq	40(%rsi), %r10
	movl	(%r10), %esi
	movl	4(%r10), %r14d
	incl	%esi
	sarl	%esi
	movl	%esi, %eax
	imull	%edx, %eax
	cltd
	idivl	%ecx
	movslq	%eax, %r9
	leaq	(%r9,%r9), %rdi
	incl	%ebx
	imull	%esi, %ebx
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	movl	%eax, %r15d
	movq	8(%r10), %rax
	movslq	(%r8), %rcx
	imulq	%rdi, %rcx
	shlq	$2, %rcx
	addq	(%rax), %rcx
	movq	%rcx, -80(%rbp)
	movb	8(%r12), %cl
	movslq	%edi, %rdx
	movl	%edi, %esi
	sarl	%cl, %esi
	subl	%r9d, %r15d
	movslq	4(%r8), %rcx
	movslq	%esi, %rsi
	imulq	%rsi, %rcx
	shlq	$2, %rcx
	addq	8(%rax), %rcx
	movq	%rcx, -72(%rbp)
	movq	8(%r10), %rax
	movslq	8(%r8), %rcx
	imulq	%rsi, %rcx
	shlq	$2, %rcx
	addq	16(%rax), %rcx
	movq	%rcx, -64(%rbp)
	movq	16(%r12), %rsi
	movq	32(%r12), %rax
	movq	(%rax), %rcx
	movslq	(%rsi), %rdi
	imulq	%rdx, %rdi
	shlq	$2, %rdi
	addq	(%rcx), %rdi
	movq	%rdi, -112(%rbp)
	movb	24(%r12), %cl
	movl	%edx, %edi
	sarl	%cl, %edi
	movq	(%rax), %rcx
	movslq	4(%rsi), %rbx
	movslq	%edi, %rdi
	imulq	%rdi, %rbx
	shlq	$2, %rbx
	addq	8(%rcx), %rbx
	movq	%rbx, -104(%rbp)
	movq	(%rax), %rax
	movslq	8(%rsi), %rcx
	imulq	%rdi, %rcx
	shlq	$2, %rcx
	addq	16(%rax), %rcx
	movq	%rcx, -96(%rbp)
	movq	120(%r13), %rcx
	movl	(%r13), %eax
	imull	%eax, %edx
	movslq	%edx, %rdx
	shlq	$2, %rdx
	movq	(%rcx), %rdi
	addq	%rdx, %rdi
	movq	%rdi, -144(%rbp)
	movq	8(%rcx), %rdi
	addq	%rdx, %rdi
	movq	%rdi, -136(%rbp)
	addq	16(%rcx), %rdx
	addl	%r15d, %r15d
	movq	%rdx, -128(%rbp)
	cmpq	$0, 112(%r13)
	je	LBB0_2
## %bb.1:
	movl	96(%r13), %eax
	leaq	-112(%rbp), %rdi
	leaq	-80(%rbp), %rdx
	movq	%r8, %rcx
	movl	%r14d, %r8d
	movl	%r15d, %r9d
	pushq	16(%r13)
	pushq	%rax
	callq	*104(%r13)
	jmp	LBB0_9
LBB0_2:
	movl	84(%r13), %r10d
	movq	16(%r13), %rcx
	movl	(%rcx), %ebx
	leaq	-144(%rbp), %rdi
	leaq	-80(%rbp), %rdx
	movl	%eax, %esi
	movq	%r8, %rcx
	movl	%r14d, %r8d
	movl	%r15d, %r9d
	pushq	%rbx
	pushq	%r10
	callq	*88(%r13)
	addq	$16, %rsp
	cmpl	$0, 80(%r13)
	jne	LBB0_6
## %bb.3:
	movl	(%r13), %esi
	movl	76(%r13), %r8d
	leaq	-144(%rbp), %rdi
	movl	%r14d, %edx
	movl	%r15d, %ecx
	callq	_apply_lut
	cmpl	$0, 72(%r13)
	jne	LBB0_5
## %bb.4:
	movl	(%r13), %esi
	movl	60(%r13), %r8d
	leaq	-144(%rbp), %rdi
	movl	%r14d, %edx
	movl	%r15d, %ecx
	callq	*64(%r13)
LBB0_5:
	movl	(%r13), %esi
	movl	56(%r13), %r8d
	leaq	-144(%rbp), %rdi
	movl	%r14d, %edx
	movl	%r15d, %ecx
	callq	_apply_lut
LBB0_6:
	movq	8(%r13), %rax
	movq	_DITHER_FSB@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.7:
	movq	16(%r12), %rsi
	movl	(%r13), %ecx
	movl	24(%r13), %r10d
	movq	16(%r13), %rdx
	movl	4(%rdx), %ebx
	movl	40(%r13), %eax
	subq	$8, %rsp
	leaq	-112(%rbp), %rdi
	leaq	-144(%rbp), %rdx
	movl	%r14d, %r8d
	movl	%r15d, %r9d
	pushq	%rax
	pushq	%rbx
	pushq	%r10
	callq	*48(%r13)
	addq	$32, %rsp
	jmp	LBB0_10
LBB0_8:
	movq	16(%r12), %rsi
	movl	(%r13), %ecx
	movl	24(%r13), %eax
	movq	16(%r13), %rdx
	movl	4(%rdx), %ebx
	leaq	-112(%rbp), %rdi
	leaq	-144(%rbp), %rdx
	movl	%r14d, %r8d
	movl	%r15d, %r9d
	pushq	%rbx
	pushq	%rax
	callq	*32(%r13)
LBB0_9:
	addq	$16, %rsp
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	xorl	%eax, %eax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_DITHER_FSB,8,3                 ## @DITHER_FSB
	.no_dead_strip	_convert
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function convert
_convert:                               ; @convert
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	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
	mov	x19, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	ldr	x22, [x0]
	ldp	x9, x8, [x1, #32]
	ldp	w10, w20, [x8]
	add	w10, w10, #1
	asr	w10, w10, #1
	mul	w11, w10, w2
	sdiv	w12, w11, w3
	lsl	w13, w12, #1
	add	w10, w10, w11
	sdiv	w10, w10, w3
	sub	w10, w10, w12
	lsl	w21, w10, #1
	ldr	x10, [x8, #8]
	ldr	x3, [x1]
	ldr	w11, [x3]
	mul	w11, w11, w13
	ldp	x12, x10, [x10]
	add	x11, x12, w11, sxtw #2
	str	x11, [sp, #64]
	ldr	w11, [x3, #4]
	ldr	w12, [x1, #8]
	asr	w12, w13, w12
	mul	w11, w12, w11
	add	x10, x10, w11, sxtw #2
	str	x10, [sp, #72]
	ldr	x8, [x8, #8]
	ldr	x8, [x8, #16]
	ldr	w10, [x3, #8]
	mul	w10, w10, w12
	add	x8, x8, w10, sxtw #2
	str	x8, [sp, #80]
	ldr	x8, [x9]
	ldr	x8, [x8]
	ldr	x1, [x1, #16]
	ldr	w10, [x1]
	mul	w10, w10, w13
	add	x8, x8, w10, sxtw #2
	str	x8, [sp, #40]
	ldr	x8, [x9]
	ldr	x8, [x8, #8]
	ldr	w10, [x1, #4]
	ldr	w11, [x19, #24]
	asr	w11, w13, w11
	mul	w10, w11, w10
	add	x8, x8, w10, sxtw #2
	str	x8, [sp, #48]
	ldr	x8, [x9]
	ldr	x8, [x8, #16]
	ldr	w9, [x1, #8]
	mul	w9, w9, w11
	add	x8, x8, w9, sxtw #2
	str	x8, [sp, #56]
	ldr	w8, [x22]
	mul	w9, w8, w13
	sbfiz	x9, x9, #2, #32
	ldp	x11, x10, [x22, #112]
	ldp	x12, x13, [x10]
	add	x12, x12, x9
	add	x13, x13, x9
	stp	x12, x13, [sp, #16]
	ldr	x10, [x10, #16]
	add	x9, x10, x9
	str	x9, [sp, #32]
	cbz	x11, LBB0_2
; %bb.1:
	ldr	x8, [x22, #104]
	ldr	w6, [x22, #96]
	ldr	x7, [x22, #16]
	add	x0, sp, #40
	add	x2, sp, #64
	mov	x4, x20
	mov	x5, x21
	blr	x8
	b	LBB0_10
LBB0_2:
	ldr	x9, [x22, #88]
	ldr	w6, [x22, #84]
	ldr	x10, [x22, #16]
	ldr	w7, [x10]
	add	x0, sp, #16
	add	x2, sp, #64
	mov	x1, x8
	mov	x4, x20
	mov	x5, x21
	blr	x9
	ldr	w8, [x22, #80]
	cbnz	w8, LBB0_6
; %bb.3:
	ldr	w1, [x22]
	ldr	w4, [x22, #76]
	add	x0, sp, #16
	mov	x2, x20
	mov	x3, x21
	bl	_apply_lut
	ldr	w8, [x22, #72]
	cbnz	w8, LBB0_5
; %bb.4:
	ldr	x8, [x22, #64]
	ldr	w1, [x22]
	ldr	w4, [x22, #60]
	add	x0, sp, #16
	mov	x2, x20
	mov	x3, x21
	blr	x8
LBB0_5:
	ldr	w1, [x22]
	ldr	w4, [x22, #56]
	add	x0, sp, #16
	mov	x2, x20
	mov	x3, x21
	bl	_apply_lut
LBB0_6:
	ldr	x8, [x22, #8]
Lloh3:
	adrp	x9, _DITHER_FSB@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DITHER_FSB@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.7:
	ldr	x8, [x22, #48]
	ldr	x1, [x19, #16]
	ldr	w3, [x22]
	ldr	w6, [x22, #24]
	ldr	x9, [x22, #16]
	ldr	w7, [x9, #4]
	ldr	w9, [x22, #40]
	str	w9, [sp]
	b	LBB0_9
LBB0_8:
	ldr	x8, [x22, #32]
	ldr	x1, [x19, #16]
	ldr	w3, [x22]
	ldr	w6, [x22, #24]
	ldr	x9, [x22, #16]
	ldr	w7, [x9, #4]
LBB0_9:
	add	x0, sp, #40
	add	x2, sp, #16
	mov	x4, x20
	mov	x5, x21
	blr	x8
LBB0_10:
	ldur	x8, [x29, #-40]
Lloh6:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh7:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	mov	w0, #0
	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
	add	sp, sp, #144
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_DITHER_FSB,8,3                 ; @DITHER_FSB
	.no_dead_strip	_convert
.subsections_via_symbols
