	.file	"189132.c"
	.intel_syntax noprefix
	.text
	.globl	mutex_lock
	.bss
	.align 32
	.type	mutex_lock, @object
	.size	mutex_lock, 40
mutex_lock:
	.zero	40
	.globl	head
	.align 8
	.type	head, @object
	.size	head, 8
head:
	.zero	8
	.globl	fd
	.align 4
	.type	fd, @object
	.size	fd, 4
fd:
	.zero	4
	.globl	sockfd
	.align 4
	.type	sockfd, @object
	.size	sockfd, 4
sockfd:
	.zero	4
	.globl	clientfd
	.align 4
	.type	clientfd, @object
	.size	clientfd, 4
clientfd:
	.zero	4
	.globl	status
	.align 4
	.type	status, @object
	.size	status, 4
status:
	.zero	4
	.globl	packets
	.align 4
	.type	packets, @object
	.size	packets, 4
packets:
	.zero	4
	.globl	byte
	.type	byte, @object
	.size	byte, 1
byte:
	.zero	1
	.globl	isdaemon
	.type	isdaemon, @object
	.size	isdaemon, 1
isdaemon:
	.zero	1
	.globl	datap
	.align 8
	.type	datap, @object
	.size	datap, 8
datap:
	.zero	8
	.section	.rodata
.LC0:
	.string	"aesdsocket"
	.align 8
.LC1:
	.string	"Failed to configure SIGINT handler\n"
	.align 8
.LC2:
	.string	"Failed to configure SIGTERM handler\n"
