	.file	"extr_cmstypes.c_Read8bitTables.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	Read8bitTables, @function
Read8bitTables:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	push	r12
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	mov	r12d, edi
	push	rbx
	sub	rsp, 88
	.cfi_offset 3, -56
	mov	QWORD PTR -96[rbp], rsi
	mov	QWORD PTR -112[rbp], rdx
	mov	rsi, rsp
	mov	DWORD PTR -84[rbp], ecx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR cmsMAXCHANNELS[rip]
	mov	rdx, rax
	lea	rax, 15[0+rax*8]
	mov	rcx, rax
	and	rax, -4096
	sub	rsi, rax
	and	rcx, -16
	mov	rax, rsi
	cmp	rsp, rax
	je	.L3
.L39:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L39
.L3:
	and	ecx, 4095
	sub	rsp, rcx
	test	rcx, rcx
	jne	.L40
	mov	QWORD PTR -120[rbp], rsp
	cmp	edx, DWORD PTR -84[rbp]
	jl	.L17
.L5:
	mov	eax, DWORD PTR -84[rbp]
	test	eax, eax
	jle	.L17
	mov	rdi, QWORD PTR -120[rbp]
	sal	edx, 3
	xor	esi, esi
	call	memset@PLT
	mov	esi, 256
	mov	edi, r12d
	call	_cmsMalloc@PLT
	mov	QWORD PTR -104[rbp], rax
	test	rax, rax
	je	.L17
	mov	rax, QWORD PTR -104[rbp]
	mov	r14, QWORD PTR -120[rbp]
	mov	QWORD PTR -128[rbp], rax
	mov	eax, DWORD PTR -84[rbp]
	mov	QWORD PTR -72[rbp], r14
	sub	eax, 1
	lea	rax, 8[r14+rax*8]
	mov	QWORD PTR -80[rbp], rax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L42:
	add	r14, 8
	cmp	r14, QWORD PTR -80[rbp]
	je	.L41
.L10:
	xor	edx, edx
	mov	esi, 256
	mov	edi, r12d
	call	cmsBuildTabulatedToneCurve16@PLT
	mov	QWORD PTR [r14], rax
	test	rax, rax
	jne	.L42
	.p2align 4,,10
	.p2align 3
.L16:
	mov	rax, QWORD PTR -72[rbp]
	mov	rsi, QWORD PTR [rax]
	test	rsi, rsi
	je	.L15
	mov	edi, r12d
	call	cmsFreeToneCurve@PLT
.L15:
	add	QWORD PTR -72[rbp], 8
	mov	rax, QWORD PTR -72[rbp]
	cmp	rax, QWORD PTR -80[rbp]
	jne	.L16
	mov	rax, QWORD PTR -128[rbp]
	test	rax, rax
	je	.L17
	mov	rsi, rax
	mov	edi, r12d
	call	_cmsFree@PLT
.L17:
	mov	eax, DWORD PTR FALSE[rip]
.L1:
	mov	rdx, QWORD PTR -56[rbp]
	xor	rdx, QWORD PTR fs:40
	jne	.L43
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L40:
	.cfi_restore_state
	or	QWORD PTR -8[rsp+rcx], 0
	mov	QWORD PTR -120[rbp], rsp
	cmp	edx, DWORD PTR -84[rbp]
	jge	.L5
	jmp	.L17
.L41:
	mov	r14, QWORD PTR -120[rbp]
	.p2align 4,,10
	.p2align 3
.L12:
	mov	r13, QWORD PTR -104[rbp]
	mov	rax, QWORD PTR -96[rbp]
	mov	ecx, 256
	mov	edi, r12d
	mov	r8d, 1
	mov	rdx, r13
	mov	rsi, rax
	call	[QWORD PTR [rax]]
	cmp	eax, 1
	jne	.L16
	xor	r15d, r15d
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rax, QWORD PTR [r14]
	mov	edi, DWORD PTR 0[r13]
	add	r13, 4
	mov	rbx, QWORD PTR [rax]
	call	FROM_8_TO_16@PLT
	add	rbx, r15
	add	r15, 8
	mov	QWORD PTR [rbx], rax
	cmp	r15, 2048
	jne	.L11
	add	r14, 8
	cmp	r14, QWORD PTR -80[rbp]
	jne	.L12
	mov	rsi, QWORD PTR -104[rbp]
	mov	edi, r12d
	call	_cmsFree@PLT
	mov	rdx, QWORD PTR -120[rbp]
	mov	esi, DWORD PTR -84[rbp]
	mov	edi, r12d
	call	cmsStageAllocToneCurves@PLT
	mov	edx, DWORD PTR cmsAT_END[rip]
	mov	rsi, QWORD PTR -112[rbp]
	mov	edi, r12d
	mov	ecx, eax
	call	cmsPipelineInsertStage@PLT
	test	eax, eax
	je	.L19
