	.file	"862253.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 16
	.type	message, @object
	.size	message, 23
message:
	.string	"Hello, spooky world.\n"
	.string	""
.LC0:
	.string	"./mmap_output"
.LC1:
	.string	"%s"
	.text
	.type	be_child, @function
be_child:
.LFB0:
	.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	edx, 438
	mov	esi, 578
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], 0
	jns	.L2
	call	abort@PLT
.L2:
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, 1024
	mov	edi, eax
	call	ftruncate@PLT
	mov	eax, DWORD PTR -12[rbp]
	mov	r9d, 0
	mov	r8d, eax
	mov	ecx, 1
	mov	edx, 3
	mov	esi, 1024
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, 1024
	mov	esi, 13
	mov	rdi, rax
	call	memset@PLT
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, message[rip]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	call	abort@PLT
	.cfi_endproc
.LFE0:
	.size	be_child, .-be_child
	.section	.rodata
	.align 8
.LC2:
	.string	"wait() didn't return my child's PID"
.LC3:
	.string	"couldn't open fd"
	.align 8
.LC4:
	.string	"expecting child to leave me %d bytes.\n"
.LC5:
	.string	"expecting:\n %s\ngot:\n %s\n"
	.align 8
.LC6:
	.string	"Child managed to write the correct message."
	.text
	.type	be_parent, @function
be_parent:
.LFB1:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 1072
	mov	DWORD PTR -1060[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edi, 0
	call	wait@PLT
	mov	DWORD PTR -1048[rbp], eax
	mov	eax, DWORD PTR -1048[rbp]
	cmp	eax, DWORD PTR -1060[rbp]
	je	.L4
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L9
.L4:
	mov	edx, 438
	mov	esi, 0
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -1044[rbp], eax
	cmp	DWORD PTR -1044[rbp], 0
	jns	.L6
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L9
.L6:
	lea	rcx, -1040[rbp]
	mov	eax, DWORD PTR -1044[rbp]
	mov	edx, 1024
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	cmp	rax, 1024
	je	.L7
	mov	esi, 1024
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L9
.L7:
	lea	rax, -1040[rbp]
	mov	edx, 23
	lea	rsi, message[rip]
	mov	rdi, rax
	call	memcmp@PLT
	test	eax, eax
	je	.L8
	lea	rax, -1040[rbp]
	lea	rdx, message[rip]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L9
.L8:
	lea	rdi, .LC6[rip]
	call	puts@PLT
	mov	eax, 0
.L9:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	be_parent, .-be_parent
	.section	.rodata
.LC7:
	.string	"oh no, can't fork()"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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
	call	fork@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	jns	.L12
	lea	rdi, .LC7[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L13
.L12:
	cmp	DWORD PTR -4[rbp], 0
	jne	.L14
	call	be_child
	jmp	.L13
.L14:
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	be_parent
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	"862253.c"
	.text
	.section	.rodata
	.align	2
	.type	message, %object
	.size	message, 23
message:
	.ascii	"Hello, spooky world.\012\000\000"
	.align	2
.LC0:
	.ascii	"./mmap_output\000"
	.align	2
.LC1:
	.ascii	"%s\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	be_child, %function
be_child:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r2, .L3
	ldr	r1, .L3+4
	ldr	r0, .L3+8
	bl	open
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bge	.L2
	bl	abort
.L2:
	mov	r1, #1024
	ldr	r0, [fp, #-12]
	bl	ftruncate
	mov	r3, #0
	str	r3, [sp, #4]
	ldr	r3, [fp, #-12]
	str	r3, [sp]
	mov	r3, #1
	mov	r2, #3
	mov	r1, #1024
	mov	r0, #0
	bl	mmap
	str	r0, [fp, #-8]
	mov	r2, #1024
	mov	r1, #13
	ldr	r0, [fp, #-8]
	bl	memset
	ldr	r2, .L3+12
	ldr	r1, .L3+16
	ldr	r0, [fp, #-8]
	bl	sprintf
	bl	abort
.L4:
	.align	2
.L3:
	.word	438
	.word	578
	.word	.LC0
	.word	message
	.word	.LC1
	.size	be_child, .-be_child
	.section	.rodata
	.align	2
.LC2:
	.ascii	"wait() didn't return my child's PID\000"
	.align	2
.LC3:
	.ascii	"couldn't open fd\000"
	.align	2
.LC4:
	.ascii	"expecting child to leave me %d bytes.\012\000"
	.align	2
.LC5:
	.ascii	"expecting:\012 %s\012got:\012 %s\012\000"
	.align	2
.LC6:
	.ascii	"Child managed to write the correct message.\000"
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	be_parent, %function
be_parent:
	@ args = 0, pretend = 0, frame = 1048
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1040
	sub	sp, sp, #8
	str	r0, [fp, #-1048]
	ldr	r3, .L13
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r0, #0
	bl	wait
	str	r0, [fp, #-1040]
	ldr	r2, [fp, #-1040]
	ldr	r3, [fp, #-1048]
	cmp	r2, r3
	beq	.L6
	ldr	r0, .L13+4
	bl	puts
	mov	r3, #1
	b	.L11
.L6:
	ldr	r2, .L13+8
	mov	r1, #0
	ldr	r0, .L13+12
	bl	open
	str	r0, [fp, #-1036]
	ldr	r3, [fp, #-1036]
	cmp	r3, #0
	bge	.L8
	ldr	r0, .L13+16
	bl	puts
	mov	r3, #1
	b	.L11
.L8:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #1024
	mov	r1, r3
	ldr	r0, [fp, #-1036]
	bl	read
	mov	r3, r0
	cmp	r3, #1024
	beq	.L9
	mov	r1, #1024
	ldr	r0, .L13+20
	bl	printf
	mov	r3, #1
	b	.L11
.L9:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #23
	ldr	r1, .L13+24
	mov	r0, r3
	bl	memcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L10
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r2, .L13+24
	mov	r1, r3
	ldr	r0, .L13+28
	bl	printf
	mov	r3, #1
	b	.L11
.L10:
	ldr	r0, .L13+32
	bl	puts
	mov	r3, #0
.L11:
	ldr	r2, .L13
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L12
	bl	__stack_chk_fail
.L12:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L14:
	.align	2
.L13:
	.word	.LC7
	.word	.LC2
	.word	438
	.word	.LC0
	.word	.LC3
	.word	.LC4
	.word	message
	.word	.LC5
	.word	.LC6
	.size	be_parent, .-be_parent
	.section	.rodata
	.align	2
.LC8:
	.ascii	"oh no, can't fork()\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L16
	ldr	r0, .L19
	bl	puts
	mov	r3, #1
	b	.L17
.L16:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L18
	bl	be_child
	mov	r3, r0
	b	.L17
.L18:
	ldr	r0, [fp, #-8]
	bl	be_parent
	mov	r3, r0
.L17:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L20:
	.align	2
.L19:
	.word	.LC8
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
