	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_link_socket_read_tcp           ## -- Begin function link_socket_read_tcp
	.p2align	4, 0x90
_link_socket_read_tcp:                  ## @link_socket_read_tcp
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	leaq	8(%rdi), %r15
	cmpq	$0, 8(%rdi)
	je	LBB0_3
LBB0_1:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_stream_buf_get_final
	movq	%r15, %rdi
	callq	_stream_buf_reset
	movl	(%r14), %eax
	jmp	LBB0_2
LBB0_3:
	movq	%rdi, %rbx
	leaq	-48(%rbp), %r12
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_stream_buf_get_next
	movl	16(%rbx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r12, %rdi
	callq	_BPTR
	movl	%eax, %r13d
	movq	%r12, %rdi
	callq	_BLEN
	movq	_MSG_NOSIGNAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_recv
	testl	%eax, %eax
	je	LBB0_8
## %bb.4:
	jle	LBB0_9
## %bb.5:
	cmpq	$0, (%r15)
	jne	LBB0_1
## %bb.6:
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_stream_buf_added
	testq	%rax, %rax
	jne	LBB0_1
## %bb.7:
	movl	$0, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_2
LBB0_8:
	movl	$1, (%rbx)
LBB0_9:
	movl	%eax, (%r14)
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MSG_NOSIGNAL,4,2               ## @MSG_NOSIGNAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_link_socket_read_tcp           ; -- Begin function link_socket_read_tcp
	.p2align	2
_link_socket_read_tcp:                  ; @link_socket_read_tcp
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x20, #8]!
	cbz	x8, LBB0_2
LBB0_1:
	mov	x0, x20
	mov	x1, x19
	bl	_stream_buf_get_final
	mov	x0, x20
	bl	_stream_buf_reset
	ldr	w1, [x19]
	b	LBB0_9
LBB0_2:
	mov	x21, x0
	add	x1, sp, #8
	mov	x0, x20
	bl	_stream_buf_get_next
	ldr	w22, [x21, #16]
	add	x0, sp, #8
	bl	_BPTR
	mov	x23, x0
	add	x0, sp, #8
	bl	_BLEN
	mov	x2, x0
Lloh0:
	adrp	x8, _MSG_NOSIGNAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MSG_NOSIGNAL@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	x0, x22
	mov	x1, x23
	bl	_recv
	mov	x1, x0
	cbz	w0, LBB0_7
; %bb.3:
	cmp	w1, #0
	b.le	LBB0_8
; %bb.4:
	ldr	x8, [x20]
	cbnz	x8, LBB0_1
; %bb.5:
	mov	x0, x20
	bl	_stream_buf_added
	cbnz	x0, LBB0_1
; %bb.6:
	mov	w1, #0
	str	wzr, [x19]
	b	LBB0_9
LBB0_7:
	mov	w8, #1
	str	w8, [x21]
LBB0_8:
	str	w1, [x19]
LBB0_9:
	mov	x0, x1
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_MSG_NOSIGNAL,4,2               ; @MSG_NOSIGNAL
.subsections_via_symbols