.LC3:
	.string	"-d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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	QWORD PTR -16[rbp], rsi
	mov	edx, 8
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	openlog@PLT
	lea	rsi, signal_handler[rip]
	mov	edi, 2
	call	signal@PLT
	cmp	rax, -1
	jne	.L2
	lea	rsi, .LC1[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	lea	rsi, signal_handler[rip]
	mov	edi, 15
	call	signal@PLT
	cmp	rax, -1
	jne	.L3
	lea	rsi, .LC2[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	esi, 0
	lea	rdi, mutex_lock[rip]
	call	pthread_mutex_init@PLT
	cmp	DWORD PTR -4[rbp], 1
	jle	.L4
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	call	strcmp@PLT
	test	eax, eax
	jne	.L4
	mov	BYTE PTR isdaemon[rip], 1
.L4:
	call	handle_socket
	call	closelog@PLT
	mov	eax, -1
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC4:
	.string	"9000"
.LC5:
	.string	"getaddrinfo function failed\n"
.LC6:
	.string	"socket function failed\n"
.LC7:
	.string	"setsockopt function failed\n"
.LC8:
	.string	"bind function failed\n"
.LC9:
	.string	"daemon function failed\n"
.LC10:
	.string	"Entering daemon mode\n"
.LC11:
	.string	"/dev/aesdchar"
.LC12:
	.string	"create function failed\n"
.LC13:
	.string	"setitimer function failed\n"
.LC14:
	.string	"listen function failed\n"
.LC15:
	.string	"accept function failed\n"
.LC16:
	.string	"Accepting connection from %s"
	.align 8
.LC17:
	.string	"pthread_create function failed\n"
.LC18:
	.string	"Thread created\n"
.LC19:
	.string	"Thread exited\n"
.LC20:
	.string	"Closed connection from %s"
	.text
	.globl	handle_socket
	.type	handle_socket, @function
handle_socket:
.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, 160
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	QWORD PTR head[rip], 0
	lea	rax, -96[rbp]
	mov	edx, 48
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -96[rbp], 1
	mov	DWORD PTR -92[rbp], 10
	mov	DWORD PTR -88[rbp], 1
	lea	rdx, -152[rbp]
	lea	rax, -96[rbp]
	mov	rcx, rdx
	mov	rdx, rax
	lea	rsi, .LC4[rip]
	mov	edi, 0
	call	getaddrinfo@PLT
	mov	DWORD PTR status[rip], eax
	mov	eax, DWORD PTR status[rip]
	test	eax, eax
	je	.L7
	lea	rsi, .LC5[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L7:
	mov	edx, 0
	mov	esi, 1
	mov	edi, 10
	call	socket@PLT
	mov	DWORD PTR sockfd[rip], eax
	mov	eax, DWORD PTR sockfd[rip]
	cmp	eax, -1
	jne	.L8
	lea	rsi, .LC6[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	rax, QWORD PTR -152[rbp]
	mov	rdi, rax
	call	freeaddrinfo@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	mov	DWORD PTR -156[rbp], 1
	mov	eax, DWORD PTR sockfd[rip]
	lea	rdx, -156[rbp]
	mov	r8d, 4
	mov	rcx, rdx
	mov	edx, 2
	mov	esi, 1
	mov	edi, eax
	call	setsockopt@PLT
	mov	DWORD PTR status[rip], eax
	mov	eax, DWORD PTR status[rip]
	cmp	eax, -1
	jne	.L9
	lea	rsi, .LC7[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	rax, QWORD PTR -152[rbp]
	mov	rdi, rax
	call	freeaddrinfo@PLT
	mov	edi, 1
	call	exit@PLT
.L9:
	mov	rax, QWORD PTR -152[rbp]
	mov	edx, DWORD PTR 16[rax]
	mov	rax, QWORD PTR -152[rbp]
	mov	rcx, QWORD PTR 24[rax]
	mov	eax, DWORD PTR sockfd[rip]
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	mov	DWORD PTR status[rip], eax
	mov	eax, DWORD PTR status[rip]
	cmp	eax, -1
	jne	.L10
	lea	rsi, .LC8[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	rax, QWORD PTR -152[rbp]
	mov	rdi, rax
	call	freeaddrinfo@PLT
	mov	edi, 1
	call	exit@PLT
.L10:
	movzx	eax, BYTE PTR isdaemon[rip]
	test	al, al
	je	.L11
	mov	esi, 0
	mov	edi, 0
	call	daemon@PLT
	mov	DWORD PTR status[rip], eax
	mov	eax, DWORD PTR status[rip]
	cmp	eax, -1
	jne	.L12
	lea	rsi, .LC9[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L12:
	lea	rsi, .LC10[rip]
	mov	edi, 6
	mov	eax, 0
	call	syslog@PLT
.L11:
	mov	esi, 420
	lea	rdi, .LC11[rip]
	call	creat@PLT
	mov	DWORD PTR fd[rip], eax
	mov	eax, DWORD PTR fd[rip]
	cmp	eax, -1
	jne	.L13
	lea	rsi, .LC12[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L13:
	mov	eax, DWORD PTR fd[rip]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -152[rbp]
	mov	rdi, rax
	call	freeaddrinfo@PLT
	mov	QWORD PTR -128[rbp], 10
	mov	QWORD PTR -120[rbp], 0
	mov	QWORD PTR -112[rbp], 10
	mov	QWORD PTR -104[rbp], 0
	lea	rax, -128[rbp]
	mov	edx, 0
	mov	rsi, rax
	mov	edi, 0
	call	setitimer@PLT
	mov	DWORD PTR status[rip], eax
	mov	eax, DWORD PTR status[rip]
	cmp	eax, -1
	jne	.L26
	lea	rsi, .LC13[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
.L26:
	mov	eax, DWORD PTR sockfd[rip]
	mov	esi, 5
	mov	edi, eax
	call	listen@PLT
	mov	DWORD PTR status[rip], eax
	mov	eax, DWORD PTR status[rip]
	cmp	eax, -1
	jne	.L15
	lea	rsi, .LC14[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	rax, QWORD PTR -152[rbp]
	mov	rdi, rax
	call	freeaddrinfo@PLT
	mov	edi, 1
	call	exit@PLT
.L15:
	mov	DWORD PTR -160[rbp], 16
	mov	eax, DWORD PTR sockfd[rip]
	lea	rdx, -160[rbp]
	lea	rcx, -48[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR clientfd[rip], eax
	mov	eax, DWORD PTR clientfd[rip]
	cmp	eax, -1
	jne	.L16
	lea	rsi, .LC15[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	rax, QWORD PTR -152[rbp]
	mov	rdi, rax
	call	freeaddrinfo@PLT
	mov	edi, 1
	call	exit@PLT
.L16:
	lea	rax, -48[rbp]
	mov	QWORD PTR -136[rbp], rax
	mov	rax, QWORD PTR -136[rbp]
	lea	rsi, 4[rax]
	lea	rax, -32[rbp]
	mov	ecx, 16
	mov	rdx, rax
	mov	edi, 2
	call	inet_ntop@PLT
	lea	rax, -32[rbp]
	mov	rdx, rax
	lea	rsi, .LC16[rip]
	mov	edi, 6
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 40
	call	malloc@PLT
	mov	QWORD PTR datap[rip], rax
	mov	rax, QWORD PTR datap[rip]
	mov	rdx, QWORD PTR head[rip]
	mov	QWORD PTR 32[rax], rdx
	mov	rax, QWORD PTR datap[rip]
	mov	QWORD PTR head[rip], rax
	mov	rax, QWORD PTR datap[rip]
	mov	edx, DWORD PTR clientfd[rip]
	mov	DWORD PTR 16[rax], edx
	mov	rax, QWORD PTR datap[rip]
	mov	BYTE PTR [rax], 0
	mov	rax, QWORD PTR datap[rip]
	lea	rdx, mutex_lock[rip]
	mov	QWORD PTR 24[rax], rdx
	mov	rax, QWORD PTR datap[rip]
	mov	rdx, rax
	mov	rax, QWORD PTR datap[rip]
	add	rax, 8
	mov	rcx, rdx
	lea	rdx, thread_handler[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	DWORD PTR status[rip], eax
	mov	eax, DWORD PTR status[rip]
	test	eax, eax
	je	.L17
	lea	rsi, .LC17[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L17:
	lea	rsi, .LC18[rip]
	mov	edi, 6
	mov	eax, 0
	call	syslog@PLT
	mov	rax, QWORD PTR head[rip]
	mov	QWORD PTR datap[rip], rax
	jmp	.L18
.L25:
	mov	rax, QWORD PTR datap[rip]
	mov	rax, QWORD PTR 8[rax]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rax, QWORD PTR datap[rip]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	je	.L19
	mov	rdx, QWORD PTR head[rip]
	mov	rax, QWORD PTR datap[rip]
	cmp	rdx, rax
	jne	.L20
	mov	rax, QWORD PTR head[rip]
	mov	rax, QWORD PTR 32[rax]
	mov	QWORD PTR head[rip], rax
	jmp	.L21
.L20:
	mov	rax, QWORD PTR head[rip]
	mov	QWORD PTR -144[rbp], rax
	jmp	.L22
.L23:
	mov	rax, QWORD PTR -144[rbp]
	mov	rax, QWORD PTR 32[rax]
	mov	QWORD PTR -144[rbp], rax
.L22:
	mov	rax, QWORD PTR -144[rbp]
	mov	rdx, QWORD PTR 32[rax]
	mov	rax, QWORD PTR datap[rip]
	cmp	rdx, rax
	jne	.L23
	mov	rax, QWORD PTR -144[rbp]
	mov	rax, QWORD PTR 32[rax]
	mov	rdx, QWORD PTR 32[rax]
	mov	rax, QWORD PTR -144[rbp]
	mov	QWORD PTR 32[rax], rdx
.L21:
	mov	rax, QWORD PTR datap[rip]
	mov	rdi, rax
	call	free@PLT
	jmp	.L24
.L19:
	mov	rax, QWORD PTR datap[rip]
	mov	rax, QWORD PTR 32[rax]
	mov	QWORD PTR datap[rip], rax
.L18:
	mov	rax, QWORD PTR datap[rip]
	test	rax, rax
	jne	.L25
.L24:
	lea	rsi, .LC19[rip]
	mov	edi, 6
	mov	eax, 0
	call	syslog@PLT
	lea	rax, -32[rbp]
	mov	rdx, rax
	lea	rsi, .LC20[rip]
	mov	edi, 7
	mov	eax, 0
	call	syslog@PLT
	jmp	.L26
	.cfi_endproc
.LFE7:
	.size	handle_socket, .-handle_socket
	.section	.rodata
.LC21:
	.string	"malloc() failed"
.LC22:
	.string	"recv() failed"
.LC23:
	.string	"realloc() failed"
	.align 8
.LC24:
	.string	"pthread_mutex_lock() failed with error code: %d\n"
	.align 8
.LC25:
	.string	"open() failed (append and write only)\n"
.LC26:
	.string	"write() failed\n"
.LC27:
	.string	"File partially written\n"
.LC28:
	.string	"open() failed (read only)\n"
.LC29:
	.string	"read() failed!\n"
.LC30:
	.string	"send() failed!\n"
	.align 8
.LC31:
	.string	"pthread_mutex_unlock() failed with error code: %d\n"
	.text
	.globl	thread_handler
	.type	thread_handler, @function
thread_handler:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 1096
	.cfi_offset 3, -24
	mov	QWORD PTR -1096[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	BYTE PTR -1081[rbp], 0
	mov	QWORD PTR -1056[rbp], 0
	mov	QWORD PTR -1048[rbp], 0
	lea	rdx, -1040[rbp]
	mov	eax, 0
	mov	ecx, 126
	mov	rdi, rdx
	rep stosq
	mov	QWORD PTR -1072[rbp], 0
	mov	rax, QWORD PTR -1096[rbp]
	mov	QWORD PTR -1064[rbp], rax
	mov	edi, 1024
	call	malloc@PLT
	mov	QWORD PTR -1072[rbp], rax
	cmp	QWORD PTR -1072[rbp], 0
	jne	.L29
	lea	rsi, .LC21[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L29:
	mov	rax, QWORD PTR -1072[rbp]
	mov	edx, 1024
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	jmp	.L30
.L37:
	mov	rax, QWORD PTR -1064[rbp]
	mov	eax, DWORD PTR 16[rax]
	lea	rsi, -1056[rbp]
	mov	ecx, 0
	mov	edx, 1024
	mov	edi, eax
	call	recv@PLT
	mov	DWORD PTR status[rip], eax
	mov	eax, DWORD PTR status[rip]
	cmp	eax, -1
	jne	.L31
	lea	rsi, .LC22[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L31:
	mov	DWORD PTR -1080[rbp], 0
	jmp	.L32
.L35:
	mov	eax, DWORD PTR -1080[rbp]
	cdqe
	movzx	eax, BYTE PTR -1056[rbp+rax]
	cmp	al, 10
	jne	.L33
	mov	BYTE PTR -1081[rbp], 1
	add	DWORD PTR -1080[rbp], 1
	jmp	.L34
.L33:
	add	DWORD PTR -1080[rbp], 1
.L32:
	cmp	DWORD PTR -1080[rbp], 1023
	jle	.L35
.L34:
	mov	edx, DWORD PTR packets[rip]
	mov	eax, DWORD PTR -1080[rbp]
	add	eax, edx
	mov	DWORD PTR packets[rip], eax
	mov	eax, DWORD PTR packets[rip]
	add	eax, 1
	movsx	rdx, eax
	mov	rax, QWORD PTR -1072[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	realloc@PLT
	mov	QWORD PTR -1072[rbp], rax
	cmp	QWORD PTR -1072[rbp], 0
	jne	.L36
	lea	rsi, .LC23[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L36:
	mov	eax, DWORD PTR -1080[rbp]
	movsx	rdx, eax
	lea	rcx, -1056[rbp]
	mov	rax, QWORD PTR -1072[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	strncat@PLT
	lea	rax, -1056[rbp]
	mov	edx, 1024
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
.L30:
	movzx	eax, BYTE PTR -1081[rbp]
	xor	eax, 1
	test	al, al
	jne	.L37
	mov	rax, QWORD PTR -1064[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	DWORD PTR status[rip], eax
	mov	eax, DWORD PTR status[rip]
	test	eax, eax
	je	.L38
	mov	eax, DWORD PTR status[rip]
	mov	edx, eax
	lea	rsi, .LC24[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L38:
	mov	esi, 1025
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR fd[rip], eax
	mov	eax, DWORD PTR fd[rip]
	cmp	eax, -1
	jne	.L39
	lea	rsi, .LC25[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L39:
	mov	rax, QWORD PTR -1072[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	eax, DWORD PTR fd[rip]
	mov	rcx, QWORD PTR -1072[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	DWORD PTR -1076[rbp], eax
	cmp	DWORD PTR -1076[rbp], -1
	jne	.L40
	lea	rsi, .LC26[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L40:
	mov	eax, DWORD PTR -1076[rbp]
	movsx	rbx, eax
	mov	rax, QWORD PTR -1072[rbp]
	mov	rdi, rax
	call	strlen@PLT
	cmp	rbx, rax
	je	.L41
	lea	rsi, .LC27[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L41:
	mov	eax, DWORD PTR fd[rip]
	mov	edi, eax
	call	close@PLT
	lea	rax, -1056[rbp]
	mov	edx, 1024
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	esi, 0
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR fd[rip], eax
	mov	eax, DWORD PTR fd[rip]
	cmp	eax, -1
	jne	.L42
	lea	rsi, .LC28[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L42:
	mov	DWORD PTR -1080[rbp], 0
	jmp	.L43
.L46:
	mov	eax, DWORD PTR fd[rip]
	mov	edx, 1
	lea	rsi, byte[rip]
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -1076[rbp], eax
	cmp	DWORD PTR -1076[rbp], -1
	jne	.L44
	lea	rsi, .LC29[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L44:
	mov	rax, QWORD PTR -1064[rbp]
	mov	eax, DWORD PTR 16[rax]
	mov	ecx, 0
	mov	edx, 1
	lea	rsi, byte[rip]
	mov	edi, eax
	call	send@PLT
	mov	DWORD PTR -1076[rbp], eax
	cmp	DWORD PTR -1076[rbp], -1
	jne	.L45
	lea	rsi, .LC30[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L45:
	add	DWORD PTR -1080[rbp], 1
.L43:
	mov	eax, DWORD PTR packets[rip]
	cmp	DWORD PTR -1080[rbp], eax
	jl	.L46
	mov	rax, QWORD PTR -1064[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	mov	DWORD PTR -1076[rbp], eax
	cmp	DWORD PTR -1076[rbp], 0
	je	.L47
	mov	eax, DWORD PTR -1076[rbp]
	mov	edx, eax
	lea	rsi, .LC31[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L47:
	mov	rax, QWORD PTR -1064[rbp]
	mov	BYTE PTR [rax], 1
	mov	eax, DWORD PTR fd[rip]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -1064[rbp]
	mov	eax, DWORD PTR 16[rax]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -1072[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -1064[rbp]
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L49
	call	__stack_chk_fail@PLT
.L49:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	thread_handler, .-thread_handler
	.section	.rodata
.LC32:
	.string	"SIGINT Caught! Exiting ... \n"
.LC33:
	.string	"SIGTERM Caught! Exiting ... \n"
	.text
	.type	signal_handler, @function
signal_handler:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	cmp	DWORD PTR -20[rbp], 2
	je	.L51
	cmp	DWORD PTR -20[rbp], 15
	je	.L52
	jmp	.L71
.L51:
	lea	rsi, .LC32[rip]
	mov	edi, 7
	mov	eax, 0
	call	syslog@PLT
	jmp	.L54
.L61:
	mov	rax, QWORD PTR head[rip]
	mov	QWORD PTR datap[rip], rax
	nop
	mov	rax, QWORD PTR datap[rip]
	test	rax, rax
	je	.L54
	mov	rax, QWORD PTR datap[rip]
	mov	eax, DWORD PTR 16[rax]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR datap[rip]
	mov	rax, QWORD PTR 8[rax]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rdx, QWORD PTR head[rip]
	mov	rax, QWORD PTR datap[rip]
	cmp	rdx, rax
	jne	.L56
	mov	rax, QWORD PTR head[rip]
	mov	rax, QWORD PTR 32[rax]
	mov	QWORD PTR head[rip], rax
	jmp	.L57
.L56:
	mov	rax, QWORD PTR head[rip]
	mov	QWORD PTR -16[rbp], rax
	jmp	.L58
.L59:
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 32[rax]
	mov	QWORD PTR -16[rbp], rax
.L58:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdx, QWORD PTR 32[rax]
	mov	rax, QWORD PTR datap[rip]
	cmp	rdx, rax
	jne	.L59
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 32[rax]
	mov	rdx, QWORD PTR 32[rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR 32[rax], rdx
.L57:
	mov	rax, QWORD PTR datap[rip]
	mov	rdi, rax
	call	free@PLT
	nop
.L54:
	mov	rax, QWORD PTR head[rip]
	test	rax, rax
	jne	.L61
	lea	rdi, mutex_lock[rip]
	call	pthread_mutex_destroy@PLT
	lea	rdi, .LC11[rip]
	call	unlink@PLT
	mov	eax, DWORD PTR clientfd[rip]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR sockfd[rip]
	mov	edi, eax
	call	close@PLT
	jmp	.L62
.L52:
	lea	rsi, .LC33[rip]
	mov	edi, 6
	mov	eax, 0
	call	syslog@PLT
	jmp	.L63
.L70:
	mov	rax, QWORD PTR head[rip]
	mov	QWORD PTR datap[rip], rax
	nop
	mov	rax, QWORD PTR datap[rip]
	test	rax, rax
	je	.L63
	mov	rax, QWORD PTR datap[rip]
	mov	eax, DWORD PTR 16[rax]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR datap[rip]
	mov	rax, QWORD PTR 8[rax]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rdx, QWORD PTR head[rip]
	mov	rax, QWORD PTR datap[rip]
	cmp	rdx, rax
	jne	.L65
	mov	rax, QWORD PTR head[rip]
	mov	rax, QWORD PTR 32[rax]
	mov	QWORD PTR head[rip], rax
	jmp	.L66
.L65:
	mov	rax, QWORD PTR head[rip]
	mov	QWORD PTR -8[rbp], rax
	jmp	.L67
.L68:
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 32[rax]
	mov	QWORD PTR -8[rbp], rax
.L67:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR 32[rax]
	mov	rax, QWORD PTR datap[rip]
	cmp	rdx, rax
	jne	.L68
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 32[rax]
	mov	rdx, QWORD PTR 32[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR 32[rax], rdx
.L66:
	mov	rax, QWORD PTR datap[rip]
	mov	rdi, rax
	call	free@PLT
	nop
.L63:
	mov	rax, QWORD PTR head[rip]
	test	rax, rax
	jne	.L70
	lea	rdi, mutex_lock[rip]
	call	pthread_mutex_destroy@PLT
	lea	rdi, .LC11[rip]
	call	unlink@PLT
	mov	eax, DWORD PTR clientfd[rip]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR sockfd[rip]
	mov	edi, eax
	call	close@PLT
	jmp	.L62
.L71:
	mov	edi, 1
	call	exit@PLT
.L62:
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE9:
	.size	signal_handler, .-signal_handler
	.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	"189132.c"
	.text
	.global	mutex_lock
	.bss
	.align	2
	.type	mutex_lock, %object
	.size	mutex_lock, 24
mutex_lock:
	.space	24
	.comm	head,4,4
	.global	fd
	.align	2
	.type	fd, %object
	.size	fd, 4
fd:
	.space	4
	.global	sockfd
	.align	2
	.type	sockfd, %object
	.size	sockfd, 4
sockfd:
	.space	4
	.global	clientfd
	.align	2
	.type	clientfd, %object
	.size	clientfd, 4
clientfd:
	.space	4
	.global	status
	.align	2
	.type	status, %object
	.size	status, 4
status:
	.space	4
	.global	packets
	.align	2
	.type	packets, %object
	.size	packets, 4
packets:
	.space	4
	.global	byte
	.type	byte, %object
	.size	byte, 1
byte:
	.space	1
	.global	isdaemon
	.type	isdaemon, %object
	.size	isdaemon, 1
isdaemon:
	.space	1
	.global	datap
	.align	2
	.type	datap, %object
	.size	datap, 4
datap:
	.space	4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"aesdsocket\000"
	.align	2
.LC1:
	.ascii	"Failed to configure SIGINT handler\012\000"
	.align	2
.LC2:
	.ascii	"Failed to configure SIGTERM handler\012\000"
	.align	2
.LC3:
	.ascii	"-d\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ 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]
	str	r1, [fp, #-12]
	mov	r2, #8
	mov	r1, #1
	ldr	r0, .L6
	bl	openlog
	ldr	r1, .L6+4
	mov	r0, #2
	bl	signal
	mov	r3, r0
	cmn	r3, #1
	bne	.L2
	ldr	r1, .L6+8
	mov	r0, #3
	bl	syslog
	mov	r0, #1
	bl	exit
.L2:
	ldr	r1, .L6+4
	mov	r0, #15
	bl	signal
	mov	r3, r0
	cmn	r3, #1
	bne	.L3
	ldr	r1, .L6+12
	mov	r0, #3
	bl	syslog
	mov	r0, #1
	bl	exit
.L3:
	mov	r1, #0
	ldr	r0, .L6+16
	bl	pthread_mutex_init
	ldr	r3, [fp, #-8]
	cmp	r3, #1
	ble	.L4
	ldr	r3, [fp, #-12]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L6+20
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L4
	ldr	r3, .L6+24
	mov	r2, #1
	strb	r2, [r3]
.L4:
	bl	handle_socket
	bl	closelog
	mvn	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	.LC0
	.word	signal_handler
	.word	.LC1
	.word	.LC2
	.word	mutex_lock
	.word	.LC3
	.word	isdaemon
	.size	main, .-main
	.section	.rodata
	.align	2
.LC4:
	.ascii	"9000\000"
	.align	2
.LC5:
	.ascii	"getaddrinfo function failed\012\000"
	.align	2
.LC6:
	.ascii	"socket function failed\012\000"
	.align	2
.LC7:
	.ascii	"setsockopt function failed\012\000"
	.align	2
.LC8:
	.ascii	"bind function failed\012\000"
	.align	2
.LC9:
	.ascii	"daemon function failed\012\000"
	.align	2
.LC10:
	.ascii	"Entering daemon mode\012\000"
	.align	2
.LC11:
	.ascii	"/dev/aesdchar\000"
	.align	2
.LC12:
	.ascii	"create function failed\012\000"
	.align	2
.LC13:
	.ascii	"setitimer function failed\012\000"
	.align	2
.LC14:
	.ascii	"listen function failed\012\000"
	.align	2
.LC15:
	.ascii	"accept function failed\012\000"
	.align	2
.LC16:
	.ascii	"Accepting connection from %s\000"
	.align	2
.LC17:
	.ascii	"pthread_create function failed\012\000"
	.align	2
.LC18:
	.ascii	"Thread created\012\000"
	.align	2
.LC19:
	.ascii	"Thread exited\012\000"
	.align	2
.LC20:
	.ascii	"Closed connection from %s\000"
	.align	2
.LC21:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	handle_socket
	.syntax unified
	.arm
	.fpu softvfp
	.type	handle_socket, %function
handle_socket:
	@ args = 0, pretend = 0, frame = 104
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #112
	ldr	r3, .L30
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L30+4
	mov	r2, #0
	str	r2, [r3]
	sub	r3, fp, #72
	mov	r2, #32
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #1
	str	r3, [fp, #-72]
	mov	r3, #10
	str	r3, [fp, #-68]
	mov	r3, #1
	str	r3, [fp, #-64]
	sub	r3, fp, #108
	sub	r2, fp, #72
	ldr	r1, .L30+8
	mov	r0, #0
	bl	getaddrinfo
	mov	r3, r0
	ldr	r2, .L30+12
	str	r3, [r2]
	ldr	r3, .L30+12
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L9
	ldr	r1, .L30+16
	mov	r0, #3
	bl	syslog
	mov	r0, #1
	bl	exit
.L9:
	mov	r2, #0
	mov	r1, #1
	mov	r0, #10
	bl	socket
	mov	r3, r0
	ldr	r2, .L30+20
	str	r3, [r2]
	ldr	r3, .L30+20
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L10
	ldr	r1, .L30+24
	mov	r0, #3
	bl	syslog
	ldr	r3, [fp, #-108]
	mov	r0, r3
	bl	freeaddrinfo
	mov	r0, #1
	bl	exit
.L10:
	ldr	r3, .L30+20
	ldr	r0, [r3]
	mov	r3, #1
	str	r3, [fp, #-100]
	sub	r3, fp, #100
	mov	r2, #4
	str	r2, [sp]
	mov	r2, #2
	mov	r1, #1
	bl	setsockopt
	mov	r3, r0
	ldr	r2, .L30+12
	str	r3, [r2]
	ldr	r3, .L30+12
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L11
	ldr	r1, .L30+28
	mov	r0, #3
	bl	syslog
	ldr	r3, [fp, #-108]
	mov	r0, r3
	bl	freeaddrinfo
	mov	r0, #1
	bl	exit
.L11:
	ldr	r3, .L30+20
	ldr	r0, [r3]
	ldr	r3, [fp, #-108]
	ldr	r1, [r3, #20]
	ldr	r3, [fp, #-108]
	ldr	r3, [r3, #16]
	mov	r2, r3
	bl	bind
	mov	r3, r0
	ldr	r2, .L30+12
	str	r3, [r2]
	ldr	r3, .L30+12
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L12
	ldr	r1, .L30+32
	mov	r0, #3
	bl	syslog
	ldr	r3, [fp, #-108]
	mov	r0, r3
	bl	freeaddrinfo
	mov	r0, #1
	bl	exit
.L12:
	ldr	r3, .L30+36
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L13
	mov	r1, #0
	mov	r0, #0
	bl	daemon
	mov	r3, r0
	ldr	r2, .L30+12
	str	r3, [r2]
	ldr	r3, .L30+12
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L14
	ldr	r1, .L30+40
	mov	r0, #3
	bl	syslog
	mov	r0, #1
	bl	exit
.L14:
	ldr	r1, .L30+44
	mov	r0, #6
	bl	syslog
.L13:
	mov	r1, #420
	ldr	r0, .L30+48
	bl	creat
	mov	r3, r0
	ldr	r2, .L30+52
	str	r3, [r2]
	ldr	r3, .L30+52
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L15
	ldr	r1, .L30+56
	mov	r0, #3
	bl	syslog
	mov	r0, #1
	bl	exit
.L15:
	ldr	r3, .L30+52
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-108]
	mov	r0, r3
	bl	freeaddrinfo
	mov	r3, #10
	str	r3, [fp, #-88]
	mov	r3, #0
	str	r3, [fp, #-84]
	mov	r3, #10
	str	r3, [fp, #-80]
	mov	r3, #0
	str	r3, [fp, #-76]
	sub	r3, fp, #88
	mov	r2, #0
	mov	r1, r3
	mov	r0, #0
	bl	setitimer
	mov	r3, r0
	ldr	r2, .L30+12
	str	r3, [r2]
	ldr	r3, .L30+12
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L28
	ldr	r1, .L30+60
	mov	r0, #3
	bl	syslog
.L28:
	ldr	r3, .L30+20
	ldr	r3, [r3]
	mov	r1, #5
	mov	r0, r3
	bl	listen
	mov	r3, r0
	ldr	r2, .L30+12
	str	r3, [r2]
	ldr	r3, .L30+12
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L17
	ldr	r1, .L30+64
	mov	r0, #3
	bl	syslog
	ldr	r3, [fp, #-108]
	mov	r0, r3
	bl	freeaddrinfo
	mov	r0, #1
	bl	exit
.L17:
	mov	r3, #16
	str	r3, [fp, #-104]
	ldr	r3, .L30+20
	ldr	r3, [r3]
	sub	r2, fp, #104
	sub	r1, fp, #40
	mov	r0, r3
	bl	accept
	mov	r3, r0
	ldr	r2, .L30+68
	str	r3, [r2]
	ldr	r3, .L30+68
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L18
	ldr	r1, .L30+72
	mov	r0, #3
	bl	syslog
	ldr	r3, [fp, #-108]
	mov	r0, r3
	bl	freeaddrinfo
	mov	r0, #1
	bl	exit
.L18:
	sub	r3, fp, #40
	str	r3, [fp, #-92]
	ldr	r3, [fp, #-92]
	add	r1, r3, #4
	sub	r2, fp, #24
	mov	r3, #16
	mov	r0, #2
	bl	inet_ntop
	sub	r3, fp, #24
	mov	r2, r3
	ldr	r1, .L30+76
	mov	r0, #6
	bl	syslog
	mov	r0, #20
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L30+80
	str	r2, [r3]
	ldr	r3, .L30+80
	ldr	r3, [r3]
	ldr	r2, .L30+4
	ldr	r2, [r2]
	str	r2, [r3, #16]
	ldr	r3, .L30+80
	ldr	r3, [r3]
	ldr	r2, .L30+4
	str	r3, [r2]
	ldr	r3, .L30+80
	ldr	r3, [r3]
	ldr	r2, .L30+68
	ldr	r2, [r2]
	str	r2, [r3, #8]
	ldr	r3, .L30+80
	ldr	r3, [r3]
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, .L30+80
	ldr	r3, [r3]
	ldr	r2, .L30+84
	str	r2, [r3, #12]
	ldr	r3, .L30+80
	ldr	r3, [r3]
	add	r0, r3, #4
	ldr	r3, .L30+80
	ldr	r3, [r3]
	ldr	r2, .L30+88
	mov	r1, #0
	bl	pthread_create
	mov	r3, r0
	ldr	r2, .L30+12
	str	r3, [r2]
	ldr	r3, .L30+12
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L19
	ldr	r1, .L30+92
	mov	r0, #3
	bl	syslog
	mov	r0, #1
	bl	exit
.L19:
	ldr	r1, .L30+96
	mov	r0, #6
	bl	syslog
	ldr	r3, .L30+4
	ldr	r3, [r3]
	ldr	r2, .L30+80
	str	r3, [r2]
	b	.L20
.L27:
	ldr	r3, .L30+80
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, .L30+80
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L21
	ldr	r3, .L30+4
	ldr	r2, [r3]
	ldr	r3, .L30+80
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L22
	ldr	r3, .L30+4
	ldr	r3, [r3]
	ldr	r3, [r3, #16]
	ldr	r2, .L30+4
	str	r3, [r2]
	b	.L23
.L22:
	ldr	r3, .L30+4
	ldr	r3, [r3]
	str	r3, [fp, #-96]
	b	.L24
.L25:
	ldr	r3, [fp, #-96]
	ldr	r3, [r3, #16]
	str	r3, [fp, #-96]
.L24:
	ldr	r3, [fp, #-96]
	ldr	r2, [r3, #16]
	ldr	r3, .L30+80
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L25
	ldr	r3, [fp, #-96]
	ldr	r3, [r3, #16]
	ldr	r2, [r3, #16]
	ldr	r3, [fp, #-96]
	str	r2, [r3, #16]
.L23:
	ldr	r3, .L30+80
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	b	.L26
.L21:
	ldr	r3, .L30+80
	ldr	r3, [r3]
	ldr	r3, [r3, #16]
	ldr	r2, .L30+80
	str	r3, [r2]
.L20:
	ldr	r3, .L30+80
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L27
.L26:
	ldr	r1, .L30+100
	mov	r0, #6
	bl	syslog
	sub	r3, fp, #24
	mov	r2, r3
	ldr	r1, .L30+104
	mov	r0, #7
	bl	syslog
	b	.L28
.L31:
	.align	2
.L30:
	.word	.LC21
	.word	head
	.word	.LC4
	.word	status
	.word	.LC5
	.word	sockfd
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	isdaemon
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	fd
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	clientfd
	.word	.LC15
	.word	.LC16
	.word	datap
	.word	mutex_lock
	.word	thread_handler
	.word	.LC17
	.word	.LC18
	.word	.LC19
	.word	.LC20
	.size	handle_socket, .-handle_socket
	.section	.rodata
	.align	2
.LC22:
	.ascii	"malloc() failed\000"
	.align	2
.LC23:
	.ascii	"recv() failed\000"
	.align	2
.LC24:
	.ascii	"realloc() failed\000"
	.align	2
.LC25:
	.ascii	"pthread_mutex_lock() failed with error code: %d\012"
	.ascii	"\000"
	.align	2
.LC26:
	.ascii	"open() failed (append and write only)\012\000"
	.align	2
.LC27:
	.ascii	"write() failed\012\000"
	.align	2
.LC28:
	.ascii	"File partially written\012\000"
	.align	2
.LC29:
	.ascii	"open() failed (read only)\012\000"
	.align	2
.LC30:
	.ascii	"read() failed!\012\000"
	.align	2
.LC31:
	.ascii	"send() failed!\012\000"
	.align	2
.LC32:
	.ascii	"pthread_mutex_unlock() failed with error code: %d\012"
	.ascii	"\000"
	.align	2
.LC33:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	thread_handler
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread_handler, %function
thread_handler:
	@ args = 0, pretend = 0, frame = 1056
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #1056
	sub	sp, sp, #4
	str	r0, [fp, #-1064]
	ldr	r3, .L54
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #0
	strb	r3, [fp, #-1057]
	mov	r3, #0
	str	r3, [fp, #-1040]
	sub	r3, fp, #1024
	sub	r3, r3, #12
	mov	r2, #1020
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #0
	str	r3, [fp, #-1052]
	ldr	r3, [fp, #-1064]
	str	r3, [fp, #-1048]
	mov	r0, #1024
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-1052]
	ldr	r3, [fp, #-1052]
	cmp	r3, #0
	bne	.L33
	ldr	r1, .L54+4
	mov	r0, #3
	bl	syslog
	mov	r0, #1
	bl	exit
.L33:
	mov	r2, #1024
	mov	r1, #0
	ldr	r0, [fp, #-1052]
	bl	memset
	b	.L34
.L41:
	ldr	r3, [fp, #-1048]
	ldr	r0, [r3, #8]
	sub	r1, fp, #1024
	sub	r1, r1, #12
	sub	r1, r1, #4
	mov	r3, #0
	mov	r2, #1024
	bl	recv
	mov	r3, r0
	ldr	r2, .L54+8
	str	r3, [r2]
	ldr	r3, .L54+8
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L35
	ldr	r1, .L54+12
	mov	r0, #3
	bl	syslog
	mov	r0, #1
	bl	exit
.L35:
	mov	r3, #0
	str	r3, [fp, #-1056]
	b	.L36
.L39:
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	ldr	r2, [fp, #-1056]
	add	r3, r3, r2
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L37
	mov	r3, #1
	strb	r3, [fp, #-1057]
	ldr	r3, [fp, #-1056]
	add	r3, r3, #1
	str	r3, [fp, #-1056]
	b	.L38
.L37:
	ldr	r3, [fp, #-1056]
	add	r3, r3, #1
	str	r3, [fp, #-1056]
.L36:
	ldr	r3, [fp, #-1056]
	cmp	r3, #1024
	blt	.L39
.L38:
	ldr	r3, .L54+16
	ldr	r2, [r3]
	ldr	r3, [fp, #-1056]
	add	r3, r2, r3
	ldr	r2, .L54+16
	str	r3, [r2]
	ldr	r3, .L54+16
	ldr	r3, [r3]
	add	r3, r3, #1
	mov	r1, r3
	ldr	r0, [fp, #-1052]
	bl	realloc
	str	r0, [fp, #-1052]
	ldr	r3, [fp, #-1052]
	cmp	r3, #0
	bne	.L40
	ldr	r1, .L54+20
	mov	r0, #3
	bl	syslog
	mov	r0, #1
	bl	exit
.L40:
	ldr	r2, [fp, #-1056]
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, [fp, #-1052]
	bl	strncat
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r2, #1024
	mov	r1, #0
	mov	r0, r3
	bl	memset
.L34:
	ldrb	r3, [fp, #-1057]
	eor	r3, r3, #1
	and	r3, r3, #255
	cmp	r3, #0
	bne	.L41
	ldr	r3, [fp, #-1048]
	ldr	r3, [r3, #12]
	mov	r0, r3
	bl	pthread_mutex_lock
	mov	r3, r0
	ldr	r2, .L54+8
	str	r3, [r2]
	ldr	r3, .L54+8
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L42
	ldr	r3, .L54+8
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L54+24
	mov	r0, #3
	bl	syslog
	mov	r0, #1
	bl	exit
.L42:
	ldr	r1, .L54+28
	ldr	r0, .L54+32
	bl	open
	mov	r3, r0
	ldr	r2, .L54+36
	str	r3, [r2]
	ldr	r3, .L54+36
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L43
	ldr	r1, .L54+40
	mov	r0, #3
	bl	syslog
	mov	r0, #1
	bl	exit
.L43:
	ldr	r3, .L54+36
	ldr	r4, [r3]
	ldr	r0, [fp, #-1052]
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r1, [fp, #-1052]
	mov	r0, r4
	bl	write
	str	r0, [fp, #-1044]
	ldr	r3, [fp, #-1044]
	cmn	r3, #1
	bne	.L44
	ldr	r1, .L54+44
	mov	r0, #3
	bl	syslog
	mov	r0, #1
	bl	exit
.L44:
	ldr	r0, [fp, #-1052]
	bl	strlen
	mov	r2, r0
	ldr	r3, [fp, #-1044]
	cmp	r2, r3
	beq	.L45
	ldr	r1, .L54+48
	mov	r0, #3
	bl	syslog
	mov	r0, #1
	bl	exit
.L45:
	ldr	r3, .L54+36
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r2, #1024
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r1, #0
	ldr	r0, .L54+32
	bl	open
	mov	r3, r0
	ldr	r2, .L54+36
	str	r3, [r2]
	ldr	r3, .L54+36
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L46
	ldr	r1, .L54+52
	mov	r0, #3
	bl	syslog
	mov	r0, #1
	bl	exit
.L46:
	mov	r3, #0
	str	r3, [fp, #-1056]
	b	.L47
.L50:
	ldr	r3, .L54+36
	ldr	r3, [r3]
	mov	r2, #1
	ldr	r1, .L54+56
	mov	r0, r3
	bl	read
	str	r0, [fp, #-1044]
	ldr	r3, [fp, #-1044]
	cmn	r3, #1
	bne	.L48
	ldr	r1, .L54+60
	mov	r0, #3
	bl	syslog
	mov	r0, #1
	bl	exit
.L48:
	ldr	r3, [fp, #-1048]
	ldr	r0, [r3, #8]
	mov	r3, #0
	mov	r2, #1
	ldr	r1, .L54+56
	bl	send
	str	r0, [fp, #-1044]
	ldr	r3, [fp, #-1044]
	cmn	r3, #1
	bne	.L49
	ldr	r1, .L54+64
	mov	r0, #3
	bl	syslog
	mov	r0, #1
	bl	exit
.L49:
	ldr	r3, [fp, #-1056]
	add	r3, r3, #1
	str	r3, [fp, #-1056]
.L47:
	ldr	r3, .L54+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-1056]
	cmp	r2, r3
	blt	.L50
	ldr	r3, [fp, #-1048]
	ldr	r3, [r3, #12]
	mov	r0, r3
	bl	pthread_mutex_unlock
	str	r0, [fp, #-1044]
	ldr	r3, [fp, #-1044]
	cmp	r3, #0
	beq	.L51
	ldr	r2, [fp, #-1044]
	ldr	r1, .L54+68
	mov	r0, #3
	bl	syslog
	mov	r0, #1
	bl	exit
.L51:
	ldr	r3, [fp, #-1048]
	mov	r2, #1
	strb	r2, [r3]
	ldr	r3, .L54+36
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-1048]
	ldr	r3, [r3, #8]
	mov	r0, r3
	bl	close
	ldr	r0, [fp, #-1052]
	bl	free
	ldr	r3, [fp, #-1048]
	ldr	r2, .L54
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L53
	bl	__stack_chk_fail
.L53:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L55:
	.align	2
.L54:
	.word	.LC33
	.word	.LC22
	.word	status
	.word	.LC23
	.word	packets
	.word	.LC24
	.word	.LC25
	.word	1025
	.word	.LC11
	.word	fd
	.word	.LC26
	.word	.LC27
	.word	.LC28
	.word	.LC29
	.word	byte
	.word	.LC30
	.word	.LC31
	.word	.LC32
	.size	thread_handler, .-thread_handler
	.section	.rodata
	.align	2
.LC34:
	.ascii	"SIGINT Caught! Exiting ... \012\000"
	.align	2
.LC35:
	.ascii	"SIGTERM Caught! Exiting ... \012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	signal_handler, %function
signal_handler:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #2
	beq	.L57
	ldr	r3, [fp, #-16]
	cmp	r3, #15
	beq	.L58
	b	.L77
.L57:
	ldr	r1, .L78
	mov	r0, #7
	bl	syslog
	b	.L60
.L67:
	ldr	r3, .L78+4
	ldr	r3, [r3]
	ldr	r2, .L78+8
	str	r3, [r2]
	nop
	ldr	r3, .L78+8
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L60
	ldr	r3, .L78+8
	ldr	r3, [r3]
	ldr	r3, [r3, #8]
	mov	r0, r3
	bl	close
	ldr	r3, .L78+8
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, .L78+4
	ldr	r2, [r3]
	ldr	r3, .L78+8
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L62
	ldr	r3, .L78+4
	ldr	r3, [r3]
	ldr	r3, [r3, #16]
	ldr	r2, .L78+4
	str	r3, [r2]
	b	.L63
.L62:
	ldr	r3, .L78+4
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	b	.L64
.L65:
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #16]
	str	r3, [fp, #-12]
.L64:
	ldr	r3, [fp, #-12]
	ldr	r2, [r3, #16]
	ldr	r3, .L78+8
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L65
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #16]
	ldr	r2, [r3, #16]
	ldr	r3, [fp, #-12]
	str	r2, [r3, #16]
.L63:
	ldr	r3, .L78+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	nop
.L60:
	ldr	r3, .L78+4
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L67
	ldr	r0, .L78+12
	bl	pthread_mutex_destroy
	ldr	r0, .L78+16
	bl	unlink
	ldr	r3, .L78+20
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	ldr	r3, .L78+24
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	b	.L68
.L58:
	ldr	r1, .L78+28
	mov	r0, #6
	bl	syslog
	b	.L69
.L76:
	ldr	r3, .L78+4
	ldr	r3, [r3]
	ldr	r2, .L78+8
	str	r3, [r2]
	nop
	ldr	r3, .L78+8
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L69
	ldr	r3, .L78+8
	ldr	r3, [r3]
	ldr	r3, [r3, #8]
	mov	r0, r3
	bl	close
	ldr	r3, .L78+8
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, .L78+4
	ldr	r2, [r3]
	ldr	r3, .L78+8
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L71
	ldr	r3, .L78+4
	ldr	r3, [r3]
	ldr	r3, [r3, #16]
	ldr	r2, .L78+4
	str	r3, [r2]
	b	.L72
.L71:
	ldr	r3, .L78+4
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	b	.L73
.L74:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #16]
	str	r3, [fp, #-8]
.L73:
	ldr	r3, [fp, #-8]
	ldr	r2, [r3, #16]
	ldr	r3, .L78+8
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L74
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #16]
	ldr	r2, [r3, #16]
	ldr	r3, [fp, #-8]
	str	r2, [r3, #16]
.L72:
	ldr	r3, .L78+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	nop
.L69:
	ldr	r3, .L78+4
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L76
	ldr	r0, .L78+12
	bl	pthread_mutex_destroy
	ldr	r0, .L78+16
	bl	unlink
	ldr	r3, .L78+20
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	ldr	r3, .L78+24
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	b	.L68
.L77:
	mov	r0, #1
	bl	exit
.L68:
	mov	r0, #0
	bl	exit
.L79:
	.align	2
.L78:
	.word	.LC34
	.word	head
	.word	datap
	.word	mutex_lock
	.word	.LC11
	.word	clientfd
	.word	sockfd
	.word	.LC35
	.size	signal_handler, .-signal_handler
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
