	.file	"extr_watchcat-engine.c_start_server.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"(none)"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"cannot open server socket at port %d: %m\n"
	.align 8
.LC2:
	.string	"created listening socket at %s:%d, fd=%d\n"
	.align 8
.LC3:
	.string	"fatal: cannot change user to %s\n"
	.align 8
.LC4:
	.string	"fatal: cannot resolve hostname %s: %m\n"
	.section	.rodata.str1.1
.LC5:
	.string	"Server started\n"
	.section	.rodata.str1.8
	.align 8
.LC6:
	.string	"epoll_work(): %d out of %d connections, network bufers: %d used, %d out of %d allocated\n"
	.align 8
.LC7:
	.string	"after epoll_work(), sigpoll_cnt=%d\n"
	.section	.rodata.str1.1
.LC8:
	.string	"Quitting.\n"
	.text
	.p2align 4
	.globl	start_server
	.type	start_server, @function
start_server:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	xor	eax, eax
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	init_epoll@PLT
	xor	eax, eax
	call	init_netbuffers@PLT
	mov	rax, QWORD PTR sfd[rip]
	test	rax, rax
	je	.L28
	test	rax, rax
	js	.L29
.L3:
	mov	esi, DWORD PTR verbosity[rip]
	test	esi, esi
	jne	.L30
.L4:
	cmp	QWORD PTR daemonize[rip], 0
	jne	.L31
.L5:
	mov	rdi, QWORD PTR username[rip]
	call	change_user@PLT
	test	rax, rax
	jns	.L6
	mov	rdx, QWORD PTR username[rip]
	lea	rax, .LC0[rip]
	mov	edi, DWORD PTR stderr[rip]
	lea	rsi, .LC3[rip]
	test	rdx, rdx
	cmove	rdx, rax
	xor	eax, eax
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	mov	rdi, QWORD PTR sfd[rip]
	lea	rdx, memcache_methods[rip]
	lea	rsi, ct_watchcat_engine_server[rip]
	call	init_listening_connection@PLT
	mov	rdi, QWORD PTR hostname[rip]
	call	gethostbyname@PLT
	mov	rbx, rax
	test	rax, rax
	je	.L8
	mov	rax, QWORD PTR AF_INET[rip]
	cmp	QWORD PTR [rbx], rax
	je	.L32
.L8:
	mov	rdx, QWORD PTR hostname[rip]
	mov	edi, DWORD PTR stderr[rip]
	lea	rsi, .LC4[rip]
	xor	eax, eax
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
	mov	rax, QWORD PTR 16[rbx]
.L9:
	mov	eax, DWORD PTR [rax]
	xor	esi, esi
	lea	rdi, default_ct[rip]
	mov	DWORD PTR default_ct[rip+4], eax
	mov	eax, DWORD PTR queue_port[rip]
	mov	DWORD PTR default_ct[rip], eax
	call	create_target@PLT
	mov	DWORD PTR queue_conn[rip], eax
	xor	eax, eax
	call	create_all_outbound_connections@PLT
	mov	esi, DWORD PTR sigint_handler[rip]
	mov	edi, DWORD PTR SIGINT[rip]
	call	signal@PLT
	mov	esi, DWORD PTR sigterm_handler[rip]
	mov	edi, DWORD PTR SIGTERM[rip]
	call	signal@PLT
	mov	esi, DWORD PTR sigusr1_handler[rip]
	mov	edi, DWORD PTR SIGUSR1[rip]
	call	signal@PLT
	mov	esi, DWORD PTR SIG_IGN[rip]
	mov	edi, DWORD PTR SIGPIPE[rip]
	call	signal@PLT
	mov	esi, DWORD PTR sigpoll_handler[rip]
	mov	edi, DWORD PTR SIGPOLL[rip]
	call	signal@PLT
	cmp	QWORD PTR daemonize[rip], 0
	jne	.L33
.L10:
	mov	eax, DWORD PTR verbosity[rip]
	test	eax, eax
	jne	.L34
