	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function minimize_crossings
_minimize_crossings:                    ## @minimize_crossings
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	(%rdi), %r15d
	movl	$4096, %r12d                    ## imm = 0x1000
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
	testl	%r15d, %r15d
	jle	LBB0_7
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	decl	%r12d
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_3:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	4(%r14), %esi
	movl	8(%r14), %edi
	movl	%r15d, %edx
	movl	%ebx, %ecx
	movl	$1, %r8d
	callq	_layer_sweep
	cmpl	$-1, %eax
	je	LBB0_11
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=2
	xorl	%ecx, %ecx
	testl	%eax, %eax
	setne	%cl
	orl	%ecx, %r13d
	incl	%ebx
	movl	(%r14), %r15d
	cmpl	%r15d, %ebx
	jl	LBB0_3
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	testl	%r13d, %r13d
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	testl	%r12d, %r12d
	jne	LBB0_1
LBB0_7:
	movl	$4096, %r12d                    ## imm = 0x1000
LBB0_8:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
	decl	%r12d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_8 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	testl	%r15d, %r15d
	jle	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=2
	decl	%r15d
	movl	8(%r14), %edi
	movl	(%r14), %edx
	movl	4(%r14), %esi
	movl	%r15d, %ecx
	xorl	%r8d, %r8d
	callq	_layer_sweep
	xorl	%ecx, %ecx
	testl	%eax, %eax
	setne	%cl
	orl	%ecx, %ebx
	cmpl	$-1, %eax
	jne	LBB0_9
	jmp	LBB0_11
LBB0_12:                                ##   in Loop: Header=BB0_8 Depth=1
	testl	%ebx, %ebx
	je	LBB0_11
## %bb.13:                              ##   in Loop: Header=BB0_8 Depth=1
	testl	%r12d, %r12d
	je	LBB0_11
## %bb.14:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	(%r14), %r15d
	jmp	LBB0_8
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_minimize_crossings
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function minimize_crossings
_minimize_crossings:                    ; @minimize_crossings
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	w20, [x0]
	mov	w22, #4096
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_3 Depth 2
	cmp	w20, #1
	b.lt	LBB0_6
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	w21, #0
	mov	w23, #0
	sub	w22, w22, #1
LBB0_3:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldp	w1, w0, [x19, #4]
	mov	x2, x20
	mov	x3, x21
	mov	w4, #1
	bl	_layer_sweep
	cmn	w0, #1
	b.eq	LBB0_13
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=2
	cmp	w0, #0
	cset	w8, ne
	orr	w23, w23, w8
	add	w21, w21, #1
	ldr	w20, [x19]
	cmp	w21, w20
	b.lt	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_1 Depth=1
	cmp	w23, #0
	ccmp	w22, #0, #4, ne
	b.ne	LBB0_1
LBB0_6:
	mov	w21, #4096
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	mov	w22, #0
	sub	w21, w21, #1
LBB0_8:                                 ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	subs	w20, w20, #1
	b.lt	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	ldp	w1, w0, [x19, #4]
	ldr	w2, [x19]
	mov	x3, x20
	mov	w4, #0
	bl	_layer_sweep
	cmp	w0, #0
	cset	w8, ne
	orr	w22, w22, w8
	cmn	w0, #1
	b.ne	LBB0_8
	b	LBB0_13
LBB0_10:                                ;   in Loop: Header=BB0_7 Depth=1
	cbz	w22, LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	cbz	w21, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w20, [x19]
	b	LBB0_7
LBB0_13:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_minimize_crossings
.subsections_via_symbols
