	.file	"339336.c"
	.intel_syntax noprefix
	.text
	.globl	sock_serv
	.bss
	.align 16
	.type	sock_serv, @object
	.size	sock_serv, 16
sock_serv:
	.zero	16
	.globl	sock_clt
	.align 16
	.type	sock_clt, @object
	.size	sock_clt, 16
sock_clt:
	.zero	16
	.section	.rodata
	.align 8
.LC0:
	.string	"utilisation ./a.out <num_port> <file2send>\n"
.LC1:
	.string	"accept fail"
.LC2:
	.string	"socket connection error"
.LC3:
	.string	"client IP and port : %s:%d\n"
.LC4:
	.string	"clt_%d_%d_%d_%d_%d_%d.jpg"
	.align 8
.LC5:
	.string	"Creating the copied output file : %s\n"
.LC6:
	.string	"open fail"
.LC7:
	.string	"recv fail"
.LC8:
	.string	"write fail"
	.align 8
.LC9:
	.string	"receved a file (%ld) Bytes from %s:%d\n"
	.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, 880
	mov	DWORD PTR -868[rbp], edi
	mov	QWORD PTR -880[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -856[rbp], 16
	mov	QWORD PTR -824[rbp], 0
	cmp	DWORD PTR -868[rbp], 2
	je	.L2
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 3
	call	exit@PLT
.L2:
	mov	rax, QWORD PTR -880[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	edi, eax
	call	create_server_socket
	mov	DWORD PTR -852[rbp], eax
	lea	rax, -528[rbp]
	mov	rsi, rax
	mov	eax, 0
	mov	edx, 64
	mov	rdi, rsi
	mov	rcx, rdx
	rep stosq
	mov	eax, DWORD PTR -852[rbp]
	mov	esi, 1
	mov	edi, eax
	call	listen@PLT
.L11:
	lea	rdx, -856[rbp]
	mov	eax, DWORD PTR -852[rbp]
	lea	rsi, sock_clt[rip]
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -848[rbp], eax
	cmp	DWORD PTR -848[rbp], -1
	jne	.L3
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L12
.L3:
	lea	rax, -800[rbp]
	mov	ecx, 16
	mov	rdx, rax
	lea	rsi, sock_clt[rip+4]
	mov	edi, 2
	call	inet_ntop@PLT
	test	rax, rax
	jne	.L5
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 4
	call	exit@PLT
.L5:
	movzx	eax, WORD PTR sock_clt[rip+2]
	movzx	eax, ax
	mov	edi, eax
	call	ntohs@PLT
	mov	WORD PTR -858[rbp], ax
	movzx	edx, WORD PTR -858[rbp]
	lea	rax, -800[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -784[rbp]
	mov	rsi, rax
	mov	eax, 0
	mov	edx, 32
	mov	rdi, rsi
	mov	rcx, rdx
	rep stosq
	mov	edi, 0
	call	time@PLT
	mov	QWORD PTR -840[rbp], rax
	lea	rax, -840[rbp]
	mov	rdi, rax
	call	localtime@PLT
	mov	QWORD PTR -816[rbp], rax
	lea	rax, -784[rbp]
	mov	rsi, rax
	mov	eax, 0
	mov	edx, 32
	mov	rdi, rsi
	mov	rcx, rdx
	rep stosq
	mov	rax, QWORD PTR -816[rbp]
	mov	edi, DWORD PTR [rax]
	mov	rax, QWORD PTR -816[rbp]
	mov	esi, DWORD PTR 4[rax]
	mov	rax, QWORD PTR -816[rbp]
	mov	r8d, DWORD PTR 8[rax]
	mov	rax, QWORD PTR -816[rbp]
	mov	eax, DWORD PTR 20[rax]
	lea	r10d, 1900[rax]
	mov	rax, QWORD PTR -816[rbp]
	mov	eax, DWORD PTR 16[rax]
	lea	ecx, 1[rax]
	mov	rax, QWORD PTR -816[rbp]
	mov	edx, DWORD PTR 12[rax]
	lea	rax, -784[rbp]
	push	rdi
	push	rsi
	mov	r9d, r8d
	mov	r8d, r10d
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	add	rsp, 16
	lea	rax, -784[rbp]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	QWORD PTR -824[rbp], 0
	lea	rax, -784[rbp]
	mov	edx, 384
	mov	esi, 65
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -844[rbp], eax
	cmp	DWORD PTR -844[rbp], -1
	jne	.L6
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	edi, 3
	call	exit@PLT
.L6:
	lea	rax, -528[rbp]
	mov	rsi, rax
	mov	eax, 0
	mov	edx, 64
	mov	rdi, rsi
	mov	rcx, rdx
	rep stosq
	mov	eax, DWORD PTR -848[rbp]
	lea	rsi, -528[rbp]
	mov	ecx, 0
	mov	edx, 512
	mov	edi, eax
	call	recv@PLT
	mov	QWORD PTR -832[rbp], rax
	jmp	.L7
.L10:
	cmp	QWORD PTR -832[rbp], -1
	jne	.L8
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	edi, 5
	call	exit@PLT
.L8:
	mov	rdx, QWORD PTR -832[rbp]
	lea	rcx, -528[rbp]
	mov	eax, DWORD PTR -844[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	QWORD PTR -808[rbp], rax
	cmp	QWORD PTR -808[rbp], -1
	jne	.L9
	lea	rdi, .LC8[rip]
	call	perror@PLT
	mov	edi, 6
	call	exit@PLT
.L9:
	mov	rax, QWORD PTR -808[rbp]
	add	QWORD PTR -824[rbp], rax
	lea	rax, -528[rbp]
	mov	rsi, rax
	mov	eax, 0
	mov	edx, 64
	mov	rdi, rsi
	mov	rcx, rdx
	rep stosq
	mov	eax, DWORD PTR -848[rbp]
	lea	rsi, -528[rbp]
	mov	ecx, 0
	mov	edx, 512
	mov	edi, eax
	call	recv@PLT
	mov	QWORD PTR -832[rbp], rax
.L7:
	cmp	QWORD PTR -832[rbp], 0
	jne	.L10
	mov	eax, DWORD PTR -844[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -848[rbp]
	mov	edi, eax
	call	close@PLT
	movzx	ecx, WORD PTR -858[rbp]
	lea	rdx, -800[rbp]
	mov	rax, QWORD PTR -824[rbp]
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	cmp	DWORD PTR -852[rbp], 0
	jg	.L11
	mov	eax, 0
.L12:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC10:
	.string	"socket fail"
.LC11:
	.string	"setsockopt erreur"
.LC12:
	.string	"bind fail"
	.text
	.globl	create_server_socket
	.type	create_server_socket, @function
create_server_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, 48
	mov	DWORD PTR -36[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -24[rbp], 1
	mov	DWORD PTR -20[rbp], 0
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -16[rbp], eax
	cmp	DWORD PTR -16[rbp], -1
	jne	.L15
	lea	rdi, .LC10[rip]
	call	perror@PLT
	mov	eax, 0
	jmp	.L19
.L15:
	lea	rdx, -24[rbp]
	mov	eax, DWORD PTR -16[rbp]
	mov	r8d, 4
	mov	rcx, rdx
	mov	edx, 2
	mov	esi, 1
	mov	edi, eax
	call	setsockopt@PLT
	cmp	eax, -1
	jne	.L17
	lea	rdi, .LC11[rip]
	call	perror@PLT
	mov	edi, 5
	call	exit@PLT
.L17:
	mov	DWORD PTR -20[rbp], 1
	lea	rdx, -20[rbp]
	mov	eax, DWORD PTR -16[rbp]
	mov	r8d, 4
	mov	rcx, rdx
	mov	edx, 19
	mov	esi, 0
	mov	edi, eax
	call	setsockopt@PLT
	mov	DWORD PTR -12[rbp], 16
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	lea	rax, sock_serv[rip]
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	WORD PTR sock_serv[rip], 2
	mov	eax, DWORD PTR -36[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR sock_serv[rip+2], ax
	mov	edi, 0
	call	htonl@PLT
	mov	DWORD PTR sock_serv[rip+4], eax
	mov	edx, DWORD PTR -12[rbp]
	mov	eax, DWORD PTR -16[rbp]
	lea	rsi, sock_serv[rip]
	mov	edi, eax
	call	bind@PLT
	cmp	eax, -1
	jne	.L18
	lea	rdi, .LC12[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L19
.L18:
	mov	eax, DWORD PTR -16[rbp]
.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
.LFE7:
	.size	create_server_socket, .-create_server_socket
	.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	"339336.c"
	.text
	.comm	sock_serv,16,4
	.comm	sock_clt,16,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"utilisation ./a.out <num_port> <file2send>\012\000"
	.align	2
.LC1:
	.ascii	"accept fail\000"
	.align	2
.LC2:
	.ascii	"socket connection error\000"
	.align	2
.LC3:
	.ascii	"client IP and port : %s:%d\012\000"
	.align	2
.LC4:
	.ascii	"clt_%d_%d_%d_%d_%d_%d.jpg\000"
	.align	2
.LC5:
	.ascii	"Creating the copied output file : %s\012\000"
	.align	2
.LC6:
	.ascii	"open fail\000"
	.align	2
.LC7:
	.ascii	"recv fail\000"
	.align	2
.LC8:
	.ascii	"write fail\000"
	.align	2
.LC9:
	.ascii	"receved a file (%ld) Bytes from %s:%d\012\000"
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 840
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #860
	str	r0, [fp, #-848]
	str	r1, [fp, #-852]
	ldr	r3, .L14
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #16
	str	r3, [fp, #-836]
	mov	r3, #0
	str	r3, [fp, #-824]
	ldr	r3, [fp, #-848]
	cmp	r3, #2
	beq	.L2
	ldr	r0, .L14+4
	bl	perror
	mov	r0, #3
	bl	exit
.L2:
	ldr	r3, [fp, #-852]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	mov	r0, r3
	bl	create_server_socket
	str	r0, [fp, #-820]
	sub	r3, fp, #528
	mov	r0, r3
	mov	r3, #512
	mov	r2, r3
	mov	r1, #0
	bl	memset
	mov	r1, #1
	ldr	r0, [fp, #-820]
	bl	listen
.L11:
	sub	r3, fp, #836
	mov	r2, r3
	ldr	r1, .L14+8
	ldr	r0, [fp, #-820]
	bl	accept
	mov	r3, r0
	str	r3, [fp, #-816]
	ldr	r3, [fp, #-816]
	cmn	r3, #1
	bne	.L3
	ldr	r0, .L14+12
	bl	perror
	mov	r3, #1
	b	.L12
.L3:
	sub	r2, fp, #800
	mov	r3, #16
	ldr	r1, .L14+16
	mov	r0, #2
	bl	inet_ntop
	mov	r3, r0
	cmp	r3, #0
	bne	.L5
	ldr	r0, .L14+20
	bl	perror
	mov	r0, #4
	bl	exit
.L5:
	ldr	r3, .L14+8
	ldrh	r3, [r3, #2]
	sub	r2, fp, #12
	sub	r4, r2, #824
	sub	r4, r4, #2
	mov	r0, r3
	bl	ntohs
	mov	r3, r0
	strh	r3, [r4]	@ movhi
	sub	r3, fp, #12
	sub	r3, r3, #824
	sub	r3, r3, #2
	ldrh	r2, [r3]
	sub	r3, fp, #800
	mov	r1, r3
	ldr	r0, .L14+24
	bl	printf
	sub	r3, fp, #784
	mov	r0, r3
	mov	r3, #256
	mov	r2, r3
	mov	r1, #0
	bl	memset
	mov	r0, #0
	bl	time
	mov	r3, r0
	str	r3, [fp, #-832]
	sub	r3, fp, #832
	mov	r0, r3
	bl	localtime
	str	r0, [fp, #-812]
	sub	r3, fp, #784
	mov	r0, r3
	mov	r3, #256
	mov	r2, r3
	mov	r1, #0
	bl	memset
	ldr	r3, [fp, #-812]
	ldr	lr, [r3, #12]
	ldr	r3, [fp, #-812]
	ldr	r3, [r3, #16]
	add	r4, r3, #1
	ldr	r3, [fp, #-812]
	ldr	r3, [r3, #20]
	add	r3, r3, #1888
	add	r3, r3, #12
	ldr	r2, [fp, #-812]
	ldr	r2, [r2, #8]
	ldr	r1, [fp, #-812]
	ldr	r1, [r1, #4]
	ldr	r0, [fp, #-812]
	ldr	r0, [r0]
	sub	ip, fp, #784
	str	r0, [sp, #12]
	str	r1, [sp, #8]
	str	r2, [sp, #4]
	str	r3, [sp]
	mov	r3, r4
	mov	r2, lr
	ldr	r1, .L14+28
	mov	r0, ip
	bl	sprintf
	sub	r3, fp, #784
	mov	r1, r3
	ldr	r0, .L14+32
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-824]
	sub	r3, fp, #784
	mov	r2, #384
	mov	r1, #65
	mov	r0, r3
	bl	open
	str	r0, [fp, #-808]
	ldr	r3, [fp, #-808]
	cmn	r3, #1
	bne	.L6
	ldr	r0, .L14+36
	bl	perror
	mov	r0, #3
	bl	exit
.L6:
	sub	r3, fp, #528
	mov	r0, r3
	mov	r3, #512
	mov	r2, r3
	mov	r1, #0
	bl	memset
	ldr	r0, [fp, #-816]
	sub	r1, fp, #528
	mov	r3, #0
	mov	r2, #512
	bl	recv
	str	r0, [fp, #-828]
	b	.L7
.L10:
	ldr	r3, [fp, #-828]
	cmn	r3, #1
	bne	.L8
	ldr	r0, .L14+40
	bl	perror
	mov	r0, #5
	bl	exit
.L8:
	ldr	r2, [fp, #-828]
	sub	r3, fp, #528
	mov	r1, r3
	ldr	r0, [fp, #-808]
	bl	write
	str	r0, [fp, #-804]
	ldr	r3, [fp, #-804]
	cmn	r3, #1
	bne	.L9
	ldr	r0, .L14+44
	bl	perror
	mov	r0, #6
	bl	exit
.L9:
	ldr	r2, [fp, #-824]
	ldr	r3, [fp, #-804]
	add	r3, r2, r3
	str	r3, [fp, #-824]
	sub	r3, fp, #528
	mov	r0, r3
	mov	r3, #512
	mov	r2, r3
	mov	r1, #0
	bl	memset
	ldr	r0, [fp, #-816]
	sub	r1, fp, #528
	mov	r3, #0
	mov	r2, #512
	bl	recv
	str	r0, [fp, #-828]
.L7:
	ldr	r3, [fp, #-828]
	cmp	r3, #0
	bne	.L10
	ldr	r0, [fp, #-808]
	bl	close
	ldr	r3, [fp, #-816]
	mov	r0, r3
	bl	close
	sub	r3, fp, #12
	sub	r3, r3, #824
	sub	r3, r3, #2
	ldrh	r3, [r3]
	sub	r2, fp, #800
	ldr	r1, [fp, #-824]
	ldr	r0, .L14+48
	bl	printf
	ldr	r3, [fp, #-820]
	cmp	r3, #0
	bgt	.L11
	mov	r3, #0
.L12:
	ldr	r2, .L14
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L13
	bl	__stack_chk_fail
.L13:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L15:
	.align	2
.L14:
	.word	.LC10
	.word	.LC0
	.word	sock_clt
	.word	.LC1
	.word	sock_clt+4
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.size	main, .-main
	.section	.rodata
	.align	2
.LC11:
	.ascii	"socket fail\000"
	.align	2
.LC12:
	.ascii	"setsockopt erreur\000"
	.align	2
.LC13:
	.ascii	"bind fail\000"
	.align	2
.LC14:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	create_server_socket
	.syntax unified
	.arm
	.fpu softvfp
	.type	create_server_socket, %function
create_server_socket:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-32]
	ldr	r3, .L23
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #1
	str	r3, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-20]
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	bne	.L17
	ldr	r0, .L23+4
	bl	perror
	mov	r3, #0
	b	.L21
.L17:
	sub	r3, fp, #24
	mov	r2, #4
	str	r2, [sp]
	mov	r2, #2
	mov	r1, #1
	ldr	r0, [fp, #-16]
	bl	setsockopt
	mov	r3, r0
	cmn	r3, #1
	bne	.L19
	ldr	r0, .L23+8
	bl	perror
	mov	r0, #5
	bl	exit
.L19:
	mov	r3, #1
	str	r3, [fp, #-20]
	sub	r3, fp, #20
	mov	r2, #4
	str	r2, [sp]
	mov	r2, #19
	mov	r1, #0
	ldr	r0, [fp, #-16]
	bl	setsockopt
	mov	r3, #16
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	ldr	r2, .L23+12
	mov	r0, r2
	mov	r2, r3
	mov	r1, #0
	bl	memset
	ldr	r3, .L23+12
	mov	r2, #2
	strh	r2, [r3]	@ movhi
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L23+12
	strh	r2, [r3, #2]	@ movhi
	mov	r0, #0
	bl	htonl
	mov	r3, r0
	ldr	r2, .L23+12
	str	r3, [r2, #4]
	ldr	r3, [fp, #-12]
	mov	r2, r3
	ldr	r1, .L23+12
	ldr	r0, [fp, #-16]
	bl	bind
	mov	r3, r0
	cmn	r3, #1
	bne	.L20
	ldr	r0, .L23+16
	bl	perror
	mov	r3, #1
	b	.L21
.L20:
	ldr	r3, [fp, #-16]
.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	.LC11
	.word	.LC12
	.word	sock_serv
	.word	.LC13
	.size	create_server_socket, .-create_server_socket
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
