	.file	"extr_sections.c_copy_shdr.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"gelf_getshdr() failed: %s"
.LC1:
	.string	"malloc failed"
.LC2:
	.string	"elf_update_shdr failed: %s"
	.text
	.p2align 4
	.globl	copy_shdr
	.type	copy_shdr, @function
copy_shdr:
.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
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, r8d
	sub	rsp, 136
	.cfi_def_cfa_offset 192
	mov	edi, DWORD PTR 60[rsi]
	mov	DWORD PTR 12[rsp], ecx
	lea	r15, 16[rsp]
	mov	rsi, r15
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 120[rsp], rax
	xor	eax, eax
	call	gelf_getshdr@PLT
	test	rax, rax
	je	.L32
.L2:
	lea	r14, 64[rsp]
	mov	edi, DWORD PTR 32[r13]
	mov	rsi, r14
	call	gelf_getshdr@PLT
	test	rax, rax
	je	.L33
.L3:
	mov	eax, DWORD PTR 12[rsp]
	test	eax, eax
	jne	.L34
	mov	rdx, QWORD PTR 52[r13]
	mov	rax, QWORD PTR 0[r13]
	mov	rsi, QWORD PTR 8[r13]
	mov	QWORD PTR 100[rsp], rdx
	mov	rdx, QWORD PTR 44[rsp]
	mov	QWORD PTR 64[rsp], rax
	mov	QWORD PTR 92[rsp], rdx
	mov	edx, DWORD PTR 48[r13]
	mov	QWORD PTR 72[rsp], rsi
	mov	DWORD PTR 88[rsp], edx
	mov	edx, DWORD PTR 36[rsp]
	mov	DWORD PTR 84[rsp], edx
	test	ebx, ebx
	jne	.L35
	mov	eax, DWORD PTR 32[rsp]
	mov	rdx, QWORD PTR 16[rsp]
	cmp	rdx, QWORD PTR SHT_REL[rip]
	mov	DWORD PTR 80[rsp], eax
	je	.L13
	cmp	rdx, QWORD PTR SHT_RELA[rip]
	je	.L13
.L5:
	test	rbp, rbp
	je	.L36
.L14:
	mov	rsi, rbp
	mov	rdi, r12
	call	add_to_shstrtab@PLT
	mov	edi, DWORD PTR 32[r13]
	mov	rsi, r14
	call	gelf_update_shdr@PLT
	test	eax, eax
	je	.L37
