	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wps_build_m2d
_wps_build_m2d:                         ## @wps_build_m2d
	.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	%rdi, %r14
	movq	(%rdi), %r15
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_wpa_printf
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_wpabuf_alloc
	testq	%rax, %rax
	je	LBB0_21
## %bb.1:
	movq	%rax, %rbx
	movq	16(%r14), %rax
	cmpq	$0, 32(%rax)
	je	LBB0_5
## %bb.2:
	movq	_WPS_CFG_NO_ERROR@GOTPCREL(%rip), %rdx
	movq	%r15, %rcx
	cmpq	(%rdx), %r15
	jne	LBB0_4
## %bb.3:
	movq	_WPS_CFG_SETUP_LOCKED@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
LBB0_4:
	cmpq	$0, 24(%rax)
	cmovneq	%rcx, %r15
LBB0_5:
	movq	%rbx, %rdi
	callq	_wps_build_version
	testq	%rax, %rax
	jne	LBB0_20
## %bb.6:
	movq	_WPS_M2D@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_wps_build_msg_type
	testq	%rax, %rax
	jne	LBB0_20
## %bb.7:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_wps_build_enrollee_nonce
	testq	%rax, %rax
	jne	LBB0_20
## %bb.8:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_wps_build_registrar_nonce
	testq	%rax, %rax
	jne	LBB0_20
## %bb.9:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_wps_build_uuid_r
	testq	%rax, %rax
	jne	LBB0_20
## %bb.10:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_wps_build_auth_type_flags
	testq	%rax, %rax
	jne	LBB0_20
## %bb.11:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_wps_build_encr_type_flags
	testq	%rax, %rax
	jne	LBB0_20
## %bb.12:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_wps_build_conn_type_flags
	testq	%rax, %rax
	jne	LBB0_20
## %bb.13:
	movq	16(%r14), %rax
	movl	16(%rax), %edi
	movq	%rbx, %rsi
	callq	_wps_build_config_methods_r
	testq	%rax, %rax
	jne	LBB0_20
## %bb.14:
	movq	16(%r14), %rdi
	movq	%rbx, %rsi
	callq	_wps_build_device_attrs
	testq	%rax, %rax
	jne	LBB0_20
## %bb.15:
	movq	16(%r14), %r12
	movl	4(%r12), %edi
	callq	*8(%r12)
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	%eax, %edx
	callq	_wps_build_rf_bands
	testq	%rax, %rax
	jne	LBB0_20
## %bb.16:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_wps_build_assoc_state
	testq	%rax, %rax
	jne	LBB0_20
## %bb.17:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_wps_build_config_error
	testq	%rax, %rax
	jne	LBB0_20
## %bb.18:
	movq	16(%r14), %rdi
	movq	%rbx, %rsi
	callq	_wps_build_os_version
	testq	%rax, %rax
	jne	LBB0_20
## %bb.19:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_wps_build_wfa_ext
	testq	%rax, %rax
	je	LBB0_23
LBB0_20:
	movq	%rbx, %rdi
	callq	_wpabuf_free
LBB0_21:
	xorl	%ebx, %ebx
LBB0_22:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_23:
	movq	_RECV_M2D_ACK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r14)
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_MSG_DEBUG,4,2                  ## @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"WPS: Building Message M2D"

	.comm	_WPS_CFG_NO_ERROR,8,3           ## @WPS_CFG_NO_ERROR
	.comm	_WPS_CFG_SETUP_LOCKED,8,3       ## @WPS_CFG_SETUP_LOCKED
	.comm	_WPS_M2D,4,2                    ## @WPS_M2D
	.comm	_RECV_M2D_ACK,4,2               ## @RECV_M2D_ACK
	.no_dead_strip	_wps_build_m2d
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wps_build_m2d
_wps_build_m2d:                         ; @wps_build_m2d
	.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	x19, x0
	ldr	x21, [x0]
Lloh0:
	adrp	x8, _MSG_DEBUG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MSG_DEBUG@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_wpa_printf
	mov	w0, #1000
	bl	_wpabuf_alloc
	mov	x20, x0
	cbz	x0, LBB0_19
