	.file	"85504.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Could not load shared library %s: %s\n"
.LC1:
	.string	"%s loaded.\n"
.LC2:
	.string	"x"
	.align 8
.LC3:
	.string	"Could not access global DLL variable (x) in %s: %s\n"
	.align 8
.LC4:
	.string	"Constructor was not run on dlopen(\"%s\") !\n"
.LC5:
	.string	"set_y"
	.align 8
.LC6:
	.string	"Could not access global DLL function (set_y) in %s: %s\n"
	.align 8
.LC7:
	.string	"Could not unload shared library %s: %s\n"
.LC8:
	.string	"%s unloaded.\n"
	.align 8
.LC9:
	.string	"Static destructors was not called on dlclose()!\n"
	.text
	.type	check_library, @function
check_library:
.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, 64
	mov	QWORD PTR -56[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -56[rbp]
	mov	esi, 2
	mov	rdi, rax
	call	dlopen@PLT
	mov	QWORD PTR -32[rbp], rax
	mov	DWORD PTR -36[rbp], 0
	cmp	QWORD PTR -32[rbp], 0
	jne	.L2
	call	dlerror@PLT
	mov	rcx, rax
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -56[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L9
.L2:
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -56[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR -32[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	call	dlsym@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L4
	call	dlerror@PLT
	mov	rcx, rax
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -56[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 10
	jmp	.L9
.L4:
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	eax, 1
	je	.L5
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -56[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 11
	jmp	.L9
.L5:
	mov	rax, QWORD PTR -32[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	call	dlsym@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jne	.L6
	call	dlerror@PLT
	mov	rcx, rax
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -56[rbp]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 12
	jmp	.L9
.L6:
	mov	DWORD PTR -36[rbp], 0
	lea	rax, -36[rbp]
	mov	rdx, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	rdx
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	dlclose@PLT
	test	eax, eax
	jns	.L7
	call	dlerror@PLT
	mov	rcx, rax
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -56[rbp]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 2
	jmp	.L9
.L7:
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -56[rbp]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, DWORD PTR -36[rbp]
	cmp	eax, 2
	je	.L8
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 48
	mov	esi, 1
	lea	rdi, .LC9[rip]
	call	fwrite@PLT
	mov	eax, 2
	jmp	.L9
.L8:
	mov	eax, 0
.L9:
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	check_library, .-check_library
	.section	.rodata
.LC10:
	.string	"libdlclosetest1.so"
.LC11:
	.string	"libdlclosetest2.so"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, .LC10[rip]
	call	check_library
	test	eax, eax
	je	.L12
	mov	eax, 1
	jmp	.L13
.L12:
	lea	rdi, .LC11[rip]
	call	check_library
	test	eax, eax
	je	.L14
	mov	eax, 2
	jmp	.L13
.L14:
	mov	eax, 0
.L13:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	"85504.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Could not load shared library %s: %s\012\000"
	.align	2
.LC1:
	.ascii	"%s loaded.\012\000"
	.align	2
.LC2:
	.ascii	"x\000"
	.align	2
.LC3:
	.ascii	"Could not access global DLL variable (x) in %s: %s\012"
	.ascii	"\000"
	.align	2
.LC4:
	.ascii	"Constructor was not run on dlopen(\"%s\") !\012\000"
	.align	2
.LC5:
	.ascii	"set_y\000"
	.align	2
.LC6:
	.ascii	"Could not access global DLL function (set_y) in %s:"
	.ascii	" %s\012\000"
	.align	2
.LC7:
	.ascii	"Could not unload shared library %s: %s\012\000"
	.align	2
.LC8:
	.ascii	"%s unloaded.\012\000"
	.align	2
.LC9:
	.ascii	"Static destructors was not called on dlclose()!\012"
	.ascii	"\000"
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	check_library, %function
check_library:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #36
	str	r0, [fp, #-40]
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r1, #2
	ldr	r0, [fp, #-40]
	bl	dlopen
	str	r0, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L2
	ldr	r3, .L11+4
	ldr	r4, [r3]
	bl	dlerror
	mov	r3, r0
	ldr	r2, [fp, #-40]
	ldr	r1, .L11+8
	mov	r0, r4
	bl	fprintf
	mov	r3, #1
	b	.L9
.L2:
	ldr	r3, .L11+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-40]
	ldr	r1, .L11+12
	mov	r0, r3
	bl	fprintf
	ldr	r1, .L11+16
	ldr	r0, [fp, #-28]
	bl	dlsym
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L4
	ldr	r3, .L11+4
	ldr	r4, [r3]
	bl	dlerror
	mov	r3, r0
	ldr	r2, [fp, #-40]
	ldr	r1, .L11+20
	mov	r0, r4
	bl	fprintf
	mov	r3, #10
	b	.L9
.L4:
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	cmp	r3, #1
	beq	.L5
	ldr	r3, .L11+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-40]
	ldr	r1, .L11+24
	mov	r0, r3
	bl	fprintf
	mov	r3, #11
	b	.L9
.L5:
	ldr	r1, .L11+28
	ldr	r0, [fp, #-28]
	bl	dlsym
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L6
	ldr	r3, .L11+4
	ldr	r4, [r3]
	bl	dlerror
	mov	r3, r0
	ldr	r2, [fp, #-40]
	ldr	r1, .L11+32
	mov	r0, r4
	bl	fprintf
	mov	r3, #12
	b	.L9
.L6:
	mov	r3, #0
	str	r3, [fp, #-32]
	sub	r2, fp, #32
	ldr	r3, [fp, #-20]
	mov	r0, r2
	blx	r3
	ldr	r0, [fp, #-28]
	bl	dlclose
	mov	r3, r0
	cmp	r3, #0
	bge	.L7
	ldr	r3, .L11+4
	ldr	r4, [r3]
	bl	dlerror
	mov	r3, r0
	ldr	r2, [fp, #-40]
	ldr	r1, .L11+36
	mov	r0, r4
	bl	fprintf
	mov	r3, #2
	b	.L9
.L7:
	ldr	r3, .L11+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-40]
	ldr	r1, .L11+40
	mov	r0, r3
	bl	fprintf
	ldr	r3, [fp, #-32]
	cmp	r3, #2
	beq	.L8
	ldr	r3, .L11+4
	ldr	r3, [r3]
	mov	r2, #48
	mov	r1, #1
	ldr	r0, .L11+44
	bl	fwrite
	mov	r3, #2
	b	.L9
.L8:
	mov	r3, #0
.L9:
	ldr	r2, .L11
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L10
	bl	__stack_chk_fail
.L10:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC10
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.size	check_library, .-check_library
	.section	.rodata
	.align	2
.LC11:
	.ascii	"libdlclosetest1.so\000"
	.align	2
.LC12:
	.ascii	"libdlclosetest2.so\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L17
	bl	check_library
	mov	r3, r0
	cmp	r3, #0
	beq	.L14
	mov	r3, #1
	b	.L15
.L14:
	ldr	r0, .L17+4
	bl	check_library
	mov	r3, r0
	cmp	r3, #0
	beq	.L16
	mov	r3, #2
	b	.L15
.L16:
	mov	r3, #0
.L15:
	mov	r0, r3
	pop	{fp, pc}
.L18:
	.align	2
.L17:
	.word	.LC11
	.word	.LC12
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
