	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pidfile_write                  ## -- Begin function pidfile_write
	.p2align	4, 0x90
_pidfile_write:                         ## @pidfile_write
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_pidfile_verify
	movq	_errno@GOTPCREL(%rip), %r13
	movl	%eax, (%r13)
	movl	$-1, %ebx
	testl	%eax, %eax
	jne	LBB0_4
## %bb.1:
	movl	(%r14), %r15d
	xorl	%ebx, %ebx
	movl	%r15d, %edi
	xorl	%esi, %esi
	callq	_ftruncate
	cmpl	$-1, %eax
	je	LBB0_3
## %bb.2:
	xorl	%eax, %eax
	callq	_getpid
	leaq	L_.str(%rip), %rdx
	leaq	-64(%rbp), %r12
	movq	%r12, %rdi
	movl	$16, %esi
	movl	%eax, %ecx
	callq	_snprintf
	movq	%r12, %rdi
	callq	_strlen
	movl	%r15d, %edi
	movq	%r12, %rsi
	movq	%rax, %rdx
	xorl	%ecx, %ecx
	callq	_pwrite
	movq	%rax, %r15
	movq	%r12, %rdi
	callq	_strlen
	cmpq	%rax, %r15
	je	LBB0_4
LBB0_3:
	movl	(%r13), %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	__pidfile_remove
	movl	%ebx, (%r13)
	movl	$-1, %ebx
LBB0_4:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_6
## %bb.5:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,4,2                      ## @errno
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%u"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pidfile_write                  ; -- Begin function pidfile_write
	.p2align	2
_pidfile_write:                         ; @pidfile_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	bl	_pidfile_verify
Lloh3:
	adrp	x21, _errno@GOTPAGE
Lloh4:
	ldr	x21, [x21, _errno@GOTPAGEOFF]
	str	w0, [x21]
	cbnz	w0, LBB0_4
; %bb.1:
	ldr	w20, [x19]
	mov	x0, x20
	mov	w1, #0
	bl	_ftruncate
	cmn	w0, #1
	b.eq	LBB0_3
; %bb.2:
	bl	_getpid
	mov	x3, x0
Lloh5:
	adrp	x2, l_.str@PAGE
Lloh6:
	add	x2, x2, l_.str@PAGEOFF
	add	x0, sp, #8
	mov	w1, #16
	bl	_snprintf
	add	x0, sp, #8
	bl	_strlen
	mov	x2, x0
	add	x1, sp, #8
	mov	x0, x20
	mov	w3, #0
	bl	_pwrite
	mov	x20, x0
	add	x0, sp, #8
	bl	_strlen
	mov	x8, x0
	mov	w0, #0
	cmp	x20, x8
	b.eq	LBB0_5
LBB0_3:
	ldr	w20, [x21]
	mov	x0, x19
	mov	w1, #0
	bl	__pidfile_remove
	str	w20, [x21]
LBB0_4:
	mov	w0, #-1
LBB0_5:
	ldr	x8, [sp, #24]
Lloh7:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh8:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_7
; %bb.6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_7:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,4,2                      ; @errno
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%u"

.subsections_via_symbols
