	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function recv_pkt
_recv_pkt:                              ## @recv_pkt
	.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	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movslq	%esi, %r12
	leaq	(,%r12,8), %rdi
	addq	40(%rbx), %rdi
	movl	$1, %esi
	movl	%ecx, %edx
	callq	_poll
	testl	%eax, %eax
	js	LBB0_1
## %bb.6:
	jne	LBB0_2
## %bb.7:
	movl	$-1, %eax
	jmp	LBB0_14
LBB0_1:
	movl	32(%rbx), %edx
	movq	24(%rbx), %rax
	movl	(%rax,%r12,4), %r8d
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	movq	%r14, %rcx
	callq	_err
LBB0_2:
	movq	40(%rbx), %rax
	movq	(%rax,%r12,8), %rax
	movq	_POLLIN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_4
## %bb.3:
	movl	32(%rbx), %edx
	movq	24(%rbx), %rax
	movl	(%rax,%r12,4), %r8d
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	movq	%r14, %rcx
	xorl	%eax, %eax
	callq	_errx
LBB0_4:
	cmpq	$0, (%rbx)
	je	LBB0_5
## %bb.8:
	leaq	-56(%rbp), %rcx
	movl	$24, %r8d
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movq	%r14, %rdx
	callq	_recv_pkt_recvmsg
	jmp	LBB0_9
LBB0_5:
	leaq	-56(%rbp), %rcx
	movl	$24, %r8d
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movq	%r14, %rdx
	callq	_recv_pkt_recv
LBB0_9:
	movq	-56(%rbp), %r9
	movq	_NPKTS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r9
	jae	LBB0_12
## %bb.10:
	movl	-40(%rbp), %r15d
	movq	%rbx, %rdi
	movq	%r9, %rsi
	callq	_PDATA
	movq	_PKT_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_memcmp
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:
	movq	-56(%rbp), %r9
LBB0_12:
	movl	32(%rbx), %edx
	movq	24(%rbx), %rax
	movl	(%rax,%r12,4), %r8d
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	movq	%r14, %rcx
	xorl	%eax, %eax
	callq	_errx
LBB0_13:
	incl	8(%rbx)
	movq	16(%rbx), %rax
	movq	-56(%rbp), %rcx
	movq	-48(%rbp), %rsi
	shlq	$4, %rcx
	movl	8(%rax,%rcx), %edi
	movl	$8, %edx
	callq	_memcpy
	movq	16(%rbx), %rcx
	movq	-56(%rbp), %rax
	movq	%rax, %rdx
	shlq	$4, %rdx
	movq	$0, (%rcx,%rdx)
LBB0_14:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: %s: poll(%d)"

	.comm	_POLLIN,8,3                     ## @POLLIN
L_.str.1:                               ## @.str.1
	.asciz	"%s: %s: poll(%d): unexpected result"

	.comm	_NPKTS,8,3                      ## @NPKTS
	.comm	_PKT_SIZE,4,2                   ## @PKT_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"%s: %s: recv(%d): corrupted data, packet %d"

	.no_dead_strip	_recv_pkt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function recv_pkt
_recv_pkt:                              ; @recv_pkt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x8, [x0, #40]
	sxtw	x22, w21
	add	x0, x8, w1, sxtw #3
	mov	w1, #1
	mov	x2, x3
	bl	_poll
	tbnz	w0, #31, LBB0_3
; %bb.1:
	cbnz	w0, LBB0_4
; %bb.2:
	mov	w0, #-1
	b	LBB0_14
LBB0_3:
	ldr	w2, [x19, #32]
	ldr	x8, [x19, #24]
	ldr	w4, [x8, x22, lsl #2]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	mov	x3, x20
	bl	_err
LBB0_4:
	ldr	x8, [x19, #40]
	ldr	x8, [x8, x22, lsl #3]
Lloh2:
	adrp	x9, _POLLIN@GOTPAGE
Lloh3:
	ldr	x9, [x9, _POLLIN@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_6
; %bb.5:
	ldr	w2, [x19, #32]
	ldr	x8, [x19, #24]
	ldr	w4, [x8, x22, lsl #2]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	mov	x3, x20
	bl	_errx
LBB0_6:
	ldr	x8, [x19]
	cbz	x8, LBB0_8
; %bb.7:
	add	x3, sp, #8
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	mov	w4, #24
	bl	_recv_pkt_recvmsg
	b	LBB0_9
LBB0_8:
	add	x3, sp, #8
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	mov	w4, #24
	bl	_recv_pkt_recv
LBB0_9:
	ldr	x1, [sp, #8]
Lloh7:
	adrp	x8, _NPKTS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _NPKTS@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	cmp	x1, x8
	b.hs	LBB0_12
; %bb.10:
	ldr	w21, [sp, #24]
	mov	x0, x19
	bl	_PDATA
	mov	x1, x0
Lloh10:
	adrp	x8, _PKT_SIZE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PKT_SIZE@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	x0, x21
	bl	_memcmp
	cbz	x0, LBB0_13
; %bb.11:
	ldr	x1, [sp, #8]
LBB0_12:
	ldr	w2, [x19, #32]
	ldr	x8, [x19, #24]
	ldr	w4, [x8, x22, lsl #2]
Lloh13:
	adrp	x8, l_.str.2@PAGE
Lloh14:
	add	x8, x8, l_.str.2@PAGEOFF
	str	x1, [sp]
	mov	w0, #1
	mov	x1, x8
	mov	x3, x20
	bl	_errx
LBB0_13:
	ldr	w8, [x19, #8]
	add	w8, w8, #1
	str	w8, [x19, #8]
	ldr	x8, [x19, #16]
	ldp	x9, x1, [sp, #8]
	add	x8, x8, x9, lsl #4
	ldr	w0, [x8, #8]
	mov	w2, #8
	bl	_memcpy
	ldr	x8, [x19, #16]
	ldr	x0, [sp, #8]
	lsl	x9, x0, #4
	str	xzr, [x8, x9]
LBB0_14:
                                        ; kill: def $w0 killed $w0 killed $x0
	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
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: %s: poll(%d)"

	.comm	_POLLIN,8,3                     ; @POLLIN
l_.str.1:                               ; @.str.1
	.asciz	"%s: %s: poll(%d): unexpected result"

	.comm	_NPKTS,8,3                      ; @NPKTS
	.comm	_PKT_SIZE,4,2                   ; @PKT_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"%s: %s: recv(%d): corrupted data, packet %d"

	.no_dead_strip	_recv_pkt
.subsections_via_symbols
