	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wpa_driver_hostap_set_key
_wpa_driver_hostap_set_key:             ## @wpa_driver_hostap_set_key
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -44(%rbp)                 ## 4-byte Spill
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	movq	%rcx, %r15
	movl	%edx, %r13d
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	40(%rbp), %rax
	leaq	48(%rax), %r14
	movq	%r14, %rdi
	callq	_os_zalloc
	movl	$-1, %r12d
	testq	%rax, %rax
	je	LBB0_12
## %bb.1:
	movq	%rax, %rbx
	movq	_PRISM2_SET_ENCRYPTION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
	movq	32(%rbx), %rdi
	movq	_ETH_ALEN@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	testq	%r15, %r15
	je	LBB0_2
## %bb.3:
	movq	%r15, %rsi
	callq	_memcpy
	jmp	LBB0_4
LBB0_2:
	movl	$255, %esi
	callq	_memset
LBB0_4:
	addl	$-128, %r13d
	cmpl	$4, %r13d
	jae	LBB0_5
## %bb.6:
	movq	32(%rbp), %r12
	movslq	%r13d, %rax
	leaq	l_reltable.wpa_driver_hostap_set_key(%rip), %rcx
	movslq	(%rcx,%rax,4), %rsi
	addq	%rcx, %rsi
	movq	24(%rbx), %rdi
	movq	_HOSTAP_CRYPT_ALG_NAME_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_os_strlcpy
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movq	_HOSTAP_CRYPT_FLAG_SET_TX_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_8:
	movl	%eax, 16(%rbx)
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%rbx)
	movq	40(%rbp), %rdx
	movq	%rdx, 8(%rbx)
	movq	%rbx, %rdi
	addq	$48, %rdi
	movq	%r12, %rsi
	callq	_memcpy
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_hostapd_ioctl
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	leaq	L_str(%rip), %rdi
	callq	_puts
	movl	$-1, %r12d
	jmp	LBB0_11
LBB0_5:
	movq	%rbx, %rdi
	callq	_os_free
	jmp	LBB0_12
LBB0_9:
	xorl	%r12d, %r12d
LBB0_11:
	movq	%rbx, %rdi
	callq	_free
LBB0_12:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PRISM2_SET_ENCRYPTION,4,2      ## @PRISM2_SET_ENCRYPTION
	.comm	_ETH_ALEN,8,3                   ## @ETH_ALEN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"NONE"

	.comm	_HOSTAP_CRYPT_ALG_NAME_LEN,4,2  ## @HOSTAP_CRYPT_ALG_NAME_LEN
L_.str.1:                               ## @.str.1
	.asciz	"WEP"

L_.str.2:                               ## @.str.2
	.asciz	"TKIP"

L_.str.3:                               ## @.str.3
	.asciz	"CCMP"

	.comm	_HOSTAP_CRYPT_FLAG_SET_TX_KEY,4,2 ## @HOSTAP_CRYPT_FLAG_SET_TX_KEY
L_str:                                  ## @str
	.asciz	"Failed to set encryption."

	.no_dead_strip	_wpa_driver_hostap_set_key
	.section	__TEXT,__const
	.p2align	2                               ## @reltable.wpa_driver_hostap_set_key
l_reltable.wpa_driver_hostap_set_key:
	.long	L_.str.1-l_reltable.wpa_driver_hostap_set_key
	.long	L_.str.2-l_reltable.wpa_driver_hostap_set_key
	.long	L_.str-l_reltable.wpa_driver_hostap_set_key
	.long	L_.str.3-l_reltable.wpa_driver_hostap_set_key

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wpa_driver_hostap_set_key
_wpa_driver_hostap_set_key:             ; @wpa_driver_hostap_set_key
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x24, x5
	mov	x23, x4
	mov	x26, x3
	mov	x25, x2
	mov	x20, x1
	ldr	x22, [x29, #24]
	add	x21, x22, #48
	mov	x0, x21
	bl	_os_zalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x8, _PRISM2_SET_ENCRYPTION@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PRISM2_SET_ENCRYPTION@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x0, #40]
	ldr	x0, [x0, #32]
Lloh3:
	adrp	x8, _ETH_ALEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ETH_ALEN@GOTPAGEOFF]
Lloh5:
	ldr	x2, [x8]
	cbz	x26, LBB0_4
; %bb.2:
	mov	x1, x26
	bl	_memcpy
	b	LBB0_5
LBB0_3:
	mov	w20, #-1
	b	LBB0_11
LBB0_4:
	mov	w1, #255
	bl	_memset
LBB0_5:
	sub	w8, w25, #128
	cmp	w8, #4
	b.hs	LBB0_8
; %bb.6:
	ldr	x25, [x29, #16]
Lloh6:
	adrp	x9, l_switch.table.wpa_driver_hostap_set_key@PAGE
Lloh7:
	add	x9, x9, l_switch.table.wpa_driver_hostap_set_key@PAGEOFF
	ldr	x1, [x9, w8, sxtw #3]
	ldr	x0, [x19, #24]
Lloh8:
	adrp	x8, _HOSTAP_CRYPT_ALG_NAME_LEN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _HOSTAP_CRYPT_ALG_NAME_LEN@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	bl	_os_strlcpy
Lloh11:
	adrp	x8, _HOSTAP_CRYPT_FLAG_SET_TX_KEY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _HOSTAP_CRYPT_FLAG_SET_TX_KEY@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w24, #0
	csel	w8, wzr, w8, eq
	str	w8, [x19, #16]
	str	w23, [x19]
	str	x22, [x19, #8]
	add	x0, x19, #48
	mov	x1, x25
	mov	x2, x22
	bl	_memcpy
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	bl	_hostapd_ioctl
	cbz	x0, LBB0_9
; %bb.7:
Lloh14:
	adrp	x0, l_str@PAGE
Lloh15:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	mov	w20, #-1
	b	LBB0_10
LBB0_8:
	mov	x0, x19
	bl	_os_free
	mov	w20, #-1
	b	LBB0_11
LBB0_9:
	mov	w20, #0
LBB0_10:
	mov	x0, x19
	bl	_free
LBB0_11:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_PRISM2_SET_ENCRYPTION,4,2      ; @PRISM2_SET_ENCRYPTION
	.comm	_ETH_ALEN,8,3                   ; @ETH_ALEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"NONE"

	.comm	_HOSTAP_CRYPT_ALG_NAME_LEN,4,2  ; @HOSTAP_CRYPT_ALG_NAME_LEN
l_.str.1:                               ; @.str.1
	.asciz	"WEP"

l_.str.2:                               ; @.str.2
	.asciz	"TKIP"

l_.str.3:                               ; @.str.3
	.asciz	"CCMP"

	.comm	_HOSTAP_CRYPT_FLAG_SET_TX_KEY,4,2 ; @HOSTAP_CRYPT_FLAG_SET_TX_KEY
l_str:                                  ; @str
	.asciz	"Failed to set encryption."

	.no_dead_strip	_wpa_driver_hostap_set_key
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.wpa_driver_hostap_set_key
l_switch.table.wpa_driver_hostap_set_key:
	.quad	l_.str.1
	.quad	l_.str.2
	.quad	l_.str
	.quad	l_.str.3

.subsections_via_symbols
