	.file	"extr_esp_https_ota.c_esp_https_ota_perform.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"esp_https_ota_perform: Invalid argument"
	.align 8
.LC1:
	.string	"esp_https_ota_perform: Invalid state"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"esp_ota_begin failed (%s)"
.LC3:
	.string	"Connection closed"
.LC4:
	.string	"Error: SSL data read error"
.LC5:
	.string	"Invalid ESP HTTPS OTA State"
	.text
	.p2align 4
	.globl	esp_https_ota_perform
	.type	esp_https_ota_perform, @function
esp_https_ota_perform:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	test	rdi, rdi
	je	.L13
	mov	eax, DWORD PTR [rdi]
	mov	rbp, rdi
	cmp	eax, 128
	jle	.L14
	cmp	eax, 129
	je	.L15
	mov	edi, DWORD PTR TAG[rip]
	lea	rsi, .LC5[rip]
	xor	eax, eax
	call	ESP_LOGE@PLT
	mov	r12d, DWORD PTR ESP_FAIL[rip]
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	lea	rdx, 24[rdi]
	mov	esi, DWORD PTR OTA_SIZE_UNKNOWN[rip]
	mov	edi, DWORD PTR 28[rdi]
	call	esp_ota_begin@PLT
	cmp	DWORD PTR ESP_OK[rip], eax
	mov	r12d, eax
	jne	.L16
	mov	edx, DWORD PTR 4[rbp]
	mov	rsi, QWORD PTR 8[rbp]
	mov	DWORD PTR 0[rbp], 128
	test	edx, edx
	jne	.L11
	mov	edx, DWORD PTR 16[rbp]
	mov	edi, DWORD PTR 20[rbp]
	call	esp_http_client_read@PLT
	test	eax, eax
	je	.L17
	js	.L18
	mov	rsi, QWORD PTR 8[rbp]
	mov	edx, eax
