	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rename_tempfile                ## -- Begin function rename_tempfile
	.p2align	4, 0x90
_rename_tempfile:                       ## @rename_tempfile
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_is_tempfile_active
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_BUG
LBB0_2:
	movq	%rbx, %rdi
	callq	_close_tempfile_gently
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_delete_tempfile
	movl	$-1, %eax
	jmp	LBB0_7
LBB0_4:
	movl	(%rbx), %edi
	movq	%r15, %rsi
	callq	_rename
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	_errno@GOTPCREL(%rip), %r15
	movl	(%r15), %ebx
	movq	%r14, %rdi
	callq	_delete_tempfile
	movl	%ebx, (%r15)
	movl	$-1, %eax
	jmp	LBB0_7
LBB0_6:
	movq	%rbx, %rdi
	callq	_deactivate_tempfile
	movq	$0, (%r14)
	xorl	%eax, %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rename_tempfile called for inactive object"

	.comm	_errno,4,2                      ## @errno
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rename_tempfile                ; -- Begin function rename_tempfile
	.p2align	2
_rename_tempfile:                       ; @rename_tempfile
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x21, x1
	mov	x19, x0
	ldr	x20, [x0]
	mov	x0, x20
	bl	_is_tempfile_active
	cbnz	w0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_BUG
LBB0_2:
	mov	x0, x20
	bl	_close_tempfile_gently
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_delete_tempfile
	mov	w0, #-1
	b	LBB0_7
LBB0_4:
	ldr	w0, [x20]
	mov	x1, x21
	bl	_rename
	cbz	x0, LBB0_6
; %bb.5:
Lloh2:
	adrp	x20, _errno@GOTPAGE
Lloh3:
	ldr	x20, [x20, _errno@GOTPAGEOFF]
	ldr	w21, [x20]
	mov	x0, x19
	bl	_delete_tempfile
	str	w21, [x20]
	mov	w0, #-1
	b	LBB0_7
LBB0_6:
	mov	x0, x20
	bl	_deactivate_tempfile
	mov	w0, #0
	str	xzr, [x19]
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rename_tempfile called for inactive object"

	.comm	_errno,4,2                      ; @errno
.subsections_via_symbols
