	.file	"extr_close.c_close.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	close
	.type	close, @function
close:
.LFB0:
	.cfi_startproc
	endbr64
	movsx	rax, edi
	cmp	edi, DWORD PTR SOPEN_MAX[rip]
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	lea	rdx, [rax+rax*4]
	mov	rax, QWORD PTR files[rip]
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	lea	rbx, [rax+rdx*8]
	jnb	.L2
	mov	eax, DWORD PTR [rbx]
	test	eax, eax
	je	.L2
	mov	rdi, QWORD PTR 32[rbx]
	call	free@PLT
	mov	eax, DWORD PTR [rbx]
	mov	QWORD PTR 32[rbx], 0
	mov	ebp, eax
	and	ebp, DWORD PTR F_RAW[rip]
	je	.L22
	xor	ebp, ebp
.L5:
	and	eax, DWORD PTR F_NODEV[rip]
	mov	r12d, eax
	jne	.L10
.L25:
	mov	rax, QWORD PTR 16[rbx]
	test	rax, rax
	je	.L6
	mov	rdi, rbx
	call	[QWORD PTR [rax]]
	mov	r12d, eax
.L6:
	cmp	QWORD PTR 8[rbx], 0
	je	.L7
	mov	rdi, rbx
	call	devclose@PLT
.L7:
	mov	DWORD PTR [rbx], 0
	test	ebp, ebp
	jne	.L23
	test	r12d, r12d
	jne	.L24
.L1:
	mov	eax, r12d
	pop	rbx
	.cfi_remember_state
	.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
.L22:
	.cfi_restore_state
	mov	rdx, QWORD PTR 24[rbx]
	test	rdx, rdx
	je	.L5
	mov	rdi, rbx
	call	[QWORD PTR [rdx]]
	mov	ebp, eax
	mov	eax, DWORD PTR [rbx]
	and	eax, DWORD PTR F_NODEV[rip]
	mov	r12d, eax
	je	.L25
.L10:
	xor	r12d, r12d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	mov	eax, DWORD PTR EBADF[rip]
	mov	r12d, -1
	mov	DWORD PTR errno[rip], eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L23:
	mov	DWORD PTR errno[rip], ebp
	mov	r12d, -1
	jmp	.L1
.L24:
	mov	DWORD PTR errno[rip], r12d
	mov	r12d, -1
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	close, .-close
	.comm	files,8,8
	.comm	errno,4,4
	.comm	SOPEN_MAX,4,4
	.comm	F_RAW,4,4
	.comm	F_NODEV,4,4
	.comm	EBADF,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_close.c_close.c"
	.text
	.align	2
	.global	close
	.syntax unified
	.arm
	.fpu softvfp
	.type	close, %function
close:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L27
	ldr	r2, .L27+4
	ldr	r3, [r3]
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r7, [r2]
	cmp	r0, r3
	add	r0, r0, r0, lsl #2
	add	r4, r7, r0, lsl #2
	bcs	.L2
	lsl	r8, r0, #2
	ldr	r3, [r7, r8]
	cmp	r3, #0
	beq	.L2
	ldr	r0, [r4, #16]
	bl	free
	mov	r2, #0
	ldr	r1, .L27+8
	ldr	r3, [r7, r8]
	ldr	r0, [r1]
	str	r2, [r4, #16]
	ands	r6, r3, r0
	movne	r6, r2
	bne	.L5
	ldr	r2, [r4, #12]
	cmp	r2, #0
	beq	.L5
	ldr	r3, [r2]
	mov	r0, r4
	blx	r3
	mov	r6, r0
	ldr	r3, [r7, r8]
.L5:
	ldr	r2, .L27+12
	ldr	r5, [r2]
	ands	r5, r3, r5
	movne	r5, #0
	beq	.L25
.L6:
	ldr	r3, [r4, #4]
	cmp	r3, #0
	beq	.L7
	mov	r0, r4
	bl	devclose
.L7:
	mov	r3, #0
	cmp	r6, r3
	str	r3, [r7, r8]
	bne	.L26
	cmp	r5, #0
	ldrne	r3, .L27+16
	strne	r5, [r3]
	mvnne	r5, #0
.L1:
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L25:
	ldr	r3, [r4, #8]
	cmp	r3, #0
	beq	.L6
	mov	r0, r4
	ldr	r3, [r3]
	blx	r3
	mov	r5, r0
	b	.L6
.L2:
	ldr	r2, .L27+20
	ldr	r3, .L27+16
	ldr	r2, [r2]
	mvn	r5, #0
	str	r2, [r3]
	b	.L1
.L26:
	ldr	r3, .L27+16
	mvn	r5, #0
	str	r6, [r3]
	b	.L1
.L28:
	.align	2
.L27:
	.word	SOPEN_MAX
	.word	files
	.word	F_RAW
	.word	F_NODEV
	.word	errno
	.word	EBADF
	.size	close, .-close
	.comm	files,4,4
	.comm	errno,4,4
	.comm	SOPEN_MAX,4,4
	.comm	F_RAW,4,4
	.comm	F_NODEV,4,4
	.comm	EBADF,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
