	.file	"218085.c"
	.intel_syntax noprefix
	.text
	.data
	.align 4
	.type	socket_fd, @object
	.size	socket_fd, 4
socket_fd:
	.long	-1
	.globl	hints
	.bss
	.align 32
	.type	hints, @object
	.size	hints, 48
hints:
	.zero	48
	.globl	res
	.align 8
	.type	res, @object
	.size	res, 8
res:
	.zero	8
	.local	mutex_buffer
	.comm	mutex_buffer,40,32
	.globl	signal_recv
	.type	signal_recv, @object
	.size	signal_recv, 1
signal_recv:
	.zero	1
	.text
	.globl	clean_all
	.type	clean_all, @function
clean_all:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, DWORD PTR socket_fd[rip]
	test	eax, eax
	js	.L2
	mov	eax, DWORD PTR socket_fd[rip]
	mov	esi, 2
	mov	edi, eax
	call	shutdown@PLT
	mov	eax, DWORD PTR socket_fd[rip]
	mov	edi, eax
	call	close@PLT
.L2:
	lea	rdi, mutex_buffer[rip]
	call	pthread_mutex_destroy@PLT
	call	closelog@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	clean_all, .-clean_all
	.section	.rodata
.LC0:
	.string	"Signal Caught %d\n\r"
	.text
	.type	signal_handler, @function
signal_handler:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	DWORD PTR -4[rbp], edi
	mov	eax, DWORD PTR -4[rbp]
	mov	edx, eax
	lea	rsi, .LC0[rip]
	mov	edi, 6
	mov	eax, 0
	call	syslog@PLT
	mov	BYTE PTR signal_recv[rip], 1
	cmp	DWORD PTR -4[rbp], 2
	je	.L4
	cmp	DWORD PTR -4[rbp], 15
	jne	.L5
.L4:
	mov	eax, 0
	call	clean_all
.L5:
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE7:
	.size	signal_handler, .-signal_handler
	.section	.rodata
.LC1:
	.string	"malloc failed %d\n\r"
.LC2:
	.string	"reading from socket errno=%d\n"
.LC3:
	.string	"realloc error %d\n\r"
.LC4:
	.string	"/dev/aesdchar"
.LC5:
	.string	"failed to open a file:%d\n"
.LC6:
	.string	"Error in locking the mutex\n\r"
	.align 8
.LC7:
	.string	"Writing to file error no: %d\n\r"
	.align 8
.LC8:
	.string	"Error in unlocking the mutex\n\r"
	.align 8
.LC9:
	.string	"Error writing to client fd %d\n"
	.text
	.globl	thread_func
	.type	thread_func, @function
