	.file	"extr_mdt_loader.c___qcom_mdt_load.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"invalid firmware metadata\n"
.LC1:
	.string	"unable to setup relocation\n"
.LC2:
	.string	"segment outside memory range\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC3:
	.string	"failed to load segment %d from truncated file %s\n"
	.section	.rodata.str1.1
.LC4:
	.string	"b%02d"
.LC5:
	.string	"failed to load %s\n"
	.text
	.p2align 4
	.type	__qcom_mdt_load, @function
__qcom_mdt_load:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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, 120
	.cfi_def_cfa_offset 176
	mov	rax, QWORD PTR 184[rsp]
	mov	QWORD PTR 8[rsp], rdi
	mov	QWORD PTR 16[rsp], rdx
	mov	DWORD PTR 52[rsp], ecx
	mov	QWORD PTR [rsp], r8
	mov	QWORD PTR 40[rsp], r9
	mov	QWORD PTR 32[rsp], rax
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 104[rsp], rax
	xor	eax, eax
	test	rsi, rsi
	je	.L2
	test	r8, r8
	je	.L2
	test	r9, r9
	je	.L2
	cmp	QWORD PTR 176[rsp], 0
	je	.L2
	mov	rbx, QWORD PTR 16[rsp]
	mov	rbp, rsi
	mov	rdi, rbx
	call	strlen@PLT
	mov	QWORD PTR 56[rsp], rax
	cmp	rax, 4
	jbe	.L2
	mov	esi, DWORD PTR GFP_KERNEL[rip]
	mov	rdi, rbx
	mov	r14, QWORD PTR PHYS_ADDR_MAX[rip]
	mov	r15, QWORD PTR 0[rbp]
	call	kstrdup@PLT
	mov	r8d, DWORD PTR ENOMEM[rip]
	mov	QWORD PTR 24[rsp], rax
	neg	r8d
	test	rax, rax
	je	.L1
	mov	esi, DWORD PTR 192[rsp]
	test	esi, esi
	jne	.L7
.L12:
	mov	ecx, DWORD PTR [r15]
	test	ecx, ecx
	jle	.L52
	lea	rax, 4[r15]
	xor	r13d, r13d
	mov	QWORD PTR 72[rsp], rbp
	xor	ebx, ebx
	mov	QWORD PTR 64[rsp], rax
	mov	r12, rax
	xor	eax, eax
	mov	ebp, r13d
	mov	r13, rax
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L13:
	mov	eax, DWORD PTR [r15]
	add	ebp, 1
	add	r12, 40
	cmp	eax, ebp
	jle	.L53
.L15:
	mov	rdi, r12
	call	mdt_phdr_valid@PLT
	test	eax, eax
	je	.L13
	mov	rdi, QWORD PTR 8[r12]
	mov	eax, DWORD PTR [r12]
	test	DWORD PTR QCOM_MDT_RELOCATABLE[rip], eax
	mov	eax, 1
	cmovne	ebx, eax
	cmp	r14, rdi
	cmovg	r14, rdi
	add	rdi, QWORD PTR 16[r12]
	cmp	rdi, r13
	jbe	.L13
	mov	esi, DWORD PTR SZ_4K[rip]
	add	ebp, 1
	add	r12, 40
	call	ALIGN@PLT
	mov	r13, rax
	mov	eax, DWORD PTR [r15]
	cmp	eax, ebp
	jg	.L15
.L53:
	mov	rbp, QWORD PTR 72[rsp]
	test	ebx, ebx
	je	.L30
	mov	edx, DWORD PTR 192[rsp]
	test	edx, edx
	jne	.L54
.L16:
	test	eax, eax
	jle	.L9
	mov	rax, QWORD PTR 56[rsp]
	mov	r13, QWORD PTR 64[rsp]
	xor	r12d, r12d
	sub	rax, 3
	mov	QWORD PTR 40[rsp], rax
	mov	rax, rbp
	mov	rbp, r13
	mov	r13, rax
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L21:
	add	r12d, 1
	add	rbp, 40
	cmp	DWORD PTR [r15], r12d
	jle	.L9
