	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_close_tempfile_gently          ## -- Begin function close_tempfile_gently
	.p2align	4, 0x90
_close_tempfile_gently:                 ## @close_tempfile_gently
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	callq	_is_tempfile_active
	xorl	%ecx, %ecx
	testl	%eax, %eax
	je	LBB0_9
## %bb.1:
	movl	(%rbx), %edi
	testl	%edi, %edi
	js	LBB0_9
## %bb.2:
	movq	8(%rbx), %r14
	movl	$-1, (%rbx)
	testq	%r14, %r14
	je	LBB0_7
## %bb.3:
	movq	$0, 8(%rbx)
	movq	%r14, %rdi
	callq	_ferror
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_fclose
	movl	%eax, %ecx
	testq	%rbx, %rbx
	je	LBB0_4
## %bb.5:
	movl	$-1, %eax
	testl	%ecx, %ecx
	jne	LBB0_8
## %bb.6:
	movq	_EIO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_errno@GOTPCREL(%rip), %rdx
	movl	%ecx, (%rdx)
	jmp	LBB0_8
LBB0_7:
	callq	_close
	jmp	LBB0_8
LBB0_4:
	movl	%ecx, %eax
LBB0_8:
	xorl	%ecx, %ecx
	negl	%eax
	sbbl	%ecx, %ecx
LBB0_9:
	movl	%ecx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_errno,4,2                      ## @errno
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_close_tempfile_gently          ; -- Begin function close_tempfile_gently
	.p2align	2
_close_tempfile_gently:                 ; @close_tempfile_gently
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	bl	_is_tempfile_active
	cbz	w0, LBB0_10
; %bb.1:
	ldr	w0, [x19]
	tbnz	w0, #31, LBB0_7
; %bb.2:
	ldr	x20, [x19, #8]
	mov	w8, #-1
	str	w8, [x19]
	cbz	x20, LBB0_8
; %bb.3:
	str	xzr, [x19, #8]
	mov	x0, x20
	bl	_ferror
	mov	x19, x0
	mov	x0, x20
	bl	_fclose
	cbz	x19, LBB0_9
; %bb.4:
	cbnz	w0, LBB0_6
; %bb.5:
Lloh0:
	adrp	x8, _EIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _errno@GOTPAGE
Lloh4:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh5:
	str	w8, [x9]
LBB0_6:
	mov	w0, #-1
	b	LBB0_9
LBB0_7:
	mov	w0, #0
	b	LBB0_10
LBB0_8:
	bl	_close
LBB0_9:
	cmp	w0, #0
	csetm	w0, ne
LBB0_10:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotStr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_errno,4,2                      ; @errno
.subsections_via_symbols
