	.file	"extr_3945-mac.c_il3945_request_scan.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Fail to allocate scan memory\n"
.LC1:
	.string	"Scanning while associated...\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"suspend_time 0x%X beacon interval %d\n"
	.section	.rodata.str1.1
.LC3:
	.string	"Kicking off active scan\n"
.LC4:
	.string	"Kicking off passive scan.\n"
.LC5:
	.string	"Invalid scan band\n"
.LC6:
	.string	"channel count %d\n"
	.text
	.p2align 4
	.globl	il3945_request_scan
	.type	il3945_request_scan, @function
il3945_request_scan:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pxor	xmm0, xmm0
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	add	rdi, 32
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	mov	eax, DWORD PTR CMD_SIZE_HUGE[rip]
	movaps	XMMWORD PTR 16[rsp], xmm0
	mov	DWORD PTR 16[rsp], 88
	mov	DWORD PTR 32[rsp], eax
	mov	eax, DWORD PTR C_SCAN[rip]
	mov	DWORD PTR 36[rsp], eax
	call	lockdep_assert_held@PLT
	mov	rbx, QWORD PTR 24[r12]
	test	rbx, rbx
	je	.L31
.L2:
	mov	rax, QWORD PTR IL_MAX_SCAN_SIZE[rip]
	xor	esi, esi
	mov	rdi, rbx
	lea	rdx, 88[rax]
	call	memset@PLT
	mov	eax, DWORD PTR IL_PLCP_QUIET_THRESH[rip]
	mov	rdi, r12
	mov	DWORD PTR 84[rbx], eax
	mov	eax, DWORD PTR IL_ACTIVE_QUIET_TIME[rip]
	mov	DWORD PTR 80[rbx], eax
	call	il_is_associated@PLT
	test	rax, rax
	jne	.L32
.L4:
	mov	rax, QWORD PTR 8[r12]
	mov	r15d, DWORD PTR [rax]
	test	r15d, r15d
	jne	.L33
	lea	rdi, .LC4[rip]
	xor	eax, eax
	xor	r14d, r14d
	call	D_SCAN@PLT
.L7:
	mov	eax, DWORD PTR TX_CMD_FLG_SEQ_CTL_MSK[rip]
	mov	r10d, DWORD PTR [r12]
	mov	DWORD PTR 36[rbx], eax
	mov	eax, DWORD PTR 16[r12]
	mov	DWORD PTR 32[rbx], eax
	mov	eax, DWORD PTR TX_CMD_LIFE_TIME_INFINITE[rip]
	mov	DWORD PTR 28[rbx], eax
	cmp	r10d, 128
	je	.L10
	cmp	r10d, 129
	jne	.L11
	mov	eax, DWORD PTR RXON_FLG_BAND_24G_MSK[rip]
	or	eax, DWORD PTR RXON_FLG_AUTO_DETECT_MSK[rip]
	mov	DWORD PTR [rbx], eax
	mov	eax, DWORD PTR RATE_1M_PLCP[rip]
	mov	DWORD PTR 24[rbx], eax
