	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_p2p_buf_add_service_instance   ## -- Begin function p2p_buf_add_service_instance
	.p2align	4, 0x90
_p2p_buf_add_service_instance:          ## @p2p_buf_add_service_instance
	.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	%rcx, -56(%rbp)                 ## 8-byte Spill
	testq	%rdx, %rdx
	je	LBB0_22
## %bb.1:
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_22
## %bb.2:
	movq	%r8, %rbx
	testq	%r8, %r8
	je	LBB0_22
## %bb.3:
	movq	%rdx, %r13
	movq	%rsi, %r14
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_P2PS_HASH_LEN@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	imulq	%rdx, %rcx
	leaq	L_.str(%rip), %rsi
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdx
	callq	_wpa_hexdump
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r13, %rdx
	callq	_p2ps_wildcard_hash
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%r14, %rdi
	callq	_p2p_wfa_service_adv
	testq	%rax, %rax
	setne	%r15b
	jmp	LBB0_6
LBB0_4:
	xorl	%r15d, %r15d
LBB0_6:
	movq	_MAX_SVC_ADV_IE_LEN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_P2PS_HASH_LEN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	leaq	(%rax,%rcx), %rdi
	addq	$256, %rdi                      ## imm = 0x100
	callq	_wpabuf_alloc
	testq	%rax, %rax
	je	LBB0_22
## %bb.7:
	movq	%rax, %r12
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	callq	_p2p_buf_add_ie_hdr
	movq	%rax, %r13
	movq	%rax, -80(%rbp)
	movq	$0, -48(%rbp)
	movq	_P2P_ATTR_ADVERTISED_SERVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_wpabuf_put_u8
	movq	%r12, %rdi
	movl	$4, %esi
	callq	_wpabuf_put
	movl	%r15d, %r14d
	movq	%rax, %r15
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_WPA_PUT_LE16
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_p2p_buf_update_ie_hdr
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_wpabuf_put
	movq	%rax, -88(%rbp)
	testb	%r14b, %r14b
	je	LBB0_8
## %bb.9:
	movq	_P2PS_WILD_HASH_STR@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	subq	$8, %rsp
	leaq	-48(%rbp), %rax
	leaq	-88(%rbp), %r10
	leaq	-80(%rbp), %r9
	movq	%r12, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	pushq	%r15
	pushq	%rax
	pushq	%r10
	callq	_p2p_buf_add_service_info
	addq	$32, %rsp
	movq	-48(%rbp), %rax
	movq	_MAX_SVC_ADV_LEN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	jbe	LBB0_10
	jmp	LBB0_20
LBB0_8:
	movq	_MAX_SVC_ADV_LEN@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	xorl	%eax, %eax
LBB0_10:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_11:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_13 Depth 2
	testq	%r14, %r14
	jle	LBB0_17
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	_P2PS_HASH_LEN@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_13 Depth=2
	movq	_P2PS_HASH_LEN@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	leaq	(%r13,%rdx,8), %r13
	decq	%r14
	je	LBB0_16
LBB0_13:                                ##   Parent Loop BB0_11 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	12(%rbx), %esi
	movq	%r13, %rdi
	callq	_os_memcmp
	testq	%rax, %rax
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=2
	movl	8(%rbx), %edx
	movl	(%rbx), %r8d
	movl	4(%rbx), %ecx
	subq	$8, %rsp
	movq	%r12, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	leaq	-80(%rbp), %r9
	pushq	%r15
	leaq	-48(%rbp), %rax
	pushq	%rax
	leaq	-88(%rbp), %rax
	pushq	%rax
	callq	_p2p_buf_add_service_info
	addq	$32, %rsp
	testq	%rax, %rax
	je	LBB0_15
LBB0_16:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	-48(%rbp), %rax
	movq	_MAX_SVC_ADV_LEN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	-64(%rbp), %r14                 ## 8-byte Reload
LBB0_17:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	16(%rbx), %rbx
	testq	%rbx, %rbx
	je	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_11 Depth=1
	cmpq	%rcx, %rax
	jbe	LBB0_11
LBB0_19:
	testq	%rax, %rax
	je	LBB0_21
LBB0_20:
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	callq	_wpabuf_put_buf
LBB0_21:
	movq	%r12, %rdi
	callq	_wpabuf_free
LBB0_22:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MSG_DEBUG,4,2                  ## @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"P2PS: Probe Request service hash values"

	.comm	_P2PS_HASH_LEN,8,3              ## @P2PS_HASH_LEN
	.comm	_MAX_SVC_ADV_IE_LEN,8,3         ## @MAX_SVC_ADV_IE_LEN
	.comm	_P2P_ATTR_ADVERTISED_SERVICE,4,2 ## @P2P_ATTR_ADVERTISED_SERVICE
	.comm	_P2PS_WILD_HASH_STR,4,2         ## @P2PS_WILD_HASH_STR
	.comm	_MAX_SVC_ADV_LEN,8,3            ## @MAX_SVC_ADV_LEN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_p2p_buf_add_service_instance   ; -- Begin function p2p_buf_add_service_instance
	.p2align	2
_p2p_buf_add_service_instance:          ; @p2p_buf_add_service_instance
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	cbz	x2, LBB0_20
; %bb.1:
	mov	x21, x3
	cbz	x3, LBB0_20
