	.file	"extr_gd_gd2.c__gd2CreateFromFile.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Bad GD2 header"
.LC1:
	.string	"Could not create gdImage"
.LC2:
	.string	"Could not read color palette"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC3:
	.string	"Image palette completed: %d colours"
	.text
	.p2align 4
	.type	_gd2CreateFromFile, @function
_gd2CreateFromFile:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, r9
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, edi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, r8
	sub	rsp, 16
	.cfi_def_cfa_offset 72
	mov	r13, QWORD PTR 88[rsp]
	push	r13
	.cfi_def_cfa_offset 80
	push	QWORD PTR 88[rsp]
	.cfi_def_cfa_offset 88
	push	QWORD PTR 88[rsp]
	.cfi_def_cfa_offset 96
	call	_gd2GetHeader@PLT
	add	rsp, 32
	.cfi_def_cfa_offset 64
	cmp	eax, 1
	jne	.L11
	mov	edi, DWORD PTR [r15]
	call	gd2_truecolor@PLT
	mov	esi, DWORD PTR [r14]
	mov	edi, DWORD PTR [r12]
	test	rax, rax
	jne	.L12
	call	gdImageCreate@PLT
	mov	r12, rax
.L5:
	test	r12, r12
	je	.L13
	xor	edx, edx
	cmp	DWORD PTR [rbx], 2
	mov	rsi, r12
	mov	edi, ebp
	sete	dl
	call	_gdGetColors@PLT
	test	eax, eax
	je	.L14
	mov	esi, DWORD PTR [r12]
	lea	rdi, .LC3[rip]
	xor	eax, eax
	call	gd_error@PLT
	mov	edi, eax
	call	GD2_DBG@PLT
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rax, r12
	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
.L12:
	.cfi_restore_state
	call	gdImageCreateTrueColor@PLT
	mov	r12, rax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L11:
	lea	rdi, .LC0[rip]
	xor	eax, eax
	xor	r12d, r12d
	call	gd_error@PLT
	mov	edi, eax
	call	GD2_DBG@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L14:
	lea	rdi, .LC2[rip]
	call	gd_error@PLT
	mov	edi, eax
	call	GD2_DBG@PLT
	mov	rdi, r12
	call	gdImageDestroy@PLT
.L7:
	mov	rdi, QWORD PTR 0[r13]
	xor	r12d, r12d
	call	gdFree@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	lea	rdi, .LC1[rip]
	xor	eax, eax
	call	gd_error@PLT
	mov	edi, eax
	call	GD2_DBG@PLT
	jmp	.L7
	.cfi_endproc
.LFE0:
	.size	_gd2CreateFromFile, .-_gd2CreateFromFile
	.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_gd_gd2.c__gd2CreateFromFile.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Bad GD2 header\000"
	.align	2
.LC1:
	.ascii	"Could not create gdImage\000"
	.align	2
.LC2:
	.ascii	"Could not read color palette\000"
	.align	2
.LC3:
	.ascii	"Image palette completed: %d colours\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	_gd2CreateFromFile, %function
_gd2CreateFromFile:
	@ args = 20, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	sub	sp, sp, #28
	ldr	ip, [sp, #68]
	ldr	r7, [sp, #72]
	add	r6, sp, #56
	ldm	r6, {r6, r8, lr}
	str	ip, [sp, #12]
	stm	sp, {r6, r8, lr}
	str	r7, [sp, #16]
	mov	r5, r0
	mov	r9, r1
	mov	r4, r2
	bl	_gd2GetHeader
	cmp	r0, #1
	bne	.L11
	ldr	r0, [r8]
	bl	gd2_truecolor
	cmp	r0, #0
	ldr	r1, [r4]
	ldr	r0, [r9]
	bne	.L12
	bl	gdImageCreate
	mov	r4, r0
.L5:
	cmp	r4, #0
	beq	.L13
	ldr	r2, [r6]
	mov	r0, r5
	sub	r2, r2, #2
	clz	r2, r2
	mov	r1, r4
	lsr	r2, r2, #5
	bl	_gdGetColors
	cmp	r0, #0
	beq	.L14
	ldr	r1, [r4]
	ldr	r0, .L15
	bl	gd_error
	bl	GD2_DBG
	mov	r0, r4
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L12:
	bl	gdImageCreateTrueColor
	mov	r4, r0
	b	.L5
.L11:
	mov	r4, #0
	ldr	r0, .L15+4
	bl	gd_error
	bl	GD2_DBG
	mov	r0, r4
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L14:
	ldr	r0, .L15+8
	bl	gd_error
	bl	GD2_DBG
	mov	r0, r4
	bl	gdImageDestroy
.L7:
	mov	r4, #0
	ldr	r0, [r7]
	bl	gdFree
	mov	r0, r4
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L13:
	ldr	r0, .L15+12
	bl	gd_error
	bl	GD2_DBG
	b	.L7
.L16:
	.align	2
.L15:
	.word	.LC3
	.word	.LC0
	.word	.LC2
	.word	.LC1
	.size	_gd2CreateFromFile, .-_gd2CreateFromFile
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
