	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PacketGet                      ## -- Begin function PacketGet
	.p2align	4, 0x90
_PacketGet:                             ## @PacketGet
	.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	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	$8, -36(%rbp)
	movq	_insocket@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-72(%rbp), %rsi
	leaq	-80(%rbp), %r8
	leaq	-36(%rbp), %r9
	movl	$32, %edx
	xorl	%ecx, %ecx
	callq	_recvfrom
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.4:
	movl	%eax, %ebx
	cmpb	$0, _PacketGet.first(%rip)
	jne	LBB0_6
## %bb.5:
	movl	-72(%rbp), %edx
	movl	-68(%rbp), %ecx
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	callq	_printf
LBB0_6:
	movb	$1, _PacketGet.first(%rip)
	movq	_doomcom@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	4(%rax), %ecx
	testl	%ecx, %ecx
	jle	LBB0_7
## %bb.12:
	movq	-80(%rbp), %rsi
	movq	_sendaddress@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdi
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	cmpq	(%rdi,%rdx,8), %rsi
	je	LBB0_8
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	incq	%rdx
	cmpq	%rdx, %rcx
	jne	LBB0_13
	jmp	LBB0_15
LBB0_1:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_EWOULDBLOCK@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	je	LBB0_3
## %bb.2:
	callq	_strerror
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_I_Error
LBB0_3:
	movq	_doomcom@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	jmp	LBB0_15
LBB0_7:
	xorl	%edx, %edx
LBB0_8:
	cmpl	%ecx, %edx
	jne	LBB0_9
LBB0_15:
	movl	$-1, (%rax)
LBB0_16:
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	%edx, (%rax)
	movl	%ebx, 8(%rax)
	movl	-44(%rbp), %edi
	callq	_ntohl
	movq	_netbuffer@GOTPCREL(%rip), %r14
	movq	(%r14), %rcx
	movl	%eax, 28(%rcx)
	movl	-48(%rbp), %eax
	movl	%eax, 24(%rcx)
	movl	-52(%rbp), %eax
	movl	%eax, 20(%rcx)
	movl	-56(%rbp), %eax
	movl	%eax, 16(%rcx)
	movl	-72(%rbp), %eax
	movl	%eax, (%rcx)
	testl	%eax, %eax
	jle	LBB0_16
## %bb.10:
	movq	-64(%rbp), %rax
	movq	8(%rcx), %rcx
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	20(%rax,%rbx), %edx
	movl	%edx, 28(%rcx,%r15)
	movl	16(%rax,%rbx), %edx
	movl	%edx, 24(%rcx,%r15)
	movl	12(%rax,%rbx), %edi
	callq	_ntohs
	movq	(%r14), %rcx
	movq	8(%rcx), %rcx
	movq	%rax, 16(%rcx,%r15)
	movq	-64(%rbp), %rax
	movl	8(%rax,%rbx), %edi
	callq	_ntohs
	movq	(%r14), %rcx
	movq	8(%rcx), %rcx
	movq	%rax, 8(%rcx,%r15)
	movq	-64(%rbp), %rax
	movl	4(%rax,%rbx), %edx
	movq	(%r14), %rsi
	movq	8(%rsi), %rcx
	movl	%edx, 4(%rcx,%r15)
	movl	(%rax,%rbx), %edx
	movl	%edx, (%rcx,%r15)
	incq	%r12
	movslq	(%rsi), %rdx
	addq	$24, %rbx
	addq	$32, %r15
	cmpq	%rdx, %r12
	jl	LBB0_11
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_insocket,4,2                   ## @insocket
	.comm	_errno,8,3                      ## @errno
	.comm	_EWOULDBLOCK,8,3                ## @EWOULDBLOCK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"GetPacket: %s"

	.comm	_doomcom,8,3                    ## @doomcom
.zerofill __DATA,__bss,_PacketGet.first,1,2 ## @PacketGet.first
L_.str.1:                               ## @.str.1
	.asciz	"len=%d:p=[0x%x 0x%x] \n"

	.comm	_sendaddress,8,3                ## @sendaddress
	.comm	_netbuffer,8,3                  ## @netbuffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PacketGet                      ; -- Begin function PacketGet
	.p2align	2
