	.file	"extr_esp_bt_main.c_esp_bluedroid_deinit.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Bluedroid already de-initialised\n"
	.align 8
.LC1:
	.string	"Bludroid already enabled, do disable first\n"
	.align 8
.LC2:
	.string	"Bluedroid de-initialise failed\n"
	.text
	.p2align 4
	.globl	esp_bluedroid_deinit
	.type	esp_bluedroid_deinit, @function
esp_bluedroid_deinit:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	sub	rsp, 32
	.cfi_def_cfa_offset 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	mov	eax, DWORD PTR bd_already_init[rip]
	test	eax, eax
	je	.L12
	cmp	QWORD PTR bd_already_enable[rip], 0
	jne	.L13
	mov	edi, DWORD PTR BTC_MAIN_DEINIT_FUTURE[rip]
	call	btc_main_get_future_p@PLT
	mov	rbx, rax
	xor	eax, eax
	call	future_new@PLT
	mov	QWORD PTR [rbx], rax
	test	rax, rax
	je	.L14
	mov	eax, DWORD PTR BTC_SIG_API_CALL[rip]
	xor	ecx, ecx
	xor	edx, edx
	xor	esi, esi
	lea	rdi, 12[rsp]
	mov	DWORD PTR 20[rsp], eax
	mov	eax, DWORD PTR BTC_PID_MAIN_INIT[rip]
	mov	DWORD PTR 16[rsp], eax
	mov	eax, DWORD PTR BTC_MAIN_ACT_DEINIT[rip]
	mov	DWORD PTR 12[rsp], eax
	call	btc_transfer_context@PLT
	cmp	rax, QWORD PTR BT_STATUS_SUCCESS[rip]
	jne	.L10
	mov	rdi, QWORD PTR [rbx]
	call	future_await@PLT
	cmp	rax, QWORD PTR FUTURE_FAIL[rip]
	je	.L10
	xor	eax, eax
	call	btc_deinit@PLT
	mov	eax, DWORD PTR ESP_OK[rip]
	mov	DWORD PTR bd_already_init[rip], 0
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L10:
	lea	rdi, .LC2[rip]
	call	LOG_ERROR@PLT
	mov	eax, DWORD PTR ESP_FAIL[rip]
.L1:
	mov	rdx, QWORD PTR 24[rsp]
	xor	rdx, QWORD PTR fs:40
	jne	.L15
	add	rsp, 32
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	pop	rbx
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	lea	rdi, .LC1[rip]
	call	LOG_ERROR@PLT
	mov	eax, DWORD PTR ESP_ERR_INVALID_STATE[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L12:
	lea	rdi, .LC0[rip]
	call	LOG_ERROR@PLT
	mov	eax, DWORD PTR ESP_ERR_INVALID_STATE[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L14:
	lea	rdi, .LC2[rip]
	call	LOG_ERROR@PLT
	mov	eax, DWORD PTR ESP_ERR_NO_MEM[rip]
	jmp	.L1
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	esp_bluedroid_deinit, .-esp_bluedroid_deinit
	.comm	bd_already_init,4,4
	.comm	bd_already_enable,8,8
	.comm	FUTURE_FAIL,8,8
	.comm	ESP_OK,4,4
	.comm	ESP_FAIL,4,4
	.comm	ESP_ERR_NO_MEM,4,4
	.comm	ESP_ERR_INVALID_STATE,4,4
	.comm	BT_STATUS_SUCCESS,8,8
	.comm	BTC_SIG_API_CALL,4,4
	.comm	BTC_PID_MAIN_INIT,4,4
	.comm	BTC_MAIN_DEINIT_FUTURE,4,4
	.comm	BTC_MAIN_ACT_DEINIT,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_esp_bt_main.c_esp_bluedroid_deinit.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Bluedroid already de-initialised\012\000"
	.align	2
.LC1:
	.ascii	"Bludroid already enabled, do disable first\012\000"
	.align	2
.LC2:
	.ascii	"Bluedroid de-initialise failed\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	esp_bluedroid_deinit
	.syntax unified
	.arm
	.fpu softvfp
	.type	esp_bluedroid_deinit, %function
esp_bluedroid_deinit:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r3, .L16
	ldr	r6, .L16+4
	sub	sp, sp, #16
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	ldr	r3, [r6]
	cmp	r3, #0
	beq	.L12
	ldr	r3, .L16+8
	ldr	r4, [r3]
	cmp	r4, #0
	bne	.L13
	ldr	r3, .L16+12
	ldr	r0, [r3]
	bl	btc_main_get_future_p
	mov	r5, r0
	bl	future_new
	cmp	r0, #0
	str	r0, [r5]
	beq	.L14
	ldr	r2, .L16+16
	ldr	r1, .L16+20
	ldr	r3, .L16+24
	ldr	r0, [r2]
	ldr	r1, [r1]
	ldr	ip, [r3]
	str	r1, [sp, #8]
	mov	r3, r4
	str	r0, [sp, #4]
	mov	r2, r4
	mov	r1, r4
	mov	r0, sp
	str	ip, [sp]
	bl	btc_transfer_context
	ldr	r3, .L16+28
	ldr	r3, [r3]
	cmp	r0, r3
	bne	.L10
	ldr	r0, [r5]
	bl	future_await
	ldr	r3, .L16+32
	ldr	r3, [r3]
	cmp	r0, r3
	beq	.L10
	bl	btc_deinit
	ldr	r3, .L16+36
	str	r4, [r6]
	ldr	r0, [r3]
	b	.L1
.L10:
	ldr	r0, .L16+40
	bl	LOG_ERROR
	ldr	r3, .L16+44
	ldr	r0, [r3]
.L1:
	ldr	r3, .L16
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L15
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, pc}
.L13:
	ldr	r0, .L16+48
	bl	LOG_ERROR
	ldr	r3, .L16+52
	ldr	r0, [r3]
	b	.L1
.L12:
	ldr	r0, .L16+56
	bl	LOG_ERROR
	ldr	r3, .L16+52
	ldr	r0, [r3]
	b	.L1
.L14:
	ldr	r0, .L16+40
	bl	LOG_ERROR
	ldr	r3, .L16+60
	ldr	r0, [r3]
	b	.L1
.L15:
	bl	__stack_chk_fail
.L17:
	.align	2
.L16:
	.word	.LC3
	.word	bd_already_init
	.word	bd_already_enable
	.word	BTC_MAIN_DEINIT_FUTURE
	.word	BTC_PID_MAIN_INIT
	.word	BTC_SIG_API_CALL
	.word	BTC_MAIN_ACT_DEINIT
	.word	BT_STATUS_SUCCESS
	.word	FUTURE_FAIL
	.word	ESP_OK
	.word	.LC2
	.word	ESP_FAIL
	.word	.LC1
	.word	ESP_ERR_INVALID_STATE
	.word	.LC0
	.word	ESP_ERR_NO_MEM
	.size	esp_bluedroid_deinit, .-esp_bluedroid_deinit
	.comm	bd_already_init,4,4
	.comm	bd_already_enable,4,4
	.comm	FUTURE_FAIL,4,4
	.comm	ESP_OK,4,4
	.comm	ESP_FAIL,4,4
	.comm	ESP_ERR_NO_MEM,4,4
	.comm	ESP_ERR_INVALID_STATE,4,4
	.comm	BT_STATUS_SUCCESS,4,4
	.comm	BTC_SIG_API_CALL,4,4
	.comm	BTC_PID_MAIN_INIT,4,4
	.comm	BTC_MAIN_DEINIT_FUTURE,4,4
	.comm	BTC_MAIN_ACT_DEINIT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
