	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ub_stop_bg
_ub_stop_bg:                            ## @ub_stop_bg
	.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, %r13
	callq	_lock_basic_lock
	cmpq	$0, 40(%r13)
	je	LBB0_11
## %bb.1:
	movq	_UB_LIBCMD_QUIT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -72(%rbp)
	movq	%r13, %rdi
	callq	_lock_basic_unlock
	leaq	32(%r13), %r14
	movq	%r14, %rdi
	callq	_lock_basic_lock
	movl	36(%r13), %edi
	leaq	-72(%rbp), %rsi
	movl	$8, %edx
	xorl	%ecx, %ecx
	callq	_tube_write_msg
	movq	%r14, %rdi
	callq	_lock_basic_unlock
	leaq	24(%r13), %rdi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_lock_basic_lock
	movl	28(%r13), %edi
	leaq	-48(%rbp), %rsi
	leaq	-56(%rbp), %rdx
	xorl	%ecx, %ecx
	callq	_tube_read_msg
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	leaq	-48(%rbp), %r15
	leaq	-56(%rbp), %r12
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rdi
	movq	-56(%rbp), %rsi
	callq	_context_serial_getcmd
	movq	%rax, %rbx
	movq	_UB_LIBCMD_QUIT@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movq	-48(%rbp), %rdi
	callq	_free
	cmpq	%r14, %rbx
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	28(%r13), %edi
	movq	%r15, %rsi
	movq	%r12, %rdx
	xorl	%ecx, %ecx
	callq	_tube_read_msg
	testq	%rax, %rax
	jne	LBB0_3
LBB0_5:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_lock_basic_unlock
	movq	%r13, %rdi
	callq	_lock_basic_lock
	movq	16(%r13), %rbx
	movq	%r13, %rdi
	callq	_lock_basic_unlock
	testq	%rbx, %rbx
	je	LBB0_7
## %bb.6:
	movl	8(%r13), %edi
	callq	_ub_thread_join
	jmp	LBB0_10
LBB0_11:
	movq	%r13, %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_lock_basic_unlock              ## TAILCALL
LBB0_7:
	movl	4(%r13), %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_waitpid
	cmpl	$-1, %eax
	jne	LBB0_10
## %bb.8:
	movq	_verbosity@GOTPCREL(%rip), %rax
	cmpl	$3, (%rax)
	jl	LBB0_10
## %bb.9:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_log_err
LBB0_10:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_UB_LIBCMD_QUIT,8,3             ## @UB_LIBCMD_QUIT
	.comm	_verbosity,4,2                  ## @verbosity
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"waitpid: %s"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ub_stop_bg
_ub_stop_bg:                            ; @ub_stop_bg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x0
	bl	_lock_basic_lock
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_6
; %bb.1:
Lloh0:
	adrp	x22, _UB_LIBCMD_QUIT@GOTPAGE
Lloh1:
	ldr	x22, [x22, _UB_LIBCMD_QUIT@GOTPAGEOFF]
	ldr	x8, [x22]
	str	x8, [sp, #8]
	mov	x0, x19
	bl	_lock_basic_unlock
	add	x20, x19, #32
	mov	x0, x20
	bl	_lock_basic_lock
	ldr	w0, [x19, #36]
	add	x1, sp, #8
	mov	w2, #8
	mov	w3, #0
	bl	_tube_write_msg
	mov	x0, x20
	bl	_lock_basic_unlock
	add	x20, x19, #24
	mov	x0, x20
	bl	_lock_basic_lock
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #28]
	add	x1, sp, #24
	add	x2, sp, #16
	mov	w3, #0
	bl	_tube_read_msg
	cbz	x0, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldp	x1, x0, [sp, #16]
	bl	_context_serial_getcmd
	mov	x21, x0
	ldr	x23, [x22]
	ldr	x0, [sp, #24]
	bl	_free
	cmp	x21, x23
	b.ne	LBB0_2
LBB0_4:
	mov	x0, x20
	bl	_lock_basic_unlock
	mov	x0, x19
	bl	_lock_basic_lock
	ldr	x20, [x19, #16]
	mov	x0, x19
	bl	_lock_basic_unlock
	cbz	x20, LBB0_7
; %bb.5:
	ldr	w0, [x19, #8]
	bl	_ub_thread_join
	b	LBB0_10
LBB0_6:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_lock_basic_unlock
LBB0_7:
	ldr	w0, [x19, #4]
	mov	x1, #0
	mov	w2, #0
	bl	_waitpid
	cmn	w0, #1
	b.ne	LBB0_10
; %bb.8:
Lloh2:
	adrp	x8, _verbosity@GOTPAGE
Lloh3:
	ldr	x8, [x8, _verbosity@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w8, #3
	b.lt	LBB0_10
; %bb.9:
Lloh5:
	adrp	x8, _errno@GOTPAGE
Lloh6:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_strerror
	mov	x1, x0
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_log_err
LBB0_10:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_UB_LIBCMD_QUIT,8,3             ; @UB_LIBCMD_QUIT
	.comm	_verbosity,4,2                  ; @verbosity
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"waitpid: %s"

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