	.file	"628124.c"
	.intel_syntax noprefix
	.text
	.globl	key
	.bss
	.align 4
	.type	key, @object
	.size	key, 4
key:
	.zero	4
	.globl	msgid
	.align 4
	.type	msgid, @object
	.size	msgid, 4
msgid:
	.zero	4
	.section	.rodata
.LC0:
	.string	"msgsnd error"
.LC1:
	.string	"msgctl error"
	.text
	.globl	threadWrite
	.type	threadWrite, @function
threadWrite:
.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, 304
	mov	QWORD PTR -296[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR key[rip]
	mov	esi, 950
	mov	edi, eax
	call	msgget@PLT
	mov	DWORD PTR msgid[rip], eax
	mov	QWORD PTR -272[rbp], 1
	jmp	.L2
.L4:
	lea	rax, -272[rbp]
	add	rax, 8
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -276[rbp], eax
	mov	eax, DWORD PTR -276[rbp]
	sub	eax, 1
	cdqe
	movzx	eax, BYTE PTR -264[rbp+rax]
	cmp	al, 10
	jne	.L3
	mov	eax, DWORD PTR -276[rbp]
	sub	eax, 1
	cdqe
	mov	BYTE PTR -264[rbp+rax], 0
.L3:
	mov	eax, DWORD PTR -276[rbp]
	add	eax, 1
	movsx	rdx, eax
	mov	eax, DWORD PTR msgid[rip]
	lea	rsi, -272[rbp]
	mov	ecx, 0
	mov	edi, eax
	call	msgsnd@PLT
	cmp	eax, -1
	jne	.L2
	lea	rdi, .LC0[rip]
	call	perror@PLT
.L2:
	mov	rax, QWORD PTR stdin[rip]
	lea	rdx, -272[rbp]
	lea	rcx, 8[rdx]
	mov	rdx, rax
	mov	esi, 264
	mov	rdi, rcx
	call	fgets@PLT
	test	rax, rax
	jne	.L4
	mov	eax, DWORD PTR msgid[rip]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	msgctl@PLT
	cmp	eax, -1
	jne	.L5
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	threadWrite, .-threadWrite
	.section	.rodata
.LC2:
	.string	"msrcv error"
.LC3:
	.string	"Data send is : %s \n"
	.text
	.globl	threadRead
	.type	threadRead, @function
threadRead:
.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, 288
	mov	QWORD PTR -280[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR key[rip]
	mov	esi, 950
	mov	edi, eax
	call	msgget@PLT
	mov	DWORD PTR msgid[rip], eax
	mov	QWORD PTR -272[rbp], 1
.L10:
	mov	eax, DWORD PTR msgid[rip]
	lea	rsi, -272[rbp]
	mov	r8d, 0
	mov	ecx, 0
	mov	edx, 255
	mov	edi, eax
	call	msgrcv@PLT
	cmp	rax, -1
	jne	.L9
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L9:
	lea	rax, -272[rbp]
	add	rax, 8
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L10
	.cfi_endproc
.LFE7:
	.size	threadRead, .-threadRead
	.section	.rodata
.LC4:
	.string	"progfile"
.LC5:
	.string	"error creating thread 1."
.LC6:
	.string	"error creating thread 2."
.LC7:
	.string	"error joining thread 1 ."
.LC8:
	.string	"error joining thread 2 ."
	.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, 32
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	esi, 65
	lea	rdi, .LC4[rip]
	call	ftok@PLT
	mov	DWORD PTR key[rip], eax
	lea	rax, -24[rbp]
	mov	ecx, 0
	lea	rdx, threadWrite[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	test	eax, eax
	je	.L13
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	call	abort@PLT
.L13:
	lea	rax, -16[rbp]
	mov	ecx, 0
	lea	rdx, threadRead[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	test	eax, eax
	je	.L14
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	call	abort@PLT
.L14:
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	test	eax, eax
	je	.L15
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	call	abort@PLT
.L15:
	mov	eax, DWORD PTR msgid[rip]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	msgctl@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	test	eax, eax
	je	.L16
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	call	abort@PLT
.L16:
	mov	edi, 0
	call	exit@PLT
	.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	"628124.c"
	.text
	.comm	key,4,4
	.comm	msgid,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"msgsnd error\000"
	.align	2
.LC1:
	.ascii	"msgctl error\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	threadWrite
	.syntax unified
	.arm
	.fpu softvfp
	.type	threadWrite, %function
threadWrite:
	@ args = 0, pretend = 0, frame = 280
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #280
	str	r0, [fp, #-280]
	ldr	r3, .L8
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L8+4
	ldr	r3, [r3]
	ldr	r1, .L8+8
	mov	r0, r3
	bl	msgget
	mov	r3, r0
	ldr	r2, .L8+12
	str	r3, [r2]
	mov	r3, #1
	str	r3, [fp, #-268]
	b	.L2
.L4:
	sub	r3, fp, #268
	add	r3, r3, #4
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	str	r3, [fp, #-272]
	ldr	r3, [fp, #-272]
	sub	r3, r3, #1
	sub	r2, fp, #4
	add	r3, r2, r3
	ldrb	r3, [r3, #-260]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L3
	ldr	r3, [fp, #-272]
	sub	r3, r3, #1
	sub	r2, fp, #4
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3, #-260]
.L3:
	ldr	r3, .L8+12
	ldr	r0, [r3]
	ldr	r3, [fp, #-272]
	add	r3, r3, #1
	mov	r2, r3
	sub	r1, fp, #268
	mov	r3, #0
	bl	msgsnd
	mov	r3, r0
	cmn	r3, #1
	bne	.L2
	ldr	r0, .L8+16
	bl	perror
.L2:
	ldr	r3, .L8+20
	ldr	r2, [r3]
	sub	r3, fp, #268
	add	r3, r3, #4
	mov	r1, #260
	mov	r0, r3
	bl	fgets
	mov	r3, r0
	cmp	r3, #0
	bne	.L4
	ldr	r3, .L8+12
	ldr	r3, [r3]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	msgctl
	mov	r3, r0
	cmn	r3, #1
	bne	.L5
	ldr	r0, .L8+24
	bl	perror
	mov	r0, #1
	bl	exit
.L5:
	mov	r3, #0
	ldr	r2, .L8
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L7
	bl	__stack_chk_fail
.L7:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L9:
	.align	2
.L8:
	.word	.LC2
	.word	key
	.word	950
	.word	msgid
	.word	.LC0
	.word	stdin
	.word	.LC1
	.size	threadWrite, .-threadWrite
	.section	.rodata
	.align	2
.LC3:
	.ascii	"msrcv error\000"
	.align	2
.LC4:
	.ascii	"Data send is : %s \012\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	threadRead
	.syntax unified
	.arm
	.fpu softvfp
	.type	threadRead, %function
threadRead:
	@ args = 0, pretend = 0, frame = 272
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #280
	str	r0, [fp, #-272]
	ldr	r3, .L14
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L14+4
	ldr	r3, [r3]
	ldr	r1, .L14+8
	mov	r0, r3
	bl	msgget
	mov	r3, r0
	ldr	r2, .L14+12
	str	r3, [r2]
	mov	r3, #1
	str	r3, [fp, #-268]
.L12:
	ldr	r3, .L14+12
	ldr	r0, [r3]
	sub	r1, fp, #268
	mov	r3, #0
	str	r3, [sp]
	mov	r3, #0
	mov	r2, #255
	bl	msgrcv
	mov	r3, r0
	cmn	r3, #1
	bne	.L11
	ldr	r0, .L14+16
	bl	perror
	mov	r0, #1
	bl	exit
.L11:
	sub	r3, fp, #268
	add	r3, r3, #4
	mov	r1, r3
	ldr	r0, .L14+20
	bl	printf
	b	.L12
.L15:
	.align	2
.L14:
	.word	.LC5
	.word	key
	.word	950
	.word	msgid
	.word	.LC3
	.word	.LC4
	.size	threadRead, .-threadRead
	.section	.rodata
	.align	2
.LC6:
	.ascii	"progfile\000"
	.align	2
.LC7:
	.ascii	"error creating thread 1.\000"
	.align	2
.LC8:
	.ascii	"error creating thread 2.\000"
	.align	2
.LC9:
	.ascii	"error joining thread 1 .\000"
	.align	2
.LC10:
	.ascii	"error joining thread 2 .\000"
	.align	2
.LC11:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r3, .L22
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r1, #65
	ldr	r0, .L22+4
	bl	ftok
	mov	r3, r0
	ldr	r2, .L22+8
	str	r3, [r2]
	sub	r0, fp, #16
	mov	r3, #0
	ldr	r2, .L22+12
	mov	r1, #0
	bl	pthread_create
	mov	r3, r0
	cmp	r3, #0
	beq	.L17
	ldr	r0, .L22+16
	bl	printf
	bl	abort
.L17:
	sub	r0, fp, #12
	mov	r3, #0
	ldr	r2, .L22+20
	mov	r1, #0
	bl	pthread_create
	mov	r3, r0
	cmp	r3, #0
	beq	.L18
	ldr	r0, .L22+24
	bl	printf
	bl	abort
.L18:
	ldr	r3, [fp, #-16]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	mov	r3, r0
	cmp	r3, #0
	beq	.L19
	ldr	r0, .L22+28
	bl	printf
	bl	abort
.L19:
	ldr	r3, .L22+32
	ldr	r3, [r3]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	msgctl
	ldr	r3, [fp, #-12]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	mov	r3, r0
	cmp	r3, #0
	beq	.L20
	ldr	r0, .L22+36
	bl	printf
	bl	abort
.L20:
	mov	r0, #0
	bl	exit
.L23:
	.align	2
.L22:
	.word	.LC11
	.word	.LC6
	.word	key
	.word	threadWrite
	.word	.LC7
	.word	threadRead
	.word	.LC8
	.word	.LC9
	.word	msgid
	.word	.LC10
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
