	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_upnp_er_set_selected_registrar ## -- Begin function upnp_er_set_selected_registrar
	.p2align	4, 0x90
_upnp_er_set_selected_registrar:        ## @upnp_er_set_selected_registrar
	.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
	subq	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	_MSG_MSGDUMP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_wpa_hexdump_buf
	movq	%rbx, %rdi
	callq	_wps_validate_upnp_set_selected_registrar
	movl	$-1, %r12d
	testq	%rax, %rax
	js	LBB0_17
## %bb.1:
	leaq	-72(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_wps_parse_msg
	testq	%rax, %rax
	js	LBB0_17
## %bb.2:
	movq	%r14, 16(%r15)
	movq	_upnp_er_set_selected_timeout@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_eloop_cancel_timeout
	movl	12(%r15), %edi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_os_memset
	movq	-72(%rbp), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	cmpq	$0, (%rax)
	je	LBB0_4
## %bb.5:
	movl	$1, (%r15)
	movq	-40(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.6:
	callq	_WPA_GET_BE16
	jmp	LBB0_8
LBB0_4:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_wpa_printf
	movl	$0, (%r15)
	jmp	LBB0_16
LBB0_7:
	movq	_DEV_PW_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_8:
	movl	%eax, 4(%r15)
	movq	-48(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.10:
	callq	_WPA_GET_BE16
	jmp	LBB0_11
LBB0_9:
	movl	$-1, %eax
LBB0_11:
	movl	%eax, 8(%r15)
	movq	-56(%rbp), %rsi
	testq	%rsi, %rsi
	je	LBB0_13
## %bb.12:
	movl	-64(%rbp), %eax
	movq	_ETH_ALEN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cltd
	idivl	%ecx
	movq	_WPS_MAX_AUTHORIZED_MACS@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	cmpl	%edx, %eax
	cmovll	%eax, %edx
	movl	12(%r15), %edi
	imull	%ecx, %edx
	callq	_os_memcpy
	jmp	LBB0_15
LBB0_13:
	cmpl	$0, -60(%rbp)
	jne	LBB0_15
## %bb.14:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_wpa_printf
	movl	12(%r15), %edi
	movq	_ETH_ALEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$255, %esi
	callq	_os_memset
LBB0_15:
	movq	_WPS_PBC_WALK_TIME@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%rbx), %edx
	xorl	%esi, %esi
	movq	%r15, %rcx
	movq	%r14, %r8
	callq	_eloop_register_timeout
LBB0_16:
	xorl	%r12d, %r12d
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_wps_registrar_selected_registrar_changed
LBB0_17:
	movl	%r12d, %eax
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MSG_MSGDUMP,4,2                ## @MSG_MSGDUMP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"WPS: SetSelectedRegistrar attributes"

	.comm	_upnp_er_set_selected_timeout,4,2 ## @upnp_er_set_selected_timeout
	.comm	_MSG_DEBUG,4,2                  ## @MSG_DEBUG
L_.str.1:                               ## @.str.1
	.asciz	"WPS: SetSelectedRegistrar: Disable Selected Registrar"

	.comm	_DEV_PW_DEFAULT,4,2             ## @DEV_PW_DEFAULT
	.comm	_ETH_ALEN,4,2                   ## @ETH_ALEN
	.comm	_WPS_MAX_AUTHORIZED_MACS,4,2    ## @WPS_MAX_AUTHORIZED_MACS
L_.str.2:                               ## @.str.2
	.asciz	"WPS: Add broadcast AuthorizedMACs for WPS 1.0 ER"

	.comm	_WPS_PBC_WALK_TIME,4,2          ## @WPS_PBC_WALK_TIME
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_upnp_er_set_selected_registrar ; -- Begin function upnp_er_set_selected_registrar
	.p2align	2
_upnp_er_set_selected_registrar:        ; @upnp_er_set_selected_registrar
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _MSG_MSGDUMP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MSG_MSGDUMP@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_wpa_hexdump_buf
	mov	x0, x21
	bl	_wps_validate_upnp_set_selected_registrar
	tbnz	x0, #63, LBB0_6
; %bb.1:
	add	x1, sp, #8
	mov	x0, x21
	bl	_wps_parse_msg
	tbnz	x0, #63, LBB0_6
; %bb.2:
	str	x19, [x20, #16]
Lloh5:
	adrp	x21, _upnp_er_set_selected_timeout@GOTPAGE
Lloh6:
	ldr	x21, [x21, _upnp_er_set_selected_timeout@GOTPAGEOFF]
	ldr	w0, [x21]
	mov	x1, x20
	mov	x2, x19
	bl	_eloop_cancel_timeout
	ldr	w0, [x20, #12]
	mov	w1, #0
	mov	w2, #4
	bl	_os_memset
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_7
; %bb.3:
	ldr	x8, [x8]
	cbz	x8, LBB0_7
; %bb.4:
	mov	w8, #1
	str	w8, [x20]
	ldr	x0, [sp, #40]
	cbz	x0, LBB0_8
; %bb.5:
	bl	_WPA_GET_BE16
	b	LBB0_9
LBB0_6:
	mov	w0, #-1
	b	LBB0_18
LBB0_7:
Lloh7:
	adrp	x8, _MSG_DEBUG@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MSG_DEBUG@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_wpa_printf
	str	wzr, [x20]
	b	LBB0_17
LBB0_8:
Lloh12:
	adrp	x8, _DEV_PW_DEFAULT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DEV_PW_DEFAULT@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
LBB0_9:
	str	w0, [x20, #4]
	ldr	x0, [sp, #32]
	cbz	x0, LBB0_11
; %bb.10:
	bl	_WPA_GET_BE16
	b	LBB0_12
LBB0_11:
	mov	w0, #-1
LBB0_12:
	str	w0, [x20, #8]
	ldr	x1, [sp, #24]
	cbz	x1, LBB0_14
; %bb.13:
	ldr	w8, [sp, #16]
Lloh15:
	adrp	x9, _ETH_ALEN@GOTPAGE
Lloh16:
	ldr	x9, [x9, _ETH_ALEN@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
Lloh18:
	adrp	x10, _WPS_MAX_AUTHORIZED_MACS@GOTPAGE
Lloh19:
	ldr	x10, [x10, _WPS_MAX_AUTHORIZED_MACS@GOTPAGEOFF]
	sdiv	w8, w8, w9
Lloh20:
	ldr	w10, [x10]
	cmp	w8, w10
	csel	w8, w8, w10, lt
	ldr	w0, [x20, #12]
	mul	w2, w8, w9
	bl	_os_memcpy
	b	LBB0_16
LBB0_14:
	ldr	w8, [sp, #20]
	cbnz	w8, LBB0_16
; %bb.15:
Lloh21:
	adrp	x8, _MSG_DEBUG@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MSG_DEBUG@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
Lloh24:
	adrp	x1, l_.str.2@PAGE
Lloh25:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_wpa_printf
	ldr	w0, [x20, #12]
Lloh26:
	adrp	x8, _ETH_ALEN@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ETH_ALEN@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
	mov	w1, #255
	bl	_os_memset
LBB0_16:
Lloh29:
	adrp	x8, _WPS_PBC_WALK_TIME@GOTPAGE
Lloh30:
	ldr	x8, [x8, _WPS_PBC_WALK_TIME@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
	ldr	w2, [x21]
	mov	w1, #0
	mov	x3, x20
	mov	x4, x19
	bl	_eloop_register_timeout
LBB0_17:
	mov	x0, x19
	mov	w1, #0
	bl	_wps_registrar_selected_registrar_changed
	mov	w0, #0
LBB0_18:
	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
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_MSG_MSGDUMP,4,2                ; @MSG_MSGDUMP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"WPS: SetSelectedRegistrar attributes"

	.comm	_upnp_er_set_selected_timeout,4,2 ; @upnp_er_set_selected_timeout
	.comm	_MSG_DEBUG,4,2                  ; @MSG_DEBUG
l_.str.1:                               ; @.str.1
	.asciz	"WPS: SetSelectedRegistrar: Disable Selected Registrar"

	.comm	_DEV_PW_DEFAULT,4,2             ; @DEV_PW_DEFAULT
	.comm	_ETH_ALEN,4,2                   ; @ETH_ALEN
	.comm	_WPS_MAX_AUTHORIZED_MACS,4,2    ; @WPS_MAX_AUTHORIZED_MACS
l_.str.2:                               ; @.str.2
	.asciz	"WPS: Add broadcast AuthorizedMACs for WPS 1.0 ER"

	.comm	_WPS_PBC_WALK_TIME,4,2          ; @WPS_PBC_WALK_TIME
.subsections_via_symbols
