	.file	"7949015.c"
	.intel_syntax noprefix
	.text
	.local	message
	.comm	message,8,8
	.local	processPID
	.comm	processPID,60,32
	.local	process
	.comm	process,4,4
	.section	.rodata
	.align 8
.LC0:
	.string	"Usage: ipc [message] (max. 15 chars without spaces)"
.LC1:
	.string	"ipc:~$> "
.LC2:
	.string	"ipc-process-1"
.LC3:
	.string	"ipc-process-2"
.LC4:
	.string	"ps"
.LC5:
	.string	"\nipc:~$> "
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 40
	.cfi_offset 3, -24
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	cmp	DWORD PTR -36[rbp], 1
	jle	.L2
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	strlen@PLT
	cmp	rax, 15
	jbe	.L3
.L2:
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	eax, 0
	jmp	.L4
.L3:
	mov	rax, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR message[rip], rax
	mov	DWORD PTR process[rip], 0
	mov	eax, 0
	call	printInstructions
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -24[rbp], 0
	jmp	.L5
.L13:
	call	getchar@PLT
	mov	BYTE PTR -25[rbp], al
	movsx	eax, BYTE PTR -25[rbp]
	cmp	eax, 120
	je	.L6
	cmp	eax, 120
	jg	.L16
	cmp	eax, 112
	je	.L8
	cmp	eax, 112
	jg	.L16
	cmp	eax, 105
	je	.L9
	cmp	eax, 105
	jg	.L16
	cmp	eax, 49
	je	.L10
	cmp	eax, 50
	je	.L11
	jmp	.L7
.L10:
	mov	ebx, DWORD PTR process[rip]
	lea	eax, 1[rbx]
	mov	DWORD PTR process[rip], eax
	mov	ecx, 0
	mov	edx, 0
	lea	rsi, .LC2[rip]
	lea	rdi, sendProcess[rip]
	mov	eax, 0
	call	createprocess@PLT
	movsx	rdx, ebx
	lea	rcx, 0[0+rdx*4]
	lea	rdx, processPID[rip]
	mov	DWORD PTR [rcx+rdx], eax
	jmp	.L7
.L11:
	mov	ebx, DWORD PTR process[rip]
	lea	eax, 1[rbx]
	mov	DWORD PTR process[rip], eax
	mov	ecx, 0
	mov	edx, 0
	lea	rsi, .LC3[rip]
	lea	rdi, receiveProcess[rip]
	mov	eax, 0
	call	createprocess@PLT
	movsx	rdx, ebx
	lea	rcx, 0[0+rdx*4]
	lea	rdx, processPID[rip]
	mov	DWORD PTR [rcx+rdx], eax
	jmp	.L7
.L8:
	mov	edx, 0
	mov	esi, 0
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	run@PLT
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L7
.L9:
	mov	eax, 0
	call	printInstructions
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L7
.L6:
	mov	DWORD PTR -24[rbp], 1
	nop
.L7:
.L16:
	nop
.L12:
	call	getchar@PLT
	cmp	eax, 10
	jne	.L12
.L5:
	cmp	DWORD PTR -24[rbp], 0
	je	.L13
	mov	DWORD PTR -20[rbp], 0
	jmp	.L14
