	.file	"496036.c"
	.intel_syntax noprefix
	.text
	.globl	global_var
	.bss
	.align 4
	.type	global_var, @object
	.size	global_var, 4
global_var:
	.zero	4
	.globl	thread_counter
	.section	.tbss,"awT",@nobits
	.align 4
	.type	thread_counter, @object
	.size	thread_counter, 4
thread_counter:
	.zero	4
	.section	.rodata
.LC0:
	.string	"  thread1 %d\n"
	.align 8
.LC1:
	.string	"  End of thread1 - global_var=%d  thread_counter=%d\n"
	.text
	.globl	thread1
	.type	thread1, @function
thread1:
.LFB0:
	.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	DWORD PTR -4[rbp], 1
	jmp	.L2
.L3:
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -4[rbp], 1
	mov	edx, DWORD PTR global_var[rip]
	mov	eax, DWORD PTR -4[rbp]
	add	eax, edx
	mov	DWORD PTR global_var[rip], eax
	mov	eax, DWORD PTR fs:thread_counter@tpoff
	add	eax, 1
	mov	DWORD PTR fs:thread_counter@tpoff, eax
	mov	edi, 1
	call	sleep@PLT
.L2:
	cmp	DWORD PTR -4[rbp], 12
	jle	.L3
	mov	edx, DWORD PTR fs:thread_counter@tpoff
	mov	eax, DWORD PTR global_var[rip]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	thread1, .-thread1
	.section	.rodata
	.align 8
.LC2:
	.string	"\t\t  thread2 %d  global_var=%d\n"
	.align 8
.LC3:
	.string	"\t\t  End of thread2 - global_var=%d  thread_counter=%d\n"
	.text
	.globl	thread2
	.type	thread2, @function
thread2:
.LFB1:
	.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	DWORD PTR fs:thread_counter@tpoff, 1
	mov	DWORD PTR -4[rbp], 1
	jmp	.L6
.L7:
	mov	edx, DWORD PTR global_var[rip]
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR fs:thread_counter@tpoff
	imul	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR fs:thread_counter@tpoff, eax
	mov	edi, 3
	call	sleep@PLT
	add	DWORD PTR -4[rbp], 1
.L6:
	cmp	DWORD PTR -4[rbp], 3
	jle	.L7
	mov	edx, DWORD PTR fs:thread_counter@tpoff
	mov	eax, DWORD PTR global_var[rip]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	thread2, .-thread2
	.section	.rodata
	.align 8
.LC4:
	.string	"Starting threads - global_var=%d  thread_counter=%d\n"
	.align 8
.LC5:
	.string	"Threads complete - global_var=%d  thread_counter=%d\n"
.LC6:
	.string	"  Thread 1 returned %d\n"
