	.file	"431339.c"
	.intel_syntax noprefix
	.text
	.data
	.align 4
	.type	server_fd, @object
	.size	server_fd, 4
server_fd:
	.long	-1
	.local	new_addr_info
	.comm	new_addr_info,8,8
	.local	mutex_lock
	.comm	mutex_lock,40,32
	.globl	sig_caught
	.bss
	.type	sig_caught, @object
	.size	sig_caught, 1
sig_caught:
	.zero	1
	.text
	.globl	shutdown_process
	.type	shutdown_process, @function
shutdown_process:
.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 server_fd[rip]
	test	eax, eax
	js	.L2
	mov	eax, DWORD PTR server_fd[rip]
	mov	esi, 2
	mov	edi, eax
	call	shutdown@PLT
	mov	eax, DWORD PTR server_fd[rip]
	mov	edi, eax
	call	close@PLT
.L2:
	lea	rdi, mutex_lock[rip]
	call	pthread_mutex_destroy@PLT
	call	closelog@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	shutdown_process, .-shutdown_process
	.section	.rodata
.LC0:
	.string	"Signal Caught %d\n\r"
	.text
	.type	sig_handler, @function
sig_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 sig_caught[rip], 1
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	sig_handler, .-sig_handler
	.section	.rodata
.LC1:
	.string	"aesdsocket"
	.align 8
.LC2:
	.string	"ERROR: could not register SIGINT, error SIG_ERR\n\r"
	.align 8
.LC3:
	.string	"ERROR: could not register SIGTERM, error SIG_ERR\n\r"
.LC4:
	.string	"-d"
	.align 8
.LC5:
	.string	"Useage incorrect for arg: %s\nUse -d option for daemonize"
.LC6:
	.string	"/dev/aesdchar"
.LC7:
	.string	"error %d\n"
	.align 8
.LC8:
	.string	"ERROR: aesdsocketdata file could not be opened/created, error number %d"
.LC9:
	.string	"Here"
.LC10:
	.string	"9000"
.LC11:
	.string	"ERROR in getaddrinfo() %s\n"
	.align 8
.LC12:
	.string	"ERROR opening socket, error number %d\n"
	.align 8
.LC13:
	.string	"ERROR set socket options failed with error number%d\n"
	.align 8
.LC14:
	.string	"ERROR binding socket error num %d\n"
	.align 8
.LC15:
	.string	"ERROR: listening for connection error num %d\n"
.LC16:
	.string	"Listening for connections\n\r"
.LC17:
	.string	"setsid error%d\n"
.LC18:
	.string	"/"
.LC19:
	.string	"/dev/null"
	.align 8
.LC20:
	.string	"ERROR: accepting new connection error is %s"
	.align 8
.LC21:
	.string	"Accepted connection from %s \n\r"
.LC22:
	.string	"Accepted connection from %s\n\r"
.LC23:
	.string	"Joining thread with id %d\n\r"
.LC24:
	.string	"Killing thread %d\n\r"
	.text
	.globl	main
	.type	main, @function
