	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function orinoco_ioctl_setiwencode
_orinoco_ioctl_setiwencode:             ## @orinoco_ioctl_setiwencode
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r13
	movq	%rdx, %r12
	movq	%rdi, %rbx
	callq	_ndev_priv
	xorl	%r15d, %r15d
	cmpl	$0, 36(%rax)
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movq	_IW_ENCODE_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	andl	(%r12), %r13d
	movl	(%r14), %ebx
	movl	4(%r14), %edx
	movl	8(%r14), %esi
	movq	_EINPROGRESS@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	cmpq	$0, 16(%r12)
	je	LBB0_8
## %bb.3:
	movq	8(%r12), %rax
	movq	_LARGE_KEY_SIZE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_6
LBB0_4:
	movq	_E2BIG@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_1:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_33
LBB0_6:
	movq	_SMALL_KEY_SIZE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_8
## %bb.7:
	cmpl	$0, 32(%r14)
	je	LBB0_4
LBB0_8:
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	leaq	-72(%rbp), %rsi
	movq	%r14, %rdi
	callq	_orinoco_lock
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_5:
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_33
LBB0_10:
	cmpq	$0, 24(%r14)
	je	LBB0_13
## %bb.11:
	movslq	4(%r14), %rax
	movq	_ORINOCO_ALG_TKIP@GOTPCREL(%rip), %rcx
	cmpq	%rax, (%rcx)
	jne	LBB0_13
## %bb.12:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_orinoco_clear_tkip_key
LBB0_13:
	leal	-1(%r13), %esi
	testl	%r13d, %r13d
	setle	%cl
	movq	_ORINOCO_MAX_KEYS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	movq	8(%r12), %r8
	setg	%al
	orb	%cl, %al
	testq	%r8, %r8
	jle	LBB0_17
## %bb.14:
	testb	%al, %al
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	je	LBB0_16
## %bb.15:
	movl	(%r14), %esi
LBB0_16:
	movq	_ORINOCO_ALG_WEP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	cmovnel	%esi, %ebx
	movl	%eax, %edi
LBB0_22:
	movl	(%r12), %eax
	movq	_IW_ENCODE_DISABLED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_24
## %bb.23:
	movq	_ORINOCO_ALG_NONE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
LBB0_24:
	movq	_IW_ENCODE_OPEN@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	testl	%eax, (%rcx)
	cmovel	-48(%rbp), %edx                 ## 4-byte Folded Reload
	movq	_IW_ENCODE_RESTRICTED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	movl	$1, %r13d
	cmovel	%edx, %r13d
	cmpq	$0, 16(%r12)
	je	LBB0_27
## %bb.25:
	testq	%r8, %r8
	jle	LBB0_27
## %bb.26:
	movq	_ORINOCO_ALG_WEP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$0, (%rsp)
	movl	%ebx, %r15d
	movl	%edi, %ebx
	movq	%r14, %rdi
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	xorl	%r9d, %r9d
	callq	_orinoco_set_key
	movl	%ebx, %edi
	movl	%r15d, %ebx
	movl	%eax, %r15d
LBB0_27:
	movl	%ebx, (%r14)
	cmpl	%edi, 4(%r14)
	jne	LBB0_31
## %bb.28:
	cmpl	%r13d, 8(%r14)
	jne	LBB0_31
## %bb.29:
	movl	%edi, %r12d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_netif_carrier_ok
	movl	%r12d, %edi
	testq	%rax, %rax
	je	LBB0_31
## %bb.30:
	movq	%r14, %rdi
	callq	___orinoco_hw_setup_wepkeys
	movl	%eax, %r15d
	jmp	LBB0_32
LBB0_31:
	movl	%edi, 4(%r14)
	movl	%r13d, 8(%r14)
	jmp	LBB0_32
LBB0_17:
	testb	%al, %al
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	je	LBB0_21
## %bb.18:
	testl	%r13d, %r13d
	jne	LBB0_20
## %bb.19:
	movl	$-1, %esi
	cmpl	$0, (%r12)
	jne	LBB0_22
	jmp	LBB0_20
LBB0_21:
	movq	16(%r14), %rax
	movl	%esi, %ecx
	cmpq	$0, (%rax,%rcx,8)
	movl	%esi, %ebx
	jne	LBB0_22
