	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LogThread                      ## -- Begin function LogThread
	.p2align	4, 0x90
_LogThread:                             ## @LogThread
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	%rsp, -88(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MAX_SIZE@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	movl	(%r15), %r13d
	movq	%r13, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movl	$0, -68(%rbp)
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	testq	%rbx, %rbx
	je	LBB0_17
## %bb.1:
	testq	%r12, %r12
	je	LBB0_17
## %bb.2:
	movq	%r14, %rdi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_Zero
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_Zero
	movq	_g_foreground@GOTPCREL(%rip), %r13
	cmpq	$0, (%r13)
	je	LBB0_3
## %bb.4:
	xorl	%eax, %eax
	callq	_GetIO4Stdout
	jmp	LBB0_5
LBB0_3:
	xorl	%eax, %eax
LBB0_5:
	movq	%rax, -64(%rbp)
	xorl	%eax, %eax
	callq	_NewBuf
	movq	%rax, %rbx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_NoticeThreadInit
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	(%r12), %edi
	movl	$9821, %esi                     ## imm = 0x265D
	callq	_Wait
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	xorl	%eax, %eax
	callq	_Tick64
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_7 Depth=2
	movq	-64(%rbp), %rdx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_LogThreadWriteStdout
	testl	%eax, %eax
	je	LBB0_10
LBB0_7:                                 ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	$0, (%r13)
	jne	LBB0_8
## %bb.19:                              ##   in Loop: Header=BB0_7 Depth=2
	movq	%r12, %rdi
	movq	%rbx, %rsi
	leaq	-64(%rbp), %rdx
	leaq	-68(%rbp), %rcx
	movq	%r15, %r8
	movq	%r14, %r9
	callq	_LogThreadWriteGeneral
	testl	%eax, %eax
	jne	LBB0_7
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	cmpq	$0, 16(%r12)
	je	LBB0_20
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	8(%r12), %rdi
	callq	_LockQueue
	movq	8(%r12), %rdi
	movq	(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	callq	_UnlockQueue
	movq	-64(%rbp), %rdi
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_6 Depth=1
	testq	%rdi, %rdi
	jne	LBB0_6
LBB0_13:
	testq	%rdi, %rdi
	je	LBB0_16
## %bb.14:
	cmpq	$0, (%r13)
	jne	LBB0_16
## %bb.15:
	movl	$1, %esi
	callq	_FileCloseEx
LBB0_16:
	movq	%rbx, %rdi
	callq	_FreeBuf
LBB0_17:
	movq	-88(%rbp), %rsp                 ## 8-byte Reload
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_21
## %bb.18:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_SIZE,4,2                   ## @MAX_SIZE
	.comm	_g_foreground,8,3               ## @g_foreground
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LogThread                      ; -- Begin function LogThread
	.p2align	2
_LogThread:                             ; @LogThread
	.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, x1
	mov	x23, x0
	mov	x24, sp
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, _MAX_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_SIZE@GOTPAGEOFF]
	ldr	w1, [x8]
	mov	x9, x1
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x10, x1, #15
	and	x10, x10, #0x1fffffff0
	sub	x20, x9, x10
	mov	sp, x20
	ldr	w22, [x8]
	mov	x9, x22
Lloh7:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh8:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x22, #15
	and	x9, x9, #0x1fffffff0
	sub	x21, x8, x9
	mov	sp, x21
	stur	wzr, [x29, #-84]
	cbz	x0, LBB0_17
; %bb.1:
	cbz	x19, LBB0_17
; %bb.2:
	mov	x0, x20
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_Zero
	mov	x0, x21
	mov	x1, x22
	bl	_Zero
Lloh9:
	adrp	x25, _g_foreground@GOTPAGE
Lloh10:
	ldr	x25, [x25, _g_foreground@GOTPAGEOFF]
	ldr	x8, [x25]
	cbz	x8, LBB0_4
; %bb.3:
	bl	_GetIO4Stdout
	b	LBB0_5
LBB0_4:
	mov	x0, #0
LBB0_5:
	stur	x0, [x29, #-80]
	bl	_NewBuf
	mov	x22, x0
	mov	x0, x23
	bl	_NoticeThreadInit
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	w0, [x19]
	mov	w1, #9821
	bl	_Wait
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	bl	_Tick64
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=2
	sub	x2, x29, #80
	sub	x3, x29, #84
	mov	x0, x19
	mov	x1, x22
	mov	x4, x21
	mov	x5, x20
	bl	_LogThreadWriteGeneral
	cbz	w0, LBB0_11
LBB0_9:                                 ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x25]
	cbz	x8, LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	ldur	x2, [x29, #-80]
	mov	x0, x19
	mov	x1, x22
	bl	_LogThreadWriteStdout
	cbnz	w0, LBB0_9
LBB0_11:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_6
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	x0, [x19, #8]
	bl	_LockQueue
	ldr	x0, [x19, #8]
	ldr	x23, [x0]
	bl	_UnlockQueue
	ldur	x0, [x29, #-80]
	cmp	x23, #0
	ccmp	x0, #0, #4, ne
	b.ne	LBB0_7
; %bb.13:
	cbz	x0, LBB0_16
; %bb.14:
	ldr	x8, [x25]
	cbnz	x8, LBB0_16
; %bb.15:
	mov	w1, #1
	bl	_FileCloseEx
LBB0_16:
	mov	x0, x22
	bl	_FreeBuf
LBB0_17:
	mov	sp, x24
	ldur	x8, [x29, #-72]
Lloh11:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh12:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh13:
	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	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_SIZE,4,2                   ; @MAX_SIZE
	.comm	_g_foreground,8,3               ; @g_foreground
.subsections_via_symbols
