	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function checkbuf
_checkbuf:                              ## @checkbuf
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	%esi, -36(%rbp)
	movq	_maxrecsize@GOTPCREL(%rip), %r15
	cmpl	%esi, (%r15)
	jge	LBB0_8
## %bb.1:
	movl	%esi, %ebx
	testq	%r14, %r14
	je	LBB0_3
## %bb.2:
	movq	%r14, %rdi
	callq	_free
LBB0_3:
	movl	%ebx, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_9
## %bb.4:
	movq	%rax, %r14
	movl	%ebx, (%r15)
	cmpl	$1025, %ebx                     ## imm = 0x401
	jl	LBB0_8
## %bb.5:
	movq	_SOL_SOCKET@GOTPCREL(%rip), %r15
	movq	_SO_RCVBUF@GOTPCREL(%rip), %r12
	leaq	-36(%rbp), %rbx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movl	(%r12), %edx
	xorl	%edi, %edi
	movq	%rbx, %rcx
	movl	$4, %r8d
	callq	_setsockopt
	testq	%rax, %rax
	jns	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	-36(%rbp), %eax
	leal	-1024(%rax), %ecx
	movl	%ecx, -36(%rbp)
	cmpl	$2048, %eax                     ## imm = 0x800
	jg	LBB0_6
LBB0_8:
	movq	%r14, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	leaq	L_.str(%rip), %rdi
	callq	_DEBUG
	movl	$4, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_maxrecsize,4,2                 ## @maxrecsize
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rmtd: cannot allocate buffer space\n"

	.comm	_SOL_SOCKET,4,2                 ## @SOL_SOCKET
	.comm	_SO_RCVBUF,4,2                  ## @SO_RCVBUF
	.no_dead_strip	_checkbuf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function checkbuf
_checkbuf:                              ; @checkbuf
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	str	w1, [sp, #12]
Lloh0:
	adrp	x21, _maxrecsize@GOTPAGE
Lloh1:
	ldr	x21, [x21, _maxrecsize@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, w1
	b.ge	LBB0_8
; %bb.1:
	mov	x20, x1
	cbz	x19, LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_free
LBB0_3:
	mov	x0, x20
	bl	_malloc
	cbz	x0, LBB0_9
; %bb.4:
	mov	x19, x0
	str	w20, [x21]
	cmp	w20, #1025
	b.lt	LBB0_8
; %bb.5:
Lloh2:
	adrp	x20, _SOL_SOCKET@GOTPAGE
Lloh3:
	ldr	x20, [x20, _SOL_SOCKET@GOTPAGEOFF]
Lloh4:
	adrp	x21, _SO_RCVBUF@GOTPAGE
Lloh5:
	ldr	x21, [x21, _SO_RCVBUF@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x20]
	ldr	w2, [x21]
	add	x3, sp, #12
	mov	w0, #0
	mov	w4, #4
	bl	_setsockopt
	tbz	x0, #63, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [sp, #12]
	sub	w9, w8, #1024
	str	w9, [sp, #12]
	cmp	w8, #2048
	b.gt	LBB0_6
LBB0_8:
	mov	x0, x19
	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
	add	sp, sp, #64
	ret
LBB0_9:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DEBUG
	mov	w0, #4
	bl	_exit
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_maxrecsize,4,2                 ; @maxrecsize
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rmtd: cannot allocate buffer space\n"

	.comm	_SOL_SOCKET,4,2                 ; @SOL_SOCKET
	.comm	_SO_RCVBUF,4,2                  ; @SO_RCVBUF
	.no_dead_strip	_checkbuf
.subsections_via_symbols
