	.file	"extr_ipw2100.c_shim__set_security.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Security flags: %c %c%c%c%c %c%c%c%c\n"
	.text
	.p2align 4
	.type	shim__set_security, @function
shim__set_security:
.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
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	call	libipw_priv@PLT
	lea	r13, 4[rax]
	mov	rbp, rax
	mov	rdi, r13
	call	mutex_lock@PLT
	mov	eax, DWORD PTR 0[rbp]
	test	DWORD PTR STATUS_INITIALIZED[rip], eax
	je	.L3
	mov	edx, DWORD PTR [r12]
	mov	rax, QWORD PTR 8[rbp]
	xor	ebx, ebx
	mov	r15d, 1
.L8:
	bt	edx, ebx
	jnc	.L4
	mov	rcx, QWORD PTR 8[r12]
	mov	rsi, QWORD PTR [rax]
	mov	r14d, r15d
	lea	rcx, [rcx+rbx*8]
	mov	rdi, QWORD PTR [rcx]
	mov	QWORD PTR [rsi+rbx*8], rdi
	mov	r8, QWORD PTR [rcx]
	mov	ecx, ebx
	sal	r14d, cl
	test	r8, r8
	jne	.L5
	mov	ecx, r14d
	not	ecx
	and	ecx, DWORD PTR 8[rax]
	mov	DWORD PTR 8[rax], ecx
.L6:
	mov	rdi, QWORD PTR SEC_LEVEL_1[rip]
	cmp	QWORD PTR 16[r12], rdi
	je	.L52
	not	r14d
	and	r14d, ecx
	mov	DWORD PTR 8[rax], r14d
.L4:
	add	rbx, 1
	cmp	rbx, 4
	jne	.L8
	mov	esi, DWORD PTR SEC_ACTIVE_KEY[rip]
	mov	ecx, DWORD PTR 8[rax]
	test	esi, edx
	je	.L9
	mov	rdi, QWORD PTR 24[r12]
	cmp	QWORD PTR 16[rax], rdi
	je	.L9
	or	ecx, esi
	mov	QWORD PTR 16[rax], rdi
	mov	esi, DWORD PTR STATUS_SECURITY_UPDATED[rip]
	mov	DWORD PTR 8[rax], ecx
	or	DWORD PTR 0[rbp], esi
.L9:
	mov	esi, DWORD PTR SEC_AUTH_MODE[rip]
	test	esi, edx
	je	.L10
	mov	rdi, QWORD PTR 32[r12]
	cmp	QWORD PTR 24[rax], rdi
	je	.L10
	or	ecx, esi
	mov	QWORD PTR 24[rax], rdi
	mov	esi, DWORD PTR STATUS_SECURITY_UPDATED[rip]
	mov	DWORD PTR 8[rax], ecx
	or	DWORD PTR 0[rbp], esi
.L10:
	mov	esi, DWORD PTR SEC_ENABLED[rip]
	test	esi, edx
	je	.L11
	mov	rdi, QWORD PTR 40[r12]
	cmp	QWORD PTR 32[rax], rdi
	je	.L11
	or	ecx, esi
	mov	QWORD PTR 32[rax], rdi
	mov	esi, DWORD PTR STATUS_SECURITY_UPDATED[rip]
	mov	DWORD PTR 8[rax], ecx
	or	DWORD PTR 0[rbp], esi
.L11:
	test	DWORD PTR SEC_ENCRYPT[rip], edx
	je	.L12
	mov	esi, DWORD PTR 48[r12]
	mov	DWORD PTR 48[rax], esi
.L12:
	mov	esi, DWORD PTR SEC_LEVEL[rip]
	test	esi, edx
	je	.L13
	mov	rdx, QWORD PTR 16[r12]
	cmp	QWORD PTR 40[rax], rdx
	je	.L13
	or	ecx, esi
	mov	QWORD PTR 40[rax], rdx
	mov	DWORD PTR 8[rax], ecx
	mov	eax, DWORD PTR STATUS_SECURITY_UPDATED[rip]
	or	DWORD PTR 0[rbp], eax
