	.file	"212458.c"
	.intel_syntax noprefix
	.text
	.globl	buf
	.bss
	.align 32
	.type	buf, @object
	.size	buf, 512
buf:
	.zero	512
	.section	.rodata
	.align 8
.LC0:
	.string	"Usage: %s <host-name> <port-number>\n"
.LC1:
	.string	"%s: host not found (%s)\n"
.LC2:
	.string	"socket:"
.LC3:
	.string	"connect:"
.LC4:
	.string	"Connected as player %d\n"
.LC5:
	.string	"listen:"
.LC6:
	.string	"%d\n"
.LC7:
	.string	"recv "
.LC8:
	.string	"connect: in right"
.LC9:
	.string	"Connect: in left"
.LC10:
	.string	"calling fcntl"
.LC11:
	.string	"I'm it"
.LC12:
	.string	"error in sending to master"
.LC13:
	.string	"Sending potato to 0"
.LC14:
	.string	"Sending potato to %d\n"
.LC15:
	.string	"sending to left"
.LC16:
	.string	"sending to right"
	.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, 416
	mov	DWORD PTR -404[rbp], edi
	mov	QWORD PTR -416[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -404[rbp], 3
	je	.L2
	mov	rax, QWORD PTR -416[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	rax, QWORD PTR -416[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	gethostbyname@PLT
	mov	QWORD PTR -320[rbp], rax
	cmp	QWORD PTR -320[rbp], 0
	jne	.L3
	mov	rax, QWORD PTR -416[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rcx, -80[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	rax, QWORD PTR -416[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -364[rbp], eax
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -360[rbp], eax
	cmp	DWORD PTR -360[rbp], 0
	jns	.L4
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	eax, DWORD PTR -360[rbp]
	mov	edi, eax
	call	exit@PLT
.L4:
	mov	WORD PTR -304[rbp], 2
	mov	eax, DWORD PTR -364[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -302[rbp], ax
	mov	rax, QWORD PTR -320[rbp]
	mov	eax, DWORD PTR 20[rax]
	movsx	rdx, eax
	mov	rax, QWORD PTR -320[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR [rax]
	lea	rcx, -304[rbp]
	add	rcx, 4
	mov	rsi, rax
	mov	rdi, rcx
	call	memcpy@PLT
	lea	rcx, -304[rbp]
	mov	eax, DWORD PTR -360[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	connect@PLT
	mov	DWORD PTR -356[rbp], eax
	cmp	DWORD PTR -356[rbp], 0
	jns	.L5
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	eax, DWORD PTR -356[rbp]
	mov	edi, eax
	call	exit@PLT
.L5:
	mov	DWORD PTR -384[rbp], 0
	lea	rsi, -384[rbp]
	mov	eax, DWORD PTR -360[rbp]
	mov	ecx, 0
	mov	edx, 4
	mov	edi, eax
	call	recv@PLT
	mov	DWORD PTR -388[rbp], eax
	mov	eax, DWORD PTR -384[rbp]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -380[rbp], 0
	mov	DWORD PTR -376[rbp], 0
	lea	rsi, -380[rbp]
	mov	eax, DWORD PTR -360[rbp]
	mov	ecx, 0
	mov	edx, 4
	mov	edi, eax
	call	recv@PLT
	mov	DWORD PTR -388[rbp], eax
	lea	rsi, -376[rbp]
	mov	eax, DWORD PTR -360[rbp]
	mov	ecx, 0
	mov	edx, 4
	mov	edi, eax
	call	recv@PLT
	mov	DWORD PTR -388[rbp], eax
	mov	QWORD PTR -312[rbp], 0
	mov	eax, DWORD PTR -376[rbp]
	add	eax, 1
	cdqe
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -312[rbp], rax
	mov	edx, DWORD PTR -376[rbp]
	mov	rax, QWORD PTR -312[rbp]
	mov	DWORD PTR [rax], edx
	lea	rax, -80[rbp]
	mov	esi, 64
	mov	rdi, rax
	call	gethostname@PLT
	lea	rax, -80[rbp]
	mov	rdi, rax
	call	gethostbyname@PLT
	mov	QWORD PTR -320[rbp], rax
	cmp	QWORD PTR -320[rbp], 0
	jne	.L6
	mov	rax, QWORD PTR -416[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rcx, -80[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -352[rbp], eax
	cmp	DWORD PTR -352[rbp], 0
	jns	.L7
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	eax, DWORD PTR -360[rbp]
	mov	edi, eax
	call	exit@PLT
.L7:
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -348[rbp], eax
	cmp	DWORD PTR -348[rbp], 0
	jns	.L8
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	eax, DWORD PTR -360[rbp]
	mov	edi, eax
	call	exit@PLT
.L8:
	mov	WORD PTR -288[rbp], 2
	mov	rax, QWORD PTR -320[rbp]
	mov	eax, DWORD PTR 20[rax]
	movsx	rdx, eax
	mov	rax, QWORD PTR -320[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR [rax]
	lea	rcx, -288[rbp]
	add	rcx, 4
	mov	rsi, rax
	mov	rdi, rcx
	call	memcpy@PLT
	mov	edi, 5
	call	srand@PLT
.L10:
	call	rand@PLT
	movsx	rdx, eax
	imul	rdx, rdx, 1172812403
	shr	rdx, 32
	sar	edx, 14
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	mov	DWORD PTR -368[rbp], edx
	mov	edx, DWORD PTR -368[rbp]
	imul	edx, edx, 60000
	sub	eax, edx
	mov	DWORD PTR -368[rbp], eax
	cmp	DWORD PTR -368[rbp], 1023
	jg	.L9
	add	DWORD PTR -368[rbp], 1024
.L9:
	mov	eax, DWORD PTR -368[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -286[rbp], ax
	lea	rcx, -288[rbp]
	mov	eax, DWORD PTR -352[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	mov	DWORD PTR -356[rbp], eax
	cmp	DWORD PTR -356[rbp], 0
	js	.L10
	mov	eax, DWORD PTR -352[rbp]
	mov	esi, 5
	mov	edi, eax
	call	listen@PLT
	mov	DWORD PTR -356[rbp], eax
	cmp	DWORD PTR -356[rbp], 0
	jns	.L11
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	eax, DWORD PTR -356[rbp]
	mov	edi, eax
	call	exit@PLT
.L11:
	lea	rax, -240[rbp]
	mov	esi, 64
	mov	rdi, rax
	call	gethostname@PLT
	mov	eax, DWORD PTR -368[rbp]
	mov	DWORD PTR -176[rbp], eax
	lea	rsi, -240[rbp]
	mov	eax, DWORD PTR -360[rbp]
	mov	ecx, 0
	mov	edx, 68
	mov	edi, eax
	call	send@PLT
	mov	DWORD PTR -388[rbp], eax
	lea	rsi, -160[rbp]
	mov	eax, DWORD PTR -360[rbp]
	mov	ecx, 0
	mov	edx, 68
	mov	edi, eax
	call	recv@PLT
	mov	DWORD PTR -388[rbp], eax
	mov	eax, DWORD PTR -388[rbp]
	test	eax, eax
	jns	.L12
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L12:
	lea	rax, -160[rbp]
	mov	rdi, rax
	call	gethostbyname@PLT
	mov	QWORD PTR -320[rbp], rax
	cmp	QWORD PTR -320[rbp], 0
	jne	.L13
	mov	rax, QWORD PTR -416[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rcx, -80[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L13:
	mov	WORD PTR -272[rbp], 2
	mov	eax, DWORD PTR -96[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -270[rbp], ax
	mov	rax, QWORD PTR -320[rbp]
	mov	eax, DWORD PTR 20[rax]
	movsx	rdx, eax
	mov	rax, QWORD PTR -320[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR [rax]
	lea	rcx, -272[rbp]
	add	rcx, 4
	mov	rsi, rax
	mov	rdi, rcx
	call	memcpy@PLT
	mov	eax, DWORD PTR -384[rbp]
	test	eax, eax
	jle	.L14
	lea	rcx, -272[rbp]
	mov	eax, DWORD PTR -348[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	connect@PLT
	mov	DWORD PTR -356[rbp], eax
	cmp	DWORD PTR -356[rbp], 0
	jns	.L15
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC8[rip]
	call	perror@PLT
.L15:
	lea	rdx, -388[rbp]
	lea	rcx, -256[rbp]
	mov	eax, DWORD PTR -352[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -372[rbp], eax
	cmp	DWORD PTR -372[rbp], 0
	jns	.L16
	lea	rdi, .LC9[rip]
	call	perror@PLT
	jmp	.L16
.L14:
	lea	rdx, -388[rbp]
	lea	rcx, -256[rbp]
	mov	eax, DWORD PTR -352[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -372[rbp], eax
	cmp	DWORD PTR -356[rbp], 0
	jns	.L17
	lea	rdi, .LC9[rip]
	call	perror@PLT
	mov	eax, DWORD PTR -356[rbp]
	mov	edi, eax
	call	exit@PLT
.L17:
	lea	rcx, -272[rbp]
	mov	eax, DWORD PTR -348[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	connect@PLT
	mov	DWORD PTR -356[rbp], eax
	cmp	DWORD PTR -356[rbp], 0
	jns	.L16
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC8[rip]
	call	perror@PLT
.L16:
	mov	eax, DWORD PTR -360[rbp]
	mov	edx, 0
	mov	esi, 3
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	or	ah, 8
	mov	edx, eax
	mov	eax, DWORD PTR -360[rbp]
	mov	esi, 4
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	mov	DWORD PTR -344[rbp], eax
	cmp	DWORD PTR -344[rbp], -1
	jne	.L18
	lea	rdi, .LC10[rip]
	call	perror@PLT
.L18:
	mov	eax, DWORD PTR -352[rbp]
	mov	edx, 0
	mov	esi, 3
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	or	ah, 8
	mov	edx, eax
	mov	eax, DWORD PTR -352[rbp]
	mov	esi, 4
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	mov	DWORD PTR -344[rbp], eax
	cmp	DWORD PTR -344[rbp], -1
	jne	.L19
	lea	rdi, .LC10[rip]
	call	perror@PLT
.L19:
	mov	eax, DWORD PTR -348[rbp]
	mov	edx, 0
	mov	esi, 3
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	or	ah, 8
	mov	edx, eax
	mov	eax, DWORD PTR -348[rbp]
	mov	esi, 4
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	mov	DWORD PTR -344[rbp], eax
	cmp	DWORD PTR -344[rbp], -1
	jne	.L20
	lea	rdi, .LC10[rip]
	call	perror@PLT
.L20:
	mov	eax, DWORD PTR -348[rbp]
	mov	edx, 0
	mov	esi, 3
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	or	ah, 8
	mov	edx, eax
	mov	eax, DWORD PTR -372[rbp]
	mov	esi, 4
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	mov	DWORD PTR -344[rbp], eax
	cmp	DWORD PTR -344[rbp], -1
	jne	.L32
	lea	rdi, .LC10[rip]
	call	perror@PLT
.L32:
	mov	DWORD PTR -340[rbp], 0
	mov	eax, DWORD PTR -340[rbp]
	mov	DWORD PTR -336[rbp], eax
	mov	eax, DWORD PTR -336[rbp]
	mov	DWORD PTR -332[rbp], eax
	mov	eax, DWORD PTR -376[rbp]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rsi, QWORD PTR -312[rbp]
	mov	eax, DWORD PTR -360[rbp]
	mov	ecx, 0
	mov	edi, eax
	call	recv@PLT
	mov	DWORD PTR -332[rbp], eax
	mov	eax, DWORD PTR -376[rbp]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rsi, QWORD PTR -312[rbp]
	mov	eax, DWORD PTR -372[rbp]
	mov	ecx, 0
	mov	edi, eax
	call	recv@PLT
	mov	DWORD PTR -336[rbp], eax
	mov	eax, DWORD PTR -376[rbp]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rsi, QWORD PTR -312[rbp]
	mov	eax, DWORD PTR -348[rbp]
	mov	ecx, 0
	mov	edi, eax
	call	recv@PLT
	mov	DWORD PTR -340[rbp], eax
	cmp	DWORD PTR -332[rbp], 0
	jg	.L22
	cmp	DWORD PTR -336[rbp], 0
	jg	.L22
	cmp	DWORD PTR -340[rbp], 0
	jle	.L32
.L22:
	mov	edx, DWORD PTR -376[rbp]
	mov	rax, QWORD PTR -312[rbp]
	mov	ecx, DWORD PTR [rax]
	mov	eax, edx
	sub	eax, ecx
	add	eax, 1
	mov	DWORD PTR -328[rbp], eax
	mov	eax, DWORD PTR -328[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -312[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -384[rbp]
	mov	DWORD PTR [rdx], eax
	mov	rax, QWORD PTR -312[rbp]
	mov	eax, DWORD PTR [rax]
	lea	edx, -1[rax]
	mov	rax, QWORD PTR -312[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -312[rbp]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	js	.L36
	mov	rax, QWORD PTR -312[rbp]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jne	.L26
	mov	rax, QWORD PTR -312[rbp]
	mov	DWORD PTR [rax], -1
	lea	rdi, .LC11[rip]
	call	puts@PLT
	mov	eax, DWORD PTR -376[rbp]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rsi, QWORD PTR -312[rbp]
	mov	eax, DWORD PTR -360[rbp]
	mov	ecx, 0
	mov	edi, eax
	call	send@PLT
	mov	DWORD PTR -388[rbp], eax
	mov	eax, DWORD PTR -388[rbp]
	test	eax, eax
	jns	.L32
	lea	rdi, .LC12[rip]
	call	perror@PLT
	jmp	.L32
.L26:
	call	rand@PLT
	mov	DWORD PTR -324[rbp], eax
	mov	eax, DWORD PTR -324[rbp]
	and	eax, 1
	test	eax, eax
	jne	.L27
	mov	eax, DWORD PTR -380[rbp]
	lea	edx, -1[rax]
	mov	eax, DWORD PTR -384[rbp]
	cmp	edx, eax
	jne	.L28
	lea	rdi, .LC13[rip]
	call	puts@PLT
	jmp	.L29
.L28:
	mov	eax, DWORD PTR -384[rbp]
	add	eax, 1
	mov	esi, eax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
.L29:
	mov	eax, DWORD PTR -376[rbp]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rsi, QWORD PTR -312[rbp]
	mov	eax, DWORD PTR -372[rbp]
	mov	ecx, 0
	mov	edi, eax
	call	send@PLT
	mov	DWORD PTR -388[rbp], eax
	mov	eax, DWORD PTR -388[rbp]
	test	eax, eax
	jns	.L32
	lea	rdi, .LC15[rip]
	call	perror@PLT
	jmp	.L32
.L27:
	mov	eax, DWORD PTR -384[rbp]
	test	eax, eax
	jne	.L30
	mov	eax, DWORD PTR -380[rbp]
	sub	eax, 1
	mov	esi, eax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L31
.L30:
	mov	eax, DWORD PTR -384[rbp]
	sub	eax, 1
	mov	esi, eax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
.L31:
	mov	eax, DWORD PTR -376[rbp]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rsi, QWORD PTR -312[rbp]
	mov	eax, DWORD PTR -348[rbp]
	mov	ecx, 0
	mov	edi, eax
	call	send@PLT
	mov	DWORD PTR -388[rbp], eax
	mov	eax, DWORD PTR -388[rbp]
	test	eax, eax
	jns	.L32
	lea	rdi, .LC16[rip]
	call	perror@PLT
	jmp	.L32
.L36:
	nop
	mov	eax, DWORD PTR -360[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -372[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -348[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -352[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L34
	call	__stack_chk_fail@PLT
.L34:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"212458.c"
	.text
	.comm	buf,512,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: %s <host-name> <port-number>\012\000"
	.align	2
.LC1:
	.ascii	"%s: host not found (%s)\012\000"
	.align	2
.LC2:
	.ascii	"socket:\000"
	.align	2
.LC3:
	.ascii	"connect:\000"
	.align	2
.LC4:
	.ascii	"Connected as player %d\012\000"
	.align	2
.LC5:
	.ascii	"listen:\000"
	.align	2
.LC6:
	.ascii	"%d\012\000"
	.align	2
.LC7:
	.ascii	"recv \000"
	.align	2
.LC8:
	.ascii	"connect: in right\000"
	.align	2
.LC9:
	.ascii	"Connect: in left\000"
	.align	2
.LC10:
	.ascii	"calling fcntl\000"
	.align	2
.LC11:
	.ascii	"I'm it\000"
	.align	2
.LC12:
	.ascii	"error in sending to master\000"
	.align	2
.LC13:
	.ascii	"Sending potato to 0\000"
	.align	2
.LC14:
	.ascii	"Sending potato to %d\012\000"
	.align	2
.LC15:
	.ascii	"sending to left\000"
	.align	2
.LC16:
	.ascii	"sending to right\000"
	.align	2
.LC17:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 352
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #352
	str	r0, [fp, #-352]
	str	r1, [fp, #-356]
	ldr	r3, .L37
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-352]
	cmp	r3, #3
	beq	.L2
	ldr	r3, .L37+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-356]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L37+8
	bl	fprintf
	mov	r0, #1
	bl	exit
.L2:
	ldr	r3, [fp, #-356]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	gethostbyname
	str	r0, [fp, #-324]
	ldr	r3, [fp, #-324]
	cmp	r3, #0
	bne	.L3
	ldr	r3, .L37+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-356]
	ldr	r2, [r3]
	sub	r3, fp, #72
	ldr	r1, .L37+12
	bl	fprintf
	mov	r0, #1
	bl	exit
.L3:
	ldr	r3, [fp, #-356]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-320]
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-316]
	ldr	r3, [fp, #-316]
	cmp	r3, #0
	bge	.L4
	ldr	r0, .L37+16
	bl	perror
	ldr	r0, [fp, #-316]
	bl	exit
.L4:
	sub	r3, fp, #4
	sub	r3, r3, #268
	mov	r2, #2
	strh	r2, [r3]	@ movhi
	ldr	r3, [fp, #-320]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #4
	sub	r3, r3, #268
	strh	r2, [r3, #2]	@ movhi
	ldr	r3, [fp, #-324]
	ldr	r3, [r3, #16]
	ldr	r1, [r3]
	ldr	r3, [fp, #-324]
	ldr	r3, [r3, #12]
	mov	r2, r3
	sub	r3, fp, #272
	add	r3, r3, #4
	mov	r0, r3
	bl	memcpy
	sub	r3, fp, #272
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-316]
	bl	connect
	str	r0, [fp, #-312]
	ldr	r3, [fp, #-312]
	cmp	r3, #0
	bge	.L5
	ldr	r0, .L37+20
	bl	perror
	ldr	r0, [fp, #-312]
	bl	exit
.L5:
	mov	r3, #0
	str	r3, [fp, #-344]
	sub	r1, fp, #344
	mov	r3, #0
	mov	r2, #4
	ldr	r0, [fp, #-316]
	bl	recv
	mov	r3, r0
	str	r3, [fp, #-348]
	ldr	r3, [fp, #-344]
	mov	r1, r3
	ldr	r0, .L37+24
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-340]
	mov	r3, #0
	str	r3, [fp, #-336]
	sub	r1, fp, #340
	mov	r3, #0
	mov	r2, #4
	ldr	r0, [fp, #-316]
	bl	recv
	mov	r3, r0
	str	r3, [fp, #-348]
	sub	r1, fp, #336
	mov	r3, #0
	mov	r2, #4
	ldr	r0, [fp, #-316]
	bl	recv
	mov	r3, r0
	str	r3, [fp, #-348]
	mov	r3, #0
	str	r3, [fp, #-308]
	ldr	r3, [fp, #-336]
	add	r3, r3, #1
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-308]
	ldr	r2, [fp, #-336]
	ldr	r3, [fp, #-308]
	str	r2, [r3]
	sub	r3, fp, #72
	mov	r1, #64
	mov	r0, r3
	bl	gethostname
	sub	r3, fp, #72
	mov	r0, r3
	bl	gethostbyname
	str	r0, [fp, #-324]
	ldr	r3, [fp, #-324]
	cmp	r3, #0
	bne	.L6
	ldr	r3, .L37+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-356]
	ldr	r2, [r3]
	sub	r3, fp, #72
	ldr	r1, .L37+12
	bl	fprintf
	mov	r0, #1
	bl	exit
.L6:
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-304]
	ldr	r3, [fp, #-304]
	cmp	r3, #0
	bge	.L7
	ldr	r0, .L37+16
	bl	perror
	ldr	r0, [fp, #-316]
	bl	exit
.L7:
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-300]
	ldr	r3, [fp, #-300]
	cmp	r3, #0
	bge	.L8
	ldr	r0, .L37+16
	bl	perror
	ldr	r0, [fp, #-316]
	bl	exit
.L8:
	mov	r3, #2
	sub	r2, fp, #256
	strh	r3, [r2]	@ movhi
	ldr	r3, [fp, #-324]
	ldr	r3, [r3, #16]
	ldr	r1, [r3]
	ldr	r3, [fp, #-324]
	ldr	r3, [r3, #12]
	mov	r2, r3
	sub	r3, fp, #256
	add	r3, r3, #4
	mov	r0, r3
	bl	memcpy
	mov	r0, #5
	bl	srand
.L10:
	bl	rand
	mov	r1, r0
	ldr	r3, .L37+28
	smull	r2, r3, r1, r3
	asr	r2, r3, #14
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r2, r3, #4
	sub	r2, r2, r3
	lsl	r3, r2, #5
	mov	r2, r3
	sub	r3, r1, r2
	str	r3, [fp, #-328]
	ldr	r3, [fp, #-328]
	cmp	r3, #1024
	bge	.L9
	ldr	r3, [fp, #-328]
	add	r3, r3, #1024
	str	r3, [fp, #-328]
.L9:
	ldr	r3, [fp, #-328]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-254]	@ movhi
	sub	r3, fp, #256
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-304]
	bl	bind
	str	r0, [fp, #-312]
	ldr	r3, [fp, #-312]
	cmp	r3, #0
	blt	.L10
	mov	r1, #5
	ldr	r0, [fp, #-304]
	bl	listen
	str	r0, [fp, #-312]
	ldr	r3, [fp, #-312]
	cmp	r3, #0
	bge	.L11
	ldr	r0, .L37+32
	bl	perror
	ldr	r0, [fp, #-312]
	bl	exit
.L11:
	sub	r3, fp, #208
	mov	r1, #64
	mov	r0, r3
	bl	gethostname
	ldr	r3, [fp, #-328]
	str	r3, [fp, #-144]
	sub	r1, fp, #208
	mov	r3, #0
	mov	r2, #68
	ldr	r0, [fp, #-316]
	bl	send
	mov	r3, r0
	str	r3, [fp, #-348]
	sub	r1, fp, #140
	mov	r3, #0
	mov	r2, #68
	ldr	r0, [fp, #-316]
	bl	recv
	mov	r3, r0
	str	r3, [fp, #-348]
	ldr	r3, [fp, #-348]
	cmp	r3, #0
	bge	.L12
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L37+36
	bl	printf
	ldr	r0, .L37+40
	bl	perror
	mov	r0, #1
	bl	exit
.L12:
	sub	r3, fp, #140
	mov	r0, r3
	bl	gethostbyname
	str	r0, [fp, #-324]
	ldr	r3, [fp, #-324]
	cmp	r3, #0
	bne	.L13
	ldr	r3, .L37+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-356]
	ldr	r2, [r3]
	sub	r3, fp, #72
	ldr	r1, .L37+12
	bl	fprintf
	mov	r0, #1
	bl	exit
.L13:
	mov	r3, #2
	strh	r3, [fp, #-240]	@ movhi
	ldr	r3, [fp, #-76]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-238]	@ movhi
	ldr	r3, [fp, #-324]
	ldr	r3, [r3, #16]
	ldr	r1, [r3]
	ldr	r3, [fp, #-324]
	ldr	r3, [r3, #12]
	mov	r2, r3
	sub	r3, fp, #240
	add	r3, r3, #4
	mov	r0, r3
	bl	memcpy
	ldr	r3, [fp, #-344]
	cmp	r3, #0
	ble	.L14
	sub	r3, fp, #240
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-300]
	bl	connect
	str	r0, [fp, #-312]
	ldr	r3, [fp, #-312]
	cmp	r3, #0
	bge	.L15
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L37+36
	bl	printf
	ldr	r0, .L37+44
	bl	perror
.L15:
	sub	r2, fp, #348
	sub	r3, fp, #224
	mov	r1, r3
	ldr	r0, [fp, #-304]
	bl	accept
	str	r0, [fp, #-332]
	ldr	r3, [fp, #-332]
	cmp	r3, #0
	bge	.L16
	ldr	r0, .L37+48
	bl	perror
	b	.L16
.L14:
	sub	r2, fp, #348
	sub	r3, fp, #224
	mov	r1, r3
	ldr	r0, [fp, #-304]
	bl	accept
	str	r0, [fp, #-332]
	ldr	r3, [fp, #-312]
	cmp	r3, #0
	bge	.L17
	ldr	r0, .L37+48
	bl	perror
	ldr	r0, [fp, #-312]
	bl	exit
.L17:
	sub	r3, fp, #240
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-300]
	bl	connect
	str	r0, [fp, #-312]
	ldr	r3, [fp, #-312]
	cmp	r3, #0
	bge	.L16
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L37+36
	bl	printf
	ldr	r0, .L37+44
	bl	perror
.L16:
	mov	r2, #0
	mov	r1, #3
	ldr	r0, [fp, #-316]
	bl	fcntl
	mov	r3, r0
	orr	r3, r3, #2048
	mov	r2, r3
	mov	r1, #4
	ldr	r0, [fp, #-316]
	bl	fcntl
	str	r0, [fp, #-296]
	ldr	r3, [fp, #-296]
	cmn	r3, #1
	bne	.L18
	ldr	r0, .L37+52
	bl	perror
.L18:
	mov	r2, #0
	mov	r1, #3
	ldr	r0, [fp, #-304]
	bl	fcntl
	mov	r3, r0
	orr	r3, r3, #2048
	mov	r2, r3
	mov	r1, #4
	ldr	r0, [fp, #-304]
	bl	fcntl
	str	r0, [fp, #-296]
	ldr	r3, [fp, #-296]
	cmn	r3, #1
	bne	.L19
	ldr	r0, .L37+52
	bl	perror
.L19:
	mov	r2, #0
	mov	r1, #3
	ldr	r0, [fp, #-300]
	bl	fcntl
	mov	r3, r0
	orr	r3, r3, #2048
	mov	r2, r3
	mov	r1, #4
	ldr	r0, [fp, #-300]
	bl	fcntl
	str	r0, [fp, #-296]
	ldr	r3, [fp, #-296]
	cmn	r3, #1
	bne	.L20
	ldr	r0, .L37+52
	bl	perror
.L20:
	mov	r2, #0
	mov	r1, #3
	ldr	r0, [fp, #-300]
	bl	fcntl
	mov	r3, r0
	orr	r3, r3, #2048
	mov	r2, r3
	mov	r1, #4
	ldr	r0, [fp, #-332]
	bl	fcntl
	str	r0, [fp, #-296]
	ldr	r3, [fp, #-296]
	cmn	r3, #1
	bne	.L32
	ldr	r0, .L37+52
	bl	perror
.L32:
	mov	r3, #0
	str	r3, [fp, #-292]
	ldr	r3, [fp, #-292]
	str	r3, [fp, #-288]
	ldr	r3, [fp, #-288]
	str	r3, [fp, #-284]
	ldr	r3, [fp, #-336]
	add	r3, r3, #1
	lsl	r2, r3, #2
	mov	r3, #0
	ldr	r1, [fp, #-308]
	ldr	r0, [fp, #-316]
	bl	recv
	str	r0, [fp, #-284]
	ldr	r3, [fp, #-336]
	add	r3, r3, #1
	lsl	r2, r3, #2
	mov	r3, #0
	ldr	r1, [fp, #-308]
	ldr	r0, [fp, #-332]
	bl	recv
	str	r0, [fp, #-288]
	ldr	r3, [fp, #-336]
	add	r3, r3, #1
	lsl	r2, r3, #2
	mov	r3, #0
	ldr	r1, [fp, #-308]
	ldr	r0, [fp, #-300]
	bl	recv
	str	r0, [fp, #-292]
	ldr	r3, [fp, #-284]
	cmp	r3, #0
	bgt	.L22
	ldr	r3, [fp, #-288]
	cmp	r3, #0
	bgt	.L22
	ldr	r3, [fp, #-292]
	cmp	r3, #0
	ble	.L32
.L22:
	ldr	r2, [fp, #-336]
	ldr	r3, [fp, #-308]
	ldr	r3, [r3]
	sub	r3, r2, r3
	add	r3, r3, #1
	str	r3, [fp, #-280]
	ldr	r3, [fp, #-280]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-308]
	add	r3, r2, r3
	ldr	r2, [fp, #-344]
	str	r2, [r3]
	ldr	r3, [fp, #-308]
	ldr	r3, [r3]
	sub	r2, r3, #1
	ldr	r3, [fp, #-308]
	str	r2, [r3]
	ldr	r3, [fp, #-308]
	ldr	r3, [r3]
	cmp	r3, #0
	blt	.L36
	ldr	r3, [fp, #-308]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L26
	ldr	r3, [fp, #-308]
	mvn	r2, #0
	str	r2, [r3]
	ldr	r0, .L37+56
	bl	puts
	ldr	r3, [fp, #-336]
	add	r3, r3, #1
	lsl	r2, r3, #2
	mov	r3, #0
	ldr	r1, [fp, #-308]
	ldr	r0, [fp, #-316]
	bl	send
	mov	r3, r0
	str	r3, [fp, #-348]
	ldr	r3, [fp, #-348]
	cmp	r3, #0
	bge	.L32
	ldr	r0, .L37+60
	bl	perror
	b	.L32
.L26:
	bl	rand
	str	r0, [fp, #-276]
	ldr	r3, [fp, #-276]
	and	r3, r3, #1
	cmp	r3, #0
	bne	.L27
	ldr	r3, [fp, #-340]
	sub	r2, r3, #1
	ldr	r3, [fp, #-344]
	cmp	r2, r3
	bne	.L28
	ldr	r0, .L37+64
	bl	puts
	b	.L29
.L28:
	ldr	r3, [fp, #-344]
	add	r3, r3, #1
	mov	r1, r3
	ldr	r0, .L37+68
	bl	printf
.L29:
	ldr	r3, [fp, #-336]
	add	r3, r3, #1
	lsl	r2, r3, #2
	mov	r3, #0
	ldr	r1, [fp, #-308]
	ldr	r0, [fp, #-332]
	bl	send
	mov	r3, r0
	str	r3, [fp, #-348]
	ldr	r3, [fp, #-348]
	cmp	r3, #0
	bge	.L32
	ldr	r0, .L37+72
	bl	perror
	b	.L32
.L27:
	ldr	r3, [fp, #-344]
	cmp	r3, #0
	bne	.L30
	ldr	r3, [fp, #-340]
	sub	r3, r3, #1
	mov	r1, r3
	ldr	r0, .L37+68
	bl	printf
	b	.L31
.L30:
	ldr	r3, [fp, #-344]
	sub	r3, r3, #1
	mov	r1, r3
	ldr	r0, .L37+68
	bl	printf
.L31:
	ldr	r3, [fp, #-336]
	add	r3, r3, #1
	lsl	r2, r3, #2
	mov	r3, #0
	ldr	r1, [fp, #-308]
	ldr	r0, [fp, #-300]
	bl	send
	mov	r3, r0
	str	r3, [fp, #-348]
	ldr	r3, [fp, #-348]
	cmp	r3, #0
	bge	.L32
	ldr	r0, .L37+76
	bl	perror
	b	.L32
.L36:
	nop
	ldr	r0, [fp, #-316]
	bl	close
	ldr	r0, [fp, #-332]
	bl	close
	ldr	r0, [fp, #-300]
	bl	close
	ldr	r0, [fp, #-304]
	bl	close
	mov	r3, #0
	ldr	r2, .L37
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L34
	bl	__stack_chk_fail
.L34:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L38:
	.align	2
.L37:
	.word	.LC17
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	1172812403
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
