	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_discovery                      ## -- Begin function discovery
	.p2align	4, 0x90
_discovery:                             ## @discovery
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_log_debugx
	movq	%r15, %rdi
	callq	_text_new_request
	movq	%rax, %r14
	xorl	%eax, %eax
	callq	_keys_new
	movq	%rax, %rbx
	leaq	L_.str.1(%rip), %rsi
	leaq	L_.str.2(%rip), %rdx
	movq	%rax, %rdi
	callq	_keys_add
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_keys_save
	movq	%rbx, %rdi
	callq	_keys_delete
	movq	%r14, %rdi
	callq	_pdu_send
	movq	%r14, %rdi
	callq	_pdu_delete
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_log_debugx
	movq	%r15, %rdi
	callq	_text_receive
	movq	%rax, %r14
	xorl	%eax, %eax
	callq	_keys_new
	movq	%rax, %rbx
	movq	%rax, %rdi
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %rsi
	callq	_keys_load
	movq	_KEYS_MAX@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	jle	LBB0_6
## %bb.1:
	leaq	L_.str.4(%rip), %r12
	xorl	%r13d, %r13d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r13
	movslq	(%r14), %rax
	cmpq	%rax, %r13
	jge	LBB0_6
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rbx), %rax
	movq	(%rax,%r13,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %rsi
	callq	_strcmp
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rbx), %rax
	movl	(%rax,%r13,4), %esi
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_log_debugx
	movq	(%rbx), %rax
	movl	(%rax,%r13,4), %esi
	movq	%r15, %rdi
	callq	_kernel_add
	jmp	LBB0_5
LBB0_6:
	movq	%rbx, %rdi
	callq	_keys_delete
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_pdu_delete
	leaq	L_.str.6(%rip), %rdi
	xorl	%eax, %eax
	callq	_log_debugx
	movq	%r15, %rdi
	callq	_kernel_remove
	leaq	L_.str.7(%rip), %rdi
	xorl	%eax, %eax
	callq	_log_debugx
	movq	%r15, %rdi
	callq	_logout_new_request
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_pdu_send
	movq	%rbx, %rdi
	callq	_pdu_delete
	leaq	L_.str.8(%rip), %rdi
	xorl	%eax, %eax
	callq	_log_debugx
	movq	%r15, %rdi
	callq	_logout_receive
	movq	%rax, %rdi
	callq	_pdu_delete
	leaq	L_.str.9(%rip), %rdi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_log_debugx                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"beginning discovery session"

L_.str.1:                               ## @.str.1
	.asciz	"SendTargets"

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

L_.str.3:                               ## @.str.3
	.asciz	"waiting for Text Response"

	.comm	_KEYS_MAX,4,2                   ## @KEYS_MAX
L_.str.4:                               ## @.str.4
	.asciz	"TargetName"

L_.str.5:                               ## @.str.5
	.asciz	"adding target %s"

L_.str.6:                               ## @.str.6
	.asciz	"removing temporary discovery session"

L_.str.7:                               ## @.str.7
	.asciz	"discovery done; logging out"

L_.str.8:                               ## @.str.8
	.asciz	"waiting for Logout Response"

L_.str.9:                               ## @.str.9
	.asciz	"discovery session done"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_discovery                      ; -- Begin function discovery
	.p2align	2
_discovery:                             ; @discovery
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_log_debugx
	mov	x0, x19
	bl	_text_new_request
	mov	x20, x0
	bl	_keys_new
	mov	x21, x0
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
Lloh4:
	adrp	x2, l_.str.2@PAGE
Lloh5:
	add	x2, x2, l_.str.2@PAGEOFF
	bl	_keys_add
	mov	x0, x21
	mov	x1, x20
	bl	_keys_save
	mov	x0, x21
	bl	_keys_delete
	mov	x0, x20
	bl	_pdu_send
	mov	x0, x20
	bl	_pdu_delete
Lloh6:
	adrp	x0, l_.str.3@PAGE
Lloh7:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_log_debugx
	mov	x0, x19
	bl	_text_receive
	mov	x20, x0
	bl	_keys_new
	mov	x21, x0
	mov	x1, x20
	bl	_keys_load
Lloh8:
	adrp	x24, _KEYS_MAX@GOTPAGE
Lloh9:
	ldr	x24, [x24, _KEYS_MAX@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.1:
	mov	x25, #0
Lloh10:
	adrp	x22, l_.str.4@PAGE
Lloh11:
	add	x22, x22, l_.str.4@PAGEOFF
Lloh12:
	adrp	x23, l_.str.5@PAGE
Lloh13:
	add	x23, x23, l_.str.5@PAGEOFF
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x25, x25, #1
	ldrsw	x8, [x24]
	cmp	x25, x8
	b.ge	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #8]
	ldr	x0, [x8, x25, lsl #3]
	cbz	x0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x1, x22
	bl	_strcmp
	cbnz	x0, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x21]
	lsl	x26, x25, #2
	ldr	w8, [x8, x26]
	str	x8, [sp]
	mov	x0, x23
	bl	_log_debugx
	ldr	x8, [x21]
	ldr	w1, [x8, x26]
	mov	x0, x19
	bl	_kernel_add
	b	LBB0_2
LBB0_6:
	mov	x0, x21
	bl	_keys_delete
	mov	x0, x20
	bl	_pdu_delete
Lloh14:
	adrp	x0, l_.str.6@PAGE
Lloh15:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_log_debugx
	mov	x0, x19
	bl	_kernel_remove
Lloh16:
	adrp	x0, l_.str.7@PAGE
Lloh17:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_log_debugx
	mov	x0, x19
	bl	_logout_new_request
	mov	x20, x0
	bl	_pdu_send
	mov	x0, x20
	bl	_pdu_delete
Lloh18:
	adrp	x0, l_.str.8@PAGE
Lloh19:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_log_debugx
	mov	x0, x19
	bl	_logout_receive
	bl	_pdu_delete
Lloh20:
	adrp	x0, l_.str.9@PAGE
Lloh21:
	add	x0, x0, l_.str.9@PAGEOFF
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_log_debugx
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"beginning discovery session"

l_.str.1:                               ; @.str.1
	.asciz	"SendTargets"

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

l_.str.3:                               ; @.str.3
	.asciz	"waiting for Text Response"

	.comm	_KEYS_MAX,4,2                   ; @KEYS_MAX
l_.str.4:                               ; @.str.4
	.asciz	"TargetName"

l_.str.5:                               ; @.str.5
	.asciz	"adding target %s"

l_.str.6:                               ; @.str.6
	.asciz	"removing temporary discovery session"

l_.str.7:                               ; @.str.7
	.asciz	"discovery done; logging out"

l_.str.8:                               ; @.str.8
	.asciz	"waiting for Logout Response"

l_.str.9:                               ; @.str.9
	.asciz	"discovery session done"

.subsections_via_symbols
