	.file	"817696.c"
	.intel_syntax noprefix
	.text
	.globl	g_counter
	.bss
	.align 4
	.type	g_counter, @object
	.size	g_counter, 4
g_counter:
	.zero	4
	.section	.rodata
	.align 8
.LC0:
	.string	"Error: failed to create thread %ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 3936
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -8024[rbp], 1
	jmp	.L2
.L5:
	mov	rax, QWORD PTR -8024[rbp]
	mov	rdx, QWORD PTR -8024[rbp]
	sub	rdx, 1
	lea	rcx, -8016[rbp]
	sal	rdx, 3
	lea	rdi, [rcx+rdx]
	mov	rcx, rax
	lea	rdx, ThreadFunction[rip]
	mov	esi, 0
	call	pthread_create@PLT
	mov	DWORD PTR -8028[rbp], eax
	cmp	DWORD PTR -8028[rbp], 0
	je	.L3
	mov	rax, QWORD PTR -8024[rbp]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L8
.L3:
	add	QWORD PTR -8024[rbp], 1
.L2:
	cmp	QWORD PTR -8024[rbp], 1000
	jbe	.L5
	mov	QWORD PTR -8024[rbp], 0
	jmp	.L6
.L7:
	mov	rax, QWORD PTR -8024[rbp]
	mov	rax, QWORD PTR -8016[rbp+rax*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	add	QWORD PTR -8024[rbp], 1
.L6:
	cmp	QWORD PTR -8024[rbp], 999
	jbe	.L7
	mov	eax, 0
.L8:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.string	"In thread %ld - Local: %ld, Global: %d\n"
	.text
	.globl	ThreadFunction
	.type	ThreadFunction, @function
ThreadFunction:
.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	QWORD PTR -8[rbp], 0
	jmp	.L11
.L12:
	mov	eax, DWORD PTR g_counter[rip]
	add	eax, 1
	mov	DWORD PTR g_counter[rip], eax
	mov	ecx, DWORD PTR g_counter[rip]
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	add	QWORD PTR -8[rbp], 1
.L11:
	cmp	QWORD PTR -8[rbp], 9999
	jbe	.L12
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE1:
	.size	ThreadFunction, .-ThreadFunction
	.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	"817696.c"
	.text
	.global	g_counter
	.bss
	.align	2
	.type	g_counter, %object
	.size	g_counter, 4
g_counter:
	.space	4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Error: failed to create thread %ld\012\000"
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 4016
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #4016
	ldr	r3, .L10
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #1
	str	r3, [fp, #-4016]
	b	.L2
.L5:
	ldr	r3, [fp, #-4016]
	sub	r2, r3, #1
	sub	r3, fp, #4000
	sub	r3, r3, #4
	sub	r3, r3, #4
	lsl	r2, r2, #2
	add	r0, r3, r2
	ldr	r3, [fp, #-4016]
	ldr	r2, .L10+4
	mov	r1, #0
	bl	pthread_create
	str	r0, [fp, #-4012]
	ldr	r3, [fp, #-4012]
	cmp	r3, #0
	beq	.L3
	ldr	r1, [fp, #-4016]
	ldr	r0, .L10+8
	bl	printf
	mov	r3, #1
	b	.L8
.L3:
	ldr	r3, [fp, #-4016]
	add	r3, r3, #1
	str	r3, [fp, #-4016]
.L2:
	ldr	r3, [fp, #-4016]
	cmp	r3, #1000
	bls	.L5
	mov	r3, #0
	str	r3, [fp, #-4016]
	b	.L6
.L7:
	ldr	r3, [fp, #-4016]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-4004]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-4016]
	add	r3, r3, #1
	str	r3, [fp, #-4016]
.L6:
	ldr	r3, [fp, #-4016]
	cmp	r3, #1000
	bcc	.L7
	mov	r3, #0
.L8:
	ldr	r2, .L10
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L9
	bl	__stack_chk_fail
.L9:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC1
	.word	ThreadFunction
	.word	.LC0
	.size	main, .-main
	.section	.rodata
	.align	2
.LC2:
	.ascii	"In thread %ld - Local: %ld, Global: %d\012\000"
	.text
	.align	2
	.global	ThreadFunction
	.syntax unified
	.arm
	.fpu softvfp
	.type	ThreadFunction, %function
ThreadFunction:
	@ 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, #0
	str	r3, [fp, #-8]
	b	.L13
.L14:
	ldr	r3, .L15
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L15
	str	r3, [r2]
	ldr	r1, [fp, #-16]
	ldr	r3, .L15
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	ldr	r0, .L15+4
	bl	printf
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L13:
	ldr	r3, [fp, #-8]
	ldr	r2, .L15+8
	cmp	r3, r2
	bls	.L14
	mov	r0, #0
	bl	pthread_exit
.L16:
	.align	2
.L15:
	.word	g_counter
	.word	.LC2
	.word	9999
	.size	ThreadFunction, .-ThreadFunction
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
