	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_packet
_read_packet:                           ## @read_packet
	.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
	movl	%edx, %ebx
	movq	%rsi, %r14
	movl	%edi, %r15d
	xorl	%edi, %edi
	testl	%edx, %edx
	setg	%dil
	callq	_assert
	cmpl	$0, _read_packet.totlen(%rip)
	jne	LBB0_4
## %bb.1:
	leaq	_read_packet.buf(%rip), %r12
	movl	%r15d, %edi
	movq	%r12, %rsi
	movl	$4096, %edx                     ## imm = 0x1000
	callq	_read
	movl	%eax, _read_packet.totlen(%rip)
	cmpl	$-1, %eax
	je	LBB0_2
## %bb.3:
	movq	%r12, _read_packet.next(%rip)
LBB0_4:
	leaq	_read_packet.next(%rip), %rdi
	leaq	_read_packet.totlen(%rip), %rsi
	leaq	-36(%rbp), %rdx
	callq	_get_80211
	movq	%rax, %r15
	movl	-36(%rbp), %eax
	cmpl	%ebx, %eax
	jle	LBB0_6
## %bb.5:
	movl	%ebx, -36(%rbp)
	movl	%ebx, %eax
LBB0_6:
	xorl	%edi, %edi
	testl	%eax, %eax
	setg	%dil
	callq	_assert
	movl	-36(%rbp), %edx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_memcpy
	movl	-36(%rbp), %eax
LBB0_7:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	$0, _read_packet.totlen(%rip)
	movl	$-1, %eax
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_read_packet.buf,4096,4 ## @read_packet.buf
.zerofill __DATA,__bss,_read_packet.totlen,4,2 ## @read_packet.totlen
	.section	__DATA,__data
	.p2align	3                               ## @read_packet.next
_read_packet.next:
	.quad	_read_packet.buf

	.no_dead_strip	_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_packet
_read_packet:                           ; @read_packet
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	cmp	w2, #0
	cset	w0, gt
	bl	_assert
	adrp	x23, _read_packet.totlen@PAGE
	ldr	w8, [x23, _read_packet.totlen@PAGEOFF]
	cbnz	w8, LBB0_3
; %bb.1:
Lloh0:
	adrp	x22, _read_packet.buf@PAGE
Lloh1:
	add	x22, x22, _read_packet.buf@PAGEOFF
	mov	x0, x21
	mov	x1, x22
	mov	w2, #4096
	bl	_read
	str	w0, [x23, _read_packet.totlen@PAGEOFF]
	cmn	w0, #1
	b.eq	LBB0_7
; %bb.2:
	adrp	x8, _read_packet.next@PAGE
	str	x22, [x8, _read_packet.next@PAGEOFF]
LBB0_3:
Lloh2:
	adrp	x0, _read_packet.next@PAGE
Lloh3:
	add	x0, x0, _read_packet.next@PAGEOFF
Lloh4:
	adrp	x1, _read_packet.totlen@PAGE
Lloh5:
	add	x1, x1, _read_packet.totlen@PAGEOFF
	add	x2, sp, #12
	bl	_get_80211
	mov	x21, x0
	ldr	w8, [sp, #12]
	cmp	w8, w20
	b.le	LBB0_5
; %bb.4:
	str	w20, [sp, #12]
	mov	x8, x20
LBB0_5:
	cmp	w8, #0
	cset	w0, gt
	bl	_assert
	ldr	w2, [sp, #12]
	mov	x0, x19
	mov	x1, x21
	bl	_memcpy
	ldr	w0, [sp, #12]
LBB0_6:
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_7:
	str	wzr, [x23, _read_packet.totlen@PAGEOFF]
	b	LBB0_6
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_read_packet.buf,4096,0 ; @read_packet.buf
.zerofill __DATA,__bss,_read_packet.totlen,4,2 ; @read_packet.totlen
	.section	__DATA,__data
	.p2align	3                               ; @read_packet.next
_read_packet.next:
	.quad	_read_packet.buf

	.no_dead_strip	_read_packet
.subsections_via_symbols
