	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_read_tap                       ## -- Begin function read_tap
	.p2align	4, 0x90
_read_tap:                              ## @read_tap
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	(%rdi), %rdi
	xorl	%ebx, %ebx
	cmpl	$0, 16(%r12)
	setne	%bl
	leal	10(,%rbx,4), %r13d
	shll	$2, %ebx
	leaq	(%rdi,%r13), %r15
	xorl	$-2, %ebx
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movl	24(%r12), %edi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_read
	movl	%eax, 8(%r12)
	cmpl	$-1, %eax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_2:
	movq	(%r12), %r14
	leaq	-46(%rbp), %rbx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	$6, %edx
	callq	_memcpy
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_fill_basic
	movq	(%r14), %rdi
	movq	%rbx, %rsi
	movl	$8, %edx
	callq	_memcpy
	movq	_IEEE80211_FC0_TYPE_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	8(%r14), %rax
	orl	%ecx, (%rax)
	movq	_IEEE80211_FC1_DIR_TODS@GOTPCREL(%rip), %rdx
	movl	4(%rax), %ecx
	orl	(%rdx), %ecx
	movl	%ecx, 4(%rax)
	cmpl	$0, 16(%r12)
	je	LBB0_3
## %bb.4:
	movq	_IEEE80211_FC1_PROTECTED@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	movl	%ecx, 4(%rax)
	xorl	%eax, %eax
	cmpl	$0, 16(%r12)
	setne	%al
	shlq	$2, %rax
	jmp	LBB0_5
LBB0_3:
	xorl	%eax, %eax
LBB0_5:
	movl	$240298, 16(%r14,%rax)          ## imm = 0x3AAAA
	movw	$0, 20(%r14,%rax)
	addl	%r13d, 8(%r12)
	cmpl	$0, 16(%r12)
	je	LBB0_7
## %bb.6:
	leaq	16(%r14), %rdi
	leaq	12(%r12), %rsi
	movl	$3, %edx
	callq	_memcpy
	movb	$0, 19(%r14)
	incb	12(%r12)
	movl	20(%r12), %edx
	movl	8(%r12), %esi
	movl	16(%r12), %ecx
	movq	%r14, %rdi
	callq	_wep_encrypt
	addl	$4, 8(%r12)
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read()"

	.comm	_IEEE80211_FC0_TYPE_DATA,4,2    ## @IEEE80211_FC0_TYPE_DATA
	.comm	_IEEE80211_FC1_DIR_TODS,4,2     ## @IEEE80211_FC1_DIR_TODS
	.comm	_IEEE80211_FC1_PROTECTED,4,2    ## @IEEE80211_FC1_PROTECTED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_read_tap                       ; -- Begin function read_tap
	.p2align	2
_read_tap:                              ; @read_tap
	.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
	ldr	x0, [x0]
	ldr	w8, [x19, #16]
	mov	w9, #14
	mov	w10, #10
	cmp	w8, #0
	csel	w22, w10, w9, eq
	add	x21, x0, x22
	mov	w8, #8
	sub	w20, w8, w22
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	w0, [x19, #24]
	mov	x1, x21
	mov	x2, x20
	bl	_read
	str	w0, [x19, #8]
	cmn	w0, #1
	b.ne	LBB0_2
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_2:
	ldr	x20, [x19]
	add	x0, sp, #10
	mov	x1, x21
	mov	w2, #6
	bl	_memcpy
	mov	x0, x20
	mov	x1, x19
	bl	_fill_basic
	ldr	x0, [x20]
	add	x1, sp, #10
	mov	w2, #8
	bl	_memcpy
Lloh2:
	adrp	x8, _IEEE80211_FC0_TYPE_DATA@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IEEE80211_FC0_TYPE_DATA@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x8]
	ldr	x8, [x20, #8]
	ldp	w10, w11, [x8]
	orr	w9, w10, w9
	str	w9, [x8]
Lloh5:
	adrp	x9, _IEEE80211_FC1_DIR_TODS@GOTPAGE
Lloh6:
	ldr	x9, [x9, _IEEE80211_FC1_DIR_TODS@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w9, w11, w9
	str	w9, [x8, #4]
	ldr	w10, [x19, #16]
	cbz	w10, LBB0_4
; %bb.3:
Lloh8:
	adrp	x10, _IEEE80211_FC1_PROTECTED@GOTPAGE
Lloh9:
	ldr	x10, [x10, _IEEE80211_FC1_PROTECTED@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	orr	w9, w10, w9
	str	w9, [x8, #4]
	ldr	w8, [x19, #16]
	cmp	w8, #0
	cset	w8, ne
	lsl	x8, x8, #2
	b	LBB0_5
LBB0_4:
	mov	x8, #0
LBB0_5:
	add	x0, x20, #16
	add	x8, x0, x8
	mov	w9, #43690
	movk	w9, #3, lsl #16
	str	w9, [x8]
	strh	wzr, [x8, #4]
	ldr	w8, [x19, #8]
	add	w8, w8, w22
	str	w8, [x19, #8]
	ldr	w8, [x19, #16]
	cbz	w8, LBB0_7
; %bb.6:
	add	x1, x19, #12
	mov	w2, #3
	bl	_memcpy
	strb	wzr, [x20, #19]
	ldrb	w8, [x19, #12]
	add	w8, w8, #1
	strb	w8, [x19, #12]
	ldr	w1, [x19, #8]
	ldp	w3, w2, [x19, #16]
	mov	x0, x20
	bl	_wep_encrypt
	ldr	w8, [x19, #8]
	add	w8, w8, #4
	str	w8, [x19, #8]
LBB0_7:
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read()"

	.comm	_IEEE80211_FC0_TYPE_DATA,4,2    ; @IEEE80211_FC0_TYPE_DATA
	.comm	_IEEE80211_FC1_DIR_TODS,4,2     ; @IEEE80211_FC1_DIR_TODS
	.comm	_IEEE80211_FC1_PROTECTED,4,2    ; @IEEE80211_FC1_PROTECTED
.subsections_via_symbols