.L1:
	mov	rax, QWORD PTR 120[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L38
	add	rsp, 136
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L35:
	.cfi_restore_state
	mov	DWORD PTR 80[rsp], 0
	test	DWORD PTR SF_ALLOC[rip], ebx
	je	.L7
	mov	edx, DWORD PTR SHF_ALLOC[rip]
	mov	DWORD PTR 80[rsp], edx
.L7:
	test	DWORD PTR SF_READONLY[rip], ebx
	jne	.L8
	mov	edx, DWORD PTR SHF_WRITE[rip]
	or	DWORD PTR 80[rsp], edx
.L8:
	test	DWORD PTR SF_CODE[rip], ebx
	je	.L9
	mov	edx, DWORD PTR SHF_EXECINSTR[rip]
	or	DWORD PTR 80[rsp], edx
.L9:
	test	DWORD PTR SF_CONTENTS[rip], ebx
	je	.L5
	cmp	QWORD PTR SHT_NOBITS[rip], rax
	jne	.L5
	test	rsi, rsi
	jle	.L5
	mov	rax, QWORD PTR SHT_PROGBITS[rip]
	mov	edi, 1
	mov	QWORD PTR 0[r13], rax
	mov	QWORD PTR 64[rsp], rax
	call	calloc@PLT
	mov	QWORD PTR 40[r13], rax
	test	rax, rax
	je	.L39
.L12:
	mov	DWORD PTR 16[r13], 1
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L34:
	mov	edx, 48
	mov	rsi, r15
	mov	rdi, r14
	call	memcpy@PLT
	test	rbp, rbp
	jne	.L14
.L36:
	mov	rsi, QWORD PTR 24[r13]
	mov	rdi, r12
	call	add_to_shstrtab@PLT
	mov	edi, DWORD PTR 32[r13]
	mov	rsi, r14
	call	gelf_update_shdr@PLT
	test	eax, eax
	jne	.L1
.L37:
	mov	edi, -1
	call	elf_errmsg@PLT
	mov	edi, DWORD PTR EXIT_FAILURE[rip]
	lea	rsi, .LC2[rip]
	mov	edx, eax
	call	errx@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	or	eax, DWORD PTR SHF_INFO_LINK[rip]
	mov	DWORD PTR 80[rsp], eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L32:
	mov	edi, -1
	call	elf_errmsg@PLT
	mov	edi, DWORD PTR EXIT_FAILURE[rip]
	lea	rsi, .LC0[rip]
	mov	edx, eax
	call	errx@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L33:
	mov	edi, -1
	call	elf_errmsg@PLT
	mov	edi, DWORD PTR EXIT_FAILURE[rip]
	lea	rsi, .LC0[rip]
	mov	edx, eax
	call	errx@PLT
	jmp	.L3
.L39:
	mov	edi, DWORD PTR EXIT_FAILURE[rip]
	lea	rsi, .LC1[rip]
	call	err@PLT
	jmp	.L12
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	copy_shdr, .-copy_shdr
	.comm	SHT_RELA,8,8
	.comm	SHT_REL,8,8
	.comm	SHT_PROGBITS,8,8
	.comm	SHT_NOBITS,8,8
	.comm	SHF_WRITE,4,4
	.comm	SHF_INFO_LINK,4,4
	.comm	SHF_EXECINSTR,4,4
	.comm	SHF_ALLOC,4,4
	.comm	SF_READONLY,4,4
	.comm	SF_CONTENTS,4,4
	.comm	SF_CODE,4,4
	.comm	SF_ALLOC,4,4
	.comm	EXIT_FAILURE,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_sections.c_copy_shdr.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"gelf_getshdr() failed: %s\000"
	.align	2
.LC1:
	.ascii	"malloc failed\000"
	.align	2
.LC2:
	.ascii	"elf_update_shdr failed: %s\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	copy_shdr
	.syntax unified
	.arm
	.fpu softvfp
	.type	copy_shdr, %function
copy_shdr:
	@ args = 4, pretend = 0, frame = 80
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r6, r3
	sub	sp, sp, #84
	ldr	r3, .L34
	mov	r4, r1
	mov	r7, r0
	ldr	r0, [r1, #36]
	add	r1, sp, #4
	mov	r5, r2
	ldr	r3, [r3]
	str	r3, [sp, #76]
	mov	r3,#0
	ldr	r8, [sp, #112]
	bl	gelf_getshdr
	cmp	r0, #0
	beq	.L29
.L2:
	ldr	r0, [r4, #16]
	add	r1, sp, #40
	bl	gelf_getshdr
	cmp	r0, #0
	beq	.L30
.L3:
	cmp	r6, #0
	beq	.L4
	add	ip, sp, #4
	add	lr, sp, #40
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldr	r3, [ip]
	str	r3, [lr]
.L5:
	cmp	r5, #0
	movne	r1, r5
	ldreq	r1, [r4, #12]
	moveq	r0, r7
	movne	r0, r7
	bl	add_to_shstrtab
	ldr	r0, [r4, #16]
	add	r1, sp, #40
	bl	gelf_update_shdr
	cmp	r0, #0
	beq	.L31
.L1:
	ldr	r3, .L34
	ldr	r2, [r3]
	ldr	r3, [sp, #76]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L32
	add	sp, sp, #84
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L4:
	ldr	r0, [r4, #32]
	ldr	r2, [r4, #28]
	str	r0, [sp, #72]
	str	r2, [sp, #68]
	ldr	r0, [sp, #28]
	ldr	r2, [sp, #24]
	ldr	r3, [r4]
	ldr	r1, [r4, #4]
	str	r0, [sp, #64]
	str	r2, [sp, #60]
	ldr	r0, [r4, #24]
	ldr	r2, [sp, #16]
	cmp	r8, #0
	str	r3, [sp, #40]
	str	r1, [sp, #44]
	str	r0, [sp, #56]
	str	r2, [sp, #52]
	beq	.L6
	ldr	r2, .L34+4
	str	r6, [sp, #48]
	ldr	r2, [r2]
	tst	r8, r2
	ldrne	r2, .L34+8
	ldrne	r2, [r2]
	strne	r2, [sp, #48]
	ldr	r2, .L34+12
	ldr	r2, [r2]
	tst	r8, r2
	ldreq	r0, .L34+16
	ldreq	r2, [sp, #48]
	ldreq	r0, [r0]
	orreq	r2, r2, r0
	streq	r2, [sp, #48]
	ldr	r2, .L34+20
	ldr	r2, [r2]
	tst	r8, r2
	ldrne	r0, .L34+24
	ldrne	r2, [sp, #48]
	ldrne	r0, [r0]
	orrne	r2, r2, r0
	strne	r2, [sp, #48]
	ldr	r2, .L34+28
	ldr	r2, [r2]
	tst	r8, r2
	beq	.L5
	ldr	r2, .L34+32
	cmp	r1, #0
	ldr	r2, [r2]
	sub	r3, r2, r3
	clz	r3, r3
	lsr	r3, r3, #5
	movle	r3, #0
	cmp	r3, #0
	beq	.L5
	ldr	r3, .L34+36
	mov	r0, #1
	ldr	r3, [r3]
	str	r3, [r4]
	str	r3, [sp, #40]
	bl	calloc
	cmp	r0, #0
	str	r0, [r4, #20]
	beq	.L33
.L12:
	mov	r3, #1
	str	r3, [r4, #8]
	b	.L5
.L31:
	ldr	r3, .L34+40
	mvn	r0, #0
	ldr	r4, [r3]
	bl	elf_errmsg
	ldr	r1, .L34+44
	mov	r2, r0
	mov	r0, r4
	bl	errx
	b	.L1
.L6:
	ldr	r2, .L34+48
	ldr	r3, [sp, #4]
	ldr	r1, [r2]
	ldr	r2, [sp, #12]
	cmp	r3, r1
	str	r2, [sp, #48]
	beq	.L13
	ldr	r1, .L34+52
	ldr	r1, [r1]
	cmp	r3, r1
	bne	.L5
.L13:
	ldr	r3, .L34+56
	ldr	r3, [r3]
	orr	r2, r3, r2
	str	r2, [sp, #48]
	b	.L5
.L29:
	ldr	r3, .L34+40
	mvn	r0, #0
	ldr	r9, [r3]
	bl	elf_errmsg
	ldr	r1, .L34+60
	mov	r2, r0
	mov	r0, r9
	bl	errx
	b	.L2
.L30:
	ldr	r3, .L34+40
	mvn	r0, #0
	ldr	r9, [r3]
	bl	elf_errmsg
	ldr	r1, .L34+60
	mov	r2, r0
	mov	r0, r9
	bl	errx
	b	.L3
.L32:
	bl	__stack_chk_fail
.L33:
	ldr	r3, .L34+40
	ldr	r1, .L34+64
	ldr	r0, [r3]
	bl	err
	b	.L12
.L35:
	.align	2
.L34:
	.word	.LC3
	.word	SF_ALLOC
	.word	SHF_ALLOC
	.word	SF_READONLY
	.word	SHF_WRITE
	.word	SF_CODE
	.word	SHF_EXECINSTR
	.word	SF_CONTENTS
	.word	SHT_NOBITS
	.word	SHT_PROGBITS
	.word	EXIT_FAILURE
	.word	.LC2
	.word	SHT_REL
	.word	SHT_RELA
	.word	SHF_INFO_LINK
	.word	.LC0
	.word	.LC1
	.size	copy_shdr, .-copy_shdr
	.comm	SHT_RELA,4,4
	.comm	SHT_REL,4,4
	.comm	SHT_PROGBITS,4,4
	.comm	SHT_NOBITS,4,4
	.comm	SHF_WRITE,4,4
	.comm	SHF_INFO_LINK,4,4
	.comm	SHF_EXECINSTR,4,4
	.comm	SHF_ALLOC,4,4
	.comm	SF_READONLY,4,4
	.comm	SF_CONTENTS,4,4
	.comm	SF_CODE,4,4
	.comm	SF_ALLOC,4,4
	.comm	EXIT_FAILURE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
