	.file	"694061.c"
	.intel_syntax noprefix
	.text
	.globl	npos
	.bss
	.align 4
	.type	npos, @object
	.size	npos, 4
npos:
	.zero	4
	.globl	mut
	.align 32
	.type	mut, @object
	.size	mut, 40
mut:
	.zero	40
	.globl	buf
	.align 32
	.type	buf, @object
	.size	buf, 40000000
buf:
	.zero	40000000
	.globl	pos
	.align 4
	.type	pos, @object
	.size	pos, 4
pos:
	.zero	4
	.globl	val
	.align 4
	.type	val, @object
	.size	val, 4
val:
	.zero	4
	.text
	.globl	fill
	.type	fill, @function
fill:
.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
.L4:
	lea	rdi, mut[rip]
	call	pthread_mutex_lock@PLT
	mov	edx, DWORD PTR pos[rip]
	mov	eax, DWORD PTR npos[rip]
	cmp	edx, eax
	jl	.L2
	lea	rdi, mut[rip]
	call	pthread_mutex_unlock@PLT
	mov	eax, 0
	jmp	.L5
.L2:
	mov	edx, DWORD PTR pos[rip]
	mov	eax, DWORD PTR val[rip]
	movsx	rdx, edx
	lea	rcx, 0[0+rdx*4]
	lea	rdx, buf[rip]
	mov	DWORD PTR [rcx+rdx], eax
	mov	eax, DWORD PTR pos[rip]
	add	eax, 1
	mov	DWORD PTR pos[rip], eax
	mov	eax, DWORD PTR val[rip]
	add	eax, 1
	mov	DWORD PTR val[rip], eax
	lea	rdi, mut[rip]
	call	pthread_mutex_unlock@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR [rax], edx
	jmp	.L4
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	fill, .-fill
	.section	.rodata
.LC0:
	.string	"ERROR: buf[%d] = %d\n"
	.text
	.globl	verify
	.type	verify, @function
verify:
.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	DWORD PTR -4[rbp], 0
	jmp	.L7