.L12:
	test	r15d, r15d
	mov	eax, DWORD PTR IL_GOOD_CRC_TH_DEFAULT[rip]
	mov	rsi, QWORD PTR 40[rbx]
	mov	rdi, r12
	cmove	eax, DWORD PTR IL_GOOD_CRC_TH_NEVER[rip]
	mov	rdx, QWORD PTR IL_MAX_SCAN_SIZE[rip]
	mov	DWORD PTR 12[rsp], r10d
	mov	DWORD PTR 48[rbx], eax
	mov	rax, QWORD PTR 8[r12]
	lea	r9, -88[rdx]
	mov	edx, DWORD PTR 0[r13]
	mov	ecx, DWORD PTR 8[rax]
	mov	r8d, DWORD PTR 4[rax]
	call	il_fill_probe_req@PLT
	movsx	rbp, eax
	mov	edi, ebp
	call	cpu_to_le16@PLT
	mov	rdi, r12
	mov	QWORD PTR 16[rbx], rax
	call	il3945_get_antenna_flags@PLT
	or	DWORD PTR [rbx], eax
	mov	r10d, DWORD PTR 12[rsp]
	mov	r9, r13
	mov	rax, QWORD PTR 40[rbx]
	mov	rcx, r14
	mov	edx, r15d
	mov	rdi, r12
	mov	esi, r10d
	lea	r8, [rax+rbp*4]
	call	il3945_get_channels_for_scan@PLT
	mov	DWORD PTR 4[rbx], eax
	test	eax, eax
	je	.L34
	mov	rdi, QWORD PTR 16[rbx]
	lea	rbp, 4[r12]
	call	le16_to_cpu@PLT
	movsx	rdx, DWORD PTR 4[rbx]
	mov	QWORD PTR 24[rsp], rbx
	lea	rdi, [rax+rdx*4]
	add	edi, DWORD PTR 16[rsp]
	mov	DWORD PTR 16[rsp], edi
	call	cpu_to_le16@PLT
	mov	edi, DWORD PTR S_SCAN_HW[rip]
	mov	rsi, rbp
	mov	QWORD PTR 8[rbx], rax
	call	set_bit@PLT
	mov	rdi, r12
	lea	rsi, 16[rsp]
	call	il_send_cmd_sync@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L35
.L1:
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L36
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	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
	ret
	.p2align 4,,10
	.p2align 3
.L33:
	.cfi_restore_state
	lea	rdi, .LC3[rip]
	xor	eax, eax
	call	D_SCAN@PLT
	mov	rcx, QWORD PTR 8[r12]
	mov	eax, DWORD PTR [rcx]
	test	eax, eax
	jle	.L18
	xor	ebp, ebp
	xor	r15d, r15d
	xor	r14d, r14d
	.p2align 4,,10
	.p2align 3
.L9:
	mov	rax, rbp
	sal	rax, 4
	add	rax, QWORD PTR 16[rcx]
	mov	rdx, QWORD PTR [rax]
	test	rdx, rdx
	je	.L8
	movsx	rcx, r15d
	add	r14, 1
	add	r15d, 1
	lea	rsi, [rcx+rcx*2]
	mov	rcx, QWORD PTR 56[rbx]
	lea	rcx, [rcx+rsi*8]
	mov	esi, DWORD PTR WLAN_EID_SSID[rip]
	mov	QWORD PTR 8[rcx], rdx
	mov	edi, DWORD PTR [rcx]
	mov	DWORD PTR 16[rcx], esi
	mov	esi, DWORD PTR 8[rax]
	call	memcpy@PLT
	mov	rcx, QWORD PTR 8[r12]
.L8:
	add	rbp, 1
	cmp	DWORD PTR [rcx], ebp
	jg	.L9
	mov	r15d, 1
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L11:
	lea	rdi, .LC5[rip]
	call	IL_WARN@PLT
	mov	r12d, DWORD PTR EIO[rip]
	neg	r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L10:
	mov	eax, DWORD PTR RATE_6M_PLCP[rip]
	mov	DWORD PTR 24[rbx], eax
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L32:
	lea	rdi, .LC1[rip]
	call	D_INFO@PLT
	mov	r14d, DWORD PTR 4[r13]
	mov	edi, 204800
	mov	QWORD PTR 64[rbx], 0
	call	cpu_to_le32@PLT
	mov	QWORD PTR 72[rbx], rax
	test	r14d, r14d
	je	.L17
	mov	eax, 100
	cdq
	idiv	r14d
	sal	edx, 10
	sal	eax, 24
	or	edx, eax
	mov	ebp, edx
