	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function login_verify_mutual
_login_verify_mutual:                   ## @login_verify_mutual
	.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
	movq	(%rdi), %r12
	xorl	%eax, %eax
	callq	_keys_new
	movq	%rax, %r14
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_keys_load
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_keys_find
	movq	%rax, %r15
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	callq	_log_errx
LBB0_2:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_keys_find
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.3(%rip), %rsi
	movl	$1, %edi
	callq	_log_errx
LBB0_4:
	movq	(%r12), %rdi
	movq	%rbx, %rsi
	callq	_chap_receive
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.4(%rip), %rsi
	movl	$1, %edi
	callq	_log_errx
LBB0_6:
	movl	12(%r12), %esi
	movq	%r15, %rdi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	leaq	L_.str.5(%rip), %rsi
	movq	%r12, %rdi
	callq	_fail
	leaq	L_.str.6(%rip), %rsi
	movl	$1, %edi
	callq	_log_errx
LBB0_8:
	movq	(%r12), %rdi
	movl	8(%r12), %esi
	callq	_chap_authenticate
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	leaq	L_.str.5(%rip), %rsi
	movq	%r12, %rdi
	callq	_fail
	leaq	L_.str.7(%rip), %rsi
	movl	$1, %edi
	callq	_log_errx
LBB0_10:
	movq	%r14, %rdi
	callq	_keys_delete
	movq	(%r12), %rdi
	callq	_chap_delete
	movq	$0, (%r12)
	leaq	L_.str.8(%rip), %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_log_debugx                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CHAP_N"

L_.str.1:                               ## @.str.1
	.asciz	"received CHAP Response PDU without CHAP_N"

L_.str.2:                               ## @.str.2
	.asciz	"CHAP_R"

L_.str.3:                               ## @.str.3
	.asciz	"received CHAP Response PDU without CHAP_R"

L_.str.4:                               ## @.str.4
	.asciz	"received CHAP Response PDU with invalid CHAP_R"

L_.str.5:                               ## @.str.5
	.asciz	"Mutual CHAP failed"

L_.str.6:                               ## @.str.6
	.asciz	"mutual CHAP authentication failed: wrong user"

L_.str.7:                               ## @.str.7
	.asciz	"mutual CHAP authentication failed: wrong secret"

L_.str.8:                               ## @.str.8
	.asciz	"mutual CHAP authentication succeeded"

	.no_dead_strip	_login_verify_mutual
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function login_verify_mutual
_login_verify_mutual:                   ; @login_verify_mutual
	.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	x21, x0
	ldr	x19, [x0]
	bl	_keys_new
	mov	x20, x0
	mov	x1, x21
	bl	_keys_load
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_keys_find
	mov	x21, x0
	cbnz	x0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_log_errx
LBB0_2:
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_keys_find
	mov	x22, x0
	cbnz	x0, LBB0_4
; %bb.3:
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #1
	bl	_log_errx
LBB0_4:
	ldr	x0, [x19]
	mov	x1, x22
	bl	_chap_receive
	cbz	w0, LBB0_6
; %bb.5:
Lloh8:
	adrp	x1, l_.str.4@PAGE
Lloh9:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #1
	bl	_log_errx
LBB0_6:
	ldr	w1, [x19, #12]
	mov	x0, x21
	bl	_strcmp
	cbz	x0, LBB0_8
; %bb.7:
Lloh10:
	adrp	x1, l_.str.5@PAGE
Lloh11:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_fail
Lloh12:
	adrp	x1, l_.str.6@PAGE
Lloh13:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w0, #1
	bl	_log_errx
LBB0_8:
	ldr	x0, [x19]
	ldr	w1, [x19, #8]
	bl	_chap_authenticate
	cbz	w0, LBB0_10
; %bb.9:
Lloh14:
	adrp	x1, l_.str.5@PAGE
Lloh15:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_fail
Lloh16:
	adrp	x1, l_.str.7@PAGE
Lloh17:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	w0, #1
	bl	_log_errx
LBB0_10:
	mov	x0, x20
	bl	_keys_delete
	ldr	x0, [x19]
	bl	_chap_delete
	str	xzr, [x19]
Lloh18:
	adrp	x0, l_.str.8@PAGE
Lloh19:
	add	x0, x0, l_.str.8@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_debugx
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CHAP_N"

l_.str.1:                               ; @.str.1
	.asciz	"received CHAP Response PDU without CHAP_N"

l_.str.2:                               ; @.str.2
	.asciz	"CHAP_R"

l_.str.3:                               ; @.str.3
	.asciz	"received CHAP Response PDU without CHAP_R"

l_.str.4:                               ; @.str.4
	.asciz	"received CHAP Response PDU with invalid CHAP_R"

l_.str.5:                               ; @.str.5
	.asciz	"Mutual CHAP failed"

l_.str.6:                               ; @.str.6
	.asciz	"mutual CHAP authentication failed: wrong user"

l_.str.7:                               ; @.str.7
	.asciz	"mutual CHAP authentication failed: wrong secret"

l_.str.8:                               ; @.str.8
	.asciz	"mutual CHAP authentication succeeded"

	.no_dead_strip	_login_verify_mutual
.subsections_via_symbols
