	.file	"657291.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"test.log"
	.align 8
.LC1:
	.string	"Error while opening test.log for writing (initial)"
.LC2:
	.string	"PROGRAM STARTED...\n"
	.align 8
.LC3:
	.string	"Error occured while trying to fork()\n"
	.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, 16
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edx, 420
	mov	esi, 577
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -16[rbp], eax
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, -1
	jne	.L2
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L7
.L2:
	mov	eax, DWORD PTR -16[rbp]
	mov	edx, 19
	lea	rsi, .LC2[rip]
	mov	edi, eax
	call	write@PLT
	call	fork@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], 0
	jns	.L4
	mov	eax, DWORD PTR -16[rbp]
	mov	edx, 37
	lea	rsi, .LC3[rip]
	mov	edi, eax
	call	write@PLT
	mov	eax, DWORD PTR -16[rbp]
	mov	edi, eax
	call	close@PLT
	jmp	.L5
.L4:
	cmp	DWORD PTR -12[rbp], 0
	jne	.L6
	mov	eax, 0
	call	childProcess
	jmp	.L5
.L6:
	lea	rax, -16[rbp]
	mov	rdi, rax
	call	parentProcess
.L5:
	mov	eax, 0
.L7:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC4:
	.string	"The child has been created, exiting now...\n"
	.text
	.globl	parentProcess
	.type	parentProcess, @function
parentProcess:
.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
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	edx, 43
	lea	rsi, .LC4[rip]
	mov	edi, eax
	call	write@PLT
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE7:
	.size	parentProcess, .-parentProcess
	.section	.rodata
.LC5:
	.string	"Error while calling setsid()"
.LC6:
	.string	"/"
.LC7:
	.string	"/dev/null"
.LC8:
	.string	"PID: %d, GID: %d, SID: %d\n"
.LC9:
	.string	"/home/tayum/SysProg/test.log"
	.align 8
.LC10:
	.string	"Error while opening test.log for writing (from daemon)"
.LC11:
	.string	"PID: %d, Current time is: %s"
	.text
	.globl	childProcess
	.type	childProcess, @function
childProcess:
.LFB8:
	.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, 152
	.cfi_offset 3, -24
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	call	setsid@PLT
	mov	DWORD PTR -156[rbp], eax
	cmp	DWORD PTR -156[rbp], -1
	jne	.L11
	lea	rdi, .LC5[rip]
	call	puts@PLT
.L11:
	lea	rdi, .LC6[rip]
	call	chdir@PLT
	cmp	eax, -1
	jne	.L12
	lea	rdi, .LC5[rip]
	call	puts@PLT
.L12:
	mov	DWORD PTR -160[rbp], 0
	jmp	.L13
.L14:
	mov	eax, DWORD PTR -160[rbp]
	mov	edi, eax
	call	close@PLT
	add	DWORD PTR -160[rbp], 1
