	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hapd_wps_reconfig_in_memory
_hapd_wps_reconfig_in_memory:           ## @hapd_wps_reconfig_in_memory
	.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	%rsi, %r15
	movq	%rdi, %r14
	movq	8(%rdi), %r13
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_wpa_printf
	movl	$2, (%r13)
	movl	(%r15), %edx
	movq	_SSID_MAX_LEN@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jg	LBB0_2
## %bb.1:
	movq	48(%r13), %rdi
	movq	24(%r15), %rsi
	callq	_os_memcpy
	movl	(%r15), %eax
	movl	%eax, 24(%r13)
	movl	$1, 28(%r13)
LBB0_2:
	movl	4(%r15), %eax
	movq	_WPS_AUTH_WPA2@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_WPS_AUTH_WPA2PSK@GOTPCREL(%rip), %r12
	movl	(%r12), %r8d
	movl	%r8d, %edi
	orl	%esi, %edi
	movq	_WPS_AUTH_WPA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_WPS_AUTH_WPAPSK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ebx
	movl	%ebx, %edx
	orl	%ecx, %edx
	testl	%eax, %edi
	je	LBB0_4
## %bb.3:
	andl	%eax, %edx
	cmpl	$1, %edx
	movl	$3, %edi
	sbbl	$0, %edi
	jmp	LBB0_5
LBB0_4:
	movl	$1, %edi
	testl	%eax, %edx
	je	LBB0_29
LBB0_5:
	movl	%edi, 4(%r13)
	orl	%esi, %ecx
	testl	%eax, %ecx
	je	LBB0_7
## %bb.6:
	movq	_WPA_KEY_MGMT_IEEE8021X@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 56(%r13)
LBB0_7:
	orl	%r8d, %ebx
	testl	%eax, %ebx
	je	LBB0_9
## %bb.8:
	movq	_WPA_KEY_MGMT_PSK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 56(%r13)
LBB0_9:
	movl	$0, 76(%r13)
	movl	8(%r15), %eax
	movq	_WPS_ENCR_AES@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_10
## %bb.11:
	movq	16(%r14), %rcx
	movq	(%rcx), %rcx
	movq	_HOSTAPD_MODE_IEEE80211AD@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_12
## %bb.13:
	movq	_WPA_CIPHER_GCMP@GOTPCREL(%rip), %rcx
	jmp	LBB0_14
LBB0_10:
	xorl	%edx, %edx
	jmp	LBB0_15
LBB0_12:
	movq	_WPA_CIPHER_CCMP@GOTPCREL(%rip), %rcx
LBB0_14:
	movl	(%rcx), %edx
	movl	%edx, 76(%r13)
LBB0_15:
	movq	_WPS_ENCR_TKIP@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_17
## %bb.16:
	movq	_WPA_CIPHER_TKIP@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movl	%edx, 76(%r13)
LBB0_17:
	movl	%edx, 72(%r13)
	movl	%edx, %esi
	callq	_wpa_select_ap_group_cipher
	movl	%eax, 80(%r13)
	movq	8(%r14), %rax
	cmpq	$0, 64(%rax)
	je	LBB0_21
## %bb.18:
	movl	(%r12), %eax
	testl	%eax, 4(%r15)
	je	LBB0_21
## %bb.19:
	movq	_PMK_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%eax, %eax
	cmpl	%eax, 12(%r15)
	je	LBB0_21
## %bb.20:
	movq	_WPA_KEY_MGMT_SAE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 56(%r13)
LBB0_21:
	movl	12(%r15), %eax
	leal	-8(%rax), %ecx
	cmpl	$55, %ecx
	ja	LBB0_25
## %bb.22:
	movq	32(%r13), %rdi
	callq	_os_free
	movl	12(%r15), %edi
	incl	%edi
	callq	_os_zalloc
	movq	%rax, 32(%r13)
	testq	%rax, %rax
	je	LBB0_24
## %bb.23:
	movq	16(%r15), %rsi
	movl	12(%r15), %edx
	movq	%rax, %rdi
	callq	_os_memcpy
LBB0_24:
	leaq	40(%r13), %rdi
	callq	_hostapd_config_clear_wpa_psk
	jmp	LBB0_30
LBB0_25:
	cmpl	$64, %eax
	jne	LBB0_30
## %bb.26:
	leaq	40(%r13), %rdi
	callq	_hostapd_config_clear_wpa_psk
	movl	$4, %edi
	callq	_os_zalloc
	movq	%rax, 40(%r13)
	testq	%rax, %rax
	je	LBB0_30