.LC7:
	.string	"  Thread 2 returned %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR fs:thread_counter@tpoff, 10
	mov	edx, DWORD PTR fs:thread_counter@tpoff
	mov	eax, DWORD PTR global_var[rip]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -24[rbp]
	mov	edx, 0
	lea	rsi, thread1[rip]
	mov	rdi, rax
	call	thrd_create@PLT
	lea	rax, -16[rbp]
	mov	edx, 0
	lea	rsi, thread2[rip]
	mov	rdi, rax
	call	thrd_create@PLT
	mov	rax, QWORD PTR -24[rbp]
	lea	rdx, -32[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	thrd_join@PLT
	mov	rax, QWORD PTR -16[rbp]
	lea	rdx, -28[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	thrd_join@PLT
	mov	edi, 10
	call	putchar@PLT
	mov	edx, DWORD PTR fs:thread_counter@tpoff
	mov	eax, DWORD PTR global_var[rip]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -32[rbp]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -28[rbp]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	"496036.c"
	.text
	.global	global_var
	.bss
	.align	2
	.type	global_var, %object
	.size	global_var, 4
global_var:
	.space	4
	.global	thread_counter
	.section	.tbss,"awT",%nobits
	.align	2
	.type	thread_counter, %object
	.size	thread_counter, 4
thread_counter:
	.space	4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"  thread1 %d\012\000"
	.align	2
.LC1:
	.ascii	"  End of thread1 - global_var=%d  thread_counter=%d"
	.ascii	"\012\000"
	.text
	.align	2
	.global	thread1
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread1, %function
thread1:
	@ 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]
	mov	r3, #1
	str	r3, [fp, #-8]
	b	.L2
.L3:
	ldr	r1, [fp, #-8]
	ldr	r0, .L5
	bl	printf
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r3, .L5+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	ldr	r2, .L5+4
	str	r3, [r2]
	bl	__aeabi_read_tp	@ load_tp_soft
	mov	r3, r0
	ldr	r2, .L5+8
	ldr	r3, [r3, r2]
	add	r3, r3, #1
	bl	__aeabi_read_tp	@ load_tp_soft
	mov	r2, r0
	ldr	r1, .L5+8
	str	r3, [r2, r1]
	mov	r0, #1
	bl	sleep
.L2:
	ldr	r3, [fp, #-8]
	cmp	r3, #12
	ble	.L3
	ldr	r3, .L5+4
	ldr	r3, [r3]
	bl	__aeabi_read_tp	@ load_tp_soft
	mov	r2, r0
	ldr	r1, .L5+8
	ldr	r2, [r2, r1]
	mov	r1, r3
	ldr	r0, .L5+12
	bl	printf
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	.LC0
	.word	global_var
	.word	thread_counter(tpoff)
	.word	.LC1
	.size	thread1, .-thread1
	.section	.rodata
	.align	2
.LC2:
	.ascii	"\011\011  thread2 %d  global_var=%d\012\000"
	.align	2
.LC3:
	.ascii	"\011\011  End of thread2 - global_var=%d  thread_co"
	.ascii	"unter=%d\012\000"
	.text
	.align	2
	.global	thread2
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread2, %function
thread2:
	@ 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]
	bl	__aeabi_read_tp	@ load_tp_soft
	mov	r3, r0
	ldr	r2, .L11
	mov	r1, #1
	str	r1, [r3, r2]
	mov	r3, #1
	str	r3, [fp, #-8]
	b	.L8
.L9:
	ldr	r3, .L11+4
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, [fp, #-8]
	ldr	r0, .L11+8
	bl	printf
	bl	__aeabi_read_tp	@ load_tp_soft
	mov	r3, r0
	ldr	r2, .L11
	ldr	r3, [r3, r2]
	ldr	r2, [fp, #-8]
	mul	r3, r2, r3
	bl	__aeabi_read_tp	@ load_tp_soft
	mov	r2, r0
	ldr	r1, .L11
	str	r3, [r2, r1]
	mov	r0, #3
	bl	sleep
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L8:
	ldr	r3, [fp, #-8]
	cmp	r3, #3
	ble	.L9
	ldr	r3, .L11+4
	ldr	r3, [r3]
	bl	__aeabi_read_tp	@ load_tp_soft
	mov	r2, r0
	ldr	r1, .L11
	ldr	r2, [r2, r1]
	mov	r1, r3
	ldr	r0, .L11+12
	bl	printf
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	thread_counter(tpoff)
	.word	global_var
	.word	.LC2
	.word	.LC3
	.size	thread2, .-thread2
	.section	.rodata
	.align	2
.LC4:
	.ascii	"Starting threads - global_var=%d  thread_counter=%d"
	.ascii	"\012\000"
	.align	2
.LC5:
	.ascii	"Threads complete - global_var=%d  thread_counter=%d"
	.ascii	"\012\000"
	.align	2
.LC6:
	.ascii	"  Thread 1 returned %d\012\000"
	.align	2
.LC7:
	.ascii	"  Thread 2 returned %d\012\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
	ldr	r3, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	bl	__aeabi_read_tp	@ load_tp_soft
	mov	r3, r0
	ldr	r2, .L16+4
	mov	r1, #10
	str	r1, [r3, r2]
	ldr	r3, .L16+8
	ldr	r3, [r3]
	bl	__aeabi_read_tp	@ load_tp_soft
	mov	r2, r0
	ldr	r1, .L16+4
	ldr	r2, [r2, r1]
	mov	r1, r3
	ldr	r0, .L16+12
	bl	printf
	sub	r3, fp, #24
	mov	r2, #0
	ldr	r1, .L16+16
	mov	r0, r3
	bl	thrd_create
	sub	r3, fp, #20
	mov	r2, #0
	ldr	r1, .L16+20
	mov	r0, r3
	bl	thrd_create
	ldr	r3, [fp, #-24]
	sub	r2, fp, #16
	mov	r1, r2
	mov	r0, r3
	bl	thrd_join
	ldr	r3, [fp, #-20]
	sub	r2, fp, #12
	mov	r1, r2
	mov	r0, r3
	bl	thrd_join
	mov	r0, #10
	bl	putchar
	ldr	r3, .L16+8
	ldr	r3, [r3]
	bl	__aeabi_read_tp	@ load_tp_soft
	mov	r2, r0
	ldr	r1, .L16+4
	ldr	r2, [r2, r1]
	mov	r1, r3
	ldr	r0, .L16+24
	bl	printf
	ldr	r3, [fp, #-16]
	mov	r1, r3
	ldr	r0, .L16+28
	bl	printf
	ldr	r3, [fp, #-12]
	mov	r1, r3
	ldr	r0, .L16+32
	bl	printf
	mov	r3, #0
	ldr	r2, .L16
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L15
	bl	__stack_chk_fail
.L15:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC8
	.word	thread_counter(tpoff)
	.word	global_var
	.word	.LC4
	.word	thread1
	.word	thread2
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
