	.file	"extr_bufferevent_sock.c_bufferevent_socket_connect.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	bufferevent_socket_connect
	.type	bufferevent_socket_connect, @function
bufferevent_socket_connect:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13d, edx
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 24
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	BEV_UPCAST@PLT
	mov	rdi, rbp
	mov	rbx, rax
	call	bufferevent_incref_and_lock_@PLT
	mov	rdi, rbp
	call	bufferevent_getfd@PLT
	mov	QWORD PTR [rsp], rax
	test	rax, rax
	js	.L18
	test	r12, r12
	jne	.L19
	mov	rsi, rax
	mov	rdi, rbp
	call	bufferevent_setfd@PLT
.L10:
	mov	esi, DWORD PTR EV_WRITE[rip]
	mov	rdi, rbp
	call	be_socket_enable@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L16
	mov	DWORD PTR [rbx], 1
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L19:
	mov	rsi, r12
	mov	rdi, rsp
	mov	edx, r13d
	call	evutil_socket_connect_@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L16
.L8:
	mov	rsi, QWORD PTR [rsp]
	mov	rdi, rbp
	call	bufferevent_setfd@PLT
	test	r12d, r12d
	je	.L10
	cmp	r12d, 1
	je	.L20
	mov	edx, DWORD PTR BEV_OPT_DEFER_CALLBACKS[rip]
	mov	esi, DWORD PTR BEV_EVENT_ERROR[rip]
	mov	rdi, rbp
	xor	r12d, r12d
	call	bufferevent_run_eventcb_@PLT
	mov	esi, DWORD PTR EV_WRITE[rip]
	mov	rdi, rbp
	or	esi, DWORD PTR EV_READ[rip]
	call	bufferevent_disable@PLT
.L4:
	mov	rdi, rbp
	call	bufferevent_decref_and_unlock_@PLT
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L21
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	test	r12, r12
	je	.L16
	mov	edi, DWORD PTR [r12]
	mov	esi, DWORD PTR SOCK_STREAM[rip]
	xor	edx, edx
	or	esi, DWORD PTR EVUTIL_SOCK_NONBLOCK[rip]
	call	evutil_socket_@PLT
	mov	QWORD PTR [rsp], rax
	test	rax, rax
	js	.L16
	mov	rsi, r12
	mov	rdi, rsp
	mov	edx, r13d
	call	evutil_socket_connect_@PLT
	mov	r12d, eax
	test	eax, eax
	jns	.L8
	mov	rdi, QWORD PTR [rsp]
	call	evutil_closesocket@PLT
	.p2align 4,,10
	.p2align 3
.L16:
	mov	r12d, -1
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L20:
	mov	DWORD PTR [rbx], 1
	mov	edx, DWORD PTR BEV_OPT_DEFER_CALLBACKS[rip]
	mov	rdi, rbp
	xor	r12d, r12d
	mov	esi, DWORD PTR EV_WRITE[rip]
	call	bufferevent_trigger_nolock_@PLT
	jmp	.L4
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	bufferevent_socket_connect, .-bufferevent_socket_connect
	.comm	bufferevent_writecb,4,4
	.comm	SOCK_STREAM,4,4
	.comm	EV_WRITE,4,4
	.comm	EV_READ,4,4
	.comm	EV_PERSIST,4,4
	.comm	EV_FINALIZE,4,4
	.comm	EVUTIL_SOCK_NONBLOCK,4,4
	.comm	BEV_OPT_DEFER_CALLBACKS,4,4
	.comm	BEV_EVENT_ERROR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_bufferevent_sock.c_bufferevent_socket_connect.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	bufferevent_socket_connect
	.syntax unified
	.arm
	.fpu softvfp
	.type	bufferevent_socket_connect, %function
bufferevent_socket_connect:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	ldr	r3, .L22
	sub	sp, sp, #12
	mov	r4, r0
	mov	r5, r1
	mov	r7, r2
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	bl	BEV_UPCAST
	mov	r6, r0
	mov	r0, r4
	bl	bufferevent_incref_and_lock_
	mov	r0, r4
	bl	bufferevent_getfd
	cmp	r0, #0
	str	r0, [sp]
	blt	.L18
	cmp	r5, #0
	bne	.L19
	mov	r1, r0
	mov	r0, r4
	bl	bufferevent_setfd
.L10:
	ldr	r3, .L22+4
	mov	r0, r4
	ldr	r1, [r3]
	bl	be_socket_enable
	subs	r5, r0, #0
	moveq	r3, #1
	streq	r3, [r6]
	beq	.L4
.L16:
	mvn	r5, #0
	b	.L4
.L19:
	mov	r1, r5
	mov	r2, r7
	mov	r0, sp
	bl	evutil_socket_connect_
	subs	r5, r0, #0
	blt	.L16
.L8:
	mov	r0, r4
	ldr	r1, [sp]
	bl	bufferevent_setfd
	cmp	r5, #0
	beq	.L10
	cmp	r5, #1
	ldr	r2, .L22+8
	beq	.L20
	ldr	r3, .L22+12
	ldr	r2, [r2]
	ldr	r1, [r3]
	mov	r0, r4
	bl	bufferevent_run_eventcb_
	ldr	r2, .L22+4
	ldr	r3, .L22+16
	ldr	r1, [r2]
	ldr	r3, [r3]
	mov	r0, r4
	orr	r1, r1, r3
	bl	bufferevent_disable
	mov	r5, #0
.L4:
	mov	r0, r4
	bl	bufferevent_decref_and_unlock_
	ldr	r3, .L22
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L21
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L18:
	cmp	r5, #0
	beq	.L16
	ldr	r2, .L22+20
	ldr	r3, .L22+24
	ldr	r1, [r2]
	ldr	r3, [r3]
	mov	r2, #0
	ldr	r0, [r5]
	orr	r1, r1, r3
	bl	evutil_socket_
	cmp	r0, #0
	str	r0, [sp]
	blt	.L16
	mov	r1, r5
	mov	r2, r7
	mov	r0, sp
	bl	evutil_socket_connect_
	subs	r5, r0, #0
	bge	.L8
	ldr	r0, [sp]
	bl	evutil_closesocket
	b	.L16
.L20:
	ldr	r3, .L22+4
	str	r5, [r6]
	mov	r0, r4
	ldr	r2, [r2]
	ldr	r1, [r3]
	bl	bufferevent_trigger_nolock_
	mov	r5, #0
	b	.L4
.L21:
	bl	__stack_chk_fail
.L23:
	.align	2
.L22:
	.word	.LC0
	.word	EV_WRITE
	.word	BEV_OPT_DEFER_CALLBACKS
	.word	BEV_EVENT_ERROR
	.word	EV_READ
	.word	SOCK_STREAM
	.word	EVUTIL_SOCK_NONBLOCK
	.size	bufferevent_socket_connect, .-bufferevent_socket_connect
	.comm	bufferevent_writecb,4,4
	.comm	SOCK_STREAM,4,4
	.comm	EV_WRITE,4,4
	.comm	EV_READ,4,4
	.comm	EV_PERSIST,4,4
	.comm	EV_FINALIZE,4,4
	.comm	EVUTIL_SOCK_NONBLOCK,4,4
	.comm	BEV_OPT_DEFER_CALLBACKS,4,4
	.comm	BEV_EVENT_ERROR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