## %bb.27:
	movq	16(%r15), %rdi
	movl	4(%rax), %esi
	movq	_PMK_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_hexstr2bin
	testq	%rax, %rax
	jne	LBB0_30
## %bb.28:
	movq	40(%r13), %rax
	movl	$1, (%rax)
	movq	32(%r13), %rdi
	callq	_os_free
	movq	$0, 32(%r13)
	jmp	LBB0_30
LBB0_29:
	movl	$0, 4(%r13)
LBB0_30:
	movl	$1, 20(%r13)
	movq	_wps_reload_config@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%r14), %ecx
	xorl	%edi, %edi
	movl	$100000, %esi                   ## imm = 0x186A0
	xorl	%r8d, %r8d
	callq	_eloop_register_timeout
	xorl	%eax, %eax
	addq	$8, %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	"WPS: Updating in-memory configuration"

	.comm	_SSID_MAX_LEN,4,2               ## @SSID_MAX_LEN
	.comm	_WPS_AUTH_WPA2,4,2              ## @WPS_AUTH_WPA2
	.comm	_WPS_AUTH_WPA2PSK,4,2           ## @WPS_AUTH_WPA2PSK
	.comm	_WPS_AUTH_WPA,4,2               ## @WPS_AUTH_WPA
	.comm	_WPS_AUTH_WPAPSK,4,2            ## @WPS_AUTH_WPAPSK
	.comm	_WPA_KEY_MGMT_IEEE8021X,4,2     ## @WPA_KEY_MGMT_IEEE8021X
	.comm	_WPA_KEY_MGMT_PSK,4,2           ## @WPA_KEY_MGMT_PSK
	.comm	_WPS_ENCR_AES,4,2               ## @WPS_ENCR_AES
	.comm	_HOSTAPD_MODE_IEEE80211AD,8,3   ## @HOSTAPD_MODE_IEEE80211AD
	.comm	_WPA_CIPHER_GCMP,4,2            ## @WPA_CIPHER_GCMP
	.comm	_WPA_CIPHER_CCMP,4,2            ## @WPA_CIPHER_CCMP
	.comm	_WPS_ENCR_TKIP,4,2              ## @WPS_ENCR_TKIP
	.comm	_WPA_CIPHER_TKIP,4,2            ## @WPA_CIPHER_TKIP
	.comm	_PMK_LEN,4,2                    ## @PMK_LEN
	.comm	_WPA_KEY_MGMT_SAE,4,2           ## @WPA_KEY_MGMT_SAE
	.comm	_wps_reload_config,4,2          ## @wps_reload_config
	.comm	_MGMT_FRAME_PROTECTION_OPTIONAL,8,3 ## @MGMT_FRAME_PROTECTION_OPTIONAL
	.comm	_NO_MGMT_FRAME_PROTECTION,8,3   ## @NO_MGMT_FRAME_PROTECTION
	.no_dead_strip	_hapd_wps_reconfig_in_memory
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hapd_wps_reconfig_in_memory
_hapd_wps_reconfig_in_memory:           ; @hapd_wps_reconfig_in_memory
	.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	x20, x1
	mov	x19, x0
	ldr	x21, [x0, #8]
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	w8, #2
	str	w8, [x21]
	ldr	w2, [x20]
Lloh5:
	adrp	x8, _SSID_MAX_LEN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SSID_MAX_LEN@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w2, w8
	b.gt	LBB0_2
; %bb.1:
	ldr	x0, [x21, #48]
	ldr	x1, [x20, #24]
	bl	_os_memcpy
	ldr	w8, [x20]
	mov	w9, #1
	stp	w8, w9, [x21, #24]
LBB0_2:
	ldr	w8, [x20, #4]
Lloh8:
	adrp	x9, _WPS_AUTH_WPA2@GOTPAGE
Lloh9:
	ldr	x9, [x9, _WPS_AUTH_WPA2@GOTPAGEOFF]
Lloh10:
	adrp	x22, _WPS_AUTH_WPA2PSK@GOTPAGE
Lloh11:
	ldr	x22, [x22, _WPS_AUTH_WPA2PSK@GOTPAGEOFF]
Lloh12:
	ldr	w11, [x9]
	ldr	w9, [x22]
	orr	w14, w9, w11
Lloh13:
	adrp	x10, _WPS_AUTH_WPA@GOTPAGE
Lloh14:
	ldr	x10, [x10, _WPS_AUTH_WPA@GOTPAGEOFF]
Lloh15:
	ldr	w12, [x10]
Lloh16:
	adrp	x10, _WPS_AUTH_WPAPSK@GOTPAGE
Lloh17:
	ldr	x10, [x10, _WPS_AUTH_WPAPSK@GOTPAGEOFF]
Lloh18:
	ldr	w10, [x10]
	orr	w13, w10, w12
	and	w13, w13, w8
	tst	w14, w8
	b.eq	LBB0_4
; %bb.3:
	cmp	w13, #0
	mov	w13, #2
	cinc	w0, w13, ne
	b	LBB0_6
LBB0_4:
	cbz	w13, LBB0_27
; %bb.5:
	mov	w0, #1
LBB0_6:
	str	w0, [x21, #4]
	orr	w11, w12, w11
	tst	w11, w8
	b.eq	LBB0_8
; %bb.7:
Lloh19:
	adrp	x11, _WPA_KEY_MGMT_IEEE8021X@GOTPAGE
Lloh20:
	ldr	x11, [x11, _WPA_KEY_MGMT_IEEE8021X@GOTPAGEOFF]
Lloh21:
	ldr	w11, [x11]
	str	w11, [x21, #56]
LBB0_8:
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:
Lloh22:
	adrp	x8, _WPA_KEY_MGMT_PSK@GOTPAGE
Lloh23:
	ldr	x8, [x8, _WPA_KEY_MGMT_PSK@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	str	w8, [x21, #56]
LBB0_10:
	str	wzr, [x21, #76]
	ldr	w8, [x20, #8]
Lloh25:
	adrp	x9, _WPS_ENCR_AES@GOTPAGE
Lloh26:
	ldr	x9, [x9, _WPS_ENCR_AES@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.11:
	ldr	x9, [x19, #16]
	ldr	x9, [x9]
Lloh28:
	adrp	x10, _HOSTAPD_MODE_IEEE80211AD@GOTPAGE
Lloh29:
	ldr	x10, [x10, _HOSTAPD_MODE_IEEE80211AD@GOTPAGEOFF]
Lloh30:
	ldr	x10, [x10]
Lloh31:
	adrp	x11, _WPA_CIPHER_GCMP@GOTPAGE
Lloh32:
	ldr	x11, [x11, _WPA_CIPHER_GCMP@GOTPAGEOFF]
Lloh33:
	adrp	x12, _WPA_CIPHER_CCMP@GOTPAGE
Lloh34:
	ldr	x12, [x12, _WPA_CIPHER_CCMP@GOTPAGEOFF]
	cmp	x9, x10
	csel	x9, x11, x12, eq
	ldr	w1, [x9]
	str	w1, [x21, #76]
	b	LBB0_13
LBB0_12:
	mov	w1, #0
LBB0_13:
Lloh35:
	adrp	x9, _WPS_ENCR_TKIP@GOTPAGE
Lloh36:
	ldr	x9, [x9, _WPS_ENCR_TKIP@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.14:
Lloh38:
	adrp	x8, _WPA_CIPHER_TKIP@GOTPAGE
Lloh39:
	ldr	x8, [x8, _WPA_CIPHER_TKIP@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
	orr	w1, w1, w8
	str	w1, [x21, #76]
LBB0_15:
	str	w1, [x21, #72]
	mov	x2, x1
	bl	_wpa_select_ap_group_cipher
	str	w0, [x21, #80]
	ldr	x8, [x19, #8]
	ldr	x8, [x8, #64]
	cbz	x8, LBB0_19
; %bb.16:
	ldr	w8, [x20, #4]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_19
; %bb.17:
	ldr	w8, [x20, #12]
Lloh41:
	adrp	x9, _PMK_LEN@GOTPAGE
Lloh42:
	ldr	x9, [x9, _PMK_LEN@GOTPAGEOFF]
Lloh43:
	ldr	w9, [x9]
	cmp	w8, w9, lsl #1
	b.eq	LBB0_19
; %bb.18:
Lloh44:
	adrp	x8, _WPA_KEY_MGMT_SAE@GOTPAGE
Lloh45:
	ldr	x8, [x8, _WPA_KEY_MGMT_SAE@GOTPAGEOFF]
Lloh46:
	ldr	w8, [x8]
	ldr	w9, [x21, #56]
	orr	w8, w9, w8
	str	w8, [x21, #56]
LBB0_19:
	ldr	w8, [x20, #12]
	sub	w9, w8, #8
	cmp	w9, #55
	b.hi	LBB0_23
; %bb.20:
	ldr	x0, [x21, #32]
	bl	_os_free
	ldr	w8, [x20, #12]
	add	w0, w8, #1
	bl	_os_zalloc
	str	x0, [x21, #32]
	cbz	x0, LBB0_22
; %bb.21:
	ldr	x1, [x20, #16]
	ldr	w2, [x20, #12]
	bl	_os_memcpy
LBB0_22:
	add	x0, x21, #40
	bl	_hostapd_config_clear_wpa_psk
	b	LBB0_28
LBB0_23:
	cmp	w8, #64
	b.ne	LBB0_28
; %bb.24:
	add	x0, x21, #40
	bl	_hostapd_config_clear_wpa_psk
	mov	w0, #4
	bl	_os_zalloc
	str	x0, [x21, #40]
	cbz	x0, LBB0_28
; %bb.25:
	ldr	x8, [x20, #16]
	ldr	w1, [x0, #4]
Lloh47:
	adrp	x9, _PMK_LEN@GOTPAGE
Lloh48:
	ldr	x9, [x9, _PMK_LEN@GOTPAGEOFF]
Lloh49:
	ldr	w2, [x9]
	mov	x0, x8
	bl	_hexstr2bin
	cbnz	x0, LBB0_28
; %bb.26:
	mov	w8, #1
	ldp	x0, x9, [x21, #32]
	str	w8, [x9]
	bl	_os_free
	str	xzr, [x21, #32]
	b	LBB0_28
LBB0_27:
	str	wzr, [x21, #4]
LBB0_28:
	mov	w8, #1
	str	w8, [x21, #20]
Lloh50:
	adrp	x8, _wps_reload_config@GOTPAGE
Lloh51:
	ldr	x8, [x8, _wps_reload_config@GOTPAGEOFF]
Lloh52:
	ldr	w2, [x8]
	ldr	w3, [x19]
	mov	w0, #0
	mov	w1, #34464
	movk	w1, #1, lsl #16
	mov	x4, #0
	bl	_eloop_register_timeout
	mov	w0, #0
	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
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.cfi_endproc
                                        ; -- End function
	.comm	_MSG_DEBUG,4,2                  ; @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"WPS: Updating in-memory configuration"

	.comm	_SSID_MAX_LEN,4,2               ; @SSID_MAX_LEN
	.comm	_WPS_AUTH_WPA2,4,2              ; @WPS_AUTH_WPA2
	.comm	_WPS_AUTH_WPA2PSK,4,2           ; @WPS_AUTH_WPA2PSK
	.comm	_WPS_AUTH_WPA,4,2               ; @WPS_AUTH_WPA
	.comm	_WPS_AUTH_WPAPSK,4,2            ; @WPS_AUTH_WPAPSK
	.comm	_WPA_KEY_MGMT_IEEE8021X,4,2     ; @WPA_KEY_MGMT_IEEE8021X
	.comm	_WPA_KEY_MGMT_PSK,4,2           ; @WPA_KEY_MGMT_PSK
	.comm	_WPS_ENCR_AES,4,2               ; @WPS_ENCR_AES
	.comm	_HOSTAPD_MODE_IEEE80211AD,8,3   ; @HOSTAPD_MODE_IEEE80211AD
	.comm	_WPA_CIPHER_GCMP,4,2            ; @WPA_CIPHER_GCMP
	.comm	_WPA_CIPHER_CCMP,4,2            ; @WPA_CIPHER_CCMP
	.comm	_WPS_ENCR_TKIP,4,2              ; @WPS_ENCR_TKIP
	.comm	_WPA_CIPHER_TKIP,4,2            ; @WPA_CIPHER_TKIP
	.comm	_PMK_LEN,4,2                    ; @PMK_LEN
	.comm	_WPA_KEY_MGMT_SAE,4,2           ; @WPA_KEY_MGMT_SAE
	.comm	_wps_reload_config,4,2          ; @wps_reload_config
	.comm	_MGMT_FRAME_PROTECTION_OPTIONAL,8,3 ; @MGMT_FRAME_PROTECTION_OPTIONAL
	.comm	_NO_MGMT_FRAME_PROTECTION,8,3   ; @NO_MGMT_FRAME_PROTECTION
	.no_dead_strip	_hapd_wps_reconfig_in_memory
.subsections_via_symbols
