	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bezier_approximate
_bezier_approximate:                    ## @bezier_approximate
	.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	%r12
	pushq	%rbx
	subq	$64, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	callq	_bezier_deviation_squared
	movl	%r14d, %ecx
	imull	%r14d, %ecx
	cmpl	%ecx, %eax
	jle	LBB0_1
## %bb.3:
	movl	8(%r12), %r8d
	movl	(%r12), %eax
	movl	4(%r12), %r10d
	leal	(%rax,%r8,2), %edx
	movl	16(%r12), %ecx
	leal	(%rcx,%rdx), %ebx
	addl	$3, %ebx
                                        ## kill: def $edx killed $edx killed $rdx
	addl	%ecx, %edx
	cmovnsl	%edx, %ebx
	sarl	$2, %ebx
	movl	12(%r12), %r9d
	leal	(%r10,%r9,2), %edx
	movl	20(%r12), %esi
	leal	(%rsi,%rdx), %edi
	addl	$3, %edi
                                        ## kill: def $edx killed $edx killed $rdx
	addl	%esi, %edx
	cmovnsl	%edx, %edi
	sarl	$2, %edi
	movq	(%r12), %rdx
	movq	%rdx, -64(%rbp)
	addl	%r8d, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	sarl	%edx
	movl	%edx, -56(%rbp)
	addl	%r9d, %r10d
	movl	%r10d, %eax
	shrl	$31, %eax
	addl	%r10d, %eax
	sarl	%eax
	movl	%eax, -52(%rbp)
	movl	%ebx, -48(%rbp)
	movl	%edi, -44(%rbp)
	movl	%ebx, -96(%rbp)
	movl	%edi, -92(%rbp)
	addl	%r8d, %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	movl	%eax, -88(%rbp)
	addl	%r9d, %esi
	movl	%esi, %eax
	shrl	$31, %eax
	addl	%esi, %eax
	sarl	%eax
	movl	%eax, -84(%rbp)
	movq	16(%r12), %rax
	movq	%rax, -80(%rbp)
	leaq	-64(%rbp), %rdi
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	_bezier_approximate
	testq	%r15, %r15
	movslq	%eax, %rbx
	leaq	(%r15,%rbx,8), %rsi
	cmoveq	%r15, %rsi
	leaq	-96(%rbp), %rdi
	movl	%r14d, %edx
	callq	_bezier_approximate
	addl	%eax, %ebx
	jmp	LBB0_4
LBB0_1:
	movl	$1, %ebx
	testq	%r15, %r15
	je	LBB0_4
## %bb.2:
	movq	16(%r12), %rax
	movq	%rax, (%r15)
LBB0_4:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_6
## %bb.5:
	movl	%ebx, %eax
	addq	$64, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_bezier_approximate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bezier_approximate
_bezier_approximate:                    ; @bezier_approximate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	bl	_bezier_deviation_squared
	mul	w8, w19, w19
	cmp	w0, w8
	b.le	LBB0_2
; %bb.1:
	ldp	w8, w10, [x21]
	ldp	w9, w13, [x21, #8]
	add	w11, w8, w9, lsl #1
	ldp	w12, w15, [x21, #16]
	add	w11, w11, w12
	add	w14, w11, #3
	cmp	w11, #0
	csel	w11, w14, w11, lt
	asr	w11, w11, #2
	add	w14, w10, w13, lsl #1
	add	w14, w14, w15
	add	w16, w14, #3
	cmp	w14, #0
	csel	w14, w16, w14, lt
	asr	w14, w14, #2
	ldr	x16, [x21]
	str	x16, [sp, #32]
	add	w8, w9, w8
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	add	w10, w13, w10
	cmp	w10, #0
	cinc	w10, w10, lt
	asr	w10, w10, #1
	stp	w8, w10, [sp, #40]
	stp	w11, w14, [sp, #48]
	stp	w11, w14, [sp, #8]
	add	w8, w12, w9
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	add	w9, w15, w13
	cmp	w9, #0
	cinc	w9, w9, lt
	asr	w9, w9, #1
	stp	w8, w9, [sp, #16]
	ldr	x8, [x21, #16]
	str	x8, [sp, #24]
	add	x0, sp, #32
	mov	x1, x20
	mov	x2, x19
	bl	_bezier_approximate
	mov	x21, x0
	add	x8, x20, w0, sxtw #3
	cmp	x20, #0
	csel	x1, xzr, x8, eq
	add	x0, sp, #8
	mov	x2, x19
	bl	_bezier_approximate
	add	w0, w0, w21
	b	LBB0_5
LBB0_2:
	cbz	x20, LBB0_4
; %bb.3:
	ldr	x8, [x21, #16]
	str	x8, [x20]
LBB0_4:
	mov	w0, #1
LBB0_5:
	ldur	x8, [x29, #-40]
Lloh3:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh4:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_7
; %bb.6:
	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
	add	sp, sp, #112
	ret
LBB0_7:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_bezier_approximate
.subsections_via_symbols
