	.file	"9512400.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"hb:n:p:"
	.section	.data.rel.local,"aw"
	.align 8
	.type	short_options, @object
	.size	short_options, 8
short_options:
	.quad	.LC0
	.section	.rodata
.LC1:
	.string	"help"
.LC2:
	.string	"port"
.LC3:
	.string	"bind"
.LC4:
	.string	"num"
	.section	.data.rel.ro.local,"aw"
	.align 32
	.type	long_options, @object
	.size	long_options, 128
long_options:
	.quad	.LC1
	.long	0
	.zero	4
	.quad	0
	.long	104
	.zero	4
	.quad	.LC2
	.long	1
	.zero	4
	.quad	0
	.long	112
	.zero	4
	.quad	.LC3
	.long	1
	.zero	4
	.quad	0
	.long	98
	.zero	4
	.quad	.LC4
	.long	1
	.zero	4
	.quad	0
	.long	110
	.zero	4
	.section	.rodata
	.align 8
.LC5:
	.string	"--Simple TCP Server--\n\n        To play with socket programming\n\nOptions:\n\n -h|--help\t\tDisplay help\n -p|--port\t\tPort to listen on\n -n|--num\t\tListen for number of connections\n -b|--bind\t\tAddress to listen on (def: all)\n"
	.text
	.globl	usage
	.type	usage, @function
usage:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, .LC5[rip]
	call	puts@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	usage, .-usage
	.section	.rodata
	.align 8
.LC6:
	.string	"No options given, try ``--help''\n"
.LC7:
	.string	"PID: %d"
.LC8:
	.string	"ERROR: creating socket"
.LC9:
	.string	"ERROR: binding to socket"
.LC10:
	.string	"ERROR: accepting on socket"
.LC11:
	.string	"ERROR: sending on socket"
.LC12:
	.string	"Sent %d bytes to client %s"
	.text
	.globl	main
	.type	main, @function