.L13:
	mov	r9d, ecx
	xor	r8d, r8d
	mov	edx, ecx
	and	r9d, 1
	add	r9d, 48
	test	cl, 2
	setne	r8b
	xor	edi, edi
	push	r9
	.cfi_def_cfa_offset 72
	add	r8d, 48
	test	cl, 4
	setne	dil
	xor	eax, eax
	push	r8
	.cfi_def_cfa_offset 80
	add	edi, 48
	test	cl, 8
	setne	al
	xor	ebx, ebx
	push	rdi
	.cfi_def_cfa_offset 88
	lea	rdi, .LC0[rip]
	add	eax, 48
	test	cl, 16
	setne	bl
	xor	r11d, r11d
	test	cl, 32
	push	rax
	.cfi_def_cfa_offset 96
	setne	r11b
	xor	r10d, r10d
	lea	r9d, 48[rbx]
	test	cl, 64
	setne	r10b
	shr	dl, 7
	xor	esi, esi
	lea	r8d, 48[r11]
	movzx	edx, dl
	add	r10d, 48
	add	edx, 48
	and	ch, 1
	mov	ecx, r10d
	setne	sil
	add	esi, 48
	call	IPW_DEBUG_WEP@PLT
	mov	eax, DWORD PTR STATUS_ASSOCIATED[rip]
	add	rsp, 32
	.cfi_def_cfa_offset 64
	or	eax, DWORD PTR STATUS_ASSOCIATING[rip]
	test	DWORD PTR 0[rbp], eax
	je	.L53
.L3:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rdi, r13
	pop	rbx
	.cfi_def_cfa_offset 48
	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
	jmp	mutex_unlock@PLT
	.p2align 4,,10
	.p2align 3
.L53:
	.cfi_restore_state
	xor	esi, esi
	mov	rdi, rbp
	call	ipw2100_configure_security@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L52:
	or	r14d, ecx
	mov	ecx, DWORD PTR STATUS_SECURITY_UPDATED[rip]
	mov	DWORD PTR 8[rax], r14d
	or	DWORD PTR 0[rbp], ecx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rdx, QWORD PTR 56[r12]
	mov	rax, QWORD PTR 56[rax]
	mov	esi, DWORD PTR [rdx+rbx*4]
	mov	edi, DWORD PTR [rax+rbx*4]
	mov	rdx, r8
	call	memcpy@PLT
	mov	rax, QWORD PTR 8[rbp]
	mov	edx, DWORD PTR [r12]
	mov	ecx, DWORD PTR 8[rax]
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	shim__set_security, .-shim__set_security
	.comm	STATUS_SECURITY_UPDATED,4,4
	.comm	STATUS_INITIALIZED,4,4
	.comm	STATUS_ASSOCIATING,4,4
	.comm	STATUS_ASSOCIATED,4,4
	.comm	SEC_LEVEL_1,8,8
	.comm	SEC_LEVEL,4,4
	.comm	SEC_ENCRYPT,4,4
	.comm	SEC_ENABLED,4,4
	.comm	SEC_AUTH_MODE,4,4
	.comm	SEC_ACTIVE_KEY,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_ipw2100.c_shim__set_security.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Security flags: %c %c%c%c%c %c%c%c%c\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	shim__set_security, %function
