	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wil_p2p_search                 ## -- Begin function wil_p2p_search
	.p2align	4, 0x90
_wil_p2p_search:                        ## @wil_p2p_search
	.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	%rsi, %r15
	movq	%rdi, %r14
	callq	_vif_to_wil
	movq	%rax, %r12
	movq	_P2P_DMG_SOCIAL_CHANNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	movq	%rax, %rdi
	callq	_wil_dbg_misc
	movq	%r12, %rdi
	callq	_lockdep_assert_held
	cmpl	$0, (%r14)
	je	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	callq	_wil_err
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_2:
	movl	(%rbx), %esi
	movq	_P2P_DEFAULT_BI@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_wmi_p2p_cfg
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	callq	_wil_err
	jmp	LBB0_13
LBB0_4:
	movq	_P2P_WILDCARD_SSID@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_strlen
	movl	(%rbx), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_wmi_set_ssid
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_12
LBB0_6:
	movq	_WMI_FRAME_PROBE_REQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %ecx
	movl	4(%r15), %edx
	movq	%r14, %rdi
	callq	_wmi_set_ie
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_12
LBB0_8:
	movq	_WMI_FRAME_PROBE_RESP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %ecx
	movl	4(%r15), %edx
	movq	%r14, %rdi
	callq	_wmi_set_ie
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %ebx
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_12
LBB0_10:
	movq	%r14, %rdi
	callq	_wmi_start_search
	testl	%eax, %eax
	je	LBB0_14
## %bb.11:
	movl	%eax, %ebx
	leaq	L_.str.6(%rip), %rsi
LBB0_12:
	movq	%r12, %rdi
	callq	_wil_err
	movq	%r14, %rdi
	callq	_wmi_stop_discovery
LBB0_13:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movl	$1, (%r14)
	leaq	8(%r14), %rdi
	movq	_wil_p2p_search_expired@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_INIT_WORK
	addq	$4, %r14
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	_P2P_SEARCH_DURATION_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	addq	%rax, %rbx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_mod_timer
	xorl	%ebx, %ebx
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"p2p_search: channel %d\n"

	.comm	_P2P_DMG_SOCIAL_CHANNEL,4,2     ## @P2P_DMG_SOCIAL_CHANNEL
L_.str.1:                               ## @.str.1
	.asciz	"search failed. discovery already ongoing\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_P2P_DEFAULT_BI,4,2             ## @P2P_DEFAULT_BI
L_.str.2:                               ## @.str.2
	.asciz	"wmi_p2p_cfg failed\n"

	.comm	_P2P_WILDCARD_SSID,4,2          ## @P2P_WILDCARD_SSID
L_.str.3:                               ## @.str.3
	.asciz	"wmi_set_ssid failed\n"

	.comm	_WMI_FRAME_PROBE_REQ,4,2        ## @WMI_FRAME_PROBE_REQ
L_.str.4:                               ## @.str.4
	.asciz	"wmi_set_ie(WMI_FRAME_PROBE_REQ) failed\n"

	.comm	_WMI_FRAME_PROBE_RESP,4,2       ## @WMI_FRAME_PROBE_RESP
L_.str.5:                               ## @.str.5
	.asciz	"wmi_set_ie(WMI_FRAME_PROBE_RESP) failed\n"

L_.str.6:                               ## @.str.6
	.asciz	"wmi_start_search failed\n"

	.comm	_wil_p2p_search_expired,4,2     ## @wil_p2p_search_expired
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_P2P_SEARCH_DURATION_MS,4,2     ## @P2P_SEARCH_DURATION_MS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wil_p2p_search                 ; -- Begin function wil_p2p_search
	.p2align	2
_wil_p2p_search:                        ; @wil_p2p_search
	.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, x1
	mov	x19, x0
	bl	_vif_to_wil
	mov	x20, x0
Lloh0:
	adrp	x22, _P2P_DMG_SOCIAL_CHANNEL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _P2P_DMG_SOCIAL_CHANNEL@GOTPAGEOFF]
	ldr	w2, [x22]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_wil_dbg_misc
	mov	x0, x20
	bl	_lockdep_assert_held
	ldr	w8, [x19]
	cbz	w8, LBB0_2
; %bb.1:
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_wil_err
Lloh6:
	adrp	x8, _EBUSY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_13
LBB0_2:
	ldr	w1, [x22]
Lloh9:
	adrp	x8, _P2P_DEFAULT_BI@GOTPAGE