.L11:
	xor	r13d, r13d
	xor	ebp, ebp
	lea	r12, .LC6[rip]
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L12:
	mov	edi, 57
	call	epoll_work@PLT
	mov	edx, DWORD PTR sigpoll_cnt[rip]
	test	edx, edx
	jle	.L13
	cmp	DWORD PTR verbosity[rip], 1
	jle	.L14
	mov	edi, DWORD PTR stderr[rip]
	lea	rsi, .LC7[rip]
	xor	eax, eax
	call	fprintf@PLT
.L14:
	mov	DWORD PTR sigpoll_cnt[rip], 0
.L13:
	mov	ebx, DWORD PTR now[rip]
	cmp	ebx, r13d
	je	.L15
	xor	eax, eax
	call	cron@PLT
.L15:
	xor	eax, eax
	call	epoll_pre_event@PLT
	mov	rax, QWORD PTR quit_steps[rip]
	test	rax, rax
	je	.L18
	sub	rax, 1
	mov	QWORD PTR quit_steps[rip], rax
	je	.L35
.L18:
	mov	eax, DWORD PTR verbosity[rip]
	add	ebp, 1
	mov	r13d, ebx
.L17:
	test	eax, eax
	jle	.L12
	test	bpl, bpl
	jne	.L12
	mov	eax, DWORD PTR NB_max[rip]
	sub	rsp, 8
	.cfi_def_cfa_offset 56
	mov	edx, DWORD PTR active_connections[rip]
	mov	rsi, r12
	mov	r9d, DWORD PTR NB_alloc[rip]
	mov	r8d, DWORD PTR NB_used[rip]
	mov	ecx, DWORD PTR maxconn[rip]
	mov	edi, DWORD PTR stderr[rip]
	push	rax
	.cfi_def_cfa_offset 64
	xor	eax, eax
	call	fprintf@PLT
	pop	rax
	.cfi_def_cfa_offset 56
	pop	rdx
	.cfi_def_cfa_offset 48
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L35:
	mov	edi, DWORD PTR stderr[rip]
	lea	rsi, .LC8[rip]
	call	fprintf@PLT
	mov	rdi, QWORD PTR sfd[rip]
	call	epoll_close@PLT
	mov	rdi, QWORD PTR sfd[rip]
	call	close@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	not	rax
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	mov	rdi, rax
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	shr	rdi, 63
	jmp	assert@PLT
	.p2align 4,,10
	.p2align 3
.L31:
	.cfi_restore_state
	xor	eax, eax
	call	setsid@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L28:
	mov	edx, DWORD PTR backlog[rip]
	mov	esi, DWORD PTR settings_addr[rip]
	xor	ecx, ecx
	mov	edi, DWORD PTR port[rip]
	call	server_socket@PLT
	mov	QWORD PTR sfd[rip], rax
	test	rax, rax
	jns	.L3
.L29:
	mov	edx, DWORD PTR port[rip]
	mov	edi, DWORD PTR stderr[rip]
	lea	rsi, .LC1[rip]
	xor	eax, eax
	call	fprintf@PLT
	mov	edi, 3
	call	exit@PLT
	mov	esi, DWORD PTR verbosity[rip]
	test	esi, esi
	je	.L4
