	.file	"86675.c"
	.intel_syntax noprefix
	.text
	.globl	msqid
	.bss
	.align 4
	.type	msqid, @object
	.size	msqid, 4
msqid:
	.zero	4
	.text
	.globl	killmsgbuf
	.type	killmsgbuf, @function
killmsgbuf:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, DWORD PTR msqid[rip]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	msgctl@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	killmsgbuf, .-killmsgbuf
	.section	.rodata
.LC0:
	.string	": "
.LC1:
	.string	"end"
.LC2:
	.string	"\nMessage NOT delivered!\n"
	.text
	.globl	producer
	.type	producer, @function
producer:
.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	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -96[rbp], 1
.L7:
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdin[rip]
	lea	rdx, -96[rbp]
	lea	rcx, 8[rdx]
	mov	rdx, rax
	mov	esi, 80
	mov	rdi, rcx
	call	fgets@PLT
	lea	rax, -96[rbp]
	add	rax, 8
	mov	rdi, rax
	call	strlen@PLT
	sub	rax, 1
	movzx	eax, BYTE PTR -88[rbp+rax]
	cmp	al, 10
	jne	.L3
	lea	rax, -96[rbp]
	add	rax, 8
	mov	rdi, rax
	call	strlen@PLT
	sub	rax, 1
	mov	BYTE PTR -88[rbp+rax], 0
.L3:
	lea	rax, -96[rbp]
	add	rax, 8
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	call	strcmp@PLT
	test	eax, eax
	jne	.L4
	mov	eax, DWORD PTR msqid[rip]
	lea	rsi, -96[rbp]
	mov	ecx, 0
	mov	edx, 80
	mov	edi, eax
	call	msgsnd@PLT
	nop
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L8
	jmp	.L9
.L4:
	mov	eax, DWORD PTR msqid[rip]
	lea	rsi, -96[rbp]
	mov	ecx, 2048
	mov	edx, 80
	mov	edi, eax
	call	msgsnd@PLT
	cmp	eax, -1
	jne	.L7
	lea	rdi, .LC2[rip]
	call	perror@PLT
	jmp	.L7
.L9:
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	producer, .-producer
	.section	.rodata
.LC3:
	.string	"w"
.LC4:
	.string	"consumer.out"
.LC5:
	.string	"%s\n"
	.text
	.globl	consumer
	.type	consumer, @function
consumer:
.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, 112
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rsi, .LC3[rip]
	lea	rdi, .LC4[rip]
	call	fopen@PLT
	mov	QWORD PTR -104[rbp], rax
.L13:
	mov	eax, DWORD PTR msqid[rip]
	lea	rsi, -96[rbp]
	mov	r8d, 0
	mov	ecx, 0
	mov	edx, 80
	mov	edi, eax
	call	msgrcv@PLT
	lea	rax, -96[rbp]
	add	rax, 8
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	call	strcmp@PLT
	test	eax, eax
	jne	.L11
	mov	eax, 0
	call	killmsgbuf
	mov	rax, QWORD PTR -104[rbp]
	mov	rdi, rax
	call	fclose@PLT
	nop
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L14
	jmp	.L15
