	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function csock_read
_csock_read:                            ## @csock_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_resbufsiz@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	incl	%edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	_csock@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r15), %edx
	incl	%edx
	movq	%rbx, %rsi
	movq	%r14, %rcx
	callq	_NgRecvMsg
	testl	%eax, %eax
	js	LBB0_3
## %bb.5:
	je	LBB0_11
## %bb.6:
	cmpl	(%r15), %eax
	jbe	LBB0_10
## %bb.7:
	movq	_stats@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_LEAF_begemotNgTooLargeMsgs@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	incl	(%rax,%rcx,4)
	movq	_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_syslog
	movq	%rbx, %rdi
	callq	_free
	movq	_EFBIG@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_1:
	movq	_stats@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_LEAF_begemotNgNoMems@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	incl	(%rax,%rcx,4)
	movq	_LOG_CRIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_syslog
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %r14d
LBB0_9:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	%r14d, (%rax)
	xorl	%ebx, %ebx
LBB0_10:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_errno@GOTPCREL(%rip), %r15
	movl	(%r15), %r14d
	movq	%rbx, %rdi
	callq	_free
	movl	(%r15), %eax
	movq	_EWOULDBLOCK@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_9
## %bb.4:
	movq	_stats@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_LEAF_begemotNgMsgReadErrs@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	incl	(%rax,%rcx,4)
	movq	_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_syslog
	jmp	LBB0_9
LBB0_11:
	movq	_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_syslog
	xorl	%edi, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_resbufsiz,4,2                  ## @resbufsiz
	.comm	_stats,8,3                      ## @stats
	.comm	_LEAF_begemotNgNoMems,8,3       ## @LEAF_begemotNgNoMems
	.comm	_LOG_CRIT,4,2                   ## @LOG_CRIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"out of memory"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_errno,4,2                      ## @errno
	.comm	_csock,4,2                      ## @csock
	.comm	_EWOULDBLOCK,4,2                ## @EWOULDBLOCK
	.comm	_LEAF_begemotNgMsgReadErrs,8,3  ## @LEAF_begemotNgMsgReadErrs
	.comm	_LOG_WARNING,4,2                ## @LOG_WARNING
L_.str.1:                               ## @.str.1
	.asciz	"read from csock: %m"

	.comm	_LOG_DEBUG,4,2                  ## @LOG_DEBUG
L_.str.2:                               ## @.str.2
	.asciz	"node closed -- exiting"

	.comm	_LEAF_begemotNgTooLargeMsgs,8,3 ## @LEAF_begemotNgTooLargeMsgs
L_.str.3:                               ## @.str.3
	.asciz	"ng message too large"

	.comm	_EFBIG,4,2                      ## @EFBIG
	.no_dead_strip	_csock_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function csock_read
_csock_read:                            ; @csock_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
	mov	x20, x0
Lloh0:
	adrp	x22, _resbufsiz@GOTPAGE
Lloh1:
	ldr	x22, [x22, _resbufsiz@GOTPAGEOFF]
	ldr	w8, [x22]
	add	w0, w8, #1
	bl	_malloc
Lloh2:
	adrp	x21, _errno@GOTPAGE
Lloh3:
	ldr	x21, [x21, _errno@GOTPAGEOFF]
	cbz	x0, LBB0_5
; %bb.1:
	mov	x19, x0
Lloh4:
	adrp	x8, _csock@GOTPAGE
