	.file	"extr_ieee80211_ioctl.c_ieee80211_ioctl_setkey.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ieee80211_ioctl_setkey, @function
ieee80211_ioctl_setkey:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	sub	rsp, 48
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	cmp	DWORD PTR [rsi], 40
	je	.L2
.L10:
	mov	r12d, DWORD PTR EINVAL[rip]
.L1:
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L28
	add	rsp, 48
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	r8, rsp
	mov	rbp, rdi
	mov	edi, DWORD PTR 4[rsi]
	mov	edx, 40
	mov	rsi, r8
	call	copyin@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	cmp	DWORD PTR [rsp], 4
	ja	.L29
	mov	r13, QWORD PTR 8[rsp]
	mov	rax, QWORD PTR IEEE80211_KEYIX_NONE[rip]
	cmp	rax, r13
	je	.L30
	cmp	QWORD PTR IEEE80211_WEP_NKID[rip], r13
	jbe	.L10
	mov	rcx, QWORD PTR 8[rbp]
	lea	rdx, 0[r13+r13*4]
	xor	r14d, r14d
	lea	r15, [rcx+rdx*8]
	cmp	rax, QWORD PTR [r15]
	je	.L31
.L9:
	mov	rdi, rbp
	call	ieee80211_key_update_begin@PLT
	mov	edx, DWORD PTR 16[rsp]
	mov	esi, DWORD PTR 32[rsp]
	mov	rcx, r15
	mov	rdi, rbp
	call	ieee80211_crypto_newkey@PLT
	test	rax, rax
	je	.L11
	mov	eax, DWORD PTR [rsp]
	mov	edx, DWORD PTR IEEE80211_KEYBUF_SIZE[rip]
	cmp	eax, edx
	cmovg	eax, edx
	mov	DWORD PTR 8[r15], eax
	mov	eax, DWORD PTR IEEE80211_TID_SIZE[rip]
	test	eax, eax
	jle	.L13
	mov	rcx, QWORD PTR 32[r15]
	xor	eax, eax
	.p2align 4,,10
	.p2align 3
.L14:
	mov	edx, DWORD PTR 28[rsp]
	mov	DWORD PTR [rcx+rax*4], edx
	add	rax, 1
	cmp	DWORD PTR IEEE80211_TID_SIZE[rip], eax
	jg	.L14
.L13:
	mov	QWORD PTR 24[r15], 0
	mov	edi, DWORD PTR 16[r15]
	xor	esi, esi
	mov	edx, 4
	call	memset@PLT
	mov	edi, DWORD PTR 16[r15]
	mov	edx, DWORD PTR [rsp]
	mov	esi, DWORD PTR 24[rsp]
	call	memcpy@PLT
	test	r14, r14
	je	.L15
	mov	esi, DWORD PTR [r14]
