	.file	"141098.c"
	.intel_syntax noprefix
	.text
	.globl	gGracefulShutdown
	.bss
	.align 4
	.type	gGracefulShutdown, @object
	.size	gGracefulShutdown, 4
gGracefulShutdown:
	.zero	4
	.globl	gMasterSocket
	.data
	.align 4
	.type	gMasterSocket, @object
	.size	gMasterSocket, 4
gMasterSocket:
	.long	-1
	.globl	gCaughtHupSignal
	.bss
	.align 4
	.type	gCaughtHupSignal, @object
	.size	gCaughtHupSignal, 4
gCaughtHupSignal:
	.zero	4
	.globl	gListenPort
	.data
	.align 4
	.type	gListenPort, @object
	.size	gListenPort, 4
gListenPort:
	.long	10037
	.globl	gLockFileDesk
	.align 4
	.type	gLockFileDesk, @object
	.size	gLockFileDesk, 4
gLockFileDesk:
	.long	-1
	.globl	gLockFilePath
	.section	.rodata
.LC0:
	.string	"chat-daemon.pid"
	.section	.data.rel.ro.local,"aw"
	.align 8
	.type	gLockFilePath, @object
	.size	gLockFilePath, 8
gLockFilePath:
	.quad	.LC0
	.section	.rodata
.LC1:
	.string	"Error fork the process."
.LC2:
	.string	"%d"
.LC3:
	.string	"Error creating the lock file."
.LC4:
	.string	"Error locking the lock file."
.LC5:
	.string	"Error writing to lock file."
	.align 8
.LC6:
	.string	"Error changing the session ID."
.LC7:
	.string	"/"
	.align 8
.LC8:
	.string	"Error changing the process folder."
.LC9:
	.string	"/dev/null"
	.text
	.globl	BecomeDaemonProcess
	.type	BecomeDaemonProcess, @function