.L28:
	mov	rdi, rbp
	call	mdt_phdr_valid@PLT
	test	eax, eax
	je	.L21
	mov	rbx, QWORD PTR 8[rbp]
	mov	rax, QWORD PTR 16[rbp]
	sub	rbx, r14
	lea	rdx, [rax+rbx]
	cmp	rdx, QWORD PTR 176[rsp]
	ja	.L55
	mov	rdx, QWORD PTR 24[rbp]
	add	rbx, QWORD PTR [rsp]
	test	rdx, rdx
	je	.L23
	mov	rsi, QWORD PTR 32[rbp]
	mov	rax, QWORD PTR 8[r13]
	cmp	rsi, rax
	jge	.L24
	lea	rcx, [rsi+rdx]
	cmp	rcx, rax
	ja	.L56
	add	rsi, QWORD PTR 0[r13]
	mov	rdi, rbx
	call	memcpy@PLT
	mov	rax, QWORD PTR 16[rbp]
	mov	rdx, QWORD PTR 24[rbp]
.L23:
	cmp	rdx, rax
	jnb	.L21
	sub	rax, rdx
	lea	rdi, [rbx+rdx]
	xor	esi, esi
	mov	rdx, rax
	call	memset@PLT
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L2:
	mov	r8d, DWORD PTR EINVAL[rip]
	neg	r8d
