	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function be_async_ctrl
_be_async_ctrl:                         ## @be_async_ctrl
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rdi, %r15
	movl	$-1, %ebx
	cmpl	$128, %esi
	je	LBB0_4
## %bb.1:
	cmpl	$131, %esi
	je	LBB0_8
## %bb.2:
	cmpl	$130, %esi
	jne	LBB0_13
## %bb.3:
	movl	(%r15), %edi
	callq	_evbuffer_overlapped_get_fd_
	movq	%rax, (%r14)
	jmp	LBB0_12
LBB0_4:
	movq	(%r14), %r12
	movl	(%r15), %edi
	callq	_evbuffer_overlapped_get_fd_
	cmpq	%rax, %r12
	je	LBB0_12
## %bb.5:
	movl	8(%r15), %edi
	callq	_event_base_get_iocp_
	testq	%rax, %rax
	je	LBB0_13
## %bb.6:
	movq	(%r14), %rsi
	movq	%rax, %rdi
	movl	$1, %edx
	callq	_event_iocp_port_associate_
	testl	%eax, %eax
	js	LBB0_13
## %bb.7:
	movl	(%r15), %edi
	movq	(%r14), %rsi
	callq	_evbuffer_overlapped_set_fd_
	movl	4(%r15), %edi
	movq	(%r14), %rsi
	callq	_evbuffer_overlapped_set_fd_
	jmp	LBB0_12
LBB0_8:
	movq	%r15, %rdi
	callq	_upcast
	movq	%rax, %rbx
	movl	(%r15), %edi
	callq	_evbuffer_overlapped_get_fd_
	movq	_INVALID_SOCKET@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rax
	je	LBB0_11
## %bb.9:
	movq	_BEV_OPT_CLOSE_ON_FREE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 4(%rbx)
	je	LBB0_11
## %bb.10:
	movq	%rax, %rdi
	callq	_closesocket
	movl	(%r15), %edi
	movq	(%r14), %rsi
	callq	_evbuffer_overlapped_set_fd_
LBB0_11:
	movl	$0, (%rbx)
LBB0_12:
	xorl	%ebx, %ebx
LBB0_13:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INVALID_SOCKET,8,3             ## @INVALID_SOCKET
	.comm	_BEV_OPT_CLOSE_ON_FREE,4,2      ## @BEV_OPT_CLOSE_ON_FREE
	.no_dead_strip	_be_async_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function be_async_ctrl
_be_async_ctrl:                         ; @be_async_ctrl
	.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, x2
	mov	x19, x0
	cmp	w1, #128
	b.eq	LBB0_4
; %bb.1:
	cmp	w1, #131
	b.eq	LBB0_9
; %bb.2:
	cmp	w1, #130
	b.ne	LBB0_8
; %bb.3:
	ldr	w0, [x19]
	bl	_evbuffer_overlapped_get_fd_
	mov	x8, x0
	mov	w0, #0
	str	x8, [x20]
	b	LBB0_14
LBB0_4:
	ldr	x21, [x20]
	ldr	w0, [x19]
	bl	_evbuffer_overlapped_get_fd_
	cmp	x21, x0
	b.eq	LBB0_13
; %bb.5:
	ldr	w0, [x19, #8]
	bl	_event_base_get_iocp_
	cbz	x0, LBB0_8
; %bb.6:
	ldr	x1, [x20]
	mov	w2, #1
	bl	_event_iocp_port_associate_
	tbnz	w0, #31, LBB0_8
; %bb.7:
	ldr	w0, [x19]
	ldr	x1, [x20]
	bl	_evbuffer_overlapped_set_fd_
	ldr	w0, [x19, #4]
	ldr	x1, [x20]
	bl	_evbuffer_overlapped_set_fd_
	mov	w0, #0
	b	LBB0_14
LBB0_8:
	mov	w0, #-1
	b	LBB0_14
LBB0_9:
	mov	x0, x19
	bl	_upcast
	mov	x20, x0
	ldr	w0, [x19]
	bl	_evbuffer_overlapped_get_fd_
Lloh0:
	adrp	x21, _INVALID_SOCKET@GOTPAGE
Lloh1:
	ldr	x21, [x21, _INVALID_SOCKET@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x0, x8
	b.eq	LBB0_12
; %bb.10:
	ldr	w8, [x20, #4]
Lloh2:
	adrp	x9, _BEV_OPT_CLOSE_ON_FREE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _BEV_OPT_CLOSE_ON_FREE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.11:
	bl	_closesocket
	ldr	w0, [x19]
	ldr	x1, [x21]
	bl	_evbuffer_overlapped_set_fd_
LBB0_12:
	mov	w0, #0
	str	wzr, [x20]
	b	LBB0_14
LBB0_13:
	mov	w0, #0
LBB0_14:
	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
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_INVALID_SOCKET,8,3             ; @INVALID_SOCKET
	.comm	_BEV_OPT_CLOSE_ON_FREE,4,2      ; @BEV_OPT_CLOSE_ON_FREE
	.no_dead_strip	_be_async_ctrl
.subsections_via_symbols
