	.file	"145617.c"
	.intel_syntax noprefix
	.text
	.globl	val
	.bss
	.align 8
	.type	val, @object
	.size	val, 8
val:
	.zero	8
	.globl	need
	.align 8
	.type	need, @object
	.size	need, 8
need:
	.zero	8
	.globl	turn
	.align 4
	.type	turn, @object
	.size	turn, 4
turn:
	.zero	4
	.section	.rodata
.LC0:
	.string	"ID: %zu -- VAL: %ld\n"
	.text
	.globl	codet
	.type	codet, @function
codet:
.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, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -16[rbp], rax
	mov	DWORD PTR -20[rbp], 0
	jmp	.L2
.L9:
	mov	rax, QWORD PTR -16[rbp]
	lea	rdx, 0[0+rax*4]
	lea	rax, need[rip]
	mov	DWORD PTR [rdx+rax], 1
	mfence
	jmp	.L3
.L7:
	mfence
	mov	eax, DWORD PTR turn[rip]
	cdqe
	cmp	QWORD PTR -16[rbp], rax
	je	.L4
	mov	rax, QWORD PTR -16[rbp]
	lea	rdx, 0[0+rax*4]
	lea	rax, need[rip]
	mov	DWORD PTR [rdx+rax], 0
	jmp	.L5
.L6:
	call	sched_yield@PLT
.L5:
	mov	eax, DWORD PTR turn[rip]
	cdqe
	cmp	QWORD PTR -16[rbp], rax
	jne	.L6
	mov	rax, QWORD PTR -16[rbp]
	lea	rdx, 0[0+rax*4]
	lea	rax, need[rip]
	mov	DWORD PTR [rdx+rax], 1
.L4:
	mfence
.L3:
	mov	eax, 1
	sub	rax, QWORD PTR -16[rbp]
	lea	rdx, 0[0+rax*4]
	lea	rax, need[rip]
	mov	eax, DWORD PTR [rdx+rax]
	test	eax, eax
	jne	.L7
	mov	rax, QWORD PTR val[rip]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 1
	mov	QWORD PTR val[rip], rax
	mov	ecx, DWORD PTR -20[rbp]
	movsx	rax, ecx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax, 2
	mov	esi, ecx
	sar	esi, 31
	sub	eax, esi
	mov	edx, eax
	mov	eax, edx
	sal	eax, 2
	add	eax, edx
	add	eax, eax
	sub	ecx, eax
	mov	edx, ecx
	test	edx, edx
	jne	.L8
	mov	rdx, QWORD PTR val[rip]
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
.L8:
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, eax
	mov	eax, 1
	sub	eax, edx
	mov	DWORD PTR turn[rip], eax
	mov	rax, QWORD PTR -16[rbp]
	lea	rdx, 0[0+rax*4]
	lea	rax, need[rip]
	mov	DWORD PTR [rdx+rax], 0
	add	DWORD PTR -20[rbp], 1
.L2:
	cmp	DWORD PTR -20[rbp], 199
	jle	.L9
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	codet, .-codet
	.section	.rodata
.LC1:
	.string	"%ld %d\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, 64
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edi, 0
	call	time@PLT
	mov	edi, eax
	call	srand@PLT
	mov	QWORD PTR -40[rbp], 0
	jmp	.L11
.L12:
	mov	rax, QWORD PTR -40[rbp]
	lea	rcx, -32[rbp]
	mov	rdx, QWORD PTR -40[rbp]
	sal	rdx, 3
	lea	rdi, [rcx+rdx]
	mov	rcx, rax
	lea	rdx, codet[rip]
	mov	esi, 0
	call	pthread_create@PLT
	add	QWORD PTR -40[rbp], 1
.L11:
	cmp	QWORD PTR -40[rbp], 1
	jbe	.L12
	mov	QWORD PTR -40[rbp], 0
	jmp	.L13