Lloh10:
	ldr	x8, [x8, _P2P_DEFAULT_BI@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_wmi_p2p_cfg
	cbz	w0, LBB0_4
; %bb.3:
	mov	x22, x0
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_wil_err
	b	LBB0_13
LBB0_4:
Lloh14:
	adrp	x22, _P2P_WILDCARD_SSID@GOTPAGE
Lloh15:
	ldr	x22, [x22, _P2P_WILDCARD_SSID@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_strlen
	mov	x1, x0
	ldr	w2, [x22]
	mov	x0, x19
	bl	_wmi_set_ssid
	cbz	w0, LBB0_6
; %bb.5:
	mov	x22, x0
Lloh16:
	adrp	x1, l_.str.3@PAGE
Lloh17:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_12
LBB0_6:
Lloh18:
	adrp	x8, _WMI_FRAME_PROBE_REQ@GOTPAGE
Lloh19:
	ldr	x8, [x8, _WMI_FRAME_PROBE_REQ@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	ldp	w3, w2, [x21]
	mov	x0, x19
	bl	_wmi_set_ie
	cbz	w0, LBB0_8
; %bb.7:
	mov	x22, x0
Lloh21:
	adrp	x1, l_.str.4@PAGE
Lloh22:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_12
LBB0_8:
Lloh23:
	adrp	x8, _WMI_FRAME_PROBE_RESP@GOTPAGE
Lloh24:
	ldr	x8, [x8, _WMI_FRAME_PROBE_RESP@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	ldp	w3, w2, [x21]
	mov	x0, x19
	bl	_wmi_set_ie
	cbz	w0, LBB0_10
; %bb.9:
	mov	x22, x0
Lloh26:
	adrp	x1, l_.str.5@PAGE
Lloh27:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_12
LBB0_10:
	mov	x0, x19
	bl	_wmi_start_search
	mov	x22, x0
	cbz	w0, LBB0_14
; %bb.11:
Lloh28:
	adrp	x1, l_.str.6@PAGE
Lloh29:
	add	x1, x1, l_.str.6@PAGEOFF
LBB0_12:
	mov	x0, x20
	bl	_wil_err
	mov	x0, x19
	bl	_wmi_stop_discovery
LBB0_13:
	mov	x0, x22
	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_14:
	mov	w8, #1
	add	x0, x19, #8
	str	w8, [x19], #4
Lloh30:
	adrp	x8, _wil_p2p_search_expired@GOTPAGE
Lloh31:
	ldr	x8, [x8, _wil_p2p_search_expired@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	bl	_INIT_WORK
Lloh33:
	adrp	x8, _jiffies@GOTPAGE
Lloh34:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh35:
	ldr	x20, [x8]
Lloh36:
	adrp	x8, _P2P_SEARCH_DURATION_MS@GOTPAGE
Lloh37:
	ldr	x8, [x8, _P2P_SEARCH_DURATION_MS@GOTPAGEOFF]
Lloh38:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	add	x1, x0, x20
	mov	x0, x19
	bl	_mod_timer
	b	LBB0_13
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"p2p_search: channel %d\n"

	.comm	_P2P_DMG_SOCIAL_CHANNEL,4,2     ; @P2P_DMG_SOCIAL_CHANNEL
l_.str.1:                               ; @.str.1
	.asciz	"search failed. discovery already ongoing\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_P2P_DEFAULT_BI,4,2             ; @P2P_DEFAULT_BI
l_.str.2:                               ; @.str.2
	.asciz	"wmi_p2p_cfg failed\n"

	.comm	_P2P_WILDCARD_SSID,4,2          ; @P2P_WILDCARD_SSID
l_.str.3:                               ; @.str.3
	.asciz	"wmi_set_ssid failed\n"

	.comm	_WMI_FRAME_PROBE_REQ,4,2        ; @WMI_FRAME_PROBE_REQ
l_.str.4:                               ; @.str.4
	.asciz	"wmi_set_ie(WMI_FRAME_PROBE_REQ) failed\n"

	.comm	_WMI_FRAME_PROBE_RESP,4,2       ; @WMI_FRAME_PROBE_RESP
l_.str.5:                               ; @.str.5
	.asciz	"wmi_set_ie(WMI_FRAME_PROBE_RESP) failed\n"

l_.str.6:                               ; @.str.6
	.asciz	"wmi_start_search failed\n"

	.comm	_wil_p2p_search_expired,4,2     ; @wil_p2p_search_expired
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_P2P_SEARCH_DURATION_MS,4,2     ; @P2P_SEARCH_DURATION_MS
.subsections_via_symbols
