	.file	"813664.c"
	.intel_syntax noprefix
	.text
	.globl	nh
	.bss
	.align 16
	.type	nh, @object
	.size	nh, 28
nh:
	.zero	28
	.globl	message_queue
	.section	.rodata
.LC0:
	.string	"./queue"
	.section	.data.rel.local,"aw"
	.align 8
	.type	message_queue, @object
	.size	message_queue, 8
message_queue:
	.quad	.LC0
	.globl	count_left
	.bss
	.align 4
	.type	count_left, @object
	.size	count_left, 4
count_left:
	.zero	4
	.globl	count_right
	.data
	.align 4
	.type	count_right, @object
	.size	count_right, 4
count_right:
	.long	1
	.section	.rodata
.LC1:
	.string	"P2"
	.align 8
.LC2:
	.string	"Right : Signal sent from process with pid %d\n"
	.text
	.globl	handler_usr1
	.type	handler_usr1, @function
handler_usr1:
.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 -4[rbp], edi
	mov	QWORD PTR -16[rbp], rsi
	mov	QWORD PTR -24[rbp], rdx
	mov	eax, DWORD PTR count_left[rip]
	add	eax, 1
	mov	DWORD PTR count_left[rip], eax
	lea	rsi, .LC1[rip]
	lea	rdi, nh[rip]
	mov	eax, 0
	call	sprintf@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 16[rax]
	mov	DWORD PTR nh[rip+20], eax
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 16[rax]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	mov	eax, DWORD PTR count_left[rip]
	cmp	eax, 3
	jg	.L3
	mov	eax, DWORD PTR nh[rip+24]
	mov	esi, 10
	mov	edi, eax
	call	kill@PLT
.L3:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	handler_usr1, .-handler_usr1
	.section	.rodata
	.align 8
.LC3:
	.string	"left : Signal sent from process with pid %d\n"
	.text
	.globl	handler_usr2_left
	.type	handler_usr2_left, @function
handler_usr2_left:
.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, 32
	mov	DWORD PTR -4[rbp], edi
	mov	QWORD PTR -16[rbp], rsi
	mov	QWORD PTR -24[rbp], rdx
	mov	eax, DWORD PTR count_right[rip]
	add	eax, 1
	mov	DWORD PTR count_right[rip], eax
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 16[rax]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	mov	eax, DWORD PTR count_right[rip]
	cmp	eax, 3
	jg	.L6
	mov	eax, DWORD PTR nh[rip+20]
	mov	esi, 12
	mov	edi, eax
	call	kill@PLT
.L6:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	handler_usr2_left, .-handler_usr2_left
	.section	.rodata
.LC4:
	.string	"%d"
.LC5:
	.string	"P4"
	.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, 448
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR message_queue[rip]
	mov	esi, 0
	mov	rdi, rax
	call	ftok@PLT
	mov	DWORD PTR -440[rbp], eax
	mov	eax, DWORD PTR -440[rbp]
	mov	esi, 950
	mov	edi, eax
	call	msgget@PLT
	mov	DWORD PTR -436[rbp], eax
	mov	QWORD PTR -432[rbp], 3
	call	getpid@PLT
	mov	edx, eax
	lea	rax, -432[rbp]
	add	rax, 8
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	lea	rsi, -432[rbp]
	mov	eax, DWORD PTR -436[rbp]
	mov	ecx, 0
	mov	edx, 100
	mov	edi, eax
	call	msgsnd@PLT
	lea	rdx, -320[rbp]
	mov	eax, 0
	mov	ecx, 19
	mov	rdi, rdx
	rep stosq
	mov	DWORD PTR -184[rbp], 4
	lea	rax, handler_usr1[rip]
	mov	QWORD PTR -320[rbp], rax
	lea	rax, -320[rbp]
	mov	edx, 0
	mov	rsi, rax
	mov	edi, 10
	call	sigaction@PLT
	lea	rsi, -432[rbp]
	mov	eax, DWORD PTR -436[rbp]
	mov	r8d, 0
	mov	ecx, 4
	mov	edx, 100
	mov	edi, eax
	call	msgrcv@PLT
	lea	rsi, .LC5[rip]
	lea	rdi, nh[rip+10]
	mov	eax, 0
	call	sprintf@PLT
	lea	rax, -432[rbp]
	add	rax, 8
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR nh[rip+24], eax
	mov	eax, DWORD PTR nh[rip+24]
	mov	esi, 10
	mov	edi, eax
	call	kill@PLT
	lea	rdx, -160[rbp]
	mov	eax, 0
	mov	ecx, 19
	mov	rdi, rdx
	rep stosq
	mov	DWORD PTR -184[rbp], 4
	lea	rax, handler_usr2_left[rip]
	mov	QWORD PTR -160[rbp], rax
	lea	rax, -160[rbp]
	mov	edx, 0
	mov	rsi, rax
	mov	edi, 12
	call	sigaction@PLT
	mov	DWORD PTR -448[rbp], 0
	jmp	.L8
