	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_go_daemon                      ## -- Begin function go_daemon
	.p2align	4, 0x90
_go_daemon:                             ## @go_daemon
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_no_daemon@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_15
## %bb.1:
	testb	$1, _go_daemon.state(%rip)
	jne	LBB0_15
## %bb.2:
	movb	$1, _go_daemon.state(%rip)
	movq	_log_perror@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_nullfd@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movl	$-1, %edi
	callq	_daemonfd
	cmpl	$-1, %eax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	callq	_error
LBB0_4:
	leaq	-20(%rbp), %rdi
	xorl	%eax, %eax
	callq	_cap_rights_init
	movq	_pidfile@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.5:
	callq	_pidfile_write
	movq	(%rbx), %rdi
	callq	_pidfile_fileno
	leaq	-20(%rbp), %rsi
	movl	%eax, %edi
	callq	_caph_rights_limit
	testq	%rax, %rax
	jns	LBB0_7
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	callq	_error
LBB0_7:
	movl	(%r14), %edi
	cmpl	$-1, %edi
	je	LBB0_9
## %bb.8:
	callq	_close
	movl	$-1, (%r14)
LBB0_9:
	movq	_STDIN_FILENO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-20(%rbp), %rsi
	callq	_caph_rights_limit
	testq	%rax, %rax
	jns	LBB0_11
## %bb.10:
	leaq	L_.str.2(%rip), %rdi
	callq	_error
LBB0_11:
	movq	_CAP_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-20(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_cap_rights_init
	movq	_STDOUT_FILENO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_caph_rights_limit
	testq	%rax, %rax
	jns	LBB0_13
## %bb.12:
	leaq	L_.str.3(%rip), %rdi
	callq	_error
LBB0_13:
	movq	_STDERR_FILENO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-20(%rbp), %rsi
	callq	_caph_rights_limit
	testq	%rax, %rax
	jns	LBB0_15
## %bb.14:
	leaq	L_.str.4(%rip), %rdi
	callq	_error
LBB0_15:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_go_daemon.state,1,2 ## @go_daemon.state
	.comm	_no_daemon,8,3                  ## @no_daemon
	.comm	_log_perror,8,3                 ## @log_perror
	.comm	_nullfd,4,2                     ## @nullfd
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"daemon"

	.comm	_pidfile,8,3                    ## @pidfile
L_.str.1:                               ## @.str.1
	.asciz	"can't limit pidfile descriptor: %m"

	.comm	_STDIN_FILENO,4,2               ## @STDIN_FILENO
L_.str.2:                               ## @.str.2
	.asciz	"can't limit stdin: %m"

	.comm	_CAP_WRITE,4,2                  ## @CAP_WRITE
	.comm	_STDOUT_FILENO,4,2              ## @STDOUT_FILENO
L_.str.3:                               ## @.str.3
	.asciz	"can't limit stdout: %m"

	.comm	_STDERR_FILENO,4,2              ## @STDERR_FILENO
L_.str.4:                               ## @.str.4
	.asciz	"can't limit stderr: %m"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_go_daemon                      ; -- Begin function go_daemon
	.p2align	2
_go_daemon:                             ; @go_daemon
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
Lloh0:
	adrp	x8, _no_daemon@GOTPAGE
Lloh1:
	ldr	x8, [x8, _no_daemon@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbnz	x8, LBB0_15
; %bb.1:
	adrp	x8, _go_daemon.state@PAGE
	ldrb	w9, [x8, _go_daemon.state@PAGEOFF]
	tbnz	w9, #0, LBB0_15
; %bb.2:
	mov	w9, #1
	strb	w9, [x8, _go_daemon.state@PAGEOFF]
Lloh3:
	adrp	x8, _log_perror@GOTPAGE
Lloh4:
	ldr	x8, [x8, _log_perror@GOTPAGEOFF]
Lloh5:
	str	xzr, [x8]
Lloh6:
	adrp	x19, _nullfd@GOTPAGE
Lloh7:
	ldr	x19, [x19, _nullfd@GOTPAGEOFF]
	ldr	w1, [x19]
	mov	w0, #-1
	bl	_daemonfd
	cmn	w0, #1
	b.ne	LBB0_4
; %bb.3:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_error
LBB0_4:
	add	x0, sp, #12
	bl	_cap_rights_init
Lloh10:
	adrp	x20, _pidfile@GOTPAGE
Lloh11:
	ldr	x20, [x20, _pidfile@GOTPAGEOFF]
	ldr	x0, [x20]
	cbz	x0, LBB0_7
; %bb.5:
	bl	_pidfile_write
	ldr	x0, [x20]
	bl	_pidfile_fileno
	add	x1, sp, #12
	bl	_caph_rights_limit
	tbz	x0, #63, LBB0_7
; %bb.6:
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_error
LBB0_7:
	ldr	w0, [x19]
	cmn	w0, #1
	b.eq	LBB0_9
; %bb.8:
	bl	_close
	mov	w8, #-1
	str	w8, [x19]
LBB0_9:
Lloh14:
	adrp	x8, _STDIN_FILENO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _STDIN_FILENO@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	add	x1, sp, #12
	bl	_caph_rights_limit
	tbz	x0, #63, LBB0_11
; %bb.10:
Lloh17:
	adrp	x0, l_.str.2@PAGE
Lloh18:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_error
LBB0_11:
Lloh19:
	adrp	x8, _CAP_WRITE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _CAP_WRITE@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	str	x8, [sp]
	add	x0, sp, #12
	bl	_cap_rights_init
Lloh22:
	adrp	x8, _STDOUT_FILENO@GOTPAGE
Lloh23:
	ldr	x8, [x8, _STDOUT_FILENO@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	add	x1, sp, #12
	bl	_caph_rights_limit
	tbz	x0, #63, LBB0_13
; %bb.12:
Lloh25:
	adrp	x0, l_.str.3@PAGE
Lloh26:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_error
LBB0_13:
Lloh27:
	adrp	x8, _STDERR_FILENO@GOTPAGE
Lloh28:
	ldr	x8, [x8, _STDERR_FILENO@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	add	x1, sp, #12
	bl	_caph_rights_limit
	tbz	x0, #63, LBB0_15
; %bb.14:
Lloh30:
	adrp	x0, l_.str.4@PAGE
Lloh31:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_error
LBB0_15:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotStr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_go_daemon.state,1,2 ; @go_daemon.state
	.comm	_no_daemon,8,3                  ; @no_daemon
	.comm	_log_perror,8,3                 ; @log_perror
	.comm	_nullfd,4,2                     ; @nullfd
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"daemon"

	.comm	_pidfile,8,3                    ; @pidfile
l_.str.1:                               ; @.str.1
	.asciz	"can't limit pidfile descriptor: %m"

	.comm	_STDIN_FILENO,4,2               ; @STDIN_FILENO
l_.str.2:                               ; @.str.2
	.asciz	"can't limit stdin: %m"

	.comm	_CAP_WRITE,4,2                  ; @CAP_WRITE
	.comm	_STDOUT_FILENO,4,2              ; @STDOUT_FILENO
l_.str.3:                               ; @.str.3
	.asciz	"can't limit stdout: %m"

	.comm	_STDERR_FILENO,4,2              ; @STDERR_FILENO
l_.str.4:                               ; @.str.4
	.asciz	"can't limit stderr: %m"

.subsections_via_symbols
