	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sock_recv                      ## -- Begin function sock_recv
	.p2align	4, 0x90
_sock_recv:                             ## @sock_recv
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdx, %rdx
	je	LBB0_1
## %bb.2:
	movl	%ecx, %r13d
	movq	%rdx, %r12
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	cmpq	%rdx, %rcx
	jae	LBB0_5
## %bb.3:
	movl	$-1, %r12d
	testq	%r8, %r8
	je	LBB0_17
## %bb.4:
	leaq	L_.str.1(%rip), %rdx
	movq	%r8, %rdi
	movl	%r9d, %esi
	xorl	%eax, %eax
	callq	_pcap_snprintf
	jmp	LBB0_17
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_SOCK_DEBUG_MESSAGE
	xorl	%r12d, %r12d
LBB0_17:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%rsi, %rbx
	movl	%edi, %r14d
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movl	%r9d, -44(%rbp)                 ## 4-byte Spill
	movl	%r12d, %r15d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r14d, %edi
	movq	%rbx, %rsi
	movl	%r15d, %edx
	xorl	%ecx, %ecx
	callq	_recv
	testl	%eax, %eax
	je	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpl	$-1, %eax
	je	LBB0_8
## %bb.14:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	_SOCK_RECEIVEALL_YES@GOTPCREL(%rip), %rcx
	testl	%r13d, (%rcx)
	je	LBB0_15
## %bb.16:                              ##   in Loop: Header=BB0_6 Depth=1
	movslq	%eax, %rcx
	addq	%rcx, %rbx
	subl	%eax, %r15d
	jne	LBB0_6
	jmp	LBB0_17
LBB0_10:
	cmpl	%r12d, %r15d
	jne	LBB0_12
## %bb.11:
	movq	_SOCK_EOF_IS_ERROR@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	andl	(%rax), %r13d
	je	LBB0_17
LBB0_12:
	movl	$-1, %r12d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	testq	%rdi, %rdi
	je	LBB0_17
## %bb.13:
	leaq	L_.str.3(%rip), %rdx
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_pcap_snprintf
	jmp	LBB0_17
LBB0_8:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_EINTR@GOTPCREL(%rip), %rcx
	movl	$-3, %r12d
	cmpq	(%rcx), %rax
	je	LBB0_17
## %bb.9:
	leaq	L_.str.2(%rip), %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_sock_geterror
	movl	$-1, %r12d
	jmp	LBB0_17
LBB0_15:
	movl	%eax, %r12d
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"I have been requested to read zero bytes"

	.comm	_INT_MAX,8,3                    ## @INT_MAX
L_.str.1:                               ## @.str.1
	.asciz	"Can't read more than %u bytes with sock_recv"

	.comm	_errno,8,3                      ## @errno
	.comm	_EINTR,8,3                      ## @EINTR
L_.str.2:                               ## @.str.2
	.asciz	"recv(): "

	.comm	_SOCK_EOF_IS_ERROR,4,2          ## @SOCK_EOF_IS_ERROR
L_.str.3:                               ## @.str.3
	.asciz	"The other host terminated the connection."

	.comm	_SOCK_RECEIVEALL_YES,4,2        ## @SOCK_RECEIVEALL_YES
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sock_recv                      ; -- Begin function sock_recv
	.p2align	2
_sock_recv:                             ; @sock_recv
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x21, x2
	cbz	x2, LBB0_6
; %bb.1:
	mov	x19, x5
	mov	x20, x4
Lloh0:
	adrp	x8, _INT_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _INT_MAX@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x21
	b.hs	LBB0_8
; %bb.2:
	cbz	x20, LBB0_5
; %bb.3:
	str	x8, [sp]
Lloh3:
	adrp	x2, l_.str.1@PAGE
Lloh4:
	add	x2, x2, l_.str.1@PAGEOFF
LBB0_4:
	mov	x0, x20
	mov	x1, x19
	bl	_pcap_snprintf
LBB0_5:
	mov	w21, #-1
	b	LBB0_7
LBB0_6:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_SOCK_DEBUG_MESSAGE
LBB0_7:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_8:
	mov	x22, x3
	mov	x23, x1
	mov	x24, x0
Lloh7:
	adrp	x26, _SOCK_RECEIVEALL_YES@GOTPAGE
Lloh8:
	ldr	x26, [x26, _SOCK_RECEIVEALL_YES@GOTPAGEOFF]
	mov	x25, x21
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	mov	x1, x23
	mov	x2, x25
	mov	w3, #0
	bl	_recv
	cbz	w0, LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	cmn	w0, #1
	b.eq	LBB0_16
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w8, [x26]
	tst	w8, w22
	b.eq	LBB0_18
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x23, x23, w0, sxtw
	subs	w25, w25, w0
	b.ne	LBB0_9
	b	LBB0_7
LBB0_13:
	cmp	w25, w21
	b.ne	LBB0_19
; %bb.14:
Lloh9:
	adrp	x8, _SOCK_EOF_IS_ERROR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SOCK_EOF_IS_ERROR@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	and	w8, w8, w22
	cbnz	w8, LBB0_19
; %bb.15:
	mov	w21, #0
	b	LBB0_7
LBB0_16:
Lloh12:
	adrp	x8, _errno@GOTPAGE
Lloh13:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
Lloh15:
	adrp	x9, _EINTR@GOTPAGE
Lloh16:
	ldr	x9, [x9, _EINTR@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_21
; %bb.17:
	mov	w21, #-3
	b	LBB0_7
LBB0_18:
	mov	x21, x0
	b	LBB0_7
LBB0_19:
	cbz	x20, LBB0_5
; %bb.20:
Lloh18:
	adrp	x2, l_.str.3@PAGE
Lloh19:
	add	x2, x2, l_.str.3@PAGEOFF
	b	LBB0_4
LBB0_21:
Lloh20:
	adrp	x0, l_.str.2@PAGE
Lloh21:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x20
	mov	x2, x19
	bl	_sock_geterror
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"I have been requested to read zero bytes"

	.comm	_INT_MAX,8,3                    ; @INT_MAX
l_.str.1:                               ; @.str.1
	.asciz	"Can't read more than %u bytes with sock_recv"

	.comm	_errno,8,3                      ; @errno
	.comm	_EINTR,8,3                      ; @EINTR
l_.str.2:                               ; @.str.2
	.asciz	"recv(): "

	.comm	_SOCK_EOF_IS_ERROR,4,2          ; @SOCK_EOF_IS_ERROR
l_.str.3:                               ; @.str.3
	.asciz	"The other host terminated the connection."

	.comm	_SOCK_RECEIVEALL_YES,4,2        ; @SOCK_RECEIVEALL_YES
.subsections_via_symbols
