	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function safe_x_ring
_safe_x_ring:                           ## @safe_x_ring
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	$1, %r12d
	cmpl	$4, (%rdi)
	jne	LBB0_15
## %bb.1:
	movq	%rdi, %r14
	movq	_X_MESH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%rdi)
	jne	LBB0_15
## %bb.2:
	movl	%ecx, %r13d
	movl	%edx, %ebx
	movl	%esi, %r15d
	leal	-1(%r15), %edi
	movl	$4, %esi
	callq	_canonicalize
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	leal	1(%r15), %edi
	movl	(%r14), %esi
	callq	_canonicalize
	movl	%eax, %r12d
	leal	2(%r15), %edi
	movl	(%r14), %esi
	callq	_canonicalize
	movq	8(%r14), %rsi
	movslq	-48(%rbp), %r10                 ## 4-byte Folded Reload
	movq	(%rsi,%r10,8), %rcx
	movslq	%ebx, %rbx
	movq	(%rcx,%rbx,8), %rcx
	movslq	%r13d, %r13
	movq	(%rcx,%r13,8), %rcx
	movslq	%r12d, %r8
	movq	(%rsi,%r8,8), %rdx
	movq	(%rdx,%rbx,8), %rdx
	xorl	%edi, %edi
	cmpq	$0, (%rdx,%r13,8)
	setne	%dil
	cmpq	$1, %rcx
	sbbl	$-1, %edi
	movslq	%eax, %r9
	movq	(%rsi,%r9,8), %rax
	movq	(%rax,%rbx,8), %rax
	movq	(%rax,%r13,8), %rdx
	cmpq	$1, %rdx
	sbbl	$-1, %edi
	xorl	%r12d, %r12d
	cmpl	$2, %edi
	jb	LBB0_15
## %bb.3:
	movl	$1, %r12d
	testq	%rdx, %rdx
	movq	%r9, -48(%rbp)                  ## 8-byte Spill
	je	LBB0_6
## %bb.4:
	testq	%rcx, %rcx
	je	LBB0_6
## %bb.5:
	movq	%r14, %rdi
	xorl	%esi, %esi
	movq	%r8, %r12
	movq	%r10, -56(%rbp)                 ## 8-byte Spill
	callq	_link_tswitches
	movq	-48(%rbp), %r9                  ## 8-byte Reload
	movq	%r12, %r8
	xorl	%r12d, %r12d
	testq	%rax, %rax
	setne	%r12b
	movq	8(%r14), %rsi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rsi,%rax,8), %rax
	movq	(%rax,%rbx,8), %rax
	movq	(%rax,%r13,8), %rcx
LBB0_6:
	movslq	%r15d, %r15
	testq	%rcx, %rcx
	je	LBB0_9
## %bb.7:
	movq	(%rsi,%r15,8), %rax
	movq	(%rax,%rbx,8), %rax
	movq	(%rax,%r13,8), %rax
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	%r14, %rdi
	xorl	%esi, %esi
	movq	%rcx, %rdx
	movq	%rax, %rcx
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r8, %rbx
	callq	_link_tswitches
	movq	-48(%rbp), %r9                  ## 8-byte Reload
	movq	%rbx, %r8
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	testq	%rax, %rax
	setne	%al
	testl	%r12d, %r12d
	setne	%cl
	andb	%al, %cl
	movzbl	%cl, %r12d
	movq	8(%r14), %rsi
LBB0_9:
	movq	(%rsi,%r15,8), %rax
	movq	(%rax,%rbx,8), %rax
	movq	(%rax,%r13,8), %rdx
	testq	%rdx, %rdx
	je	LBB0_12
## %bb.10:
	movq	(%rsi,%r8,8), %rax
	movq	(%rax,%rbx,8), %rax
	movq	(%rax,%r13,8), %rcx
	testq	%rcx, %rcx
	je	LBB0_12
## %bb.11:
	movq	%r14, %rdi
	xorl	%esi, %esi
	movq	%r8, %r15
	callq	_link_tswitches
	movq	-48(%rbp), %r9                  ## 8-byte Reload
	movq	%r15, %r8
	testq	%rax, %rax
	setne	%al
	testl	%r12d, %r12d
	setne	%cl
	andb	%al, %cl
	movzbl	%cl, %r12d
	movq	8(%r14), %rsi
LBB0_12:
	movq	(%rsi,%r8,8), %rax
	movq	(%rax,%rbx,8), %rax
	movq	(%rax,%r13,8), %rdx
	testq	%rdx, %rdx
	je	LBB0_15
## %bb.13:
	movq	(%rsi,%r9,8), %rax
	movq	(%rax,%rbx,8), %rax
	movq	(%rax,%r13,8), %rcx
	testq	%rcx, %rcx
	je	LBB0_15