.L1:
	mov	rax, QWORD PTR 104[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L57
	add	rsp, 120
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r8d
	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
.L24:
	.cfi_restore_state
	mov	rdi, QWORD PTR 24[rsp]
	mov	edx, r12d
	add	rdi, QWORD PTR 40[rsp]
	lea	rsi, .LC4[rip]
	call	sprintf@PLT
	mov	r8, QWORD PTR 24[rbp]
	mov	rdx, QWORD PTR 8[rsp]
	mov	rcx, rbx
	mov	rsi, QWORD PTR 24[rsp]
	lea	rdi, 88[rsp]
	call	request_firmware_into_buf@PLT
	test	eax, eax
	jne	.L58
	mov	rdi, QWORD PTR 88[rsp]
	call	release_firmware@PLT
	mov	rax, QWORD PTR 16[rbp]
	mov	rdx, QWORD PTR 24[rbp]
	jmp	.L23
.L52:
	mov	r14, QWORD PTR 40[rsp]
	.p2align 4,,10
	.p2align 3
.L9:
	xor	r8d, r8d
.L19:
	mov	rax, QWORD PTR 32[rsp]
	test	rax, rax
	je	.L11
	mov	QWORD PTR [rax], r14
.L11:
	mov	rdi, QWORD PTR 24[rsp]
	mov	DWORD PTR [rsp], r8d
	call	kfree@PLT
	mov	r8d, DWORD PTR [rsp]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rdi, rbp
	lea	rsi, 96[rsp]
	call	qcom_mdt_read_metadata@PLT
	mov	rdi, rax
	mov	r12, rax
	call	IS_ERR@PLT
	test	rax, rax
	jne	.L59
	mov	rdx, QWORD PTR 96[rsp]
	mov	edi, DWORD PTR 52[rsp]
	mov	rsi, r12
	call	qcom_scm_pas_init_image@PLT
	mov	rdi, r12
	mov	DWORD PTR 64[rsp], eax
	call	kfree@PLT
	mov	r8d, DWORD PTR 64[rsp]
	test	r8d, r8d
	je	.L12
	mov	rdi, QWORD PTR 8[rsp]
	lea	rsi, .LC0[rip]
	xor	eax, eax
	mov	DWORD PTR [rsp], r8d
	call	dev_err@PLT
	mov	r8d, DWORD PTR [rsp]
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L30:
	mov	r14, QWORD PTR 40[rsp]
	jmp	.L16
.L54:
	mov	rdx, r13
	mov	rsi, QWORD PTR 40[rsp]
	mov	edi, DWORD PTR 52[rsp]
	sub	rdx, r14
	call	qcom_scm_pas_mem_setup@PLT
	test	eax, eax
	jne	.L17
	mov	eax, DWORD PTR [r15]
	jmp	.L16
.L59:
	mov	rdi, r12
	call	PTR_ERR@PLT
	mov	r8d, eax
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L55:
	mov	rdi, QWORD PTR 8[rsp]
	lea	rsi, .LC2[rip]
	xor	eax, eax
	call	dev_err@PLT
	mov	r8d, DWORD PTR EINVAL[rip]
	neg	r8d
	jmp	.L19
.L56:
	mov	rcx, QWORD PTR 16[rsp]
	mov	rdi, QWORD PTR 8[rsp]
	mov	edx, r12d
	xor	eax, eax
	lea	rsi, .LC3[rip]
	call	dev_err@PLT
	mov	r8d, DWORD PTR EINVAL[rip]
	neg	r8d
	jmp	.L19
.L58:
	mov	rdx, QWORD PTR 24[rsp]
	mov	rdi, QWORD PTR 8[rsp]
	mov	DWORD PTR [rsp], eax
	xor	eax, eax
	lea	rsi, .LC5[rip]
	call	dev_err@PLT
	mov	r8d, DWORD PTR [rsp]
	jmp	.L19
.L17:
	mov	rdi, QWORD PTR 8[rsp]
	mov	DWORD PTR [rsp], eax
	lea	rsi, .LC1[rip]
	xor	eax, eax
	call	dev_err@PLT
	mov	r8d, DWORD PTR [rsp]
	jmp	.L11
.L57:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	__qcom_mdt_load, .-__qcom_mdt_load
	.comm	SZ_4K,4,4
	.comm	QCOM_MDT_RELOCATABLE,4,4
	.comm	PHYS_ADDR_MAX,8,8
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,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_mdt_loader.c___qcom_mdt_load.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"invalid firmware metadata\012\000"
	.align	2
.LC1:
	.ascii	"unable to setup relocation\012\000"
	.align	2
.LC2:
	.ascii	"segment outside memory range\012\000"
	.align	2
.LC3:
	.ascii	"failed to load segment %d from truncated file %s\012"
	.ascii	"\000"
	.align	2
.LC4:
	.ascii	"b%02d\000"
	.align	2
.LC5:
	.ascii	"failed to load %s\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	__qcom_mdt_load, %function
__qcom_mdt_load:
	@ args = 20, pretend = 0, frame = 48
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #60
	ldr	r7, [sp, #96]
	str	r3, [sp, #20]
	cmp	r7, #0
	cmpne	r1, #0
	ldr	r3, .L59
	str	r0, [sp, #8]
	str	r2, [sp, #12]
	ldr	r3, [r3]
	str	r3, [sp, #52]
	mov	r3,#0
	ldr	r3, [sp, #108]
	str	r3, [sp, #16]
	beq	.L2
	ldr	r3, [sp, #100]
	ldr	r2, [sp, #104]
	cmp	r2, #0
	cmpne	r3, #0
	beq	.L2
	ldr	r5, [sp, #12]
	mov	r4, r1
	mov	r0, r5
	bl	strlen
	cmp	r0, #4
	str	r0, [sp, #28]
	bls	.L2
	ldr	r2, .L59+4
	ldr	r3, .L59+8
	mov	r0, r5
	ldr	r1, [r2]
	ldr	r5, [r3]
	ldr	r6, [r4]
	bl	kstrdup
	subs	r3, r0, #0
	str	r3, [sp, #24]
	beq	.L51
	ldr	r3, [sp, #112]
	cmp	r3, #0
	bne	.L6
.L11:
	ldr	r3, [r6]
	cmp	r3, #0
	ldrle	r5, [sp, #100]
	ble	.L8
	mov	r10, #0
	add	r3, r6, #4
	str	r4, [sp, #36]
	mov	r9, r10
	mov	r8, r3
	mov	r4, r10
	ldr	fp, .L59+12
	str	r3, [sp, #32]
	b	.L14
.L12:
	ldr	r1, [r6]
	add	r4, r4, #1
	cmp	r1, r4
	add	r8, r8, #20
	ble	.L52
.L14:
	mov	r0, r8
	bl	mdt_phdr_valid
	cmp	r0, #0
	beq	.L12
	ldr	r0, [r8]
	ldr	r1, [fp]
	ldr	r2, [r8, #4]
	tst	r0, r1
	ldr	r0, [r8, #8]
	movne	r9, #1
	add	r0, r2, r0
	cmp	r5, r2
	movge	r5, r2
	cmp	r0, r10
	bls	.L12
	ldr	r3, .L59+16
	ldr	r1, [r3]
	bl	ALIGN
	mov	r10, r0
	b	.L12
.L2:
	ldr	r3, .L59+20
	ldr	r10, [r3]
	rsb	r10, r10, #0
.L1:
	ldr	r3, .L59
	ldr	r2, [r3]
	ldr	r3, [sp, #52]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L53
	mov	r0, r10
	add	sp, sp, #60
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L52:
	cmp	r9, #0
	ldr	r4, [sp, #36]
	beq	.L29
	ldr	r3, [sp, #112]
	cmp	r3, #0
	bne	.L54
.L15:
	cmp	r1, #0
	ble	.L8
	ldr	r3, [sp, #28]
	mov	r9, #0
	sub	r0, r3, #3
	ldr	r3, [sp, #24]
	ldr	r8, [sp, #32]
	add	r3, r3, r0
	ldr	fp, [sp, #104]
	str	r3, [sp, #20]
	b	.L27
.L20:
	ldr	r3, [r6]
	add	r9, r9, #1
	cmp	r3, r9
	add	r8, r8, #20
	ble	.L8
.L27:
	mov	r0, r8
	bl	mdt_phdr_valid
	cmp	r0, #0
	beq	.L20
	ldr	r3, [r8, #4]
	ldr	r2, [r8, #8]
	sub	r3, r3, r5
	add	r1, r2, r3
	cmp	r1, fp
	bhi	.L55
	ldr	r0, [r8, #12]
	add	r10, r7, r3
	cmp	r0, #0
	beq	.L22
	ldr	r1, [r8, #16]
	ldr	r2, [r4, #4]
	cmp	r1, r2
	bge	.L23
	add	ip, r1, r0
	cmp	ip, r2
	bhi	.L56
	ldr	ip, [r4]
	mov	r2, r0
	add	r1, r1, ip
	mov	r0, r10
	bl	memcpy
	ldr	r2, [r8, #8]
	ldr	r0, [r8, #12]
.L22:
	cmp	r0, r2
	bcs	.L20
	sub	r2, r2, r0
	mov	r1, #0
	add	r0, r10, r0
	bl	memset
	b	.L20
.L23:
	mov	r2, r9
	ldr	r1, .L59+24
	ldr	r0, [sp, #20]
	bl	sprintf
	ldr	r2, [r8, #12]
	mov	r3, r10
	str	r2, [sp]
	ldr	r1, [sp, #24]
	ldr	r2, [sp, #8]
	add	r0, sp, #44
	bl	request_firmware_into_buf
	cmp	r0, #0
	bne	.L57
	ldr	r0, [sp, #44]
	bl	release_firmware
	ldr	r2, [r8, #8]
	ldr	r0, [r8, #12]
	b	.L22
.L8:
	mov	r10, #0
.L18:
	ldr	r3, [sp, #16]
	cmp	r3, #0
	strne	r5, [r3]
.L10:
	ldr	r0, [sp, #24]
	bl	kfree
	b	.L1
.L6:
	add	r1, sp, #48
	mov	r0, r4
	bl	qcom_mdt_read_metadata
	mov	r9, r0
	bl	IS_ERR
	cmp	r0, #0
	bne	.L58
	mov	r1, r9
	ldr	r2, [sp, #48]
	ldr	r0, [sp, #20]
	bl	qcom_scm_pas_init_image
	mov	r10, r0
	mov	r0, r9
	bl	kfree
	cmp	r10, #0
	beq	.L11
	ldr	r0, [sp, #8]
	ldr	r1, .L59+28
	bl	dev_err
	b	.L10
.L29:
	ldr	r5, [sp, #100]
	b	.L15
.L51:
	ldr	r3, .L59+32
	ldr	r10, [r3]
	rsb	r10, r10, #0
	b	.L1
.L54:
	sub	r2, r10, r5
	ldr	r0, [sp, #20]
	ldr	r1, [sp, #100]
	bl	qcom_scm_pas_mem_setup
	subs	r10, r0, #0
	bne	.L16
	ldr	r1, [r6]
	b	.L15
.L58:
	mov	r0, r9
	bl	PTR_ERR
	mov	r10, r0
	b	.L10
.L55:
	ldr	r0, [sp, #8]
	ldr	r1, .L59+36
	bl	dev_err
	ldr	r3, .L59+20
	ldr	r10, [r3]
	rsb	r10, r10, #0
	b	.L18
.L56:
	ldr	r3, [sp, #12]
	mov	r2, r9
	ldr	r0, [sp, #8]
	ldr	r1, .L59+40
	bl	dev_err
	ldr	r3, .L59+20
	ldr	r10, [r3]
	rsb	r10, r10, #0
	b	.L18
.L57:
	mov	r10, r0
	ldr	r2, [sp, #24]
	ldr	r0, [sp, #8]
	ldr	r1, .L59+44
	bl	dev_err
	b	.L18
.L16:
	ldr	r0, [sp, #8]
	ldr	r1, .L59+48
	bl	dev_err
	b	.L10
.L53:
	bl	__stack_chk_fail
.L60:
	.align	2
.L59:
	.word	.LC6
	.word	GFP_KERNEL
	.word	PHYS_ADDR_MAX
	.word	QCOM_MDT_RELOCATABLE
	.word	SZ_4K
	.word	EINVAL
	.word	.LC4
	.word	.LC0
	.word	ENOMEM
	.word	.LC2
	.word	.LC3
	.word	.LC5
	.word	.LC1
	.size	__qcom_mdt_load, .-__qcom_mdt_load
	.comm	SZ_4K,4,4
	.comm	QCOM_MDT_RELOCATABLE,4,4
	.comm	PHYS_ADDR_MAX,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
