	.file	"97012248.c"
	.intel_syntax noprefix
	.text
	.globl	alloc_counter
	.type	alloc_counter, @function
alloc_counter:
.LFB0:
	.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	edi, 48
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR 40[rax], 0
	mov	rax, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	alloc_counter, .-alloc_counter
	.globl	inc
	.type	inc, @function
inc:
.LFB1:
	.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
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 40[rax]
	cmp	eax, 10
	setle	al
	movzx	eax, al
	mov	edi, eax
	mov	eax, 0
	call	assert@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 40[rax]
	not	eax
	shr	eax, 31
	movzx	eax, al
	mov	edi, eax
	mov	eax, 0
	call	assert@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 40[rax]
	cmp	eax, 9
	jg	.L4
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 40[rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR 40[rax], edx
.L4:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	inc, .-inc
	.globl	dec
	.type	dec, @function
dec:
.LFB2:
	.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
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 40[rax]
	cmp	eax, 10
	setle	al
	movzx	eax, al
	mov	edi, eax
	mov	eax, 0
	call	assert@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 40[rax]
	not	eax
	shr	eax, 31
	movzx	eax, al
	mov	edi, eax
	mov	eax, 0
	call	assert@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 40[rax]
	test	eax, eax
	jle	.L6
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 40[rax]
	lea	edx, -1[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR 40[rax], edx
.L6:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	dec, .-dec
	.globl	main
	.type	main, @function
main:
.LFB3:
	.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	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, 0
	call	alloc_counter
	mov	QWORD PTR -16[rbp], rax
	jmp	.L8
.L13:
	mov	eax, 0
	call	rand@PLT
	test	eax, eax
	je	.L9
	cmp	eax, 1
	je	.L10
	jmp	.L15
.L9:
	mov	rdx, QWORD PTR -16[rbp]
	lea	rax, -24[rbp]
	mov	rcx, rdx
	lea	rdx, inc[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	jmp	.L12
.L10:
	mov	rdx, QWORD PTR -16[rbp]
	lea	rax, -24[rbp]
	mov	rcx, rdx
	lea	rdx, dec[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	jmp	.L12
.L15:
	mov	eax, 0
	call	alloc_counter
	mov	QWORD PTR -16[rbp], rax
.L12:
	sub	DWORD PTR -28[rbp], 1
.L8:
	cmp	DWORD PTR -28[rbp], 0
	jg	.L13
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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	"97012248.c"
	.text
	.align	2
	.global	alloc_counter
	.syntax unified
	.arm
	.fpu softvfp
	.type	alloc_counter, %function
alloc_counter:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	mov	r0, #28
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	mov	r2, #0
	str	r2, [r3, #24]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	alloc_counter, .-alloc_counter
	.align	2
	.global	inc
	.syntax unified
	.arm
	.fpu softvfp
	.type	inc, %function
inc:
	@ 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]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	bl	pthread_mutex_lock
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #24]
	cmp	r3, #10
	movle	r3, #1
	movgt	r3, #0
	and	r3, r3, #255
	mov	r0, r3
	bl	assert
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #24]
	mvn	r3, r3
	lsr	r3, r3, #31
	and	r3, r3, #255
	mov	r0, r3
	bl	assert
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #24]
	cmp	r3, #9
	bgt	.L4
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #24]
	add	r2, r3, #1
	ldr	r3, [fp, #-8]
	str	r2, [r3, #24]
.L4:
	ldr	r3, [fp, #-8]
	mov	r0, r3
	bl	pthread_mutex_unlock
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	inc, .-inc
	.align	2
	.global	dec
	.syntax unified
	.arm
	.fpu softvfp
	.type	dec, %function
dec:
	@ 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]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	bl	pthread_mutex_lock
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #24]
	cmp	r3, #10
	movle	r3, #1
	movgt	r3, #0
	and	r3, r3, #255
	mov	r0, r3
	bl	assert
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #24]
	mvn	r3, r3
	lsr	r3, r3, #31
	and	r3, r3, #255
	mov	r0, r3
	bl	assert
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #24]
	cmp	r3, #0
	ble	.L6
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #24]
	sub	r2, r3, #1
	ldr	r3, [fp, #-8]
	str	r2, [r3, #24]
.L6:
	ldr	r3, [fp, #-8]
	mov	r0, r3
	bl	pthread_mutex_unlock
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	dec, .-dec
	.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, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	bl	alloc_counter
	str	r0, [fp, #-16]
	b	.L8
.L13:
	bl	rand
	mov	r3, r0
	cmp	r3, #0
	beq	.L9
	cmp	r3, #1
	beq	.L10
	b	.L15
.L9:
	sub	r0, fp, #20
	ldr	r3, [fp, #-16]
	ldr	r2, .L16+4
	mov	r1, #0
	bl	pthread_create
	b	.L12
.L10:
	sub	r0, fp, #20
	ldr	r3, [fp, #-16]
	ldr	r2, .L16+8
	mov	r1, #0
	bl	pthread_create
	b	.L12
.L15:
	bl	alloc_counter
	str	r0, [fp, #-16]
.L12:
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
.L8:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bgt	.L13
	nop
	ldr	r3, .L16
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L14
	bl	__stack_chk_fail
.L14:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC0
	.word	inc
	.word	dec
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
