	.file	"20021.c"
	.intel_syntax noprefix
	.text
	.globl	counter
	.bss
	.align 32
	.type	counter, @object
	.size	counter, 80
counter:
	.zero	80
	.globl	lock
	.align 32
	.type	lock, @object
	.size	lock, 400
lock:
	.zero	400
	.text
	.globl	myThread
	.type	myThread, @function
myThread:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -4[rbp], eax
	mov	DWORD PTR -8[rbp], 0
	jmp	.L2
.L3:
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	lea	rdx, lock[rip]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, counter[rip]
	mov	rax, QWORD PTR [rdx+rax]
	lea	rcx, 1[rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, counter[rip]
	mov	QWORD PTR [rdx+rax], rcx
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	lea	rdx, lock[rip]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	add	DWORD PTR -8[rbp], 1
.L2:
	cmp	DWORD PTR -8[rbp], 999
	jle	.L3
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	myThread, .-myThread
	.section	.rodata
.LC0:
	.string	"Counter[%d]: %ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 144
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -132[rbp], 0
	jmp	.L5
.L7:
	nop
.L6:
	mov	eax, DWORD PTR -132[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	lea	rdx, lock[rip]
	add	rax, rdx
	mov	esi, 0
	mov	rdi, rax
	call	pthread_mutex_init@PLT
	test	eax, eax
	jne	.L6
	add	DWORD PTR -132[rbp], 1
.L5:
	cmp	DWORD PTR -132[rbp], 9
	jle	.L7
	mov	DWORD PTR -128[rbp], 0
	jmp	.L8
.L9:
	mov	edi, 4
	call	malloc@PLT
	mov	QWORD PTR -104[rbp], rax
	mov	rax, QWORD PTR -104[rbp]
	mov	edx, DWORD PTR -128[rbp]
	mov	DWORD PTR [rax], edx
	lea	rdx, -96[rbp]
	mov	eax, DWORD PTR -128[rbp]
	cdqe
	sal	rax, 3
	lea	rdi, [rdx+rax]
	mov	rax, QWORD PTR -104[rbp]
	mov	rcx, rax
	lea	rdx, myThread[rip]
	mov	esi, 0
	call	pthread_create@PLT
	add	DWORD PTR -128[rbp], 1
.L8:
	cmp	DWORD PTR -128[rbp], 9
	jle	.L9
	mov	DWORD PTR -124[rbp], 0
	jmp	.L10
.L13:
	mov	DWORD PTR -120[rbp], 0
	jmp	.L11
.L12:
	mov	eax, DWORD PTR -120[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	lea	rdx, lock[rip]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR -120[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, counter[rip]
	mov	rax, QWORD PTR [rdx+rax]
	lea	rcx, 1[rax]
	mov	eax, DWORD PTR -120[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, counter[rip]
	mov	QWORD PTR [rdx+rax], rcx
	mov	eax, DWORD PTR -120[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	lea	rdx, lock[rip]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	add	DWORD PTR -120[rbp], 1
.L11:
	cmp	DWORD PTR -120[rbp], 9
	jle	.L12
	add	DWORD PTR -124[rbp], 1
.L10:
	cmp	DWORD PTR -124[rbp], 999
	jle	.L13
	mov	DWORD PTR -116[rbp], 0
	jmp	.L14
.L15:
	mov	eax, DWORD PTR -116[rbp]
	cdqe
	mov	rax, QWORD PTR -96[rbp+rax*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	add	DWORD PTR -116[rbp], 1
.L14:
	cmp	DWORD PTR -116[rbp], 9
	jle	.L15
	mov	DWORD PTR -112[rbp], 0
	jmp	.L16
.L17:
	mov	eax, DWORD PTR -112[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, counter[rip]
	mov	rdx, QWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -112[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -112[rbp], 1
.L16:
	cmp	DWORD PTR -112[rbp], 9
	jle	.L17
	mov	DWORD PTR -108[rbp], 0
	jmp	.L18
.L20:
	nop
.L19:
	mov	eax, DWORD PTR -108[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	lea	rdx, lock[rip]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_destroy@PLT
	test	eax, eax
	jne	.L19
	add	DWORD PTR -108[rbp], 1
.L18:
	cmp	DWORD PTR -108[rbp], 9
	jle	.L20
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	"20021.c"
	.text
	.global	counter
	.bss
	.align	2
	.type	counter, %object
	.size	counter, 40
counter:
	.space	40
	.comm	lock,240,4
	.text
	.align	2
	.global	myThread
	.syntax unified
	.arm
	.fpu softvfp
	.type	myThread, %function
myThread:
	@ 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]
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L2
.L3:
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L4
	add	r3, r3, r2
	mov	r0, r3
	bl	pthread_mutex_lock
	ldr	r2, .L4+4
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #2]
	add	r2, r3, #1
	ldr	r1, .L4+4
	ldr	r3, [fp, #-8]
	str	r2, [r1, r3, lsl #2]
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L4
	add	r3, r3, r2
	mov	r0, r3
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L2:
	ldr	r3, [fp, #-12]
	cmp	r3, #1000
	blt	.L3
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L5:
	.align	2
.L4:
	.word	lock
	.word	counter
	.size	myThread, .-myThread
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Counter[%d]: %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 = 80
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #80
	ldr	r3, .L25
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-80]
	b	.L7
.L9:
	nop
.L8:
	ldr	r2, [fp, #-80]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L25+4
	add	r3, r3, r2
	mov	r1, #0
	mov	r0, r3
	bl	pthread_mutex_init
	mov	r3, r0
	cmp	r3, #0
	bne	.L8
	ldr	r3, [fp, #-80]
	add	r3, r3, #1
	str	r3, [fp, #-80]
.L7:
	ldr	r3, [fp, #-80]
	cmp	r3, #9
	ble	.L9
	mov	r3, #0
	str	r3, [fp, #-76]
	b	.L10
.L11:
	mov	r0, #4
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-52]
	ldr	r3, [fp, #-52]
	ldr	r2, [fp, #-76]
	str	r2, [r3]
	sub	r2, fp, #48
	ldr	r3, [fp, #-76]
	lsl	r3, r3, #2
	add	r0, r2, r3
	ldr	r3, [fp, #-52]
	ldr	r2, .L25+8
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-76]
	add	r3, r3, #1
	str	r3, [fp, #-76]
.L10:
	ldr	r3, [fp, #-76]
	cmp	r3, #9
	ble	.L11
	mov	r3, #0
	str	r3, [fp, #-72]
	b	.L12
.L15:
	mov	r3, #0
	str	r3, [fp, #-68]
	b	.L13
.L14:
	ldr	r2, [fp, #-68]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L25+4
	add	r3, r3, r2
	mov	r0, r3
	bl	pthread_mutex_lock
	ldr	r2, .L25+12
	ldr	r3, [fp, #-68]
	ldr	r3, [r2, r3, lsl #2]
	add	r2, r3, #1
	ldr	r1, .L25+12
	ldr	r3, [fp, #-68]
	str	r2, [r1, r3, lsl #2]
	ldr	r2, [fp, #-68]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L25+4
	add	r3, r3, r2
	mov	r0, r3
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-68]
	add	r3, r3, #1
	str	r3, [fp, #-68]
.L13:
	ldr	r3, [fp, #-68]
	cmp	r3, #9
	ble	.L14
	ldr	r3, [fp, #-72]
	add	r3, r3, #1
	str	r3, [fp, #-72]
.L12:
	ldr	r3, [fp, #-72]
	cmp	r3, #1000
	blt	.L15
	mov	r3, #0
	str	r3, [fp, #-64]
	b	.L16
.L17:
	ldr	r3, [fp, #-64]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-44]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-64]
	add	r3, r3, #1
	str	r3, [fp, #-64]
.L16:
	ldr	r3, [fp, #-64]
	cmp	r3, #9
	ble	.L17
	mov	r3, #0
	str	r3, [fp, #-60]
	b	.L18
.L19:
	ldr	r2, .L25+12
	ldr	r3, [fp, #-60]
	ldr	r3, [r2, r3, lsl #2]
	mov	r2, r3
	ldr	r1, [fp, #-60]
	ldr	r0, .L25+16
	bl	printf
	ldr	r3, [fp, #-60]
	add	r3, r3, #1
	str	r3, [fp, #-60]
.L18:
	ldr	r3, [fp, #-60]
	cmp	r3, #9
	ble	.L19
	mov	r3, #0
	str	r3, [fp, #-56]
	b	.L20
.L22:
	nop
.L21:
	ldr	r2, [fp, #-56]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L25+4
	add	r3, r3, r2
	mov	r0, r3
	bl	pthread_mutex_destroy
	mov	r3, r0
	cmp	r3, #0
	bne	.L21
	ldr	r3, [fp, #-56]
	add	r3, r3, #1
	str	r3, [fp, #-56]
.L20:
	ldr	r3, [fp, #-56]
	cmp	r3, #9
	ble	.L22
	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	.LC1
	.word	lock
	.word	myThread
	.word	counter
	.word	.LC0
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
