	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wl1251_set_key_type
_wl1251_set_key_type:                   ## @wl1251_set_key_type
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rcx, %rbx
	movq	%rsi, %r14
	movl	(%rcx), %esi
	leal	-128(%rsi), %eax
	cmpl	$2, %eax
	jb	LBB0_5
## %bb.1:
	cmpl	$130, %esi
	je	LBB0_7
## %bb.2:
	cmpl	$131, %esi
	jne	LBB0_9
## %bb.3:
	movq	%r8, %rdi
	callq	_is_broadcast_ether_addr
	testl	%eax, %eax
	jne	LBB0_11
## %bb.4:
	movq	_KEY_AES_PAIRWISE@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_5:
	movq	%r8, %rdi
	callq	_is_broadcast_ether_addr
	testl	%eax, %eax
	jne	LBB0_10
## %bb.6:
	movq	_KEY_WEP_ADDR@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_7:
	movq	%r8, %rdi
	callq	_is_broadcast_ether_addr
	testl	%eax, %eax
	jne	LBB0_13
## %bb.8:
	movq	_KEY_TKIP_MIC_PAIRWISE@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_9:
	leaq	L_.str(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_wl1251_error
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_16
LBB0_10:
	movq	_KEY_WEP_DEFAULT@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_11:
	movq	_KEY_AES_GROUP@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movq	_IEEE80211_KEY_FLAG_GENERATE_IV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 4(%rbx)
	jmp	LBB0_15
LBB0_13:
	movq	_KEY_TKIP_MIC_GROUP@GOTPCREL(%rip), %rax
LBB0_14:
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movl	8(%rbx), %eax
	movl	%eax, 12(%rbx)
LBB0_15:
	xorl	%eax, %eax
LBB0_16:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KEY_WEP_DEFAULT,4,2            ## @KEY_WEP_DEFAULT
	.comm	_KEY_WEP_ADDR,4,2               ## @KEY_WEP_ADDR
	.comm	_KEY_TKIP_MIC_GROUP,4,2         ## @KEY_TKIP_MIC_GROUP
	.comm	_KEY_TKIP_MIC_PAIRWISE,4,2      ## @KEY_TKIP_MIC_PAIRWISE
	.comm	_KEY_AES_GROUP,4,2              ## @KEY_AES_GROUP
	.comm	_KEY_AES_PAIRWISE,4,2           ## @KEY_AES_PAIRWISE
	.comm	_IEEE80211_KEY_FLAG_GENERATE_IV,4,2 ## @IEEE80211_KEY_FLAG_GENERATE_IV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unknown key cipher 0x%x"

	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.no_dead_strip	_wl1251_set_key_type
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wl1251_set_key_type
_wl1251_set_key_type:                   ; @wl1251_set_key_type
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x3
	mov	x20, x1
	ldr	w1, [x3]
	sub	w8, w1, #128
	cmp	w8, #2
	b.lo	LBB0_4
; %bb.1:
	cmp	w1, #130
	b.eq	LBB0_5
; %bb.2:
	cmp	w1, #131
	b.ne	LBB0_7
; %bb.3:
	mov	x0, x4
	bl	_is_broadcast_ether_addr
	mov	x8, x0
	mov	w0, #0
Lloh0:
	adrp	x9, _KEY_AES_PAIRWISE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _KEY_AES_PAIRWISE@GOTPAGEOFF]
Lloh2:
	adrp	x10, _KEY_AES_GROUP@GOTPAGE
Lloh3:
	ldr	x10, [x10, _KEY_AES_GROUP@GOTPAGEOFF]
	cmp	w8, #0
	csel	x8, x9, x10, eq
	ldr	w8, [x8]
	str	w8, [x20]
Lloh4:
	adrp	x8, _IEEE80211_KEY_FLAG_GENERATE_IV@GOTPAGE
Lloh5:
	ldr	x8, [x8, _IEEE80211_KEY_FLAG_GENERATE_IV@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	ldr	w9, [x19, #4]
	orr	w8, w9, w8
	str	w8, [x19, #4]
	b	LBB0_8
LBB0_4:
	mov	x0, x4
	bl	_is_broadcast_ether_addr
	mov	x8, x0
	mov	w0, #0
Lloh7:
	adrp	x9, _KEY_WEP_ADDR@GOTPAGE
Lloh8:
	ldr	x9, [x9, _KEY_WEP_ADDR@GOTPAGEOFF]
Lloh9:
	adrp	x10, _KEY_WEP_DEFAULT@GOTPAGE
Lloh10:
	ldr	x10, [x10, _KEY_WEP_DEFAULT@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
	mov	x0, x4
	bl	_is_broadcast_ether_addr
	mov	x8, x0
	mov	w0, #0
Lloh11:
	adrp	x9, _KEY_TKIP_MIC_PAIRWISE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _KEY_TKIP_MIC_PAIRWISE@GOTPAGEOFF]
Lloh13:
	adrp	x10, _KEY_TKIP_MIC_GROUP@GOTPAGE
Lloh14:
	ldr	x10, [x10, _KEY_TKIP_MIC_GROUP@GOTPAGEOFF]
LBB0_6:
	cmp	w8, #0
	csel	x8, x9, x10, eq
	ldr	w8, [x8]
	str	w8, [x20]
	ldr	w8, [x19, #8]
	str	w8, [x19, #12]
	b	LBB0_8
LBB0_7:
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	bl	_wl1251_error
Lloh17:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_KEY_WEP_DEFAULT,4,2            ; @KEY_WEP_DEFAULT
	.comm	_KEY_WEP_ADDR,4,2               ; @KEY_WEP_ADDR
	.comm	_KEY_TKIP_MIC_GROUP,4,2         ; @KEY_TKIP_MIC_GROUP
	.comm	_KEY_TKIP_MIC_PAIRWISE,4,2      ; @KEY_TKIP_MIC_PAIRWISE
	.comm	_KEY_AES_GROUP,4,2              ; @KEY_AES_GROUP
	.comm	_KEY_AES_PAIRWISE,4,2           ; @KEY_AES_PAIRWISE
	.comm	_IEEE80211_KEY_FLAG_GENERATE_IV,4,2 ; @IEEE80211_KEY_FLAG_GENERATE_IV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unknown key cipher 0x%x"

	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.no_dead_strip	_wl1251_set_key_type
.subsections_via_symbols
