	.file	"630746.c"
	.intel_syntax noprefix
	.text
	.globl	stringtoint
	.type	stringtoint, @function
stringtoint:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -12[rbp], 0
	mov	QWORD PTR -8[rbp], 0
	jmp	.L2
.L3:
	mov	rdx, QWORD PTR -8[rbp]
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	mov	rcx, rax
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	sub	eax, 48
	cdqe
	add	rax, rcx
	mov	QWORD PTR -8[rbp], rax
	add	DWORD PTR -12[rbp], 1
.L2:
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L3
	mov	rax, QWORD PTR -8[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	stringtoint, .-stringtoint
	.section	.rodata
	.align 8
.LC0:
	.string	"ERROR: Invalid number of arguments passed, expected 4"
	.align 8
.LC1:
	.string	"Example: ./fork [Nc] [Np] [Tc] [Tp]"
.LC2:
	.string	"fork program starting"
.LC3:
	.string	"fork failed"
.LC4:
	.string	"This is the child"
.LC5:
	.string	"./child"
.LC6:
	.string	"Exec returned: %d\n"
.LC7:
	.string	"This is the parent"
.LC8:
	.string	"%s pid: %d\n"
	.align 8
.LC9:
	.string	"Waiting for child process to terminate."
.LC10:
	.string	"Child process terminated."
	.text
	.globl	main
	.type	main, @function
main:
.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, 64
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	cmp	DWORD PTR -52[rbp], 5
	je	.L6
	lea	rdi, .LC0[rip]
	call	puts@PLT
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L7
.L6:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	stringtoint
	mov	DWORD PTR -28[rbp], eax
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	stringtoint
	mov	DWORD PTR -24[rbp], eax
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	stringtoint
	mov	DWORD PTR -20[rbp], eax
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 32
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	stringtoint
	mov	DWORD PTR -16[rbp], eax
	lea	rdi, .LC2[rip]
	call	puts@PLT
	call	fork@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], -1
	je	.L8
	cmp	DWORD PTR -12[rbp], 0
	je	.L9
	jmp	.L15
.L8:
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L9:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 24
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	r8d, 0
	mov	rcx, rdx
	mov	rdx, rax
	lea	rsi, .LC4[rip]
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	execlp@PLT
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L11
.L15:
	lea	rax, .LC7[rip]
	mov	QWORD PTR -8[rbp], rax
	mov	eax, DWORD PTR -24[rbp]
	mov	DWORD PTR -36[rbp], eax
	mov	eax, DWORD PTR -16[rbp]
	mov	DWORD PTR -32[rbp], eax
	nop
.L11:
	jmp	.L12
.L14:
	mov	edx, DWORD PTR -12[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -32[rbp]
	mov	edi, eax
	call	sleep@PLT
	cmp	DWORD PTR -12[rbp], 0
	je	.L13
	lea	rdi, .LC9[rip]
	call	puts@PLT
	mov	edi, 0
	call	wait@PLT
	lea	rdi, .LC10[rip]
	call	puts@PLT
.L13:
	sub	DWORD PTR -36[rbp], 1
.L12:
	cmp	DWORD PTR -36[rbp], 0
	jg	.L14
	mov	eax, 0
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	"630746.c"
	.text
	.align	2
	.global	stringtoint
	.syntax unified
	.arm
	.fpu softvfp
	.type	stringtoint, %function
stringtoint:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	str	r0, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L2
.L3:
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	mov	r1, r3
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #48
	add	r3, r1, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L2:
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L3
	ldr	r3, [fp, #-8]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	stringtoint, .-stringtoint
	.section	.rodata
	.align	2
.LC0:
	.ascii	"ERROR: Invalid number of arguments passed, expected"
	.ascii	" 4\000"
	.align	2
.LC1:
	.ascii	"Example: ./fork [Nc] [Np] [Tc] [Tp]\000"
	.align	2
.LC2:
	.ascii	"fork program starting\000"
	.align	2
.LC3:
	.ascii	"fork failed\000"
	.align	2
.LC4:
	.ascii	"This is the child\000"
	.align	2
.LC5:
	.ascii	"./child\000"
	.align	2
.LC6:
	.ascii	"Exec returned: %d\012\000"
	.align	2
.LC7:
	.ascii	"This is the parent\000"
	.align	2
.LC8:
	.ascii	"%s pid: %d\012\000"
	.align	2
.LC9:
	.ascii	"Waiting for child process to terminate.\000"
	.align	2
.LC10:
	.ascii	"Child process terminated.\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	ldr	r3, [fp, #-40]
	cmp	r3, #5
	beq	.L6
	ldr	r0, .L16
	bl	puts
	ldr	r0, .L16+4
	bl	puts
	mvn	r3, #0
	b	.L7
.L6:
	ldr	r3, [fp, #-44]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	stringtoint
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-44]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	stringtoint
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-44]
	add	r3, r3, #12
	ldr	r3, [r3]
	mov	r0, r3
	bl	stringtoint
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-44]
	add	r3, r3, #16
	ldr	r3, [r3]
	mov	r0, r3
	bl	stringtoint
	str	r0, [fp, #-12]
	ldr	r0, .L16+8
	bl	puts
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	beq	.L8
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L9
	b	.L15
.L8:
	ldr	r0, .L16+12
	bl	perror
	mov	r0, #1
	bl	exit
.L9:
	ldr	r3, [fp, #-44]
	add	r3, r3, #4
	ldr	r2, [r3]
	ldr	r3, [fp, #-44]
	add	r3, r3, #12
	ldr	r3, [r3]
	mov	r1, #0
	str	r1, [sp]
	ldr	r1, .L16+16
	ldr	r0, .L16+20
	bl	execlp
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L16+24
	bl	printf
	b	.L11
.L15:
	ldr	r3, .L16+28
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-20]
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-12]
	str	r3, [fp, #-28]
	nop
.L11:
	b	.L12
.L14:
	ldr	r2, [fp, #-8]
	ldr	r1, [fp, #-36]
	ldr	r0, .L16+32
	bl	printf
	ldr	r3, [fp, #-28]
	mov	r0, r3
	bl	sleep
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L13
	ldr	r0, .L16+36
	bl	puts
	mov	r0, #0
	bl	wait
	ldr	r0, .L16+40
	bl	puts
.L13:
	ldr	r3, [fp, #-32]
	sub	r3, r3, #1
	str	r3, [fp, #-32]
.L12:
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bgt	.L14
	mov	r3, #0
.L7:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