.L14:
	mov	rbx, QWORD PTR -72[rbp]
	mov	edi, r12d
	mov	rsi, QWORD PTR [rbx]
	call	cmsFreeToneCurve@PLT
	mov	rax, rbx
	add	rax, 8
	mov	QWORD PTR -72[rbp], rax
	cmp	rax, QWORD PTR -80[rbp]
	jne	.L14
	mov	eax, DWORD PTR TRUE[rip]
	jmp	.L1
.L19:
.L13:
	endbr64
	mov	QWORD PTR -128[rbp], 0
	jmp	.L16
.L43:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	Read8bitTables, .-Read8bitTables
	.comm	cmsMAXCHANNELS,4,4
	.comm	cmsAT_END,4,4
	.comm	TRUE,4,4
	.comm	FALSE,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_cmstypes.c_Read8bitTables.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	Read8bitTables, %function
Read8bitTables:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #52
	mov	r6, r3
	ldr	r3, .L38
	mov	r7, r0
	ldr	r0, [r3]
	mov	r10, r1
	lsl	r1, r0, #2
	add	r3, r1, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	ldr	r3, .L38+4
	str	r2, [fp, #-56]
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	cmp	r0, r6
	add	r3, sp, #8
	str	r3, [fp, #-48]
	blt	.L14
	cmp	r6, #0
	ble	.L14
	mov	r2, r1
	ldr	r0, [fp, #-48]
	mov	r1, #0
	bl	memset
	mov	r1, #256
	mov	r0, r7
	bl	_cmsMalloc
	subs	r4, r0, #0
	beq	.L14
	ldr	r3, [fp, #-48]
	mov	r9, #0
	sub	r3, r3, #4
	mov	r5, r3
	str	r3, [fp, #-64]
	str	r4, [fp, #-60]
	b	.L7
.L36:
	add	r8, r9, #1
	cmp	r6, r8
	beq	.L35
	mov	r9, r8
.L7:
	mov	r2, #0
	mov	r1, #256
	mov	r0, r7
	bl	cmsBuildTabulatedToneCurve16
	cmp	r0, #0
	str	r0, [r5, #4]!
	bne	.L36
.L10:
	mov	r4, #0
	ldr	r5, [fp, #-64]
.L13:
	ldr	r1, [r5, #4]!
	cmp	r1, #0
	beq	.L12
	mov	r0, r7
	bl	cmsFreeToneCurve
.L12:
	add	r4, r4, #1
	cmp	r6, r4
	bne	.L13
	ldr	r3, [fp, #-60]
	cmp	r3, #0
	beq	.L14
	mov	r1, r3
	mov	r0, r7
	bl	_cmsFree
.L14:
	ldr	r3, .L38+8
	ldr	r0, [r3]
.L1:
	ldr	r3, .L38+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L37
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L35:
	mov	r3, #0
	str	r8, [fp, #-72]
	str	r6, [fp, #-68]
	mov	r8, r10
	mov	r6, r3
	ldr	r5, [fp, #-48]
	str	r9, [fp, #-52]
.L9:
	mov	r3, #1
	str	r3, [sp]
	mov	r2, r4
	mov	r3, #256
	mov	r1, r8
	mov	r0, r7
	ldr	r9, [r8]
	blx	r9
	cmp	r0, #1
	bne	.L32
	mov	r9, #0
.L8:
	ldr	r3, [r5]
	ldr	r0, [r4, r9]
	ldr	r10, [r3]
	bl	FROM_8_TO_16
	str	r0, [r10, r9]
	add	r9, r9, #4
	cmp	r9, #1024
	bne	.L8
	ldr	r3, [fp, #-52]
	add	r5, r5, #4
	cmp	r3, r6
	add	r6, r6, #1
	bne	.L9
	mov	r1, r4
	ldr	r8, [fp, #-72]
	mov	r0, r7
	ldr	r6, [fp, #-68]
	bl	_cmsFree
	ldr	r3, .L38+12
	mov	r1, r8
	ldr	r2, [fp, #-48]
	mov	r0, r7
	ldr	r4, [r3]
	bl	cmsStageAllocToneCurves
	mov	r2, r4
	mov	r3, r0
	ldr	r1, [fp, #-56]
	mov	r0, r7
	bl	cmsPipelineInsertStage
	cmp	r0, #0
	beq	.L18
	mov	r4, #0
	ldr	r5, [fp, #-64]
	ldr	r6, [fp, #-52]
.L11:
	mov	r0, r7
	ldr	r1, [r5, #4]!
	bl	cmsFreeToneCurve
	cmp	r4, r6
	add	r4, r4, #1
	bne	.L11
	ldr	r3, .L38+16
	ldr	r0, [r3]
	b	.L1
.L32:
	ldr	r6, [fp, #-68]
	b	.L10
.L18:
	str	r0, [fp, #-60]
	b	.L10
.L37:
	bl	__stack_chk_fail
.L39:
	.align	2
.L38:
	.word	cmsMAXCHANNELS
	.word	.LC0
	.word	FALSE
	.word	cmsAT_END
	.word	TRUE
	.size	Read8bitTables, .-Read8bitTables
	.comm	cmsMAXCHANNELS,4,4
	.comm	cmsAT_END,4,4
	.comm	TRUE,4,4
	.comm	FALSE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