.L13:
	cmp	DWORD PTR -160[rbp], 254
	jle	.L14
	mov	esi, 2
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	open@PLT
	mov	edi, 0
	call	dup@PLT
	mov	edi, 0
	call	dup@PLT
	call	getgid@PLT
	mov	ebx, eax
	call	getpid@PLT
	mov	edx, eax
	mov	ecx, DWORD PTR -156[rbp]
	lea	rax, -128[rbp]
	mov	r8d, ecx
	mov	ecx, ebx
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	mov	DWORD PTR -152[rbp], eax
	mov	edx, 420
	mov	esi, 1089
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -148[rbp], eax
	cmp	DWORD PTR -148[rbp], -1
	jne	.L15
	lea	rdi, .LC10[rip]
	call	puts@PLT
	nop
	mov	rax, QWORD PTR -24[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L18
	jmp	.L19
.L15:
	mov	eax, DWORD PTR -152[rbp]
	movsx	rdx, eax
	lea	rcx, -128[rbp]
	mov	eax, DWORD PTR -148[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	eax, DWORD PTR -148[rbp]
	mov	edi, eax
	call	close@PLT
.L17:
	mov	edi, 0
	call	time@PLT
	mov	QWORD PTR -144[rbp], rax
	lea	rax, -144[rbp]
	mov	rdi, rax
	call	ctime@PLT
	mov	QWORD PTR -136[rbp], rax
	call	getpid@PLT
	mov	ecx, eax
	mov	rax, QWORD PTR -136[rbp]
	mov	rdx, rax
	mov	esi, ecx
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L17
.L19:
	call	__stack_chk_fail@PLT
.L18:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	childProcess, .-childProcess
	.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	"657291.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"test.log\000"
	.align	2
.LC1:
	.ascii	"Error while opening test.log for writing (initial)\000"
	.align	2
.LC2:
	.ascii	"PROGRAM STARTED...\012\000"
	.align	2
.LC3:
	.ascii	"Error occured while trying to fork()\012\000"
	.align	2
.LC4:
	.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, .L9
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r2, #420
	ldr	r1, .L9+4
	ldr	r0, .L9+8
	bl	open
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	bne	.L2
	ldr	r0, .L9+12
	bl	puts
	mvn	r3, #0
	b	.L7
.L2:
	ldr	r3, [fp, #-16]
	mov	r2, #19
	ldr	r1, .L9+16
	mov	r0, r3
	bl	write
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bge	.L4
	ldr	r3, [fp, #-16]
	mov	r2, #37
	ldr	r1, .L9+20
	mov	r0, r3
	bl	write
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	close
	b	.L5
.L4:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L6
	bl	childProcess
	b	.L5
.L6:
	sub	r3, fp, #16
	mov	r0, r3
	bl	parentProcess
.L5:
	mov	r3, #0
.L7:
	ldr	r2, .L9
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L8
	bl	__stack_chk_fail
.L8:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC4
	.word	577
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	main, .-main
	.section	.rodata
	.align	2
.LC5:
	.ascii	"The child has been created, exiting now...\012\000"
	.text
	.align	2
	.global	parentProcess
	.syntax unified
	.arm
	.fpu softvfp
	.type	parentProcess, %function
parentProcess:
	@ 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]
	ldr	r3, [r3]
	mov	r2, #43
	ldr	r1, .L12
	mov	r0, r3
	bl	write
	mov	r0, #0
	bl	exit
.L13:
	.align	2
.L12:
	.word	.LC5
	.size	parentProcess, .-parentProcess
	.section	.rodata
	.align	2
.LC6:
	.ascii	"Error while calling setsid()\000"
	.align	2
.LC7:
	.ascii	"/\000"
	.align	2
.LC8:
	.ascii	"/dev/null\000"
	.align	2
.LC9:
	.ascii	"PID: %d, GID: %d, SID: %d\012\000"
	.align	2
.LC10:
	.ascii	"/home/tayum/SysProg/test.log\000"
	.align	2
.LC11:
	.ascii	"Error while opening test.log for writing (from daem"
	.ascii	"on)\000"
	.align	2
.LC12:
	.ascii	"PID: %d, Current time is: %s\000"
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	childProcess
	.syntax unified
	.arm
	.fpu softvfp
	.type	childProcess, %function
childProcess:
	@ args = 0, pretend = 0, frame = 128
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #140
	ldr	r3, .L24
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	bl	setsid
	str	r0, [fp, #-132]
	ldr	r3, [fp, #-132]
	cmn	r3, #1
	bne	.L15
	ldr	r0, .L24+4
	bl	puts
.L15:
	ldr	r0, .L24+8
	bl	chdir
	mov	r3, r0
	cmn	r3, #1
	bne	.L16
	ldr	r0, .L24+4
	bl	puts
.L16:
	mov	r3, #0
	str	r3, [fp, #-136]
	b	.L17
.L18:
	ldr	r0, [fp, #-136]
	bl	close
	ldr	r3, [fp, #-136]
	add	r3, r3, #1
	str	r3, [fp, #-136]
.L17:
	ldr	r3, [fp, #-136]
	cmp	r3, #254
	ble	.L18
	mov	r1, #2
	ldr	r0, .L24+12
	bl	open
	mov	r0, #0
	bl	dup
	mov	r0, #0
	bl	dup
	bl	getpid
	mov	r4, r0
	bl	getgid
	mov	r2, r0
	sub	r0, fp, #116
	ldr	r3, [fp, #-132]
	str	r3, [sp]
	mov	r3, r2
	mov	r2, r4
	ldr	r1, .L24+16
	bl	sprintf
	str	r0, [fp, #-128]
	mov	r2, #420
	ldr	r1, .L24+20
	ldr	r0, .L24+24
	bl	open
	str	r0, [fp, #-124]
	ldr	r3, [fp, #-124]
	cmn	r3, #1
	bne	.L19
	ldr	r0, .L24+28
	bl	puts
	nop
	ldr	r3, .L24
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L22
	b	.L23
.L19:
	ldr	r2, [fp, #-128]
	sub	r3, fp, #116
	mov	r1, r3
	ldr	r0, [fp, #-124]
	bl	write
	ldr	r0, [fp, #-124]
	bl	close
.L21:
	mov	r0, #0
	bl	time
	mov	r3, r0
	str	r3, [fp, #-140]
	sub	r3, fp, #140
	mov	r0, r3
	bl	ctime
	str	r0, [fp, #-120]
	bl	getpid
	mov	r3, r0
	ldr	r2, [fp, #-120]
	mov	r1, r3
	ldr	r0, .L24+32
	bl	printf
	b	.L21
.L23:
	bl	__stack_chk_fail
.L22:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L25:
	.align	2
.L24:
	.word	.LC13
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	1089
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.size	childProcess, .-childProcess
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
