	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wm_readcb
_wm_readcb:                             ## @wm_readcb
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	xorl	%eax, %eax
	callq	_evbuffer_new
	movq	%rax, %r15
	movl	(%r14), %edi
	callq	_evbuffer_get_length
	movq	%rax, %rbx
	addl	$-10, %eax
	xorl	%edi, %edi
	cmpl	$11, %eax
	setb	%dil
	callq	_assert
	xorl	%edi, %edi
	testq	%r15, %r15
	setne	%dil
	callq	_assert
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_bufferevent_read_buffer
	addl	_wm_readcb.nread(%rip), %ebx
	movl	%ebx, _wm_readcb.nread(%rip)
	cmpl	$65000, %ebx                    ## imm = 0xFDE8
	jne	LBB0_2
## %bb.1:
	movq	_EV_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_bufferevent_disable
	movq	_test_ok@GOTPCREL(%rip), %rax
	incl	(%rax)
LBB0_2:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_evbuffer_free                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_wm_readcb.nread,4,2 ## @wm_readcb.nread
	.comm	_EV_READ,4,2                    ## @EV_READ
	.comm	_test_ok,4,2                    ## @test_ok
	.no_dead_strip	_wm_readcb
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wm_readcb
_wm_readcb:                             ; @wm_readcb
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x0
	bl	_evbuffer_new
	mov	x19, x0
	ldr	w0, [x20]
	bl	_evbuffer_get_length
	mov	x21, x0
	sub	w8, w21, #10
	cmp	w8, #11
	cset	w0, lo
	bl	_assert
	cmp	x19, #0
	cset	w0, ne
	bl	_assert
	mov	x0, x20
	mov	x1, x19
	bl	_bufferevent_read_buffer
	adrp	x8, _wm_readcb.nread@PAGE
	ldr	w9, [x8, _wm_readcb.nread@PAGEOFF]
	mov	w10, #65000
	add	w9, w9, w21
	cmp	w9, w10
	str	w9, [x8, _wm_readcb.nread@PAGEOFF]
	b.ne	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EV_READ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EV_READ@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_bufferevent_disable
Lloh3:
	adrp	x8, _test_ok@GOTPAGE
Lloh4:
	ldr	x8, [x8, _test_ok@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
LBB0_2:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_evbuffer_free
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_wm_readcb.nread,4,2 ; @wm_readcb.nread
	.comm	_EV_READ,4,2                    ; @EV_READ
	.comm	_test_ok,4,2                    ; @test_ok
	.no_dead_strip	_wm_readcb
.subsections_via_symbols
