	.file	"extr_image.c_select_frame_gif.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	select_frame_gif, @function
select_frame_gif:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xor	ebp, ebp
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 72
	.cfi_def_cfa_offset 128
	mov	esi, DWORD PTR [rdi]
	mov	edi, DWORD PTR 12[rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 56[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR FALSE[rip]
	lea	r13, 48[rsp]
	mov	QWORD PTR 8[rsp], rax
	cmp	esi, r12d
	jl	.L38
.L2:
	cmp	r12d, ebp
	je	.L6
	lea	rax, 44[rsp]
	xor	ebx, ebx
	mov	QWORD PTR 24[rsp], rax
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L9:
	cmp	DWORD PTR GIF_DISPOSE_RESTORE_TO_BKGND[rip], eax
	je	.L39
.L10:
	mov	rdi, QWORD PTR 48[rsp]
	add	ebp, 1
	call	IWICBitmapFrameDecode_Release@PLT
	mov	edi, DWORD PTR 12[r14]
	cmp	r12d, ebp
	je	.L6
.L20:
	mov	rdx, r13
	mov	esi, ebp
	call	IWICBitmapDecoder_GetFrame@PLT
	mov	edi, eax
	mov	r15d, eax
	call	FAILED@PLT
	test	rax, rax
	jne	.L35
	mov	rdi, QWORD PTR 48[rsp]
	lea	rdx, disposalW.1975[rip]
	lea	rsi, GUID_MetadataFormatGCE[rip]
	call	get_gif_frame_property@PLT
	cmp	DWORD PTR GIF_DISPOSE_UNSPECIFIED[rip], eax
	je	.L8
	cmp	DWORD PTR GIF_DISPOSE_DO_NOT_DISPOSE[rip], eax
	jne	.L9
.L8:
	xor	edx, edx
	mov	rsi, QWORD PTR 48[rsp]
	test	ebp, ebp
	mov	rdi, r14
	sete	dl
	call	blit_gif_frame@PLT
	mov	edi, eax
	mov	r15d, eax
	call	FAILED@PLT
	test	rax, rax
	je	.L10
.L35:
	mov	edi, r15d
	call	hresult_to_status@PLT
.L1:
	mov	rbx, QWORD PTR 56[rsp]
	xor	rbx, QWORD PTR fs:40
	jne	.L40
	add	rsp, 72
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L39:
	.cfi_restore_state
	cmp	QWORD PTR 8[rsp], 0
	je	.L41
.L11:
	mov	r8, QWORD PTR 24[rsp]
	mov	rdi, QWORD PTR 48[rsp]
	lea	rcx, 40[rsp]
	lea	rdx, 36[rsp]
	lea	rsi, 32[rsp]
	call	get_gif_frame_rect@PLT
	mov	edi, eax
	mov	DWORD PTR 20[rsp], eax
	call	FAILED@PLT
	mov	edi, DWORD PTR 20[rsp]
	test	rax, rax
	jne	.L36
	mov	ecx, DWORD PTR 36[rsp]
	mov	r8d, DWORD PTR 44[rsp]
	mov	esi, ecx
	test	r8d, r8d
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L13:
	cmp	DWORD PTR [r14], esi
	jle	.L10
	mov	eax, DWORD PTR 4[r14]
	mov	edi, DWORD PTR 40[rsp]
	imul	eax, esi
	cdqe
	add	rax, QWORD PTR 16[r14]
	mov	rdx, rax
	mov	eax, DWORD PTR 32[rsp]
	test	edi, edi
	jle	.L14
	movsx	rcx, eax
	lea	rcx, [rdx+rcx*4]
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L17:
	mov	DWORD PTR [rcx], ebx
	add	eax, 1
	mov	edx, DWORD PTR 40[rsp]
	add	rcx, 4
	add	edx, DWORD PTR 32[rsp]
	cmp	edx, eax
	jle	.L33
.L15:
	cmp	DWORD PTR 8[r14], eax
	jg	.L17
.L33:
	mov	ecx, DWORD PTR 36[rsp]
.L14:
	mov	eax, DWORD PTR 44[rsp]
	add	esi, 1
	add	eax, ecx
	cmp	eax, esi
	jg	.L13
	jmp	.L10
.L6:
	mov	rdx, r13
	mov	esi, r12d
	call	IWICBitmapDecoder_GetFrame@PLT
	mov	edi, eax
	mov	r13d, eax
	call	FAILED@PLT
	test	rax, rax
	jne	.L42
	mov	rsi, QWORD PTR 48[rsp]
	xor	edx, edx
	test	ebp, ebp
	mov	rdi, r14
	sete	dl
	call	blit_gif_frame@PLT
	mov	rdi, QWORD PTR 48[rsp]
	mov	ebp, eax
	call	IWICBitmapFrameDecode_Release@PLT
	mov	edi, ebp
	call	FAILED@PLT
	test	rax, rax
	jne	.L43
	mov	DWORD PTR [r14], r12d
	mov	eax, DWORD PTR Ok[rip]
	jmp	.L1
.L41:
	mov	rdi, r14
	call	get_gif_background_color@PLT
	mov	ebx, eax
	mov	rax, QWORD PTR TRUE[rip]
	mov	QWORD PTR 8[rsp], rax
	jmp	.L11
.L38:
	mov	rdx, r13
	call	IWICBitmapDecoder_GetFrame@PLT
	mov	edi, eax
	mov	r15d, eax
	call	FAILED@PLT
	test	rax, rax
	jne	.L35
	mov	rdi, QWORD PTR 48[rsp]
	lea	rdx, disposalW.1975[rip]
	lea	rsi, GUID_MetadataFormatGCE[rip]
	call	get_gif_frame_property@PLT
	mov	rdi, QWORD PTR 48[rsp]
	mov	ebx, eax
	call	IWICBitmapFrameDecode_Release@PLT
	cmp	DWORD PTR GIF_DISPOSE_RESTORE_TO_BKGND[rip], ebx
	je	.L44
	cmp	DWORD PTR GIF_DISPOSE_RESTORE_TO_PREV[rip], ebx
	mov	edi, DWORD PTR 12[r14]
	je	.L2
	mov	eax, DWORD PTR [r14]
	lea	ebp, 1[rax]
	jmp	.L2
.L44:
	mov	ebp, DWORD PTR [r14]
	mov	edi, DWORD PTR 12[r14]
	jmp	.L2
.L42:
	mov	edi, r13d
.L36:
	call	hresult_to_status@PLT
	jmp	.L1
.L43:
	mov	edi, ebp
	call	hresult_to_status@PLT
	jmp	.L1
.L40:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	select_frame_gif, .-select_frame_gif
	.section	.rodata
	.align 8
	.type	disposalW.1975, @object
	.size	disposalW.1975, 9
disposalW.1975:
	.string	"Disposal"
	.comm	TRUE,8,8
	.comm	Ok,4,4
	.comm	GUID_MetadataFormatGCE,4,4
	.comm	GIF_DISPOSE_UNSPECIFIED,4,4
	.comm	GIF_DISPOSE_RESTORE_TO_PREV,4,4
	.comm	GIF_DISPOSE_RESTORE_TO_BKGND,4,4
	.comm	GIF_DISPOSE_DO_NOT_DISPOSE,4,4
	.comm	FALSE,8,8
	.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_select_frame_gif.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	select_frame_gif, %function
select_frame_gif:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r2, r1
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #44
	str	r1, [sp, #8]
	ldr	r3, .L42
	ldr	r1, [r0]
	ldr	r3, [r3]
	cmp	r1, r2
	ldr	r2, .L42+4
	mov	r4, r0
	ldr	r2, [r2]
	str	r2, [sp, #36]
	mov	r2,#0
	movge	r6, #0
	ldr	r0, [r0, #12]
	str	r3, [sp, #12]
	addge	r8, sp, #16
	blt	.L37
.L2:
	ldr	r3, [sp, #8]
	cmp	r3, r6
	beq	.L6
	mov	r5, #0
	ldr	fp, .L42+8
	ldr	r10, .L42+12
	ldr	r9, .L42+16
	b	.L20
.L9:
	ldr	r3, .L42+20
	ldr	r3, [r3]
	cmp	r3, r0
	beq	.L38
.L10:
	ldr	r0, [sp, #16]
	bl	IWICBitmapFrameDecode_Release
	ldr	r3, [sp, #8]
	add	r6, r6, #1
	cmp	r3, r6
	ldr	r0, [r4, #12]
	beq	.L6
.L20:
	mov	r2, r8
	mov	r1, r6
	bl	IWICBitmapDecoder_GetFrame
	mov	r7, r0
	bl	FAILED
	cmp	r0, #0
	bne	.L35
	mov	r2, fp
	mov	r1, r10
	ldr	r0, [sp, #16]
	bl	get_gif_frame_property
	ldr	r3, [r9]
	cmp	r3, r0
	beq	.L8
	ldr	r3, .L42+24
	ldr	r3, [r3]
	cmp	r3, r0
	bne	.L9
.L8:
	clz	r2, r6
	ldr	r1, [sp, #16]
	lsr	r2, r2, #5
	mov	r0, r4
	bl	blit_gif_frame
	mov	r7, r0
	bl	FAILED
	cmp	r0, #0
	beq	.L10
.L35:
	mov	r0, r7
	bl	hresult_to_status
.L1:
	ldr	r3, .L42+4
	ldr	r2, [r3]
	ldr	r3, [sp, #36]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L39
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L38:
	ldr	r3, [sp, #12]
	cmp	r3, #0
	beq	.L40
.L11:
	add	r3, sp, #32
	str	r3, [sp]
	add	r2, sp, #24
	add	r3, sp, #28
	add	r1, sp, #20
	ldr	r0, [sp, #16]
	bl	get_gif_frame_rect
	mov	r7, r0
	bl	FAILED
	cmp	r0, #0
	bne	.L35
	ldr	ip, [sp, #32]
	ldr	r2, [sp, #24]
	cmp	ip, #0
	mov	r0, r2
	ble	.L10
.L13:
	ldr	r3, [r4]
	cmp	r3, r0
	ble	.L10
	ldr	lr, [sp, #28]
	ldr	r3, [r4, #16]
	ldr	r1, [r4, #4]
	cmp	lr, #0
	mla	r1, r0, r1, r3
	ldr	r3, [sp, #20]
	ble	.L14
	add	r1, r1, r3, lsl #2
	b	.L15
.L17:
	str	r5, [r1], #4
	ldr	r2, [sp, #20]
	ldr	ip, [sp, #28]
	add	r3, r3, #1
	add	r2, r2, ip
	cmp	r2, r3
	ble	.L33
.L15:
	ldr	r2, [r4, #8]
	cmp	r2, r3
	bgt	.L17
.L33:
	ldr	r2, [sp, #24]
	ldr	ip, [sp, #32]
.L14:
	add	r0, r0, #1
	add	r3, r2, ip
	cmp	r3, r0
	bgt	.L13
	b	.L10
.L6:
	mov	r2, r8
	ldr	r1, [sp, #8]
	bl	IWICBitmapDecoder_GetFrame
	mov	r5, r0
	bl	FAILED
	cmp	r0, #0
	bne	.L34
	clz	r2, r6
	ldr	r1, [sp, #16]
	lsr	r2, r2, #5
	mov	r0, r4
	bl	blit_gif_frame
	mov	r5, r0
	ldr	r0, [sp, #16]
	bl	IWICBitmapFrameDecode_Release
	mov	r0, r5
	bl	FAILED
	cmp	r0, #0
	bne	.L34
	ldr	r2, [sp, #8]
	ldr	r3, .L42+28
	str	r2, [r4]
	ldr	r0, [r3]
	b	.L1
.L34:
	mov	r0, r5
	bl	hresult_to_status
	b	.L1
.L40:
	mov	r0, r4
	bl	get_gif_background_color
	ldr	r3, .L42+32
	mov	r5, r0
	ldr	r3, [r3]
	str	r3, [sp, #12]
	b	.L11
.L37:
	add	r8, sp, #16
	mov	r2, r8
	bl	IWICBitmapDecoder_GetFrame
	mov	r5, r0
	bl	FAILED
	subs	r6, r0, #0
	bne	.L34
	ldr	r2, .L42+8
	ldr	r1, .L42+12
	ldr	r0, [sp, #16]
	bl	get_gif_frame_property
	mov	r5, r0
	ldr	r0, [sp, #16]
	bl	IWICBitmapFrameDecode_Release
	ldr	r3, .L42+20
	ldr	r3, [r3]
	cmp	r3, r5
	beq	.L41
	ldr	r3, .L42+36
	ldr	r0, [r4, #12]
	ldr	r3, [r3]
	cmp	r3, r5
	ldrne	r6, [r4]
	addne	r6, r6, #1
	b	.L2
.L41:
	ldr	r6, [r4]
	ldr	r0, [r4, #12]
	b	.L2
.L39:
	bl	__stack_chk_fail
.L43:
	.align	2
.L42:
	.word	FALSE
	.word	.LC0
	.word	.LANCHOR0
	.word	GUID_MetadataFormatGCE
	.word	GIF_DISPOSE_UNSPECIFIED
	.word	GIF_DISPOSE_RESTORE_TO_BKGND
	.word	GIF_DISPOSE_DO_NOT_DISPOSE
	.word	Ok
	.word	TRUE
	.word	GIF_DISPOSE_RESTORE_TO_PREV
	.size	select_frame_gif, .-select_frame_gif
	.comm	TRUE,4,4
	.comm	Ok,4,4
	.comm	GUID_MetadataFormatGCE,4,4
	.comm	GIF_DISPOSE_UNSPECIFIED,4,4
	.comm	GIF_DISPOSE_RESTORE_TO_PREV,4,4
	.comm	GIF_DISPOSE_RESTORE_TO_BKGND,4,4
	.comm	GIF_DISPOSE_DO_NOT_DISPOSE,4,4
	.comm	FALSE,4,4
	.section	.rodata
	.align	2
	.set	.LANCHOR0,. + 0
	.type	disposalW.4259, %object
	.size	disposalW.4259, 9
disposalW.4259:
	.ascii	"Disposal\000"
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
