	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function attach_snp
_attach_snp:                            ## @attach_snp
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	subq	$16, %rsp
	movq	_dev_name@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	callq	_open
	movl	%eax, -4(%rbp)
	testl	%eax, %eax
	jns	LBB0_2
## %bb.1:
	movq	_EX_DATAERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_fatal
LBB0_2:
	movq	_snp_io@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SNPSTTY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-4(%rbp), %rdx
	callq	_ioctl
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_EX_UNAVAILABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_fatal
LBB0_4:
	movl	-4(%rbp), %edi
	callq	_close
	movq	_opt_timestamp@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.5:
	leaq	L_.str.2(%rip), %rdi
	callq	_timestamp
LBB0_6:
	addq	$16, %rsp
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_dev_name,4,2                   ## @dev_name
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_EX_DATAERR,4,2                 ## @EX_DATAERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"can't open device"

	.comm	_snp_io,4,2                     ## @snp_io
	.comm	_SNPSTTY,4,2                    ## @SNPSTTY
	.comm	_EX_UNAVAILABLE,4,2             ## @EX_UNAVAILABLE
L_.str.1:                               ## @.str.1
	.asciz	"cannot attach to tty"

	.comm	_opt_timestamp,8,3              ## @opt_timestamp
L_.str.2:                               ## @.str.2
	.asciz	"Logging Started."

	.no_dead_strip	_attach_snp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function attach_snp
_attach_snp:                            ; @attach_snp
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #32
	.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
Lloh0:
	adrp	x8, _dev_name@GOTPAGE
Lloh1:
	ldr	x8, [x8, _dev_name@GOTPAGEOFF]
Lloh2:
	adrp	x9, _O_RDONLY@GOTPAGE
Lloh3:
	ldr	x9, [x9, _O_RDONLY@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	ldr	w8, [x9]
Lloh6:
	adrp	x9, _O_NONBLOCK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _O_NONBLOCK@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w1, w9, w8
	bl	_open
	stur	w0, [x29, #-4]
	tbz	w0, #31, LBB0_2
; %bb.1:
Lloh9:
	adrp	x8, _EX_DATAERR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EX_DATAERR@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fatal
LBB0_2:
Lloh14:
	adrp	x8, _snp_io@GOTPAGE
Lloh15:
	ldr	x8, [x8, _snp_io@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
Lloh17:
	adrp	x8, _SNPSTTY@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SNPSTTY@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	sub	x2, x29, #4
	bl	_ioctl
	cbz	x0, LBB0_4
; %bb.3:
Lloh20:
	adrp	x8, _EX_UNAVAILABLE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EX_UNAVAILABLE@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
Lloh23:
	adrp	x1, l_.str.1@PAGE
Lloh24:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fatal
LBB0_4:
	ldur	w0, [x29, #-4]
	bl	_close
Lloh25:
	adrp	x8, _opt_timestamp@GOTPAGE
Lloh26:
	ldr	x8, [x8, _opt_timestamp@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.5:
Lloh28:
	adrp	x0, l_.str.2@PAGE
Lloh29:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_timestamp
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #32
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_dev_name,4,2                   ; @dev_name
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_EX_DATAERR,4,2                 ; @EX_DATAERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"can't open device"

	.comm	_snp_io,4,2                     ; @snp_io
	.comm	_SNPSTTY,4,2                    ; @SNPSTTY
	.comm	_EX_UNAVAILABLE,4,2             ; @EX_UNAVAILABLE
l_.str.1:                               ; @.str.1
	.asciz	"cannot attach to tty"

	.comm	_opt_timestamp,8,3              ; @opt_timestamp
l_.str.2:                               ; @.str.2
	.asciz	"Logging Started."

	.no_dead_strip	_attach_snp
.subsections_via_symbols