LBB0_20:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_32:
	leaq	-72(%rbp), %rsi
	movq	%r14, %rdi
	callq	_orinoco_unlock
LBB0_33:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IW_ENCODE_INDEX,4,2            ## @IW_ENCODE_INDEX
	.comm	_EINPROGRESS,4,2                ## @EINPROGRESS
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_LARGE_KEY_SIZE,8,3             ## @LARGE_KEY_SIZE
	.comm	_E2BIG,4,2                      ## @E2BIG
	.comm	_SMALL_KEY_SIZE,8,3             ## @SMALL_KEY_SIZE
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_ORINOCO_ALG_TKIP,8,3           ## @ORINOCO_ALG_TKIP
	.comm	_ORINOCO_MAX_KEYS,4,2           ## @ORINOCO_MAX_KEYS
	.comm	_ORINOCO_ALG_WEP,4,2            ## @ORINOCO_ALG_WEP
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IW_ENCODE_DISABLED,4,2         ## @IW_ENCODE_DISABLED
	.comm	_ORINOCO_ALG_NONE,4,2           ## @ORINOCO_ALG_NONE
	.comm	_IW_ENCODE_OPEN,4,2             ## @IW_ENCODE_OPEN
	.comm	_IW_ENCODE_RESTRICTED,4,2       ## @IW_ENCODE_RESTRICTED
	.no_dead_strip	_orinoco_ioctl_setiwencode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function orinoco_ioctl_setiwencode
_orinoco_ioctl_setiwencode:             ; @orinoco_ioctl_setiwencode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x3
	mov	x23, x2
	mov	x20, x0
	bl	_ndev_priv
	ldr	w8, [x0, #36]
	cbz	w8, LBB0_4
; %bb.1:
	mov	x19, x0
	ldr	w27, [x23]
Lloh0:
	adrp	x8, _IW_ENCODE_INDEX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IW_ENCODE_INDEX@GOTPAGEOFF]
Lloh2:
	ldr	w28, [x8]
	ldp	w22, w26, [x0]
	ldr	w25, [x0, #8]
Lloh3:
	adrp	x8, _EINPROGRESS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINPROGRESS@GOTPAGEOFF]
