	.file	"4671.c"
	.intel_syntax noprefix
	.text
	.globl	x
	.bss
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.section	.rodata
.LC0:
	.string	"libtest1.so"
.LC1:
	.string	"Can't load library: %s\n"
.LC2:
	.string	"Loaded !"
.LC3:
	.string	"test1_set"
.LC4:
	.string	"Can't find test function\n"
.LC5:
	.string	"Test function called !"
	.align 8
.LC6:
	.string	"Test function failed to set variable !\n"
.LC7:
	.string	"Unloaded !"
.LC8:
	.string	"Test destructor called !"
	.align 8
.LC9:
	.string	"Test destructor was *not* called !\n"
	.align 8
.LC10:
	.string	"Test destructor called but returned invalid value (%d)\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	esi, 2
	lea	rdi, .LC0[rip]
	call	dlopen@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jne	.L2
	call	dlerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L3
.L2:
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -16[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	call	dlsym@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L4
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 25
	mov	esi, 1
	lea	rdi, .LC4[rip]
	call	fwrite@PLT
	mov	eax, 2
	jmp	.L3
.L4:
	mov	DWORD PTR x[rip], 0
	mov	rax, QWORD PTR -8[rbp]
	lea	rdi, x[rip]
	call	rax
	mov	eax, DWORD PTR x[rip]
	cmp	eax, 1
	jne	.L5
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	dlclose@PLT
	lea	rdi, .LC7[rip]
	call	puts@PLT
	mov	eax, DWORD PTR x[rip]
	cmp	eax, 2
	jne	.L7
	jmp	.L10
.L5:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 39
	mov	esi, 1
	lea	rdi, .LC6[rip]
	call	fwrite@PLT
	mov	eax, 3
	jmp	.L3
.L10:
	lea	rdi, .LC8[rip]
	call	puts@PLT
	mov	eax, 0
	jmp	.L3
.L7:
	mov	eax, DWORD PTR x[rip]
	cmp	eax, 1
	jne	.L9
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 35
	mov	esi, 1
	lea	rdi, .LC9[rip]
	call	fwrite@PLT
	mov	eax, 4
	jmp	.L3
.L9:
	mov	edx, DWORD PTR x[rip]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC10[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 5
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"4671.c"
	.text
	.comm	x,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"libtest1.so\000"
	.align	2
.LC1:
	.ascii	"Can't load library: %s\012\000"
	.align	2
.LC2:
	.ascii	"Loaded !\000"
	.align	2
.LC3:
	.ascii	"test1_set\000"
	.align	2
.LC4:
	.ascii	"Can't find test function\012\000"
	.align	2
.LC5:
	.ascii	"Test function called !\000"
	.align	2
.LC6:
	.ascii	"Test function failed to set variable !\012\000"
	.align	2
.LC7:
	.ascii	"Unloaded !\000"
	.align	2
.LC8:
	.ascii	"Test destructor called !\000"
	.align	2
.LC9:
	.ascii	"Test destructor was *not* called !\012\000"
	.align	2
.LC10:
	.ascii	"Test destructor called but returned invalid value ("
	.ascii	"%d)\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #12
	mov	r1, #2
	ldr	r0, .L11
	bl	dlopen
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L2
	ldr	r3, .L11+4
	ldr	r4, [r3]
	bl	dlerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L11+8
	mov	r0, r4
	bl	fprintf
	mov	r3, #1
	b	.L3
.L2:
	ldr	r0, .L11+12
	bl	puts
	ldr	r1, .L11+16
	ldr	r0, [fp, #-20]
	bl	dlsym
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L4
	ldr	r3, .L11+4
	ldr	r3, [r3]
	mov	r2, #25
	mov	r1, #1
	ldr	r0, .L11+20
	bl	fwrite
	mov	r3, #2
	b	.L3
.L4:
	ldr	r3, .L11+24
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-16]
	ldr	r0, .L11+24
	blx	r3
	ldr	r3, .L11+24
	ldr	r3, [r3]
	cmp	r3, #1
	bne	.L5
	ldr	r0, .L11+28
	bl	puts
	ldr	r0, [fp, #-20]
	bl	dlclose
	ldr	r0, .L11+32
	bl	puts
	ldr	r3, .L11+24
	ldr	r3, [r3]
	cmp	r3, #2
	bne	.L7
	b	.L10
.L5:
	ldr	r3, .L11+4
	ldr	r3, [r3]
	mov	r2, #39
	mov	r1, #1
	ldr	r0, .L11+36
	bl	fwrite
	mov	r3, #3
	b	.L3
.L10:
	ldr	r0, .L11+40
	bl	puts
	mov	r3, #0
	b	.L3
.L7:
	ldr	r3, .L11+24
	ldr	r3, [r3]
	cmp	r3, #1
	bne	.L9
	ldr	r3, .L11+4
	ldr	r3, [r3]
	mov	r2, #35
	mov	r1, #1
	ldr	r0, .L11+44
	bl	fwrite
	mov	r3, #4
	b	.L3
.L9:
	ldr	r3, .L11+4
	ldr	r3, [r3]
	ldr	r2, .L11+24
	ldr	r2, [r2]
	ldr	r1, .L11+48
	mov	r0, r3
	bl	fprintf
	mov	r3, #5
.L3:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC0
	.word	stderr
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	x
	.word	.LC5
	.word	.LC7
	.word	.LC6
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
