	.file	"413820.c"
	.intel_syntax noprefix
	.text
	.local	my_name
	.comm	my_name,4096,32
	.local	leader_final_action
	.comm	leader_final_action,4,4
	.section	.rodata
.LC0:
	.string	"1"
	.text
	.type	thread1, @function
thread1:
.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	QWORD PTR -8[rbp], rdi
	mov	edx, 1
	lea	rsi, .LC0[rip]
	mov	edi, 1
	call	write@PLT
.L2:
	call	pause@PLT
	jmp	.L2
	.cfi_endproc
.LFE6:
	.size	thread1, .-thread1
	.section	.rodata
.LC1:
	.string	"%d"
.LC2:
	.string	"2"
.LC3:
	.string	"exe"
.LC4:
	.string	"/proc/self/exe"
	.text
	.type	thread2, @function
thread2:
.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, 96
	mov	QWORD PTR -88[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edx, DWORD PTR leader_final_action[rip]
	lea	rax, -80[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	mov	edx, 1
	lea	rsi, .LC2[rip]
	mov	edi, 1
	call	write@PLT
	mov	edi, 20000
	call	usleep@PLT
	lea	rax, -80[rbp]
	mov	r8d, 0
	mov	rcx, rax
	lea	rdx, .LC3[rip]
	lea	rsi, .LC3[rip]
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	execl@PLT
	lea	rax, -80[rbp]
	mov	r8d, 0
	mov	rcx, rax
	lea	rdx, .LC3[rip]
	lea	rsi, .LC3[rip]
	lea	rdi, my_name[rip]
	mov	eax, 0
	call	execl@PLT
.L4:
	call	pause@PLT
	jmp	.L4
	.cfi_endproc
.LFE7:
	.size	thread2, .-thread2
	.type	thread_leader, @function
thread_leader:
.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, 16
	mov	DWORD PTR -4[rbp], 1
	jmp	.L7
.L8:
	mov	edi, 16384
	call	malloc@PLT
	add	rax, 16384
	mov	ecx, 0
	mov	edx, 331520
	mov	rsi, rax
	lea	rdi, thread1[rip]
	mov	eax, 0
	call	clone@PLT
	mov	edi, 20000
	call	usleep@PLT
.L7:
	sub	DWORD PTR -4[rbp], 1
	cmp	DWORD PTR -4[rbp], 0
	jns	.L8
	mov	edi, 16384
	call	malloc@PLT
	add	rax, 16384
	mov	ecx, 0
	mov	edx, 331520
	mov	rsi, rax
	lea	rdi, thread2[rip]
	mov	eax, 0
	call	clone@PLT
	mov	edx, DWORD PTR leader_final_action[rip]
	movsx	rax, edx
	imul	rax, rax, 1431655766
	shr	rax, 32
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	mov	ecx, eax
	add	ecx, ecx
	add	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	test	eax, eax
	je	.L9
	cmp	eax, 1
	je	.L12
	jmp	.L11
.L9:
	mov	esi, 42
	mov	edi, 60
	mov	eax, 0
	call	syscall@PLT
.L12:
	call	pause@PLT
	jmp	.L12
.L11:
	jmp	.L11
	.cfi_endproc
.LFE8:
	.size	thread_leader, .-thread_leader
	.section	.rodata
.LC5:
	.string	"%d: thread leader\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.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	DWORD PTR -4[rbp], edi
	mov	QWORD PTR -16[rbp], rsi
	mov	edx, 4095
	lea	rsi, my_name[rip]
	lea	rdi, .LC4[rip]
	call	readlink@PLT
	test	rax, rax
	jg	.L14
	mov	eax, 1
	jmp	.L15
.L14:
	mov	rax, QWORD PTR stdout[rip]
	mov	esi, 0
	mov	rdi, rax
	call	setbuf@PLT
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	je	.L16
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L16
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	add	eax, 1
	mov	DWORD PTR leader_final_action[rip], eax
	call	thread_leader
.L16:
	call	getpid@PLT
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	je	.L17
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	jmp	.L18
.L17:
	mov	eax, 1
.L18:
	mov	edi, eax
	call	alarm@PLT
	call	thread_leader
	mov	eax, 0
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	"413820.c"
	.text
	.local	my_name
	.comm	my_name,4096,4
	.local	leader_final_action
	.comm	leader_final_action,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"1\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread1, %function
thread1:
	@ 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]
	mov	r2, #1
	ldr	r1, .L3
	mov	r0, #1
	bl	write
.L2:
	bl	pause
	b	.L2
.L4:
	.align	2
.L3:
	.word	.LC0
	.size	thread1, .-thread1
	.section	.rodata
	.align	2
.LC1:
	.ascii	"%d\000"
	.align	2
.LC2:
	.ascii	"2\000"
	.align	2
.LC3:
	.ascii	"exe\000"
	.align	2
.LC4:
	.ascii	"/proc/self/exe\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread2, %function
thread2:
	@ args = 0, pretend = 0, frame = 80
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #88
	str	r0, [fp, #-80]
	ldr	r3, .L8
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L8+4
	ldr	r2, [r3]
	sub	r3, fp, #72
	ldr	r1, .L8+8
	mov	r0, r3
	bl	sprintf
	mov	r2, #1
	ldr	r1, .L8+12
	mov	r0, #1
	bl	write
	ldr	r0, .L8+16
	bl	usleep
	sub	r3, fp, #72
	mov	r2, #0
	str	r2, [sp]
	ldr	r2, .L8+20
	ldr	r1, .L8+20
	ldr	r0, .L8+24
	bl	execl
	sub	r3, fp, #72
	mov	r2, #0
	str	r2, [sp]
	ldr	r2, .L8+20
	ldr	r1, .L8+20
	ldr	r0, .L8+28
	bl	execl
.L6:
	bl	pause
	b	.L6
.L9:
	.align	2
.L8:
	.word	.LC5
	.word	leader_final_action
	.word	.LC1
	.word	.LC2
	.word	20000
	.word	.LC3
	.word	.LC4
	.word	my_name
	.size	thread2, .-thread2
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread_leader, %function
thread_leader:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	mov	r3, #1
	str	r3, [fp, #-8]
	b	.L11
.L12:
	mov	r0, #16384
	bl	malloc
	mov	r3, r0
	add	r1, r3, #16384
	mov	r3, #0
	ldr	r2, .L17
	ldr	r0, .L17+4
	bl	clone
	ldr	r0, .L17+8
	bl	usleep
.L11:
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L12
	mov	r0, #16384
	bl	malloc
	mov	r3, r0
	add	r1, r3, #16384
	mov	r3, #0
	ldr	r2, .L17
	ldr	r0, .L17+12
	bl	clone
	ldr	r3, .L17+16
	ldr	r1, [r3]
	ldr	r3, .L17+20
	smull	r0, r2, r3, r1
	asr	r3, r1, #31
	sub	r3, r2, r3
	mov	r2, r3
	lsl	r2, r2, #1
	add	r2, r2, r3
	sub	r3, r1, r2
	cmp	r3, #0
	beq	.L13
	cmp	r3, #1
	beq	.L16
	b	.L15
.L13:
	mov	r1, #42
	mov	r0, #1
	bl	syscall
.L16:
	bl	pause
	b	.L16
.L15:
	b	.L15
.L18:
	.align	2
.L17:
	.word	331520
	.word	thread1
	.word	20000
	.word	thread2
	.word	leader_final_action
	.word	1431655766
	.size	thread_leader, .-thread_leader
	.section	.rodata
	.align	2
.LC6:
	.ascii	"%d: thread leader\012\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
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	ldr	r2, .L25
	ldr	r1, .L25+4
	ldr	r0, .L25+8
	bl	readlink
	mov	r3, r0
	cmp	r3, #0
	bgt	.L20
	mov	r3, #1
	b	.L21
.L20:
	ldr	r3, .L25+12
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	setbuf
	ldr	r3, [fp, #-12]
	add	r3, r3, #4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L22
	ldr	r3, [fp, #-12]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L25+16
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L22
	ldr	r3, [fp, #-12]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	add	r3, r3, #1
	ldr	r2, .L25+20
	str	r3, [r2]
	bl	thread_leader
.L22:
	bl	getpid
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L25+24
	bl	printf
	ldr	r3, [fp, #-12]
	add	r3, r3, #4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L23
	ldr	r3, [fp, #-12]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	b	.L24
.L23:
	mov	r3, #1
.L24:
	mov	r0, r3
	bl	alarm
	bl	thread_leader
	mov	r3, #0
.L21:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L26:
	.align	2
.L25:
	.word	4095
	.word	my_name
	.word	.LC4
	.word	stdout
	.word	.LC3
	.word	leader_final_action
	.word	.LC6
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