Lloh5:
	ldr	w24, [x8]
	ldr	x8, [x23, #16]
	cbz	x8, LBB0_7
; %bb.2:
	ldr	x8, [x23, #8]
Lloh6:
	adrp	x9, _LARGE_KEY_SIZE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _LARGE_KEY_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.le	LBB0_5
LBB0_3:
Lloh9:
	adrp	x8, _E2BIG@GOTPAGE
Lloh10:
	ldr	x8, [x8, _E2BIG@GOTPAGEOFF]
	b	LBB0_9
LBB0_4:
Lloh11:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
	b	LBB0_9
LBB0_5:
Lloh13:
	adrp	x9, _SMALL_KEY_SIZE@GOTPAGE
Lloh14:
	ldr	x9, [x9, _SMALL_KEY_SIZE@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x8, x9
	b.le	LBB0_7
; %bb.6:
	ldr	w8, [x19, #32]
	cbz	w8, LBB0_3
LBB0_7:
	add	x1, sp, #8
	mov	x0, x19
	bl	_orinoco_lock
	cbz	x0, LBB0_11
; %bb.8:
Lloh16:
	adrp	x8, _EBUSY@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_10:
	mov	x0, x24
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_11:
	and	w27, w28, w27
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_14
; %bb.12:
	ldrsw	x8, [x19, #4]
Lloh18:
	adrp	x9, _ORINOCO_ALG_TKIP@GOTPAGE
Lloh19:
	ldr	x9, [x9, _ORINOCO_ALG_TKIP@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.13:
	mov	x0, x19
	mov	x1, x22
	bl	_orinoco_clear_tkip_key
LBB0_14:
	sub	w1, w27, #1
	ldr	x4, [x23, #8]
	cmp	w27, #1
Lloh21:
	adrp	x8, _ORINOCO_MAX_KEYS@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ORINOCO_MAX_KEYS@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	ccmp	w27, w8, #0, ge
	cset	w9, gt
Lloh24:
	adrp	x8, _ORINOCO_ALG_WEP@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ORINOCO_ALG_WEP@GOTPAGEOFF]
	cmp	x4, #1
	b.lt	LBB0_26
; %bb.15:
	cbz	w9, LBB0_17
; %bb.16:
	ldr	w1, [x19]
LBB0_17:
	ldr	w9, [x8]
	cmp	w26, w9
	csel	w22, w22, w1, eq
	mov	x26, x9
LBB0_18:
	neg	w24, w24
Lloh26:
	adrp	x9, _IW_ENCODE_DISABLED@GOTPAGE
Lloh27:
	ldr	x9, [x9, _IW_ENCODE_DISABLED@GOTPAGEOFF]
	ldr	w10, [x23]
Lloh28:
	ldr	w9, [x9]
Lloh29:
	adrp	x11, _ORINOCO_ALG_NONE@GOTPAGE
Lloh30:
	ldr	x11, [x11, _ORINOCO_ALG_NONE@GOTPAGEOFF]
Lloh31:
	ldr	w11, [x11]
	tst	w9, w10
	csel	w26, w26, w11, eq
Lloh32:
	adrp	x9, _IW_ENCODE_OPEN@GOTPAGE
Lloh33:
	ldr	x9, [x9, _IW_ENCODE_OPEN@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	tst	w9, w10
	csel	w9, w25, wzr, eq
Lloh35:
	adrp	x11, _IW_ENCODE_RESTRICTED@GOTPAGE
Lloh36:
	ldr	x11, [x11, _IW_ENCODE_RESTRICTED@GOTPAGEOFF]
Lloh37:
	ldr	w11, [x11]
	tst	w11, w10
	csinc	w25, w9, wzr, eq
	ldr	x9, [x23, #16]
	cbz	x9, LBB0_21
; %bb.19:
	cmp	x4, #1
	b.lt	LBB0_21
; %bb.20:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x3, x21
	mov	x5, #0
	mov	w6, #0
	bl	_orinoco_set_key
	mov	x24, x0
LBB0_21:
	str	w22, [x19]
	ldr	w8, [x19, #4]
	cmp	w8, w26
	b.ne	LBB0_25
; %bb.22:
	ldr	w8, [x19, #8]
	cmp	w8, w25
	b.ne	LBB0_25
; %bb.23:
	mov	x0, x20
	bl	_netif_carrier_ok
	cbz	x0, LBB0_25
; %bb.24:
	mov	x0, x19
	bl	___orinoco_hw_setup_wepkeys
	mov	x24, x0
	b	LBB0_32
LBB0_25:
	stp	w26, w25, [x19, #4]
	b	LBB0_32
LBB0_26:
	cbz	w9, LBB0_30
; %bb.27:
	cbnz	w27, LBB0_31
; %bb.28:
	ldr	w9, [x23]
	cbz	w9, LBB0_31
; %bb.29:
	mov	w1, #-1
	b	LBB0_18
LBB0_30:
	ldr	x9, [x19, #16]
	ldr	x9, [x9, w1, uxtw #3]
	mov	x22, x1
	cbnz	x9, LBB0_18
LBB0_31:
Lloh38:
	adrp	x8, _EINVAL@GOTPAGE
Lloh39:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_32:
	add	x1, sp, #8
	mov	x0, x19
	bl	_orinoco_unlock
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_IW_ENCODE_INDEX,4,2            ; @IW_ENCODE_INDEX
	.comm	_EINPROGRESS,4,2                ; @EINPROGRESS
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_LARGE_KEY_SIZE,8,3             ; @LARGE_KEY_SIZE
	.comm	_E2BIG,4,2                      ; @E2BIG
	.comm	_SMALL_KEY_SIZE,8,3             ; @SMALL_KEY_SIZE
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_ORINOCO_ALG_TKIP,8,3           ; @ORINOCO_ALG_TKIP
	.comm	_ORINOCO_MAX_KEYS,4,2           ; @ORINOCO_MAX_KEYS
	.comm	_ORINOCO_ALG_WEP,4,2            ; @ORINOCO_ALG_WEP
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IW_ENCODE_DISABLED,4,2         ; @IW_ENCODE_DISABLED
	.comm	_ORINOCO_ALG_NONE,4,2           ; @ORINOCO_ALG_NONE
	.comm	_IW_ENCODE_OPEN,4,2             ; @IW_ENCODE_OPEN
	.comm	_IW_ENCODE_RESTRICTED,4,2       ; @IW_ENCODE_RESTRICTED
	.no_dead_strip	_orinoco_ioctl_setiwencode
.subsections_via_symbols