.L30:
	mov	esi, DWORD PTR buf[rip]
	mov	edi, DWORD PTR settings_addr[rip]
	mov	rbx, QWORD PTR sfd[rip]
	mov	r12d, DWORD PTR port[rip]
	call	conv_addr@PLT
	mov	edi, DWORD PTR stderr[rip]
	lea	rsi, .LC2[rip]
	mov	rdx, rax
	mov	r8, rbx
	mov	ecx, r12d
	xor	eax, eax
	call	fprintf@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L34:
	mov	edi, DWORD PTR stderr[rip]
	lea	rsi, .LC5[rip]
	xor	eax, eax
	call	fprintf@PLT
	mov	eax, DWORD PTR verbosity[rip]
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L33:
	mov	esi, DWORD PTR sighup_handler[rip]
	mov	edi, DWORD PTR SIGHUP[rip]
	call	signal@PLT
	xor	eax, eax
	call	reopen_logs@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L32:
	cmp	DWORD PTR 8[rbx], 4
	jne	.L8
	mov	ecx, DWORD PTR 24[rbx]
	test	ecx, ecx
	je	.L8
	mov	rax, QWORD PTR 16[rbx]
	test	rax, rax
	jne	.L9
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	start_server, .-start_server
	.comm	verbosity,4,4
	.comm	username,8,8
	.comm	stderr,4,4
	.comm	sigusr1_handler,4,4
	.comm	sigterm_handler,4,4
	.comm	sigpoll_handler,4,4
	.comm	sigpoll_cnt,4,4
	.comm	sigint_handler,4,4
	.comm	sighup_handler,4,4
	.comm	sfd,8,8
	.comm	settings_addr,4,4
	.comm	quit_steps,8,8
	.comm	queue_port,4,4
	.comm	queue_conn,4,4
	.comm	port,4,4
	.comm	now,4,4
	.comm	memcache_methods,4,4
	.comm	maxconn,4,4
	.comm	hostname,8,8
	.comm	default_ct,8,8
	.comm	daemonize,8,8
	.comm	ct_watchcat_engine_server,4,4
	.comm	buf,4,4
	.comm	backlog,4,4
	.comm	active_connections,4,4
	.comm	SIG_IGN,4,4
	.comm	SIGUSR1,4,4
	.comm	SIGTERM,4,4
	.comm	SIGPOLL,4,4
	.comm	SIGPIPE,4,4
	.comm	SIGINT,4,4
	.comm	SIGHUP,4,4
	.comm	NB_used,4,4
	.comm	NB_max,4,4
	.comm	NB_alloc,4,4
	.comm	AF_INET,8,8
	.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_watchcat-engine.c_start_server.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"(none)\000"
	.align	2
.LC1:
	.ascii	"cannot open server socket at port %d: %m\012\000"
	.align	2
.LC2:
	.ascii	"created listening socket at %s:%d, fd=%d\012\000"
	.align	2
.LC3:
	.ascii	"fatal: cannot change user to %s\012\000"
	.align	2
.LC4:
	.ascii	"fatal: cannot resolve hostname %s: %m\012\000"
	.align	2
.LC5:
	.ascii	"Server started\012\000"
	.align	2
.LC6:
	.ascii	"epoll_work(): %d out of %d connections, network buf"
	.ascii	"ers: %d used, %d out of %d allocated\012\000"
	.align	2
.LC7:
	.ascii	"after epoll_work(), sigpoll_cnt=%d\012\000"
	.align	2
.LC8:
	.ascii	"Quitting.\012\000"
	.text
	.align	2
	.global	start_server
	.syntax unified
	.arm
	.fpu softvfp
	.type	start_server, %function
start_server:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #20
	bl	init_epoll
	bl	init_netbuffers
	ldr	r3, .L50
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L42
	cmp	r3, #0
	blt	.L39
.L49:
	ldr	r7, .L50+4
	ldr	fp, .L50+8
	ldr	r3, [r7]
	cmp	r3, #0
	bne	.L43
.L4:
	ldr	r5, .L50+12
	ldr	r3, [r5]
	cmp	r3, #0
	bne	.L44
.L5:
	ldr	r4, .L50+16
	ldr	r0, [r4]
	bl	change_user
	cmp	r0, #0
	bge	.L6
	ldr	r2, [r4]
	ldr	r3, .L50+20
	cmp	r2, #0
	moveq	r2, r3
	ldr	r1, .L50+24
	ldr	r0, [fp]
	bl	fprintf
	mov	r0, #1
	bl	exit
