	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mesh_attach_sub                ## -- Begin function mesh_attach_sub
	.p2align	4, 0x90
_mesh_attach_sub:                       ## @mesh_attach_sub
	.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	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movq	(%rax), %r15
	movq	$0, -40(%rbp)
	leaq	-40(%rbp), %rax
	movq	%rax, (%rsp)
	callq	_mesh_add_sub
	xorl	%r14d, %r14d
	testl	%eax, %eax
	je	LBB0_6
## %bb.1:
	movq	-40(%rbp), %rsi
	movl	(%rsi), %r12d
	movl	(%rbx), %edi
	callq	_mesh_state_attachment
	testl	%eax, %eax
	je	LBB0_6
## %bb.2:
	movq	-40(%rbp), %rax
	movl	$1, %r14d
	cmpl	$0, 8(%rax)
	jne	LBB0_6
## %bb.3:
	orl	4(%rax), %r12d
	jne	LBB0_6
## %bb.4:
	cmpl	$1, (%rax)
	jne	LBB0_6
## %bb.5:
	xorl	%edi, %edi
	cmpq	$0, (%r15)
	setg	%dil
	callq	_log_assert
	decq	(%r15)
LBB0_6:
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mesh_attach_sub                ; -- Begin function mesh_attach_sub
	.p2align	2
_mesh_attach_sub:                       ; @mesh_attach_sub
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	x20, [x8]
	str	xzr, [sp, #8]
	add	x6, sp, #8
	bl	_mesh_add_sub
	cbz	w0, LBB0_7
; %bb.1:
	ldr	x1, [sp, #8]
	ldr	w21, [x1]
	ldr	w0, [x19]
	bl	_mesh_state_attachment
	cbz	w0, LBB0_7
; %bb.2:
	ldr	x8, [sp, #8]
	ldr	w9, [x8, #8]
	cbnz	w9, LBB0_6
; %bb.3:
	ldr	w9, [x8, #4]
	orr	w9, w9, w21
	cbnz	w9, LBB0_6
; %bb.4:
	ldr	w8, [x8]
	cmp	w8, #1
	b.ne	LBB0_6
; %bb.5:
	ldr	x8, [x20]
	cmp	x8, #0
	cset	w0, gt
	bl	_log_assert
	ldr	x8, [x20]
	sub	x8, x8, #1
	str	x8, [x20]
LBB0_6:
	mov	w0, #1
LBB0_7:
	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
	add	sp, sp, #64
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
