	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_p2p_listen_end                 ## -- Begin function p2p_listen_end
	.p2align	4, 0x90
_p2p_listen_end:                        ## @p2p_listen_end
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %edx
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rsi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_p2p_dbg
	movq	$0, 48(%rbx)
	cmpq	$0, 40(%rbx)
	jne	LBB0_18
## %bb.1:
	movq	(%rbx), %rax
	movq	_P2P_WAIT_PEER_CONNECT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.2:
	cmpq	$0, 32(%rbx)
	je	LBB0_5
## %bb.3:
	cmpq	$0, 16(%rbx)
	je	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_15
LBB0_5:
	movq	_P2P_CONNECT_LISTEN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.6:
	movq	32(%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_9
## %bb.7:
	cmpl	$120, (%rcx)
	jl	LBB0_12
## %bb.8:
	leaq	L_.str.2(%rip), %rsi
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_p2p_dbg
	movq	%rbx, %rdi
	movl	$-1, %esi
	callq	_p2p_go_neg_failed
	jmp	LBB0_18
LBB0_9:
	movq	_P2P_SEARCH@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_18
## %bb.10:
	cmpq	$0, 24(%rbx)
	je	LBB0_13
## %bb.11:
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_p2p_dbg
	jmp	LBB0_17
LBB0_12:
	movq	_P2P_CONNECT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_p2p_set_state
	movq	32(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_p2p_connect_send
	jmp	LBB0_17
LBB0_13:
	cmpq	$0, 16(%rbx)
	je	LBB0_19
## %bb.14:
	leaq	L_.str.4(%rip), %rsi
LBB0_15:
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_p2p_dbg
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$100000, %edx                   ## imm = 0x186A0
LBB0_16:
	callq	_p2p_set_timeout
LBB0_17:
	movl	$1, %r14d
LBB0_18:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_19:
	movl	8(%rbx), %edx
	testl	%edx, %edx
	je	LBB0_21
## %bb.20:
	leaq	L_.str.5(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_p2p_dbg
	movslq	8(%rbx), %rax
	imulq	$274877907, %rax, %rsi          ## imm = 0x10624DD3
	movq	%rsi, %rcx
	shrq	$63, %rcx
	sarq	$38, %rsi
	addl	%ecx, %esi
	imull	$1000, %esi, %ecx               ## imm = 0x3E8
	subl	%ecx, %eax
	imull	$1000, %eax, %edx               ## imm = 0x3E8
	movq	%rbx, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	jmp	LBB0_16
LBB0_21:
	movq	%rbx, %rdi
	callq	_p2p_search
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Driver ended Listen state (freq=%u)"

	.comm	_P2P_WAIT_PEER_CONNECT,8,3      ## @P2P_WAIT_PEER_CONNECT
L_.str.1:                               ## @.str.1
	.asciz	"Listen operation did not seem to start - delay idle phase to avoid busy loop"

	.comm	_P2P_CONNECT_LISTEN,8,3         ## @P2P_CONNECT_LISTEN
L_.str.2:                               ## @.str.2
	.asciz	"Timeout on sending GO Negotiation Request without getting response"

	.comm	_P2P_CONNECT,4,2                ## @P2P_CONNECT
	.comm	_P2P_SEARCH,8,3                 ## @P2P_SEARCH
L_.str.3:                               ## @.str.3
	.asciz	"p2p_scan already in progress - do not try to start a new one"

L_.str.4:                               ## @.str.4
	.asciz	"Listen operation did not seem to start - delay search phase to avoid busy loop"

L_.str.5:                               ## @.str.5
	.asciz	"Delay search operation by %u ms"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_p2p_listen_end                 ; -- Begin function p2p_listen_end
	.p2align	2
_p2p_listen_end:                        ; @p2p_listen_end
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
                                        ; kill: def $w1 killed $w1 def $x1
	mov	x19, x0
	str	x1, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_p2p_dbg
	str	xzr, [x19, #48]
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_2
LBB0_1:
	mov	w0, #0
	b	LBB0_19
LBB0_2:
	ldr	x8, [x19]
Lloh2:
	adrp	x9, _P2P_WAIT_PEER_CONNECT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _P2P_WAIT_PEER_CONNECT@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.3:
	ldr	x9, [x19, #32]
	cbz	x9, LBB0_6
; %bb.4:
	ldr	x9, [x19, #16]
	cbz	x9, LBB0_6
; %bb.5:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_16
LBB0_6:
Lloh7:
	adrp	x9, _P2P_CONNECT_LISTEN@GOTPAGE
Lloh8:
	ldr	x9, [x9, _P2P_CONNECT_LISTEN@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.7:
	ldr	x9, [x19, #32]
	cbz	x9, LBB0_10
; %bb.8:
	ldr	w8, [x9]
	cmp	w8, #120
	b.lt	LBB0_13
; %bb.9:
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_p2p_dbg
	mov	x0, x19
	mov	w1, #-1
	bl	_p2p_go_neg_failed
	mov	w0, #0
	b	LBB0_19
LBB0_10:
Lloh12:
	adrp	x9, _P2P_SEARCH@GOTPAGE
Lloh13:
	ldr	x9, [x9, _P2P_SEARCH@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_1
; %bb.11:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_14
; %bb.12:
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_p2p_dbg
	b	LBB0_18
LBB0_13:
Lloh17:
	adrp	x8, _P2P_CONNECT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _P2P_CONNECT@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_p2p_set_state
	ldr	x1, [x19, #32]
	mov	x0, x19
	bl	_p2p_connect_send
	b	LBB0_18
LBB0_14:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_20
; %bb.15:
Lloh20:
	adrp	x1, l_.str.4@PAGE
Lloh21:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_16:
	mov	x0, x19
	bl	_p2p_dbg
	mov	x0, x19
	mov	w1, #0
	mov	w2, #34464
	movk	w2, #1, lsl #16
LBB0_17:
	bl	_p2p_set_timeout
LBB0_18:
	mov	w0, #1
LBB0_19:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_20:
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_22
; %bb.21:
	str	x8, [sp]
Lloh22:
	adrp	x1, l_.str.5@PAGE
Lloh23:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_p2p_dbg
	ldr	w8, [x19, #8]
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x9, w8, w9
	lsr	x10, x9, #63
	asr	x9, x9, #38
	add	w1, w9, w10
	mov	w9, #1000
	msub	w8, w1, w9, w8
	mul	w2, w8, w9
	mov	x0, x19
	b	LBB0_17
LBB0_22:
	mov	x0, x19
	bl	_p2p_search
	b	LBB0_18
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Driver ended Listen state (freq=%u)"

	.comm	_P2P_WAIT_PEER_CONNECT,8,3      ; @P2P_WAIT_PEER_CONNECT
l_.str.1:                               ; @.str.1
	.asciz	"Listen operation did not seem to start - delay idle phase to avoid busy loop"

	.comm	_P2P_CONNECT_LISTEN,8,3         ; @P2P_CONNECT_LISTEN
l_.str.2:                               ; @.str.2
	.asciz	"Timeout on sending GO Negotiation Request without getting response"

	.comm	_P2P_CONNECT,4,2                ; @P2P_CONNECT
	.comm	_P2P_SEARCH,8,3                 ; @P2P_SEARCH
l_.str.3:                               ; @.str.3
	.asciz	"p2p_scan already in progress - do not try to start a new one"

l_.str.4:                               ; @.str.4
	.asciz	"Listen operation did not seem to start - delay search phase to avoid busy loop"

l_.str.5:                               ; @.str.5
	.asciz	"Delay search operation by %u ms"

.subsections_via_symbols