.L9:
	mov	eax, DWORD PTR nh[rip+24]
	mov	esi, 10
	mov	edi, eax
	call	kill@PLT
	mov	edi, 5
	call	sleep@PLT
	add	DWORD PTR -448[rbp], 1
.L8:
	cmp	DWORD PTR -448[rbp], 2
	jle	.L9
	nop
.L10:
	mov	eax, DWORD PTR count_left[rip]
	cmp	eax, 2
	jle	.L10
	mov	DWORD PTR -444[rbp], 0
	jmp	.L11
.L12:
	mov	eax, DWORD PTR nh[rip+20]
	mov	esi, 12
	mov	edi, eax
	call	kill@PLT
	mov	edi, 5
	call	sleep@PLT
	add	DWORD PTR -444[rbp], 1
.L11:
	cmp	DWORD PTR -444[rbp], 2
	jle	.L12
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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	"813664.c"
	.text
	.comm	nh,28,4
	.global	message_queue
	.section	.rodata
	.align	2
.LC0:
	.ascii	"./queue\000"
	.data
	.align	2
	.type	message_queue, %object
	.size	message_queue, 4
message_queue:
	.word	.LC0
	.global	count_left
	.bss
	.align	2
	.type	count_left, %object
	.size	count_left, 4
count_left:
	.space	4
	.global	count_right
	.data
	.align	2
	.type	count_right, %object
	.size	count_right, 4
count_right:
	.word	1
	.section	.rodata
	.align	2
.LC1:
	.ascii	"P2\000"
	.align	2
.LC2:
	.ascii	"Right : Signal sent from process with pid %d\012\000"
	.text
	.align	2
	.global	handler_usr1
	.syntax unified
	.arm
	.fpu softvfp
	.type	handler_usr1, %function