_PacketGet:                             ; @PacketGet
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	w8, #8
	str	w8, [sp, #36]
Lloh0:
	adrp	x8, _insocket@GOTPAGE
Lloh1:
	ldr	x8, [x8, _insocket@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	mov	x1, sp
	add	x4, sp, #40
	add	x5, sp, #36
	mov	w2, #32
	mov	w3, #0
	bl	_recvfrom
	cmn	w0, #1
	b.eq	LBB0_7
; %bb.1:
	mov	x19, x0
	adrp	x20, _PacketGet.first@PAGE
	ldrb	w8, [x20, _PacketGet.first@PAGEOFF]
	tbnz	w8, #0, LBB0_3
; %bb.2:
	ldp	w2, w3, [sp]
Lloh3:
	adrp	x0, l_.str.1@PAGE
Lloh4:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_printf
LBB0_3:
	mov	w8, #1
	strb	w8, [x20, _PacketGet.first@PAGEOFF]
Lloh5:
	adrp	x8, _doomcom@GOTPAGE
Lloh6:
	ldr	x8, [x8, _doomcom@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	ldr	w9, [x8, #4]
	cmp	w9, #1
	b.lt	LBB0_10
; %bb.4:
	mov	x10, #0
	ldr	x11, [sp, #40]
Lloh8:
	adrp	x12, _sendaddress@GOTPAGE
Lloh9:
	ldr	x12, [x12, _sendaddress@GOTPAGEOFF]
Lloh10:
	ldr	x12, [x12]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x13, [x12, x10, lsl #3]
	cmp	x11, x13
	b.eq	LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x10, x10, #1
	cmp	x9, x10
	b.ne	LBB0_5
	b	LBB0_12
LBB0_7:
Lloh11:
	adrp	x8, _errno@GOTPAGE
Lloh12:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh13:
	ldr	x0, [x8]
Lloh14:
	adrp	x8, _EWOULDBLOCK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EWOULDBLOCK@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_9
; %bb.8:
	bl	_strerror
	mov	x1, x0
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	bl	_I_Error
LBB0_9:
Lloh19:
	adrp	x8, _doomcom@GOTPAGE
Lloh20:
	ldr	x8, [x8, _doomcom@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
	b	LBB0_12
LBB0_10:
	mov	w10, #0
LBB0_11:
	cmp	w10, w9
	b.ne	LBB0_14
LBB0_12:
	mov	w9, #-1
	str	w9, [x8]
LBB0_13:
	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
	add	sp, sp, #96
	ret
LBB0_14:
	str	w10, [x8]
	str	w19, [x8, #8]
	ldr	w0, [sp, #28]
	bl	_ntohl
Lloh22:
	adrp	x19, _netbuffer@GOTPAGE
Lloh23:
	ldr	x19, [x19, _netbuffer@GOTPAGEOFF]
	ldr	x9, [x19]
	ldr	w8, [sp, #24]
	stp	w8, w0, [x9, #24]
	ldr	d0, [sp, #16]
	str	d0, [x9, #16]
	ldr	w8, [sp]
	str	w8, [x9]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.15:
	mov	x20, #0
	mov	x21, #0
	mov	x22, #0
	ldr	x8, [sp, #8]
	ldr	x9, [x9, #8]
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	add	x8, x8, x21
	ldr	d0, [x8, #16]
	add	x9, x9, x20
	str	d0, [x9, #24]
	ldr	w0, [x8, #12]
	bl	_ntohs
	ldr	x8, [x19]
	ldr	x8, [x8, #8]
	add	x8, x8, x20
	str	x0, [x8, #16]
	ldr	x8, [sp, #8]
	add	x8, x8, x21
	ldr	w0, [x8, #8]
	bl	_ntohs
	ldr	x8, [x19]
	ldr	x8, [x8, #8]
	add	x8, x8, x20
	str	x0, [x8, #8]
	ldr	x8, [sp, #8]
	ldr	x10, [x19]
	ldr	x9, [x10, #8]
	ldr	d0, [x8, x21]
	str	d0, [x9, x20]
	add	x22, x22, #1
	ldrsw	x10, [x10]
	add	x21, x21, #24
	add	x20, x20, #32
	cmp	x22, x10
	b.lt	LBB0_16
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_insocket,4,2                   ; @insocket
	.comm	_errno,8,3                      ; @errno
	.comm	_EWOULDBLOCK,8,3                ; @EWOULDBLOCK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"GetPacket: %s"

	.comm	_doomcom,8,3                    ; @doomcom
.zerofill __DATA,__bss,_PacketGet.first,1,2 ; @PacketGet.first
l_.str.1:                               ; @.str.1
	.asciz	"len=%d:p=[0x%x 0x%x] \n"

	.comm	_sendaddress,8,3                ; @sendaddress
	.comm	_netbuffer,8,3                  ; @netbuffer
.subsections_via_symbols