thread_func:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 80
	mov	QWORD PTR -72[rbp], rdi
	mov	rax, QWORD PTR -72[rbp]
	mov	QWORD PTR -8[rbp], rax
	mov	edi, 2048
	call	malloc@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L7
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	edx, eax
	lea	rsi, .LC1[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR 24[rax], 1
	jmp	.L8
.L7:
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, 2048
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
.L8:
	mov	DWORD PTR -64[rbp], 1
	mov	DWORD PTR -60[rbp], 0
	jmp	.L9
.L14:
	mov	eax, DWORD PTR -60[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	lea	rcx, [rdx+rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	edx, 2048
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -56[rbp], eax
	cmp	DWORD PTR -56[rbp], 0
	jns	.L10
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC2[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR 24[rax], 1
	mov	edi, 0
	call	pthread_exit@PLT
.L10:
	cmp	DWORD PTR -56[rbp], 0
	jne	.L11
	jmp	.L9
.L11:
	mov	eax, DWORD PTR -56[rbp]
	add	DWORD PTR -60[rbp], eax
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, 10
	mov	rdi, rax
	call	strchr@PLT
	test	rax, rax
	jne	.L29
	add	DWORD PTR -64[rbp], 1
	mov	eax, DWORD PTR -64[rbp]
	sal	eax, 11
	mov	edx, eax
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	realloc@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L9
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	edx, eax
	lea	rsi, .LC3[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR 24[rax], 1
	mov	edi, 0
	call	pthread_exit@PLT
.L9:
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR 24[rax]
	xor	eax, 1
	test	al, al
	jne	.L14
	jmp	.L13
.L29:
	nop
.L13:
	mov	edx, 420
	mov	esi, 1026
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], 0
	jns	.L15
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC5[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
.L15:
	mov	eax, DWORD PTR -52[rbp]
	mov	edx, 2
	mov	esi, 0
	mov	edi, eax
	call	lseek@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 16[rax]
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	DWORD PTR -48[rbp], eax
	cmp	DWORD PTR -48[rbp], 0
	je	.L16
	lea	rsi, .LC6[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR 24[rax], 1
	mov	edi, 0
	call	pthread_exit@PLT
.L16:
	mov	eax, DWORD PTR -60[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR -52[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	DWORD PTR -44[rbp], eax
	cmp	DWORD PTR -44[rbp], 0
	jns	.L17
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC7[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR 24[rax], 1
	mov	eax, DWORD PTR -52[rbp]
	mov	edi, eax
	call	close@PLT
	mov	edi, 0
	call	pthread_exit@PLT
.L17:
	mov	eax, DWORD PTR -52[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	lseek@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 16[rax]
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	mov	DWORD PTR -48[rbp], eax
	cmp	DWORD PTR -48[rbp], 0
	je	.L18
	lea	rsi, .LC8[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR 24[rax], 1
	mov	edi, 0
	call	pthread_exit@PLT
.L18:
	mov	eax, DWORD PTR -52[rbp]
	mov	edi, eax
	call	close@PLT
	mov	DWORD PTR -40[rbp], 0
	mov	edx, 420
	mov	esi, 1026
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], 0
	jns	.L19
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR 24[rax], 1
	mov	edi, 0
	call	pthread_exit@PLT
.L19:
	mov	eax, DWORD PTR -40[rbp]
	movsx	rcx, eax
	mov	eax, DWORD PTR -36[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	edi, eax
	call	lseek@PLT
	mov	edi, 2048
	call	malloc@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	DWORD PTR -60[rbp], 0
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, 2048
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -64[rbp], 1
.L28:
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 16[rax]
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	DWORD PTR -48[rbp], eax
	cmp	DWORD PTR -48[rbp], 0
	je	.L20
	lea	rsi, .LC6[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR 24[rax], 1
	mov	edi, 0
	call	pthread_exit@PLT
.L20:
	mov	eax, DWORD PTR -60[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -16[rbp]
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -36[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -32[rbp], eax
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 16[rax]
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	mov	DWORD PTR -48[rbp], eax
	cmp	DWORD PTR -48[rbp], 0
	je	.L21
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR 24[rax], 1
	mov	edi, 0
	call	pthread_exit@PLT
.L21:
	cmp	DWORD PTR -32[rbp], 0
	js	.L30
	cmp	DWORD PTR -32[rbp], 0
	je	.L31
	mov	eax, DWORD PTR -60[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 10
	jne	.L25
	mov	eax, DWORD PTR -60[rbp]
	add	eax, 1
	movsx	rdx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	rcx, QWORD PTR -16[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	jns	.L26
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC9[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	jmp	.L23
.L26:
	mov	eax, DWORD PTR -60[rbp]
	add	eax, 1
	movsx	rdx, eax
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -60[rbp], 0
	jmp	.L28
.L25:
	add	DWORD PTR -60[rbp], 1
	mov	eax, DWORD PTR -60[rbp]
	cmp	eax, 8
	jbe	.L28
	add	DWORD PTR -64[rbp], 1
	mov	eax, DWORD PTR -64[rbp]
	sal	eax, 11
	mov	edx, eax
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	realloc@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jne	.L28
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR 24[rax], 1
	mov	edi, 0
	call	pthread_exit@PLT
.L30:
	nop
	jmp	.L23
.L31:
	nop
.L23:
	mov	eax, DWORD PTR -36[rbp]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR 24[rax], 1
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE8:
	.size	thread_func, .-thread_func
	.section	.rodata
.LC10:
	.string	"aesdsocket"
	.align 8
.LC11:
	.string	"Error while registering SIGINT\n\r"
	.align 8
.LC12:
	.string	"Error while registering SIGTERM\n\r"
.LC13:
	.string	"-d"
	.align 8
.LC14:
	.string	"wrong arg: %s\nUse -d option for running as daemon"
	.align 8
.LC15:
	.string	"aesdsocketdata file could not be created, error number %d"
.LC16:
	.string	"9000"
.LC17:
	.string	"getaddrinfo() error %s\n"
	.align 8
.LC18:
	.string	"socket creation failed, error number %d\n"
	.align 8
.LC19:
	.string	"set socket options failed with error number%d\n"
.LC20:
	.string	"binding socket error num %d\n"
	.align 8
.LC21:
	.string	"listening for connection error num %d\n"
.LC22:
	.string	"Listening for connections\n\r"
.LC23:
	.string	"failed to create daemon\n"
	.align 8
.LC24:
	.string	"accepting new connection error is %s"
	.align 8
.LC25:
	.string	"Accepted connection from %s \n\r"
.LC26:
	.string	"Accepted connection from %s\n\r"
.LC27:
	.string	"Join spawned thread:%d\n\r"
.LC28:
	.string	"Thread is killed:%d\n\r"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 112
	mov	DWORD PTR -100[rbp], edi
	mov	QWORD PTR -112[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edx, 8
	mov	esi, 0
	lea	rdi, .LC10[rip]
	call	openlog@PLT
	lea	rsi, signal_handler[rip]
	mov	edi, 2
	call	signal@PLT
	mov	QWORD PTR -56[rbp], rax
	cmp	QWORD PTR -56[rbp], -1
	jne	.L33
	lea	rsi, .LC11[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	eax, 0
	call	clean_all
.L33:
	lea	rsi, signal_handler[rip]
	mov	edi, 15
	call	signal@PLT
	mov	QWORD PTR -56[rbp], rax
	cmp	QWORD PTR -56[rbp], -1
	jne	.L34
	lea	rsi, .LC12[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	eax, 0
	call	clean_all
.L34:
	mov	BYTE PTR -93[rbp], 0
	cmp	DWORD PTR -100[rbp], 2
	jne	.L35
	mov	rax, QWORD PTR -112[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC13[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L36
	mov	BYTE PTR -93[rbp], 1
	jmp	.L35
.L36:
	mov	rax, QWORD PTR -112[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -112[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdx, rax
	lea	rsi, .LC14[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L35:
	mov	esi, 502
	lea	rdi, .LC4[rip]
	call	creat@PLT
	mov	DWORD PTR -88[rbp], eax
	cmp	DWORD PTR -88[rbp], 0
	jns	.L37
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC15[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	eax, 0
	call	clean_all
	mov	edi, 1
	call	exit@PLT
.L37:
	mov	eax, DWORD PTR -88[rbp]
	mov	edi, eax
	call	close@PLT
	mov	QWORD PTR -64[rbp], 0
	mov	QWORD PTR -72[rbp], 0
	mov	edx, 48
	mov	esi, 0
	lea	rdi, hints[rip]
	call	memset@PLT
	mov	DWORD PTR hints[rip+4], 2
	mov	DWORD PTR hints[rip+8], 1
	mov	DWORD PTR hints[rip], 1
	lea	rcx, res[rip]
	lea	rdx, hints[rip]
	lea	rsi, .LC16[rip]
	mov	edi, 0
	call	getaddrinfo@PLT
	mov	DWORD PTR -84[rbp], eax
	cmp	DWORD PTR -84[rbp], 0
	je	.L38
	mov	eax, DWORD PTR -84[rbp]
	mov	edi, eax
	call	gai_strerror@PLT
	mov	rdx, rax
	lea	rsi, .LC17[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	eax, 0
	call	clean_all
	mov	edi, 1
	call	exit@PLT
.L38:
	mov	rax, QWORD PTR res[rip]
	mov	eax, DWORD PTR 4[rax]
	mov	edx, 0
	mov	esi, 1
	mov	edi, eax
	call	socket@PLT
	mov	DWORD PTR socket_fd[rip], eax
	mov	eax, DWORD PTR socket_fd[rip]
	test	eax, eax
	jns	.L39
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC18[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	eax, 0
	call	clean_all
	mov	edi, 1
	call	exit@PLT
.L39:
	mov	DWORD PTR -92[rbp], 1
	mov	eax, DWORD PTR socket_fd[rip]
	lea	rdx, -92[rbp]
	mov	r8d, 4
	mov	rcx, rdx
	mov	edx, 2
	mov	esi, 1
	mov	edi, eax
	call	setsockopt@PLT
	test	eax, eax
	jns	.L40
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC19[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	eax, 0
	call	clean_all
	mov	edi, 1
	call	exit@PLT
.L40:
	mov	rax, QWORD PTR res[rip]
	mov	edx, DWORD PTR 16[rax]
	mov	rax, QWORD PTR res[rip]
	mov	rcx, QWORD PTR 24[rax]
	mov	eax, DWORD PTR socket_fd[rip]
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	jns	.L41
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC20[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	eax, 0
	call	clean_all
	mov	edi, 1
	call	exit@PLT
.L41:
	mov	rax, QWORD PTR res[rip]
	mov	rdi, rax
	call	freeaddrinfo@PLT
	mov	eax, DWORD PTR socket_fd[rip]
	mov	esi, 10
	mov	edi, eax
	call	listen@PLT
	test	eax, eax
	je	.L42
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC21[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	eax, 0
	call	clean_all
	mov	edi, 1
	call	exit@PLT
.L42:
	lea	rdi, .LC22[rip]
	mov	eax, 0
	call	printf@PLT
	cmp	BYTE PTR -93[rbp], 0
	je	.L44
	mov	esi, 0
	mov	edi, 0
	call	daemon@PLT
	mov	DWORD PTR -80[rbp], eax
	cmp	DWORD PTR -80[rbp], -1
	jne	.L44
	lea	rsi, .LC23[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	eax, 0
	call	clean_all
	mov	edi, 1
	call	exit@PLT
.L51:
	mov	DWORD PTR -92[rbp], 16
	mov	eax, DWORD PTR socket_fd[rip]
	lea	rdx, -92[rbp]
	lea	rcx, -48[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -76[rbp], eax
	cmp	DWORD PTR -76[rbp], 0
	jns	.L45
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	lea	rsi, .LC24[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	eax, 0
	call	clean_all
	mov	edi, 1
	call	exit@PLT
.L45:
	movzx	eax, BYTE PTR signal_recv[rip]
	test	al, al
	jne	.L56
	lea	rax, -32[rbp]
	lea	rdx, -48[rbp]
	lea	rsi, 4[rdx]
	mov	ecx, 16
	mov	rdx, rax
	mov	edi, 2
	call	inet_ntop@PLT
	lea	rax, -32[rbp]
	mov	rdx, rax
	lea	rsi, .LC25[rip]
	mov	edi, 6
	mov	eax, 0
	call	syslog@PLT
	lea	rax, -32[rbp]
	mov	rsi, rax
	lea	rdi, .LC26[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 40
	call	malloc@PLT
	mov	QWORD PTR -64[rbp], rax
	mov	rdx, QWORD PTR -72[rbp]
	mov	rax, QWORD PTR -64[rbp]
	mov	QWORD PTR 32[rax], rdx
	mov	rax, QWORD PTR -64[rbp]
	mov	QWORD PTR -72[rbp], rax
	mov	rax, QWORD PTR -64[rbp]
	mov	edx, DWORD PTR -76[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -64[rbp]
	lea	rdx, mutex_buffer[rip]
	mov	QWORD PTR 16[rax], rdx
	mov	rax, QWORD PTR -64[rbp]
	mov	BYTE PTR 24[rax], 0
	mov	rax, QWORD PTR -64[rbp]
	mov	rdx, QWORD PTR -64[rbp]
	lea	rdi, 8[rdx]
	mov	rcx, rax
	lea	rdx, thread_func[rip]
	mov	esi, 0
	call	pthread_create@PLT
	mov	rax, QWORD PTR -72[rbp]
	mov	QWORD PTR -64[rbp], rax
	jmp	.L48
.L50:
	mov	rax, QWORD PTR -64[rbp]
	movzx	eax, BYTE PTR 24[rax]
	test	al, al
	je	.L49
	mov	rax, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rax, QWORD PTR -64[rbp]
	mov	eax, DWORD PTR [rax]
	mov	esi, 2
	mov	edi, eax
	call	shutdown@PLT
	mov	rax, QWORD PTR -64[rbp]
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	edx, eax
	lea	rsi, .LC27[rip]
	mov	edi, 6
	mov	eax, 0
	call	syslog@PLT
.L49:
	mov	rax, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR 32[rax]
	mov	QWORD PTR -64[rbp], rax
.L48:
	cmp	QWORD PTR -64[rbp], 0
	jne	.L50
.L44:
	movzx	eax, BYTE PTR signal_recv[rip]
	xor	eax, 1
	test	al, al
	jne	.L51
	jmp	.L52
.L56:
	nop
	jmp	.L52
.L53:
	mov	rax, QWORD PTR -72[rbp]
	mov	QWORD PTR -64[rbp], rax
	mov	rax, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rdi, rax
	call	pthread_cancel@PLT
	mov	rax, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	edx, eax
	lea	rsi, .LC28[rip]
	mov	edi, 6
	mov	eax, 0
	call	syslog@PLT
	mov	rax, QWORD PTR -72[rbp]
	mov	rax, QWORD PTR 32[rax]
	mov	QWORD PTR -72[rbp], rax
	mov	rax, QWORD PTR -64[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	QWORD PTR -64[rbp], 0
.L52:
	mov	rax, QWORD PTR -72[rbp]
	test	rax, rax
	jne	.L53
	mov	esi, 0
	lea	rdi, .LC4[rip]
	call	access@PLT
	test	eax, eax
	jne	.L54
	lea	rdi, .LC4[rip]
	call	remove@PLT
.L54:
	mov	eax, 0
	call	clean_all
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE9:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"218085.c"
	.text
	.data
	.align	2
	.type	socket_fd, %object
	.size	socket_fd, 4
socket_fd:
	.word	-1
	.comm	hints,32,4
	.comm	res,4,4
	.local	mutex_buffer
	.comm	mutex_buffer,24,4
	.global	signal_recv
	.bss
	.type	signal_recv, %object
	.size	signal_recv, 1
signal_recv:
	.space	1
	.text
	.align	2
	.global	clean_all
	.syntax unified
	.arm
	.fpu softvfp
	.type	clean_all, %function
clean_all:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L3
	ldr	r3, [r3]
	cmp	r3, #0
	blt	.L2
	ldr	r3, .L3
	ldr	r3, [r3]
	mov	r1, #2
	mov	r0, r3
	bl	shutdown
	ldr	r3, .L3
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
.L2:
	ldr	r0, .L3+4
	bl	pthread_mutex_destroy
	bl	closelog
	nop
	pop	{fp, pc}
.L4:
	.align	2
.L3:
	.word	socket_fd
	.word	mutex_buffer
	.size	clean_all, .-clean_all
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Signal Caught %d\012\015\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	signal_handler, %function
signal_handler:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r2, [fp, #-8]
	ldr	r1, .L8
	mov	r0, #6
	bl	syslog
	ldr	r3, .L8+4
	mov	r2, #1
	strb	r2, [r3]
	ldr	r3, [fp, #-8]
	cmp	r3, #2
	beq	.L6
	ldr	r3, [fp, #-8]
	cmp	r3, #15
	bne	.L7
.L6:
	bl	clean_all
.L7:
	mov	r0, #0
	bl	exit
.L9:
	.align	2
.L8:
	.word	.LC0
	.word	signal_recv
	.size	signal_handler, .-signal_handler
	.section	.rodata
	.align	2
.LC1:
	.ascii	"malloc failed %d\012\015\000"
	.align	2
.LC2:
	.ascii	"reading from socket errno=%d\012\000"
	.align	2
.LC3:
	.ascii	"realloc error %d\012\015\000"
	.align	2
.LC4:
	.ascii	"/dev/aesdchar\000"
	.align	2
.LC5:
	.ascii	"failed to open a file:%d\012\000"
	.align	2
.LC6:
	.ascii	"Error in locking the mutex\012\015\000"
	.align	2
.LC7:
	.ascii	"Writing to file error no: %d\012\015\000"
	.align	2
.LC8:
	.ascii	"Error in unlocking the mutex\012\015\000"
	.align	2
.LC9:
	.ascii	"Error writing to client fd %d\012\000"
	.text
	.align	2
	.global	thread_func
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread_func, %function
thread_func:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #64
	str	r0, [fp, #-64]
	ldr	r3, [fp, #-64]
	str	r3, [fp, #-40]
	mov	r0, #2048
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-56]
	cmp	r3, #0
	bne	.L11
	ldr	r3, [fp, #-40]
	ldr	r3, [r3, #4]
	mov	r2, r3
	ldr	r1, .L36
	mov	r0, #3
	bl	syslog
	ldr	r3, [fp, #-40]
	mov	r2, #1
	strb	r2, [r3, #12]
	b	.L12
.L11:
	mov	r2, #2048
	mov	r1, #0
	ldr	r0, [fp, #-56]
	bl	memset
.L12:
	mov	r3, #1
	str	r3, [fp, #-52]
	mov	r3, #0
	str	r3, [fp, #-48]
	b	.L13
.L18:
	ldr	r3, [fp, #-40]
	ldr	r0, [r3]
	ldr	r3, [fp, #-48]
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	mov	r2, #2048
	mov	r1, r3
	bl	read
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	bge	.L14
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L36+4
	mov	r0, #3
	bl	syslog
	ldr	r0, [fp, #-56]
	bl	free
	ldr	r3, [fp, #-40]
	mov	r2, #1
	strb	r2, [r3, #12]
	mov	r0, #0
	bl	pthread_exit
.L14:
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	bne	.L15
	b	.L13
.L15:
	ldr	r2, [fp, #-48]
	ldr	r3, [fp, #-36]
	add	r3, r2, r3
	str	r3, [fp, #-48]
	mov	r1, #10
	ldr	r0, [fp, #-56]
	bl	strchr
	mov	r3, r0
	cmp	r3, #0
	bne	.L33
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #11
	mov	r1, r3
	ldr	r0, [fp, #-56]
	bl	realloc
	str	r0, [fp, #-56]
	ldr	r3, [fp, #-56]
	cmp	r3, #0
	bne	.L13
	ldr	r3, [fp, #-40]
	ldr	r3, [r3, #4]
	mov	r2, r3
	ldr	r1, .L36+8
	mov	r0, #3
	bl	syslog
	ldr	r0, [fp, #-56]
	bl	free
	ldr	r3, [fp, #-40]
	mov	r2, #1
	strb	r2, [r3, #12]
	mov	r0, #0
	bl	pthread_exit
.L13:
	ldr	r3, [fp, #-40]
	ldrb	r3, [r3, #12]	@ zero_extendqisi2
	eor	r3, r3, #1
	and	r3, r3, #255
	cmp	r3, #0
	bne	.L18
	b	.L17
.L33:
	nop
.L17:
	mov	r2, #420
	ldr	r1, .L36+12
	ldr	r0, .L36+16
	bl	open
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bge	.L19
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L36+20
	mov	r0, #3
	bl	syslog
.L19:
	mov	r2, #2
	mov	r1, #0
	ldr	r0, [fp, #-32]
	bl	lseek
	ldr	r3, [fp, #-40]
	ldr	r3, [r3, #8]
	mov	r0, r3
	bl	pthread_mutex_lock
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L20
	ldr	r1, .L36+24
	mov	r0, #3
	bl	syslog
	ldr	r0, [fp, #-56]
	bl	free
	ldr	r3, [fp, #-40]
	mov	r2, #1
	strb	r2, [r3, #12]
	mov	r0, #0
	bl	pthread_exit
.L20:
	ldr	r3, [fp, #-48]
	mov	r2, r3
	ldr	r1, [fp, #-56]
	ldr	r0, [fp, #-32]
	bl	write
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bge	.L21
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L36+28
	mov	r0, #3
	bl	syslog
	ldr	r0, [fp, #-56]
	bl	free
	ldr	r3, [fp, #-40]
	mov	r2, #1
	strb	r2, [r3, #12]
	ldr	r0, [fp, #-32]
	bl	close
	mov	r0, #0
	bl	pthread_exit
.L21:
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-32]
	bl	lseek
	ldr	r3, [fp, #-40]
	ldr	r3, [r3, #8]
	mov	r0, r3
	bl	pthread_mutex_unlock
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L22
	ldr	r1, .L36+32
	mov	r0, #3
	bl	syslog
	ldr	r0, [fp, #-56]
	bl	free
	ldr	r3, [fp, #-40]
	mov	r2, #1
	strb	r2, [r3, #12]
	mov	r0, #0
	bl	pthread_exit
.L22:
	ldr	r0, [fp, #-32]
	bl	close
	mov	r3, #0
	str	r3, [fp, #-20]
	mov	r2, #420
	ldr	r1, .L36+12
	ldr	r0, .L36+16
	bl	open
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bge	.L23
	ldr	r0, [fp, #-56]
	bl	free
	ldr	r3, [fp, #-40]
	mov	r2, #1
	strb	r2, [r3, #12]
	mov	r0, #0
	bl	pthread_exit
.L23:
	mov	r2, #0
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	lseek
	mov	r0, #2048
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-44]
	mov	r3, #0
	str	r3, [fp, #-48]
	mov	r2, #2048
	mov	r1, #0
	ldr	r0, [fp, #-44]
	bl	memset
	mov	r3, #1
	str	r3, [fp, #-52]
.L32:
	ldr	r3, [fp, #-40]
	ldr	r3, [r3, #8]
	mov	r0, r3
	bl	pthread_mutex_lock
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L24
	ldr	r1, .L36+24
	mov	r0, #3
	bl	syslog
	ldr	r0, [fp, #-56]
	bl	free
	ldr	r0, [fp, #-44]
	bl	free
	ldr	r3, [fp, #-40]
	mov	r2, #1
	strb	r2, [r3, #12]
	mov	r0, #0
	bl	pthread_exit
.L24:
	ldr	r3, [fp, #-48]
	ldr	r2, [fp, #-44]
	add	r3, r2, r3
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	read
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-40]
	ldr	r3, [r3, #8]
	mov	r0, r3
	bl	pthread_mutex_unlock
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L25
	ldr	r0, [fp, #-56]
	bl	free
	ldr	r0, [fp, #-44]
	bl	free
	ldr	r3, [fp, #-40]
	mov	r2, #1
	strb	r2, [r3, #12]
	mov	r0, #0
	bl	pthread_exit
.L25:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	blt	.L34
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L35
	ldr	r3, [fp, #-48]
	ldr	r2, [fp, #-44]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L29
	ldr	r3, [fp, #-40]
	ldr	r0, [r3]
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	mov	r2, r3
	ldr	r1, [fp, #-44]
	bl	write
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L30
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L36+36
	mov	r0, #3
	bl	syslog
	b	.L27
.L30:
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	mov	r2, r3
	mov	r1, #0
	ldr	r0, [fp, #-44]
	bl	memset
	mov	r3, #0
	str	r3, [fp, #-48]
	b	.L32
.L29:
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	str	r3, [fp, #-48]
	ldr	r3, [fp, #-48]
	cmp	r3, #4
	bls	.L32
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #11
	mov	r1, r3
	ldr	r0, [fp, #-44]
	bl	realloc
	str	r0, [fp, #-44]
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	bne	.L32
	ldr	r0, [fp, #-44]
	bl	free
	ldr	r0, [fp, #-56]
	bl	free
	ldr	r3, [fp, #-40]
	mov	r2, #1
	strb	r2, [r3, #12]
	mov	r0, #0
	bl	pthread_exit
.L34:
	nop
	b	.L27
.L35:
	nop
.L27:
	ldr	r0, [fp, #-16]
	bl	close
	ldr	r0, [fp, #-44]
	bl	free
	ldr	r0, [fp, #-56]
	bl	free
	ldr	r3, [fp, #-40]
	mov	r2, #1
	strb	r2, [r3, #12]
	mov	r0, #0
	bl	pthread_exit
.L37:
	.align	2
.L36:
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	1026
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.size	thread_func, .-thread_func
	.section	.rodata
	.align	2
.LC10:
	.ascii	"aesdsocket\000"
	.align	2
.LC11:
	.ascii	"Error while registering SIGINT\012\015\000"
	.align	2
.LC12:
	.ascii	"Error while registering SIGTERM\012\015\000"
	.align	2
.LC13:
	.ascii	"-d\000"
	.align	2
.LC14:
	.ascii	"wrong arg: %s\012Use -d option for running as daemo"
	.ascii	"n\000"
	.align	2
.LC15:
	.ascii	"aesdsocketdata file could not be created, error num"
	.ascii	"ber %d\000"
	.align	2
.LC16:
	.ascii	"9000\000"
	.align	2
.LC17:
	.ascii	"getaddrinfo() error %s\012\000"
	.align	2
.LC18:
	.ascii	"socket creation failed, error number %d\012\000"
	.align	2
.LC19:
	.ascii	"set socket options failed with error number%d\012\000"
	.align	2
.LC20:
	.ascii	"binding socket error num %d\012\000"
	.align	2
.LC21:
	.ascii	"listening for connection error num %d\012\000"
	.align	2
.LC22:
	.ascii	"Listening for connections\012\015\000"
	.align	2
.LC23:
	.ascii	"failed to create daemon\012\000"
	.align	2
.LC24:
	.ascii	"accepting new connection error is %s\000"
	.align	2
.LC25:
	.ascii	"Accepted connection from %s \012\015\000"
	.align	2
.LC26:
	.ascii	"Accepted connection from %s\012\015\000"
	.align	2
.LC27:
	.ascii	"Join spawned thread:%d\012\015\000"
	.align	2
.LC28:
	.ascii	"Thread is killed:%d\012\015\000"
	.align	2
.LC29:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 80
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #88
	str	r0, [fp, #-80]
	str	r1, [fp, #-84]
	ldr	r3, .L63
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r2, #8
	mov	r1, #0
	ldr	r0, .L63+4
	bl	openlog
	ldr	r1, .L63+8
	mov	r0, #2
	bl	signal
	str	r0, [fp, #-60]
	ldr	r3, [fp, #-60]
	cmn	r3, #1
	bne	.L39
	ldr	r1, .L63+12
	mov	r0, #3
	bl	syslog
	bl	clean_all
.L39:
	ldr	r1, .L63+8
	mov	r0, #15
	bl	signal
	str	r0, [fp, #-60]
	ldr	r3, [fp, #-60]
	cmn	r3, #1
	bne	.L40
	ldr	r1, .L63+16
	mov	r0, #3
	bl	syslog
	bl	clean_all
.L40:
	mov	r3, #0
	strb	r3, [fp, #-73]
	ldr	r3, [fp, #-80]
	cmp	r3, #2
	bne	.L41
	ldr	r3, [fp, #-84]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L63+20
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L42
	mov	r3, #1
	strb	r3, [fp, #-73]
	b	.L41
.L42:
	ldr	r3, [fp, #-84]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L63+24
	bl	printf
	ldr	r3, [fp, #-84]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L63+24
	mov	r0, #3
	bl	syslog
	mov	r0, #1
	bl	exit
.L41:
	ldr	r1, .L63+28
	ldr	r0, .L63+32
	bl	creat
	str	r0, [fp, #-56]
	ldr	r3, [fp, #-56]
	cmp	r3, #0
	bge	.L43
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L63+36
	mov	r0, #3
	bl	syslog
	bl	clean_all
	mov	r0, #1
	bl	exit
.L43:
	ldr	r0, [fp, #-56]
	bl	close
	mov	r3, #0
	str	r3, [fp, #-64]
	mov	r3, #0
	str	r3, [fp, #-72]
	mov	r2, #32
	mov	r1, #0
	ldr	r0, .L63+40
	bl	memset
	ldr	r3, .L63+40
	mov	r2, #2
	str	r2, [r3, #4]
	ldr	r3, .L63+40
	mov	r2, #1
	str	r2, [r3, #8]
	ldr	r3, .L63+40
	mov	r2, #1
	str	r2, [r3]
	ldr	r3, .L63+44
	ldr	r2, .L63+40
	ldr	r1, .L63+48
	mov	r0, #0
	bl	getaddrinfo
	str	r0, [fp, #-52]
	ldr	r3, [fp, #-52]
	cmp	r3, #0
	beq	.L44
	ldr	r0, [fp, #-52]
	bl	gai_strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L63+52
	mov	r0, #3
	bl	syslog
	bl	clean_all
	mov	r0, #1
	bl	exit
.L44:
	ldr	r3, .L63+44
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	mov	r2, #0
	mov	r1, #1
	mov	r0, r3
	bl	socket
	mov	r3, r0
	ldr	r2, .L63+56
	str	r3, [r2]
	ldr	r3, .L63+56
	ldr	r3, [r3]
	cmp	r3, #0
	bge	.L45
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L63+60
	mov	r0, #3
	bl	syslog
	bl	clean_all
	mov	r0, #1
	bl	exit
.L45:
	ldr	r3, .L63+56
	ldr	r0, [r3]
	mov	r3, #1
	str	r3, [fp, #-68]
	sub	r3, fp, #68
	mov	r2, #4
	str	r2, [sp]
	mov	r2, #2
	mov	r1, #1
	bl	setsockopt
	mov	r3, r0
	cmp	r3, #0
	bge	.L46
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L63+64
	mov	r0, #3
	bl	syslog
	bl	clean_all
	mov	r0, #1
	bl	exit
.L46:
	ldr	r3, .L63+56
	ldr	r0, [r3]
	ldr	r3, .L63+44
	ldr	r3, [r3]
	ldr	r1, [r3, #20]
	ldr	r3, .L63+44
	ldr	r3, [r3]
	ldr	r3, [r3, #16]
	mov	r2, r3
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	bge	.L47
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L63+68
	mov	r0, #3
	bl	syslog
	bl	clean_all
	mov	r0, #1
	bl	exit
.L47:
	ldr	r3, .L63+44
	ldr	r3, [r3]
	mov	r0, r3
	bl	freeaddrinfo
	ldr	r3, .L63+56
	ldr	r3, [r3]
	mov	r1, #10
	mov	r0, r3
	bl	listen
	mov	r3, r0
	cmp	r3, #0
	beq	.L48
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L63+72
	mov	r0, #3
	bl	syslog
	bl	clean_all
	mov	r0, #1
	bl	exit
.L48:
	ldr	r0, .L63+76
	bl	printf
	ldrb	r3, [fp, #-73]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L50
	mov	r1, #0
	mov	r0, #0
	bl	daemon
	str	r0, [fp, #-48]
	ldr	r3, [fp, #-48]
	cmn	r3, #1
	bne	.L50
	ldr	r1, .L63+80
	mov	r0, #3
	bl	syslog
	bl	clean_all
	mov	r0, #1
	bl	exit
.L57:
	mov	r3, #16
	str	r3, [fp, #-68]
	ldr	r3, .L63+56
	ldr	r3, [r3]
	sub	r2, fp, #68
	sub	r1, fp, #40
	mov	r0, r3
	bl	accept
	str	r0, [fp, #-44]
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	bge	.L51
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L63+84
	mov	r0, #3
	bl	syslog
	bl	clean_all
	mov	r0, #1
	bl	exit
.L51:
	ldr	r3, .L63+88
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L62
	sub	r2, fp, #24
	sub	r3, fp, #40
	add	r1, r3, #4
	mov	r3, #16
	mov	r0, #2
	bl	inet_ntop
	sub	r3, fp, #24
	mov	r2, r3
	ldr	r1, .L63+92
	mov	r0, #6
	bl	syslog
	sub	r3, fp, #24
	mov	r1, r3
	ldr	r0, .L63+96
	bl	printf
	mov	r0, #20
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-64]
	ldr	r2, [fp, #-72]
	ldr	r3, [fp, #-64]
	str	r2, [r3, #16]
	ldr	r3, [fp, #-64]
	str	r3, [fp, #-72]
	ldr	r3, [fp, #-64]
	ldr	r2, [fp, #-44]
	str	r2, [r3]
	ldr	r3, [fp, #-64]
	ldr	r2, .L63+100
	str	r2, [r3, #8]
	ldr	r3, [fp, #-64]
	mov	r2, #0
	strb	r2, [r3, #12]
	ldr	r3, [fp, #-64]
	add	r0, r3, #4
	ldr	r3, [fp, #-64]
	ldr	r2, .L63+104
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-72]
	str	r3, [fp, #-64]
	b	.L54
.L56:
	ldr	r3, [fp, #-64]
	ldrb	r3, [r3, #12]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L55
	ldr	r3, [fp, #-64]
	ldr	r3, [r3, #4]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-64]
	ldr	r3, [r3]
	mov	r1, #2
	mov	r0, r3
	bl	shutdown
	ldr	r3, [fp, #-64]
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-64]
	ldr	r3, [r3, #4]
	mov	r2, r3
	ldr	r1, .L63+108
	mov	r0, #6
	bl	syslog
.L55:
	ldr	r3, [fp, #-64]
	ldr	r3, [r3, #16]
	str	r3, [fp, #-64]
.L54:
	ldr	r3, [fp, #-64]
	cmp	r3, #0
	bne	.L56
.L50:
	ldr	r3, .L63+88
	ldrb	r3, [r3]	@ zero_extendqisi2
	eor	r3, r3, #1
	and	r3, r3, #255
	cmp	r3, #0
	bne	.L57
	b	.L58
.L62:
	nop
	b	.L58
.L59:
	ldr	r3, [fp, #-72]
	str	r3, [fp, #-64]
	ldr	r3, [fp, #-64]
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	pthread_cancel
	ldr	r3, [fp, #-64]
	ldr	r3, [r3, #4]
	mov	r2, r3
	ldr	r1, .L63+112
	mov	r0, #6
	bl	syslog
	ldr	r3, [fp, #-72]
	ldr	r3, [r3, #16]
	str	r3, [fp, #-72]
	ldr	r0, [fp, #-64]
	bl	free
	mov	r3, #0
	str	r3, [fp, #-64]
.L58:
	ldr	r3, [fp, #-72]
	cmp	r3, #0
	bne	.L59
	mov	r1, #0
	ldr	r0, .L63+32
	bl	access
	mov	r3, r0
	cmp	r3, #0
	bne	.L60
	ldr	r0, .L63+32
	bl	remove
.L60:
	bl	clean_all
	mov	r0, #0
	bl	exit
.L64:
	.align	2
.L63:
	.word	.LC29
	.word	.LC10
	.word	signal_handler
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	502
	.word	.LC4
	.word	.LC15
	.word	hints
	.word	res
	.word	.LC16
	.word	.LC17
	.word	socket_fd
	.word	.LC18
	.word	.LC19
	.word	.LC20
	.word	.LC21
	.word	.LC22
	.word	.LC23
	.word	.LC24
	.word	signal_recv
	.word	.LC25
	.word	.LC26
	.word	mutex_buffer
	.word	thread_func
	.word	.LC27
	.word	.LC28
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