.L11:
	lea	rax, -96[rbp]
	lea	rdx, 8[rax]
	mov	rax, QWORD PTR -104[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L13
.L15:
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	consumer, .-consumer
	.section	.rodata
.LC6:
	.string	"."
.LC7:
	.string	"msgget"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	esi, 49
	lea	rdi, .LC6[rip]
	call	ftok@PLT
	mov	esi, 950
	mov	edi, eax
	call	msgget@PLT
	mov	DWORD PTR msqid[rip], eax
	mov	eax, DWORD PTR msqid[rip]
	cmp	eax, -1
	jne	.L17
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	edi, -1
	call	exit@PLT
.L17:
	call	fork@PLT
	test	eax, eax
	jne	.L18
	mov	eax, 0
	call	consumer
	jmp	.L19
.L18:
	mov	eax, 0
	call	producer
.L19:
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE9:
	.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	"86675.c"
	.text
	.comm	msqid,4,4
	.align	2
	.global	killmsgbuf
	.syntax unified
	.arm
	.fpu softvfp
	.type	killmsgbuf, %function
killmsgbuf:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L2
	ldr	r3, [r3]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	msgctl
	nop
	pop	{fp, pc}
.L3:
	.align	2
.L2:
	.word	msqid
	.size	killmsgbuf, .-killmsgbuf
	.section	.rodata
	.align	2
.LC0:
	.ascii	": \000"
	.align	2
.LC1:
	.ascii	"end\000"
	.align	2
.LC2:
	.ascii	"\012Message NOT delivered!\012\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	producer
	.syntax unified
	.arm
	.fpu softvfp
	.type	producer, %function
producer:
	@ args = 0, pretend = 0, frame = 88
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #88
	ldr	r3, .L12
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #1
	str	r3, [fp, #-92]
.L9:
	ldr	r0, .L12+4
	bl	printf
	ldr	r3, .L12+8
	ldr	r2, [r3]
	sub	r3, fp, #92
	add	r3, r3, #4
	mov	r1, #80
	mov	r0, r3
	bl	fgets
	sub	r3, fp, #92
	add	r3, r3, #4
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	sub	r3, r3, #1
	sub	r2, fp, #4
	add	r3, r2, r3
	ldrb	r3, [r3, #-84]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L5
	sub	r3, fp, #92
	add	r3, r3, #4
	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, #-84]
.L5:
	sub	r3, fp, #92
	add	r3, r3, #4
	mov	r1, r3
	ldr	r0, .L12+12
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L6
	ldr	r3, .L12+16
	ldr	r0, [r3]
	sub	r1, fp, #92
	mov	r3, #0
	mov	r2, #80
	bl	msgsnd
	nop
	nop
	ldr	r3, .L12
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L10
	b	.L11
.L6:
	ldr	r3, .L12+16
	ldr	r0, [r3]
	sub	r1, fp, #92
	mov	r3, #2048
	mov	r2, #80
	bl	msgsnd
	mov	r3, r0
	cmn	r3, #1
	bne	.L9
	ldr	r0, .L12+20
	bl	perror
	b	.L9
.L11:
	bl	__stack_chk_fail
.L10:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L13:
	.align	2
.L12:
	.word	.LC3
	.word	.LC0
	.word	stdin
	.word	.LC1
	.word	msqid
	.word	.LC2
	.size	producer, .-producer
	.section	.rodata
	.align	2
.LC4:
	.ascii	"w\000"
	.align	2
.LC5:
	.ascii	"consumer.out\000"
	.align	2
.LC6:
	.ascii	"%s\012\000"
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	consumer
	.syntax unified
	.arm
	.fpu softvfp
	.type	consumer, %function
consumer:
	@ args = 0, pretend = 0, frame = 96
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #104
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r1, .L20+4
	ldr	r0, .L20+8
	bl	fopen
	str	r0, [fp, #-96]
.L17:
	ldr	r3, .L20+12
	ldr	r0, [r3]
	sub	r1, fp, #92
	mov	r3, #0
	str	r3, [sp]
	mov	r3, #0
	mov	r2, #80
	bl	msgrcv
	sub	r3, fp, #92
	add	r3, r3, #4
	mov	r1, r3
	ldr	r0, .L20+16
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L15
	bl	killmsgbuf
	ldr	r0, [fp, #-96]
	bl	fclose
	nop
	nop
	ldr	r3, .L20
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L18
	b	.L19
.L15:
	sub	r3, fp, #92
	add	r3, r3, #4
	mov	r2, r3
	ldr	r1, .L20+20
	ldr	r0, [fp, #-96]
	bl	fprintf
	b	.L17
.L19:
	bl	__stack_chk_fail
.L18:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC7
	.word	.LC4
	.word	.LC5
	.word	msqid
	.word	.LC1
	.word	.LC6
	.size	consumer, .-consumer
	.section	.rodata
	.align	2
.LC8:
	.ascii	".\000"
	.align	2
.LC9:
	.ascii	"msgget\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	mov	r1, #49
	ldr	r0, .L26
	bl	ftok
	mov	r3, r0
	ldr	r1, .L26+4
	mov	r0, r3
	bl	msgget
	mov	r3, r0
	ldr	r2, .L26+8
	str	r3, [r2]
	ldr	r3, .L26+8
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L23
	ldr	r0, .L26+12
	bl	perror
	mvn	r0, #0
	bl	exit
.L23:
	bl	fork
	mov	r3, r0
	cmp	r3, #0
	bne	.L24
	bl	consumer
	b	.L25
.L24:
	bl	producer
.L25:
	mov	r0, #0
	bl	exit
.L27:
	.align	2
.L26:
	.word	.LC8
	.word	950
	.word	msqid
	.word	.LC9
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
