	.file	"342951.c"
	.intel_syntax noprefix
	.text
	.local	mutex
	.comm	mutex,20120,32
	.local	data
	.comm	data,2012,32
	.local	stacks
	.comm	stacks,8241152,32
	.section	.rodata
.LC0:
	.string	"%i\n"
	.text
	.type	thread, @function
thread:
.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	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	add	eax, 1
	movsx	rdx, eax
	imul	rdx, rdx, -2109059487
	shr	rdx, 32
	add	edx, eax
	sar	edx, 8
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	mov	DWORD PTR -8[rbp], edx
	mov	edx, DWORD PTR -8[rbp]
	imul	edx, edx, 503
	sub	eax, edx
	mov	DWORD PTR -8[rbp], eax
.L4:
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	mov	rdx, rax
	lea	rax, mutex[rip]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, data[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L2
	mov	eax, DWORD PTR -4[rbp]
	lea	ecx, -1[rax]
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, data[rip]
	mov	DWORD PTR [rdx+rax], ecx
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	mov	rdx, rax
	lea	rax, mutex[rip]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	jmp	.L4
.L2:
	mov	eax, DWORD PTR -12[rbp]
	add	eax, 1
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	thread, .-thread
	.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, 96
	mov	DWORD PTR -84[rbp], edi
	mov	QWORD PTR -96[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -84[rbp], 2
	je	.L7
	mov	edi, 255
	call	exit@PLT
.L7:
	mov	rax, QWORD PTR -96[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR data[rip], eax
	lea	rax, -64[rbp]
	mov	rdi, rax
	call	pthread_attr_init@PLT
	mov	DWORD PTR -76[rbp], 0
	jmp	.L8
.L9:
	mov	eax, DWORD PTR -76[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	mov	rdx, rax
	lea	rax, mutex[rip]
	add	rax, rdx
	mov	esi, 0
	mov	rdi, rax
	call	pthread_mutex_init@PLT
	mov	eax, DWORD PTR -76[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	mov	rdx, rax
	lea	rax, mutex[rip]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR -76[rbp]
	cdqe
	sal	rax, 14
	mov	rdx, rax
	lea	rax, stacks[rip]
	lea	rcx, [rdx+rax]
	lea	rax, -64[rbp]
	mov	edx, 16384
	mov	rsi, rcx
	mov	rdi, rax
	call	pthread_attr_setstack@PLT
	mov	eax, DWORD PTR -76[rbp]
	cdqe
	mov	rdx, rax
	lea	rsi, -64[rbp]
	lea	rax, -72[rbp]
	mov	rcx, rdx
	lea	rdx, thread[rip]
	mov	rdi, rax
	call	pthread_create@PLT
	add	DWORD PTR -76[rbp], 1
.L8:
	cmp	DWORD PTR -76[rbp], 502
	jle	.L9
	lea	rdi, mutex[rip]
	call	pthread_mutex_unlock@PLT
	mov	rax, QWORD PTR -72[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@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
.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	"342951.c"
	.text
	.local	mutex
	.comm	mutex,12072,4
	.local	data
	.comm	data,2012,4
	.local	stacks
	.comm	stacks,8241152,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%i\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread, %function
thread:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	add	r2, r3, #1
	ldr	r3, .L6
	smull	r1, r3, r2, r3
	add	r3, r3, r2
	asr	r1, r3, #8
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #6
	sub	r3, r3, r1
	lsl	r3, r3, #3
	sub	r3, r3, r1
	sub	r3, r2, r3
	str	r3, [fp, #-12]
.L4:
	ldr	r2, [fp, #-16]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r2, r3
	ldr	r3, .L6+4
	add	r3, r2, r3
	mov	r0, r3
	bl	pthread_mutex_lock
	ldr	r2, .L6+8
	ldr	r3, [fp, #-16]
	ldr	r3, [r2, r3, lsl #2]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L2
	ldr	r3, [fp, #-8]
	sub	r2, r3, #1
	ldr	r1, .L6+8
	ldr	r3, [fp, #-12]
	str	r2, [r1, r3, lsl #2]
	ldr	r2, [fp, #-12]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r2, r3
	ldr	r3, .L6+4
	add	r3, r2, r3
	mov	r0, r3
	bl	pthread_mutex_unlock
	b	.L4
.L2:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	mov	r1, r3
	ldr	r0, .L6+12
	bl	printf
	mov	r0, #0
	bl	exit
.L7:
	.align	2
.L6:
	.word	-2109059487
	.word	mutex
	.word	data
	.word	.LC0
	.size	thread, .-thread
	.section	.rodata
	.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 = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #56
	str	r0, [fp, #-56]
	str	r1, [fp, #-60]
	ldr	r3, .L14
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-56]
	cmp	r3, #2
	beq	.L9
	mov	r0, #255
	bl	exit
.L9:
	ldr	r3, [fp, #-60]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	ldr	r2, .L14+4
	str	r3, [r2]
	sub	r3, fp, #44
	mov	r0, r3
	bl	pthread_attr_init
	mov	r3, #0
	str	r3, [fp, #-48]
	b	.L10
.L11:
	ldr	r2, [fp, #-48]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r2, r3
	ldr	r3, .L14+8
	add	r3, r2, r3
	mov	r1, #0
	mov	r0, r3
	bl	pthread_mutex_init
	ldr	r2, [fp, #-48]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r2, r3
	ldr	r3, .L14+8
	add	r3, r2, r3
	mov	r0, r3
	bl	pthread_mutex_lock
	ldr	r3, [fp, #-48]
	lsl	r3, r3, #14
	ldr	r2, .L14+12
	add	r1, r3, r2
	sub	r3, fp, #44
	mov	r2, #16384
	mov	r0, r3
	bl	pthread_attr_setstack
	ldr	r3, [fp, #-48]
	sub	r1, fp, #44
	sub	r0, fp, #52
	ldr	r2, .L14+16
	bl	pthread_create
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	str	r3, [fp, #-48]
.L10:
	ldr	r3, [fp, #-48]
	ldr	r2, .L14+20
	cmp	r3, r2
	ble	.L11
	ldr	r0, .L14+8
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-52]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	mov	r3, #0
	ldr	r2, .L14
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L13
	bl	__stack_chk_fail
.L13:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	.LC1
	.word	data
	.word	mutex
	.word	stacks
	.word	thread
	.word	502
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
