	.file	"extr_image.c_ImageWrite.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"no image encoded"
	.text
	.p2align 4
	.type	ImageWrite, @function
ImageWrite:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	r14, rcx
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rdx
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rdi
	sub	rsp, 32
	.cfi_def_cfa_offset 80
	mov	r12, QWORD PTR 8[rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	test	r12, r12
	je	.L2
	mov	rax, QWORD PTR [rcx]
	cmp	QWORD PTR 32[r12], rax
	jne	.L3
	mov	rax, QWORD PTR 8[rcx]
	cmp	QWORD PTR 40[r12], rax
	je	.L33
.L3:
	mov	rdi, r12
	call	DeleteEncoder@PLT
	mov	QWORD PTR 8[rbx], 0
.L2:
	mov	edi, DWORD PTR [rbx]
	mov	rdx, r14
	mov	rsi, r13
	call	CreateEncoder@PLT
	mov	QWORD PTR 8[rbx], rax
	mov	r12, rax
	test	rax, rax
	je	.L1
.L4:
	mov	rdx, QWORD PTR 0[r13]
	cmp	QWORD PTR 8[r12], rdx
	je	.L34
.L5:
	mov	rdi, QWORD PTR 16[rbx]
	test	rdi, rdi
	je	.L17
	cmp	QWORD PTR 32[rdi], rdx
	jne	.L8
	mov	rax, QWORD PTR 8[rbx]
	mov	rax, QWORD PTR 8[rax]
	cmp	QWORD PTR 8[rdi], rax
	je	.L35
.L8:
	call	DeleteConverter@PLT
	mov	QWORD PTR 16[rbx], 0
	mov	rdx, QWORD PTR 0[r13]
.L17:
	mov	r12, rsp
	mov	esi, DWORD PTR VIDEO_ES[rip]
	mov	rdi, r12
	call	es_format_Init@PLT
	mov	rax, QWORD PTR 16[r13]
	mov	edi, DWORD PTR [rbx]
	mov	rsi, r12
	movdqu	xmm0, XMMWORD PTR 0[r13]
	mov	QWORD PTR 16[rsp], rax
	mov	rax, QWORD PTR 8[rbx]
	movaps	XMMWORD PTR [rsp], xmm0
	lea	rdx, 8[rax]
	call	CreateConverter@PLT
	mov	QWORD PTR 16[rbx], rax
	mov	r12, rax
	test	rax, rax
	je	.L1
.L13:
	mov	rdi, rbp
	call	picture_Hold@PLT
	mov	rax, QWORD PTR 16[rbx]
	mov	rsi, rbp
	mov	rdi, rax
	call	[QWORD PTR [rax]]
	xor	edi, edi
	test	rax, rax
	mov	rbp, rax
	setne	dil
	call	likely@PLT
	test	rax, rax
	je	.L16
	mov	rax, QWORD PTR 8[rbx]
	mov	rsi, rbp
	mov	rdi, rax
	call	[QWORD PTR [rax]]
	mov	rdi, rbp
	mov	r12, rax
	call	picture_Release@PLT
.L15:
	test	r12, r12
	je	.L16
.L1:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L36
	add	rsp, 32
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	mov	rax, r12
	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
.L34:
	.cfi_restore_state
	mov	rax, QWORD PTR 8[r13]
	cmp	QWORD PTR 16[r12], rax
	jne	.L5
	mov	rax, QWORD PTR 16[r13]
	cmp	QWORD PTR 24[r12], rax
	jne	.L5
	lea	rdi, 8[r12]
	mov	rsi, r13
	call	BitMapFormatIsSimilar@PLT
	test	eax, eax
	jne	.L6
	mov	rdx, QWORD PTR 0[r13]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L16:
	mov	edi, DWORD PTR [rbx]
	lea	rsi, .LC0[rip]
	xor	r12d, r12d
	call	msg_Dbg@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L33:
	mov	rax, QWORD PTR 16[rcx]
	cmp	QWORD PTR 48[r12], rax
	jne	.L3
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L35:
	add	rdi, 32
	mov	rsi, r13
	call	BitMapFormatIsSimilar@PLT
	mov	rdi, QWORD PTR 16[rbx]
	test	eax, eax
	je	.L8
	test	rdi, rdi
	je	.L37
	add	rdi, 32
	call	es_format_Clean@PLT
	mov	rax, QWORD PTR 16[rbx]
	mov	rsi, r13
	lea	rdi, 32[rax]
	call	es_format_InitFromVideo@PLT
	mov	rax, QWORD PTR 16[rbx]
	lea	rdi, 8[rax]
	call	es_format_Clean@PLT
	mov	rax, QWORD PTR 8[rbx]
	lea	rsi, 8[rax]
	mov	rax, QWORD PTR 16[rbx]
	lea	rdi, 8[rax]
	call	es_format_Copy@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rax, QWORD PTR 8[rbx]
	mov	rsi, rbp
	mov	rdi, rax
	call	[QWORD PTR [rax]]
	mov	r12, rax
	jmp	.L15
.L36:
	call	__stack_chk_fail@PLT
.L37:
	mov	rdx, QWORD PTR 0[r13]
	jmp	.L17
	.cfi_endproc
.LFE0:
	.size	ImageWrite, .-ImageWrite
	.comm	VIDEO_ES,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_image.c_ImageWrite.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"no image encoded\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ImageWrite, %function
ImageWrite:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r5, [r0, #4]
	mov	r8, r3
	ldr	r3, .L38
	sub	sp, sp, #16
	cmp	r5, #0
	mov	r4, r0
	mov	r7, r1
	mov	r6, r2
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	beq	.L2
	ldr	r2, [r5, #16]
	ldr	r3, [r8]
	cmp	r2, r3
	bne	.L3
	ldr	r2, [r5, #20]
	ldr	r3, [r8, #4]
	cmp	r2, r3
	beq	.L33
.L3:
	mov	r0, r5
	bl	DeleteEncoder
	mov	r3, #0
	str	r3, [r4, #4]
.L2:
	mov	r2, r8
	mov	r1, r6
	ldr	r0, [r4]
	bl	CreateEncoder
	cmp	r0, #0
	mov	r5, r0
	str	r0, [r4, #4]
	beq	.L1
.L4:
	ldr	r2, [r6]
	ldr	r3, [r5, #4]
	cmp	r3, r2
	beq	.L34
.L5:
	ldr	r0, [r4, #8]
	cmp	r0, #0
	beq	.L17
	ldr	r3, [r0, #16]
	cmp	r3, r2
	bne	.L8
	ldr	r3, [r4, #4]
	ldr	r2, [r0, #4]
	ldr	r3, [r3, #4]
	cmp	r2, r3
	beq	.L35
.L8:
	bl	DeleteConverter
	mov	r3, #0
	ldr	r2, [r6]
	str	r3, [r4, #8]
.L17:
	mov	r5, sp
	ldr	r3, .L38+4
	mov	r0, r5
	ldr	r1, [r3]
	bl	es_format_Init
	ldm	r6, {r0, r1, r2}
	ldr	r3, [r4, #4]
	stm	r5, {r0, r1, r2}
	mov	r1, r5
	ldr	r0, [r4]
	add	r2, r3, #4
	bl	CreateConverter
	cmp	r0, #0
	mov	r5, r0
	str	r0, [r4, #8]
	beq	.L1
.L13:
	mov	r0, r7
	bl	picture_Hold
	ldr	r0, [r4, #8]
	mov	r1, r7
	ldr	r3, [r0]
	blx	r3
	mov	r6, r0
	subs	r0, r0, #0
	movne	r0, #1
	bl	likely
	cmp	r0, #0
	beq	.L16
	ldr	r0, [r4, #4]
	mov	r1, r6
	ldr	r3, [r0]
	blx	r3
	mov	r5, r0
	mov	r0, r6
	bl	picture_Release
.L15:
	cmp	r5, #0
	beq	.L16
.L1:
	ldr	r3, .L38
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L36
	mov	r0, r5
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L34:
	ldr	r1, [r5, #8]
	ldr	r3, [r6, #4]
	cmp	r1, r3
	bne	.L5
	ldr	r1, [r5, #12]
	ldr	r3, [r6, #8]
	cmp	r1, r3
	bne	.L5
	mov	r1, r6
	add	r0, r5, #4
	bl	BitMapFormatIsSimilar
	cmp	r0, #0
	bne	.L6
	ldr	r2, [r6]
	b	.L5
.L16:
	ldr	r0, [r4]
	ldr	r1, .L38+8
	bl	msg_Dbg
	mov	r5, #0
	b	.L1
.L33:
	ldr	r2, [r5, #24]
	ldr	r3, [r8, #8]
	cmp	r2, r3
	bne	.L3
	b	.L4
.L35:
	mov	r1, r6
	add	r0, r0, #16
	bl	BitMapFormatIsSimilar
	cmp	r0, #0
	ldr	r0, [r4, #8]
	beq	.L8
	cmp	r0, #0
	beq	.L37
	add	r0, r0, #16
	bl	es_format_Clean
	ldr	r0, [r4, #8]
	mov	r1, r6
	add	r0, r0, #16
	bl	es_format_InitFromVideo
	ldr	r0, [r4, #8]
	add	r0, r0, #4
	bl	es_format_Clean
	ldr	r1, [r4, #4]
	ldr	r0, [r4, #8]
	add	r1, r1, #4
	add	r0, r0, #4
	bl	es_format_Copy
	b	.L13
.L6:
	ldr	r0, [r4, #4]
	mov	r1, r7
	ldr	r3, [r0]
	blx	r3
	mov	r5, r0
	b	.L15
.L36:
	bl	__stack_chk_fail
.L37:
	ldr	r2, [r6]
	b	.L17
.L39:
	.align	2
.L38:
	.word	.LC1
	.word	VIDEO_ES
	.word	.LC0
	.size	ImageWrite, .-ImageWrite
	.comm	VIDEO_ES,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
