	.file	"123518.c"
	.intel_syntax noprefix
	.text
	.globl	program_time
	.data
	.align 4
	.type	program_time, @object
	.size	program_time, 4
program_time:
	.long	3
	.globl	num_threads
	.align 4
	.type	num_threads, @object
	.size	num_threads, 4
num_threads:
	.long	3
	.globl	fork_thread
	.bss
	.align 4
	.type	fork_thread, @object
	.size	fork_thread, 4
fork_thread:
	.zero	4
	.globl	start
	.align 16
	.type	start, @object
	.size	start, 16
start:
	.zero	16
	.text
	.globl	wait_for_time
	.type	wait_for_time, @function
wait_for_time:
.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	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
.L4:
	lea	rax, -32[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	gettimeofday@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rcx, QWORD PTR start[rip]
	mov	edx, DWORD PTR -36[rbp]
	movsx	rdx, edx
	add	rdx, rcx
	cmp	rax, rdx
	jge	.L7
	mov	edi, 1
	call	usleep@PLT
	jmp	.L4
.L7:
	nop
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	wait_for_time, .-wait_for_time
	.section	.rodata
.LC0:
	.string	"pid: %d, thread: %ld\n"
.LC1:
	.string	"\nabout to fork in thread %ld\n"
.LC2:
	.string	"fork failed"
.LC3:
	.string	"child pid: %d\n\n"
	.text
	.globl	my_thread
	.type	my_thread, @function
my_thread:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR -8[rbp], rax
	call	getpid@PLT
	mov	ecx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, rax
	mov	esi, ecx
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 2
	call	wait_for_time
	mov	eax, DWORD PTR fork_thread[rip]
	cdqe
	cmp	QWORD PTR -8[rbp], rax
	jne	.L9
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	call	fork@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], 0
	jns	.L10
	lea	rsi, .LC2[rip]
	mov	edi, 1
	mov	eax, 0
	call	errx@PLT
.L10:
	cmp	DWORD PTR -12[rbp], 0
	jne	.L9
	call	getpid@PLT
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
.L9:
	mov	edi, 3
	call	wait_for_time
	call	getpid@PLT
	mov	ecx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, rax
	mov	esi, ecx
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 4
	call	wait_for_time
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE7:
	.size	my_thread, .-my_thread
	.section	.rodata
.LC4:
	.string	"%d"
	.align 8
.LC5:
	.string	"num_threads = %d, fork_thread = %d\n\n"
.LC6:
	.string	"pthread_create failed"
	.text
	.globl	main
	.type	main, @function
main:
.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, 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
	cmp	DWORD PTR -36[rbp], 1
	jle	.L12
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rdx, num_threads[rip]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_sscanf@PLT
	test	eax, eax
	jg	.L13
.L12:
	mov	DWORD PTR num_threads[rip], 3
.L13:
	cmp	DWORD PTR -36[rbp], 2
	jle	.L14
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	lea	rdx, fork_thread[rip]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_sscanf@PLT
	test	eax, eax
	jg	.L15
.L14:
	mov	DWORD PTR fork_thread[rip], 0
.L15:
	mov	edx, DWORD PTR fork_thread[rip]
	mov	eax, DWORD PTR num_threads[rip]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	esi, 0
	lea	rdi, start[rip]
	call	gettimeofday@PLT
	mov	edi, 1
	call	wait_for_time
	mov	QWORD PTR -16[rbp], 1
	jmp	.L16