; %bb.1:
	ldr	x8, [x19, #16]
	ldr	x9, [x8, #32]
	cbz	x9, LBB0_3
; %bb.2:
	ldr	x8, [x8, #24]
Lloh5:
	adrp	x9, _WPS_CFG_NO_ERROR@GOTPAGE
Lloh6:
	ldr	x9, [x9, _WPS_CFG_NO_ERROR@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x21, x9
	ccmp	x8, #0, #4, eq
Lloh8:
	adrp	x8, _WPS_CFG_SETUP_LOCKED@GOTPAGE
Lloh9:
	ldr	x8, [x8, _WPS_CFG_SETUP_LOCKED@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	csel	x21, x8, x21, ne
LBB0_3:
	mov	x0, x20
	bl	_wps_build_version
	cbnz	x0, LBB0_18
; %bb.4:
Lloh11:
	adrp	x8, _WPS_M2D@GOTPAGE
Lloh12:
	ldr	x8, [x8, _WPS_M2D@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_wps_build_msg_type
	cbnz	x0, LBB0_18
; %bb.5:
	mov	x0, x19
	mov	x1, x20
	bl	_wps_build_enrollee_nonce
	cbnz	x0, LBB0_18
; %bb.6:
	mov	x0, x19
	mov	x1, x20
	bl	_wps_build_registrar_nonce
	cbnz	x0, LBB0_18
; %bb.7:
	mov	x0, x19
	mov	x1, x20
	bl	_wps_build_uuid_r
	cbnz	x0, LBB0_18
; %bb.8:
	mov	x0, x19
	mov	x1, x20
	bl	_wps_build_auth_type_flags
	cbnz	x0, LBB0_18
; %bb.9:
	mov	x0, x19
	mov	x1, x20
	bl	_wps_build_encr_type_flags
	cbnz	x0, LBB0_18
; %bb.10:
	mov	x0, x19
	mov	x1, x20
	bl	_wps_build_conn_type_flags
	cbnz	x0, LBB0_18
; %bb.11:
	ldr	x8, [x19, #16]
	ldr	w0, [x8, #16]
	mov	x1, x20
	bl	_wps_build_config_methods_r
	cbnz	x0, LBB0_18
; %bb.12:
	ldr	x0, [x19, #16]
	mov	x1, x20
	bl	_wps_build_device_attrs
	cbnz	x0, LBB0_18
; %bb.13:
	ldr	x22, [x19, #16]
	ldr	x8, [x22, #8]
	ldr	w0, [x22, #4]
	blr	x8
	mov	x2, x0
	mov	x0, x22
	mov	x1, x20
	bl	_wps_build_rf_bands
	cbnz	x0, LBB0_18
; %bb.14:
	mov	x0, x19
	mov	x1, x20
	bl	_wps_build_assoc_state
	cbnz	x0, LBB0_18
; %bb.15:
	mov	x0, x20
	mov	x1, x21
	bl	_wps_build_config_error
	cbnz	x0, LBB0_18
; %bb.16:
	ldr	x0, [x19, #16]
	mov	x1, x20
	bl	_wps_build_os_version
	cbnz	x0, LBB0_18
; %bb.17:
	mov	x0, x20
	mov	w1, #0
	mov	x2, #0
	mov	w3, #0
	mov	w4, #0
	bl	_wps_build_wfa_ext
	cbz	x0, LBB0_20
LBB0_18:
	mov	x0, x20
	bl	_wpabuf_free
	mov	x20, #0
LBB0_19:
	mov	x0, x20
	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_20:
Lloh14:
	adrp	x8, _RECV_M2D_ACK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _RECV_M2D_ACK@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	str	w8, [x19, #8]
	b	LBB0_19
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_MSG_DEBUG,4,2                  ; @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"WPS: Building Message M2D"

	.comm	_WPS_CFG_NO_ERROR,8,3           ; @WPS_CFG_NO_ERROR
	.comm	_WPS_CFG_SETUP_LOCKED,8,3       ; @WPS_CFG_SETUP_LOCKED
	.comm	_WPS_M2D,4,2                    ; @WPS_M2D
	.comm	_RECV_M2D_ACK,4,2               ; @RECV_M2D_ACK
	.no_dead_strip	_wps_build_m2d
.subsections_via_symbols
