	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function syslog_read
_syslog_read:                           ## @syslog_read
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%esi, %esi
	js	LBB0_1
## %bb.2:
	movl	%edx, %r15d
	movl	%esi, %ebx
	movl	%edi, %r14d
	movq	_FIFO_LAST@GOTPCREL(%rip), %rax
	movl	%esi, %r12d
	testl	%edx, (%rax)
	je	LBB0_4
## %bb.3:
	movq	_log_max_since_clear@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%r12, %rax
	cmovbl	%eax, %ebx
	jmp	LBB0_6
LBB0_1:
	movq	__EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_4:
	movq	_log_buf@GOTPCREL(%rip), %rdi
	callq	_fifo_capacity
	cmpq	%r12, %rax
	jae	LBB0_6
## %bb.5:
	movq	_log_buf@GOTPCREL(%rip), %rdi
	callq	_fifo_capacity
	movq	%rax, %rbx
LBB0_6:
	movl	%ebx, %edi
	callq	_malloc
	movq	%rax, %r12
	movq	_log_buf@GOTPCREL(%rip), %rdi
	movq	%rax, %rsi
	movl	%ebx, %edx
	movl	%r15d, %ecx
	callq	_fifo_read
	movl	%r14d, %edi
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_user_write
	movl	%eax, %r14d
	movq	%r12, %rdi
	callq	_free
	testl	%r14d, %r14d
	je	LBB0_9
## %bb.7:
	movq	__EFAULT@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	__EINVAL,4,2                    ## @_EINVAL
	.comm	_FIFO_LAST,4,2                  ## @FIFO_LAST
	.comm	_log_max_since_clear,8,3        ## @log_max_since_clear
	.comm	_log_buf,4,2                    ## @log_buf
	.comm	__EFAULT,4,2                    ## @_EFAULT
	.no_dead_strip	_syslog_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function syslog_read
_syslog_read:                           ; @syslog_read
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	tbnz	w1, #31, LBB0_3
; %bb.1:
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _FIFO_LAST@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FIFO_LAST@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	mov	w22, w1
	tst	w8, w2
	b.eq	LBB0_4
; %bb.2:
Lloh3:
	adrp	x8, _log_max_since_clear@GOTPAGE
Lloh4:
	ldr	x8, [x8, _log_max_since_clear@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x8, x22
	csel	w19, w8, w19, lo
	b	LBB0_6
LBB0_3:
Lloh6:
	adrp	x8, __EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, __EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	b	LBB0_7
LBB0_4:
Lloh9:
	adrp	x0, _log_buf@GOTPAGE
Lloh10:
	ldr	x0, [x0, _log_buf@GOTPAGEOFF]
	bl	_fifo_capacity
	cmp	x0, x22
	b.hs	LBB0_6
; %bb.5:
Lloh11:
	adrp	x0, _log_buf@GOTPAGE
Lloh12:
	ldr	x0, [x0, _log_buf@GOTPAGEOFF]
	bl	_fifo_capacity
	mov	x19, x0
LBB0_6:
	mov	x0, x19
	bl	_malloc
	mov	x22, x0
Lloh13:
	adrp	x0, _log_buf@GOTPAGE
Lloh14:
	ldr	x0, [x0, _log_buf@GOTPAGEOFF]
	mov	x1, x22
	mov	x2, x19
	mov	x3, x21
	bl	_fifo_read
	mov	x0, x20
	mov	x1, x22
	mov	x2, x19
	bl	_user_write
	mov	x20, x0
	mov	x0, x22
	bl	_free
Lloh15:
	adrp	x8, __EFAULT@GOTPAGE
Lloh16:
	ldr	x8, [x8, __EFAULT@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmp	w20, #0
	csel	w0, w19, w8, eq
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	__EINVAL,4,2                    ; @_EINVAL
	.comm	_FIFO_LAST,4,2                  ; @FIFO_LAST
	.comm	_log_max_since_clear,8,3        ; @log_max_since_clear
	.comm	_log_buf,4,2                    ; @log_buf
	.comm	__EFAULT,4,2                    ; @_EFAULT
	.no_dead_strip	_syslog_read
.subsections_via_symbols
