	.file	"171511.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Parent process is about to fork()."
.LC1:
	.string	"fork() failed."
.LC2:
	.string	"This is the child process."
	.align 8
.LC3:
	.string	"Usage: Supply one integer argument greater than 0, e.g. \"a.out 8\". The argument is converted to unsigned long using strtoul()."
	.align 8
.LC4:
	.string	"Failed to convert argument '%s' to unsigned long. Overflow.\n"
.LC5:
	.string	"Fuck"
	.align 8
.LC6:
	.string	"Failed to convert argument '%s' to unsigned long. No conversion.\n"
	.align 8
.LC7:
	.string	"Argument must be greater than 0."
	.align 8
.LC8:
	.string	"Parent process is about to wait()."
	.align 8
.LC9:
	.string	"Parent process returned from wait()."
.LC10:
	.string	"the_stack_data/171511.c"
.LC11:
	.string	"pid == cpid"
	.align 8
.LC12:
	.string	"Child process terminated with status value = %d.\n"
	.align 8
.LC13:
	.string	"Child process terminated abnormally."
	.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
	sub	rsp, 48
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdi, .LC0[rip]
	call	puts@PLT
	call	fork@PLT
	mov	DWORD PTR -24[rbp], eax
	cmp	DWORD PTR -24[rbp], 0
	jns	.L2
	lea	rdi, .LC1[rip]
	call	puts@PLT
	jmp	.L3
.L2:
	cmp	DWORD PTR -24[rbp], 0
	jne	.L4
	lea	rdi, .LC2[rip]
	call	puts@PLT
	cmp	DWORD PTR -36[rbp], 2
	jne	.L5
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 45
	jne	.L6
.L5:
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L13
.L6:
	call	__errno_location@PLT
	mov	DWORD PTR [rax], 0
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	edx, 10
	mov	esi, 0
	mov	rdi, rax
	call	strtoul@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], -1
	jne	.L8
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 34
	jne	.L8
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	eax, 2
	jmp	.L13
.L8:
	cmp	QWORD PTR -16[rbp], 0
	jne	.L9
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 22
	jne	.L9
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	eax, 3
	jmp	.L13
.L9:
	cmp	QWORD PTR -16[rbp], 0
	jne	.L10
	lea	rdi, .LC7[rip]
	call	puts@PLT
	mov	eax, 4
	jmp	.L13
.L10:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	print_collatz
	jmp	.L3
