	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tcpip_read                     ## -- Begin function tcpip_read
	.p2align	4, 0x90
_tcpip_read:                            ## @tcpip_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	%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	%rdx, %r15
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	callq	_tcpip_getsocket
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	___tcpip_poll
	movq	8(%r13), %rbx
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.4:
	xorl	%r12d, %r12d
	testq	%r15, %r15
	jle	LBB0_9
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %r14
	movq	(%r13), %rsi
	subq	%rsi, %r14
	cmpq	%r14, %r15
	cmovlq	%r15, %r14
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r12,4), %rdi
	shlq	$2, %rsi
	addq	8(%rbx), %rsi
	movq	%r14, %rdx
	callq	_UIP_MEMCPY
	subq	%r14, %r15
	movq	(%r13), %rax
	addq	%r14, %rax
	movq	%rax, (%r13)
	cmpq	(%rbx), %rax
	jl	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	$0, (%r13)
	movq	%rbx, %rdi
	callq	_uip_pbuf_dequeue
	movq	%rax, 8(%r13)
	movq	%rbx, %rdi
	callq	_uip_pbuf_free
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	addq	%r14, %r12
	testq	%r15, %r15
	jle	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	8(%r13), %rbx
	testq	%rbx, %rbx
	jne	LBB0_5
	jmp	LBB0_9
LBB0_1:
	movl	$-1, %r12d
LBB0_9:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tcpip_read                     ; -- Begin function tcpip_read
	.p2align	2
_tcpip_read:                            ; @tcpip_read
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x2
	mov	x20, x1
	bl	_tcpip_getsocket
	cbz	x0, LBB0_9
; %bb.1:
	mov	x21, x0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	bl	___tcpip_poll
	ldr	x23, [x21, #8]
	cbz	x23, LBB0_2
; %bb.3:
	cmp	x19, #1
	b.lt	LBB0_10
; %bb.4:
	mov	x22, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	ldp	x9, x10, [x23]
	sub	x9, x9, x8
	cmp	x19, x9
	csel	x24, x19, x9, lt
	add	x0, x20, x22, lsl #2
	add	x1, x10, x8, lsl #2
	mov	x2, x24
	bl	_UIP_MEMCPY
	sub	x19, x19, x24
	ldr	x8, [x21]
	ldr	x9, [x23]
	add	x8, x8, x24
	cmp	x8, x9
	str	x8, [x21]
	b.lt	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	str	xzr, [x21]
	mov	x0, x23
	bl	_uip_pbuf_dequeue
	str	x0, [x21, #8]
	mov	x0, x23
	bl	_uip_pbuf_free
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x22, x24, x22
	cmp	x19, #1
	b.lt	LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x23, [x21, #8]
	cbnz	x23, LBB0_5
	b	LBB0_11
LBB0_9:
	mov	w22, #-1
	b	LBB0_11
LBB0_10:
	mov	w22, #0
LBB0_11:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
