	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function p2p_check_pref_chan_recv
_p2p_check_pref_chan_recv:              ## @p2p_check_pref_chan_recv
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -72(%rbp)                  ## 8-byte Spill
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	testl	%r9d, %r9d
	je	LBB0_8
## %bb.1:
	movq	%rcx, %rbx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	$8, %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	%r9d, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r13
	cmpq	-64(%rbp), %r13                 ## 8-byte Folded Reload
	jae	LBB0_8
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movl	(%rbx), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	cmpl	$3, %ecx
	jb	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$2, %r14d
	movl	$5, %r12d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=2
	incq	%r14
	movl	(%rbx), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	addl	$2, %r12d
	cmpq	%rcx, %r14
	jae	LBB0_7
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%rbx), %rax
	leal	-1(%r12), %ecx
	movl	(%rax,%rcx,4), %edi
	movl	%r12d, %ecx
	movl	(%rax,%rcx,4), %esi
	callq	_p2p_channel_to_freq
	movl	%eax, %r15d
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	cmpl	%r15d, (%rax,%r13,4)
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	%r15d, %edi
	leaq	-88(%rbp), %rsi
	leaq	-80(%rbp), %rdx
	callq	_p2p_freq_to_channel
	testq	%rax, %rax
	js	LBB0_6
## %bb.10:
	movq	-88(%rbp), %rax
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rax, 24(%rbx)
	movq	-80(%rbp), %rax
	movq	%rax, 16(%rbx)
	movq	(%rbx), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	$4, %edx
	callq	_os_memcpy
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_p2p_dbg
	jmp	LBB0_9
LBB0_8:
	leaq	L_.str.1(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_p2p_dbg
LBB0_9:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Freq %d MHz is a common preferred channel for both peer and local, use it as operating channel"

L_.str.1:                               ## @.str.1
	.asciz	"No common preferred channels found!"

	.no_dead_strip	_p2p_check_pref_chan_recv
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function p2p_check_pref_chan_recv
_p2p_check_pref_chan_recv:              ; @p2p_check_pref_chan_recv
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	cbz	w5, LBB0_9
; %bb.1:
	mov	x21, x4
	mov	x22, x3
	mov	x24, #0
	add	x20, x19, #8
	mov	w25, w5
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x24, x24, #1
	cmp	x24, x25
	b.hs	LBB0_9
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	ldr	w8, [x22]
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	cmp	w8, #3
	b.lo	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w26, #5
	mov	w27, #2
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=2
	add	x27, x27, #1
	ldr	w8, [x22]
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	add	w26, w26, #2
	cmp	x27, x8
	b.hs	LBB0_2
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x22, #8]
	sub	w9, w26, #1
	ldr	w0, [x8, w9, uxtw #2]
	ldr	w1, [x8, w26, uxtw #2]
	bl	_p2p_channel_to_freq
	ldr	w8, [x21, x24, lsl #2]
	cmp	w8, w0
	b.ne	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	mov	x23, x0
	add	x1, sp, #24
	add	x2, sp, #16
	bl	_p2p_freq_to_channel
	tbnz	x0, #63, LBB0_5
; %bb.8:
	ldp	x9, x8, [sp, #16]
	stp	x9, x8, [x19, #16]
	ldr	x1, [x19]
	mov	x0, x20
	mov	w2, #4
	bl	_os_memcpy
	str	x23, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_10
LBB0_9:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_10:
	mov	x0, x19
	bl	_p2p_dbg
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Freq %d MHz is a common preferred channel for both peer and local, use it as operating channel"

l_.str.1:                               ; @.str.1
	.asciz	"No common preferred channels found!"

	.no_dead_strip	_p2p_check_pref_chan_recv
.subsections_via_symbols