.L5:
	mov	edi, ebp
	call	cpu_to_le32@PLT
	mov	edx, r14d
	mov	esi, ebp
	lea	rdi, .LC2[rip]
	mov	QWORD PTR 64[rbx], rax
	xor	eax, eax
	call	D_SCAN@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L31:
	mov	rax, QWORD PTR IL_MAX_SCAN_SIZE[rip]
	mov	esi, DWORD PTR GFP_KERNEL[rip]
	lea	rdi, 88[rax]
	call	kmalloc@PLT
	mov	QWORD PTR 24[r12], rax
	mov	rbx, rax
	test	rax, rax
	jne	.L2
	lea	rdi, .LC0[rip]
	xor	eax, eax
	call	D_SCAN@PLT
	mov	r12d, DWORD PTR ENOMEM[rip]
	neg	r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L34:
	xor	esi, esi
	lea	rdi, .LC6[rip]
	call	D_SCAN@PLT
	mov	r12d, DWORD PTR EIO[rip]
	neg	r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L17:
	mov	ebp, 16777216
	mov	r14d, 100
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L35:
	mov	edi, DWORD PTR S_SCAN_HW[rip]
	mov	rsi, rbp
	call	clear_bit@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L18:
	mov	r15d, 1
	xor	r14d, r14d
	jmp	.L7
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	il3945_request_scan, .-il3945_request_scan
	.comm	WLAN_EID_SSID,4,4
	.comm	TX_CMD_LIFE_TIME_INFINITE,4,4
	.comm	TX_CMD_FLG_SEQ_CTL_MSK,4,4
	.comm	S_SCAN_HW,4,4
	.comm	RXON_FLG_BAND_24G_MSK,4,4
	.comm	RXON_FLG_AUTO_DETECT_MSK,4,4
	.comm	RATE_6M_PLCP,4,4
	.comm	RATE_1M_PLCP,4,4
	.comm	IL_PLCP_QUIET_THRESH,4,4
	.comm	IL_MAX_SCAN_SIZE,8,8
	.comm	IL_GOOD_CRC_TH_NEVER,4,4
	.comm	IL_GOOD_CRC_TH_DEFAULT,4,4
	.comm	IL_ACTIVE_QUIET_TIME,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	EIO,4,4
	.comm	C_SCAN,4,4
	.comm	CMD_SIZE_HUGE,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_3945-mac.c_il3945_request_scan.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Fail to allocate scan memory\012\000"
	.align	2
.LC1:
	.ascii	"Scanning while associated...\012\000"
	.global	__aeabi_idivmod
	.global	__aeabi_idiv
	.align	2
.LC2:
	.ascii	"suspend_time 0x%X beacon interval %d\012\000"
	.align	2
.LC3:
	.ascii	"Kicking off active scan\012\000"
	.align	2
.LC4:
	.ascii	"Kicking off passive scan.\012\000"
	.align	2
.LC5:
	.ascii	"Invalid scan band\012\000"
	.align	2
.LC6:
	.ascii	"channel count %d\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	il3945_request_scan
	.syntax unified
	.arm
	.fpu softvfp
	.type	il3945_request_scan, %function
