	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function open_pid_files
_open_pid_files:                        ## @open_pid_files
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movq	%rdx, %r14
	movq	%rsi, %r12
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.1:
	movq	%rdi, %rbx
	leaq	-36(%rbp), %rdx
	movl	$384, %esi                      ## imm = 0x180
	callq	_pidfile_open
	movq	%rax, (%r14)
	testq	%rax, %rax
	jne	LBB0_5
## %bb.2:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_EEXIST@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_4
## %bb.3:
	movl	-36(%rbp), %edx
	leaq	L_.str(%rip), %rsi
	movl	$3, %edi
	callq	_errx
LBB0_4:
	leaq	L_.str.1(%rip), %rsi
	movl	$2, %edi
	movq	%rbx, %rdx
	callq	_err
LBB0_5:
	testq	%r12, %r12
	je	LBB0_10
## %bb.6:
	leaq	-36(%rbp), %rdx
	movq	%r12, %rdi
	movl	$384, %esi                      ## imm = 0x180
	callq	_pidfile_open
	movq	%rax, (%r15)
	testq	%rax, %rax
	jne	LBB0_10
## %bb.7:
	movq	_errno@GOTPCREL(%rip), %r15
	movl	(%r15), %ebx
	movq	(%r14), %rdi
	callq	_pidfile_remove
	movl	%ebx, (%r15)
	movq	_EEXIST@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_9
## %bb.8:
	movl	-36(%rbp), %edx
	leaq	L_.str(%rip), %rsi
	movl	$3, %edi
	callq	_errx
LBB0_9:
	leaq	L_.str.2(%rip), %rsi
	movl	$2, %edi
	movq	%r12, %rdx
	callq	_err
LBB0_10:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,4,2                      ## @errno
	.comm	_EEXIST,4,2                     ## @EEXIST
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"process already running, pid: %d"

L_.str.1:                               ## @.str.1
	.asciz	"pidfile ``%s''"

L_.str.2:                               ## @.str.2
	.asciz	"ppidfile ``%s''"

	.no_dead_strip	_open_pid_files
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function open_pid_files
_open_pid_files:                        ; @open_pid_files
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x3
	mov	x20, x2
	mov	x19, x1
	cbz	x0, LBB0_5
; %bb.1:
	mov	x22, x0
	add	x2, sp, #12
	mov	w1, #384
	bl	_pidfile_open
	str	x0, [x20]
	cbnz	x0, LBB0_5
; %bb.2:
Lloh0:
	adrp	x8, _errno@GOTPAGE
Lloh1:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _EEXIST@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EEXIST@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_4
; %bb.3:
	ldr	w2, [sp, #12]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #3
	bl	_errx
LBB0_4:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #2
	mov	x2, x22
	bl	_err
LBB0_5:
	cbz	x19, LBB0_10
; %bb.6:
	add	x2, sp, #12
	mov	x0, x19
	mov	w1, #384
	bl	_pidfile_open
	str	x0, [x21]
	cbnz	x0, LBB0_10
; %bb.7:
Lloh10:
	adrp	x21, _errno@GOTPAGE
Lloh11:
	ldr	x21, [x21, _errno@GOTPAGEOFF]
	ldr	w22, [x21]
	ldr	x0, [x20]
	bl	_pidfile_remove
	str	w22, [x21]
Lloh12:
	adrp	x8, _EEXIST@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EEXIST@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w22, w8
	b.ne	LBB0_9
; %bb.8:
	ldr	w2, [sp, #12]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #3
	bl	_errx
LBB0_9:
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #2
	mov	x2, x19
	bl	_err
LBB0_10:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,4,2                      ; @errno
	.comm	_EEXIST,4,2                     ; @EEXIST
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"process already running, pid: %d"

l_.str.1:                               ; @.str.1
	.asciz	"pidfile ``%s''"

l_.str.2:                               ; @.str.2
	.asciz	"ppidfile ``%s''"

	.no_dead_strip	_open_pid_files
.subsections_via_symbols
