	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_chat_expect                    ## -- Begin function chat_expect
	.p2align	4, 0x90
_chat_expect:                           ## @chat_expect
	.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	%rdi, %rbx
	leaq	L_.str(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	leaq	L_.str.4(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	leaq	L_.str.5(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_11
## %bb.12:
	leaq	L_.str.6(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_13
## %bb.14:
	leaq	L_.str.7(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_25
## %bb.15:
	leaq	L_.str.8(%rip), %rsi
	movq	%rbx, %rdi
	callq	_expect_strtok
	testq	%rax, %rax
	je	LBB0_27
## %bb.16:
	movq	%rax, %r15
	leaq	L_.str.8(%rip), %r14
	movq	_exit_code@GOTPCREL(%rip), %r12
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	xorl	%edi, %edi
	movq	%r14, %rsi
	callq	_expect_strtok
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_get_string
	testq	%rax, %rax
	jne	LBB0_27
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	testq	%rbx, %rbx
	je	LBB0_21
## %bb.19:                              ##   in Loop: Header=BB0_17 Depth=1
	cmpl	$3, (%r12)
	jne	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	%rbx, %rdi
	callq	_chat_send
	xorl	%edi, %edi
	movq	%r14, %rsi
	callq	_expect_strtok
	movq	%rax, %r15
	testq	%rax, %rax
	jne	LBB0_17
	jmp	LBB0_27
LBB0_1:
	movq	_hup_next@GOTPCREL(%rip), %rax
	jmp	LBB0_26
LBB0_3:
	movq	_abort_next@GOTPCREL(%rip), %rax
	jmp	LBB0_26
LBB0_5:
	movq	_clear_abort_next@GOTPCREL(%rip), %rax
	jmp	LBB0_26
LBB0_7:
	movq	_report_next@GOTPCREL(%rip), %rax
	jmp	LBB0_26
LBB0_9:
	movq	_clear_report_next@GOTPCREL(%rip), %rax
	jmp	LBB0_26
LBB0_11:
	movq	_timeout_next@GOTPCREL(%rip), %rax
	jmp	LBB0_26
LBB0_13:
	movq	_echo_next@GOTPCREL(%rip), %rax
	jmp	LBB0_26
LBB0_25:
	movq	_say_next@GOTPCREL(%rip), %rax
LBB0_26:
	incl	(%rax)
LBB0_27:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	movq	_fail_reason@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_23
## %bb.22:
	leaq	L_.str.9(%rip), %rdi
	xorl	%eax, %eax
	callq	_chat_logf
	jmp	LBB0_24
LBB0_23:
	leaq	L_.str.10(%rip), %rdi
	xorl	%eax, %eax
	callq	_chat_logf
LBB0_24:
	movl	(%r12), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_terminate                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"HANGUP"

	.comm	_hup_next,4,2                   ## @hup_next
L_.str.1:                               ## @.str.1
	.asciz	"ABORT"

	.comm	_abort_next,4,2                 ## @abort_next
L_.str.2:                               ## @.str.2
	.asciz	"CLR_ABORT"

	.comm	_clear_abort_next,4,2           ## @clear_abort_next
L_.str.3:                               ## @.str.3
	.asciz	"REPORT"

	.comm	_report_next,4,2                ## @report_next
L_.str.4:                               ## @.str.4
	.asciz	"CLR_REPORT"

	.comm	_clear_report_next,4,2          ## @clear_report_next
L_.str.5:                               ## @.str.5
	.asciz	"TIMEOUT"

	.comm	_timeout_next,4,2               ## @timeout_next
L_.str.6:                               ## @.str.6
	.asciz	"ECHO"

	.comm	_echo_next,4,2                  ## @echo_next
L_.str.7:                               ## @.str.7
	.asciz	"SAY"

	.comm	_say_next,4,2                   ## @say_next
L_.str.8:                               ## @.str.8
	.asciz	"-"

	.comm	_exit_code,4,2                  ## @exit_code
	.comm	_fail_reason,8,3                ## @fail_reason
L_.str.9:                               ## @.str.9
	.asciz	"Failed (%s)"

L_.str.10:                              ## @.str.10
	.asciz	"Failed"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_chat_expect                    ; -- Begin function chat_expect
	.p2align	2
_chat_expect:                           ; @chat_expect
	.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
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_strcmp
	cbz	x0, LBB0_14
; %bb.1:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_strcmp
	cbz	x0, LBB0_15
; %bb.2:
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_strcmp
	cbz	x0, LBB0_16
; %bb.3:
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_strcmp
	cbz	x0, LBB0_17
; %bb.4:
Lloh8:
	adrp	x1, l_.str.4@PAGE
Lloh9:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_strcmp
	cbz	x0, LBB0_18
; %bb.5:
Lloh10:
	adrp	x1, l_.str.5@PAGE
Lloh11:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_strcmp
	cbz	x0, LBB0_19
; %bb.6:
Lloh12:
	adrp	x1, l_.str.6@PAGE
Lloh13:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_strcmp
	cbz	x0, LBB0_20
; %bb.7:
Lloh14:
	adrp	x1, l_.str.7@PAGE
Lloh15:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x19
	bl	_strcmp
	cbz	x0, LBB0_21
; %bb.8:
Lloh16:
	adrp	x1, l_.str.8@PAGE
Lloh17:
	add	x1, x1, l_.str.8@PAGEOFF
	mov	x0, x19
	bl	_expect_strtok
	cbz	x0, LBB0_23
; %bb.9:
	mov	x20, x0
Lloh18:
	adrp	x19, l_.str.8@PAGE
Lloh19:
	add	x19, x19, l_.str.8@PAGEOFF
Lloh20:
	adrp	x22, _exit_code@GOTPAGE
Lloh21:
	ldr	x22, [x22, _exit_code@GOTPAGEOFF]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, #0
	mov	x1, x19
	bl	_expect_strtok
	mov	x21, x0
	mov	x0, x20
	bl	_get_string
	cbnz	x0, LBB0_23
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	cbz	x21, LBB0_24
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w8, [x22]
	cmp	w8, #3
	b.ne	LBB0_24
; %bb.13:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x21
	bl	_chat_send
	mov	x0, #0
	mov	x1, x19
	bl	_expect_strtok
	mov	x20, x0
	cbnz	x0, LBB0_10
	b	LBB0_23
LBB0_14:
Lloh22:
	adrp	x8, _hup_next@GOTPAGE
Lloh23:
	ldr	x8, [x8, _hup_next@GOTPAGEOFF]
	b	LBB0_22
LBB0_15:
Lloh24:
	adrp	x8, _abort_next@GOTPAGE
Lloh25:
	ldr	x8, [x8, _abort_next@GOTPAGEOFF]
	b	LBB0_22
LBB0_16:
Lloh26:
	adrp	x8, _clear_abort_next@GOTPAGE
Lloh27:
	ldr	x8, [x8, _clear_abort_next@GOTPAGEOFF]
	b	LBB0_22
LBB0_17:
Lloh28:
	adrp	x8, _report_next@GOTPAGE
Lloh29:
	ldr	x8, [x8, _report_next@GOTPAGEOFF]
	b	LBB0_22
LBB0_18:
Lloh30:
	adrp	x8, _clear_report_next@GOTPAGE
Lloh31:
	ldr	x8, [x8, _clear_report_next@GOTPAGEOFF]
	b	LBB0_22
LBB0_19:
Lloh32:
	adrp	x8, _timeout_next@GOTPAGE
Lloh33:
	ldr	x8, [x8, _timeout_next@GOTPAGEOFF]
	b	LBB0_22
LBB0_20:
Lloh34:
	adrp	x8, _echo_next@GOTPAGE
Lloh35:
	ldr	x8, [x8, _echo_next@GOTPAGEOFF]
	b	LBB0_22
LBB0_21:
Lloh36:
	adrp	x8, _say_next@GOTPAGE
Lloh37:
	ldr	x8, [x8, _say_next@GOTPAGEOFF]
LBB0_22:
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
LBB0_23:
	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
LBB0_24:
Lloh38:
	adrp	x8, _fail_reason@GOTPAGE
Lloh39:
	ldr	x8, [x8, _fail_reason@GOTPAGEOFF]
Lloh40:
	ldr	x8, [x8]
	cbz	x8, LBB0_26
; %bb.25:
	str	x8, [sp]
Lloh41:
	adrp	x0, l_.str.9@PAGE
Lloh42:
	add	x0, x0, l_.str.9@PAGEOFF
	b	LBB0_27
LBB0_26:
Lloh43:
	adrp	x0, l_.str.10@PAGE
Lloh44:
	add	x0, x0, l_.str.10@PAGEOFF
LBB0_27:
	bl	_chat_logf
	ldr	w0, [x22]
	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
	b	_terminate
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpAdd	Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"HANGUP"

	.comm	_hup_next,4,2                   ; @hup_next
l_.str.1:                               ; @.str.1
	.asciz	"ABORT"

	.comm	_abort_next,4,2                 ; @abort_next
l_.str.2:                               ; @.str.2
	.asciz	"CLR_ABORT"

	.comm	_clear_abort_next,4,2           ; @clear_abort_next
l_.str.3:                               ; @.str.3
	.asciz	"REPORT"

	.comm	_report_next,4,2                ; @report_next
l_.str.4:                               ; @.str.4
	.asciz	"CLR_REPORT"

	.comm	_clear_report_next,4,2          ; @clear_report_next
l_.str.5:                               ; @.str.5
	.asciz	"TIMEOUT"

	.comm	_timeout_next,4,2               ; @timeout_next
l_.str.6:                               ; @.str.6
	.asciz	"ECHO"

	.comm	_echo_next,4,2                  ; @echo_next
l_.str.7:                               ; @.str.7
	.asciz	"SAY"

	.comm	_say_next,4,2                   ; @say_next
l_.str.8:                               ; @.str.8
	.asciz	"-"

	.comm	_exit_code,4,2                  ; @exit_code
	.comm	_fail_reason,8,3                ; @fail_reason
l_.str.9:                               ; @.str.9
	.asciz	"Failed (%s)"

l_.str.10:                              ; @.str.10
	.asciz	"Failed"

.subsections_via_symbols
