	.file	"547100.c"
	.intel_syntax noprefix
	.text
	.globl	msgQueueId
	.data
	.align 4
	.type	msgQueueId, @object
	.size	msgQueueId, 4
msgQueueId:
	.long	-1
	.globl	serverAlive
	.align 4
	.type	serverAlive, @object
	.size	serverAlive, 4
serverAlive:
	.long	1
	.section	.rodata
.LC0:
	.string	"Unable to remove queue: "
	.text
	.globl	removeQueue
	.type	removeQueue, @function
removeQueue:
.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	DWORD PTR -4[rbp], edi
	cmp	DWORD PTR -4[rbp], -1
	je	.L3
	mov	eax, DWORD PTR -4[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	msgctl@PLT
	cmp	eax, -1
	jne	.L3
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	removeQueue, .-removeQueue
	.section	.rodata
.LC1:
	.string	"Unable to sign off player: "
	.text
	.globl	signal_handler
	.type	signal_handler, @function
signal_handler:
.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	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR serverAlive[rip], 0
	mov	eax, DWORD PTR msgQueueId[rip]
	cmp	eax, -1
	je	.L8
	mov	QWORD PTR -80[rbp], 1
	lea	rax, -80[rbp]
	add	rax, 8
	mov	DWORD PTR [rax], 1245794891
	mov	BYTE PTR 4[rax], 0
	mov	eax, DWORD PTR msgQueueId[rip]
	lea	rsi, -80[rbp]
	mov	ecx, 0
	mov	edx, 56
	mov	edi, eax
	call	msgsnd@PLT
	cmp	eax, -1
	jne	.L8
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	signal_handler, .-signal_handler
	.section	.rodata
.LC2:
	.string	"Enter number of players:"
.LC3:
	.string	"%d"
	.align 8
.LC4:
	.string	"/home/squirrelosopher/Desktop/OS/OS/2017-18R/Server.c"
.LC5:
	.string	"Unable to obtain unique id: "
	.align 8
.LC6:
	.string	"Unable to create/obtain message queue id: "
	.align 8
.LC7:
	.string	"Unable to validate all the players: "
.LC8:
	.string	"Unable to approve player: "
.LC9:
	.string	"%d\n"
	.align 8
.LC10:
	.string	"Enter a message to play with chinese whispers: "
	.align 8
.LC11:
	.string	"Unable to send message to a player: "
	.align 8
.LC12:
	.string	"Unable to receive message from a last player: "
	.align 8
.LC13:
	.string	"Message received from last player: %s\n"
.LC14:
	.string	"KRAJ"
	.text
	.globl	main
	.type	main, @function
main:
.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, 192
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdi, .LC2[rip]
	call	puts@PLT
	lea	rax, -188[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	call	getchar@PLT
	mov	esi, 97
	lea	rdi, .LC4[rip]
	call	ftok@PLT
	mov	DWORD PTR -176[rbp], eax
	cmp	DWORD PTR -176[rbp], -1
	jne	.L10
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L10:
	mov	DWORD PTR -172[rbp], 950
	mov	edx, DWORD PTR -172[rbp]
	mov	eax, DWORD PTR -176[rbp]
	mov	esi, edx
	mov	edi, eax
	call	msgget@PLT
	mov	DWORD PTR msgQueueId[rip], eax
	mov	eax, DWORD PTR msgQueueId[rip]
	cmp	eax, 1
	jne	.L11
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L11:
	mov	eax, DWORD PTR -188[rbp]
	cdqe
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -168[rbp], rax
	mov	DWORD PTR -184[rbp], 0
	jmp	.L12
.L14:
	mov	eax, DWORD PTR msgQueueId[rip]
	lea	rsi, -160[rbp]
	mov	r8d, 0
	mov	ecx, 1
	mov	edx, 8
	mov	edi, eax
	call	msgrcv@PLT
	cmp	rax, -1
	jne	.L13
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L13:
	mov	eax, DWORD PTR -184[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -168[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -152[rbp]
	mov	DWORD PTR [rdx], eax
	add	DWORD PTR -184[rbp], 1
.L12:
	mov	eax, DWORD PTR -188[rbp]
	cmp	DWORD PTR -184[rbp], eax
	jl	.L14
	mov	QWORD PTR -144[rbp], 1
	mov	DWORD PTR -180[rbp], 0
	jmp	.L15
.L17:
	mov	eax, DWORD PTR -180[rbp]
	add	eax, 1
	mov	DWORD PTR -136[rbp], eax
	mov	eax, DWORD PTR -180[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -168[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	lea	rsi, -144[rbp]
	mov	ecx, 0
	mov	edx, 8
	mov	edi, eax
	call	msgsnd@PLT
	cmp	eax, -1
	jne	.L16
	lea	rdi, .LC8[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L16:
	add	DWORD PTR -180[rbp], 1
.L15:
	mov	eax, DWORD PTR -188[rbp]
	cmp	DWORD PTR -180[rbp], eax
	jl	.L17
	call	getpid@PLT
	mov	esi, eax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rsi, signal_handler[rip]
	mov	edi, 2
	call	signal@PLT
	jmp	.L18
.L22:
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rdx, QWORD PTR stdin[rip]
	lea	rax, -64[rbp]
	mov	esi, 50
	mov	rdi, rax
	call	fgets@PLT
	lea	rax, -64[rbp]
	mov	rdi, rax
	call	strlen@PLT
	lea	rdx, -1[rax]
	lea	rax, -64[rbp]
	lea	rcx, -128[rbp]
	add	rcx, 8
	mov	rsi, rax
	mov	rdi, rcx
	call	strncpy@PLT
	lea	rax, -64[rbp]
	mov	rdi, rax
	call	strlen@PLT
	sub	rax, 1
	mov	BYTE PTR -120[rbp+rax], 0
	mov	QWORD PTR -128[rbp], 1
	mov	eax, DWORD PTR msgQueueId[rip]
	lea	rsi, -128[rbp]
	mov	ecx, 0
	mov	edx, 56
	mov	edi, eax
	call	msgsnd@PLT
	cmp	eax, -1
	jne	.L19
	lea	rdi, .LC11[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L19:
	mov	eax, DWORD PTR -188[rbp]
	add	eax, 1
	movsx	rdx, eax
	mov	eax, DWORD PTR msgQueueId[rip]
	lea	rsi, -128[rbp]
	mov	r8d, 0
	mov	rcx, rdx
	mov	edx, 56
	mov	edi, eax
	call	msgrcv@PLT
	cmp	rax, -1
	jne	.L20
	lea	rdi, .LC12[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L20:
	lea	rax, -128[rbp]
	add	rax, 8
	mov	rsi, rax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -128[rbp]
	add	rax, 8
	lea	rsi, .LC14[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	je	.L25
.L18:
	mov	eax, DWORD PTR serverAlive[rip]
	test	eax, eax
	jne	.L22
	jmp	.L21
.L25:
	nop
.L21:
	mov	eax, DWORD PTR msgQueueId[rip]
	mov	edi, eax
	call	removeQueue
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	"547100.c"
	.text
	.global	msgQueueId
	.data
	.align	2
	.type	msgQueueId, %object
	.size	msgQueueId, 4
msgQueueId:
	.word	-1
	.global	serverAlive
	.align	2
	.type	serverAlive, %object
	.size	serverAlive, 4
serverAlive:
	.word	1
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Unable to remove queue: \000"
	.text
	.align	2
	.global	removeQueue
	.syntax unified
	.arm
	.fpu softvfp
	.type	removeQueue, %function
removeQueue:
	@ 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, [fp, #-8]
	cmn	r3, #1
	beq	.L3
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-8]
	bl	msgctl
	mov	r3, r0
	cmn	r3, #1
	bne	.L3
	ldr	r0, .L4
	bl	perror
	mov	r0, #1
	bl	exit
.L3:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L5:
	.align	2
.L4:
	.word	.LC0
	.size	removeQueue, .-removeQueue
	.section	.rodata
	.align	2
.LC1:
	.ascii	"KRAJ\000\000"
	.align	2
.LC2:
	.ascii	"Unable to sign off player: \000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	signal_handler
	.syntax unified
	.arm
	.fpu softvfp
	.type	signal_handler, %function
signal_handler:
	@ 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]
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L11+4
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, .L11+8
	ldr	r3, [r3]
	cmn	r3, #1
	beq	.L10
	mov	r3, #1
	str	r3, [fp, #-64]
	sub	r3, fp, #64
	add	r3, r3, #4
	ldr	r2, .L11+12
	ldm	r2, {r0, r1}
	str	r0, [r3]
	add	r3, r3, #4
	strb	r1, [r3]
	ldr	r3, .L11+8
	ldr	r0, [r3]
	sub	r1, fp, #64
	mov	r3, #0
	mov	r2, #52
	bl	msgsnd
	mov	r3, r0
	cmn	r3, #1
	bne	.L10
	ldr	r0, .L11+16
	bl	perror
	mov	r0, #1
	bl	exit
.L10:
	nop
	ldr	r3, .L11
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L9
	bl	__stack_chk_fail
.L9:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC3
	.word	serverAlive
	.word	msgQueueId
	.word	.LC1
	.word	.LC2
	.size	signal_handler, .-signal_handler
	.section	.rodata
	.align	2
.LC4:
	.ascii	"Enter number of players:\000"
	.align	2
.LC5:
	.ascii	"%d\000"
	.align	2
.LC6:
	.ascii	"/home/squirrelosopher/Desktop/OS/OS/2017-18R/Server"
	.ascii	".c\000"
	.align	2
.LC7:
	.ascii	"Unable to obtain unique id: \000"
	.align	2
.LC8:
	.ascii	"Unable to create/obtain message queue id: \000"
	.align	2
.LC9:
	.ascii	"Unable to validate all the players: \000"
	.align	2
.LC10:
	.ascii	"Unable to approve player: \000"
	.align	2
.LC11:
	.ascii	"%d\012\000"
	.align	2
.LC12:
	.ascii	"Enter a message to play with chinese whispers: \000"
	.align	2
.LC13:
	.ascii	"Unable to send message to a player: \000"
	.align	2
.LC14:
	.ascii	"Unable to receive message from a last player: \000"
	.align	2
.LC15:
	.ascii	"Message received from last player: %s\012\000"
	.align	2
.LC16:
	.ascii	"KRAJ\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 = 152
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #160
	ldr	r3, .L30
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r0, .L30+4
	bl	puts
	sub	r3, fp, #156
	mov	r1, r3
	ldr	r0, .L30+8
	bl	__isoc99_scanf
	bl	getchar
	mov	r1, #97
	ldr	r0, .L30+12
	bl	ftok
	str	r0, [fp, #-144]
	ldr	r3, [fp, #-144]
	cmn	r3, #1
	bne	.L14
	ldr	r0, .L30+16
	bl	perror
	mov	r0, #1
	bl	exit
.L14:
	ldr	r3, .L30+20
	str	r3, [fp, #-140]
	ldr	r1, [fp, #-140]
	ldr	r0, [fp, #-144]
	bl	msgget
	mov	r3, r0
	ldr	r2, .L30+24
	str	r3, [r2]
	ldr	r3, .L30+24
	ldr	r3, [r3]
	cmp	r3, #1
	bne	.L15
	ldr	r0, .L30+28
	bl	perror
	mov	r0, #1
	bl	exit
.L15:
	ldr	r3, [fp, #-156]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-136]
	mov	r3, #0
	str	r3, [fp, #-152]
	b	.L16
.L18:
	ldr	r3, .L30+24
	ldr	r0, [r3]
	sub	r1, fp, #132
	mov	r3, #0
	str	r3, [sp]
	mov	r3, #1
	mov	r2, #4
	bl	msgrcv
	mov	r3, r0
	cmn	r3, #1
	bne	.L17
	ldr	r0, .L30+32
	bl	perror
	mov	r0, #1
	bl	exit
.L17:
	ldr	r3, [fp, #-152]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-136]
	add	r3, r2, r3
	ldr	r2, [fp, #-128]
	str	r2, [r3]
	ldr	r3, [fp, #-152]
	add	r3, r3, #1
	str	r3, [fp, #-152]
.L16:
	ldr	r3, [fp, #-156]
	ldr	r2, [fp, #-152]
	cmp	r2, r3
	blt	.L18
	mov	r3, #1
	str	r3, [fp, #-124]
	mov	r3, #0
	str	r3, [fp, #-148]
	b	.L19
.L21:
	ldr	r3, [fp, #-148]
	add	r3, r3, #1
	str	r3, [fp, #-120]
	ldr	r3, [fp, #-148]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-136]
	add	r3, r2, r3
	ldr	r0, [r3]
	sub	r1, fp, #124
	mov	r3, #0
	mov	r2, #4
	bl	msgsnd
	mov	r3, r0
	cmn	r3, #1
	bne	.L20
	ldr	r0, .L30+36
	bl	perror
	mov	r0, #1
	bl	exit
.L20:
	ldr	r3, [fp, #-148]
	add	r3, r3, #1
	str	r3, [fp, #-148]
.L19:
	ldr	r3, [fp, #-156]
	ldr	r2, [fp, #-148]
	cmp	r2, r3
	blt	.L21
	bl	getpid
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L30+40
	bl	printf
	ldr	r1, .L30+44
	mov	r0, #2
	bl	signal
	b	.L22
.L26:
	ldr	r0, .L30+48
	bl	printf
	ldr	r3, .L30+52
	ldr	r2, [r3]
	sub	r3, fp, #60
	mov	r1, #50
	mov	r0, r3
	bl	fgets
	sub	r3, fp, #60
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	sub	r2, r3, #1
	sub	r1, fp, #60
	sub	r3, fp, #116
	add	r3, r3, #4
	mov	r0, r3
	bl	strncpy
	sub	r3, fp, #60
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	sub	r3, r3, #1
	sub	r2, fp, #4
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3, #-108]
	mov	r3, #1
	str	r3, [fp, #-116]
	ldr	r3, .L30+24
	ldr	r0, [r3]
	sub	r1, fp, #116
	mov	r3, #0
	mov	r2, #52
	bl	msgsnd
	mov	r3, r0
	cmn	r3, #1
	bne	.L23
	ldr	r0, .L30+56
	bl	perror
	mov	r0, #1
	bl	exit
.L23:
	ldr	r3, .L30+24
	ldr	r0, [r3]
	ldr	r3, [fp, #-156]
	add	r3, r3, #1
	sub	r1, fp, #116
	mov	r2, #0
	str	r2, [sp]
	mov	r2, #52
	bl	msgrcv
	mov	r3, r0
	cmn	r3, #1
	bne	.L24
	ldr	r0, .L30+60
	bl	perror
	mov	r0, #1
	bl	exit
.L24:
	sub	r3, fp, #116
	add	r3, r3, #4
	mov	r1, r3
	ldr	r0, .L30+64
	bl	printf
	sub	r3, fp, #116
	add	r3, r3, #4
	ldr	r1, .L30+68
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L29
.L22:
	ldr	r3, .L30+72
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L26
	b	.L25
.L29:
	nop
.L25:
	ldr	r3, .L30+24
	ldr	r3, [r3]
	mov	r0, r3
	bl	removeQueue
	mov	r3, #0
	ldr	r2, .L30
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L28
	bl	__stack_chk_fail
.L28:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L31:
	.align	2
.L30:
	.word	.LC17
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	950
	.word	msgQueueId
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	signal_handler
	.word	.LC12
	.word	stdin
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	serverAlive
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