; %bb.2:
	mov	x20, x4
	cbz	x4, LBB0_20
; %bb.3:
	mov	x22, x2
	mov	x23, x1
	mov	x25, x0
Lloh0:
	adrp	x8, _MSG_DEBUG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MSG_DEBUG@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x27, _P2PS_HASH_LEN@GOTPAGE
Lloh4:
	ldr	x27, [x27, _P2PS_HASH_LEN@GOTPAGEOFF]
	ldr	x8, [x27]
	mul	x3, x8, x2
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_wpa_hexdump
	mov	x0, x23
	mov	x1, x21
	mov	x2, x22
	bl	_p2ps_wildcard_hash
	cbz	x0, LBB0_5
; %bb.4:
	mov	x0, x23
	bl	_p2p_wfa_service_adv
	cmp	x0, #0
	cset	w19, ne
	b	LBB0_6
LBB0_5:
	mov	w19, #0
LBB0_6:
Lloh7:
	adrp	x8, _MAX_SVC_ADV_IE_LEN@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MAX_SVC_ADV_IE_LEN@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	ldr	x9, [x27]
	add	x8, x8, x9
	add	x0, x8, #256
	bl	_wpabuf_alloc
	cbz	x0, LBB0_20
; %bb.7:
	mov	x24, x0
	str	x25, [sp, #16]                  ; 8-byte Folded Spill
	bl	_p2p_buf_add_ie_hdr
	mov	x26, x0
	str	x0, [sp, #24]
	str	xzr, [sp, #40]
Lloh10:
	adrp	x8, _P2P_ATTR_ADVERTISED_SERVICE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _P2P_ATTR_ADVERTISED_SERVICE@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x24
	bl	_wpabuf_put_u8
	mov	x0, x24
	mov	w1, #4
	bl	_wpabuf_put
	mov	x25, x0
	mov	w1, #0
	bl	_WPA_PUT_LE16
	mov	x0, x24
	mov	x1, x26
	bl	_p2p_buf_update_ie_hdr
	mov	x0, x24
	mov	w1, #0
	bl	_wpabuf_put
	str	x0, [sp, #32]
Lloh13:
	adrp	x28, _MAX_SVC_ADV_LEN@GOTPAGE
Lloh14:
	ldr	x28, [x28, _MAX_SVC_ADV_LEN@GOTPAGEOFF]
	tbz	w19, #0, LBB0_9
; %bb.8:
Lloh15:
	adrp	x8, _P2PS_WILD_HASH_STR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _P2PS_WILD_HASH_STR@GOTPAGEOFF]
Lloh17:
	ldr	w4, [x8]
	str	x25, [sp]
	add	x5, sp, #24
	add	x6, sp, #32
	add	x7, sp, #40
	mov	x0, x24
	mov	x1, x23
	mov	w2, #0
	mov	w3, #0
	bl	_p2p_buf_add_service_info
	ldr	x8, [sp, #40]
	ldr	x9, [x28]
	cmp	x8, x9
	b.ls	LBB0_12
	b	LBB0_18
LBB0_9:
	mov	x8, #0
	ldr	x9, [x28]
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	x8, [sp, #40]
	ldr	x9, [x28]
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	x20, [x20, #16]
	cmp	x20, #0
	ccmp	x8, x9, #2, ne
	b.hi	LBB0_17
LBB0_12:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_15 Depth 2
	cmp	x22, #1
	b.lt	LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x2, [x27]
	mov	x19, x22
	mov	x26, x21
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=2
	ldr	x2, [x27]
	add	x26, x26, x2, lsl #3
	subs	x19, x19, #1
	b.eq	LBB0_10
LBB0_15:                                ;   Parent Loop BB0_12 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w1, [x20, #12]
	mov	x0, x26
	bl	_os_memcmp
	cbnz	x0, LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=2
	ldp	w3, w2, [x20, #4]
	ldr	w4, [x20]
	str	x25, [sp]
	add	x5, sp, #24
	add	x6, sp, #32
	add	x7, sp, #40
	mov	x0, x24
	mov	x1, x23
	bl	_p2p_buf_add_service_info
	cbz	x0, LBB0_14
	b	LBB0_10
LBB0_17:
	cbz	x8, LBB0_19
LBB0_18:
	ldr	x0, [sp, #16]                   ; 8-byte Folded Reload
	mov	x1, x24
	bl	_wpabuf_put_buf
LBB0_19:
	mov	x0, x24
	bl	_wpabuf_free
LBB0_20:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_MSG_DEBUG,4,2                  ; @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"P2PS: Probe Request service hash values"

	.comm	_P2PS_HASH_LEN,8,3              ; @P2PS_HASH_LEN
	.comm	_MAX_SVC_ADV_IE_LEN,8,3         ; @MAX_SVC_ADV_IE_LEN
	.comm	_P2P_ATTR_ADVERTISED_SERVICE,4,2 ; @P2P_ATTR_ADVERTISED_SERVICE
	.comm	_P2PS_WILD_HASH_STR,4,2         ; @P2PS_WILD_HASH_STR
	.comm	_MAX_SVC_ADV_LEN,8,3            ; @MAX_SVC_ADV_LEN
.subsections_via_symbols