.L6:
	ldr	r3, .L50
	ldr	r6, .L50+28
	ldr	r2, .L50+32
	ldr	r1, .L50+36
	ldr	r0, [r3]
	bl	init_listening_connection
	ldr	r0, [r6]
	bl	gethostbyname
	subs	r4, r0, #0
	beq	.L8
	ldr	r3, .L50+40
	ldr	r2, [r4]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L45
.L8:
	ldr	r2, [r6]
	ldr	r1, .L50+44
	ldr	r0, [fp]
	bl	fprintf
	mov	r0, #1
	bl	exit
	ldr	r3, [r4, #8]
.L9:
	ldr	r1, .L50+48
	ldr	r2, [r3]
	ldr	r0, .L50+52
	ldr	r3, [r1]
	mov	r1, #0
	str	r2, [r0, #4]
	str	r3, [r0]
	bl	create_target
	ldr	r3, .L50+56
	str	r0, [r3]
	bl	create_all_outbound_connections
	ldr	r2, .L50+60
	ldr	r3, .L50+64
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	signal
	ldr	r2, .L50+68
	ldr	r3, .L50+72
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	signal
	ldr	r2, .L50+76
	ldr	r3, .L50+80
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	signal
	ldr	r2, .L50+84
	ldr	r3, .L50+88
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	signal
	ldr	r3, .L50+92
	ldr	r2, .L50+96
	ldr	r0, [r3]
	ldr	r1, [r2]
	bl	signal
	ldr	r3, [r5]
	cmp	r3, #0
	bne	.L46
.L10:
	ldr	r3, [r7]
	cmp	r3, #0
	bne	.L47
.L11:
	mov	r6, #0
	ldr	r8, .L50+100
	mov	r5, r6
	ldr	r10, .L50+104
	ldr	r9, .L50+108
	b	.L17
.L12:
	mov	r0, #57
	bl	epoll_work
	ldr	r2, [r8]
	cmp	r2, #0
	ble	.L13
	ldr	r3, [r7]
	cmp	r3, #1
	ble	.L14
	ldr	r1, .L50+112
	ldr	r0, [fp]
	bl	fprintf
.L14:
	mov	r3, #0
	str	r3, [r8]
.L13:
	ldr	r4, [r10]
	cmp	r4, r6
	beq	.L15
	bl	cron
.L15:
	bl	epoll_pre_event
	ldr	r3, [r9]
	cmp	r3, #0
	beq	.L18
	sub	r3, r3, #1
	cmp	r3, #0
	str	r3, [r9]
	beq	.L48
.L18:
	mov	r6, r4
	ldr	r3, [r7]
	add	r5, r5, #1
.L17:
	cmp	r3, #0
	ble	.L12
	tst	r5, #255
	bne	.L12
	ldr	r3, .L50+116
	ldr	r0, [fp]
	ldr	r1, [r3]
	ldr	r3, .L50+120
	ldr	r2, [r3]
	ldr	r3, .L50+124
	ldr	r3, [r3]
	str	r2, [sp, #4]
	str	r3, [sp]
	ldr	r2, .L50+128
	ldr	r3, .L50+132
	str	r1, [sp, #8]
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, .L50+136
	bl	fprintf
	b	.L12
.L48:
	ldr	r1, .L50+140
	ldr	r0, [fp]
	bl	fprintf
	ldr	r3, .L50
	mov	r4, r3
	ldr	r0, [r3]
	bl	epoll_close
	ldr	r0, [r4]
	bl	close
	mvn	r0, r0
	lsr	r0, r0, #31
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	assert
.L44:
	bl	setsid
	b	.L5
.L42:
	ldr	r2, .L50+144
	ldr	r1, .L50+148
	ldr	r0, .L50+152
	ldr	r2, [r2]
	ldr	r1, [r1]
	ldr	r0, [r0]
	bl	server_socket
	mov	r3, r0
	ldr	r2, .L50
	cmp	r3, #0
	str	r0, [r2]
	bge	.L49
.L39:
	ldr	r3, .L50+152
	ldr	fp, .L50+8
	ldr	r2, [r3]
	ldr	r1, .L50+156
	ldr	r0, [fp]
	ldr	r7, .L50+4
	bl	fprintf
	mov	r0, #3
	bl	exit
	ldr	r3, [r7]
	cmp	r3, #0
	beq	.L4
.L43:
	ldr	r2, .L50+160
	ldr	r3, .L50+148
	ldr	r1, [r2]
	ldr	r0, [r3]
	ldr	r4, [fp]
	bl	conv_addr
	ldr	r1, .L50
	ldr	r3, .L50+152
	ldr	r1, [r1]
	mov	r2, r0
	ldr	r3, [r3]
	mov	r0, r4
	str	r1, [sp]
	ldr	r1, .L50+164
	bl	fprintf
	b	.L4
.L47:
	ldr	r1, .L50+168
	ldr	r0, [fp]
	bl	fprintf
	ldr	r3, [r7]
	b	.L11
.L46:
	ldr	r2, .L50+172
	ldr	r3, .L50+176
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	signal
	bl	reopen_logs
	b	.L10
.L45:
	ldr	r3, [r4, #4]
	cmp	r3, #4
	bne	.L8
	ldr	r3, [r4, #12]
	cmp	r3, #0
	beq	.L8
	ldr	r3, [r4, #8]
	cmp	r3, #0
	bne	.L9
	b	.L8
.L51:
	.align	2
.L50:
	.word	sfd
	.word	verbosity
	.word	stderr
	.word	daemonize
	.word	username
	.word	.LC0
	.word	.LC3
	.word	hostname
	.word	memcache_methods
	.word	ct_watchcat_engine_server
	.word	AF_INET
	.word	.LC4
	.word	queue_port
	.word	default_ct
	.word	queue_conn
	.word	sigint_handler
	.word	SIGINT
	.word	sigterm_handler
	.word	SIGTERM
	.word	sigusr1_handler
	.word	SIGUSR1
	.word	SIG_IGN
	.word	SIGPIPE
	.word	SIGPOLL
	.word	sigpoll_handler
	.word	sigpoll_cnt
	.word	now
	.word	quit_steps
	.word	.LC7
	.word	NB_max
	.word	NB_alloc
	.word	NB_used
	.word	active_connections
	.word	maxconn
	.word	.LC6
	.word	.LC8
	.word	backlog
	.word	settings_addr
	.word	port
	.word	.LC1
	.word	buf
	.word	.LC2
	.word	.LC5
	.word	sighup_handler
	.word	SIGHUP
	.size	start_server, .-start_server
	.comm	verbosity,4,4
	.comm	username,4,4
	.comm	stderr,4,4
	.comm	sigusr1_handler,4,4
	.comm	sigterm_handler,4,4
	.comm	sigpoll_handler,4,4
	.comm	sigpoll_cnt,4,4
	.comm	sigint_handler,4,4
	.comm	sighup_handler,4,4
	.comm	sfd,4,4
	.comm	settings_addr,4,4
	.comm	quit_steps,4,4
	.comm	queue_port,4,4
	.comm	queue_conn,4,4
	.comm	port,4,4
	.comm	now,4,4
	.comm	memcache_methods,4,4
	.comm	maxconn,4,4
	.comm	hostname,4,4
	.comm	default_ct,8,4
	.comm	daemonize,4,4
	.comm	ct_watchcat_engine_server,4,4
	.comm	buf,4,4
	.comm	backlog,4,4
	.comm	active_connections,4,4
	.comm	SIG_IGN,4,4
	.comm	SIGUSR1,4,4
	.comm	SIGTERM,4,4
	.comm	SIGPOLL,4,4
	.comm	SIGPIPE,4,4
	.comm	SIGINT,4,4
	.comm	SIGHUP,4,4
	.comm	NB_used,4,4
	.comm	NB_max,4,4
	.comm	NB_alloc,4,4
	.comm	AF_INET,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