handler_usr1:
	@ 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, #-8]
	str	r1, [fp, #-12]
	str	r2, [fp, #-16]
	ldr	r3, .L4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L4
	str	r3, [r2]
	ldr	r1, .L4+4
	ldr	r0, .L4+8
	bl	sprintf
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #12]
	ldr	r2, .L4+8
	str	r3, [r2, #20]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #12]
	mov	r1, r3
	ldr	r0, .L4+12
	bl	printf
	ldr	r3, .L4+16
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	ldr	r3, .L4
	ldr	r3, [r3]
	cmp	r3, #3
	bgt	.L3
	ldr	r3, .L4+8
	ldr	r3, [r3, #24]
	mov	r1, #10
	mov	r0, r3
	bl	kill
.L3:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L5:
	.align	2
.L4:
	.word	count_left
	.word	.LC1
	.word	nh
	.word	.LC2
	.word	stdout
	.size	handler_usr1, .-handler_usr1
	.section	.rodata
	.align	2
.LC3:
	.ascii	"left : Signal sent from process with pid %d\012\000"
	.text
	.align	2
	.global	handler_usr2_left
	.syntax unified
	.arm
	.fpu softvfp
	.type	handler_usr2_left, %function
handler_usr2_left:
	@ 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, #-8]
	str	r1, [fp, #-12]
	str	r2, [fp, #-16]
	ldr	r3, .L9
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L9
	str	r3, [r2]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #12]
	mov	r1, r3
	ldr	r0, .L9+4
	bl	printf
	ldr	r3, .L9+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	ldr	r3, .L9
	ldr	r3, [r3]
	cmp	r3, #3
	bgt	.L8
	ldr	r3, .L9+12
	ldr	r3, [r3, #20]
	mov	r1, #12
	mov	r0, r3
	bl	kill
.L8:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L10:
	.align	2
.L9:
	.word	count_right
	.word	.LC3
	.word	stdout
	.word	nh
	.size	handler_usr2_left, .-handler_usr2_left
	.section	.rodata
	.align	2
.LC4:
	.ascii	"%d\000"
	.align	2
.LC5:
	.ascii	"P4\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 408
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #416
	ldr	r3, .L19
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L19+4
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	ftok
	str	r0, [fp, #-400]
	ldr	r1, .L19+8
	ldr	r0, [fp, #-400]
	bl	msgget
	str	r0, [fp, #-396]
	mov	r3, #3
	str	r3, [fp, #-392]
	bl	getpid
	mov	r2, r0
	sub	r3, fp, #392
	add	r3, r3, #4
	ldr	r1, .L19+12
	mov	r0, r3
	bl	sprintf
	sub	r1, fp, #392
	mov	r3, #0
	mov	r2, #100
	ldr	r0, [fp, #-396]
	bl	msgsnd
	sub	r3, fp, #288
	mov	r2, #140
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #4
	str	r3, [fp, #-156]
	ldr	r3, .L19+16
	str	r3, [fp, #-288]
	sub	r3, fp, #288
	mov	r2, #0
	mov	r1, r3
	mov	r0, #10
	bl	sigaction
	sub	r1, fp, #392
	mov	r3, #0
	str	r3, [sp]
	mov	r3, #4
	mov	r2, #100
	ldr	r0, [fp, #-396]
	bl	msgrcv
	ldr	r1, .L19+20
	ldr	r0, .L19+24
	bl	sprintf
	sub	r3, fp, #392
	add	r3, r3, #4
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	ldr	r2, .L19+28
	str	r3, [r2, #24]
	ldr	r3, .L19+28
	ldr	r3, [r3, #24]
	mov	r1, #10
	mov	r0, r3
	bl	kill
	sub	r3, fp, #148
	mov	r2, #140
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #4
	str	r3, [fp, #-156]
	ldr	r3, .L19+32
	str	r3, [fp, #-148]
	sub	r3, fp, #148
	mov	r2, #0
	mov	r1, r3
	mov	r0, #12
	bl	sigaction
	mov	r3, #0
	str	r3, [fp, #-408]
	b	.L12
.L13:
	ldr	r3, .L19+28
	ldr	r3, [r3, #24]
	mov	r1, #10
	mov	r0, r3
	bl	kill
	mov	r0, #5
	bl	sleep
	ldr	r3, [fp, #-408]
	add	r3, r3, #1
	str	r3, [fp, #-408]
.L12:
	ldr	r3, [fp, #-408]
	cmp	r3, #2
	ble	.L13
	nop
.L14:
	ldr	r3, .L19+36
	ldr	r3, [r3]
	cmp	r3, #2
	ble	.L14
	mov	r3, #0
	str	r3, [fp, #-404]
	b	.L15
.L16:
	ldr	r3, .L19+28
	ldr	r3, [r3, #20]
	mov	r1, #12
	mov	r0, r3
	bl	kill
	mov	r0, #5
	bl	sleep
	ldr	r3, [fp, #-404]
	add	r3, r3, #1
	str	r3, [fp, #-404]
.L15:
	ldr	r3, [fp, #-404]
	cmp	r3, #2
	ble	.L16
	mov	r3, #0
	ldr	r2, .L19
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L18
	bl	__stack_chk_fail
.L18:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L20:
	.align	2
.L19:
	.word	.LC6
	.word	message_queue
	.word	950
	.word	.LC4
	.word	handler_usr1
	.word	.LC5
	.word	nh+10
	.word	nh
	.word	handler_usr2_left
	.word	count_left
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