.L16:
	mov	edi, DWORD PTR 12[r15]
	call	IEEE80211_ADDR_COPY@PLT
	mov	rsi, r15
	mov	rdi, rbp
	call	ieee80211_crypto_setkey@PLT
	test	eax, eax
	jne	.L17
	mov	r12d, DWORD PTR EIO[rip]
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L29:
	mov	r12d, DWORD PTR E2BIG[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L11:
	mov	r12d, DWORD PTR ENXIO[rip]
.L18:
	mov	rdi, rbp
	call	ieee80211_key_update_end@PLT
	test	r14, r14
	je	.L1
	mov	rdi, r14
	call	ieee80211_free_node@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L31:
	mov	QWORD PTR [r15], r13
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L30:
	mov	eax, DWORD PTR IEEE80211_KEY_XMIT[rip]
	or	eax, DWORD PTR IEEE80211_KEY_RECV[rip]
	cmp	DWORD PTR 16[rsp], eax
	jne	.L10
	mov	rax, QWORD PTR IEEE80211_M_STA[rip]
	cmp	QWORD PTR 0[rbp], rax
	je	.L32
	mov	rdi, QWORD PTR 16[rbp]
	mov	edx, DWORD PTR 20[rsp]
	mov	rsi, rbp
	call	ieee80211_find_vap_node@PLT
	mov	r14, rax
	test	rax, rax
	je	.L33
.L8:
	lea	r15, 8[r14]
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L17:
	mov	eax, DWORD PTR 16[rsp]
	test	DWORD PTR IEEE80211_KEY_DEFAULT[rip], eax
	jne	.L34
	xor	r12d, r12d
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L15:
	mov	esi, DWORD PTR 20[rsp]
	jmp	.L16
.L32:
	mov	edi, DWORD PTR 24[rbp]
	call	ieee80211_ref_node@PLT
	mov	edi, DWORD PTR 20[rsp]
	mov	esi, DWORD PTR 48[rax]
	mov	r14, rax
	call	IEEE80211_ADDR_EQ@PLT
	test	eax, eax
	jne	.L8
	mov	rdi, r14
	call	ieee80211_free_node@PLT
	mov	r12d, DWORD PTR EADDRNOTAVAIL[rip]
	jmp	.L1
.L34:
	mov	rsi, r13
	mov	rdi, rbp
	call	ieee80211_crypto_set_deftxkey@PLT
	jmp	.L18
.L33:
	mov	r12d, DWORD PTR ENOENT[rip]
	jmp	.L1
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	ieee80211_ioctl_setkey, .-ieee80211_ioctl_setkey
	.comm	IEEE80211_WEP_NKID,8,8
	.comm	IEEE80211_TID_SIZE,4,4
	.comm	IEEE80211_M_STA,8,8
	.comm	IEEE80211_KEY_XMIT,4,4
	.comm	IEEE80211_KEY_RECV,4,4
	.comm	IEEE80211_KEY_DEFAULT,4,4
	.comm	IEEE80211_KEYIX_NONE,8,8
	.comm	IEEE80211_KEYBUF_SIZE,4,4
	.comm	ENXIO,4,4
	.comm	ENOENT,4,4
	.comm	EIO,4,4
	.comm	EINVAL,4,4
	.comm	EADDRNOTAVAIL,4,4
	.comm	E2BIG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_ieee80211_ioctl.c_ieee80211_ioctl_setkey.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ieee80211_ioctl_setkey, %function
ieee80211_ioctl_setkey:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r2, [r1]
	ldr	r3, .L33
	sub	sp, sp, #32
	cmp	r2, #28
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	beq	.L2
.L10:
	ldr	r3, .L33+4
	ldr	r4, [r3]
.L1:
	ldr	r3, .L33
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L28
	mov	r0, r4
	add	sp, sp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	mov	r5, r0
	ldr	r0, [r1, #4]
	mov	r1, sp
	bl	copyin
	subs	r4, r0, #0
	bne	.L1
	ldr	r3, [sp]
	cmp	r3, #4
	bhi	.L29
	ldr	r3, .L33+8
	ldr	r7, [sp, #4]
	ldr	r2, [r3]
	cmp	r2, r7
	beq	.L30
	ldr	r3, .L33+12
	ldr	r3, [r3]
	cmp	r3, r7
	bls	.L10
	mov	r8, r4
	ldr	r3, [r5, #4]
	add	r6, r7, r7, lsl #1
	lsl	r1, r6, #3
	ldr	r0, [r3, r1]
	add	r6, r3, r6, lsl #3
	cmp	r2, r0
	streq	r7, [r3, r1]
.L9:
	mov	r0, r5
	bl	ieee80211_key_update_begin
	mov	r3, r6
	mov	r0, r5
	ldr	r2, [sp, #8]
	ldr	r1, [sp, #24]
	bl	ieee80211_crypto_newkey
	cmp	r0, #0
	beq	.L11
	ldr	r3, .L33+16
	ldr	r2, [sp]
	ldr	r3, [r3]
	ldr	r0, .L33+20
	cmp	r3, r2
	movge	r3, r2
	ldr	r2, [r0]
	str	r3, [r6, #4]
	cmp	r2, #0
	ble	.L13
	mov	r2, #0
	ldr	r1, [r6, #20]
	sub	r1, r1, #4
.L14:
	ldr	r3, [sp, #20]
	add	r2, r2, #1
	str	r3, [r1, #4]!
	ldr	r3, [r0]
	cmp	r3, r2
	bgt	.L14
.L13:
	mov	r1, #0
	mov	r2, #4
	str	r1, [r6, #16]
	ldr	r0, [r6, #12]
	bl	memset
	ldr	r1, [sp, #16]
	ldr	r2, [sp]
	ldr	r0, [r6, #12]
	bl	memcpy
	cmp	r8, #0
	ldrne	r1, [r8]
	ldreq	r1, [sp, #12]
	ldr	r0, [r6, #8]
	bl	IEEE80211_ADDR_COPY
	mov	r1, r6
	mov	r0, r5
	bl	ieee80211_crypto_setkey
	cmp	r0, #0
	bne	.L17
	ldr	r3, .L33+24
	ldr	r4, [r3]
	b	.L18
.L29:
	ldr	r3, .L33+28
	ldr	r4, [r3]
	b	.L1
.L11:
	ldr	r3, .L33+32
	ldr	r4, [r3]
.L18:
	mov	r0, r5
	bl	ieee80211_key_update_end
	cmp	r8, #0
	beq	.L1
	mov	r0, r8
	bl	ieee80211_free_node
	b	.L1
.L30:
	ldr	r2, .L33+36
	ldr	r3, .L33+40
	ldr	r1, [r2]
	ldr	r3, [r3]
	ldr	r2, [sp, #8]
	orr	r3, r3, r1
	cmp	r2, r3
	bne	.L10
	ldr	r3, .L33+44
	ldr	r2, [r5]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L31
	mov	r1, r5
	ldr	r2, [sp, #12]
	ldr	r0, [r5, #8]
	bl	ieee80211_find_vap_node
	subs	r8, r0, #0
	beq	.L32
.L8:
	add	r6, r8, #4
	b	.L9
.L17:
	ldr	r2, .L33+48
	ldr	r3, [sp, #8]
	ldr	r2, [r2]
	ands	r3, r3, r2
	moveq	r4, r3
	beq	.L18
	mov	r1, r7
	mov	r0, r5
	bl	ieee80211_crypto_set_deftxkey
	b	.L18
.L31:
	ldr	r0, [r5, #12]
	bl	ieee80211_ref_node
	mov	r8, r0
	ldr	r0, [sp, #12]
	ldr	r1, [r8, #28]
	bl	IEEE80211_ADDR_EQ
	cmp	r0, #0
	bne	.L8
	mov	r0, r8
	bl	ieee80211_free_node
	ldr	r3, .L33+52
	ldr	r4, [r3]
	b	.L1
.L32:
	ldr	r3, .L33+56
	ldr	r4, [r3]
	b	.L1
.L28:
	bl	__stack_chk_fail
.L34:
	.align	2
.L33:
	.word	.LC0
	.word	EINVAL
	.word	IEEE80211_KEYIX_NONE
	.word	IEEE80211_WEP_NKID
	.word	IEEE80211_KEYBUF_SIZE
	.word	IEEE80211_TID_SIZE
	.word	EIO
	.word	E2BIG
	.word	ENXIO
	.word	IEEE80211_KEY_RECV
	.word	IEEE80211_KEY_XMIT
	.word	IEEE80211_M_STA
	.word	IEEE80211_KEY_DEFAULT
	.word	EADDRNOTAVAIL
	.word	ENOENT
	.size	ieee80211_ioctl_setkey, .-ieee80211_ioctl_setkey
	.comm	IEEE80211_WEP_NKID,4,4
	.comm	IEEE80211_TID_SIZE,4,4
	.comm	IEEE80211_M_STA,4,4
	.comm	IEEE80211_KEY_XMIT,4,4
	.comm	IEEE80211_KEY_RECV,4,4
	.comm	IEEE80211_KEY_DEFAULT,4,4
	.comm	IEEE80211_KEYIX_NONE,4,4
	.comm	IEEE80211_KEYBUF_SIZE,4,4
	.comm	ENXIO,4,4
	.comm	ENOENT,4,4
	.comm	EIO,4,4
	.comm	EINVAL,4,4
	.comm	EADDRNOTAVAIL,4,4
	.comm	E2BIG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