.L15:
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, processPID[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	edi, eax
	mov	eax, 0
	call	killprocess@PLT
	add	DWORD PTR -20[rbp], 1
.L14:
	mov	eax, DWORD PTR process[rip]
	cmp	DWORD PTR -20[rbp], eax
	jl	.L15
	mov	eax, 0
.L4:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC6:
	.string	"Send process (pid = %d): started\n"
	.align 8
.LC7:
	.string	"Send process (pid = %d): sending message\n"
.LC8:
	.string	"ipcdemo"
	.align 8
.LC9:
	.string	"Send process (pid = %d): message (%s) sent\n"
	.text
	.globl	sendProcess
	.type	sendProcess, @function
sendProcess:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 8
	.cfi_offset 3, -24
	mov	eax, 0
	call	getpid@PLT
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	call	getpid@PLT
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR message[rip]
	mov	rdi, rax
	call	strlen@PLT
	lea	rdx, 1[rax]
	mov	rax, QWORD PTR message[rip]
	mov	rsi, rax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	sendIPC@PLT
	mov	rbx, QWORD PTR message[rip]
	mov	eax, 0
	call	getpid@PLT
	mov	rdx, rbx
	mov	esi, eax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	sendProcess, .-sendProcess
	.section	.rodata
	.align 8
.LC10:
	.string	"Receive process (pid = %d): started\n"
	.align 8
.LC11:
	.string	"Receive process (pid = %d): waiting for message\n"
	.align 8
.LC12:
	.string	"Receive process (pid = %d): message (%s) received\n"
	.text
	.globl	receiveProcess
	.type	receiveProcess, @function
receiveProcess:
.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	eax, 0
	call	getpid@PLT
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	call	getpid@PLT
	mov	esi, eax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR message[rip]
	mov	rdi, rax
	call	strlen@PLT
	lea	rdx, 1[rax]
	lea	rax, -32[rbp]
	mov	rsi, rax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	receiveIPC@PLT
	mov	eax, 0
	call	getpid@PLT
	mov	ecx, eax
	lea	rax, -32[rbp]
	mov	rdx, rax
	mov	esi, ecx
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	receiveProcess, .-receiveProcess
	.section	.rodata
	.align 8
.LC13:
	.ascii	"\n- IPC Demo "
	.string	"-\n\n\tMessage to send = %s\n\n\tPress 1 to create a process that sends the message\n\tPress 2 to create a process that receives the message\n\tPress p to show process info (ps)\n\tPress i to show commands\n\tPress x to exit\n\tEvery command must be followed by an enter\n\n"
	.text
	.globl	printInstructions
	.type	printInstructions, @function
printInstructions:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	rax, QWORD PTR message[rip]
	mov	rsi, rax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	printInstructions, .-printInstructions
	.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	"7949015.c"
	.text
	.local	message
	.comm	message,4,4
	.local	processPID
	.comm	processPID,60,4
	.local	process
	.comm	process,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: ipc [message] (max. 15 chars without spaces)"
	.ascii	"\000"
	.align	2
.LC1:
	.ascii	"ipc:~$> \000"
	.align	2
.LC2:
	.ascii	"ipc-process-1\000"
	.align	2
.LC3:
	.ascii	"ipc-process-2\000"
	.align	2
.LC4:
	.ascii	"ps\000"
	.align	2
.LC5:
	.ascii	"\012ipc:~$> \000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #28
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r3, [fp, #-32]
	cmp	r3, #1
	ble	.L2
	ldr	r3, [fp, #-36]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	cmp	r3, #15
	bls	.L3
.L2:
	ldr	r0, .L17
	bl	puts
	mov	r3, #0
	b	.L4
.L3:
	ldr	r3, [fp, #-36]
	ldr	r3, [r3, #4]
	ldr	r2, .L17+4
	str	r3, [r2]
	ldr	r3, .L17+8
	mov	r2, #0
	str	r2, [r3]
	bl	printInstructions
	ldr	r0, .L17+12
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L5
.L13:
	bl	getchar
	mov	r3, r0
	strb	r3, [fp, #-21]
	ldrb	r3, [fp, #-21]	@ zero_extendqisi2
	cmp	r3, #120
	beq	.L6
	cmp	r3, #120
	bgt	.L16
	cmp	r3, #112
	beq	.L8
	cmp	r3, #112
	bgt	.L16
	cmp	r3, #105
	beq	.L9
	cmp	r3, #105
	bgt	.L16
	cmp	r3, #49
	beq	.L10
	cmp	r3, #50
	beq	.L11
	b	.L7
.L10:
	ldr	r3, .L17+8
	ldr	r4, [r3]
	add	r3, r4, #1
	ldr	r2, .L17+8
	str	r3, [r2]
	mov	r3, #0
	mov	r2, #0
	ldr	r1, .L17+16
	ldr	r0, .L17+20
	bl	createprocess
	mov	r3, r0
	ldr	r2, .L17+24
	str	r3, [r2, r4, lsl #2]
	b	.L7
.L11:
	ldr	r3, .L17+8
	ldr	r4, [r3]
	add	r3, r4, #1
	ldr	r2, .L17+8
	str	r3, [r2]
	mov	r3, #0
	mov	r2, #0
	ldr	r1, .L17+28
	ldr	r0, .L17+32
	bl	createprocess
	mov	r3, r0
	ldr	r2, .L17+24
	str	r3, [r2, r4, lsl #2]
	b	.L7
.L8:
	mov	r2, #0
	mov	r1, #0
	ldr	r0, .L17+36
	bl	run
	ldr	r0, .L17+40
	bl	printf
	b	.L7
.L9:
	bl	printInstructions
	ldr	r0, .L17+12
	bl	printf
	b	.L7
.L6:
	mov	r3, #1
	str	r3, [fp, #-20]
	nop
.L7:
.L16:
	nop
.L12:
	bl	getchar
	mov	r3, r0
	cmp	r3, #10
	bne	.L12
.L5:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L13
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L14
.L15:
	ldr	r2, .L17+24
	ldr	r3, [fp, #-16]
	ldr	r3, [r2, r3, lsl #2]
	mov	r0, r3
	bl	killprocess
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L14:
	ldr	r3, .L17+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	blt	.L15
	mov	r3, #0
.L4:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L18:
	.align	2
.L17:
	.word	.LC0
	.word	message
	.word	process
	.word	.LC1
	.word	.LC2
	.word	sendProcess
	.word	processPID
	.word	.LC3
	.word	receiveProcess
	.word	.LC4
	.word	.LC5
	.size	main, .-main
	.section	.rodata
	.align	2
.LC6:
	.ascii	"Send process (pid = %d): started\012\000"
	.align	2
.LC7:
	.ascii	"Send process (pid = %d): sending message\012\000"
	.align	2
.LC8:
	.ascii	"ipcdemo\000"
	.align	2
.LC9:
	.ascii	"Send process (pid = %d): message (%s) sent\012\000"
	.text
	.align	2
	.global	sendProcess
	.syntax unified
	.arm
	.fpu softvfp
	.type	sendProcess, %function
sendProcess:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	bl	getpid
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L20
	bl	printf
	bl	getpid
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L20+4
	bl	printf
	ldr	r3, .L20+8
	ldr	r4, [r3]
	ldr	r3, .L20+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	add	r3, r3, #1
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L20+12
	bl	sendIPC
	bl	getpid
	mov	r1, r0
	ldr	r3, .L20+8
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r0, .L20+16
	bl	printf
	nop
	pop	{r4, r5, fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC6
	.word	.LC7
	.word	message
	.word	.LC8
	.word	.LC9
	.size	sendProcess, .-sendProcess
	.section	.rodata
	.align	2
.LC10:
	.ascii	"Receive process (pid = %d): started\012\000"
	.align	2
.LC11:
	.ascii	"Receive process (pid = %d): waiting for message\012"
	.ascii	"\000"
	.align	2
.LC12:
	.ascii	"Receive process (pid = %d): message (%s) received\012"
	.ascii	"\000"
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	receiveProcess
	.syntax unified
	.arm
	.fpu softvfp
	.type	receiveProcess, %function
receiveProcess:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	ldr	r3, .L24
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	bl	getpid
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L24+4
	bl	printf
	bl	getpid
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L24+8
	bl	printf
	ldr	r3, .L24+12
	ldr	r3, [r3]
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	add	r2, r3, #1
	sub	r3, fp, #28
	mov	r1, r3
	ldr	r0, .L24+16
	bl	receiveIPC
	bl	getpid
	mov	r1, r0
	sub	r3, fp, #28
	mov	r2, r3
	ldr	r0, .L24+20
	bl	printf
	nop
	ldr	r3, .L24
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L23
	bl	__stack_chk_fail
.L23:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	.LC13
	.word	.LC10
	.word	.LC11
	.word	message
	.word	.LC8
	.word	.LC12
	.size	receiveProcess, .-receiveProcess
	.section	.rodata
	.align	2
.LC14:
	.ascii	"\012- IPC Demo -\012\012\011Message to send = %s\012"
	.ascii	"\012\011Press 1 to create a process that sends the "
	.ascii	"message\012\011Press 2 to create a process that rec"
	.ascii	"eives the message\012\011Press p to show process in"
	.ascii	"fo (ps)\012\011Press i to show commands\012\011Pres"
	.ascii	"s x to exit\012\011Every command must be followed b"
	.ascii	"y an enter\012\012\000"
	.text
	.align	2
	.global	printInstructions
	.syntax unified
	.arm
	.fpu softvfp
	.type	printInstructions, %function
printInstructions:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L27
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L27+4
	bl	printf
	nop
	pop	{fp, pc}
.L28:
	.align	2
.L27:
	.word	message
	.word	.LC14
	.size	printInstructions, .-printInstructions
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
