	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_physical_Close                 ## -- Begin function physical_Close
	.p2align	4, 0x90
_physical_Close:                        ## @physical_Close
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_PATH_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rax
	cmpl	$0, (%r12)
	js	LBB0_17
## %bb.1:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	_LogDEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	40(%r12), %edx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_log_Printf
	movq	32(%r12), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%r12, %rdi
	callq	*%rax
LBB0_4:
	movq	%r12, %rdi
	callq	_physical_StopDeviceTimer
	cmpq	$0, 56(%r12)
	je	LBB0_6
## %bb.5:
	leaq	-64(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$12, %edx
	callq	_memset
	movq	_DEAD_PROCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	leaq	-60(%rbp), %rdi
	xorl	%esi, %esi
	callq	_gettimeofday
	movslq	-64(%rbp), %r13
	xorl	%eax, %eax
	callq	_getpid
	leaq	L_.str.1(%rip), %rdx
	movq	%r13, %rdi
	movl	$4, %esi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_snprintf
	movq	%rbx, %rdi
	callq	_ID0logout
	movq	$0, 56(%r12)
LBB0_6:
	movl	(%r12), %edi
	callq	_tcgetpgrp
	movq	%rax, %rbx
	xorl	%eax, %eax
	callq	_getpgrp
	movq	%rax, %r13
	movl	(%r12), %edi
	callq	_close
	movl	$-1, (%r12)
	movq	48(%r12), %rdi
	callq	_log_SetTtyCommandMode
	leaq	44(%r12), %r14
	movq	%r14, %rdi
	callq	_throughput_stop
	movq	_LogPHASE@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movl	40(%r12), %edx
	movq	%r14, %rdi
	callq	_throughput_log
	movq	8(%r12), %rcx
	cmpq	$-1, %rcx
	je	LBB0_8
## %bb.7:
	movl	(%r15), %edi
	movl	40(%r12), %edx
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_log_Printf
	movq	8(%r12), %rdi
	movq	_SIGHUP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ID0kill
	movq	$-1, 8(%r12)
LBB0_8:
	cmpq	%r13, %rbx
	jne	LBB0_10
## %bb.9:
	movq	48(%r12), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_bundle_setsid
LBB0_10:
	movq	16(%r12), %rax
	cmpb	$47, (%rax)
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_13
## %bb.11:
	movq	__PATH_VARRUN@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	24(%r12), %r8
	leaq	L_.str.3(%rip), %rdx
	movq	%rbx, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_snprintf
	movq	%rbx, %rdi
	callq	_ID0unlink
	cmpl	$-1, %eax
	jne	LBB0_13
## %bb.12:
	movq	_LogALERT@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	40(%r12), %r15d
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.4(%rip), %rsi
	movl	%r14d, %edi
	movl	%r15d, %edx
	movq	%rbx, %rcx
	movl	%eax, %r8d
	xorl	%eax, %eax
	callq	_log_Printf
LBB0_13:
	movq	%r12, %rdi
	callq	_physical_Unlock
	movq	32(%r12), %rax
	testq	%rax, %rax
	je	LBB0_16
## %bb.14:
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	movq	%r12, %rdi
	callq	*%rax
LBB0_16:
	movq	$0, 32(%r12)
	movq	16(%r12), %rax
	movq	%rax, 24(%r12)
	movb	$0, (%rax)
LBB0_17:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_19
## %bb.18:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PATH_MAX,4,2                   ## @PATH_MAX
	.comm	_LogDEBUG,4,2                   ## @LogDEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: Close\n"

	.comm	_DEAD_PROCESS,4,2               ## @DEAD_PROCESS
L_.str.1:                               ## @.str.1
	.asciz	"%xppp"

	.comm	_LogPHASE,4,2                   ## @LogPHASE
L_.str.2:                               ## @.str.2
	.asciz	"%s: HUPing %ld\n"

	.comm	_SIGHUP,4,2                     ## @SIGHUP
L_.str.3:                               ## @.str.3
	.asciz	"%s%s.if"

	.comm	__PATH_VARRUN,8,3               ## @_PATH_VARRUN
	.comm	_LogALERT,4,2                   ## @LogALERT
L_.str.4:                               ## @.str.4
	.asciz	"%s: Can't remove %s: %s\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_physical_Close                 ; -- Begin function physical_Close
	.p2align	2
_physical_Close:                        ; @physical_Close
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	sub	sp, sp, #32
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x8, _PATH_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PATH_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
	mov	x9, x21
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x21, #15
	and	x9, x9, #0x1fffffff0
	sub	x20, x8, x9
	mov	sp, x20
	ldr	w8, [x0]
	tbnz	w8, #31, LBB0_17
; %bb.1:
Lloh8:
	adrp	x8, _LogDEBUG@GOTPAGE
Lloh9:
	ldr	x8, [x8, _LogDEBUG@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	ldr	w2, [x19, #40]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_log_Printf
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_4
; %bb.2:
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_4
; %bb.3:
	mov	x0, x19
	blr	x8
LBB0_4:
	mov	x0, x19
	bl	_physical_StopDeviceTimer
	ldr	x8, [x19, #56]
	cbz	x8, LBB0_6
; %bb.5:
	sub	x22, x29, #88
	sub	x0, x29, #88
	mov	w1, #0
	mov	w2, #12
	bl	_memset
Lloh13:
	adrp	x8, _DEAD_PROCESS@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DEAD_PROCESS@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	stur	w8, [x29, #-80]
	orr	x0, x22, #0x4
	mov	x1, #0
	bl	_gettimeofday
	ldursw	x22, [x29, #-88]
	bl	_getpid
	str	x0, [sp, #-16]!
Lloh16:
	adrp	x2, l_.str.1@PAGE
Lloh17:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x22
	mov	w1, #4
	bl	_snprintf
	add	sp, sp, #16
	sub	x0, x29, #88
	bl	_ID0logout
	str	xzr, [x19, #56]
LBB0_6:
	ldr	w0, [x19]
	bl	_tcgetpgrp
	mov	x22, x0
	bl	_getpgrp
	mov	x23, x0
	ldr	w0, [x19]
	bl	_close
	mov	w8, #-1
	str	w8, [x19]
	ldr	x0, [x19, #48]
	bl	_log_SetTtyCommandMode
	add	x24, x19, #44
	mov	x0, x24
	bl	_throughput_stop
Lloh18:
	adrp	x25, _LogPHASE@GOTPAGE
Lloh19:
	ldr	x25, [x25, _LogPHASE@GOTPAGEOFF]
	ldr	w1, [x25]
	ldr	w2, [x19, #40]
	mov	x0, x24
	bl	_throughput_log
	ldr	x8, [x19, #8]
	cmn	x8, #1
	b.eq	LBB0_8
; %bb.7:
	ldr	w0, [x25]
	ldr	w2, [x19, #40]
	str	x8, [sp, #-16]!
Lloh20:
	adrp	x1, l_.str.2@PAGE
Lloh21:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_log_Printf
	add	sp, sp, #16
	ldr	x0, [x19, #8]
Lloh22:
	adrp	x8, _SIGHUP@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SIGHUP@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	bl	_ID0kill
	mov	x8, #-1
	str	x8, [x19, #8]
LBB0_8:
	cmp	x22, x23
	b.ne	LBB0_10
; %bb.9:
	ldr	x8, [x19, #48]
	ldr	w0, [x8]
	mov	w1, #0
	bl	_bundle_setsid
LBB0_10:
	ldr	x8, [x19, #16]
	ldrb	w8, [x8]
	cmp	w8, #47
	b.ne	LBB0_13
; %bb.11:
Lloh25:
	adrp	x8, __PATH_VARRUN@GOTPAGE
Lloh26:
	ldr	x8, [x8, __PATH_VARRUN@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
	ldr	x9, [x19, #24]
	stp	x8, x9, [sp, #-16]!
Lloh28:
	adrp	x2, l_.str.3@PAGE
Lloh29:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x20
	mov	x1, x21
	bl	_snprintf
	add	sp, sp, #16
	mov	x0, x20
	bl	_ID0unlink
	cmn	w0, #1
	b.ne	LBB0_13
; %bb.12:
Lloh30:
	adrp	x8, _LogALERT@GOTPAGE
Lloh31:
	ldr	x8, [x8, _LogALERT@GOTPAGEOFF]
Lloh32:
	ldr	w21, [x8]
	ldr	w22, [x19, #40]
Lloh33:
	adrp	x8, _errno@GOTPAGE
Lloh34:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh35:
	ldr	w0, [x8]
	bl	_strerror
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x20, x0, [sp, #-16]!
Lloh36:
	adrp	x1, l_.str.4@PAGE
Lloh37:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x21
	mov	x2, x22
	bl	_log_Printf
	add	sp, sp, #16
LBB0_13:
	mov	x0, x19
	bl	_physical_Unlock
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_16
; %bb.14:
	ldr	x8, [x8]
	cbz	x8, LBB0_16
; %bb.15:
	mov	x0, x19
	blr	x8
LBB0_16:
	ldr	x8, [x19, #16]
	stp	x8, xzr, [x19, #24]
	strb	wzr, [x8]
LBB0_17:
	ldur	x8, [x29, #-72]
Lloh38:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh39:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh40:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_19
; %bb.18:
	sub	sp, x29, #64
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_19:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_PATH_MAX,4,2                   ; @PATH_MAX
	.comm	_LogDEBUG,4,2                   ; @LogDEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: Close\n"

	.comm	_DEAD_PROCESS,4,2               ; @DEAD_PROCESS
l_.str.1:                               ; @.str.1
	.asciz	"%xppp"

	.comm	_LogPHASE,4,2                   ; @LogPHASE
l_.str.2:                               ; @.str.2
	.asciz	"%s: HUPing %ld\n"

	.comm	_SIGHUP,4,2                     ; @SIGHUP
l_.str.3:                               ; @.str.3
	.asciz	"%s%s.if"

	.comm	__PATH_VARRUN,8,3               ; @_PATH_VARRUN
	.comm	_LogALERT,4,2                   ; @LogALERT
l_.str.4:                               ; @.str.4
	.asciz	"%s: Can't remove %s: %s\n"

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