	.file	"extr_blufi_example_main.c_wifi_event_handler.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Nothing AP found"
.LC1:
	.string	"malloc error, ap_list is NULL"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"malloc error, blufi_ap_list is NULL"
	.text
	.p2align 4
	.type	wifi_event_handler, @function
wifi_event_handler:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	add	edx, -128
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	sub	rsp, 16
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	cmp	edx, 4
	ja	.L1
	mov	rbx, rcx
	lea	rcx, .L4[rip]
	movsx	rax, DWORD PTR [rcx+rdx*4]
	add	rax, rcx
	notrack jmp	rax
	.section	.rodata
	.align 4
	.align 4
.L4:
	.long	.L8-.L4
	.long	.L7-.L4
	.long	.L6-.L4
	.long	.L5-.L4
	.long	.L3-.L4
	.text
	.p2align 4,,10
	.p2align 3
.L3:
	lea	rdi, 4[rsp]
	call	esp_wifi_get_mode@PLT
	mov	eax, DWORD PTR gl_sta_connected[rip]
	xor	ecx, ecx
	xor	edx, edx
	test	eax, eax
	je	.L9
	mov	esi, DWORD PTR ESP_BLUFI_STA_CONN_SUCCESS[rip]
	mov	edi, DWORD PTR 4[rsp]
	call	esp_blufi_send_wifi_conn_report@PLT
	.p2align 4,,10
	.p2align 3
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L22
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	lea	rbp, 4[rsp]
	mov	DWORD PTR 4[rsp], 0
	mov	rdi, rbp
	call	esp_wifi_scan_get_ap_num@PLT
	mov	edi, DWORD PTR 4[rsp]
	test	edi, edi
	jne	.L10
	lea	rdi, .LC0[rip]
	call	BLUFI_INFO@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L7:
	mov	edi, DWORD PTR gl_sta_ssid[rip]
	xor	esi, esi
	mov	edx, 32
	mov	DWORD PTR gl_sta_connected[rip], 0
	call	memset@PLT
	mov	edi, DWORD PTR gl_sta_bssid[rip]
	xor	esi, esi
	mov	edx, 6
	call	memset@PLT
	xor	eax, eax
	mov	DWORD PTR gl_sta_ssid_len[rip], 0
	call	esp_wifi_connect@PLT
	mov	esi, DWORD PTR CONNECTED_BIT[rip]
	mov	edi, DWORD PTR wifi_event_group[rip]
	call	xEventGroupClearBits@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L8:
	xor	eax, eax
	call	esp_wifi_connect@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L6:
	mov	esi, DWORD PTR 8[rbx]
	mov	edi, DWORD PTR gl_sta_bssid[rip]
	mov	edx, 6
	mov	DWORD PTR gl_sta_connected[rip], 1
	call	memcpy@PLT
	mov	esi, DWORD PTR 4[rbx]
	mov	edx, DWORD PTR [rbx]
	mov	edi, DWORD PTR gl_sta_ssid[rip]
	call	memcpy@PLT
	mov	eax, DWORD PTR [rbx]
	mov	DWORD PTR gl_sta_ssid_len[rip], eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L9:
	mov	esi, DWORD PTR ESP_BLUFI_STA_CONN_FAIL[rip]
	mov	edi, DWORD PTR 4[rsp]
	call	esp_blufi_send_wifi_conn_report@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L10:
	sal	edi, 3
	call	malloc@PLT
	mov	r12, rax
	test	rax, rax
	je	.L23
	mov	rsi, rax
	mov	rdi, rbp
	call	esp_wifi_scan_get_ap_records@PLT
	mov	edi, eax
	call	ESP_ERROR_CHECK@PLT
	mov	eax, DWORD PTR 4[rsp]
	lea	edi, 0[0+rax*8]
	call	malloc@PLT
	mov	r14, rax
	test	rax, rax
	je	.L13
	mov	edi, DWORD PTR 4[rsp]
	mov	r13, rax
	mov	rbx, r12
	xor	ebp, ebp
	sub	r13, r12
	test	edi, edi
	jle	.L15
	.p2align 4,,10
	.p2align 3
.L16:
	mov	edx, DWORD PTR 4[rbx]
	lea	rax, 0[r13+rbx]
	mov	esi, DWORD PTR [rbx]
	add	ebp, 1
	mov	edi, DWORD PTR [rax]
	add	rbx, 8
	mov	DWORD PTR 4[rax], edx
	mov	edx, 4
	call	memcpy@PLT
	mov	edi, DWORD PTR 4[rsp]
	cmp	edi, ebp
	jg	.L16
.L15:
	mov	rsi, r14
	call	esp_blufi_send_wifi_list@PLT
	xor	eax, eax
	call	esp_wifi_scan_stop@PLT
	mov	rdi, r12
	call	free@PLT
	mov	rdi, r14
	call	free@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L23:
	lea	rdi, .LC1[rip]
	call	BLUFI_ERROR@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	mov	rdi, r12
	call	free@PLT
	lea	rdi, .LC2[rip]
	call	BLUFI_ERROR@PLT
	jmp	.L1
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	wifi_event_handler, .-wifi_event_handler
	.comm	wifi_event_group,4,4
	.comm	gl_sta_ssid_len,4,4
	.comm	gl_sta_ssid,4,4
	.comm	gl_sta_connected,4,4
	.comm	gl_sta_bssid,4,4
	.comm	ESP_BLUFI_STA_CONN_SUCCESS,4,4
	.comm	ESP_BLUFI_STA_CONN_FAIL,4,4
	.comm	CONNECTED_BIT,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_blufi_example_main.c_wifi_event_handler.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Nothing AP found\000"
	.align	2