.L4:
	lea	rdi, .LC8[rip]
	call	puts@PLT
	lea	rax, -28[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	wait@PLT
	mov	DWORD PTR -20[rbp], eax
	lea	rdi, .LC9[rip]
	call	puts@PLT
	mov	eax, DWORD PTR -24[rbp]
	cmp	eax, DWORD PTR -20[rbp]
	je	.L11
	lea	rcx, __PRETTY_FUNCTION__.1[rip]
	mov	edx, 62
	lea	rsi, .LC10[rip]
	lea	rdi, .LC11[rip]
	call	__assert_fail@PLT
.L11:
	mov	eax, DWORD PTR -28[rbp]
	and	eax, 127
	test	eax, eax
	jne	.L12
	mov	eax, DWORD PTR -28[rbp]
	sar	eax, 8
	movzx	eax, al
	mov	esi, eax
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L3
.L12:
	lea	rdi, .LC13[rip]
	call	puts@PLT
.L3:
	mov	eax, 0
.L13:
	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
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC14:
	.string	"n > 0"
.LC15:
	.string	"1."
.LC16:
	.string	"%lu, "
	.text
	.globl	print_collatz
	.type	print_collatz, @function
print_collatz:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	cmp	QWORD PTR -8[rbp], 0
	jne	.L16
	lea	rcx, __PRETTY_FUNCTION__.0[rip]
	mov	edx, 79
	lea	rsi, .LC10[rip]
	lea	rdi, .LC14[rip]
	call	__assert_fail@PLT
.L16:
	cmp	QWORD PTR -8[rbp], 1
	jne	.L17
	lea	rdi, .LC15[rip]
	call	puts@PLT
	jmp	.L15
.L17:
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC16[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	and	eax, 1
	test	rax, rax
	jne	.L19
	shr	QWORD PTR -8[rbp]
	jmp	.L20
.L19:
	mov	rdx, QWORD PTR -8[rbp]
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	add	rax, 1
	mov	QWORD PTR -8[rbp], rax
.L20:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	print_collatz
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	print_collatz, .-print_collatz
	.section	.rodata
	.type	__PRETTY_FUNCTION__.1, @object
	.size	__PRETTY_FUNCTION__.1, 5
__PRETTY_FUNCTION__.1:
	.string	"main"
	.align 8
	.type	__PRETTY_FUNCTION__.0, @object
	.size	__PRETTY_FUNCTION__.0, 14
__PRETTY_FUNCTION__.0:
	.string	"print_collatz"
	.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	"171511.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Parent process is about to fork().\000"
	.align	2
.LC1:
	.ascii	"fork() failed.\000"
	.align	2
.LC2:
	.ascii	"This is the child process.\000"
	.align	2
.LC3:
	.ascii	"Usage: Supply one integer argument greater than 0, "
	.ascii	"e.g. \"a.out 8\". The argument is converted to unsi"
	.ascii	"gned long using strtoul().\000"
	.align	2
.LC4:
	.ascii	"Failed to convert argument '%s' to unsigned long. O"
	.ascii	"verflow.\012\000"
	.align	2
.LC5:
	.ascii	"Fuck\000"
	.align	2
.LC6:
	.ascii	"Failed to convert argument '%s' to unsigned long. N"
	.ascii	"o conversion.\012\000"
	.align	2
.LC7:
	.ascii	"Argument must be greater than 0.\000"
	.align	2
.LC8:
	.ascii	"Parent process is about to wait().\000"
	.align	2
.LC9:
	.ascii	"Parent process returned from wait().\000"
	.align	2
.LC10:
	.ascii	"the_stack_data/171511.c\000"
	.align	2
.LC11:
	.ascii	"pid == cpid\000"
	.align	2
.LC12:
	.ascii	"Child process terminated with status value = %d.\012"
	.ascii	"\000"
	.align	2
.LC13:
	.ascii	"Child process terminated abnormally.\000"
	.align	2
.LC14:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r3, .L15
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r0, .L15+4
	bl	puts
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bge	.L2
	ldr	r0, .L15+8
	bl	puts
	b	.L3
.L2:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L4
	ldr	r0, .L15+12
	bl	puts
	ldr	r3, [fp, #-32]
	cmp	r3, #2
	bne	.L5
	ldr	r3, [fp, #-36]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #45
	bne	.L6
.L5:
	ldr	r0, .L15+16
	bl	puts
	mov	r3, #1
	b	.L13
.L6:
	bl	__errno_location
	mov	r3, r0
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-36]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r2, #10
	mov	r1, #0
	mov	r0, r3
	bl	strtoul
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	bne	.L8
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #34
	bne	.L8
	ldr	r3, [fp, #-36]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L15+20
	bl	printf
	ldr	r0, .L15+24
	bl	perror
	mov	r3, #2
	b	.L13
.L8:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L9
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #22
	bne	.L9
	ldr	r3, [fp, #-36]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L15+28
	bl	printf
	ldr	r0, .L15+24
	bl	perror
	mov	r3, #3
	b	.L13
.L9:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L10
	ldr	r0, .L15+32
	bl	puts
	mov	r3, #4
	b	.L13
.L10:
	ldr	r0, [fp, #-12]
	bl	print_collatz
	b	.L3
.L4:
	ldr	r0, .L15+36
	bl	puts
	sub	r3, fp, #24
	mov	r0, r3
	bl	wait
	str	r0, [fp, #-16]
	ldr	r0, .L15+40
	bl	puts
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	beq	.L11
	ldr	r3, .L15+44
	mov	r2, #62
	ldr	r1, .L15+48
	ldr	r0, .L15+52
	bl	__assert_fail
.L11:
	ldr	r3, [fp, #-24]
	and	r3, r3, #127
	cmp	r3, #0
	bne	.L12
	ldr	r3, [fp, #-24]
	asr	r3, r3, #8
	and	r3, r3, #255
	mov	r1, r3
	ldr	r0, .L15+56
	bl	printf
	b	.L3
.L12:
	ldr	r0, .L15+60
	bl	puts
.L3:
	mov	r3, #0
.L13:
	ldr	r2, .L15
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L14
	bl	__stack_chk_fail
.L14:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	.LC14
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	__PRETTY_FUNCTION__.5748
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.size	main, .-main
	.section	.rodata
	.align	2
.LC15:
	.ascii	"n > 0\000"
	.align	2
.LC16:
	.ascii	"1.\000"
	.align	2
.LC17:
	.ascii	"%lu, \000"
	.text
	.align	2
	.global	print_collatz
	.syntax unified
	.arm
	.fpu softvfp
	.type	print_collatz, %function
print_collatz:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L18
	ldr	r3, .L23
	mov	r2, #79
	ldr	r1, .L23+4
	ldr	r0, .L23+8
	bl	__assert_fail
.L18:
	ldr	r3, [fp, #-8]
	cmp	r3, #1
	bne	.L19
	ldr	r0, .L23+12
	bl	puts
	b	.L17
.L19:
	ldr	r1, [fp, #-8]
	ldr	r0, .L23+16
	bl	printf
	ldr	r3, [fp, #-8]
	and	r3, r3, #1
	cmp	r3, #0
	bne	.L21
	ldr	r3, [fp, #-8]
	lsr	r3, r3, #1
	str	r3, [fp, #-8]
	b	.L22
.L21:
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L22:
	ldr	r0, [fp, #-8]
	bl	print_collatz
.L17:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	__PRETTY_FUNCTION__.5753
	.word	.LC10
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.size	print_collatz, .-print_collatz
	.section	.rodata
	.align	2
	.type	__PRETTY_FUNCTION__.5748, %object
	.size	__PRETTY_FUNCTION__.5748, 5
__PRETTY_FUNCTION__.5748:
	.ascii	"main\000"
	.align	2
	.type	__PRETTY_FUNCTION__.5753, %object
	.size	__PRETTY_FUNCTION__.5753, 14
__PRETTY_FUNCTION__.5753:
	.ascii	"print_collatz\000"
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
