	.file	"635120.c"
	.intel_syntax noprefix
	.text
	.globl	ts
	.data
	.align 16
	.type	ts, @object
	.size	ts, 16
ts:
	.quad	0
	.quad	10
	.local	global_variable
	.comm	global_variable,4,4
	.section	.rodata
.LC0:
	.string	"pthread_create failed..."
.LC1:
	.string	"pthread_join failed..."
	.align 8
.LC2:
	.string	"Final Value of Shared Variable is: %d\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, 64
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -40[rbp], 0
	jmp	.L2
.L5:
	mov	QWORD PTR -16[rbp], 0
	jmp	.L3
.L4:
	add	QWORD PTR -16[rbp], 1
	mov	rdx, QWORD PTR -16[rbp]
	lea	rax, -32[rbp]
	mov	rcx, rdx
	lea	rdx, thread_sub[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	DWORD PTR -36[rbp], eax
	mov	eax, DWORD PTR -36[rbp]
	lea	rsi, .LC0[rip]
	mov	edi, eax
	call	check_for_errors_and_terminate
	add	QWORD PTR -16[rbp], 1
	mov	rdx, QWORD PTR -16[rbp]
	lea	rax, -24[rbp]
	mov	rcx, rdx
	lea	rdx, thread_add[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	DWORD PTR -36[rbp], eax
	mov	eax, DWORD PTR -36[rbp]
	lea	rsi, .LC0[rip]
	mov	edi, eax
	call	check_for_errors_and_terminate
	mov	rax, QWORD PTR -32[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	DWORD PTR -36[rbp], eax
	mov	eax, DWORD PTR -36[rbp]
	lea	rsi, .LC1[rip]
	mov	edi, eax
	call	check_for_errors_and_terminate
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	DWORD PTR -36[rbp], eax
	mov	eax, DWORD PTR -36[rbp]
	lea	rsi, .LC1[rip]
	mov	edi, eax
	call	check_for_errors_and_terminate
.L3:
	cmp	QWORD PTR -16[rbp], 9
	jbe	.L4
	add	DWORD PTR -40[rbp], 1
.L2:
	cmp	DWORD PTR -40[rbp], 24
	jle	.L5
	mov	eax, DWORD PTR global_variable[rip]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.type	thread_sub, @function
thread_sub:
.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	eax, DWORD PTR global_variable[rip]
	mov	DWORD PTR -4[rbp], eax
	sub	DWORD PTR -4[rbp], 1
	mov	esi, 0
	lea	rdi, ts[rip]
	call	nanosleep@PLT
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR global_variable[rip], eax
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	print_thread_info
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	thread_sub, .-thread_sub
	.type	thread_add, @function
thread_add:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	eax, DWORD PTR global_variable[rip]
	mov	DWORD PTR -4[rbp], eax
	add	DWORD PTR -4[rbp], 1
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR global_variable[rip], eax
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	print_thread_info
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	thread_add, .-thread_add
	.section	.rodata
	.align 8
.LC3:
	.string	"Current Value written to Global Variables by thread: %6lu \tis %6d\n"
	.text
	.globl	print_thread_info
	.type	print_thread_info, @function
print_thread_info:
.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	QWORD PTR -8[rbp], rdi
	mov	edx, DWORD PTR global_variable[rip]
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	cdqe
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	print_thread_info, .-print_thread_info
	.globl	check_for_errors_and_terminate
	.type	check_for_errors_and_terminate, @function
check_for_errors_and_terminate:
.LFB10:
	.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
	cmp	DWORD PTR -4[rbp], 0
	je	.L16
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	exit@PLT
.L16:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	check_for_errors_and_terminate, .-check_for_errors_and_terminate
	.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	"635120.c"
	.text
	.global	ts
	.data
	.align	2
	.type	ts, %object
	.size	ts, 8
ts:
	.word	0
	.word	10
	.local	global_variable
	.comm	global_variable,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"pthread_create failed...\000"
	.align	2
.LC1:
	.ascii	"pthread_join failed...\000"
	.align	2
.LC2:
	.ascii	"Final Value of Shared Variable is: %d\012\000"
	.align	2
.LC3:
	.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, .L8
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L2
.L5:
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L3
.L4:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	sub	r0, fp, #28
	ldr	r2, .L8+4
	mov	r1, #0
	bl	pthread_create
	str	r0, [fp, #-12]
	ldr	r1, .L8+8
	ldr	r0, [fp, #-12]
	bl	check_for_errors_and_terminate
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	sub	r0, fp, #24
	ldr	r2, .L8+12
	mov	r1, #0
	bl	pthread_create
	str	r0, [fp, #-12]
	ldr	r1, .L8+8
	ldr	r0, [fp, #-12]
	bl	check_for_errors_and_terminate
	ldr	r3, [fp, #-28]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	str	r0, [fp, #-12]
	ldr	r1, .L8+16
	ldr	r0, [fp, #-12]
	bl	check_for_errors_and_terminate
	ldr	r3, [fp, #-24]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	str	r0, [fp, #-12]
	ldr	r1, .L8+16
	ldr	r0, [fp, #-12]
	bl	check_for_errors_and_terminate
.L3:
	ldr	r3, [fp, #-16]
	cmp	r3, #9
	bls	.L4
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L2:
	ldr	r3, [fp, #-20]
	cmp	r3, #24
	ble	.L5
	ldr	r3, .L8+20
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L8+24
	bl	printf
	mov	r3, #0
	ldr	r2, .L8
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L7
	bl	__stack_chk_fail
.L7:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L9:
	.align	2
.L8:
	.word	.LC3
	.word	thread_sub
	.word	.LC0
	.word	thread_add
	.word	.LC1
	.word	global_variable
	.word	.LC2
	.size	main, .-main
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread_sub, %function
thread_sub:
	@ 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, .L12
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	str	r3, [fp, #-8]
	mov	r1, #0
	ldr	r0, .L12+4
	bl	nanosleep
	ldr	r2, .L12
	ldr	r3, [fp, #-8]
	str	r3, [r2]
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	print_thread_info
	mov	r3, r0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L13:
	.align	2
.L12:
	.word	global_variable
	.word	ts
	.size	thread_sub, .-thread_sub
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread_add, %function
thread_add:
	@ 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, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r2, .L16
	ldr	r3, [fp, #-8]
	str	r3, [r2]
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	print_thread_info
	mov	r3, r0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	global_variable
	.size	thread_add, .-thread_add
	.section	.rodata
	.align	2
.LC4:
	.ascii	"Current Value written to Global Variables by thread"
	.ascii	": %6lu \011is %6d\012\000"
	.text
	.align	2
	.global	print_thread_info
	.syntax unified
	.arm
	.fpu softvfp
	.type	print_thread_info, %function
print_thread_info:
	@ 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, .L20
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, [fp, #-8]
	ldr	r0, .L20+4
	bl	printf
	mov	r3, r0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	global_variable
	.word	.LC4
	.size	print_thread_info, .-print_thread_info
	.align	2
	.global	check_for_errors_and_terminate
	.syntax unified
	.arm
	.fpu softvfp
	.type	check_for_errors_and_terminate, %function
check_for_errors_and_terminate:
	@ 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	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L24
	ldr	r0, [fp, #-12]
	bl	perror
	ldr	r0, [fp, #-8]
	bl	exit
.L24:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	check_for_errors_and_terminate, .-check_for_errors_and_terminate
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