main:
.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, 112
	mov	DWORD PTR -100[rbp], edi
	mov	QWORD PTR -112[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -72[rbp], 1
	mov	DWORD PTR -68[rbp], 1
	mov	DWORD PTR -13[rbp], 1953719636
	mov	BYTE PTR -9[rbp], 0
	jmp	.L3
.L8:
	cmp	DWORD PTR -64[rbp], 112
	je	.L4
	cmp	DWORD PTR -64[rbp], 112
	jg	.L5
	cmp	DWORD PTR -64[rbp], 110
	je	.L6
	cmp	DWORD PTR -64[rbp], 110
	jg	.L5
	cmp	DWORD PTR -64[rbp], 98
	je	.L7
	cmp	DWORD PTR -64[rbp], 104
	jne	.L5
	call	usage
	mov	edi, 0
	call	exit@PLT
.L7:
	mov	DWORD PTR -72[rbp], 0
	mov	rax, QWORD PTR optarg[rip]
	mov	DWORD PTR -80[rbp], eax
	jmp	.L3
.L6:
	mov	rax, QWORD PTR optarg[rip]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -68[rbp], eax
	jmp	.L3
.L4:
	mov	rax, QWORD PTR optarg[rip]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -76[rbp], eax
	jmp	.L3
.L5:
	call	usage
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	rdx, QWORD PTR short_options[rip]
	lea	rcx, -84[rbp]
	mov	rsi, QWORD PTR -112[rbp]
	mov	eax, DWORD PTR -100[rbp]
	mov	r8, rcx
	lea	rcx, long_options[rip]
	mov	edi, eax
	call	getopt_long@PLT
	mov	DWORD PTR -64[rbp], eax
	cmp	DWORD PTR -64[rbp], -1
	jne	.L8
	cmp	DWORD PTR -100[rbp], 1
	jg	.L9
	mov	eax, DWORD PTR -100[rbp]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L9:
	call	getpid@PLT
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -60[rbp], eax
	cmp	DWORD PTR -60[rbp], -1
	jne	.L10
	lea	rdi, .LC8[rip]
	call	perror@PLT
	mov	edi, -1
	call	exit@PLT
.L10:
	mov	WORD PTR -48[rbp], 2
	mov	eax, DWORD PTR -76[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -46[rbp], ax
	mov	eax, DWORD PTR -80[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	movzx	eax, ax
	mov	DWORD PTR -44[rbp], eax
	lea	rax, -48[rbp]
	add	rax, 8
	mov	QWORD PTR [rax], 0
	cmp	DWORD PTR -72[rbp], 1
	jne	.L11
	mov	DWORD PTR -44[rbp], 0
	jmp	.L12
.L11:
	mov	eax, DWORD PTR -80[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	movzx	eax, ax
	mov	DWORD PTR -44[rbp], eax
.L12:
	mov	DWORD PTR -88[rbp], 16
	mov	eax, DWORD PTR -88[rbp]
	mov	edx, eax
	lea	rcx, -48[rbp]
	mov	eax, DWORD PTR -60[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	cmp	eax, -1
	jne	.L13
	lea	rdi, .LC9[rip]
	call	perror@PLT
	mov	edi, -1
	call	exit@PLT
.L13:
	mov	edx, DWORD PTR -68[rbp]
	mov	eax, DWORD PTR -60[rbp]
	mov	esi, edx
	mov	edi, eax
	call	listen@PLT
	jmp	.L14
.L17:
	sub	DWORD PTR -68[rbp], 1
	lea	rdx, -88[rbp]
	lea	rcx, -32[rbp]
	mov	eax, DWORD PTR -60[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -56[rbp], eax
	cmp	DWORD PTR -56[rbp], -1
	jne	.L15
	lea	rdi, .LC10[rip]
	call	perror@PLT
	mov	edi, -1
	call	exit@PLT
.L15:
	lea	rax, -13[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	lea	rsi, -13[rbp]
	mov	eax, DWORD PTR -56[rbp]
	mov	ecx, 0
	mov	edi, eax
	call	send@PLT
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], -1
	jne	.L16
	lea	rdi, .LC11[rip]
	call	perror@PLT
.L16:
	mov	eax, DWORD PTR -28[rbp]
	mov	edi, eax
	mov	eax, 0
	call	inet_ntoa@PLT
	mov	edx, eax
	mov	eax, DWORD PTR -52[rbp]
	mov	esi, eax
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -56[rbp]
	mov	edi, eax
	call	close@PLT
.L14:
	cmp	DWORD PTR -68[rbp], 0
	jg	.L17
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	"9512400.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"hb:n:p:\000"
	.data
	.align	2
	.type	short_options, %object
	.size	short_options, 4
short_options:
	.word	.LC0
	.section	.rodata
	.align	2
.LC1:
	.ascii	"help\000"
	.align	2
.LC2:
	.ascii	"port\000"
	.align	2
.LC3:
	.ascii	"bind\000"
	.align	2
.LC4:
	.ascii	"num\000"
	.align	2
	.type	long_options, %object
	.size	long_options, 64
long_options:
	.word	.LC1
	.word	0
	.word	0
	.word	104
	.word	.LC2
	.word	1
	.word	0
	.word	112
	.word	.LC3
	.word	1
	.word	0
	.word	98
	.word	.LC4
	.word	1
	.word	0
	.word	110
	.align	2
.LC5:
	.ascii	"--Simple TCP Server--\012\012        To play with s"
	.ascii	"ocket programming\012\012Options:\012\012 -h|--help"
	.ascii	"\011\011Display help\012 -p|--port\011\011Port to l"
	.ascii	"isten on\012 -n|--num\011\011Listen for number of c"
	.ascii	"onnections\012 -b|--bind\011\011Address to listen o"
	.ascii	"n (def: all)\012\000"
	.text
	.align	2
	.global	usage
	.syntax unified
	.arm
	.fpu softvfp
	.type	usage, %function
usage:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L2
	bl	puts
	nop
	mov	r0, r3
	pop	{fp, pc}
.L3:
	.align	2
.L2:
	.word	.LC5
	.size	usage, .-usage
	.section	.rodata
	.align	2
.LC7:
	.ascii	"No options given, try ``--help''\012\000"
	.align	2
.LC8:
	.ascii	"PID: %d\000"
	.align	2
.LC9:
	.ascii	"ERROR: creating socket\000"
	.align	2
.LC10:
	.ascii	"ERROR: binding to socket\000"
	.align	2
.LC11:
	.ascii	"ERROR: accepting on socket\000"
	.align	2
.LC12:
	.ascii	"ERROR: sending on socket\000"
	.align	2
.LC13:
	.ascii	"Sent %d bytes to client %s\000"
	.align	2
.LC6:
	.ascii	"Test\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 = 96
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #104
	str	r0, [fp, #-96]
	str	r1, [fp, #-100]
	ldr	r3, .L24
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #1
	str	r3, [fp, #-72]
	mov	r3, #1
	str	r3, [fp, #-68]
	ldr	r2, .L24+4
	sub	r3, fp, #16
	ldm	r2, {r0, r1}
	str	r0, [r3]
	add	r3, r3, #4
	strb	r1, [r3]
	b	.L5
.L12:
	ldr	r3, [fp, #-64]
	sub	r3, r3, #98
	cmp	r3, #14
	ldrls	pc, [pc, r3, asl #2]
	b	.L6
.L8:
	.word	.L11
	.word	.L6
	.word	.L6
	.word	.L6
	.word	.L6
	.word	.L6
	.word	.L10
	.word	.L6
	.word	.L6
	.word	.L6
	.word	.L6
	.word	.L6
	.word	.L9
	.word	.L6
	.word	.L7
.L10:
	bl	usage
	mov	r0, #0
	bl	exit
.L11:
	mov	r3, #0
	str	r3, [fp, #-72]
	ldr	r3, .L24+8
	ldr	r3, [r3]
	str	r3, [fp, #-80]
	b	.L5
.L9:
	ldr	r3, .L24+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-68]
	b	.L5
.L7:
	ldr	r3, .L24+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-76]
	b	.L5
.L6:
	bl	usage
	mov	r0, #1
	bl	exit
.L5:
	ldr	r3, .L24+12
	ldr	r2, [r3]
	sub	r3, fp, #84
	str	r3, [sp]
	ldr	r3, .L24+16
	ldr	r1, [fp, #-100]
	ldr	r0, [fp, #-96]
	bl	getopt_long
	str	r0, [fp, #-64]
	ldr	r3, [fp, #-64]
	cmn	r3, #1
	bne	.L12
	ldr	r3, [fp, #-96]
	cmp	r3, #1
	bgt	.L13
	ldr	r1, [fp, #-96]
	ldr	r0, .L24+20
	bl	printf
	mov	r0, #1
	bl	exit
.L13:
	bl	getpid
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L24+24
	bl	printf
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-60]
	ldr	r3, [fp, #-60]
	cmn	r3, #1
	bne	.L14
	ldr	r0, .L24+28
	bl	perror
	mvn	r0, #0
	bl	exit
.L14:
	mov	r3, #2
	strh	r3, [fp, #-48]	@ movhi
	ldr	r3, [fp, #-76]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-46]	@ movhi
	ldr	r3, [fp, #-80]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	str	r3, [fp, #-44]
	sub	r3, fp, #48
	add	r3, r3, #8
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2]
	str	r3, [r2, #4]
	ldr	r3, [fp, #-72]
	cmp	r3, #1
	bne	.L15
	mov	r3, #0
	str	r3, [fp, #-44]
	b	.L16
.L15:
	ldr	r3, [fp, #-80]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	str	r3, [fp, #-44]
.L16:
	mov	r3, #16
	str	r3, [fp, #-88]
	ldr	r3, [fp, #-88]
	mov	r2, r3
	sub	r3, fp, #48
	mov	r1, r3
	ldr	r0, [fp, #-60]
	bl	bind
	mov	r3, r0
	cmn	r3, #1
	bne	.L17
	ldr	r0, .L24+32
	bl	perror
	mvn	r0, #0
	bl	exit
.L17:
	ldr	r1, [fp, #-68]
	ldr	r0, [fp, #-60]
	bl	listen
	b	.L18
.L21:
	ldr	r3, [fp, #-68]
	sub	r3, r3, #1
	str	r3, [fp, #-68]
	sub	r2, fp, #88
	sub	r3, fp, #32
	mov	r1, r3
	ldr	r0, [fp, #-60]
	bl	accept
	str	r0, [fp, #-56]
	ldr	r3, [fp, #-56]
	cmn	r3, #1
	bne	.L19
	ldr	r0, .L24+36
	bl	perror
	mvn	r0, #0
	bl	exit
.L19:
	sub	r3, fp, #16
	mov	r0, r3
	bl	strlen
	mov	r2, r0
	sub	r1, fp, #16
	mov	r3, #0
	ldr	r0, [fp, #-56]
	bl	send
	str	r0, [fp, #-52]
	ldr	r3, [fp, #-52]
	cmn	r3, #1
	bne	.L20
	ldr	r0, .L24+40
	bl	perror
.L20:
	ldr	r0, [fp, #-28]
	bl	inet_ntoa
	mov	r3, r0
	mov	r2, r3
	ldr	r1, [fp, #-52]
	ldr	r0, .L24+44
	bl	printf
	ldr	r0, [fp, #-56]
	bl	close
.L18:
	ldr	r3, [fp, #-68]
	cmp	r3, #0
	bgt	.L21
	mov	r3, #0
	ldr	r2, .L24
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L23
	bl	__stack_chk_fail
.L23:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	.LC14
	.word	.LC6
	.word	optarg
	.word	short_options
	.word	long_options
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
