	.file	"371395.c"
	.intel_syntax noprefix
	.text
	.globl	buf
	.bss
	.align 32
	.type	buf, @object
	.size	buf, 1024
buf:
	.zero	1024
	.section	.rodata
.LC0:
	.string	"fcntl (get):"
.LC1:
	.string	"fcntl (set):"
	.text
	.globl	nonblock
	.type	nonblock, @function
nonblock:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, 0
	mov	esi, 3
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L2
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	eax, DWORD PTR -4[rbp]
	or	ah, 8
	mov	edx, eax
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, 4
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	cmp	eax, -1
	jne	.L4
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L4:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	nonblock, .-nonblock
	.section	.rodata
.LC2:
	.string	".chatsock"
.LC3:
	.string	"%s"
.LC4:
	.string	"connect error"
.LC5:
	.string	"Connection accepted!"
.LC6:
	.string	"select error"
	.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, 304
	mov	DWORD PTR -292[rbp], edi
	mov	QWORD PTR -304[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edx, 0
	mov	esi, 1
	mov	edi, 1
	call	socket@PLT
	mov	DWORD PTR -276[rbp], eax
	mov	eax, DWORD PTR -276[rbp]
	mov	edi, eax
	call	nonblock
	mov	WORD PTR -256[rbp], 1
	lea	rax, -256[rbp]
	add	rax, 2
	lea	rdx, .LC2[rip]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	lea	rcx, -256[rbp]
	mov	eax, DWORD PTR -276[rbp]
	mov	edx, 110
	mov	rsi, rcx
	mov	edi, eax
	call	connect@PLT
	cmp	eax, -1
	jne	.L6
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, -1
	call	exit@PLT
.L6:
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
.L12:
	mov	eax, 0
	mov	ecx, 16
	lea	rdx, -144[rbp]
	mov	rdi, rdx
#APP
# 59 "the_stack_data/371395.c" 1
	cld; rep; stosq
# 0 "" 2
#NO_APP
	mov	eax, edi
	mov	edx, ecx
	mov	DWORD PTR -272[rbp], edx
	mov	DWORD PTR -268[rbp], eax
	mov	eax, DWORD PTR -276[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	mov	esi, eax
	movsx	rax, esi
	mov	rdi, QWORD PTR -144[rbp+rax*8]
	mov	eax, DWORD PTR -276[rbp]
	cdq
	shr	edx, 26
	add	eax, edx
	and	eax, 63
	sub	eax, edx
	mov	edx, 1
	mov	ecx, eax
	sal	rdx, cl
	mov	rax, rdx
	or	rdi, rax
	mov	rdx, rdi
	movsx	rax, esi
	mov	QWORD PTR -144[rbp+rax*8], rdx
	mov	rax, QWORD PTR -144[rbp]
	or	rax, 1
	mov	QWORD PTR -144[rbp], rax
	cmp	DWORD PTR -276[rbp], 0
	jns	.L7
	mov	DWORD PTR -280[rbp], 0
	jmp	.L8
.L7:
	mov	eax, DWORD PTR -276[rbp]
	mov	DWORD PTR -280[rbp], eax
.L8:
	mov	eax, DWORD PTR -280[rbp]
	mov	edi, eax
	call	nonblock
	mov	eax, DWORD PTR -280[rbp]
	lea	edi, 1[rax]
	lea	rax, -144[rbp]
	mov	r8d, 0
	mov	ecx, 0
	mov	edx, 0
	mov	rsi, rax
	call	select@PLT
	mov	DWORD PTR -264[rbp], eax
	cmp	DWORD PTR -264[rbp], -1
	jne	.L9
	lea	rdi, .LC6[rip]
	call	perror@PLT
.L9:
	cmp	DWORD PTR -264[rbp], 0
	jle	.L12
	mov	rax, QWORD PTR -144[rbp]
	and	eax, 1
	test	rax, rax
	je	.L11
	mov	edx, 1024
	lea	rsi, buf[rip]
	mov	edi, 0
	call	read@PLT
	mov	DWORD PTR -260[rbp], eax
	mov	eax, DWORD PTR -260[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -276[rbp]
	lea	rsi, buf[rip]
	mov	edi, eax
	call	write@PLT
.L11:
	mov	eax, DWORD PTR -276[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	cdqe
	mov	rsi, QWORD PTR -144[rbp+rax*8]
	mov	eax, DWORD PTR -276[rbp]
	cdq
	shr	edx, 26
	add	eax, edx
	and	eax, 63
	sub	eax, edx
	mov	edx, 1
	mov	ecx, eax
	sal	rdx, cl
	mov	rax, rdx
	and	rax, rsi
	test	rax, rax
	je	.L12
	mov	eax, DWORD PTR -276[rbp]
	mov	edx, 1024
	lea	rsi, buf[rip]
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -260[rbp], eax
	mov	eax, DWORD PTR -260[rbp]
	cdqe
	mov	rdx, rax
	lea	rsi, buf[rip]
	mov	edi, 1
	call	write@PLT
	jmp	.L12
	.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	"371395.c"
	.text
	.comm	buf,1024,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"fcntl (get):\000"
	.align	2
.LC1:
	.ascii	"fcntl (set):\000"
	.text
	.align	2
	.global	nonblock
	.syntax unified
	.arm
	.fpu softvfp
	.type	nonblock, %function
nonblock:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	mov	r2, #0
	mov	r1, #3
	ldr	r0, [fp, #-16]
	bl	fcntl
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L2
	ldr	r0, .L5
	bl	perror
	mov	r0, #1
	bl	exit
.L2:
	ldr	r3, [fp, #-8]
	orr	r3, r3, #2048
	mov	r2, r3
	mov	r1, #4
	ldr	r0, [fp, #-16]
	bl	fcntl
	mov	r3, r0
	cmn	r3, #1
	bne	.L4
	ldr	r0, .L5+4
	bl	perror
	mov	r0, #1
	bl	exit
.L4:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	.LC0
	.word	.LC1
	.size	nonblock, .-nonblock
	.section	.rodata
	.align	2
.LC2:
	.ascii	".chatsock\000"
	.align	2
.LC3:
	.ascii	"%s\000"
	.align	2
.LC4:
	.ascii	"connect error\000"
	.align	2
.LC5:
	.ascii	"Connection accepted!\000"
	.align	2
.LC6:
	.ascii	"select 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 = 280
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #288
	str	r0, [fp, #-280]
	str	r1, [fp, #-284]
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r2, #0
	mov	r1, #1
	mov	r0, #1
	bl	socket
	str	r0, [fp, #-264]
	ldr	r0, [fp, #-264]
	bl	nonblock
	mov	r3, #1
	strh	r3, [fp, #-248]	@ movhi
	sub	r3, fp, #248
	add	r3, r3, #2
	ldr	r2, .L18+4
	ldr	r1, .L18+8
	mov	r0, r3
	bl	sprintf
	sub	r3, fp, #248
	mov	r2, #110
	mov	r1, r3
	ldr	r0, [fp, #-264]
	bl	connect
	mov	r3, r0
	cmn	r3, #1
	bne	.L8
	ldr	r0, .L18+12
	bl	perror
	mvn	r0, #0
	bl	exit
.L8:
	ldr	r0, .L18+16
	bl	printf
.L16:
	sub	r3, fp, #136
	str	r3, [fp, #-260]
	mov	r3, #0
	str	r3, [fp, #-268]
	b	.L9
.L10:
	ldr	r3, [fp, #-260]
	ldr	r2, [fp, #-268]
	mov	r1, #0
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-268]
	add	r3, r3, #1
	str	r3, [fp, #-268]
.L9:
	ldr	r3, [fp, #-268]
	cmp	r3, #31
	bls	.L10
	ldr	r3, [fp, #-264]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	mov	r2, r3
	lsl	r3, r2, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	ldr	r1, [r3, #-132]
	ldr	r3, [fp, #-264]
	rsbs	r0, r3, #0
	and	r3, r3, #31
	and	r0, r0, #31
	rsbpl	r3, r0, #0
	mov	r0, #1
	lsl	r3, r0, r3
	orr	r1, r1, r3
	lsl	r3, r2, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	str	r1, [r3, #-132]
	ldr	r3, [fp, #-136]
	orr	r3, r3, #1
	str	r3, [fp, #-136]
	ldr	r3, [fp, #-264]
	cmp	r3, #0
	bge	.L11
	mov	r3, #0
	str	r3, [fp, #-272]
	b	.L12
.L11:
	ldr	r3, [fp, #-264]
	str	r3, [fp, #-272]
.L12:
	ldr	r0, [fp, #-272]
	bl	nonblock
	ldr	r3, [fp, #-272]
	add	r0, r3, #1
	sub	r1, fp, #136
	mov	r3, #0
	str	r3, [sp]
	mov	r3, #0
	mov	r2, #0
	bl	select
	str	r0, [fp, #-256]
	ldr	r3, [fp, #-256]
	cmn	r3, #1
	bne	.L13
	ldr	r0, .L18+20
	bl	perror
.L13:
	ldr	r3, [fp, #-256]
	cmp	r3, #0
	ble	.L16
	ldr	r3, [fp, #-136]
	and	r3, r3, #1
	cmp	r3, #0
	beq	.L15
	mov	r2, #1024
	ldr	r1, .L18+24
	mov	r0, #0
	bl	read
	str	r0, [fp, #-252]
	ldr	r3, [fp, #-252]
	mov	r2, r3
	ldr	r1, .L18+24
	ldr	r0, [fp, #-264]
	bl	write
.L15:
	ldr	r3, [fp, #-264]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r2, [r3, #-132]
	ldr	r3, [fp, #-264]
	rsbs	r1, r3, #0
	and	r3, r3, #31
	and	r1, r1, #31
	rsbpl	r3, r1, #0
	mov	r1, #1
	lsl	r3, r1, r3
	and	r3, r3, r2
	cmp	r3, #0
	beq	.L16
	mov	r2, #1024
	ldr	r1, .L18+24
	ldr	r0, [fp, #-264]
	bl	read
	str	r0, [fp, #-252]
	ldr	r3, [fp, #-252]
	mov	r2, r3
	ldr	r1, .L18+24
	mov	r0, #1
	bl	write
	b	.L16
.L19:
	.align	2
.L18:
	.word	.LC7
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	buf
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
