	.file	"89200077.c"
	.intel_syntax noprefix
	.text
	.globl	table
	.bss
	.align 32
	.type	table, @object
	.size	table, 512
table:
	.zero	512
	.globl	cas_mutex
	.align 32
	.type	cas_mutex, @object
	.size	cas_mutex, 5120
cas_mutex:
	.zero	5120
	.globl	tids
	.align 32
	.type	tids, @object
	.size	tids, 104
tids:
	.zero	104
	.text
	.globl	cas
	.type	cas, @function
cas:
.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 -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -32[rbp], edx
	mov	DWORD PTR -36[rbp], ecx
	mov	DWORD PTR -4[rbp], 0
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	lea	rdx, cas_mutex[rip]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -32[rbp], eax
	jne	.L2
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -36[rbp]
	mov	DWORD PTR [rdx], eax
	mov	DWORD PTR -4[rbp], 1
.L2:
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	lea	rdx, cas_mutex[rip]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	mov	eax, DWORD PTR -4[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cas, .-cas
	.globl	thread_routine
	.type	thread_routine, @function
thread_routine:
.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 -16[rbp], 0
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -8[rbp], eax
.L9:
	cmp	DWORD PTR -16[rbp], 3
	jg	.L5
	add	DWORD PTR -16[rbp], 1
	mov	edx, DWORD PTR -16[rbp]
	mov	eax, edx
	sal	eax, 2
	add	eax, edx
	add	eax, eax
	add	edx, eax
	mov	eax, DWORD PTR -8[rbp]
	add	eax, edx
	mov	DWORD PTR -4[rbp], eax
	mov	edx, DWORD PTR -4[rbp]
	mov	eax, edx
	sal	eax, 3
	sub	eax, edx
	cdq
	shr	edx, 25
	add	eax, edx
	and	eax, 127
	sub	eax, edx
	mov	DWORD PTR -12[rbp], eax
	jmp	.L7
.L5:
	mov	edi, 0
	call	pthread_exit@PLT
.L8:
	mov	eax, DWORD PTR -12[rbp]
	add	eax, 1
	cdq
	shr	edx, 25
	add	eax, edx
	and	eax, 127
	sub	eax, edx
	mov	DWORD PTR -12[rbp], eax
.L7:
	mov	edx, DWORD PTR -4[rbp]
	mov	eax, DWORD PTR -12[rbp]
	mov	ecx, edx
	mov	edx, 0
	mov	esi, eax
	lea	rdi, table[rip]
	call	cas
	test	eax, eax
	je	.L8
	jmp	.L9
	.cfi_endproc
.LFE7:
	.size	thread_routine, .-thread_routine
	.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, 16
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -12[rbp], 0
	jmp	.L11
.L12:
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	lea	rdx, cas_mutex[rip]
	add	rax, rdx
	mov	esi, 0
	mov	rdi, rax
	call	pthread_mutex_init@PLT
	add	DWORD PTR -12[rbp], 1
.L11:
	cmp	DWORD PTR -12[rbp], 127
	jle	.L12
	mov	DWORD PTR -12[rbp], 0
	jmp	.L13
.L14:
	mov	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR -16[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, tids[rip]
	lea	rdi, [rdx+rax]
	lea	rax, -16[rbp]
	mov	rcx, rax
	lea	rdx, thread_routine[rip]
	mov	esi, 0
	call	pthread_create@PLT
	add	DWORD PTR -12[rbp], 1
.L13:
	cmp	DWORD PTR -12[rbp], 12
	jle	.L14
	mov	DWORD PTR -12[rbp], 0
	jmp	.L15
.L16:
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, tids[rip]
	mov	rax, QWORD PTR [rdx+rax]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	add	DWORD PTR -12[rbp], 1
.L15:
	cmp	DWORD PTR -12[rbp], 12
	jle	.L16
	mov	DWORD PTR -12[rbp], 0
	jmp	.L17
.L18:
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	lea	rdx, cas_mutex[rip]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_destroy@PLT
	add	DWORD PTR -12[rbp], 1
.L17:
	cmp	DWORD PTR -12[rbp], 127
	jle	.L18
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	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	"89200077.c"
	.text
	.comm	table,512,4
	.comm	cas_mutex,3072,4
	.comm	tids,52,4
	.align	2
	.global	cas
	.syntax unified
	.arm
	.fpu softvfp
	.type	cas, %function
cas:
	@ 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, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	str	r3, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-20]
	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	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	bne	.L2
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r2, [fp, #-28]
	str	r2, [r3]
	mov	r3, #1
	str	r3, [fp, #-8]
.L2:
	ldr	r2, [fp, #-20]
	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, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L5:
	.align	2
.L4:
	.word	cas_mutex
	.size	cas, .-cas
	.align	2
	.global	thread_routine
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread_routine, %function
thread_routine:
	@ 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]
	mov	r3, #0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	str	r3, [fp, #-12]
.L11:
	ldr	r3, [fp, #-20]
	cmp	r3, #3
	bgt	.L7
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
	ldr	r2, [fp, #-20]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #3
	sub	r3, r3, r2
	rsbs	r2, r3, #0
	and	r3, r3, #127
	and	r2, r2, #127
	rsbpl	r3, r2, #0
	str	r3, [fp, #-16]
	b	.L9
.L7:
	mov	r0, #0
	bl	pthread_exit
.L10:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	rsbs	r2, r3, #0
	and	r3, r3, #127
	and	r2, r2, #127
	rsbpl	r3, r2, #0
	str	r3, [fp, #-16]
.L9:
	ldr	r3, [fp, #-8]
	mov	r2, #0
	ldr	r1, [fp, #-16]
	ldr	r0, .L12
	bl	cas
	mov	r3, r0
	cmp	r3, #0
	beq	.L10
	b	.L11
.L13:
	.align	2
.L12:
	.word	table
	.size	thread_routine, .-thread_routine
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r3, .L25
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L15
.L16:
	ldr	r2, [fp, #-12]
	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
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L15:
	ldr	r3, [fp, #-12]
	cmp	r3, #127
	ble	.L16
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L17
.L18:
	ldr	r3, [fp, #-12]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, .L25+8
	add	r0, r3, r2
	sub	r3, fp, #16
	ldr	r2, .L25+12
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L17:
	ldr	r3, [fp, #-12]
	cmp	r3, #12
	ble	.L18
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L19
.L20:
	ldr	r2, .L25+8
	ldr	r3, [fp, #-12]
	ldr	r3, [r2, r3, lsl #2]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L19:
	ldr	r3, [fp, #-12]
	cmp	r3, #12
	ble	.L20
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L21
.L22:
	ldr	r2, [fp, #-12]
	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
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L21:
	ldr	r3, [fp, #-12]
	cmp	r3, #127
	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	.LC0
	.word	cas_mutex
	.word	tids
	.word	thread_routine
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