Lloh5:
	ldr	x8, [x8, _csock@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	ldr	w8, [x22]
	add	w2, w8, #1
	mov	x1, x19
	mov	x3, x20
	bl	_NgRecvMsg
	tbnz	w0, #31, LBB0_9
; %bb.2:
	cbz	w0, LBB0_11
; %bb.3:
	ldr	w8, [x22]
	cmp	w0, w8
	b.ls	LBB0_8
; %bb.4:
Lloh7:
	adrp	x8, _stats@GOTPAGE
Lloh8:
	ldr	x8, [x8, _stats@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
Lloh10:
	adrp	x9, _LEAF_begemotNgTooLargeMsgs@GOTPAGE
Lloh11:
	ldr	x9, [x9, _LEAF_begemotNgTooLargeMsgs@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	lsl	x9, x9, #2
	ldr	w10, [x8, x9]
	add	w10, w10, #1
	str	w10, [x8, x9]
Lloh13:
	adrp	x8, _LOG_WARNING@GOTPAGE
Lloh14:
	ldr	x8, [x8, _LOG_WARNING@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
Lloh16:
	adrp	x1, l_.str.3@PAGE
Lloh17:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_syslog
	mov	x0, x19
	bl	_free
Lloh18:
	adrp	x8, _EFBIG@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EFBIG@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh20:
	adrp	x8, _stats@GOTPAGE
Lloh21:
	ldr	x8, [x8, _stats@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
Lloh23:
	adrp	x9, _LEAF_begemotNgNoMems@GOTPAGE
Lloh24:
	ldr	x9, [x9, _LEAF_begemotNgNoMems@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	lsl	x9, x9, #2
	ldr	w10, [x8, x9]
	add	w10, w10, #1
	str	w10, [x8, x9]
Lloh26:
	adrp	x8, _LOG_CRIT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _LOG_CRIT@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
Lloh29:
	adrp	x1, l_.str@PAGE
Lloh30:
	add	x1, x1, l_.str@PAGEOFF
	bl	_syslog
Lloh31:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_6:
	ldr	w20, [x8]
LBB0_7:
	mov	x19, #0
	str	w20, [x21]
LBB0_8:
	mov	x0, x19
	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
LBB0_9:
	ldr	w20, [x21]
	mov	x0, x19
	bl	_free
	ldr	w8, [x21]
Lloh33:
	adrp	x9, _EWOULDBLOCK@GOTPAGE
Lloh34:
	ldr	x9, [x9, _EWOULDBLOCK@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_7
; %bb.10:
Lloh36:
	adrp	x8, _stats@GOTPAGE
Lloh37:
	ldr	x8, [x8, _stats@GOTPAGEOFF]
Lloh38:
	ldr	x8, [x8]
Lloh39:
	adrp	x9, _LEAF_begemotNgMsgReadErrs@GOTPAGE
Lloh40:
	ldr	x9, [x9, _LEAF_begemotNgMsgReadErrs@GOTPAGEOFF]
Lloh41:
	ldr	x9, [x9]
	lsl	x9, x9, #2
	ldr	w10, [x8, x9]
	add	w10, w10, #1
	str	w10, [x8, x9]
Lloh42:
	adrp	x8, _LOG_WARNING@GOTPAGE
Lloh43:
	ldr	x8, [x8, _LOG_WARNING@GOTPAGEOFF]
Lloh44:
	ldr	w0, [x8]
Lloh45:
	adrp	x1, l_.str.1@PAGE
Lloh46:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_syslog
	b	LBB0_7
LBB0_11:
Lloh47:
	adrp	x8, _LOG_DEBUG@GOTPAGE
Lloh48:
	ldr	x8, [x8, _LOG_DEBUG@GOTPAGEOFF]
Lloh49:
	ldr	w0, [x8]
Lloh50:
	adrp	x1, l_.str.2@PAGE
Lloh51:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_syslog
	mov	w0, #0
	bl	_exit
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_resbufsiz,4,2                  ; @resbufsiz
	.comm	_stats,8,3                      ; @stats
	.comm	_LEAF_begemotNgNoMems,8,3       ; @LEAF_begemotNgNoMems
	.comm	_LOG_CRIT,4,2                   ; @LOG_CRIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"out of memory"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_errno,4,2                      ; @errno
	.comm	_csock,4,2                      ; @csock
	.comm	_EWOULDBLOCK,4,2                ; @EWOULDBLOCK
	.comm	_LEAF_begemotNgMsgReadErrs,8,3  ; @LEAF_begemotNgMsgReadErrs
	.comm	_LOG_WARNING,4,2                ; @LOG_WARNING
l_.str.1:                               ; @.str.1
	.asciz	"read from csock: %m"

	.comm	_LOG_DEBUG,4,2                  ; @LOG_DEBUG
l_.str.2:                               ; @.str.2
	.asciz	"node closed -- exiting"

	.comm	_LEAF_begemotNgTooLargeMsgs,8,3 ; @LEAF_begemotNgTooLargeMsgs
l_.str.3:                               ; @.str.3
	.asciz	"ng message too large"

	.comm	_EFBIG,4,2                      ; @EFBIG
	.no_dead_strip	_csock_read
.subsections_via_symbols
