	.file	"48400.c"
	.intel_syntax noprefix
	.text
	.globl	lock
	.bss
	.align 32
	.type	lock, @object
	.size	lock, 40
lock:
	.zero	40
	.section	.rodata
.LC0:
	.string	"Handling connection request"
.LC1:
	.string	"File name is %s :  "
.LC2:
	.string	"\nopened file"
.LC3:
	.string	"error in reading socket data!"
.LC4:
	.string	"file modification completed "
	.text
	.globl	process
	.type	process, @function
process:
.LFB36:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 272
	mov	QWORD PTR -264[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -232[rbp], 0
	cmp	QWORD PTR -264[rbp], 0
	jne	.L2
	mov	edi, 0
	call	pthread_exit@PLT
.L2:
	mov	rax, QWORD PTR -264[rbp]
	mov	QWORD PTR -224[rbp], rax
	mov	rax, QWORD PTR -224[rbp]
	add	rax, 4
	mov	eax, DWORD PTR 4[rax]
	mov	eax, eax
	mov	QWORD PTR -232[rbp], rax
	mov	edi, 128
	call	malloc@PLT
	mov	QWORD PTR -216[rbp], rax
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -224[rbp]
	mov	eax, DWORD PTR [rax]
	lea	rsi, -64[rbp]
	mov	ecx, 0
	mov	edx, 50
	mov	edi, eax
	call	recv@PLT
	lea	rax, -64[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, lock[rip]
	call	pthread_mutex_lock@PLT
	lea	rax, -64[rbp]
	mov	edx, 448
	mov	esi, 65
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -240[rbp], eax
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -224[rbp]
	mov	eax, DWORD PTR [rax]
	mov	rcx, QWORD PTR -216[rbp]
	mov	edx, 128
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -236[rbp], eax
	cmp	DWORD PTR -236[rbp], 0
	jns	.L3
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	edi, 1
	call	pthread_exit@PLT
.L3:
	mov	DWORD PTR -244[rbp], 0
	jmp	.L4
.L6:
	add	DWORD PTR -244[rbp], 1
.L4:
	mov	eax, DWORD PTR -244[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -216[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	test	al, al
	je	.L5
	cmp	DWORD PTR -244[rbp], 126
	jle	.L6
.L5:
	mov	eax, DWORD PTR -244[rbp]
	lea	edx, -1[rax]
	mov	DWORD PTR -244[rbp], edx
	movsx	rdx, eax
	mov	rcx, QWORD PTR -216[rbp]
	mov	eax, DWORD PTR -240[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	eax, DWORD PTR -240[rbp]
	mov	edi, eax
	call	close@PLT
	lea	rdi, .LC4[rip]
	call	puts@PLT
	lea	rdi, lock[rip]
	call	pthread_mutex_unlock@PLT
	mov	rax, QWORD PTR -224[rbp]
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -224[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -216[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE36:
	.size	process, .-process
	.section	.rodata
.LC5:
	.string	"\n mutex init has failed"
.LC6:
	.string	"usage: %s port\n"
.LC7:
	.string	"%d"
	.align 8
.LC8:
	.string	"%s: error: wrong parameter: port\n"
	.align 8
.LC9:
	.string	"%s: error: cannot create socket\n"
	.align 8
.LC10:
	.string	"%s: error: cannot bind socket to port %d\n"
	.align 8
.LC11:
	.string	"%s: error: cannot listen on port\n"
.LC12:
	.string	"%s: ready and listening\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB37:
	.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 -68[rbp], edi
	mov	QWORD PTR -80[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -52[rbp], -1
	mov	esi, 0
	lea	rdi, lock[rip]
	call	pthread_mutex_init@PLT
	test	eax, eax
	je	.L9
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L19
.L9:
	cmp	DWORD PTR -68[rbp], 2
	je	.L11
	mov	rax, QWORD PTR -80[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, -1
	jmp	.L19
.L11:
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rdx, -56[rbp]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_sscanf@PLT
	test	eax, eax
	jg	.L12
	mov	rax, QWORD PTR -80[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, -2
	jmp	.L19
.L12:
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], 0
	jg	.L13
	mov	rax, QWORD PTR -80[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, -3
	jmp	.L19
.L13:
	mov	WORD PTR -32[rbp], 2
	mov	eax, DWORD PTR -56[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -30[rbp], ax
	mov	DWORD PTR -28[rbp], 0
	lea	rcx, -32[rbp]
	mov	eax, DWORD PTR -52[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	jns	.L14
	mov	ecx, DWORD PTR -56[rbp]
	mov	rax, QWORD PTR -80[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC10[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, -4
	jmp	.L19
.L14:
	mov	eax, DWORD PTR -52[rbp]
	mov	esi, 10
	mov	edi, eax
	call	listen@PLT
	test	eax, eax
	jns	.L15
	mov	rax, QWORD PTR -80[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC11[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, -5
	jmp	.L19
.L15:
	mov	rax, QWORD PTR -80[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
.L18:
	mov	edi, 24
	call	malloc@PLT
	mov	QWORD PTR -40[rbp], rax
	mov	rax, QWORD PTR -40[rbp]
	lea	rdx, 20[rax]
	mov	rax, QWORD PTR -40[rbp]
	lea	rcx, 4[rax]
	mov	eax, DWORD PTR -52[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	rdx, QWORD PTR -40[rbp]
	mov	DWORD PTR [rdx], eax
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jg	.L16
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	free@PLT
	jmp	.L18
.L16:
	mov	rdx, QWORD PTR -40[rbp]
	lea	rax, -48[rbp]
	mov	rcx, rdx
	lea	rdx, process[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	pthread_detach@PLT
	jmp	.L18
.L19:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE37:
	.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	"48400.c"
	.text
	.comm	lock,24,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Handling connection request\000"
	.align	2
.LC1:
	.ascii	"File name is %s :  \000"
	.align	2
.LC2:
	.ascii	"\012opened file\000"
	.align	2
.LC3:
	.ascii	"error in reading socket data!\000"
	.align	2
.LC4:
	.ascii	"file modification completed \000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	process
	.syntax unified
	.arm
	.fpu softvfp
	.type	process, %function
process:
	@ args = 0, pretend = 0, frame = 176
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #176
	str	r0, [fp, #-176]
	ldr	r3, .L8
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-168]
	ldr	r3, [fp, #-176]
	cmp	r3, #0
	bne	.L2
	mov	r0, #0
	bl	pthread_exit
.L2:
	ldr	r3, [fp, #-176]
	str	r3, [fp, #-164]
	ldr	r3, [fp, #-164]
	add	r3, r3, #4
	ldr	r3, [r3, #4]
	str	r3, [fp, #-168]
	mov	r0, #128
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-160]
	ldr	r0, .L8+4
	bl	puts
	ldr	r3, [fp, #-164]
	ldr	r0, [r3]
	sub	r1, fp, #60
	mov	r3, #0
	mov	r2, #50
	bl	recv
	sub	r3, fp, #60
	mov	r1, r3
	ldr	r0, .L8+8
	bl	printf
	ldr	r0, .L8+12
	bl	pthread_mutex_lock
	sub	r3, fp, #60
	mov	r2, #448
	mov	r1, #65
	mov	r0, r3
	bl	open
	str	r0, [fp, #-156]
	ldr	r0, .L8+16
	bl	puts
	ldr	r3, [fp, #-164]
	ldr	r3, [r3]
	mov	r2, #128
	ldr	r1, [fp, #-160]
	mov	r0, r3
	bl	read
	str	r0, [fp, #-152]
	ldr	r3, [fp, #-152]
	cmp	r3, #0
	bge	.L3
	ldr	r0, .L8+20
	bl	puts
	mov	r0, #1
	bl	pthread_exit
.L3:
	mov	r3, #0
	str	r3, [fp, #-172]
	b	.L4
.L6:
	ldr	r3, [fp, #-172]
	add	r3, r3, #1
	str	r3, [fp, #-172]
.L4:
	ldr	r3, [fp, #-172]
	ldr	r2, [fp, #-160]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L5
	ldr	r3, [fp, #-172]
	cmp	r3, #126
	ble	.L6
.L5:
	ldr	r3, [fp, #-172]
	sub	r2, r3, #1
	str	r2, [fp, #-172]
	mov	r2, r3
	ldr	r1, [fp, #-160]
	ldr	r0, [fp, #-156]
	bl	write
	ldr	r0, [fp, #-156]
	bl	close
	ldr	r0, .L8+24
	bl	puts
	ldr	r0, .L8+12
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-164]
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	ldr	r0, [fp, #-164]
	bl	free
	ldr	r0, [fp, #-160]
	bl	free
	mov	r0, #0
	bl	pthread_exit
.L9:
	.align	2
.L8:
	.word	.LC5
	.word	.LC0
	.word	.LC1
	.word	lock
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	process, .-process
	.section	.rodata
	.align	2
.LC6:
	.ascii	"\012 mutex init has failed\000"
	.align	2
.LC7:
	.ascii	"usage: %s port\012\000"
	.align	2
.LC8:
	.ascii	"%d\000"
	.align	2
.LC9:
	.ascii	"%s: error: wrong parameter: port\012\000"
	.align	2
.LC10:
	.ascii	"%s: error: cannot create socket\012\000"
	.align	2
.LC11:
	.ascii	"%s: error: cannot bind socket to port %d\012\000"
	.align	2
.LC12:
	.ascii	"%s: error: cannot listen on port\012\000"
	.align	2
.LC13:
	.ascii	"%s: ready and listening\012\000"
	.align	2
.LC14:
	.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, .L23
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mvn	r3, #0
	str	r3, [fp, #-32]
	mov	r1, #0
	ldr	r0, .L23+4
	bl	pthread_mutex_init
	mov	r3, r0
	cmp	r3, #0
	beq	.L11
	ldr	r0, .L23+8
	bl	puts
	mov	r3, #1
	b	.L21
.L11:
	ldr	r3, [fp, #-48]
	cmp	r3, #2
	beq	.L13
	ldr	r3, .L23+12
	ldr	r0, [r3]
	ldr	r3, [fp, #-52]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L23+16
	bl	fprintf
	mvn	r3, #0
	b	.L21
.L13:
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	ldr	r3, [r3]
	sub	r2, fp, #40
	ldr	r1, .L23+20
	mov	r0, r3
	bl	__isoc99_sscanf
	mov	r3, r0
	cmp	r3, #0
	bgt	.L14
	ldr	r3, .L23+12
	ldr	r0, [r3]
	ldr	r3, [fp, #-52]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L23+24
	bl	fprintf
	mvn	r3, #1
	b	.L21
.L14:
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bgt	.L15
	ldr	r3, .L23+12
	ldr	r0, [r3]
	ldr	r3, [fp, #-52]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L23+28
	bl	fprintf
	mvn	r3, #2
	b	.L21
.L15:
	mov	r3, #2
	strh	r3, [fp, #-24]	@ movhi
	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, #0
	str	r3, [fp, #-20]
	sub	r3, fp, #24
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-32]
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	bge	.L16
	ldr	r3, .L23+12
	ldr	r0, [r3]
	ldr	r3, [fp, #-52]
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	ldr	r1, .L23+32
	bl	fprintf
	mvn	r3, #3
	b	.L21
.L16:
	mov	r1, #10
	ldr	r0, [fp, #-32]
	bl	listen
	mov	r3, r0
	cmp	r3, #0
	bge	.L17
	ldr	r3, .L23+12
	ldr	r0, [r3]
	ldr	r3, [fp, #-52]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L23+36
	bl	fprintf
	mvn	r3, #4
	b	.L21
.L17:
	ldr	r3, [fp, #-52]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L23+40
	bl	printf
.L20:
	mov	r0, #24
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-28]
	add	r1, r3, #4
	ldr	r3, [fp, #-28]
	add	r3, r3, #20
	mov	r2, r3
	ldr	r0, [fp, #-32]
	bl	accept
	mov	r2, r0
	ldr	r3, [fp, #-28]
	str	r2, [r3]
	ldr	r3, [fp, #-28]
	ldr	r3, [r3]
	cmp	r3, #0
	bgt	.L18
	ldr	r0, [fp, #-28]
	bl	free
	b	.L20
.L18:
	sub	r0, fp, #36
	ldr	r3, [fp, #-28]
	ldr	r2, .L23+44
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-36]
	mov	r0, r3
	bl	pthread_detach
	b	.L20
.L21:
	ldr	r2, .L23
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L22
	bl	__stack_chk_fail
.L22:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	.LC14
	.word	lock
	.word	.LC6
	.word	stderr
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	process
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