BecomeDaemonProcess:
.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, 112
	mov	QWORD PTR -104[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	call	fork@PLT
	mov	DWORD PTR -84[rbp], eax
	cmp	DWORD PTR -84[rbp], -1
	je	.L2
	cmp	DWORD PTR -84[rbp], 0
	je	.L17
	jmp	.L16
.L2:
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L16:
	mov	edi, 0
	call	exit@PLT
.L17:
	nop
	call	getpid@PLT
	mov	edx, eax
	lea	rax, -18[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	mov	rax, QWORD PTR -104[rbp]
	mov	edx, 128
	mov	esi, 16
	mov	rdi, rax
	call	openlog@PLT
	lea	rax, .LC0[rip]
	mov	esi, 420
	mov	rdi, rax
	call	creat@PLT
	shr	eax, 31
	movzx	eax, al
	mov	DWORD PTR gLockFileDesk[rip], eax
	mov	eax, DWORD PTR gLockFileDesk[rip]
	test	eax, eax
	je	.L6
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	mov	WORD PTR -64[rbp], 1
	mov	WORD PTR -62[rbp], 0
	mov	QWORD PTR -56[rbp], 0
	mov	rax, QWORD PTR -56[rbp]
	mov	QWORD PTR -48[rbp], rax
	mov	DWORD PTR -40[rbp], 0
	mov	eax, DWORD PTR gLockFileDesk[rip]
	lea	rdx, -64[rbp]
	mov	esi, 6
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	mov	DWORD PTR -80[rbp], eax
	cmp	DWORD PTR -80[rbp], 0
	jns	.L7
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L7:
	lea	rax, -18[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	eax, DWORD PTR gLockFileDesk[rip]
	lea	rcx, -18[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	test	rax, rax
	jg	.L8
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	call	setsid@PLT
	test	eax, eax
	jns	.L9
	lea	rdi, .LC6[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L9:
	lea	rdi, .LC7[rip]
	call	chdir@PLT
	test	eax, eax
	jns	.L10
	lea	rdi, .LC8[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L10:
	mov	edi, 4
	call	sysconf@PLT
	mov	QWORD PTR -72[rbp], rax
	mov	rax, QWORD PTR -72[rbp]
	sub	eax, 1
	mov	DWORD PTR -88[rbp], eax
	jmp	.L11
.L13:
	mov	eax, DWORD PTR gLockFileDesk[rip]
	cmp	DWORD PTR -88[rbp], eax
	je	.L12
	mov	eax, DWORD PTR -88[rbp]
	mov	edi, eax
	call	close@PLT
.L12:
	sub	DWORD PTR -88[rbp], 1
.L11:
	cmp	DWORD PTR -88[rbp], 0
	jns	.L13
	mov	esi, 2
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -76[rbp], eax
	mov	eax, DWORD PTR -76[rbp]
	mov	edi, eax
	call	dup@PLT
	mov	eax, DWORD PTR -76[rbp]
	mov	edi, eax
	call	dup@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	BecomeDaemonProcess, .-BecomeDaemonProcess
	.globl	TidyUp
	.type	TidyUp, @function
TidyUp:
.LFB7:
	.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 gLockFileDesk[rip]
	cmp	eax, -1
	je	.L19
	mov	eax, DWORD PTR gLockFileDesk[rip]
	mov	edi, eax
	call	close@PLT
	lea	rax, .LC0[rip]
	mov	rdi, rax
	call	unlink@PLT
	mov	DWORD PTR gLockFileDesk[rip], -1
.L19:
	mov	eax, DWORD PTR gMasterSocket[rip]
	cmp	eax, -1
	je	.L21
	mov	eax, DWORD PTR gMasterSocket[rip]
	mov	edi, eax
	call	close@PLT
	mov	DWORD PTR gMasterSocket[rip], -1
.L21:
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	TidyUp, .-TidyUp
	.globl	Handler
	.type	Handler, @function
Handler:
.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, 16
	mov	DWORD PTR -4[rbp], edi
	cmp	DWORD PTR -4[rbp], 15
	je	.L23
	cmp	DWORD PTR -4[rbp], 15
	jg	.L24
	cmp	DWORD PTR -4[rbp], 1
	je	.L25
	cmp	DWORD PTR -4[rbp], 10
	jne	.L24
	mov	DWORD PTR gGracefulShutdown[rip], 1
	jmp	.L26
.L25:
	mov	DWORD PTR gCaughtHupSignal[rip], 1
	mov	eax, DWORD PTR gCaughtHupSignal[rip]
	mov	DWORD PTR gGracefulShutdown[rip], eax
	jmp	.L26
.L23:
	call	TidyUp
	mov	edi, 0
	call	exit@PLT
.L24:
	call	TidyUp
	mov	edi, 0
	call	exit@PLT
.L26:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	Handler, .-Handler
	.globl	ConfigureSignalHandlers
	.type	ConfigureSignalHandlers, @function
ConfigureSignalHandlers:
.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, 320
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -312[rbp], 12
	mov	DWORD PTR -308[rbp], 14
	mov	DWORD PTR -304[rbp], 13
	mov	DWORD PTR -300[rbp], 10
	mov	DWORD PTR -296[rbp], 1
	mov	DWORD PTR -292[rbp], 15
	lea	rax, -288[rbp]
	mov	rdi, rax
	call	sigemptyset@PLT
	mov	DWORD PTR -320[rbp], 0
	jmp	.L28
.L29:
	mov	eax, DWORD PTR -320[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, -312[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	lea	rax, -288[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	sigaddset@PLT
	add	DWORD PTR -320[rbp], 1
.L28:
	cmp	DWORD PTR -320[rbp], 6
	jle	.L29
	lea	rax, -160[rbp]
	add	rax, 8
	mov	rdi, rax
	call	sigemptyset@PLT
	mov	DWORD PTR -24[rbp], 0
	lea	rax, Handler[rip]
	mov	QWORD PTR -160[rbp], rax
	mov	DWORD PTR -316[rbp], 0
	jmp	.L30
.L31:
	mov	eax, DWORD PTR -316[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, -300[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	lea	rcx, -160[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	edi, eax
	call	sigaction@PLT
	add	DWORD PTR -316[rbp], 1
.L30:
	cmp	DWORD PTR -316[rbp], 15
	jle	.L31
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	ConfigureSignalHandlers, .-ConfigureSignalHandlers
	.section	.rodata
.LC10:
	.string	"Error creating socket!"
.LC11:
	.string	"Error binding socket!"
.LC12:
	.string	"Error listening on socket!"
	.text
	.globl	BindPassiveSocket
	.type	BindPassiveSocket, @function
BindPassiveSocket:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 64
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -32[rbp]
	add	rax, 8
	mov	edx, 8
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	eax, DWORD PTR -52[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -30[rbp], ax
	mov	WORD PTR -32[rbp], 2
	mov	edi, 0
	call	htonl@PLT
	mov	DWORD PTR -28[rbp], eax
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -44[rbp], eax
	cmp	DWORD PTR -44[rbp], 0
	jns	.L35
	lea	rdi, .LC10[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L39
.L35:
	mov	DWORD PTR -48[rbp], 1
	mov	QWORD PTR -40[rbp], 4
	mov	rax, QWORD PTR -40[rbp]
	mov	ecx, eax
	lea	rdx, -48[rbp]
	mov	eax, DWORD PTR -44[rbp]
	mov	r8d, ecx
	mov	rcx, rdx
	mov	edx, 2
	mov	esi, 1
	mov	edi, eax
	call	setsockopt@PLT
	lea	rcx, -32[rbp]
	mov	eax, DWORD PTR -44[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	jns	.L37
	lea	rdi, .LC11[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L39
.L37:
	mov	eax, DWORD PTR -44[rbp]
	mov	esi, 4096
	mov	edi, eax
	call	listen@PLT
	test	eax, eax
	jns	.L38
	lea	rdi, .LC12[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L39
.L38:
	mov	rax, QWORD PTR -64[rbp]
	mov	edx, DWORD PTR -44[rbp]
	mov	DWORD PTR [rax], edx
	mov	eax, 0
.L39:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L40
	call	__stack_chk_fail@PLT
.L40:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	BindPassiveSocket, .-BindPassiveSocket
	.globl	ReadLine
	.type	ReadLine, @function
ReadLine:
.LFB11:
	.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	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	mov	QWORD PTR -72[rbp], rdx
	mov	QWORD PTR -80[rbp], rcx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -32[rbp], 0
	mov	DWORD PTR -28[rbp], 0
	mov	BYTE PTR -33[rbp], 0
	mov	QWORD PTR -24[rbp], 0
.L49:
	lea	rsi, -34[rbp]
	mov	eax, DWORD PTR -52[rbp]
	mov	ecx, 0
	mov	edx, 1
	mov	edi, eax
	call	recv@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 1
	je	.L42
	cmp	QWORD PTR -16[rbp], 1
	jg	.L43
	cmp	QWORD PTR -16[rbp], -1
	je	.L44
	cmp	QWORD PTR -16[rbp], 0
	je	.L45
	jmp	.L43
.L44:
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 4
	je	.L52
	mov	DWORD PTR -28[rbp], -1
	mov	DWORD PTR -32[rbp], 1
	jmp	.L52
.L45:
	mov	DWORD PTR -28[rbp], 0
	mov	DWORD PTR -32[rbp], 1
	jmp	.L43
.L42:
	mov	rdx, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR -24[rbp]
	add	rdx, rax
	movzx	eax, BYTE PTR -34[rbp]
	mov	BYTE PTR [rdx], al
	mov	rax, QWORD PTR -16[rbp]
	add	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	cmp	rax, QWORD PTR -72[rbp]
	jb	.L53
	mov	DWORD PTR -32[rbp], 1
	mov	DWORD PTR -28[rbp], -1
	movzx	eax, BYTE PTR -34[rbp]
	cmp	al, 10
	jne	.L48
	cmp	BYTE PTR -33[rbp], 13
	jne	.L48
	mov	DWORD PTR -32[rbp], 1
.L48:
	movzx	eax, BYTE PTR -34[rbp]
	mov	BYTE PTR -33[rbp], al
	jmp	.L53
.L52:
	nop
	jmp	.L43
.L53:
	nop
.L43:
	cmp	DWORD PTR -32[rbp], 0
	je	.L49
	mov	rdx, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	mov	rax, QWORD PTR -80[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR [rax], rdx
	mov	eax, DWORD PTR -28[rbp]
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L51
	call	__stack_chk_fail@PLT
.L51:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	ReadLine, .-ReadLine
	.globl	WriteToSocket
	.type	WriteToSocket, @function
WriteToSocket:
.LFB12:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 64
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	mov	QWORD PTR -56[rbp], rdx
	mov	QWORD PTR -16[rbp], 0
	mov	DWORD PTR -24[rbp], 0
	mov	DWORD PTR -20[rbp], 0
.L58:
	mov	rax, QWORD PTR -56[rbp]
	sub	rax, QWORD PTR -16[rbp]
	mov	rdx, rax
	mov	rcx, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR -16[rbp]
	lea	rsi, [rcx+rax]
	mov	eax, DWORD PTR -36[rbp]
	mov	ecx, 0
	mov	edi, eax
	call	send@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], -1
	jne	.L55
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 4
	jne	.L56
	mov	QWORD PTR -8[rbp], 0
	jmp	.L57
.L56:
	mov	DWORD PTR -24[rbp], 1
	mov	DWORD PTR -20[rbp], 1
	jmp	.L57
.L55:
	mov	rax, QWORD PTR -8[rbp]
	add	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L57
	mov	DWORD PTR -20[rbp], 1
.L57:
	cmp	DWORD PTR -20[rbp], 0
	je	.L58
	mov	eax, DWORD PTR -24[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	WriteToSocket, .-WriteToSocket
	.globl	HandleConnection
	.type	HandleConnection, @function
HandleConnection:
.LFB13:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 64
	mov	DWORD PTR -52[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rcx, -32[rbp]
	mov	rdx, QWORD PTR -16[rbp]
	mov	rsi, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR -52[rbp]
	mov	edi, eax
	call	ReadLine
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], 0
	jne	.L61
	mov	rdx, QWORD PTR -32[rbp]
	mov	rcx, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR -52[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	WriteToSocket
.L61:
	mov	eax, DWORD PTR -36[rbp]
	mov	rdi, QWORD PTR -8[rbp]
	sub	rdi, QWORD PTR fs:40
	je	.L63
	call	__stack_chk_fail@PLT
.L63:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	HandleConnection, .-HandleConnection
	.globl	AcceptConnections
	.type	AcceptConnections, @function
AcceptConnections:
.LFB14:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 64
	mov	DWORD PTR -52[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -44[rbp], 1
	mov	DWORD PTR -40[rbp], 0
	jmp	.L65
.L70:
	mov	DWORD PTR -48[rbp], 16
	lea	rdx, -48[rbp]
	lea	rcx, -32[rbp]
	mov	eax, DWORD PTR -52[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], 0
	jns	.L66
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 4
	jne	.L67
	jmp	.L65
.L67:
	mov	DWORD PTR -44[rbp], 0
	mov	DWORD PTR -40[rbp], -1
	jmp	.L68
.L66:
	mov	eax, DWORD PTR -36[rbp]
	mov	edi, eax
	call	HandleConnection
	mov	DWORD PTR -40[rbp], eax
	cmp	DWORD PTR -40[rbp], 0
	je	.L68
	mov	DWORD PTR -44[rbp], 0
.L68:
	mov	eax, DWORD PTR -36[rbp]
	mov	edi, eax
	call	close@PLT
.L65:
	cmp	DWORD PTR -44[rbp], 1
	jne	.L69
	mov	eax, DWORD PTR gGracefulShutdown[rip]
	test	eax, eax
	je	.L70
.L69:
	mov	eax, DWORD PTR -40[rbp]
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L72
	call	__stack_chk_fail@PLT
.L72:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	AcceptConnections, .-AcceptConnections
	.section	.rodata
.LC13:
	.string	"Error opening lock file!"
.LC14:
	.string	"stop"
.LC15:
	.string	"restart"
.LC16:
	.string	"Usage: %s [stop|restart]\n"
.LC17:
	.string	"Daemonize Error."
.LC18:
	.string	"Signal Handlers Error."
.LC19:
	.string	"Socket Binding Error."
.LC20:
	.string	"Connection Accept Error."
	.text
	.globl	main
	.type	main, @function
main:
.LFB15:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 64
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -52[rbp], 1
	jle	.L74
	lea	rax, .LC0[rip]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -44[rbp], eax
	cmp	DWORD PTR -44[rbp], 0
	jns	.L75
	lea	rdi, .LC13[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L75:
	lea	rcx, -32[rbp]
	mov	eax, DWORD PTR -44[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -40[rbp], eax
	mov	eax, DWORD PTR -40[rbp]
	cdqe
	mov	BYTE PTR -32[rbp+rax], 0
	lea	rax, -32[rbp]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -36[rbp], eax
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC14[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L76
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, 10
	mov	edi, eax
	call	kill@PLT
	mov	edi, 0
	call	exit@PLT
.L76:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC15[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L77
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, 1
	mov	edi, eax
	call	kill@PLT
	mov	edi, 0
	call	exit@PLT
.L77:
	mov	rax, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC16[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L74:
	mov	rax, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	BecomeDaemonProcess
	mov	DWORD PTR -48[rbp], eax
	cmp	DWORD PTR -48[rbp], 0
	jns	.L78
	lea	rdi, .LC17[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L78:
	call	ConfigureSignalHandlers
	mov	DWORD PTR -48[rbp], eax
	cmp	DWORD PTR -48[rbp], 0
	jns	.L79
	lea	rdi, .LC18[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L79:
	mov	eax, DWORD PTR gListenPort[rip]
	lea	rsi, gMasterSocket[rip]
	mov	edi, eax
	call	BindPassiveSocket
	mov	DWORD PTR -48[rbp], eax
	cmp	DWORD PTR -48[rbp], 0
	jns	.L80
	lea	rdi, .LC19[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L80:
	mov	eax, DWORD PTR gMasterSocket[rip]
	mov	edi, eax
	call	AcceptConnections
	test	eax, eax
	jns	.L81
	lea	rdi, .LC20[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L81:
	mov	eax, DWORD PTR gGracefulShutdown[rip]
	cmp	eax, 1
	jne	.L82
	mov	eax, DWORD PTR gCaughtHupSignal[rip]
	test	eax, eax
	je	.L87
.L82:
	mov	DWORD PTR gCaughtHupSignal[rip], 0
	mov	eax, DWORD PTR gCaughtHupSignal[rip]
	mov	DWORD PTR gGracefulShutdown[rip], eax
	jmp	.L80
.L87:
	nop
	call	TidyUp
	mov	eax, 0
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L85
	call	__stack_chk_fail@PLT
.L85:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.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	"141098.c"
	.text
	.global	gGracefulShutdown
	.bss
	.align	2
	.type	gGracefulShutdown, %object
	.size	gGracefulShutdown, 4
gGracefulShutdown:
	.space	4
	.global	gMasterSocket
	.data
	.align	2
	.type	gMasterSocket, %object
	.size	gMasterSocket, 4
gMasterSocket:
	.word	-1
	.global	gCaughtHupSignal
	.bss
	.align	2
	.type	gCaughtHupSignal, %object
	.size	gCaughtHupSignal, 4
gCaughtHupSignal:
	.space	4
	.global	gListenPort
	.data
	.align	2
	.type	gListenPort, %object
	.size	gListenPort, 4
gListenPort:
	.word	10037
	.global	gLockFileDesk
	.align	2
	.type	gLockFileDesk, %object
	.size	gLockFileDesk, 4
gLockFileDesk:
	.word	-1
	.global	gLockFilePath
	.section	.rodata
	.align	2
.LC2:
	.ascii	"chat-daemon.pid\000"
	.align	2
	.type	gLockFilePath, %object
	.size	gLockFilePath, 4
gLockFilePath:
	.word	.LC2
	.align	2
.LC3:
	.ascii	"Error fork the process.\000"
	.align	2
.LC4:
	.ascii	"%d\000"
	.align	2
.LC5:
	.ascii	"Error creating the lock file.\000"
	.align	2
.LC6:
	.ascii	"Error locking the lock file.\000"
	.align	2
.LC7:
	.ascii	"Error writing to lock file.\000"
	.align	2
.LC8:
	.ascii	"Error changing the session ID.\000"
	.align	2
.LC9:
	.ascii	"/\000"
	.align	2
.LC10:
	.ascii	"Error changing the process folder.\000"
	.align	2
.LC11:
	.ascii	"/dev/null\000"
	.align	2
.LC12:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	BecomeDaemonProcess
	.syntax unified
	.arm
	.fpu softvfp
	.type	BecomeDaemonProcess, %function
BecomeDaemonProcess:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #68
	str	r0, [fp, #-72]
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-60]
	ldr	r3, [fp, #-60]
	cmn	r3, #1
	beq	.L2
	ldr	r3, [fp, #-60]
	cmp	r3, #0
	beq	.L17
	b	.L16
.L2:
	ldr	r0, .L18+4
	bl	puts
	mov	r0, #1
	bl	exit
.L16:
	mov	r0, #0
	bl	exit
.L17:
	nop
	bl	getpid
	mov	r2, r0
	sub	r3, fp, #28
	ldr	r1, .L18+8
	mov	r0, r3
	bl	sprintf
	mov	r2, #128
	mov	r1, #16
	ldr	r0, [fp, #-72]
	bl	openlog
	ldr	r3, .L18+12
	mov	r1, #420
	mov	r0, r3
	bl	creat
	mov	r3, r0
	lsr	r3, r3, #31
	and	r3, r3, #255
	mov	r2, r3
	ldr	r3, .L18+16
	str	r2, [r3]
	ldr	r3, .L18+16
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L6
	ldr	r0, .L18+20
	bl	puts
	mov	r0, #1
	bl	exit
.L6:
	mov	r3, #1
	strh	r3, [fp, #-44]	@ movhi
	mov	r3, #0
	strh	r3, [fp, #-42]	@ movhi
	mov	r3, #0
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-40]
	str	r3, [fp, #-36]
	mov	r3, #0
	str	r3, [fp, #-32]
	ldr	r3, .L18+16
	ldr	r3, [r3]
	sub	r2, fp, #44
	mov	r1, #6
	mov	r0, r3
	bl	fcntl
	str	r0, [fp, #-56]
	ldr	r3, [fp, #-56]
	cmp	r3, #0
	bge	.L7
	ldr	r0, .L18+24
	bl	puts
	mov	r0, #1
	bl	exit
.L7:
	ldr	r3, .L18+16
	ldr	r4, [r3]
	sub	r3, fp, #28
	mov	r0, r3
	bl	strlen
	mov	r2, r0
	sub	r3, fp, #28
	mov	r1, r3
	mov	r0, r4
	bl	write
	mov	r3, r0
	cmp	r3, #0
	bgt	.L8
	ldr	r0, .L18+28
	bl	puts
	mov	r0, #1
	bl	exit
.L8:
	bl	setsid
	mov	r3, r0
	cmp	r3, #0
	bge	.L9
	ldr	r0, .L18+32
	bl	puts
	mov	r0, #1
	bl	exit
.L9:
	ldr	r0, .L18+36
	bl	chdir
	mov	r3, r0
	cmp	r3, #0
	bge	.L10
	ldr	r0, .L18+40
	bl	puts
	mov	r0, #1
	bl	exit
.L10:
	mov	r0, #4
	bl	sysconf
	str	r0, [fp, #-52]
	ldr	r3, [fp, #-52]
	sub	r3, r3, #1
	str	r3, [fp, #-64]
	b	.L11
.L13:
	ldr	r3, .L18+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-64]
	cmp	r2, r3
	beq	.L12
	ldr	r0, [fp, #-64]
	bl	close
.L12:
	ldr	r3, [fp, #-64]
	sub	r3, r3, #1
	str	r3, [fp, #-64]
.L11:
	ldr	r3, [fp, #-64]
	cmp	r3, #0
	bge	.L13
	mov	r1, #2
	ldr	r0, .L18+44
	bl	open
	str	r0, [fp, #-48]
	ldr	r0, [fp, #-48]
	bl	dup
	ldr	r0, [fp, #-48]
	bl	dup
	mov	r3, #0
	ldr	r2, .L18
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L15
	bl	__stack_chk_fail
.L15:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L19:
	.align	2
.L18:
	.word	.LC12
	.word	.LC3
	.word	.LC4
	.word	.LC2
	.word	gLockFileDesk
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.size	BecomeDaemonProcess, .-BecomeDaemonProcess
	.align	2
	.global	TidyUp
	.syntax unified
	.arm
	.fpu softvfp
	.type	TidyUp, %function
TidyUp:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L24
	ldr	r3, [r3]
	cmn	r3, #1
	beq	.L21
	ldr	r3, .L24
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	ldr	r3, .L24+4
	mov	r0, r3
	bl	unlink
	ldr	r3, .L24
	mvn	r2, #0
	str	r2, [r3]
.L21:
	ldr	r3, .L24+8
	ldr	r3, [r3]
	cmn	r3, #1
	beq	.L23
	ldr	r3, .L24+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	ldr	r3, .L24+8
	mvn	r2, #0
	str	r2, [r3]
.L23:
	nop
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	gLockFileDesk
	.word	.LC2
	.word	gMasterSocket
	.size	TidyUp, .-TidyUp
	.align	2
	.global	Handler
	.syntax unified
	.arm
	.fpu softvfp
	.type	Handler, %function
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	r3, [fp, #-8]
	cmp	r3, #15
	beq	.L27
	ldr	r3, [fp, #-8]
	cmp	r3, #15
	bgt	.L28
	ldr	r3, [fp, #-8]
	cmp	r3, #1
	beq	.L29
	ldr	r3, [fp, #-8]
	cmp	r3, #10
	bne	.L28
	ldr	r3, .L31
	mov	r2, #1
	str	r2, [r3]
	b	.L30
.L29:
	ldr	r3, .L31+4
	mov	r2, #1
	str	r2, [r3]
	ldr	r3, .L31+4
	ldr	r3, [r3]
	ldr	r2, .L31
	str	r3, [r2]
	b	.L30
.L27:
	bl	TidyUp
	mov	r0, #0
	bl	exit
.L28:
	bl	TidyUp
	mov	r0, #0
	bl	exit
.L30:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L32:
	.align	2
.L31:
	.word	gGracefulShutdown
	.word	gCaughtHupSignal
	.size	Handler, .-Handler
	.section	.rodata
	.align	2
.LC0:
	.word	12
	.word	14
	.word	13
	.align	2
.LC1:
	.word	10
	.word	1
	.word	15
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	ConfigureSignalHandlers
	.syntax unified
	.arm
	.fpu softvfp
	.type	ConfigureSignalHandlers, %function
ConfigureSignalHandlers:
	@ args = 0, pretend = 0, frame = 304
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #304
	ldr	r3, .L40
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r2, .L40+4
	sub	r3, fp, #300
	ldm	r2, {r0, r1, r2}
	stm	r3, {r0, r1, r2}
	ldr	r2, .L40+8
	sub	r3, fp, #288
	ldm	r2, {r0, r1, r2}
	stm	r3, {r0, r1, r2}
	sub	r3, fp, #276
	mov	r0, r3
	bl	sigemptyset
	mov	r3, #0
	str	r3, [fp, #-308]
	b	.L34
.L35:
	ldr	r3, [fp, #-308]
	lsl	r3, r3, #2
	sub	r2, fp, #300
	add	r3, r2, r3
	ldr	r2, [r3]
	sub	r3, fp, #276
	mov	r1, r2
	mov	r0, r3
	bl	sigaddset
	ldr	r3, [fp, #-308]
	add	r3, r3, #1
	str	r3, [fp, #-308]
.L34:
	ldr	r3, [fp, #-308]
	cmp	r3, #6
	ble	.L35
	sub	r3, fp, #148
	add	r3, r3, #4
	mov	r0, r3
	bl	sigemptyset
	mov	r3, #0
	str	r3, [fp, #-16]
	ldr	r3, .L40+12
	str	r3, [fp, #-148]
	mov	r3, #0
	str	r3, [fp, #-304]
	b	.L36
.L37:
	ldr	r3, [fp, #-304]
	lsl	r3, r3, #2
	sub	r2, fp, #288
	add	r3, r2, r3
	ldr	r3, [r3]
	sub	r1, fp, #148
	mov	r2, #0
	mov	r0, r3
	bl	sigaction
	ldr	r3, [fp, #-304]
	add	r3, r3, #1
	str	r3, [fp, #-304]
.L36:
	ldr	r3, [fp, #-304]
	cmp	r3, #15
	ble	.L37
	mov	r3, #0
	ldr	r2, .L40
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L39
	bl	__stack_chk_fail
.L39:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L41:
	.align	2
.L40:
	.word	.LC13
	.word	.LC0
	.word	.LC1
	.word	Handler
	.size	ConfigureSignalHandlers, .-ConfigureSignalHandlers
	.section	.rodata
	.align	2
.LC14:
	.ascii	"Error creating socket!\000"
	.align	2
.LC15:
	.ascii	"Error binding socket!\000"
	.align	2
.LC16:
	.ascii	"Error listening on socket!\000"
	.align	2
.LC17:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	BindPassiveSocket
	.syntax unified
	.arm
	.fpu softvfp
	.type	BindPassiveSocket, %function
BindPassiveSocket:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	ldr	r3, .L49
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #24
	add	r3, r3, #8
	mov	r2, #8
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-22]	@ movhi
	mov	r3, #2
	strh	r3, [fp, #-24]	@ movhi
	mov	r0, #0
	bl	htonl
	mov	r3, r0
	str	r3, [fp, #-20]
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bge	.L43
	ldr	r0, .L49+4
	bl	puts
	mov	r3, #1
	b	.L47
.L43:
	mov	r3, #1
	str	r3, [fp, #-36]
	mov	r3, #4
	str	r3, [fp, #-28]
	sub	r2, fp, #36
	ldr	r3, [fp, #-28]
	str	r3, [sp]
	mov	r3, r2
	mov	r2, #2
	mov	r1, #1
	ldr	r0, [fp, #-32]
	bl	setsockopt
	sub	r3, fp, #24
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-32]
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	bge	.L45
	ldr	r0, .L49+8
	bl	puts
	mov	r3, #1
	b	.L47
.L45:
	mov	r1, #4096
	ldr	r0, [fp, #-32]
	bl	listen
	mov	r3, r0
	cmp	r3, #0
	bge	.L46
	ldr	r0, .L49+12
	bl	puts
	mov	r3, #1
	b	.L47
.L46:
	ldr	r3, [fp, #-44]
	ldr	r2, [fp, #-32]
	str	r2, [r3]
	mov	r3, #0
.L47:
	ldr	r2, .L49
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L48
	bl	__stack_chk_fail
.L48:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L50:
	.align	2
.L49:
	.word	.LC17
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.size	BindPassiveSocket, .-BindPassiveSocket
	.section	.rodata
	.align	2
.LC18:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	ReadLine
	.syntax unified
	.arm
	.fpu softvfp
	.type	ReadLine, %function
ReadLine:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	str	r2, [fp, #-40]
	str	r3, [fp, #-44]
	ldr	r3, .L64
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-20]
	mov	r3, #0
	strb	r3, [fp, #-25]
	mov	r3, #0
	str	r3, [fp, #-16]
.L59:
	sub	r1, fp, #26
	mov	r3, #0
	mov	r2, #1
	ldr	r0, [fp, #-32]
	bl	recv
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #1
	beq	.L52
	ldr	r3, [fp, #-12]
	cmp	r3, #1
	bgt	.L53
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	beq	.L54
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L55
	b	.L53
.L54:
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #4
	beq	.L62
	mvn	r3, #0
	str	r3, [fp, #-20]
	mov	r3, #1
	str	r3, [fp, #-24]
	b	.L62
.L55:
	mov	r3, #0
	str	r3, [fp, #-20]
	mov	r3, #1
	str	r3, [fp, #-24]
	b	.L53
.L52:
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	ldrb	r2, [fp, #-26]	@ zero_extendqisi2
	strb	r2, [r3]
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	str	r3, [fp, #-16]
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-40]
	cmp	r2, r3
	bcc	.L63
	mov	r3, #1
	str	r3, [fp, #-24]
	mvn	r3, #0
	str	r3, [fp, #-20]
	ldrb	r3, [fp, #-26]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L58
	ldrb	r3, [fp, #-25]	@ zero_extendqisi2
	cmp	r3, #13
	bne	.L58
	mov	r3, #1
	str	r3, [fp, #-24]
.L58:
	ldrb	r3, [fp, #-26]
	strb	r3, [fp, #-25]
	b	.L63
.L62:
	nop
	b	.L53
.L63:
	nop
.L53:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	beq	.L59
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-44]
	ldr	r2, [fp, #-16]
	str	r2, [r3]
	ldr	r3, [fp, #-20]
	ldr	r2, .L64
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L61
	bl	__stack_chk_fail
.L61:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L65:
	.align	2
.L64:
	.word	.LC18
	.size	ReadLine, .-ReadLine
	.align	2
	.global	WriteToSocket
	.syntax unified
	.arm
	.fpu softvfp
	.type	WriteToSocket, %function
WriteToSocket:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	mov	r3, #0
	str	r3, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-12]
.L70:
	ldr	r2, [fp, #-28]
	ldr	r3, [fp, #-20]
	add	r1, r2, r3
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-20]
	sub	r2, r2, r3
	mov	r3, #0
	ldr	r0, [fp, #-24]
	bl	send
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L67
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #4
	bne	.L68
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L69
.L68:
	mov	r3, #1
	str	r3, [fp, #-16]
	mov	r3, #1
	str	r3, [fp, #-12]
	b	.L69
.L67:
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L69
	mov	r3, #1
	str	r3, [fp, #-12]
.L69:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L70
	ldr	r3, [fp, #-16]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	WriteToSocket, .-WriteToSocket
	.section	.rodata
	.align	2
.LC19:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	HandleConnection
	.syntax unified
	.arm
	.fpu softvfp
	.type	HandleConnection, %function
HandleConnection:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	ldr	r3, .L76
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #24
	ldr	r2, [fp, #-16]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-32]
	bl	ReadLine
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L73
	ldr	r3, [fp, #-24]
	mov	r2, r3
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-32]
	bl	WriteToSocket
.L73:
	ldr	r3, [fp, #-12]
	ldr	r2, .L76
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L75
	bl	__stack_chk_fail
.L75:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L77:
	.align	2
.L76:
	.word	.LC19
	.size	HandleConnection, .-HandleConnection
	.section	.rodata
	.align	2
.LC20:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	AcceptConnections
	.syntax unified
	.arm
	.fpu softvfp
	.type	AcceptConnections, %function
AcceptConnections:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-48]
	ldr	r3, .L87
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #1
	str	r3, [fp, #-36]
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L79
.L84:
	mov	r3, #16
	str	r3, [fp, #-40]
	sub	r2, fp, #40
	sub	r3, fp, #24
	mov	r1, r3
	ldr	r0, [fp, #-48]
	bl	accept
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bge	.L80
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #4
	bne	.L81
	b	.L79
.L81:
	mov	r3, #0
	str	r3, [fp, #-36]
	mvn	r3, #0
	str	r3, [fp, #-32]
	b	.L82
.L80:
	ldr	r0, [fp, #-28]
	bl	HandleConnection
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	beq	.L82
	mov	r3, #0
	str	r3, [fp, #-36]
.L82:
	ldr	r0, [fp, #-28]
	bl	close
.L79:
	ldr	r3, [fp, #-36]
	cmp	r3, #1
	bne	.L83
	ldr	r3, .L87+4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L84
.L83:
	ldr	r3, [fp, #-32]
	ldr	r2, .L87
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L86
	bl	__stack_chk_fail
.L86:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L88:
	.align	2
.L87:
	.word	.LC20
	.word	gGracefulShutdown
	.size	AcceptConnections, .-AcceptConnections
	.section	.rodata
	.align	2
.LC21:
	.ascii	"Error opening lock file!\000"
	.align	2
.LC22:
	.ascii	"stop\000"
	.align	2
.LC23:
	.ascii	"restart\000"
	.align	2
.LC24:
	.ascii	"Usage: %s [stop|restart]\012\000"
	.align	2
.LC25:
	.ascii	"Daemonize Error.\000"
	.align	2
.LC26:
	.ascii	"Signal Handlers Error.\000"
	.align	2
.LC27:
	.ascii	"Socket Binding Error.\000"
	.align	2
.LC28:
	.ascii	"Connection Accept Error.\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 = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	ldr	r3, .L104
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-48]
	cmp	r3, #1
	ble	.L90
	ldr	r3, .L104+4
	mov	r1, #0
	mov	r0, r3
	bl	open
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	bge	.L91
	ldr	r0, .L104+8
	bl	puts
	mov	r0, #1
	bl	exit
.L91:
	sub	r3, fp, #24
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-36]
	bl	read
	str	r0, [fp, #-32]
	sub	r2, fp, #24
	ldr	r3, [fp, #-32]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	sub	r3, fp, #24
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L104+12
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L92
	mov	r1, #10
	ldr	r0, [fp, #-28]
	bl	kill
	mov	r0, #0
	bl	exit
.L92:
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L104+16
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L93
	mov	r1, #1
	ldr	r0, [fp, #-28]
	bl	kill
	mov	r0, #0
	bl	exit
.L93:
	ldr	r3, [fp, #-52]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L104+20
	bl	printf
	mov	r0, #1
	bl	exit
.L90:
	ldr	r3, [fp, #-52]
	ldr	r3, [r3]
	mov	r0, r3
	bl	BecomeDaemonProcess
	str	r0, [fp, #-40]
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	bge	.L94
	ldr	r0, .L104+24
	bl	puts
	mov	r0, #1
	bl	exit
.L94:
	bl	ConfigureSignalHandlers
	str	r0, [fp, #-40]
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	bge	.L95
	ldr	r0, .L104+28
	bl	puts
	mov	r0, #1
	bl	exit
.L95:
	ldr	r3, .L104+32
	ldr	r3, [r3]
	ldr	r1, .L104+36
	mov	r0, r3
	bl	BindPassiveSocket
	str	r0, [fp, #-40]
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	bge	.L96
	ldr	r0, .L104+40
	bl	puts
	mov	r0, #1
	bl	exit
.L96:
	ldr	r3, .L104+36
	ldr	r3, [r3]
	mov	r0, r3
	bl	AcceptConnections
	mov	r3, r0
	cmp	r3, #0
	bge	.L97
	ldr	r0, .L104+44
	bl	puts
	mov	r0, #1
	bl	exit
.L97:
	ldr	r3, .L104+48
	ldr	r3, [r3]
	cmp	r3, #1
	bne	.L98
	ldr	r3, .L104+52
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L103
.L98:
	ldr	r3, .L104+52
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, .L104+52
	ldr	r3, [r3]
	ldr	r2, .L104+48
	str	r3, [r2]
	b	.L96
.L103:
	nop
	bl	TidyUp
	mov	r3, #0
	ldr	r2, .L104
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L101
	bl	__stack_chk_fail
.L101:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L105:
	.align	2
.L104:
	.word	.LC29
	.word	.LC2
	.word	.LC21
	.word	.LC22
	.word	.LC23
	.word	.LC24
	.word	.LC25
	.word	.LC26
	.word	gListenPort
	.word	gMasterSocket
	.word	.LC27
	.word	.LC28
	.word	gGracefulShutdown
	.word	gCaughtHupSignal
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
