	.file	"extr_stb_image.c_hdr_to_ldr.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"Out of memory"
.LC3:
	.string	"outofmem"
	.text
	.p2align 4
	.type	hdr_to_ldr, @function
hdr_to_ldr:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	imul	esi, edx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	QWORD PTR 16[rsp], rdi
	mov	edi, esi
	imul	edi, ecx
	mov	DWORD PTR 8[rsp], ecx
	mov	DWORD PTR 24[rsp], esi
	call	malloc@PLT
	test	rax, rax
	je	.L22
	mov	esi, DWORD PTR 8[rsp]
	mov	r15, rax
	mov	edx, DWORD PTR 24[rsp]
	mov	eax, esi
	and	eax, 1
	cmp	eax, 1
	sbb	esi, 0
	mov	DWORD PTR 12[rsp], esi
	test	edx, edx
	jle	.L4
	test	esi, esi
	mov	eax, 0
	cmovns	eax, esi
	xor	r13d, r13d
	xor	r14d, r14d
	mov	DWORD PTR 28[rsp], eax
	.p2align 4,,10
	.p2align 3
.L5:
	mov	eax, DWORD PTR 12[rsp]
	test	eax, eax
	jle	.L13
	mov	rax, QWORD PTR 16[rsp]
	movsx	rdx, r13d
	movss	xmm5, DWORD PTR .LC4[rip]
	lea	rbx, [r15+rdx*8]
	lea	rbp, [rax+rdx*4]
	mov	eax, DWORD PTR 12[rsp]
	movss	DWORD PTR 4[rsp], xmm5
	sub	eax, 1
	add	rax, rdx
	lea	r12, 8[r15+rax*8]
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L23:
	comiss	xmm0, DWORD PTR .LC1[rip]
	jbe	.L6
	movss	xmm0, DWORD PTR .LC1[rip]
.L6:
	call	float2int@PLT
	add	rbx, 8
	add	rbp, 4
	mov	QWORD PTR -8[rbx], rax
	cmp	rbx, r12
	je	.L13
.L8:
	movss	xmm0, DWORD PTR 0[rbp]
	mulss	xmm0, DWORD PTR h2l_scale_i[rip]
	mov	edi, DWORD PTR h2l_gamma_i[rip]
	call	pow@PLT
	pxor	xmm0, xmm0
	pxor	xmm4, xmm4
	cvtsi2ss	xmm0, rax
	mulss	xmm0, DWORD PTR .LC1[rip]
	addss	xmm0, DWORD PTR 4[rsp]
	comiss	xmm4, xmm0
	jbe	.L23
	pxor	xmm0, xmm0
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L13:
	mov	eax, DWORD PTR 28[rsp]
	mov	ecx, DWORD PTR 8[rsp]
	cmp	eax, ecx
	jge	.L9
	add	eax, r13d
	mov	rsi, QWORD PTR 16[rsp]
	pxor	xmm2, xmm2
	movss	xmm1, DWORD PTR .LC1[rip]
	cdqe
	movss	xmm6, DWORD PTR .LC4[rip]
	movss	xmm0, DWORD PTR [rsi+rax*4]
	mulss	xmm0, xmm1
	addss	xmm0, xmm6
	comiss	xmm2, xmm0
	ja	.L16
	comiss	xmm0, xmm1
	jbe	.L10
	movaps	xmm0, xmm1
.L10:
	lea	rbx, [r15+rax*8]
	call	float2int@PLT
	mov	QWORD PTR [rbx], rax
.L9:
	add	r14d, 1
	add	r13d, DWORD PTR 8[rsp]
	cmp	DWORD PTR 24[rsp], r14d
	jne	.L5
.L4:
	mov	rdi, QWORD PTR 16[rsp]
	call	free@PLT
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rax, r15
	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
.L16:
	.cfi_restore_state
	movaps	xmm0, xmm2
	jmp	.L10
.L22:
	mov	rdi, QWORD PTR 16[rsp]
	call	free@PLT
	add	rsp, 40
	.cfi_def_cfa_offset 56
	lea	rsi, .LC2[rip]
	lea	rdi, .LC3[rip]
	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
	jmp	epuc@PLT
	.cfi_endproc
.LFE0:
	.size	hdr_to_ldr, .-hdr_to_ldr
	.comm	h2l_scale_i,4,4
	.comm	h2l_gamma_i,4,4
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC1:
	.long	1132396544
	.align 4