shim__set_security:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #28
	mov	r6, r1
	bl	libipw_priv
	mov	r5, r0
	add	r7, r0, #4
	mov	r0, r7
	bl	mutex_lock
	ldr	r3, .L53
	ldr	r2, [r5]
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L3
	mov	r4, #0
	mov	r10, #1
	ldr	r1, [r6]
	ldr	r3, [r5, #8]
	ldr	r9, .L53+4
	ldr	fp, .L53+8
.L8:
	asr	r2, r1, r4
	tst	r2, #1
	beq	.L4
	ldr	r2, [r6, #4]
	ldr	r0, [r3]
	ldr	ip, [r2, r4, lsl #2]
	lsl	r8, r10, r4
	str	ip, [r0, r4, lsl #2]
	ldr	r2, [r2, r4, lsl #2]
	cmp	r2, #0
	bne	.L5
	ldr	r2, [r3, #4]
	bic	r2, r2, r8
	str	r2, [r3, #4]
.L6:
	ldr	ip, [r6, #8]
	ldr	r0, [r9]
	bic	lr, r2, r8
	cmp	ip, r0
	ldreq	r0, [r5]
	orreq	r8, r2, r8
	ldreq	r2, [fp]
	streq	r8, [r3, #4]
	orreq	r2, r0, r2
	streq	r2, [r5]
	strne	lr, [r3, #4]
.L4:
	add	r4, r4, #1
	cmp	r4, #4
	bne	.L8
	ldr	r2, .L53+12
	ldr	ip, [r3, #4]
	ldr	r2, [r2]
	tst	r2, r1
	beq	.L9
	ldr	r0, [r6, #12]
	ldr	lr, [r3, #8]
	cmp	lr, r0
	beq	.L9
	ldr	lr, .L53+8
	orr	ip, ip, r2
	ldr	lr, [lr]
	ldr	r2, [r5]
	str	ip, [r3, #4]
	orr	r2, r2, lr
	str	r0, [r3, #8]
	str	r2, [r5]
.L9:
	ldr	r2, .L53+16
	ldr	r2, [r2]
	tst	r2, r1
	beq	.L10
	ldr	r0, [r6, #16]
	ldr	lr, [r3, #12]
	cmp	lr, r0
	beq	.L10
	ldr	lr, .L53+8
	orr	ip, ip, r2
	ldr	lr, [lr]
	ldr	r2, [r5]
	str	ip, [r3, #4]
	orr	r2, r2, lr
	str	r0, [r3, #12]
	str	r2, [r5]
.L10:
	ldr	r2, .L53+20
	ldr	r2, [r2]
	tst	r2, r1
	beq	.L11
	ldr	r0, [r6, #20]
	ldr	lr, [r3, #16]
	cmp	lr, r0
	beq	.L11
	ldr	lr, .L53+8
	orr	ip, ip, r2
	ldr	lr, [lr]
	ldr	r2, [r5]
	str	ip, [r3, #4]
	orr	r2, r2, lr
	str	r0, [r3, #16]
	str	r2, [r5]
.L11:
	ldr	r2, .L53+24
	ldr	r2, [r2]
	tst	r1, r2
	ldrne	r2, [r6, #24]
	strne	r2, [r3, #24]
	ldr	r2, .L53+28
	ldr	r2, [r2]
	tst	r2, r1
	beq	.L13
	ldr	r1, [r6, #8]
	ldr	r0, [r3, #20]
	cmp	r0, r1
	beq	.L13
	ldr	r0, .L53+8
	orr	ip, ip, r2
	ldr	r0, [r0]
	ldr	r2, [r5]
	str	ip, [r3, #4]
	orr	r2, r2, r0
	str	r1, [r3, #20]
	str	r2, [r5]
.L13:
	tst	ip, #256
	movne	r1, #49
	moveq	r1, #48
	tst	ip, #128
	movne	r2, #49
	moveq	r2, #48
	tst	ip, #64
	movne	r3, #49
	moveq	r3, #48
	tst	ip, #32
	movne	r8, #49
	moveq	r8, #48
	tst	ip, #16
	movne	r6, #49
	moveq	r6, #48
	tst	ip, #8
	movne	r4, #49
	moveq	r4, #48
	tst	ip, #4
	movne	lr, #49
	moveq	lr, #48
	tst	ip, #2
	movne	r0, #49
	moveq	r0, #48
	and	ip, ip, #1
	add	ip, ip, #48
	str	r0, [sp, #16]
	str	r8, [sp]
	ldr	r0, .L53+32
	str	r6, [sp, #4]
	str	r4, [sp, #8]
	str	lr, [sp, #12]
	str	ip, [sp, #20]
	bl	IPW_DEBUG_WEP
	ldr	r2, .L53+36
	ldr	r3, .L53+40
	ldr	r1, [r2]
	ldr	r2, [r3]
	ldr	r3, [r5]
	orr	r1, r1, r2
	ands	r1, r1, r3
	beq	.L52
.L3:
	mov	r0, r7
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	mutex_unlock
.L52:
	mov	r0, r5
	bl	ipw2100_configure_security
	mov	r0, r7
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	mutex_unlock
.L5:
	ldr	r1, [r3, #28]
	ldr	r3, [r6, #28]
	ldr	r0, [r1, r4, lsl #2]
	ldr	r1, [r3, r4, lsl #2]
	bl	memcpy
	ldr	r3, [r5, #8]
	ldr	r1, [r6]
	ldr	r2, [r3, #4]
	b	.L6
.L54:
	.align	2
.L53:
	.word	STATUS_INITIALIZED
	.word	SEC_LEVEL_1
	.word	STATUS_SECURITY_UPDATED
	.word	SEC_ACTIVE_KEY
	.word	SEC_AUTH_MODE
	.word	SEC_ENABLED
	.word	SEC_ENCRYPT
	.word	SEC_LEVEL
	.word	.LC0
	.word	STATUS_ASSOCIATED
	.word	STATUS_ASSOCIATING
	.size	shim__set_security, .-shim__set_security
	.comm	STATUS_SECURITY_UPDATED,4,4
	.comm	STATUS_INITIALIZED,4,4
	.comm	STATUS_ASSOCIATING,4,4
	.comm	STATUS_ASSOCIATED,4,4
	.comm	SEC_LEVEL_1,4,4
	.comm	SEC_LEVEL,4,4
	.comm	SEC_ENCRYPT,4,4
	.comm	SEC_ENABLED,4,4
	.comm	SEC_AUTH_MODE,4,4
	.comm	SEC_ACTIVE_KEY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