il3945_request_scan:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r6, r0
	mov	r2, #0
	mov	r3, #60
	ldr	ip, .L39
	ldr	r0, .L39+4
	ldr	lr, [ip]
	mov	r8, r1
	ldr	ip, [r0]
	ldr	r1, .L39+8
	sub	sp, sp, #36
	add	r0, r6, #20
	ldr	r1, [r1]
	str	r1, [sp, #28]
	mov	r1,#0
	str	lr, [sp, #20]
	str	ip, [sp, #24]
	str	r2, [sp, #16]
	str	r3, [sp, #12]
	bl	lockdep_assert_held
	ldr	r5, [r6, #16]
	ldr	r9, .L39+12
	cmp	r5, #0
	beq	.L30
.L2:
	ldr	r2, [r9]
	mov	r1, #0
	add	r2, r2, #60
	mov	r0, r5
	bl	memset
	ldr	r2, .L39+16
	ldr	r3, .L39+20
	ldr	r2, [r2]
	ldr	r3, [r3]
	mov	r0, r6
	str	r2, [r5, #56]
	str	r3, [r5, #52]
	bl	il_is_associated
	cmp	r0, #0
	bne	.L33
.L4:
	ldr	r3, [r6, #8]
	ldr	r7, [r3]
	cmp	r7, #0
	bne	.L34
	ldr	r0, .L39+24
	bl	D_SCAN
	mov	r10, r7
.L7:
	ldr	r3, .L39+28
	ldr	r2, .L39+32
	ldr	r3, [r3]
	ldr	r4, [r6]
	ldr	r2, [r2]
	str	r3, [r5, #28]
	ldr	r3, [r6, #12]
	cmp	r4, #128
	str	r2, [r5, #20]
	str	r3, [r5, #24]
	beq	.L10
	cmp	r4, #129
	bne	.L11
	ldr	r3, .L39+36
	ldr	r1, .L39+40
	ldr	r2, .L39+44
	ldr	r3, [r3]
	ldr	r1, [r1]
	ldr	r2, [r2]
	orr	r3, r3, r1
	str	r3, [r5]
	str	r2, [r5, #16]
.L12:
	cmp	r10, #0
	ldrne	r3, .L39+48
	ldreq	r3, .L39+52
	ldr	r2, [r9]
	ldr	r0, [r6, #8]
	ldr	r3, [r3]
	sub	r2, r2, #60
	ldr	r1, [r5, #32]
	str	r3, [r5, #36]
	ldr	r3, [r0, #8]
	str	r2, [sp, #4]
	ldr	r2, [r0, #4]
	mov	r0, r6
	str	r2, [sp]
	ldr	r2, [r8]
	bl	il_fill_probe_req
	mov	r9, r0
	bl	cpu_to_le16
	mov	r3, r0
	mov	r0, r6
	str	r3, [r5, #12]
	bl	il3945_get_antenna_flags
	ldr	r2, [r5]
	mov	r3, r7
	orr	r2, r2, r0
	str	r2, [r5]
	str	r8, [sp, #4]
	ldr	r1, [r5, #32]
	mov	r2, r10
	add	r0, r1, r9, lsl #2
	str	r0, [sp]
	mov	r1, r4
	mov	r0, r6
	bl	il3945_get_channels_for_scan
	cmp	r0, #0
	str	r0, [r5, #4]
	beq	.L35
	ldr	r0, [r5, #12]
	bl	le16_to_cpu
	ldr	r2, [r5, #4]
	ldr	r3, [sp, #12]
	str	r5, [sp, #16]
	add	r3, r3, r2, lsl #2
	add	r0, r3, r0
	str	r0, [sp, #12]
	bl	cpu_to_le16
	ldr	r7, .L39+56
	add	r8, r6, #4
	mov	r1, r8
	str	r0, [r5, #8]
	ldr	r0, [r7]
	bl	set_bit
	mov	r0, r6
	add	r1, sp, #12
	bl	il_send_cmd_sync
	subs	r4, r0, #0
	bne	.L36
.L1:
	ldr	r3, .L39+8
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L37
	mov	r0, r4
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L34:
	ldr	r0, .L39+60
	bl	D_SCAN
	ldr	r1, [r6, #8]
	ldr	r3, [r1]
	cmp	r3, #0
	ble	.L18
	mov	r4, #0
	mov	r7, r4
	ldr	r10, .L39+64
.L9:
	ldr	r3, [r1, #12]
	ldr	r2, [r3, r4, lsl #3]
	add	r3, r3, r4, lsl #3
	cmp	r2, #0
	beq	.L8
	ldr	r0, [r5, #40]
	add	fp, r7, r7, lsl #1
	ldr	lr, [r10]
	add	ip, r0, fp, lsl #2
	ldr	r1, [r3, #4]
	ldr	r0, [r0, fp, lsl #2]
	str	r2, [ip, #4]
	str	lr, [ip, #8]
	bl	memcpy
	ldr	r1, [r6, #8]
	add	r7, r7, #1
.L8:
	ldr	r3, [r1]
	add	r4, r4, #1
	cmp	r3, r4
	bgt	.L9
	mov	r10, #1
	b	.L7
.L11:
	ldr	r0, .L39+68
	bl	IL_WARN
	ldr	r3, .L39+72
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L1
.L10:
	ldr	r3, .L39+76
	ldr	r3, [r3]
	str	r3, [r5, #16]
	b	.L12
.L33:
	ldr	r0, .L39+80
	bl	D_INFO
	mov	r3, #0
	ldr	r7, [r8, #4]
	mov	r0, #204800
	str	r3, [r5, #44]
	bl	cpu_to_le32
	cmp	r7, #0
	moveq	r4, #16777216
	moveq	r7, #100
	str	r0, [r5, #48]
	bne	.L38
.L5:
	mov	r0, r4
	bl	cpu_to_le32
	mov	r2, r7
	str	r0, [r5, #44]
	mov	r1, r4
	ldr	r0, .L39+84
	bl	D_SCAN
	b	.L4
.L30:
	ldr	r3, .L39+88
	ldr	r0, [r9]
	ldr	r1, [r3]
	add	r0, r0, #60
	bl	kmalloc
	cmp	r0, #0
	mov	r5, r0
	str	r0, [r6, #16]
	bne	.L2
	ldr	r0, .L39+92
	bl	D_SCAN
	ldr	r3, .L39+96
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L1
.L35:
	mov	r1, r0
	ldr	r0, .L39+100
	bl	D_SCAN
	ldr	r3, .L39+72
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L1
.L38:
	mov	r1, r7
	mov	r0, #100
	bl	__aeabi_idivmod
	mov	r0, #100
	mov	r4, r1
	mov	r1, r7
	bl	__aeabi_idiv
	lsl	r4, r4, #10
	orr	r4, r4, r0, lsl #24
	b	.L5
.L36:
	mov	r1, r8
	ldr	r0, [r7]
	bl	clear_bit
	b	.L1
.L18:
	mov	r10, #1
	mov	r7, #0
	b	.L7
.L37:
	bl	__stack_chk_fail
.L40:
	.align	2
.L39:
	.word	CMD_SIZE_HUGE
	.word	C_SCAN
	.word	.LC7
	.word	IL_MAX_SCAN_SIZE
	.word	IL_PLCP_QUIET_THRESH
	.word	IL_ACTIVE_QUIET_TIME
	.word	.LC4
	.word	TX_CMD_FLG_SEQ_CTL_MSK
	.word	TX_CMD_LIFE_TIME_INFINITE
	.word	RXON_FLG_BAND_24G_MSK
	.word	RXON_FLG_AUTO_DETECT_MSK
	.word	RATE_1M_PLCP
	.word	IL_GOOD_CRC_TH_DEFAULT
	.word	IL_GOOD_CRC_TH_NEVER
	.word	S_SCAN_HW
	.word	.LC3
	.word	WLAN_EID_SSID
	.word	.LC5
	.word	EIO
	.word	RATE_6M_PLCP
	.word	.LC1
	.word	.LC2
	.word	GFP_KERNEL
	.word	.LC0
	.word	ENOMEM
	.word	.LC6
	.size	il3945_request_scan, .-il3945_request_scan
	.comm	WLAN_EID_SSID,4,4
	.comm	TX_CMD_LIFE_TIME_INFINITE,4,4
	.comm	TX_CMD_FLG_SEQ_CTL_MSK,4,4
	.comm	S_SCAN_HW,4,4
	.comm	RXON_FLG_BAND_24G_MSK,4,4
	.comm	RXON_FLG_AUTO_DETECT_MSK,4,4
	.comm	RATE_6M_PLCP,4,4
	.comm	RATE_1M_PLCP,4,4
	.comm	IL_PLCP_QUIET_THRESH,4,4
	.comm	IL_MAX_SCAN_SIZE,4,4
	.comm	IL_GOOD_CRC_TH_NEVER,4,4
	.comm	IL_GOOD_CRC_TH_DEFAULT,4,4
	.comm	IL_ACTIVE_QUIET_TIME,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	EIO,4,4
	.comm	C_SCAN,4,4
	.comm	CMD_SIZE_HUGE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