main:
.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, 192
	mov	DWORD PTR -180[rbp], edi
	mov	QWORD PTR -192[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, .LC1[rip]
	call	openlog@PLT
	lea	rsi, sig_handler[rip]
	mov	edi, 2
	call	signal@PLT
	mov	QWORD PTR -120[rbp], rax
	cmp	QWORD PTR -120[rbp], -1
	jne	.L5
	lea	rsi, .LC2[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	eax, 0
	call	shutdown_process
	mov	edi, 1
	call	exit@PLT
.L5:
	lea	rsi, sig_handler[rip]
	mov	edi, 15
	call	signal@PLT
	mov	QWORD PTR -120[rbp], rax
	cmp	QWORD PTR -120[rbp], -1
	jne	.L6
	lea	rsi, .LC3[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	eax, 0
	call	shutdown_process
	mov	edi, 1
	call	exit@PLT
.L6:
	mov	BYTE PTR -165[rbp], 0
	cmp	DWORD PTR -180[rbp], 1
	jle	.L7
	mov	rax, QWORD PTR -192[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L8
	mov	BYTE PTR -165[rbp], 1
	jmp	.L7
.L8:
	mov	rax, QWORD PTR -192[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -192[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdx, rax
	lea	rsi, .LC5[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L7:
	mov	edx, 438
	mov	esi, 578
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -160[rbp], eax
	cmp	DWORD PTR -160[rbp], 0
	jns	.L9
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC8[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	eax, 0
	call	shutdown_process
	mov	edi, 1
	call	exit@PLT
.L9:
	mov	eax, DWORD PTR -160[rbp]
	mov	edi, eax
	call	close@PLT
	mov	QWORD PTR -128[rbp], 0
	mov	QWORD PTR -136[rbp], 0
	lea	rax, -112[rbp]
	mov	edx, 48
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	lea	rdi, .LC9[rip]
	call	puts@PLT
	mov	DWORD PTR -108[rbp], 2
	mov	DWORD PTR -104[rbp], 1
	mov	DWORD PTR -112[rbp], 1
	lea	rax, -112[rbp]
	lea	rcx, new_addr_info[rip]
	mov	rdx, rax
	lea	rsi, .LC10[rip]
	mov	edi, 0
	call	getaddrinfo@PLT
	mov	DWORD PTR -156[rbp], eax
	cmp	DWORD PTR -156[rbp], 0
	je	.L10
	mov	eax, DWORD PTR -156[rbp]
	mov	edi, eax
	call	gai_strerror@PLT
	mov	rdx, rax
	lea	rsi, .LC11[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	rax, QWORD PTR new_addr_info[rip]
	mov	rdi, rax
	call	freeaddrinfo@PLT
	mov	eax, 0
	call	shutdown_process
	mov	edi, 1
	call	exit@PLT
.L10:
	mov	rax, QWORD PTR new_addr_info[rip]
	mov	eax, DWORD PTR 4[rax]
	mov	edx, 0
	mov	esi, 1
	mov	edi, eax
	call	socket@PLT
	mov	DWORD PTR server_fd[rip], eax
	mov	eax, DWORD PTR server_fd[rip]
	test	eax, eax
	jns	.L11
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC12[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	rax, QWORD PTR new_addr_info[rip]
	mov	rdi, rax
	call	freeaddrinfo@PLT
	mov	eax, 0
	call	shutdown_process
	mov	edi, 1
	call	exit@PLT
.L11:
	mov	DWORD PTR -164[rbp], 1
	mov	eax, DWORD PTR server_fd[rip]
	lea	rdx, -164[rbp]
	mov	r8d, 4
	mov	rcx, rdx
	mov	edx, 2
	mov	esi, 1
	mov	edi, eax
	call	setsockopt@PLT
	test	eax, eax
	jns	.L12
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC13[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	rax, QWORD PTR new_addr_info[rip]
	mov	rdi, rax
	call	freeaddrinfo@PLT
	mov	eax, 0
	call	shutdown_process
	mov	edi, 1
	call	exit@PLT
.L12:
	lea	rdi, .LC9[rip]
	call	puts@PLT
	mov	rax, QWORD PTR new_addr_info[rip]
	mov	edx, DWORD PTR 16[rax]
	mov	rax, QWORD PTR new_addr_info[rip]
	mov	rcx, QWORD PTR 24[rax]
	mov	eax, DWORD PTR server_fd[rip]
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	jns	.L13
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC14[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	rax, QWORD PTR new_addr_info[rip]
	mov	rdi, rax
	call	freeaddrinfo@PLT
	mov	eax, 0
	call	shutdown_process
	mov	edi, 1
	call	exit@PLT
.L13:
	mov	rax, QWORD PTR new_addr_info[rip]
	mov	rdi, rax
	call	freeaddrinfo@PLT
	mov	eax, DWORD PTR server_fd[rip]
	mov	esi, 10
	mov	edi, eax
	call	listen@PLT
	test	eax, eax
	je	.L14
	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	shutdown_process
	mov	edi, 1
	call	exit@PLT
.L14:
	lea	rdi, .LC16[rip]
	mov	eax, 0
	call	printf@PLT
	cmp	BYTE PTR -165[rbp], 0
	je	.L15
	mov	esi, 1
	mov	edi, 17
	call	signal@PLT
	mov	esi, 1
	mov	edi, 1
	call	signal@PLT
	call	fork@PLT
	mov	DWORD PTR -152[rbp], eax
	cmp	DWORD PTR -152[rbp], 0
	jns	.L16
	mov	eax, 0
	call	shutdown_process
	mov	edi, 1
	call	exit@PLT
.L16:
	cmp	DWORD PTR -152[rbp], 0
	jle	.L17
	mov	edi, 0
	call	exit@PLT
.L17:
	call	setsid@PLT
	cmp	eax, -1
	jne	.L18
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC17[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	edi, 1
	call	exit@PLT
.L18:
	lea	rdi, .LC18[rip]
	call	chdir@PLT
	mov	esi, 2
	lea	rdi, .LC19[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -148[rbp], eax
	mov	eax, DWORD PTR -148[rbp]
	mov	esi, 0
	mov	edi, eax
	call	dup2@PLT
	mov	eax, DWORD PTR -148[rbp]
	mov	esi, 1
	mov	edi, eax
	call	dup2@PLT
	mov	eax, DWORD PTR -148[rbp]
	mov	esi, 2
	mov	edi, eax
	call	dup2@PLT
	mov	eax, DWORD PTR -148[rbp]
	mov	edi, eax
	call	close@PLT
.L15:
	mov	eax, DWORD PTR server_fd[rip]
	mov	DWORD PTR -56[rbp], eax
	mov	WORD PTR -52[rbp], 1
	mov	DWORD PTR -144[rbp], 100
	jmp	.L19
.L27:
	mov	DWORD PTR -164[rbp], 16
	mov	edx, DWORD PTR -144[rbp]
	lea	rax, -56[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	poll@PLT
	movzx	eax, WORD PTR -50[rbp]
	cmp	ax, 1
	je	.L20
	jmp	.L19
.L20:
	mov	eax, DWORD PTR server_fd[rip]
	lea	rdx, -164[rbp]
	lea	rcx, -48[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -140[rbp], eax
	movzx	eax, BYTE PTR sig_caught[rip]
	test	al, al
	jne	.L32
	cmp	DWORD PTR -140[rbp], 0
	jns	.L23
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	lea	rsi, .LC20[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	eax, 0
	call	shutdown_process
	mov	edi, 1
	call	exit@PLT
.L23:
	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, .LC21[rip]
	mov	edi, 6
	mov	eax, 0
	call	syslog@PLT
	lea	rax, -32[rbp]
	mov	rsi, rax
	lea	rdi, .LC22[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 56
	call	malloc@PLT
	mov	QWORD PTR -128[rbp], rax
	mov	rdx, QWORD PTR -136[rbp]
	mov	rax, QWORD PTR -128[rbp]
	mov	QWORD PTR 48[rax], rdx
	mov	rax, QWORD PTR -128[rbp]
	mov	QWORD PTR -136[rbp], rax
	mov	rax, QWORD PTR -128[rbp]
	mov	edx, DWORD PTR -140[rbp]
	mov	DWORD PTR 8[rax], edx
	mov	rcx, QWORD PTR -128[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	rdx, QWORD PTR -40[rbp]
	mov	QWORD PTR 12[rcx], rax
	mov	QWORD PTR 20[rcx], rdx
	mov	rax, QWORD PTR -128[rbp]
	lea	rdx, mutex_lock[rip]
	mov	QWORD PTR 32[rax], rdx
	mov	rax, QWORD PTR -128[rbp]
	mov	BYTE PTR 40[rax], 0
	mov	rdx, QWORD PTR -128[rbp]
	mov	rax, QWORD PTR -128[rbp]
	mov	rcx, rdx
	lea	rdx, run_socket_comm[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	rax, QWORD PTR -136[rbp]
	mov	QWORD PTR -128[rbp], rax
	jmp	.L24
.L26:
	mov	rax, QWORD PTR -128[rbp]
	movzx	eax, BYTE PTR 40[rax]
	test	al, al
	je	.L25
	mov	rax, QWORD PTR -128[rbp]
	mov	rax, QWORD PTR [rax]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rax, QWORD PTR -128[rbp]
	mov	eax, DWORD PTR 8[rax]
	mov	esi, 2
	mov	edi, eax
	call	shutdown@PLT
	mov	rax, QWORD PTR -128[rbp]
	mov	eax, DWORD PTR 8[rax]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -128[rbp]
	mov	rax, QWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC23[rip]
	mov	edi, 6
	mov	eax, 0
	call	syslog@PLT
	mov	rax, QWORD PTR -128[rbp]
	mov	rax, QWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC23[rip]
	mov	eax, 0
	call	printf@PLT
.L25:
	mov	rax, QWORD PTR -128[rbp]
	mov	rax, QWORD PTR 48[rax]
	mov	QWORD PTR -128[rbp], rax
.L24:
	cmp	QWORD PTR -128[rbp], 0
	jne	.L26
.L19:
	movzx	eax, BYTE PTR sig_caught[rip]
	xor	eax, 1
	test	al, al
	jne	.L27
	jmp	.L28
.L32:
	nop
	jmp	.L28
.L29:
	mov	rax, QWORD PTR -136[rbp]
	mov	QWORD PTR -128[rbp], rax
	mov	rax, QWORD PTR -128[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	pthread_cancel@PLT
	mov	rax, QWORD PTR -128[rbp]
	mov	rax, QWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC24[rip]
	mov	edi, 6
	mov	eax, 0
	call	syslog@PLT
	mov	rax, QWORD PTR -136[rbp]
	mov	rax, QWORD PTR 48[rax]
	mov	QWORD PTR -136[rbp], rax
	mov	rax, QWORD PTR -128[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	QWORD PTR -128[rbp], 0
.L28:
	mov	rax, QWORD PTR -136[rbp]
	test	rax, rax
	jne	.L29
	lea	rdi, .LC6[rip]
	call	unlink@PLT
	mov	esi, 0
	lea	rdi, .LC6[rip]
	call	access@PLT
	test	eax, eax
	jne	.L30
	lea	rdi, .LC6[rip]
	call	remove@PLT
.L30:
	mov	eax, 0
	call	shutdown_process
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC25:
	.string	"Error allocating buffer for thread %d\n\r"
	.align 8
.LC26:
	.string	"Error: reading from socket errno=%d\n"
.LC27:
	.string	"read %d bytes\n\r"
.LC28:
	.string	"size error is %d\n\r"
	.align 8
.LC29:
	.string	"error opening file errno is %d\n\r"
.LC30:
	.string	"Mutex cannot be locked\n\r"
	.align 8
.LC31:
	.string	"Error writing to file errno is %d\n\r"
.LC32:
	.string	"wrote %d bytes\n\r"
.LC33:
	.string	"error is %d\n\r"
	.align 8
.LC34:
	.string	"Error reading from file errno %d\n"
.LC35:
	.string	"wrote %d bytes to client\n\r"
.LC36:
	.string	"errno is %d"
	.align 8
.LC37:
	.string	"Error writing to client fd %d\n"
	.text
	.type	run_socket_comm, @function
run_socket_comm:
.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, 80
	mov	QWORD PTR -72[rbp], rdi
	lea	rdi, .LC9[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -72[rbp]
	mov	QWORD PTR -8[rbp], rax
	mov	edi, 1024
	call	malloc@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L34
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC25[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR 40[rax], 1
	jmp	.L35
.L34:
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, 1024
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
.L35:
	mov	DWORD PTR -64[rbp], 1
	mov	DWORD PTR -60[rbp], 0
	jmp	.L36
.L41:
	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 8[rax]
	mov	edx, 1024
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -56[rbp], eax
	cmp	DWORD PTR -56[rbp], 0
	jns	.L37
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC26[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 40[rax], 1
	mov	edi, 0
	call	pthread_exit@PLT
.L37:
	mov	eax, DWORD PTR -56[rbp]
	mov	esi, eax
	lea	rdi, .LC27[rip]
	mov	eax, 0
	call	printf@PLT
	cmp	DWORD PTR -56[rbp], 0
	jne	.L38
	jmp	.L36
.L38:
	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	.L56
	add	DWORD PTR -64[rbp], 1
	mov	eax, DWORD PTR -64[rbp]
	sal	eax, 10
	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	.L36
	mov	eax, DWORD PTR -60[rbp]
	add	eax, 1024
	mov	esi, eax
	lea	rdi, .LC28[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC25[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 40[rax], 1
	mov	edi, 0
	call	pthread_exit@PLT
.L36:
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR 40[rax]
	xor	eax, 1
	test	al, al
	jne	.L41
	jmp	.L40
.L56:
	nop
.L40:
	mov	edx, 502
	mov	esi, 1026
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], 0
	jns	.L42
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC29[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
.L42:
	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 32[rax]
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	DWORD PTR -48[rbp], eax
	cmp	DWORD PTR -48[rbp], 0
	je	.L43
	lea	rsi, .LC30[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	lea	rdi, .LC30[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR 40[rax], 1
	mov	edi, 0
	call	pthread_exit@PLT
.L43:
	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	.L44
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC31[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 40[rax], 1
	mov	eax, DWORD PTR -52[rbp]
	mov	edi, eax
	call	close@PLT
	mov	edi, 0
	call	pthread_exit@PLT
.L44:
	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 32[rax]
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	mov	DWORD PTR -48[rbp], eax
	cmp	DWORD PTR -48[rbp], 0
	je	.L45
	lea	rsi, .LC30[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	lea	rdi, .LC30[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR 40[rax], 1
	mov	edi, 0
	call	pthread_exit@PLT
.L45:
	mov	eax, DWORD PTR -52[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -44[rbp]
	mov	esi, eax
	lea	rdi, .LC32[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC9[rip]
	call	puts@PLT
	mov	DWORD PTR -40[rbp], 0
	mov	edx, 502
	mov	esi, 1026
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], 0
	jns	.L46
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC26[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC33[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR 40[rax], 1
	mov	edi, 0
	call	pthread_exit@PLT
.L46:
	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, 1024
	call	malloc@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	DWORD PTR -60[rbp], 0
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, 1024
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -64[rbp], 1
.L55:
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 32[rax]
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	DWORD PTR -48[rbp], eax
	cmp	DWORD PTR -48[rbp], 0
	je	.L47
	lea	rsi, .LC30[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	lea	rdi, .LC30[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR 40[rax], 1
	mov	edi, 0
	call	pthread_exit@PLT
.L47:
	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 32[rax]
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	mov	DWORD PTR -48[rbp], eax
	cmp	DWORD PTR -48[rbp], 0
	je	.L48
	lea	rsi, .LC30[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	lea	rdi, .LC30[rip]
	mov	eax, 0
	call	printf@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 40[rax], 1
	mov	edi, 0
	call	pthread_exit@PLT
.L48:
	cmp	DWORD PTR -32[rbp], 0
	jns	.L49
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC34[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	jmp	.L50
.L49:
	cmp	DWORD PTR -32[rbp], 0
	je	.L57
	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	.L52
	mov	eax, DWORD PTR -60[rbp]
	add	eax, 1
	movsx	rdx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 8[rax]
	mov	rcx, QWORD PTR -16[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	DWORD PTR -28[rbp], eax
	mov	eax, DWORD PTR -28[rbp]
	mov	esi, eax
	lea	rdi, .LC35[rip]
	mov	eax, 0
	call	printf@PLT
	cmp	DWORD PTR -28[rbp], 0
	jns	.L53
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC36[rip]
	mov	eax, 0
	call	printf@PLT
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC37[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	jmp	.L50
.L53:
	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	.L55
.L52:
	add	DWORD PTR -60[rbp], 1
	mov	eax, DWORD PTR -60[rbp]
	cmp	eax, 8
	jbe	.L55
	add	DWORD PTR -64[rbp], 1
	mov	eax, DWORD PTR -64[rbp]
	sal	eax, 10
	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	.L55
	mov	eax, DWORD PTR -60[rbp]
	add	eax, 1024
	mov	esi, eax
	lea	rdi, .LC28[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	mov	edx, eax
	lea	rsi, .LC25[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@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 40[rax], 1
	mov	edi, 0
	call	pthread_exit@PLT
.L57:
	nop
.L50:
	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 40[rax], 1
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE9:
	.size	run_socket_comm, .-run_socket_comm
	.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	"431339.c"
	.text
	.data
	.align	2
	.type	server_fd, %object
	.size	server_fd, 4
server_fd:
	.word	-1
	.local	new_addr_info
	.comm	new_addr_info,4,4
	.local	mutex_lock
	.comm	mutex_lock,24,4
	.global	sig_caught
	.bss
	.type	sig_caught, %object
	.size	sig_caught, 1
sig_caught:
	.space	1
	.text
	.align	2
	.global	shutdown_process
	.syntax unified
	.arm
	.fpu softvfp
	.type	shutdown_process, %function
shutdown_process:
	@ 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	server_fd
	.word	mutex_lock
	.size	shutdown_process, .-shutdown_process
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Signal Caught %d\012\015\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sig_handler, %function
sig_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, .L6
	mov	r0, #6
	bl	syslog
	ldr	r3, .L6+4
	mov	r2, #1
	strb	r2, [r3]
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	.LC0
	.word	sig_caught
	.size	sig_handler, .-sig_handler
	.section	.rodata
	.align	2
.LC1:
	.ascii	"aesdsocket\000"
	.align	2
.LC2:
	.ascii	"ERROR: could not register SIGINT, error SIG_ERR\012"
	.ascii	"\015\000"
	.align	2
.LC3:
	.ascii	"ERROR: could not register SIGTERM, error SIG_ERR\012"
	.ascii	"\015\000"
	.align	2
.LC4:
	.ascii	"-d\000"
	.align	2
.LC5:
	.ascii	"Useage incorrect for arg: %s\012Use -d option for d"
	.ascii	"aemonize\000"
	.align	2
.LC6:
	.ascii	"/dev/aesdchar\000"
	.align	2
.LC7:
	.ascii	"error %d\012\000"
	.align	2
.LC8:
	.ascii	"ERROR: aesdsocketdata file could not be opened/crea"
	.ascii	"ted, error number %d\000"
	.align	2
.LC9:
	.ascii	"Here\000"
	.align	2
.LC10:
	.ascii	"9000\000"
	.align	2
.LC11:
	.ascii	"ERROR in getaddrinfo() %s\012\000"
	.align	2
.LC12:
	.ascii	"ERROR opening socket, error number %d\012\000"
	.align	2
.LC13:
	.ascii	"ERROR set socket options failed with error number%d"
	.ascii	"\012\000"
	.align	2
.LC14:
	.ascii	"ERROR binding socket error num %d\012\000"
	.align	2
.LC15:
	.ascii	"ERROR: listening for connection error num %d\012\000"
	.align	2
.LC16:
	.ascii	"Listening for connections\012\015\000"
	.align	2
.LC17:
	.ascii	"setsid error%d\012\000"
	.align	2
.LC18:
	.ascii	"/\000"
	.align	2
.LC19:
	.ascii	"/dev/null\000"
	.align	2
.LC20:
	.ascii	"ERROR: accepting new connection error is %s\000"
	.align	2
.LC21:
	.ascii	"Accepted connection from %s \012\015\000"
	.align	2
.LC22:
	.ascii	"Accepted connection from %s\012\015\000"
	.align	2
.LC23:
	.ascii	"Joining thread with id %d\012\015\000"
	.align	2
.LC24:
	.ascii	"Killing thread %d\012\015\000"
	.align	2
.LC25:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 128
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #136
	str	r0, [fp, #-128]
	str	r1, [fp, #-132]
	ldr	r3, .L37
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r2, #8
	mov	r1, #0
	ldr	r0, .L37+4
	bl	openlog
	ldr	r1, .L37+8
	mov	r0, #2
	bl	signal
	str	r0, [fp, #-108]
	ldr	r3, [fp, #-108]
	cmn	r3, #1
	bne	.L9
	ldr	r1, .L37+12
	mov	r0, #3
	bl	syslog
	bl	shutdown_process
	mov	r0, #1
	bl	exit
.L9:
	ldr	r1, .L37+8
	mov	r0, #15
	bl	signal
	str	r0, [fp, #-108]
	ldr	r3, [fp, #-108]
	cmn	r3, #1
	bne	.L10
	ldr	r1, .L37+16
	mov	r0, #3
	bl	syslog
	bl	shutdown_process
	mov	r0, #1
	bl	exit
.L10:
	mov	r3, #0
	strb	r3, [fp, #-121]
	ldr	r3, [fp, #-128]
	cmp	r3, #1
	ble	.L11
	ldr	r3, [fp, #-132]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L37+20
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L12
	mov	r3, #1
	strb	r3, [fp, #-121]
	b	.L11
.L12:
	ldr	r3, [fp, #-132]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L37+24
	bl	printf
	ldr	r3, [fp, #-132]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L37+24
	mov	r0, #3
	bl	syslog
	mov	r0, #1
	bl	exit
.L11:
	ldr	r2, .L37+28
	ldr	r1, .L37+32
	ldr	r0, .L37+36
	bl	open
	str	r0, [fp, #-104]
	ldr	r3, [fp, #-104]
	cmp	r3, #0
	bge	.L13
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L37+40
	bl	printf
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L37+44
	mov	r0, #3
	bl	syslog
	bl	shutdown_process
	mov	r0, #1
	bl	exit
.L13:
	ldr	r0, [fp, #-104]
	bl	close
	mov	r3, #0
	str	r3, [fp, #-112]
	mov	r3, #0
	str	r3, [fp, #-120]
	sub	r3, fp, #80
	mov	r2, #32
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r0, .L37+48
	bl	puts
	mov	r3, #2
	str	r3, [fp, #-76]
	mov	r3, #1
	str	r3, [fp, #-72]
	mov	r3, #1
	str	r3, [fp, #-80]
	sub	r2, fp, #80
	ldr	r3, .L37+52
	ldr	r1, .L37+56
	mov	r0, #0
	bl	getaddrinfo
	str	r0, [fp, #-100]
	ldr	r3, [fp, #-100]
	cmp	r3, #0
	beq	.L14
	ldr	r0, [fp, #-100]
	bl	gai_strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L37+60
	mov	r0, #3
	bl	syslog
	ldr	r3, .L37+52
	ldr	r3, [r3]
	mov	r0, r3
	bl	freeaddrinfo
	bl	shutdown_process
	mov	r0, #1
	bl	exit
.L14:
	ldr	r3, .L37+52
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	mov	r2, #0
	mov	r1, #1
	mov	r0, r3
	bl	socket
	mov	r3, r0
	ldr	r2, .L37+64
	str	r3, [r2]
	ldr	r3, .L37+64
	ldr	r3, [r3]
	cmp	r3, #0
	bge	.L15
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L37+68
	mov	r0, #3
	bl	syslog
	ldr	r3, .L37+52
	ldr	r3, [r3]
	mov	r0, r3
	bl	freeaddrinfo
	bl	shutdown_process
	mov	r0, #1
	bl	exit
.L15:
	ldr	r3, .L37+64
	ldr	r0, [r3]
	mov	r3, #1
	str	r3, [fp, #-116]
	sub	r3, fp, #116
	mov	r2, #4
	str	r2, [sp]
	mov	r2, #2
	mov	r1, #1
	bl	setsockopt
	mov	r3, r0
	cmp	r3, #0
	bge	.L16
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L37+72
	mov	r0, #3
	bl	syslog
	ldr	r3, .L37+52
	ldr	r3, [r3]
	mov	r0, r3
	bl	freeaddrinfo
	bl	shutdown_process
	mov	r0, #1
	bl	exit
.L16:
	ldr	r0, .L37+48
	bl	puts
	ldr	r3, .L37+64
	ldr	r0, [r3]
	ldr	r3, .L37+52
	ldr	r3, [r3]
	ldr	r1, [r3, #20]
	ldr	r3, .L37+52
	ldr	r3, [r3]
	ldr	r3, [r3, #16]
	mov	r2, r3
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	bge	.L17
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L37+76
	bl	printf
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L37+76
	mov	r0, #3
	bl	syslog
	ldr	r3, .L37+52
	ldr	r3, [r3]
	mov	r0, r3
	bl	freeaddrinfo
	bl	shutdown_process
	mov	r0, #1
	bl	exit
.L17:
	ldr	r3, .L37+52
	ldr	r3, [r3]
	mov	r0, r3
	bl	freeaddrinfo
	ldr	r3, .L37+64
	ldr	r3, [r3]
	mov	r1, #10
	mov	r0, r3
	bl	listen
	mov	r3, r0
	cmp	r3, #0
	beq	.L18
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L37+80
	mov	r0, #3
	bl	syslog
	bl	shutdown_process
	mov	r0, #1
	bl	exit
.L18:
	ldr	r0, .L37+84
	bl	printf
	ldrb	r3, [fp, #-121]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L19
	mov	r1, #1
	mov	r0, #17
	bl	signal
	mov	r1, #1
	mov	r0, #1
	bl	signal
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-96]
	ldr	r3, [fp, #-96]
	cmp	r3, #0
	bge	.L20
	bl	shutdown_process
	mov	r0, #1
	bl	exit
.L20:
	ldr	r3, [fp, #-96]
	cmp	r3, #0
	ble	.L21
	mov	r0, #0
	bl	exit
.L21:
	bl	setsid
	mov	r3, r0
	cmn	r3, #1
	bne	.L22
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L37+88
	mov	r0, #3
	bl	syslog
	mov	r0, #1
	bl	exit
.L22:
	ldr	r0, .L37+92
	bl	chdir
	mov	r1, #2
	ldr	r0, .L37+96
	bl	open
	str	r0, [fp, #-92]
	mov	r1, #0
	ldr	r0, [fp, #-92]
	bl	dup2
	mov	r1, #1
	ldr	r0, [fp, #-92]
	bl	dup2
	mov	r1, #2
	ldr	r0, [fp, #-92]
	bl	dup2
	ldr	r0, [fp, #-92]
	bl	close
.L19:
	ldr	r3, .L37+64
	ldr	r3, [r3]
	str	r3, [fp, #-48]
	mov	r3, #1
	strh	r3, [fp, #-44]	@ movhi
	mov	r3, #100
	str	r3, [fp, #-88]
	b	.L23
.L31:
	mov	r3, #16
	str	r3, [fp, #-116]
	sub	r3, fp, #48
	ldr	r2, [fp, #-88]
	mov	r1, #1
	mov	r0, r3
	bl	poll
	ldrsh	r3, [fp, #-42]
	cmp	r3, #1
	beq	.L24
	b	.L23
.L24:
	ldr	r3, .L37+64
	ldr	r3, [r3]
	sub	r2, fp, #116
	sub	r1, fp, #40
	mov	r0, r3
	bl	accept
	str	r0, [fp, #-84]
	ldr	r3, .L37+100
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L36
	ldr	r3, [fp, #-84]
	cmp	r3, #0
	bge	.L27
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L37+104
	mov	r0, #3
	bl	syslog
	bl	shutdown_process
	mov	r0, #1
	bl	exit
.L27:
	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, .L37+108
	mov	r0, #6
	bl	syslog
	sub	r3, fp, #24
	mov	r1, r3
	ldr	r0, .L37+112
	bl	printf
	mov	r0, #36
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-112]
	ldr	r2, [fp, #-120]
	ldr	r3, [fp, #-112]
	str	r2, [r3, #32]
	ldr	r3, [fp, #-112]
	str	r3, [fp, #-120]
	ldr	r3, [fp, #-112]
	ldr	r2, [fp, #-84]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-112]
	add	ip, r3, #8
	sub	r3, fp, #40
	ldm	r3, {r0, r1, r2, r3}
	stm	ip, {r0, r1, r2, r3}
	ldr	r3, [fp, #-112]
	ldr	r2, .L37+116
	str	r2, [r3, #24]
	ldr	r3, [fp, #-112]
	mov	r2, #0
	strb	r2, [r3, #28]
	ldr	r0, [fp, #-112]
	ldr	r3, [fp, #-112]
	ldr	r2, .L37+120
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-120]
	str	r3, [fp, #-112]
	b	.L28
.L30:
	ldr	r3, [fp, #-112]
	ldrb	r3, [r3, #28]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L29
	ldr	r3, [fp, #-112]
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-112]
	ldr	r3, [r3, #4]
	mov	r1, #2
	mov	r0, r3
	bl	shutdown
	ldr	r3, [fp, #-112]
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-112]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L37+124
	mov	r0, #6
	bl	syslog
	ldr	r3, [fp, #-112]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L37+124
	bl	printf
.L29:
	ldr	r3, [fp, #-112]
	ldr	r3, [r3, #32]
	str	r3, [fp, #-112]
.L28:
	ldr	r3, [fp, #-112]
	cmp	r3, #0
	bne	.L30
.L23:
	ldr	r3, .L37+100
	ldrb	r3, [r3]	@ zero_extendqisi2
	eor	r3, r3, #1
	and	r3, r3, #255
	cmp	r3, #0
	bne	.L31
	b	.L32
.L36:
	nop
	b	.L32
.L33:
	ldr	r3, [fp, #-120]
	str	r3, [fp, #-112]
	ldr	r3, [fp, #-112]
	ldr	r3, [r3]
	mov	r0, r3
	bl	pthread_cancel
	ldr	r3, [fp, #-112]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L37+128
	mov	r0, #6
	bl	syslog
	ldr	r3, [fp, #-120]
	ldr	r3, [r3, #32]
	str	r3, [fp, #-120]
	ldr	r0, [fp, #-112]
	bl	free
	mov	r3, #0
	str	r3, [fp, #-112]
.L32:
	ldr	r3, [fp, #-120]
	cmp	r3, #0
	bne	.L33
	ldr	r0, .L37+36
	bl	unlink
	mov	r1, #0
	ldr	r0, .L37+36
	bl	access
	mov	r3, r0
	cmp	r3, #0
	bne	.L34
	ldr	r0, .L37+36
	bl	remove
.L34:
	bl	shutdown_process
	mov	r0, #0
	bl	exit
.L38:
	.align	2
.L37:
	.word	.LC25
	.word	.LC1
	.word	sig_handler
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	438
	.word	578
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	new_addr_info
	.word	.LC10
	.word	.LC11
	.word	server_fd
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.word	.LC18
	.word	.LC19
	.word	sig_caught
	.word	.LC20
	.word	.LC21
	.word	.LC22
	.word	mutex_lock
	.word	run_socket_comm
	.word	.LC23
	.word	.LC24
	.size	main, .-main
	.section	.rodata
	.align	2
.LC26:
	.ascii	"Error allocating buffer for thread %d\012\015\000"
	.align	2
.LC27:
	.ascii	"Error: reading from socket errno=%d\012\000"
	.align	2
.LC28:
	.ascii	"read %d bytes\012\015\000"
	.align	2
.LC29:
	.ascii	"size error is %d\012\015\000"
	.align	2
.LC30:
	.ascii	"error opening file errno is %d\012\015\000"
	.align	2
.LC31:
	.ascii	"Mutex cannot be locked\012\015\000"
	.align	2
.LC32:
	.ascii	"Error writing to file errno is %d\012\015\000"
	.align	2
.LC33:
	.ascii	"wrote %d bytes\012\015\000"
	.align	2
.LC34:
	.ascii	"error is %d\012\015\000"
	.align	2
.LC35:
	.ascii	"Error reading from file errno %d\012\000"
	.align	2
.LC36:
	.ascii	"wrote %d bytes to client\012\015\000"
	.align	2
.LC37:
	.ascii	"errno is %d\000"
	.align	2
.LC38:
	.ascii	"Error writing to client fd %d\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	run_socket_comm, %function
run_socket_comm:
	@ 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	r0, .L64
	bl	puts
	ldr	r3, [fp, #-64]
	str	r3, [fp, #-40]
	mov	r0, #1024
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-56]
	cmp	r3, #0
	bne	.L40
	ldr	r3, [fp, #-40]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L64+4
	mov	r0, #3
	bl	syslog
	ldr	r3, [fp, #-40]
	mov	r2, #1
	strb	r2, [r3, #28]
	b	.L41
.L40:
	mov	r2, #1024
	mov	r1, #0
	ldr	r0, [fp, #-56]
	bl	memset
.L41:
	mov	r3, #1
	str	r3, [fp, #-52]
	mov	r3, #0
	str	r3, [fp, #-48]
	b	.L42
.L47:
	ldr	r3, [fp, #-40]
	ldr	r0, [r3, #4]
	ldr	r3, [fp, #-48]
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	mov	r2, #1024
	mov	r1, r3
	bl	read
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	bge	.L43
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L64+8
	mov	r0, #3
	bl	syslog
	ldr	r0, [fp, #-56]
	bl	free
	ldr	r3, [fp, #-40]
	mov	r2, #1
	strb	r2, [r3, #28]
	mov	r0, #0
	bl	pthread_exit
.L43:
	ldr	r1, [fp, #-36]
	ldr	r0, .L64+12
	bl	printf
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	bne	.L44
	b	.L42
.L44:
	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	.L62
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #10
	mov	r1, r3
	ldr	r0, [fp, #-56]
	bl	realloc
	str	r0, [fp, #-56]
	ldr	r3, [fp, #-56]
	cmp	r3, #0
	bne	.L42
	ldr	r3, [fp, #-48]
	add	r3, r3, #1024
	mov	r1, r3
	ldr	r0, .L64+16
	bl	printf
	ldr	r3, [fp, #-40]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L64+4
	mov	r0, #3
	bl	syslog
	ldr	r0, [fp, #-56]
	bl	free
	ldr	r3, [fp, #-40]
	mov	r2, #1
	strb	r2, [r3, #28]
	mov	r0, #0
	bl	pthread_exit
.L42:
	ldr	r3, [fp, #-40]
	ldrb	r3, [r3, #28]	@ zero_extendqisi2
	eor	r3, r3, #1
	and	r3, r3, #255
	cmp	r3, #0
	bne	.L47
	b	.L46
.L62:
	nop
.L46:
	ldr	r2, .L64+20
	ldr	r1, .L64+24
	ldr	r0, .L64+28
	bl	open
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bge	.L48
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L64+32
	mov	r0, #3
	bl	syslog
.L48:
	mov	r2, #2
	mov	r1, #0
	ldr	r0, [fp, #-32]
	bl	lseek
	ldr	r3, [fp, #-40]
	ldr	r3, [r3, #24]
	mov	r0, r3
	bl	pthread_mutex_lock
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L49
	ldr	r1, .L64+36
	mov	r0, #3
	bl	syslog
	ldr	r0, .L64+36
	bl	printf
	ldr	r0, [fp, #-56]
	bl	free
	ldr	r3, [fp, #-40]
	mov	r2, #1
	strb	r2, [r3, #28]
	mov	r0, #0
	bl	pthread_exit
.L49:
	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	.L50
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L64+40
	mov	r0, #3
	bl	syslog
	ldr	r0, [fp, #-56]
	bl	free
	ldr	r3, [fp, #-40]
	mov	r2, #1
	strb	r2, [r3, #28]
	ldr	r0, [fp, #-32]
	bl	close
	mov	r0, #0
	bl	pthread_exit
.L50:
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-32]
	bl	lseek
	ldr	r3, [fp, #-40]
	ldr	r3, [r3, #24]
	mov	r0, r3
	bl	pthread_mutex_unlock
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L51
	ldr	r1, .L64+36
	mov	r0, #3
	bl	syslog
	ldr	r0, .L64+36
	bl	printf
	ldr	r0, [fp, #-56]
	bl	free
	ldr	r3, [fp, #-40]
	mov	r2, #1
	strb	r2, [r3, #28]
	mov	r0, #0
	bl	pthread_exit
.L51:
	ldr	r0, [fp, #-32]
	bl	close
	ldr	r1, [fp, #-24]
	ldr	r0, .L64+44
	bl	printf
	ldr	r0, .L64
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-20]
	ldr	r2, .L64+20
	ldr	r1, .L64+24
	ldr	r0, .L64+28
	bl	open
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bge	.L52
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L64+8
	mov	r0, #3
	bl	syslog
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L64+48
	bl	printf
	ldr	r0, [fp, #-56]
	bl	free
	ldr	r3, [fp, #-40]
	mov	r2, #1
	strb	r2, [r3, #28]
	mov	r0, #0
	bl	pthread_exit
.L52:
	mov	r2, #0
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	lseek
	mov	r0, #1024
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-44]
	mov	r3, #0
	str	r3, [fp, #-48]
	mov	r2, #1024
	mov	r1, #0
	ldr	r0, [fp, #-44]
	bl	memset
	mov	r3, #1
	str	r3, [fp, #-52]
.L61:
	ldr	r3, [fp, #-40]
	ldr	r3, [r3, #24]
	mov	r0, r3
	bl	pthread_mutex_lock
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L53
	ldr	r1, .L64+36
	mov	r0, #3
	bl	syslog
	ldr	r0, .L64+36
	bl	printf
	ldr	r0, [fp, #-56]
	bl	free
	ldr	r3, [fp, #-40]
	mov	r2, #1
	strb	r2, [r3, #28]
	mov	r0, #0
	bl	pthread_exit
.L53:
	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, #24]
	mov	r0, r3
	bl	pthread_mutex_unlock
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L54
	ldr	r1, .L64+36
	mov	r0, #3
	bl	syslog
	ldr	r0, .L64+36
	bl	printf
	ldr	r0, [fp, #-56]
	bl	free
	ldr	r0, [fp, #-44]
	bl	free
	ldr	r3, [fp, #-40]
	mov	r2, #1
	strb	r2, [r3, #28]
	mov	r0, #0
	bl	pthread_exit
.L54:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bge	.L55
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L64+52
	mov	r0, #3
	bl	syslog
	b	.L56
.L55:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L63
	ldr	r3, [fp, #-48]
	ldr	r2, [fp, #-44]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L58
	ldr	r3, [fp, #-40]
	ldr	r0, [r3, #4]
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	mov	r2, r3
	ldr	r1, [fp, #-44]
	bl	write
	str	r0, [fp, #-8]
	ldr	r1, [fp, #-8]
	ldr	r0, .L64+56
	bl	printf
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L59
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L64+60
	bl	printf
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L64+64
	mov	r0, #3
	bl	syslog
	b	.L56
.L59:
	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	.L61
.L58:
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	str	r3, [fp, #-48]
	ldr	r3, [fp, #-48]
	cmp	r3, #4
	bls	.L61
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #10
	mov	r1, r3
	ldr	r0, [fp, #-44]
	bl	realloc
	str	r0, [fp, #-44]
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	bne	.L61
	ldr	r3, [fp, #-48]
	add	r3, r3, #1024
	mov	r1, r3
	ldr	r0, .L64+16
	bl	printf
	ldr	r3, [fp, #-40]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L64+4
	mov	r0, #3
	bl	syslog
	ldr	r0, [fp, #-44]
	bl	free
	ldr	r0, [fp, #-56]
	bl	free
	ldr	r3, [fp, #-40]
	mov	r2, #1
	strb	r2, [r3, #28]
	mov	r0, #0
	bl	pthread_exit
.L63:
	nop
.L56:
	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, #28]
	mov	r0, #0
	bl	pthread_exit
.L65:
	.align	2
.L64:
	.word	.LC9
	.word	.LC26
	.word	.LC27
	.word	.LC28
	.word	.LC29
	.word	502
	.word	1026
	.word	.LC6
	.word	.LC30
	.word	.LC31
	.word	.LC32
	.word	.LC33
	.word	.LC34
	.word	.LC35
	.word	.LC36
	.word	.LC37
	.word	.LC38
	.size	run_socket_comm, .-run_socket_comm
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