.LC4:
	.long	1056964608
	.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_stb_image.c_hdr_to_ldr.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Out of memory\000"
	.align	2
.LC1:
	.ascii	"outofmem\000"
	.global	__aeabi_fmul
	.global	__aeabi_i2f
	.global	__aeabi_fadd
	.global	__aeabi_fcmplt
	.global	__aeabi_fcmpgt
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	hdr_to_ldr, %function
hdr_to_ldr:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	ip, r3
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #36
	str	r3, [sp, #4]
	mov	r3, r0
	mul	r0, r2, r1
	mov	r2, r0
	str	r0, [sp, #16]
	mov	r0, ip
	mul	r0, r2, r0
	str	r3, [sp, #12]
	bl	malloc
	subs	r8, r0, #0
	beq	.L23
	ldr	r3, [sp, #4]
	tst	r3, #1
	ldrne	r3, [sp, #4]
	subeq	r3, r3, #1
	str	r3, [sp, #20]
	ldr	r3, [sp, #16]
	cmp	r3, #0
	ble	.L4
	mov	r3, #0
	mvn	r10, #3
	mov	r9, #1056964608
	mov	r6, #0
	ldr	r2, [sp, #4]
	str	r3, [sp]
	lsl	r2, r2, #2
	str	r3, [sp, #8]
	str	r2, [sp, #28]
	ldr	r3, [sp, #12]
	ldr	r2, [sp, #20]
	sub	r10, r10, r3
	add	r7, r3, r2, lsl #2
	ldr	r5, .L24
	bic	r3, r2, r2, asr #31
	str	r3, [sp, #24]
.L5:
	ldr	r3, [sp, #20]
	cmp	r3, #0
	ble	.L13
	ldr	r3, [sp, #12]
	ldr	r2, [sp]
	add	r4, r3, r2, lsl #2
.L8:
	ldr	r3, .L24+4
	ldr	r0, [r4], #4	@ float
	ldr	fp, [r3]
	ldr	r3, .L24+8
	ldr	r1, [r3]	@ float
	bl	__aeabi_fmul
	mov	r1, fp
	bl	pow
	bl	__aeabi_i2f
	mov	r1, r5
	bl	__aeabi_fmul
	mov	r1, r9
	bl	__aeabi_fadd
	mov	r1, r6
	mov	fp, r0
	bl	__aeabi_fcmplt
	cmp	r0, #0
	movne	fp, r6
	bne	.L6
	mov	r0, fp
	mov	r1, r5
	bl	__aeabi_fcmpgt
	cmp	r0, #0
	movne	fp, r5
.L6:
	mov	r0, fp
	bl	float2int
	add	r3, r8, r4
	cmp	r4, r7
	str	r0, [r3, r10]
	bne	.L8
.L13:
	ldr	r3, [sp, #24]
	ldr	r2, [sp, #4]
	cmp	r3, r2
	bge	.L9
	ldr	r2, [sp]
	mov	r1, r5
	add	fp, r2, r3
	ldr	r3, [sp, #12]
	ldr	r0, [r3, fp, lsl #2]	@ float
	bl	__aeabi_fmul
	mov	r1, r9
	bl	__aeabi_fadd
	mov	r1, r6
	mov	r4, r0
	bl	__aeabi_fcmplt
	cmp	r0, #0
	movne	r4, r6
	bne	.L10
	mov	r0, r4
	mov	r1, r5
	bl	__aeabi_fcmpgt
	cmp	r0, #0
	movne	r4, r5
.L10:
	mov	r0, r4
	bl	float2int
	str	r0, [r8, fp, lsl #2]
.L9:
	ldr	r3, [sp, #8]
	ldr	r2, [sp, #16]
	add	r3, r3, #1
	cmp	r2, r3
	str	r3, [sp, #8]
	ldr	r3, [sp, #28]
	add	r7, r7, r3
	ldm	sp, {r2, r3}
	add	r3, r3, r2
	str	r3, [sp]
	bne	.L5
.L4:
	ldr	r0, [sp, #12]
	bl	free
	mov	r0, r8
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L23:
	ldr	r0, [sp, #12]
	bl	free
	ldr	r1, .L24+12
	ldr	r0, .L24+16
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	epuc
.L25:
	.align	2
.L24:
	.word	1132396544
	.word	h2l_gamma_i
	.word	h2l_scale_i
	.word	.LC0
	.word	.LC1
	.size	hdr_to_ldr, .-hdr_to_ldr
	.comm	h2l_scale_i,4,4
	.comm	h2l_gamma_i,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
