	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wpa_write_wpa_ie
_wpa_write_wpa_ie:                      ## @wpa_write_wpa_ie
	.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	_WLAN_EID_VENDOR_SPECIFIC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rsi)
	movq	16(%rsi), %rdi
	movq	_WPA_OUI_TYPE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	callq	_RSN_SELECTOR_PUT
	movq	8(%r15), %rdi
	movq	_WPA_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_WPA_PUT_LE16
	movq	_WPA_PROTO_WPA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r14), %esi
	callq	_wpa_cipher_to_suite
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	leaq	32(%r15), %rdi
	movq	%rax, %rsi
	callq	_RSN_SELECTOR_PUT
	movq	_WPA_SELECTOR_LEN@GOTPCREL(%rip), %r13
	movslq	(%r13), %rbx
	leaq	(%r15,%rbx,4), %r12
	addq	$40, %r12
	movl	4(%r14), %esi
	movq	%r12, %rdi
	callq	_wpa_cipher_put_suites
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	leaq	(%r15,%rbx,4), %rdi
	addq	$32, %rdi
	movslq	(%r13), %rcx
	movslq	%eax, %r13
	imulq	%rcx, %r13
	movl	%eax, %esi
	callq	_WPA_PUT_LE16
	leaq	(%r12,%r13,4), %rbx
	addq	$8, %rbx
	movl	8(%r14), %edx
	movq	_WPA_KEY_MGMT_IEEE8021X@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	je	LBB0_5
## %bb.8:
	movq	_WPA_AUTH_KEY_MGMT_UNSPEC_802_1X@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	callq	_RSN_SELECTOR_PUT
	movq	_WPA_SELECTOR_LEN@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	leaq	(%rbx,%rax,4), %rbx
	movq	_WPA_KEY_MGMT_PSK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r14)
	je	LBB0_11
## %bb.9:
	movl	$2, %r14d
	jmp	LBB0_10
LBB0_1:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r14), %edx
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_7
LBB0_3:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	4(%r14), %edx
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_7
LBB0_5:
	movq	_WPA_KEY_MGMT_PSK@GOTPCREL(%rip), %rax
	movl	$1, %r14d
	testl	%edx, (%rax)
	je	LBB0_6
LBB0_10:
	movq	_WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	callq	_RSN_SELECTOR_PUT
	movq	_WPA_SELECTOR_LEN@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	leaq	(%rbx,%rax,4), %rbx
	jmp	LBB0_12
LBB0_11:
	movl	$1, %r14d
LBB0_12:
	leaq	(%r12,%r13,4), %rdi
	movl	%r14d, %esi
	callq	_WPA_PUT_LE16
	subq	%r15, %rbx
	shrq	$2, %rbx
	leal	-2(%rbx), %eax
	movl	%eax, (%r15)
	jmp	LBB0_13
LBB0_6:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_7:
	callq	_wpa_printf
	movl	$-1, %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WLAN_EID_VENDOR_SPECIFIC,4,2   ## @WLAN_EID_VENDOR_SPECIFIC
	.comm	_WPA_OUI_TYPE,8,3               ## @WPA_OUI_TYPE
	.comm	_WPA_VERSION,4,2                ## @WPA_VERSION
	.comm	_WPA_PROTO_WPA,4,2              ## @WPA_PROTO_WPA
	.comm	_MSG_DEBUG,4,2                  ## @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid group cipher (%d)."

	.comm	_WPA_SELECTOR_LEN,4,2           ## @WPA_SELECTOR_LEN
L_.str.1:                               ## @.str.1
	.asciz	"Invalid pairwise cipher (%d)."

	.comm	_WPA_KEY_MGMT_IEEE8021X,4,2     ## @WPA_KEY_MGMT_IEEE8021X
	.comm	_WPA_AUTH_KEY_MGMT_UNSPEC_802_1X,8,3 ## @WPA_AUTH_KEY_MGMT_UNSPEC_802_1X
	.comm	_WPA_KEY_MGMT_PSK,4,2           ## @WPA_KEY_MGMT_PSK
	.comm	_WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X,8,3 ## @WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X
L_.str.2:                               ## @.str.2
	.asciz	"Invalid key management type (%d)."

	.no_dead_strip	_wpa_write_wpa_ie
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wpa_write_wpa_ie
_wpa_write_wpa_ie:                      ; @wpa_write_wpa_ie
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _WLAN_EID_VENDOR_SPECIFIC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WLAN_EID_VENDOR_SPECIFIC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x1, #24]
	ldr	x0, [x1, #16]
Lloh3:
	adrp	x8, _WPA_OUI_TYPE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _WPA_OUI_TYPE@GOTPAGEOFF]