.L11:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rdi, rbp
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	_ota_write@PLT
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	mov	edi, DWORD PTR TAG[rip]
	lea	rsi, .LC0[rip]
	xor	eax, eax
	call	ESP_LOGE@PLT
	mov	r12d, DWORD PTR ESP_ERR_INVALID_ARG[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	mov	edi, eax
	call	esp_err_to_name@PLT
	mov	edi, DWORD PTR TAG[rip]
	lea	rsi, .LC2[rip]
	mov	edx, eax
	xor	eax, eax
	call	ESP_LOGE@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L14:
	mov	edi, DWORD PTR TAG[rip]
	lea	rsi, .LC1[rip]
	xor	eax, eax
	call	ESP_LOGE@PLT
	mov	r12d, DWORD PTR ESP_FAIL[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	mov	edi, DWORD PTR TAG[rip]
	lea	rsi, .LC4[rip]
	xor	eax, eax
	call	ESP_LOGE@PLT
	mov	r12d, DWORD PTR ESP_FAIL[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L17:
	mov	edi, DWORD PTR TAG[rip]
	lea	rsi, .LC3[rip]
	call	ESP_LOGI@PLT
	mov	eax, DWORD PTR ESP_HTTPS_OTA_SUCCESS[rip]
	mov	r12d, DWORD PTR ESP_OK[rip]
	mov	DWORD PTR 0[rbp], eax
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	esp_https_ota_perform, .-esp_https_ota_perform
	.comm	TAG,4,4
	.comm	OTA_SIZE_UNKNOWN,4,4
	.comm	ESP_OK,4,4
	.comm	ESP_HTTPS_OTA_SUCCESS,4,4
	.comm	ESP_FAIL,4,4
	.comm	ESP_ERR_INVALID_ARG,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_https_ota.c_esp_https_ota_perform.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"esp_https_ota_perform: Invalid argument\000"
	.align	2
.LC1:
	.ascii	"esp_https_ota_perform: Invalid state\000"
	.align	2
.LC2:
	.ascii	"esp_ota_begin failed (%s)\000"
	.align	2
.LC3:
	.ascii	"Connection closed\000"
	.align	2
.LC4:
	.ascii	"Error: SSL data read error\000"
	.align	2
.LC5:
	.ascii	"Invalid ESP HTTPS OTA State\000"
	.text
	.align	2
	.global	esp_https_ota_perform
	.syntax unified
	.arm
	.fpu softvfp
	.type	esp_https_ota_perform, %function
esp_https_ota_perform:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	subs	r4, r0, #0
	beq	.L13
	ldr	r3, [r4]
	cmp	r3, #128
	ble	.L14
	cmp	r3, #129
	beq	.L15
	ldr	r3, .L19
	ldr	r1, .L19+4
	ldr	r0, [r3]
	bl	ESP_LOGE
	ldr	r3, .L19+8
	ldr	r5, [r3]
.L1:
	mov	r0, r5
	pop	{r4, r5, r6, pc}
.L15:
	ldr	r3, .L19+12
	ldr	r0, [r4, #24]
	ldr	r1, [r3]
	add	r2, r4, #20
	bl	esp_ota_begin
	ldr	r6, .L19+16
	mov	r5, r0
	ldr	r3, [r6]
	cmp	r3, r0
	bne	.L16
	mov	r3, #128
	ldr	r2, [r4, #4]
	ldr	r1, [r4, #8]
	cmp	r2, #0
	str	r3, [r4]
	bne	.L11
	ldr	r2, [r4, #12]
	ldr	r0, [r4, #16]
	bl	esp_http_client_read
	subs	r2, r0, #0
	beq	.L17
	blt	.L18
	ldr	r1, [r4, #8]
.L11:
	mov	r0, r4
	pop	{r4, r5, r6, lr}
	b	_ota_write
.L13:
	ldr	r3, .L19
	ldr	r1, .L19+20
	ldr	r0, [r3]
	bl	ESP_LOGE
	ldr	r3, .L19+24
	ldr	r5, [r3]
	mov	r0, r5
	pop	{r4, r5, r6, pc}
.L16:
	ldr	r3, .L19
	ldr	r4, [r3]
	bl	esp_err_to_name
	ldr	r1, .L19+28
	mov	r2, r0
	mov	r0, r4
	bl	ESP_LOGE
	b	.L1
.L14:
	ldr	r3, .L19
	ldr	r1, .L19+32
	ldr	r0, [r3]
	bl	ESP_LOGE
	ldr	r3, .L19+8
	ldr	r5, [r3]
	mov	r0, r5
	pop	{r4, r5, r6, pc}
.L18:
	ldr	r3, .L19
	ldr	r1, .L19+36
	ldr	r0, [r3]
	bl	ESP_LOGE
	ldr	r3, .L19+8
	ldr	r5, [r3]
	b	.L1
.L17:
	ldr	r3, .L19
	ldr	r1, .L19+40
	ldr	r0, [r3]
	bl	ESP_LOGI
	ldr	r3, .L19+44
	ldr	r5, [r6]
	ldr	r3, [r3]
	str	r3, [r4]
	b	.L1
.L20:
	.align	2
.L19:
	.word	TAG
	.word	.LC5
	.word	ESP_FAIL
	.word	OTA_SIZE_UNKNOWN
	.word	ESP_OK
	.word	.LC0
	.word	ESP_ERR_INVALID_ARG
	.word	.LC2
	.word	.LC1
	.word	.LC4
	.word	.LC3
	.word	ESP_HTTPS_OTA_SUCCESS
	.size	esp_https_ota_perform, .-esp_https_ota_perform
	.comm	TAG,4,4
	.comm	OTA_SIZE_UNKNOWN,4,4
	.comm	ESP_OK,4,4
	.comm	ESP_HTTPS_OTA_SUCCESS,4,4
	.comm	ESP_FAIL,4,4
	.comm	ESP_ERR_INVALID_ARG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
