	.file	"extr_mkfwimage.c_validate_image_layout.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Invalid part count '%d'\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"Invalid partition name '%s' of the part %d\n"
	.align 8
.LC2:
	.string	"Couldn't stat file '%s' from part '%s'\n"
	.align 8
.LC3:
	.string	"File '%s' from part '%s' is empty!\n"
	.align 8
.LC4:
	.string	"File '%s' too big (%d) - max size: 0x%08X (exceeds %lu bytes)\n"
	.text
	.p2align 4
	.type	validate_image_layout, @function
validate_image_layout:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	esi, DWORD PTR [rdi]
	test	esi, esi
	je	.L2
	cmp	esi, DWORD PTR MAX_SECTIONS[rip]
	jg	.L2
	mov	r12, rdi
	xor	ebp, ebp
	test	esi, esi
	jg	.L3
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	mov	r8, QWORD PTR 8[rbx]
	test	r8, r8
	je	.L20
	mov	rcx, QWORD PTR [rbx]
	cmp	r8, rcx
	jg	.L21
	add	rbp, 1
	cmp	DWORD PTR [r12], ebp
	jle	.L4
.L3:
	mov	rdx, QWORD PTR 8[r12]
	lea	rax, 0[rbp+rbp*2]
	mov	r13d, ebp
	lea	rbx, [rdx+rax*8]
	mov	edi, DWORD PTR 20[rbx]
	call	strlen@PLT
	test	eax, eax
	je	.L12
	cmp	eax, 16
	jg	.L12
	mov	edi, DWORD PTR 16[rbx]
	lea	rsi, 8[rbx]
	call	stat@PLT
	test	rax, rax
	jns	.L8
	mov	edx, DWORD PTR 20[rbx]
	mov	esi, DWORD PTR 16[rbx]
	lea	rdi, .LC2[rip]
	xor	eax, eax
	call	ERROR@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, -2
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	xor	eax, eax
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	mov	esi, DWORD PTR 20[rbx]
	mov	edx, r13d
	lea	rdi, .LC1[rip]
	xor	eax, eax
	call	ERROR@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, -1
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	mov	edx, DWORD PTR 20[rbx]
	mov	esi, DWORD PTR 16[rbx]
	lea	rdi, .LC3[rip]
	xor	eax, eax
	call	ERROR@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, -3
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	mov	esi, DWORD PTR 16[rbx]
	mov	edx, ebp
	sub	r8, rcx
	lea	rdi, .LC4[rip]
	xor	eax, eax
	call	ERROR@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, -4
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	lea	rdi, .LC0[rip]
	xor	eax, eax
	call	ERROR@PLT
	mov	eax, -1
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	validate_image_layout, .-validate_image_layout
	.comm	MAX_SECTIONS,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_mkfwimage.c_validate_image_layout.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Invalid part count '%d'\012\000"
	.align	2
.LC1:
	.ascii	"Invalid partition name '%s' of the part %d\012\000"
	.align	2
.LC2:
	.ascii	"Couldn't stat file '%s' from part '%s'\012\000"
	.align	2
.LC3:
	.ascii	"File '%s' from part '%s' is empty!\012\000"
	.align	2
.LC4:
	.ascii	"File '%s' too big (%d) - max size: 0x%08X (exceeds "
	.ascii	"%lu bytes)\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	validate_image_layout, %function
validate_image_layout:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r1, [r0]
	sub	sp, sp, #8
	cmp	r1, #0
	beq	.L2
	ldr	r3, .L20
	ldr	r3, [r3]
	cmp	r1, r3
	bgt	.L2
	cmp	r1, #0
	movgt	r7, r0
	movgt	r5, #0
	bgt	.L3
	b	.L4
.L6:
	ldr	r0, [r4, #8]
	bl	stat
	cmp	r0, #0
	blt	.L17
	ldr	r2, [r4, #4]
	cmp	r2, #0
	beq	.L18
	ldr	r3, [r6, r8]
	cmp	r2, r3
	bgt	.L19
	ldr	r3, [r7]
	add	r5, r5, #1
	cmp	r3, r5
	ble	.L4
.L3:
	ldr	r6, [r7, #4]
	lsl	r8, r5, #4
	add	r4, r6, r5, lsl #4
	ldr	r0, [r4, #12]
	bl	strlen
	cmp	r0, #16
	movle	r3, #0
	movgt	r3, #1
	cmp	r0, #0
	moveq	r3, #1
	cmp	r3, #0
	add	r1, r4, #4
	beq	.L6
	mov	r2, r5
	ldr	r1, [r4, #12]
	ldr	r0, .L20+4
	bl	ERROR
	mvn	r0, #0
.L1:
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L4:
	mov	r0, #0
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L17:
	ldr	r2, [r4, #12]
	ldr	r1, [r4, #8]
	ldr	r0, .L20+8
	bl	ERROR
	mvn	r0, #1
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L18:
	ldr	r2, [r4, #12]
	ldr	r1, [r4, #8]
	ldr	r0, .L20+12
	bl	ERROR
	mvn	r0, #2
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L19:
	sub	r2, r2, r3
	ldr	r1, [r4, #8]
	ldr	r0, .L20+16
	str	r2, [sp]
	mov	r2, r5
	bl	ERROR
	mvn	r0, #3
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	ldr	r0, .L20+20
	bl	ERROR
	mvn	r0, #0
	b	.L1
.L21:
	.align	2
.L20:
	.word	MAX_SECTIONS
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC0
	.size	validate_image_layout, .-validate_image_layout
	.comm	MAX_SECTIONS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
