	.file	"87637799.c"
	.intel_syntax noprefix
	.text
	.globl	buffer
	.bss
	.align 32
	.type	buffer, @object
	.size	buffer, 800
buffer:
	.zero	800
	.globl	buf_indx
	.align 4
	.type	buf_indx, @object
	.size	buf_indx, 4
buf_indx:
	.zero	4
	.text
	.globl	error
	.type	error, @function
error:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	error, .-error
	.section	.rodata
.LC0:
	.string	"ERROR opening socket."
.LC1:
	.string	"ERROR on binding"
.LC2:
	.string	"------ Start Batch %d ------\n"
.LC3:
	.string	"NODE: %4d DONUT: %4d\n"
.LC4:
	.string	"------ End Batch %d ------\n"
	.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, 96
	mov	DWORD PTR -84[rbp], edi
	mov	QWORD PTR -96[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -64[rbp], 0
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -60[rbp], eax
	cmp	DWORD PTR -60[rbp], 0
	jns	.L3
	lea	rdi, .LC0[rip]
	call	error
.L3:
	lea	rax, -48[rbp]
	mov	QWORD PTR [rax], 0
	mov	QWORD PTR 8[rax], 0
	mov	WORD PTR -48[rbp], 2
	mov	DWORD PTR -44[rbp], 0
	mov	edi, 1992
	call	htons@PLT
	mov	WORD PTR -46[rbp], ax
	lea	rcx, -48[rbp]
	mov	eax, DWORD PTR -60[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	jns	.L4
	lea	rdi, .LC1[rip]
	call	error
.L4:
	mov	eax, DWORD PTR -60[rbp]
	mov	esi, 5
	mov	edi, eax
	call	listen@PLT
	mov	DWORD PTR -72[rbp], 16
.L9:
	mov	DWORD PTR buf_indx[rip], 0
	jmp	.L5
.L6:
	lea	rdx, -72[rbp]
	lea	rcx, -32[rbp]
	mov	eax, DWORD PTR -60[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -76[rbp], eax
	lea	rdx, -76[rbp]
	lea	rax, -56[rbp]
	mov	rcx, rdx
	lea	rdx, handler[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
.L5:
	mov	eax, DWORD PTR buf_indx[rip]
	cmp	eax, 98
	jle	.L6
	mov	rax, QWORD PTR -56[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	eax, DWORD PTR -64[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -68[rbp], 0
	jmp	.L7
.L8:
	mov	eax, DWORD PTR -68[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, buffer[rip+4]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -68[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	lea	rax, buffer[rip]
	mov	eax, DWORD PTR [rcx+rax]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -68[rbp], 1
.L7:
	cmp	DWORD PTR -68[rbp], 99
	jle	.L8
	mov	eax, DWORD PTR -64[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -64[rbp], edx
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	jmp	.L9
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.section	.rodata
.LC5:
	.string	"ERROR reading from socket"
	.align 8
.LC6:
	.string	"Warning: could not write to node"
	.text
	.globl	handler
	.type	handler, @function
handler:
.LFB8:
	.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	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -8[rbp], eax
	mov	eax, DWORD PTR buf_indx[rip]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, buffer[rip]
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -8[rbp]
	mov	edx, 8
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	jns	.L12
	lea	rdi, .LC5[rip]
	call	error
.L12:
	mov	edi, 5000
	call	usleep@PLT
	mov	eax, DWORD PTR buf_indx[rip]
	add	eax, 1
	mov	DWORD PTR buf_indx[rip], eax
	mov	eax, DWORD PTR -8[rbp]
	mov	edx, 4
	lea	rsi, buf_indx[rip]
	mov	edi, eax
	call	write@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	jns	.L13
	lea	rdi, .LC6[rip]
	call	puts@PLT
.L13:
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	handler, .-handler
	.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	"87637799.c"
	.text
	.comm	buffer,800,4
	.comm	buf_indx,4,4
	.align	2
	.global	error
	.syntax unified
	.arm
	.fpu softvfp
	.type	error, %function
error:
	@ 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	r0, [fp, #-8]
	bl	perror
	mov	r0, #1
	bl	exit
	.size	error, .-error
	.section	.rodata
	.align	2
.LC0:
	.ascii	"ERROR opening socket.\000"
	.align	2
.LC1:
	.ascii	"ERROR on binding\000"
	.align	2
.LC2:
	.ascii	"------ Start Batch %d ------\012\000"
	.align	2
.LC3:
	.ascii	"NODE: %4d DONUT: %4d\012\000"
	.align	2
.LC4:
	.ascii	"------ End Batch %d ------\012\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 72
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #72
	str	r0, [fp, #-72]
	str	r1, [fp, #-76]
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-48]
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-44]
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	bge	.L3
	ldr	r0, .L11+4
	bl	error
.L3:
	sub	r3, fp, #40
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2]
	str	r3, [r2, #4]
	str	r3, [r2, #8]
	str	r3, [r2, #12]
	mov	r3, #2
	strh	r3, [fp, #-40]	@ movhi
	mov	r3, #0
	str	r3, [fp, #-36]
	ldr	r0, .L11+8
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-38]	@ movhi
	sub	r3, fp, #40
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-44]
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	bge	.L4
	ldr	r0, .L11+12
	bl	error
.L4:
	mov	r1, #5
	ldr	r0, [fp, #-44]
	bl	listen
	mov	r3, #16
	str	r3, [fp, #-60]
.L9:
	ldr	r3, .L11+16
	mov	r2, #0
	str	r2, [r3]
	b	.L5
.L6:
	sub	r2, fp, #60
	sub	r3, fp, #24
	mov	r1, r3
	ldr	r0, [fp, #-44]
	bl	accept
	mov	r3, r0
	str	r3, [fp, #-64]
	sub	r3, fp, #64
	sub	r0, fp, #56
	ldr	r2, .L11+20
	mov	r1, #0
	bl	pthread_create
.L5:
	ldr	r3, .L11+16
	ldr	r3, [r3]
	cmp	r3, #98
	ble	.L6
	ldr	r3, [fp, #-56]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r1, [fp, #-48]
	ldr	r0, .L11+24
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L7
.L8:
	ldr	r2, .L11+28
	ldr	r3, [fp, #-52]
	ldr	r1, [r2, r3, lsl #3]
	ldr	r2, .L11+28
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	mov	r2, r3
	ldr	r0, .L11+32
	bl	printf
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L7:
	ldr	r3, [fp, #-52]
	cmp	r3, #99
	ble	.L8
	ldr	r3, [fp, #-48]
	add	r2, r3, #1
	str	r2, [fp, #-48]
	mov	r1, r3
	ldr	r0, .L11+36
	bl	printf
	ldr	r3, .L11+40
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	b	.L9
.L12:
	.align	2
.L11:
	.word	.LC5
	.word	.LC0
	.word	1992
	.word	.LC1
	.word	buf_indx
	.word	handler
	.word	.LC2
	.word	buffer
	.word	.LC3
	.word	.LC4
	.word	stdout
	.size	main, .-main
	.section	.rodata
	.align	2
.LC6:
	.ascii	"ERROR reading from socket\000"
	.align	2
.LC7:
	.ascii	"Warning: could not write to node\000"
	.text
	.align	2
	.global	handler
	.syntax unified
	.arm
	.fpu softvfp
	.type	handler, %function
handler:
	@ 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]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	ldr	r3, .L16
	ldr	r3, [r3]
	lsl	r3, r3, #3
	ldr	r2, .L16+4
	add	r3, r3, r2
	mov	r2, #8
	mov	r1, r3
	ldr	r0, [fp, #-12]
	bl	read
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L14
	ldr	r0, .L16+8
	bl	error
.L14:
	ldr	r0, .L16+12
	bl	usleep
	ldr	r3, .L16
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L16
	str	r3, [r2]
	mov	r2, #4
	ldr	r1, .L16
	ldr	r0, [fp, #-12]
	bl	write
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L15
	ldr	r0, .L16+16
	bl	puts
.L15:
	ldr	r3, .L16+20
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	buf_indx
	.word	buffer
	.word	.LC6
	.word	5000
	.word	.LC7
	.word	stdout
	.size	handler, .-handler
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