.L14:
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -32[rbp+rax*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	add	QWORD PTR -40[rbp], 1
.L13:
	cmp	QWORD PTR -40[rbp], 1
	jbe	.L14
	mov	rax, QWORD PTR val[rip]
	mov	edx, 400
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	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	"145617.c"
	.text
	.global	val
	.bss
	.align	2
	.type	val, %object
	.size	val, 4
val:
	.space	4
	.comm	need,8,4
	.comm	turn,4,4
	.global	__sync_synchronize
	.section	.rodata
	.align	2
.LC0:
	.ascii	"ID: %zu -- VAL: %ld\012\000"
	.text
	.align	2
	.global	codet
	.syntax unified
	.arm
	.fpu softvfp
	.type	codet, %function
codet:
	@ 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, #-12]
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L2
.L9:
	ldr	r2, .L10
	ldr	r3, [fp, #-12]
	mov	r1, #1
	str	r1, [r2, r3, lsl #2]
	bl	__sync_synchronize
	b	.L3
.L7:
	bl	__sync_synchronize
	ldr	r3, .L10+4
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r3, [fp, #-12]
	cmp	r3, r2
	beq	.L4
	ldr	r2, .L10
	ldr	r3, [fp, #-12]
	mov	r1, #0
	str	r1, [r2, r3, lsl #2]
	b	.L5
.L6:
	bl	sched_yield
.L5:
	ldr	r3, .L10+4
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r3, [fp, #-12]
	cmp	r3, r2
	bne	.L6
	ldr	r2, .L10
	ldr	r3, [fp, #-12]
	mov	r1, #1
	str	r1, [r2, r3, lsl #2]
.L4:
	bl	__sync_synchronize
.L3:
	ldr	r3, [fp, #-12]
	rsb	r3, r3, #1
	ldr	r2, .L10
	ldr	r3, [r2, r3, lsl #2]
	cmp	r3, #0
	bne	.L7
	ldr	r3, .L10+8
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	ldr	r2, .L10+8
	str	r3, [r2]
	ldr	r1, [fp, #-16]
	ldr	r3, .L10+12
	smull	r2, r3, r1, r3
	asr	r2, r3, #2
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	sub	r2, r1, r3
	cmp	r2, #0
	bne	.L8
	ldr	r3, .L10+8
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, [fp, #-12]
	ldr	r0, .L10+16
	bl	printf
.L8:
	ldr	r3, [fp, #-12]
	rsb	r3, r3, #1
	mov	r2, r3
	ldr	r3, .L10+4
	str	r2, [r3]
	ldr	r2, .L10
	ldr	r3, [fp, #-12]
	mov	r1, #0
	str	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L2:
	ldr	r3, [fp, #-16]
	cmp	r3, #199
	ble	.L9
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	need
	.word	turn
	.word	val
	.word	1717986919
	.word	.LC0
	.size	codet, .-codet
	.section	.rodata
	.align	2
.LC1:
	.ascii	"%ld %d\012\000"
	.align	2
.LC2:
	.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
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	ldr	r3, .L19
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r0, #0
	bl	time
	mov	r3, r0
	mov	r0, r3
	bl	srand
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L13
.L14:
	sub	r2, fp, #16
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	add	r0, r2, r3
	ldr	r3, [fp, #-20]
	ldr	r2, .L19+4
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L13:
	ldr	r3, [fp, #-20]
	cmp	r3, #1
	bls	.L14
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L15
.L16:
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-12]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L15:
	ldr	r3, [fp, #-20]
	cmp	r3, #1
	bls	.L16
	ldr	r3, .L19+8
	ldr	r3, [r3]
	mov	r2, #400
	mov	r1, r3
	ldr	r0, .L19+12
	bl	printf
	mov	r3, #0
	ldr	r2, .L19
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L18
	bl	__stack_chk_fail
.L18:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L20:
	.align	2
.L19:
	.word	.LC2
	.word	codet
	.word	val
	.word	.LC1
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