Lloh5:
	ldr	x1, [x8]
	bl	_RSN_SELECTOR_PUT
	ldr	x0, [x19, #8]
Lloh6:
	adrp	x8, _WPA_VERSION@GOTPAGE
Lloh7:
	ldr	x8, [x8, _WPA_VERSION@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_WPA_PUT_LE16
Lloh9:
	adrp	x8, _WPA_PROTO_WPA@GOTPAGE
Lloh10:
	ldr	x8, [x8, _WPA_PROTO_WPA@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	ldr	w1, [x20]
	bl	_wpa_cipher_to_suite
	cbz	x0, LBB0_5
; %bb.1:
	mov	x1, x0
	add	x21, x19, #32
	mov	x0, x21
	bl	_RSN_SELECTOR_PUT
Lloh12:
	adrp	x23, _WPA_SELECTOR_LEN@GOTPAGE
Lloh13:
	ldr	x23, [x23, _WPA_SELECTOR_LEN@GOTPAGEOFF]
	ldrsw	x8, [x23]
	add	x22, x21, x8, lsl #2
	add	x21, x22, #8
	ldr	w1, [x20, #4]
	mov	x0, x21
	bl	_wpa_cipher_put_suites
	cbz	w0, LBB0_6
; %bb.2:
	mov	x1, x0
	ldr	w8, [x23]
	mul	w8, w8, w0
	add	x21, x21, w8, sxtw #2
	mov	x0, x22
	bl	_WPA_PUT_LE16
	add	x22, x21, #8
	ldr	w2, [x20, #8]
Lloh14:
	adrp	x8, _WPA_KEY_MGMT_IEEE8021X@GOTPAGE
Lloh15:
	ldr	x8, [x8, _WPA_KEY_MGMT_IEEE8021X@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	tst	w8, w2
	b.eq	LBB0_7
; %bb.3:
Lloh17:
	adrp	x8, _WPA_AUTH_KEY_MGMT_UNSPEC_802_1X@GOTPAGE
Lloh18:
	ldr	x8, [x8, _WPA_AUTH_KEY_MGMT_UNSPEC_802_1X@GOTPAGEOFF]
Lloh19:
	ldr	x1, [x8]
	mov	x0, x22
	bl	_RSN_SELECTOR_PUT
	ldrsw	x8, [x23]
	add	x22, x22, x8, lsl #2
	ldr	w8, [x20, #8]
Lloh20:
	adrp	x9, _WPA_KEY_MGMT_PSK@GOTPAGE
Lloh21:
	ldr	x9, [x9, _WPA_KEY_MGMT_PSK@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.4:
	mov	w20, #2
	b	LBB0_9
LBB0_5:
Lloh23:
	adrp	x8, _MSG_DEBUG@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MSG_DEBUG@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	ldr	w2, [x20]
Lloh26:
	adrp	x1, l_.str@PAGE
Lloh27:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_13
LBB0_6:
Lloh28:
	adrp	x8, _MSG_DEBUG@GOTPAGE
Lloh29:
	ldr	x8, [x8, _MSG_DEBUG@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	ldr	w2, [x20, #4]
Lloh31:
	adrp	x1, l_.str.1@PAGE
Lloh32:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_13
LBB0_7:
Lloh33:
	adrp	x8, _WPA_KEY_MGMT_PSK@GOTPAGE
Lloh34:
	ldr	x8, [x8, _WPA_KEY_MGMT_PSK@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	tst	w8, w2
	b.eq	LBB0_12
; %bb.8:
	mov	w20, #1
LBB0_9:
Lloh36:
	adrp	x8, _WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X@GOTPAGE
Lloh37:
	ldr	x8, [x8, _WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X@GOTPAGEOFF]
Lloh38:
	ldr	x1, [x8]
	mov	x0, x22
	bl	_RSN_SELECTOR_PUT
	ldrsw	x8, [x23]
	add	x22, x22, x8, lsl #2
	b	LBB0_11
LBB0_10:
	mov	w20, #1
LBB0_11:
	mov	x0, x21
	mov	x1, x20
	bl	_WPA_PUT_LE16
	sub	x8, x22, x19
	lsr	x0, x8, #2
	sub	w8, w0, #2
	str	w8, [x19]
	b	LBB0_14
LBB0_12:
Lloh39:
	adrp	x8, _MSG_DEBUG@GOTPAGE
Lloh40:
	ldr	x8, [x8, _MSG_DEBUG@GOTPAGEOFF]
Lloh41:
	ldr	w0, [x8]
Lloh42:
	adrp	x1, l_.str.2@PAGE
Lloh43:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_13:
	bl	_wpa_printf
	mov	w0, #-1
LBB0_14:
                                        ; kill: def $w0 killed $w0 killed $x0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_WLAN_EID_VENDOR_SPECIFIC,4,2   ; @WLAN_EID_VENDOR_SPECIFIC
	.comm	_WPA_OUI_TYPE,8,3               ; @WPA_OUI_TYPE
	.comm	_WPA_VERSION,4,2                ; @WPA_VERSION
	.comm	_WPA_PROTO_WPA,4,2              ; @WPA_PROTO_WPA
	.comm	_MSG_DEBUG,4,2                  ; @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid group cipher (%d)."

	.comm	_WPA_SELECTOR_LEN,4,2           ; @WPA_SELECTOR_LEN
l_.str.1:                               ; @.str.1
	.asciz	"Invalid pairwise cipher (%d)."

	.comm	_WPA_KEY_MGMT_IEEE8021X,4,2     ; @WPA_KEY_MGMT_IEEE8021X
	.comm	_WPA_AUTH_KEY_MGMT_UNSPEC_802_1X,8,3 ; @WPA_AUTH_KEY_MGMT_UNSPEC_802_1X
	.comm	_WPA_KEY_MGMT_PSK,4,2           ; @WPA_KEY_MGMT_PSK
	.comm	_WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X,8,3 ; @WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X
l_.str.2:                               ; @.str.2
	.asciz	"Invalid key management type (%d)."

	.no_dead_strip	_wpa_write_wpa_ie
.subsections_via_symbols