.L10:
	lea	rdi, mut[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR pos[rip]
	cmp	DWORD PTR -4[rbp], eax
	jle	.L8
	sub	DWORD PTR -4[rbp], 1
	lea	rdi, mut[rip]
	call	pthread_mutex_unlock@PLT
	jmp	.L9
.L8:
	lea	rdi, mut[rip]
	call	pthread_mutex_unlock@PLT
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, buf[rip]
	mov	eax, DWORD PTR [rdx+rax]
	cmp	DWORD PTR -4[rbp], eax
	je	.L9
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, buf[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
.L9:
	add	DWORD PTR -4[rbp], 1
.L7:
	mov	eax, DWORD PTR npos[rip]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L10
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	verify, .-verify
	.section	.rodata
.LC1:
	.string	"Usage: %s <nr_pos> <nr_thrs>\n"
.LC2:
	.string	"count[%d] = %d\n"
.LC3:
	.string	"total count = %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 1264
	mov	DWORD PTR -1252[rbp], edi
	mov	QWORD PTR -1264[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -1252[rbp], 3
	je	.L13
	mov	rax, QWORD PTR -1264[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L23
.L13:
	mov	rax, QWORD PTR -1264[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	cmp	eax, 9999999
	jg	.L15
	mov	rax, QWORD PTR -1264[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	jmp	.L16
.L15:
	mov	eax, 10000000
.L16:
	mov	DWORD PTR npos[rip], eax
	mov	rax, QWORD PTR -1264[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	cmp	eax, 99
	jg	.L17
	mov	rax, QWORD PTR -1264[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	jmp	.L18
.L17:
	mov	eax, 100
.L18:
	mov	DWORD PTR -1228[rbp], eax
	lea	rax, -1224[rbp]
	mov	ecx, 0
	lea	rdx, verify[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	DWORD PTR -1236[rbp], 0
	jmp	.L19
.L20:
	mov	eax, DWORD PTR -1236[rbp]
	cdqe
	mov	DWORD PTR -1216[rbp+rax*4], 0
	lea	rdx, -1216[rbp]
	mov	eax, DWORD PTR -1236[rbp]
	cdqe
	sal	rax, 2
	add	rdx, rax
	lea	rcx, -816[rbp]
	mov	eax, DWORD PTR -1236[rbp]
	cdqe
	sal	rax, 3
	add	rax, rcx
	mov	rcx, rdx
	lea	rdx, fill[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	add	DWORD PTR -1236[rbp], 1
.L19:
	mov	eax, DWORD PTR -1236[rbp]
	cmp	eax, DWORD PTR -1228[rbp]
	jl	.L20
	mov	DWORD PTR -1232[rbp], 0
	mov	DWORD PTR -1236[rbp], 0
	jmp	.L21
.L22:
	mov	eax, DWORD PTR -1236[rbp]
	cdqe
	mov	rax, QWORD PTR -816[rbp+rax*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	eax, DWORD PTR -1236[rbp]
	cdqe
	mov	edx, DWORD PTR -1216[rbp+rax*4]
	mov	eax, DWORD PTR -1236[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -1236[rbp]
	cdqe
	mov	eax, DWORD PTR -1216[rbp+rax*4]
	add	DWORD PTR -1232[rbp], eax
	add	DWORD PTR -1236[rbp], 1
.L21:
	mov	eax, DWORD PTR -1236[rbp]
	cmp	eax, DWORD PTR -1228[rbp]
	jl	.L22
	mov	eax, DWORD PTR -1232[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -1224[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	eax, 0
.L23:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	"694061.c"
	.text
	.comm	npos,4,4
	.global	mut
	.bss
	.align	2
	.type	mut, %object
	.size	mut, 24
mut:
	.space	24
	.comm	buf,40000000,4
	.global	pos
	.align	2
	.type	pos, %object
	.size	pos, 4
pos:
	.space	4
	.global	val
	.align	2
	.type	val, %object
	.size	val, 4
val:
	.space	4
	.text
	.align	2
	.global	fill
	.syntax unified
	.arm
	.fpu softvfp
	.type	fill, %function
fill:
	@ 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]
.L4:
	ldr	r0, .L6
	bl	pthread_mutex_lock
	ldr	r3, .L6+4
	ldr	r2, [r3]
	ldr	r3, .L6+8
	ldr	r3, [r3]
	cmp	r2, r3
	blt	.L2
	ldr	r0, .L6
	bl	pthread_mutex_unlock
	mov	r3, #0
	b	.L5
.L2:
	ldr	r3, .L6+4
	ldr	r3, [r3]
	ldr	r2, .L6+12
	ldr	r2, [r2]
	ldr	r1, .L6+16
	str	r2, [r1, r3, lsl #2]
	ldr	r3, .L6+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L6+4
	str	r3, [r2]
	ldr	r3, .L6+12
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L6+12
	str	r3, [r2]
	ldr	r0, .L6
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	add	r2, r3, #1
	ldr	r3, [fp, #-8]
	str	r2, [r3]
	b	.L4
.L5:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	mut
	.word	pos
	.word	npos
	.word	val
	.word	buf
	.size	fill, .-fill
	.section	.rodata
	.align	2
.LC0:
	.ascii	"ERROR: buf[%d] = %d\012\000"
	.text
	.align	2
	.global	verify
	.syntax unified
	.arm
	.fpu softvfp
	.type	verify, %function
verify:
	@ 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	.L9
.L12:
	ldr	r0, .L14
	bl	pthread_mutex_lock
	ldr	r3, .L14+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	ble	.L10
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r0, .L14
	bl	pthread_mutex_unlock
	b	.L11
.L10:
	ldr	r0, .L14
	bl	pthread_mutex_unlock
	ldr	r2, .L14+8
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #2]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	beq	.L11
	ldr	r2, .L14+8
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #2]
	mov	r2, r3
	ldr	r1, [fp, #-8]
	ldr	r0, .L14+12
	bl	printf
.L11:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L9:
	ldr	r3, .L14+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L12
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	mut
	.word	pos
	.word	buf
	.word	.LC0
	.word	npos
	.size	verify, .-verify
	.section	.rodata
	.align	2
.LC1:
	.ascii	"Usage: %s <nr_pos> <nr_thrs>\012\000"
	.align	2
.LC2:
	.ascii	"count[%d] = %d\012\000"
	.align	2
.LC3:
	.ascii	"total count = %d\012\000"
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 832
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #832
	str	r0, [fp, #-832]
	str	r1, [fp, #-836]
	ldr	r3, .L29
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-832]
	cmp	r3, #3
	beq	.L17
	ldr	r3, [fp, #-836]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L29+4
	bl	printf
	mov	r3, #1
	b	.L27
.L17:
	ldr	r3, [fp, #-836]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	ldr	r2, .L29+8
	cmp	r3, r2
	bgt	.L19
	ldr	r3, [fp, #-836]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	b	.L20
.L19:
	ldr	r3, .L29+12
.L20:
	ldr	r2, .L29+16
	str	r3, [r2]
	ldr	r3, [fp, #-836]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	cmp	r3, #99
	bgt	.L21
	ldr	r3, [fp, #-836]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	b	.L22
.L21:
	mov	r3, #100
.L22:
	str	r3, [fp, #-812]
	sub	r0, fp, #824
	mov	r3, #0
	ldr	r2, .L29+20
	mov	r1, #0
	bl	pthread_create
	mov	r3, #0
	str	r3, [fp, #-820]
	b	.L23
.L24:
	ldr	r3, [fp, #-820]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3, #-804]
	sub	r2, fp, #408
	ldr	r3, [fp, #-820]
	lsl	r3, r3, #2
	add	r0, r2, r3
	sub	r2, fp, #808
	ldr	r3, [fp, #-820]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, .L29+24
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-820]
	add	r3, r3, #1
	str	r3, [fp, #-820]
.L23:
	ldr	r2, [fp, #-820]
	ldr	r3, [fp, #-812]
	cmp	r2, r3
	blt	.L24
	mov	r3, #0
	str	r3, [fp, #-816]
	mov	r3, #0
	str	r3, [fp, #-820]
	b	.L25
.L26:
	ldr	r3, [fp, #-820]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-404]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-820]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-804]
	mov	r2, r3
	ldr	r1, [fp, #-820]
	ldr	r0, .L29+28
	bl	printf
	ldr	r3, [fp, #-820]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-804]
	ldr	r2, [fp, #-816]
	add	r3, r2, r3
	str	r3, [fp, #-816]
	ldr	r3, [fp, #-820]
	add	r3, r3, #1
	str	r3, [fp, #-820]
.L25:
	ldr	r2, [fp, #-820]
	ldr	r3, [fp, #-812]
	cmp	r2, r3
	blt	.L26
	ldr	r1, [fp, #-816]
	ldr	r0, .L29+32
	bl	printf
	ldr	r3, [fp, #-824]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	mov	r3, #0
.L27:
	ldr	r2, .L29
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L28
	bl	__stack_chk_fail
.L28:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L30:
	.align	2
.L29:
	.word	.LC4
	.word	.LC1
	.word	9999999
	.word	10000000
	.word	npos
	.word	verify
	.word	fill
	.word	.LC2
	.word	.LC3
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
