	.file	"extr_tempfile.c_close_tempfile_gently.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	close_tempfile_gently
	.type	close_tempfile_gently, @function
close_tempfile_gently:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	call	is_tempfile_active@PLT
	test	eax, eax
	je	.L1
	mov	edi, DWORD PTR [rbx]
	xor	eax, eax
	test	edi, edi
	js	.L1
	mov	rbp, QWORD PTR 8[rbx]
	mov	DWORD PTR [rbx], -1
	test	rbp, rbp
	je	.L3
	mov	QWORD PTR 8[rbx], 0
	mov	rdi, rbp
	call	ferror@PLT
	mov	rdi, rbp
	test	rax, rax
	je	.L4
	call	fclose@PLT
	mov	r8d, eax
	mov	eax, -1
	test	r8d, r8d
	jne	.L1
	mov	edx, DWORD PTR EIO[rip]
	mov	DWORD PTR errno[rip], edx
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	call	fclose@PLT
.L5:
	test	eax, eax
	setne	al
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movzx	eax, al
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	neg	eax
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	call	close@PLT
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	close_tempfile_gently, .-close_tempfile_gently
	.comm	errno,4,4
	.comm	EIO,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_tempfile.c_close_tempfile_gently.c"
	.text
	.align	2
	.global	close_tempfile_gently
	.syntax unified
	.arm
	.fpu softvfp
	.type	close_tempfile_gently, %function
close_tempfile_gently:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r5, r0
	bl	is_tempfile_active
	cmp	r0, #0
	popeq	{r4, r5, r6, pc}
	ldr	r0, [r5]
	cmp	r0, #0
	blt	.L6
	mvn	r4, #0
	ldr	r6, [r5, #4]
	str	r4, [r5]
	cmp	r6, #0
	beq	.L3
	mov	r3, #0
	mov	r0, r6
	str	r3, [r5, #4]
	bl	ferror
	cmp	r0, #0
	mov	r0, r6
	beq	.L4
	bl	fclose
	cmp	r0, #0
	bne	.L7
	ldr	r2, .L13
	ldr	r3, .L13+4
	ldr	r2, [r2]
	mov	r0, r4
	str	r2, [r3]
	pop	{r4, r5, r6, pc}
.L6:
	mov	r0, #0
	pop	{r4, r5, r6, pc}
.L4:
	bl	fclose
.L5:
	subs	r0, r0, #0
	movne	r0, #1
	rsb	r0, r0, #0
	pop	{r4, r5, r6, pc}
.L3:
	bl	close
	b	.L5
.L7:
	mov	r0, r4
	pop	{r4, r5, r6, pc}
.L14:
	.align	2
.L13:
	.word	EIO
	.word	errno
	.size	close_tempfile_gently, .-close_tempfile_gently
	.comm	errno,4,4
	.comm	EIO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