.L18:
	mov	rdx, QWORD PTR -16[rbp]
	lea	rax, -24[rbp]
	mov	rcx, rdx
	lea	rdx, my_thread[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	test	eax, eax
	je	.L17
	lea	rsi, .LC6[rip]
	mov	edi, 1
	mov	eax, 0
	call	errx@PLT
.L17:
	add	QWORD PTR -16[rbp], 1
.L16:
	mov	eax, DWORD PTR num_threads[rip]
	cdqe
	cmp	QWORD PTR -16[rbp], rax
	jle	.L18
	mov	edi, 0
	call	my_thread
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	"123518.c"
	.text
	.global	program_time
	.data
	.align	2
	.type	program_time, %object
	.size	program_time, 4
program_time:
	.word	3
	.global	num_threads
	.align	2
	.type	num_threads, %object
	.size	num_threads, 4
num_threads:
	.word	3
	.global	fork_thread
	.bss
	.align	2
	.type	fork_thread, %object
	.size	fork_thread, 4
fork_thread:
	.space	4
	.comm	start,8,4
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	wait_for_time
	.syntax unified
	.arm
	.fpu softvfp
	.type	wait_for_time, %function
wait_for_time:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	ldr	r3, .L8
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
.L4:
	sub	r3, fp, #16
	mov	r1, #0
	mov	r0, r3
	bl	gettimeofday
	ldr	r2, [fp, #-16]
	ldr	r3, .L8+4
	ldr	r1, [r3]
	ldr	r3, [fp, #-24]
	add	r3, r1, r3
	cmp	r2, r3
	bge	.L7
	mov	r0, #1
	bl	usleep
	b	.L4
.L7:
	nop
	nop
	ldr	r3, .L8
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L5
	bl	__stack_chk_fail
.L5:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L9:
	.align	2
.L8:
	.word	.LC0
	.word	start
	.size	wait_for_time, .-wait_for_time
	.section	.rodata
	.align	2
.LC1:
	.ascii	"pid: %d, thread: %ld\012\000"
	.align	2
.LC2:
	.ascii	"\012about to fork in thread %ld\012\000"
	.align	2
.LC3:
	.ascii	"fork failed\000"
	.align	2
.LC4:
	.ascii	"child pid: %d\012\012\000"
	.text
	.align	2
	.global	my_thread
	.syntax unified
	.arm
	.fpu softvfp
	.type	my_thread, %function
my_thread:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-12]
	bl	getpid
	mov	r3, r0
	ldr	r2, [fp, #-12]
	mov	r1, r3
	ldr	r0, .L13
	bl	printf
	mov	r0, #2
	bl	wait_for_time
	ldr	r3, .L13+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	bne	.L11
	ldr	r1, [fp, #-12]
	ldr	r0, .L13+8
	bl	printf
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L12
	ldr	r1, .L13+12
	mov	r0, #1
	bl	errx
.L12:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L11
	bl	getpid
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L13+16
	bl	printf
.L11:
	mov	r0, #3
	bl	wait_for_time
	bl	getpid
	mov	r3, r0
	ldr	r2, [fp, #-12]
	mov	r1, r3
	ldr	r0, .L13
	bl	printf
	mov	r0, #4
	bl	wait_for_time
	mov	r0, #0
	bl	exit
.L14:
	.align	2
.L13:
	.word	.LC1
	.word	fork_thread
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	my_thread, .-my_thread
	.section	.rodata
	.align	2
.LC5:
	.ascii	"%d\000"
	.align	2
.LC6:
	.ascii	"num_threads = %d, fork_thread = %d\012\012\000"
	.align	2
.LC7:
	.ascii	"pthread_create failed\000"
	.align	2
.LC8:
	.word	__stack_chk_guard
	.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	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	ldr	r3, .L25
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-24]
	cmp	r3, #1
	ble	.L16
	ldr	r3, [fp, #-28]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r2, .L25+4
	ldr	r1, .L25+8
	mov	r0, r3
	bl	__isoc99_sscanf
	mov	r3, r0
	cmp	r3, #0
	bgt	.L17
.L16:
	ldr	r3, .L25+4
	mov	r2, #3
	str	r2, [r3]
.L17:
	ldr	r3, [fp, #-24]
	cmp	r3, #2
	ble	.L18
	ldr	r3, [fp, #-28]
	add	r3, r3, #8
	ldr	r3, [r3]
	ldr	r2, .L25+12
	ldr	r1, .L25+8
	mov	r0, r3
	bl	__isoc99_sscanf
	mov	r3, r0
	cmp	r3, #0
	bgt	.L19
.L18:
	ldr	r3, .L25+12
	mov	r2, #0
	str	r2, [r3]
.L19:
	ldr	r3, .L25+4
	ldr	r3, [r3]
	ldr	r2, .L25+12
	ldr	r2, [r2]
	mov	r1, r3
	ldr	r0, .L25+16
	bl	printf
	mov	r1, #0
	ldr	r0, .L25+20
	bl	gettimeofday
	mov	r0, #1
	bl	wait_for_time
	mov	r3, #1
	str	r3, [fp, #-12]
	b	.L20
.L22:
	ldr	r3, [fp, #-12]
	sub	r0, fp, #16
	ldr	r2, .L25+24
	mov	r1, #0
	bl	pthread_create
	mov	r3, r0
	cmp	r3, #0
	beq	.L21
	ldr	r1, .L25+28
	mov	r0, #1
	bl	errx
.L21:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L20:
	ldr	r3, .L25+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	ble	.L22
	mov	r0, #0
	bl	my_thread
	mov	r3, #0
	ldr	r2, .L25
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L24
	bl	__stack_chk_fail
.L24:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L26:
	.align	2
.L25:
	.word	.LC8
	.word	num_threads
	.word	.LC5
	.word	fork_thread
	.word	.LC6
	.word	start
	.word	my_thread
	.word	.LC7
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