.LC1:
	.ascii	"malloc error, ap_list is NULL\000"
	.align	2
.LC2:
	.ascii	"malloc error, blufi_ap_list is NULL\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	wifi_event_handler, %function
wifi_event_handler:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r3
	ldr	r3, .L23
	sub	sp, sp, #8
	sub	r2, r2, #128
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	cmp	r2, #4
	ldrls	pc, [pc, r2, asl #2]
	b	.L1
.L4:
	.word	.L8
	.word	.L7
	.word	.L6
	.word	.L5
	.word	.L3
.L5:
	mov	r5, #0
	mov	r0, sp
	str	r5, [sp]
	bl	esp_wifi_scan_get_ap_num
	ldr	r0, [sp]
	cmp	r0, r5
	bne	.L10
	ldr	r0, .L23+4
	bl	BLUFI_INFO
.L1:
	ldr	r3, .L23
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L21
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L3:
	mov	r0, sp
	bl	esp_wifi_get_mode
	ldr	r3, .L23+8
	ldr	r0, [sp]
	ldr	r3, [r3]
	cmp	r3, #0
	movne	r3, #0
	ldreq	r2, .L23+12
	ldrne	r1, .L23+16
	ldreq	r1, [r2]
	movne	r2, r3
	moveq	r2, r3
	ldrne	r1, [r1]
	bl	esp_blufi_send_wifi_conn_report
	b	.L1
.L8:
	bl	esp_wifi_connect
	b	.L1
.L7:
	mov	r4, #0
	ldr	r2, .L23+20
	ldr	r3, .L23+8
	mov	r1, r4
	ldr	r0, [r2]
	mov	r2, #32
	str	r4, [r3]
	bl	memset
	ldr	r3, .L23+24
	mov	r1, r4
	mov	r2, #6
	ldr	r0, [r3]
	bl	memset
	ldr	r3, .L23+28
	str	r4, [r3]
	bl	esp_wifi_connect
	ldr	r2, .L23+32
	ldr	r3, .L23+36
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	xEventGroupClearBits
	b	.L1
.L6:
	mov	ip, #1
	ldr	r2, .L23+24
	ldr	r3, .L23+8
	ldr	r0, [r2]
	ldr	r1, [r4, #8]
	mov	r2, #6
	str	ip, [r3]
	bl	memcpy
	ldr	r3, .L23+20
	ldr	r2, [r4]
	ldr	r0, [r3]
	ldr	r1, [r4, #4]
	bl	memcpy
	ldr	r2, [r4]
	ldr	r3, .L23+28
	str	r2, [r3]
	b	.L1
.L10:
	lsl	r0, r0, #3
	bl	malloc
	subs	r7, r0, #0
	beq	.L22
	mov	r1, r7
	mov	r0, sp
	bl	esp_wifi_scan_get_ap_records
	bl	ESP_ERROR_CHECK
	ldr	r0, [sp]
	lsl	r0, r0, #3
	bl	malloc
	subs	r8, r0, #0
	beq	.L13
	ldr	r0, [sp]
	cmp	r0, #0
	movgt	r4, r7
	subgt	r6, r8, r7
	ble	.L15
.L16:
	ldr	r2, [r4, #4]
	add	r3, r6, r4
	ldr	r1, [r4]
	ldr	r0, [r6, r4]
	str	r2, [r3, #4]
	mov	r2, #4
	bl	memcpy
	ldr	r0, [sp]
	add	r5, r5, #1
	cmp	r0, r5
	add	r4, r4, #8
	bgt	.L16
.L15:
	mov	r1, r8
	bl	esp_blufi_send_wifi_list
	bl	esp_wifi_scan_stop
	mov	r0, r7
	bl	free
	mov	r0, r8
	bl	free
	b	.L1
.L21:
	bl	__stack_chk_fail
.L13:
	mov	r0, r7
	bl	free
	ldr	r0, .L23+40
	bl	BLUFI_ERROR
	b	.L1
.L22:
	ldr	r0, .L23+44
	bl	BLUFI_ERROR
	b	.L1
.L24:
	.align	2
.L23:
	.word	.LC3
	.word	.LC0
	.word	gl_sta_connected
	.word	ESP_BLUFI_STA_CONN_FAIL
	.word	ESP_BLUFI_STA_CONN_SUCCESS
	.word	gl_sta_ssid
	.word	gl_sta_bssid
	.word	gl_sta_ssid_len
	.word	CONNECTED_BIT
	.word	wifi_event_group
	.word	.LC2
	.word	.LC1
	.size	wifi_event_handler, .-wifi_event_handler
	.comm	wifi_event_group,4,4
	.comm	gl_sta_ssid_len,4,4
	.comm	gl_sta_ssid,4,4
	.comm	gl_sta_connected,4,4
	.comm	gl_sta_bssid,4,4
	.comm	ESP_BLUFI_STA_CONN_SUCCESS,4,4
	.comm	ESP_BLUFI_STA_CONN_FAIL,4,4
	.comm	CONNECTED_BIT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
