	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wpas_p2p_optimize_listen_channel
_wpas_p2p_optimize_listen_channel:      ## @wpas_p2p_optimize_listen_channel
	.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	24(%rdi), %rax
	cmpl	$0, (%rax)
	je	LBB0_12
## %bb.1:
	movq	%rdi, %r14
	cmpl	$0, 16(%rdi)
	je	LBB0_12
## %bb.2:
	movq	(%r14), %rax
	movq	_WPA_COMPLETED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.3:
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	8(%r14), %rax
	movl	(%rax), %edi
	callq	_p2p_get_listen_channel
	testl	%r15d, %r15d
	je	LBB0_12
## %bb.4:
	movl	%eax, %r12d
	movl	%r15d, %r13d
	xorl	%r15d, %r15d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	incq	%r15
	cmpq	%r15, %r13
	je	LBB0_10
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx,%r15,4), %edi
	leaq	-48(%rbp), %rsi
	callq	_ieee80211_freq_to_chan
	movl	-48(%rbp), %eax
	cmpl	%eax, %r12d
	je	LBB0_12
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$11, %eax
	ja	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	$2114, %ecx                     ## imm = 0x842
	btl	%eax, %ecx
	jae	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_9
LBB0_10:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_12
## %bb.11:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %ecx
	callq	_wpa_dbg
	movq	8(%r14), %rax
	movl	(%rax), %edi
	movl	$81, %esi
	movl	%ebx, %edx
	xorl	%ecx, %ecx
	callq	_p2p_set_listen_channel
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WPA_COMPLETED,8,3              ## @WPA_COMPLETED
	.comm	_MSG_DEBUG,4,2                  ## @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"P2P: Update Listen channel to %u based on operating channel"

	.no_dead_strip	_wpas_p2p_optimize_listen_channel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wpas_p2p_optimize_listen_channel
_wpas_p2p_optimize_listen_channel:      ; @wpas_p2p_optimize_listen_channel
	.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
	ldr	x8, [x0, #24]
	ldr	w8, [x8]
	cbz	w8, LBB0_9
; %bb.1:
	mov	x19, x0
	ldr	w8, [x0, #16]
	cbz	w8, LBB0_9
; %bb.2:
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _WPA_COMPLETED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _WPA_COMPLETED@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.3:
	mov	x23, x2
	mov	x20, x1
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	bl	_p2p_get_listen_channel
	cbz	w23, LBB0_9
; %bb.4:
	mov	x22, x0
	mov	w21, #0
	mov	w24, #1
	mov	w25, #2114
	mov	w23, w23
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20]
	add	x1, sp, #12
	bl	_ieee80211_freq_to_chan
	ldr	w8, [sp, #12]
	cmp	w22, w8
	b.eq	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w8, #11
	lsl	w9, w24, w8
	and	w9, w9, w25
	ccmp	w9, #0, #4, ls
	csel	w21, w8, w21, ne
	add	x20, x20, #4
	subs	x23, x23, #1
	b.ne	LBB0_5
; %bb.7:
	cbz	w21, LBB0_9
; %bb.8:
Lloh3:
	adrp	x8, _MSG_DEBUG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MSG_DEBUG@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	x3, x21
	bl	_wpa_dbg
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	mov	w1, #81
	mov	x2, x21
	mov	w3, #0
	bl	_p2p_set_listen_channel
LBB0_9:
	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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_WPA_COMPLETED,8,3              ; @WPA_COMPLETED
	.comm	_MSG_DEBUG,4,2                  ; @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"P2P: Update Listen channel to %u based on operating channel"

	.no_dead_strip	_wpas_p2p_optimize_listen_channel
.subsections_via_symbols