## %bb.14:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_link_tswitches
	testq	%rax, %rax
	setne	%al
	testl	%r12d, %r12d
	setne	%cl
	andb	%al, %cl
	movzbl	%cl, %r12d
LBB0_15:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_X_MESH,4,2                     ## @X_MESH
	.no_dead_strip	_safe_x_ring
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function safe_x_ring
_safe_x_ring:                           ; @safe_x_ring
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	ldr	w8, [x0]
	cmp	w8, #4
	b.ne	LBB0_2
; %bb.1:
	mov	x19, x0
	ldr	w8, [x0, #4]
Lloh0:
	adrp	x9, _X_MESH@GOTPAGE
Lloh1:
	ldr	x9, [x9, _X_MESH@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
LBB0_2:
	mov	w21, #1
LBB0_3:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_4:
	mov	x21, x3
	mov	x24, x2
	mov	x23, x1
	sub	w0, w1, #1
	mov	w1, #4
	bl	_canonicalize
	mov	x25, x0
	add	w0, w23, #1
	ldr	w1, [x19]
	bl	_canonicalize
	mov	x22, x0
	add	w0, w23, #2
	ldr	w1, [x19]
	bl	_canonicalize
	ldr	x9, [x19, #8]
	ldr	x8, [x9, w25, sxtw #3]
	sbfiz	x10, x24, #3, #32
	ldr	x8, [x8, x10]
	sbfiz	x11, x21, #3, #32
	ldr	x3, [x8, x11]
	cmp	x3, #0
	ldr	x8, [x9, w22, sxtw #3]
	ldr	x8, [x8, x10]
	ldr	x8, [x8, x11]
	cset	w12, ne
	cmp	x8, #0
	ldr	x8, [x9, w0, sxtw #3]
	ldr	x8, [x8, x10]
	cinc	w10, w12, ne
	ldr	x2, [x8, x11]
	cmp	x2, #0
	cinc	w8, w10, ne
	cmp	w8, #2
	b.hs	LBB0_6
; %bb.5:
	mov	w21, #0
	b	LBB0_3
LBB0_6:
	mov	x20, x0
	sxtw	x24, w24
	sxtw	x26, w21
	cmp	x2, #0
	ccmp	x3, #0, #4, ne
	b.ne	LBB0_8
; %bb.7:
	mov	w21, #1
	b	LBB0_9
LBB0_8:
	sxtw	x25, w25
	mov	x0, x19
	mov	w1, #0
	bl	_link_tswitches
	cmp	x0, #0
	cset	w21, ne
	ldr	x9, [x19, #8]
	ldr	x8, [x9, x25, lsl #3]
	ldr	x8, [x8, x24, lsl #3]
	ldr	x3, [x8, x26, lsl #3]
LBB0_9:
	sxtw	x23, w23
	cbz	x3, LBB0_12
; %bb.10:
	ldr	x8, [x9, x23, lsl #3]
	ldr	x8, [x8, x24, lsl #3]
	ldr	x8, [x8, x26, lsl #3]
	cbz	x8, LBB0_12
; %bb.11:
	mov	x0, x19
	mov	w1, #0
	mov	x2, x3
	mov	x3, x8
	bl	_link_tswitches
	cmp	x0, #0
	ccmp	w21, #0, #4, ne
	cset	w21, ne
	ldr	x9, [x19, #8]
LBB0_12:
	sxtw	x22, w22
	ldr	x8, [x9, x23, lsl #3]
	ldr	x8, [x8, x24, lsl #3]
	ldr	x2, [x8, x26, lsl #3]
	cbz	x2, LBB0_15
; %bb.13:
	ldr	x8, [x9, x22, lsl #3]
	ldr	x8, [x8, x24, lsl #3]
	ldr	x3, [x8, x26, lsl #3]
	cbz	x3, LBB0_15
; %bb.14:
	mov	x0, x19
	mov	w1, #0
	bl	_link_tswitches
	cmp	x0, #0
	ccmp	w21, #0, #4, ne
	cset	w21, ne
	ldr	x9, [x19, #8]
LBB0_15:
	ldr	x8, [x9, x22, lsl #3]
	ldr	x8, [x8, x24, lsl #3]
	ldr	x2, [x8, x26, lsl #3]
	cbz	x2, LBB0_3
; %bb.16:
	sxtw	x8, w20
	ldr	x8, [x9, x8, lsl #3]
	ldr	x8, [x8, x24, lsl #3]
	ldr	x3, [x8, x26, lsl #3]
	cbz	x3, LBB0_3
; %bb.17:
	mov	x0, x19
	mov	w1, #0
	bl	_link_tswitches
	cmp	x0, #0
	ccmp	w21, #0, #4, ne
	cset	w21, ne
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_X_MESH,4,2                     ; @X_MESH
	.no_dead_strip	_safe_x_ring
.subsections_via_symbols
