	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function datalink_LoginDone
_datalink_LoginDone:                    ## @datalink_LoginDone
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	leaq	36(%rdi), %r14
	movq	%r14, %rdi
	callq	_chat_Finish
	cmpl	$0, 48(%rbx)
	je	LBB0_12
## %bb.1:
	movq	8(%rbx), %rdi
	callq	_physical_Raw
	testl	%eax, %eax
	je	LBB0_2
## %bb.8:
	movl	$-1, 16(%rbx)
	movq	$0, 24(%rbx)
	movq	8(%rbx), %rsi
	leaq	24(%rsi), %rdi
	addq	$8, %rsi
	callq	_hdlc_Init
	movq	8(%rbx), %rdi
	addq	$20, %rdi
	callq	_async_Setup
	movq	(%rbx), %rcx
	movq	8(%rbx), %rax
	leaq	8(%rax), %rdi
	movq	_DATALINK_READY@GOTPCREL(%rip), %rdx
	xorl	%esi, %esi
	cmpq	(%rdx), %rcx
	je	LBB0_10
## %bb.9:
	movl	12(%rax), %esi
LBB0_10:
	callq	_lcp_Setup
	movq	8(%rbx), %rdi
	addq	$16, %rdi
	callq	_ccp_Setup
	movq	_DATALINK_LCP@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	callq	_datalink_NewState
	movq	8(%rbx), %rdi
	addq	$8, %rdi
	callq	_fsm_Up
	movq	8(%rbx), %rdi
	addq	$8, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_fsm_Open                       ## TAILCALL
LBB0_12:
	movl	$-1, 16(%rbx)
	movq	$0, 24(%rbx)
	movq	_DATALINK_READY@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_datalink_NewState              ## TAILCALL
LBB0_2:
	movl	$0, 16(%rbx)
	movq	_LogWARN@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_log_Printf
	cmpq	$0, 40(%rbx)
	je	LBB0_5
## %bb.3:
	movq	_DATALINK_LOGOUT@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	callq	_datalink_NewState
	movl	32(%rbx), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_chat_Setup
	testl	%eax, %eax
	je	LBB0_4
## %bb.11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	8(%rbx), %rdi
	callq	_physical_StopDeviceTimer
	movq	8(%rbx), %rdi
	movq	(%rdi), %rax
	movq	_PHYS_DEDICATED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.6:
	callq	_physical_Close
LBB0_7:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_datalink_HangupDone            ## TAILCALL
LBB0_4:
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_log_Printf                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DATALINK_READY,8,3             ## @DATALINK_READY
	.comm	_LogWARN,4,2                    ## @LogWARN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"datalink_LoginDone: Not connected.\n"

	.comm	_DATALINK_LOGOUT,8,3            ## @DATALINK_LOGOUT
L_.str.1:                               ## @.str.1
	.asciz	"Invalid logout script\n"

	.comm	_PHYS_DEDICATED,8,3             ## @PHYS_DEDICATED
	.comm	_DATALINK_LCP,8,3               ## @DATALINK_LCP
	.no_dead_strip	_datalink_LoginDone
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function datalink_LoginDone
_datalink_LoginDone:                    ; @datalink_LoginDone
	.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	x19, x0
	add	x20, x0, #36
	mov	x0, x20
	bl	_chat_Finish
	ldr	w8, [x19, #48]
	cbz	w8, LBB0_4
; %bb.1:
	ldr	x0, [x19, #8]
	bl	_physical_Raw
	cbz	w0, LBB0_5
; %bb.2:
	mov	w8, #-1
	str	w8, [x19, #16]
	str	xzr, [x19, #24]
	ldr	x8, [x19, #8]
	add	x0, x8, #24
	add	x1, x8, #8
	bl	_hdlc_Init
	ldr	x8, [x19, #8]
	add	x0, x8, #20
	bl	_async_Setup
	ldp	x9, x8, [x19]
	add	x0, x8, #8
Lloh0:
	adrp	x10, _DATALINK_READY@GOTPAGE
Lloh1:
	ldr	x10, [x10, _DATALINK_READY@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_8
; %bb.3:
	mov	w1, #0
	b	LBB0_9
LBB0_4:
	mov	w8, #-1
	str	w8, [x19, #16]
	str	xzr, [x19, #24]
Lloh3:
	adrp	x8, _DATALINK_READY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DATALINK_READY@GOTPAGEOFF]
Lloh5:
	ldr	x1, [x8]
	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	_datalink_NewState
LBB0_5:
	str	wzr, [x19, #16]
Lloh6:
	adrp	x21, _LogWARN@GOTPAGE
Lloh7:
	ldr	x21, [x21, _LogWARN@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_log_Printf
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_10
; %bb.6:
Lloh10:
	adrp	x8, _DATALINK_LOGOUT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DATALINK_LOGOUT@GOTPAGEOFF]
Lloh12:
	ldr	x1, [x8]
	mov	x0, x19
	bl	_datalink_NewState
	ldr	w1, [x19, #32]
	mov	x0, x20
	mov	x2, #0
	bl	_chat_Setup
	cbz	w0, LBB0_13
; %bb.7:
	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_8:
	ldr	w1, [x8, #12]
LBB0_9:
	bl	_lcp_Setup
	ldr	x8, [x19, #8]
	add	x0, x8, #16
	bl	_ccp_Setup
Lloh13:
	adrp	x8, _DATALINK_LCP@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DATALINK_LCP@GOTPAGEOFF]
Lloh15:
	ldr	x1, [x8]
	mov	x0, x19
	bl	_datalink_NewState
	ldr	x8, [x19, #8]
	add	x0, x8, #8
	bl	_fsm_Up
	ldr	x8, [x19, #8]
	add	x0, x8, #8
	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	_fsm_Open
LBB0_10:
	ldr	x0, [x19, #8]
	bl	_physical_StopDeviceTimer
	ldr	x0, [x19, #8]
	ldr	x8, [x0]
Lloh16:
	adrp	x9, _PHYS_DEDICATED@GOTPAGE
Lloh17:
	ldr	x9, [x9, _PHYS_DEDICATED@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.11:
	bl	_physical_Close
LBB0_12:
	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	_datalink_HangupDone
LBB0_13:
	ldr	w0, [x21]
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	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	_log_Printf
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_DATALINK_READY,8,3             ; @DATALINK_READY
	.comm	_LogWARN,4,2                    ; @LogWARN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"datalink_LoginDone: Not connected.\n"

	.comm	_DATALINK_LOGOUT,8,3            ; @DATALINK_LOGOUT
l_.str.1:                               ; @.str.1
	.asciz	"Invalid logout script\n"

	.comm	_PHYS_DEDICATED,8,3             ; @PHYS_DEDICATED
	.comm	_DATALINK_LCP,8,3               ; @DATALINK_LCP
	.no_dead_strip	_datalink_LoginDone
.subsections_via_symbols
