	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bundle_LayerDown
_bundle_LayerDown:                      ## @bundle_LayerDown
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	(%rsi), %rdi
	callq	_isncp
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	16(%rbx), %rdi
	callq	_ncp_LayersOpen
	testq	%rax, %rax
	jne	LBB0_18
## %bb.2:
	cmpq	$0, 24(%r14)
	je	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_bundle_StopSessionTimer
LBB0_4:
	movq	%r14, %rdi
	callq	_bundle_StopIdleTimer
	movq	$0, 16(%r14)
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mp_StopAutoloadTimer           ## TAILCALL
LBB0_5:
	movq	(%rbx), %rax
	movq	_PROTO_LCP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_18
## %bb.6:
	movq	%r14, %rdi
	callq	_bundle_LinksRemoved
	movq	8(%r14), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	_DATALINK_CLOSED@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r8
	movq	_DATALINK_HANGUP@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdi
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	(%rax), %rsi
	cmpq	%r8, %rsi
	setne	%cl
	cmpq	%rdi, %rsi
	setne	%dl
	andb	%cl, %dl
	movzbl	%dl, %ecx
	addl	%ecx, %r12d
LBB0_12:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	16(%rax), %rax
	testq	%rax, %rax
	je	LBB0_13
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rbx, 8(%rax)
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%rax, %r15
	jmp	LBB0_12
LBB0_7:
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
LBB0_13:
	cmpq	$0, (%r14)
	je	LBB0_17
## %bb.14:
	movq	%r14, %rdi
	callq	_bundle_CalculateBandwidth
	testq	%r15, %r15
	je	LBB0_16
## %bb.15:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_mp_LinkLost
LBB0_17:
	testl	%r12d, %r12d
	je	LBB0_19
LBB0_18:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	_LogALERT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	8(%rbx), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rsi
	callq	_log_Printf
	testl	%r12d, %r12d
	jne	LBB0_18
LBB0_19:
	movq	%r14, %rdi
	callq	_ncp2initial
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mp_Down                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PROTO_LCP,8,3                  ## @PROTO_LCP
	.comm	_DATALINK_CLOSED,8,3            ## @DATALINK_CLOSED
	.comm	_DATALINK_HANGUP,8,3            ## @DATALINK_HANGUP
	.comm	_LogALERT,4,2                   ## @LogALERT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Oops, lost an unrecognised datalink (%s) !\n"

	.no_dead_strip	_bundle_LayerDown
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bundle_LayerDown
_bundle_LayerDown:                      ; @bundle_LayerDown
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x20, x1
	mov	x19, x0
	ldr	x0, [x1]
	bl	_isncp
	cbz	x0, LBB0_5
; %bb.1:
	ldr	x0, [x20, #16]
	bl	_ncp_LayersOpen
	cbnz	x0, LBB0_16
; %bb.2:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_bundle_StopSessionTimer
LBB0_4:
	mov	x0, x19
	bl	_bundle_StopIdleTimer
	str	xzr, [x19, #16]
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_mp_StopAutoloadTimer
LBB0_5:
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _PROTO_LCP@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PROTO_LCP@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_16
; %bb.6:
	mov	x0, x19
	bl	_bundle_LinksRemoved
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_11
; %bb.7:
	mov	w22, #0
	mov	x21, #0
Lloh3:
	adrp	x9, _DATALINK_CLOSED@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DATALINK_CLOSED@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
Lloh6:
	adrp	x10, _DATALINK_HANGUP@GOTPAGE
Lloh7:
	ldr	x10, [x10, _DATALINK_HANGUP@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	x11, [x8]
	cmp	x11, x9
	ccmp	x11, x10, #4, ne
	cinc	w22, w22, ne
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_12
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x8, #8]
	cmp	x11, x20
	b.ne	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x21, x8
	ldr	x8, [x8, #16]
	cbnz	x8, LBB0_9
	b	LBB0_12
LBB0_11:
	mov	x21, #0
	mov	w22, #0
LBB0_12:
	ldr	x8, [x19]
	cbz	x8, LBB0_15
; %bb.13:
	mov	x0, x19
	bl	_bundle_CalculateBandwidth
	cbz	x21, LBB0_17
; %bb.14:
	mov	x0, x19
	mov	x1, x21
	bl	_mp_LinkLost
LBB0_15:
	cbz	w22, LBB0_18
LBB0_16:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_17:
Lloh9:
	adrp	x8, _LogALERT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _LogALERT@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	ldr	x8, [x20, #8]
	ldr	w2, [x8]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_log_Printf
	cbnz	w22, LBB0_16
LBB0_18:
	mov	x0, x19
	bl	_ncp2initial
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_mp_Down
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_PROTO_LCP,8,3                  ; @PROTO_LCP
	.comm	_DATALINK_CLOSED,8,3            ; @DATALINK_CLOSED
	.comm	_DATALINK_HANGUP,8,3            ; @DATALINK_HANGUP
	.comm	_LogALERT,4,2                   ; @LogALERT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Oops, lost an unrecognised datalink (%s) !\n"

	.no_dead_strip	_bundle_LayerDown
.subsections_via_symbols
