	.file	"extr_image.c_get_ImageBase.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"rb"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"get_ImageBase, cannot open '%s' (%s)\n"
	.align 8
.LC2:
	.string	"get_ImageBase %s, read error IMAGE_DOS_HEADER (%s)\n"
	.align 8
.LC3:
	.string	"get_ImageBase %s, MZ header missing\n"
	.align 8
.LC4:
	.string	"get_ImageBase %s, read error IMAGE_FILE_HEADER (%s)\n"
	.align 8
.LC5:
	.string	"get_ImageBase %s, read error IMAGE_OPTIONAL_HEADER (%s)\n"
	.align 8
.LC6:
	.string	"get_ImageBase %s, not an IMAGE_NT_OPTIONAL_HDR 32/64 bit\n"
	.text
	.p2align 4
	.globl	get_ImageBase
	.type	get_ImageBase, @function
get_ImageBase:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rsi
	sub	rsp, 112
	.cfi_def_cfa_offset 144
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 104[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR INVALID_BASE[rip]
	mov	QWORD PTR [rsi], rax
	lea	rsi, .LC0[rip]
	call	fopen@PLT
	test	rax, rax
	je	.L13
	mov	rdi, rsp
	mov	rcx, rax
	mov	edx, 1
	mov	esi, 32
	mov	rbp, rax
	call	fread@PLT
	cmp	eax, 1
	jne	.L14
	mov	rax, QWORD PTR IMAGE_DOS_MAGIC[rip]
	cmp	QWORD PTR [rsp], rax
	jne	.L5
	mov	rsi, QWORD PTR 8[rsp]
	test	rsi, rsi
	je	.L5
	mov	edx, DWORD PTR SEEK_SET[rip]
	add	esi, 4
	mov	rdi, rbp
	call	fseek@PLT
	lea	rdi, 32[rsp]
	mov	rcx, rbp
	mov	edx, 1
	mov	esi, 32
	call	fread@PLT
	cmp	eax, 1
	jne	.L15
	lea	rdi, 64[rsp]
	mov	rcx, rbp
	mov	edx, 1
	mov	esi, 32
	call	fread@PLT
	cmp	eax, 1
	jne	.L16
	mov	rax, QWORD PTR 80[rsp]
	cmp	rax, QWORD PTR IMAGE_NT_OPTIONAL_HDR32_MAGIC[rip]
	je	.L9
	cmp	rax, QWORD PTR IMAGE_NT_OPTIONAL_HDR64_MAGIC[rip]
	jne	.L17
.L9:
	mov	rax, QWORD PTR 88[rsp]
	mov	rdi, rbp
	mov	QWORD PTR [rbx], rax
	call	fclose@PLT
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rdx, r12
	lea	rsi, .LC3[rip]
	mov	edi, 2
	xor	eax, eax
	call	l2l_dbg@PLT
	mov	rdi, rbp
	call	fclose@PLT
	mov	eax, 3
.L1:
	mov	rbx, QWORD PTR 104[rsp]
	xor	rbx, QWORD PTR fs:40
	jne	.L18
	add	rsp, 112
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	mov	edi, DWORD PTR errno[rip]
	call	strerror@PLT
	mov	rdx, r12
	mov	edi, 3
	lea	rsi, .LC1[rip]
	mov	ecx, eax
	xor	eax, eax
	call	l2l_dbg@PLT
	mov	eax, 1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L14:
	mov	edi, DWORD PTR errno[rip]
	call	strerror@PLT
	mov	rdx, r12
	mov	edi, 1
	lea	rsi, .LC2[rip]
	mov	ecx, eax
	xor	eax, eax
	call	l2l_dbg@PLT
	mov	rdi, rbp
	call	fclose@PLT
	mov	eax, 2
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L15:
	mov	edi, DWORD PTR errno[rip]
	call	strerror@PLT
	mov	rdx, r12
	mov	edi, 1
	lea	rsi, .LC4[rip]
	mov	ecx, eax
	xor	eax, eax
	call	l2l_dbg@PLT
	mov	rdi, rbp
	call	fclose@PLT
	mov	eax, 4
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L16:
	mov	edi, DWORD PTR errno[rip]
	call	strerror@PLT
	mov	rdx, r12
	mov	edi, 1
	lea	rsi, .LC5[rip]
	mov	ecx, eax
	xor	eax, eax
	call	l2l_dbg@PLT
	mov	rdi, rbp
	call	fclose@PLT
	mov	eax, 5
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L17:
	mov	rdx, r12
	lea	rsi, .LC6[rip]
	mov	edi, 2
	xor	eax, eax
	call	l2l_dbg@PLT
	mov	rdi, rbp
	call	fclose@PLT
	mov	eax, 6
	jmp	.L1
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	get_ImageBase, .-get_ImageBase
	.comm	errno,4,4
	.comm	SEEK_SET,4,4
	.comm	INVALID_BASE,8,8
	.comm	IMAGE_NT_OPTIONAL_HDR64_MAGIC,8,8
	.comm	IMAGE_NT_OPTIONAL_HDR32_MAGIC,8,8
	.comm	IMAGE_DOS_MAGIC,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_get_ImageBase.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"rb\000"
	.align	2
.LC1:
	.ascii	"get_ImageBase, cannot open '%s' (%s)\012\000"
	.align	2
.LC2:
	.ascii	"get_ImageBase %s, read error IMAGE_DOS_HEADER (%s)\012"
	.ascii	"\000"
	.align	2
.LC3:
	.ascii	"get_ImageBase %s, MZ header missing\012\000"
	.align	2
.LC4:
	.ascii	"get_ImageBase %s, read error IMAGE_FILE_HEADER (%s)"
	.ascii	"\012\000"
	.align	2
.LC5:
	.ascii	"get_ImageBase %s, read error IMAGE_OPTIONAL_HEADER "
	.ascii	"(%s)\012\000"
	.align	2
.LC6:
	.ascii	"get_ImageBase %s, not an IMAGE_NT_OPTIONAL_HDR 32/6"
	.ascii	"4 bit\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	get_ImageBase
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_ImageBase, %function
get_ImageBase:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r6, r1
	ldr	r3, .L19
	ldr	r2, .L19+4
	ldr	r3, [r3]
	sub	sp, sp, #56
	ldr	r2, [r2]
	str	r2, [sp, #52]
	mov	r2,#0
	ldr	r1, .L19+8
	str	r3, [r6]
	mov	r7, r0
	bl	fopen
	subs	r4, r0, #0
	beq	.L13
	mov	r3, r4
	mov	r2, #1
	mov	r1, #16
	add	r0, sp, #4
	bl	fread
	cmp	r0, #1
	mov	r5, r0
	bne	.L14
	ldr	r3, .L19+12
	ldr	r2, [sp, #4]
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L5
	ldr	r1, [sp, #8]
	cmp	r1, #0
	beq	.L5
	ldr	r3, .L19+16
	add	r1, r1, #4
	ldr	r2, [r3]
	mov	r0, r4
	bl	fseek
	mov	r3, r4
	mov	r2, r5
	mov	r1, #16
	add	r0, sp, #20
	bl	fread
	cmp	r0, #1
	mov	r8, r0
	bne	.L15
	mov	r2, r0
	mov	r3, r4
	mov	r1, #16
	add	r0, sp, #36
	bl	fread
	cmp	r0, #1
	bne	.L16
	ldr	r2, .L19+20
	ldr	r3, [sp, #44]
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L9
	ldr	r2, .L19+24
	ldr	r2, [r2]
	cmp	r3, r2
	bne	.L17
.L9:
	ldr	r3, [sp, #48]
	mov	r0, r4
	str	r3, [r6]
	bl	fclose
	mov	r0, #0
	b	.L1
.L5:
	mov	r2, r7
	ldr	r1, .L19+28
	mov	r0, #2
	bl	l2l_dbg
	mov	r0, r4
	bl	fclose
	mov	r0, #3
.L1:
	ldr	r3, .L19+4
	ldr	r2, [r3]
	ldr	r3, [sp, #52]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L18
	add	sp, sp, #56
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L13:
	ldr	r3, .L19+32
	ldr	r0, [r3]
	bl	strerror
	mov	r2, r7
	mov	r3, r0
	ldr	r1, .L19+36
	mov	r0, #3
	bl	l2l_dbg
	mov	r0, #1
	b	.L1
.L14:
	ldr	r3, .L19+32
	ldr	r0, [r3]
	bl	strerror
	mov	r2, r7
	mov	r3, r0
	ldr	r1, .L19+40
	mov	r0, #1
	bl	l2l_dbg
	mov	r0, r4
	bl	fclose
	mov	r0, #2
	b	.L1
.L15:
	ldr	r3, .L19+32
	ldr	r0, [r3]
	bl	strerror
	mov	r2, r7
	mov	r3, r0
	ldr	r1, .L19+44
	mov	r0, r5
	bl	l2l_dbg
	mov	r0, r4
	bl	fclose
	mov	r0, #4
	b	.L1
.L16:
	ldr	r3, .L19+32
	ldr	r0, [r3]
	bl	strerror
	mov	r2, r7
	mov	r3, r0
	ldr	r1, .L19+48
	mov	r0, r8
	bl	l2l_dbg
	mov	r0, r4
	bl	fclose
	mov	r0, #5
	b	.L1
.L17:
	mov	r2, r7
	ldr	r1, .L19+52
	mov	r0, #2
	bl	l2l_dbg
	mov	r0, r4
	bl	fclose
	mov	r0, #6
	b	.L1
.L18:
	bl	__stack_chk_fail
.L20:
	.align	2
.L19:
	.word	INVALID_BASE
	.word	.LC7
	.word	.LC0
	.word	IMAGE_DOS_MAGIC
	.word	SEEK_SET
	.word	IMAGE_NT_OPTIONAL_HDR32_MAGIC
	.word	IMAGE_NT_OPTIONAL_HDR64_MAGIC
	.word	.LC3
	.word	errno
	.word	.LC1
	.word	.LC2
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.size	get_ImageBase, .-get_ImageBase
	.comm	errno,4,4
	.comm	SEEK_SET,4,4
	.comm	INVALID_BASE,4,4
	.comm	IMAGE_NT_OPTIONAL_HDR64_MAGIC,4,4
	.comm	IMAGE_NT_OPTIONAL_HDR32_MAGIC,4,4
	.comm	IMAGE_DOS_MAGIC,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
