	.file	"43281.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"open() error!"
.LC1:
	.string	"read() error!"
.LC2:
	.string	"Usage : %s<txt>  <port>\n"
.LC3:
	.string	"socket() error"
.LC4:
	.string	"bind() error"
.LC5:
	.string	"listen() error"
.LC6:
	.string	"accept() error"
	.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, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 1888
	mov	DWORD PTR -10068[rbp], edi
	mov	QWORD PTR -10080[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -10080[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -10060[rbp], eax
	cmp	DWORD PTR -10060[rbp], -1
	jne	.L2
	lea	rdi, .LC0[rip]
	call	error_handling
.L2:
	lea	rcx, -10016[rbp]
	mov	eax, DWORD PTR -10060[rbp]
	mov	edx, 10000
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	cmp	rax, -1
	jne	.L3
	lea	rdi, .LC1[rip]
	call	error_handling
.L3:
	mov	eax, DWORD PTR -10060[rbp]
	mov	edi, eax
	call	close@PLT
	cmp	DWORD PTR -10068[rbp], 3
	je	.L4
	mov	rax, QWORD PTR -10080[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L4:
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -10056[rbp], eax
	cmp	DWORD PTR -10056[rbp], -1
	jne	.L5
	lea	rdi, .LC3[rip]
	call	error_handling
.L5:
	lea	rax, -10048[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	WORD PTR -10048[rbp], 2
	mov	edi, 0
	call	htonl@PLT
	mov	DWORD PTR -10044[rbp], eax
	mov	rax, QWORD PTR -10080[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -10046[rbp], ax
	lea	rcx, -10048[rbp]
	mov	eax, DWORD PTR -10056[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	cmp	eax, -1
	jne	.L6
	lea	rdi, .LC4[rip]
	call	error_handling
.L6:
	mov	eax, DWORD PTR -10056[rbp]
	mov	esi, 5
	mov	edi, eax
	call	listen@PLT
	cmp	eax, -1
	jne	.L7
	lea	rdi, .LC5[rip]
	call	error_handling
.L7:
	mov	DWORD PTR -10064[rbp], 16
	lea	rdx, -10064[rbp]
	lea	rcx, -10032[rbp]
	mov	eax, DWORD PTR -10056[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -10052[rbp], eax
	cmp	DWORD PTR -10052[rbp], -1
	jne	.L8
	lea	rdi, .LC6[rip]
	call	error_handling
.L8:
	lea	rcx, -10016[rbp]
	mov	eax, DWORD PTR -10052[rbp]
	mov	edx, 10000
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	eax, DWORD PTR -10052[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -10056[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	error_handling
	.type	error_handling, @function
error_handling:
.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	QWORD PTR -8[rbp], rdi
	mov	rdx, QWORD PTR stderr[rip]
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	fputs@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rsi, rax
	mov	edi, 10
	call	fputc@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE7:
	.size	error_handling, .-error_handling
	.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	"43281.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"open() error!\000"
	.align	2
.LC1:
	.ascii	"read() error!\000"
	.align	2
.LC2:
	.ascii	"Usage : %s<txt>  <port>\012\000"
	.align	2
.LC3:
	.ascii	"socket() error\000"
	.align	2
.LC4:
	.ascii	"bind() error\000"
	.align	2
.LC5:
	.ascii	"listen() error\000"
	.align	2
.LC6:
	.ascii	"accept() error\000"
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 10064
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #10048
	sub	sp, sp, #20
	sub	r3, fp, #8192
	sub	r3, r3, #12
	str	r0, [r3, #-1868]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	str	r1, [r3, #-1872]
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-1872]
	add	r3, r3, #4
	ldr	r3, [r3]
	sub	r2, fp, #8192
	sub	r2, r2, #12
	mov	r4, r2
	mov	r1, #0
	mov	r0, r3
	bl	open
	str	r0, [r4, #-1856]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-1856]
	cmn	r3, #1
	bne	.L2
	ldr	r0, .L11+4
	bl	error_handling
.L2:
	sub	r3, fp, #9984
	sub	r3, r3, #12
	sub	r3, r3, #20
	sub	r2, fp, #8192
	sub	r2, r2, #12
	mov	r0, r2
	ldr	r2, .L11+8
	mov	r1, r3
	ldr	r0, [r0, #-1856]
	bl	read
	mov	r3, r0
	cmn	r3, #1
	bne	.L3
	ldr	r0, .L11+12
	bl	error_handling
.L3:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r0, [r3, #-1856]
	bl	close
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-1868]
	cmp	r3, #3
	beq	.L4
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-1872]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L11+16
	bl	printf
	mov	r0, #1
	bl	exit
.L4:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r4, r3
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [r4, #-1852]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-1852]
	cmn	r3, #1
	bne	.L5
	ldr	r0, .L11+20
	bl	error_handling
.L5:
	sub	r3, fp, #9984
	sub	r3, r3, #12
	sub	r3, r3, #52
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #8192
	sub	r3, r3, #12
	sub	r3, r3, #1840
	sub	r3, r3, #4
	mov	r2, #2
	strh	r2, [r3]	@ movhi
	mov	r0, #0
	bl	htonl
	mov	r3, r0
	sub	r2, fp, #8192
	sub	r2, r2, #12
	str	r3, [r2, #-1840]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-1872]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	sub	r3, r3, #1840
	sub	r3, r3, #4
	strh	r2, [r3, #2]	@ movhi
	sub	r3, fp, #9984
	sub	r3, r3, #12
	sub	r3, r3, #52
	sub	r2, fp, #8192
	sub	r2, r2, #12
	mov	r0, r2
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [r0, #-1852]
	bl	bind
	mov	r3, r0
	cmn	r3, #1
	bne	.L6
	ldr	r0, .L11+24
	bl	error_handling
.L6:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r1, #5
	ldr	r0, [r3, #-1852]
	bl	listen
	mov	r3, r0
	cmn	r3, #1
	bne	.L7
	ldr	r0, .L11+28
	bl	error_handling
.L7:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #16
	str	r3, [r2, #-1860]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r4, r3
	sub	r2, fp, #10048
	sub	r2, r2, #12
	sub	r2, r2, #4
	sub	r3, fp, #9984
	sub	r3, r3, #12
	sub	r3, r3, #36
	sub	r1, fp, #8192
	sub	r1, r1, #12
	mov	r0, r1
	mov	r1, r3
	ldr	r0, [r0, #-1852]
	bl	accept
	str	r0, [r4, #-1848]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-1848]
	cmn	r3, #1
	bne	.L8
	ldr	r0, .L11+32
	bl	error_handling
.L8:
	sub	r3, fp, #9984
	sub	r3, r3, #12
	sub	r3, r3, #20
	sub	r2, fp, #8192
	sub	r2, r2, #12
	mov	r0, r2
	ldr	r2, .L11+8
	mov	r1, r3
	ldr	r0, [r0, #-1848]
	bl	write
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r0, [r3, #-1848]
	bl	close
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r0, [r3, #-1852]
	bl	close
	mov	r3, #0
	ldr	r2, .L11
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L10
	bl	__stack_chk_fail
.L10:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC7
	.word	.LC0
	.word	10000
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.size	main, .-main
	.align	2
	.global	error_handling
	.syntax unified
	.arm
	.fpu softvfp
	.type	error_handling, %function
error_handling:
	@ 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, .L14
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, [fp, #-8]
	bl	fputs
	ldr	r3, .L14
	ldr	r3, [r3]
	mov	r1, r3
	mov	r0, #10
	bl	fputc
	mov	r0, #1
	bl	exit
.L15:
	.align	2
.L14:
	.word	stderr
	.size	error_handling, .-error_handling
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
