	.file	"813945.c"
	.intel_syntax noprefix
	.text
	.globl	mutex
	.bss
	.align 32
	.type	mutex, @object
	.size	mutex, 40
mutex:
	.zero	40
	.text
	.globl	work
	.type	work, @function
work:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	DWORD PTR -20[rbp], edi
	mov	eax, DWORD PTR -20[rbp]
	mov	DWORD PTR -8[rbp], eax
	mov	eax, DWORD PTR -8[rbp]
	imul	eax, eax
	imul	eax, eax, 100
	mov	DWORD PTR -8[rbp], eax
	mov	DWORD PTR -12[rbp], 0
	jmp	.L2
.L3:
	mov	eax, DWORD PTR -8[rbp]
	lea	edx, 1[rax]
	mov	eax, DWORD PTR -12[rbp]
	imul	eax, edx
	mov	DWORD PTR -4[rbp], eax
	add	DWORD PTR -12[rbp], 1
.L2:
	mov	eax, DWORD PTR -12[rbp]
	cmp	DWORD PTR -8[rbp], eax
	ja	.L3
	nop
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	work, .-work
	.globl	critical
	.type	critical, @function
critical:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	DWORD PTR -20[rbp], edi
	mov	eax, DWORD PTR -20[rbp]
	mov	DWORD PTR -8[rbp], eax
	mov	eax, DWORD PTR -8[rbp]
	imul	eax, eax
	imul	eax, eax, 100
	mov	DWORD PTR -8[rbp], eax
	mov	DWORD PTR -12[rbp], 0
	jmp	.L5
.L6:
	mov	eax, DWORD PTR -8[rbp]
	lea	edx, 1[rax]
	mov	eax, DWORD PTR -12[rbp]
	imul	eax, edx
	mov	DWORD PTR -4[rbp], eax
	add	DWORD PTR -12[rbp], 1
.L5:
	mov	eax, DWORD PTR -12[rbp]
	cmp	DWORD PTR -8[rbp], eax
	ja	.L6
	nop
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	critical, .-critical
	.globl	thread_routine
	.type	thread_routine, @function
thread_routine:
.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, 24
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	work
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	thread_routine, .-thread_routine
	.globl	critical_thread_routine
	.type	critical_thread_routine, @function
critical_thread_routine:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 24
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	critical
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	critical_thread_routine, .-critical_thread_routine
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 144
	mov	DWORD PTR -132[rbp], edi
	mov	QWORD PTR -144[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -132[rbp], 2
	je	.L12
	mov	eax, -1
	jmp	.L21
.L12:
	mov	rax, QWORD PTR -144[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -112[rbp], eax
	lea	rdx, -112[rbp]
	lea	rax, -96[rbp]
	mov	rcx, rdx
	lea	rdx, critical_thread_routine[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	test	eax, eax
	je	.L14
	mov	eax, -1
	jmp	.L21
.L14:
	mov	DWORD PTR -120[rbp], 1
	jmp	.L15
.L17:
	lea	rdx, -96[rbp]
	mov	eax, DWORD PTR -120[rbp]
	cdqe
	sal	rax, 3
	lea	rdi, [rdx+rax]
	lea	rax, -112[rbp]
	mov	rcx, rax
	lea	rdx, thread_routine[rip]
	mov	esi, 0
	call	pthread_create@PLT
	test	eax, eax
	je	.L16
	mov	eax, -1
	jmp	.L21
.L16:
	add	DWORD PTR -120[rbp], 1
.L15:
	cmp	DWORD PTR -120[rbp], 7
	jle	.L17
	mov	DWORD PTR -116[rbp], 0
	jmp	.L18
.L20:
	mov	eax, DWORD PTR -116[rbp]
	cdqe
	mov	rax, QWORD PTR -96[rbp+rax*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	test	eax, eax
	je	.L19
	mov	eax, -1
	jmp	.L21
.L19:
	add	DWORD PTR -116[rbp], 1
.L18:
	cmp	DWORD PTR -116[rbp], 7
	jle	.L20
	mov	eax, 0
.L21:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	"813945.c"
	.text
	.comm	mutex,24,4
	.align	2
	.global	work
	.syntax unified
	.arm
	.fpu softvfp
	.type	work, %function
work:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #28
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	mul	r2, r3, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r2, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #2
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L2
.L3:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	ldr	r2, [fp, #-16]
	mul	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L2:
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	bhi	.L3
	nop
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	work, .-work
	.align	2
	.global	critical
	.syntax unified
	.arm
	.fpu softvfp
	.type	critical, %function
critical:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #28
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	mul	r2, r3, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r2, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #2
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L5
.L6:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	ldr	r2, [fp, #-16]
	mul	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L5:
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	bhi	.L6
	nop
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	critical, .-critical
	.align	2
	.global	thread_routine
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread_routine, %function
thread_routine:
	@ 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]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r0, [fp, #-8]
	bl	work
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	thread_routine, .-thread_routine
	.align	2
	.global	critical_thread_routine
	.syntax unified
	.arm
	.fpu softvfp
	.type	critical_thread_routine, %function
critical_thread_routine:
	@ 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]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r0, [fp, #-8]
	bl	critical
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	critical_thread_routine, .-critical_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 = 72
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #72
	str	r0, [fp, #-72]
	str	r1, [fp, #-76]
	ldr	r3, .L23
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-72]
	cmp	r3, #2
	beq	.L12
	mvn	r3, #0
	b	.L21
.L12:
	ldr	r3, [fp, #-76]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	str	r3, [fp, #-56]
	sub	r3, fp, #56
	sub	r0, fp, #48
	ldr	r2, .L23+4
	mov	r1, #0
	bl	pthread_create
	mov	r3, r0
	cmp	r3, #0
	beq	.L14
	mvn	r3, #0
	b	.L21
.L14:
	mov	r3, #1
	str	r3, [fp, #-64]
	b	.L15
.L17:
	sub	r2, fp, #48
	ldr	r3, [fp, #-64]
	lsl	r3, r3, #2
	add	r0, r2, r3
	sub	r3, fp, #56
	ldr	r2, .L23+8
	mov	r1, #0
	bl	pthread_create
	mov	r3, r0
	cmp	r3, #0
	beq	.L16
	mvn	r3, #0
	b	.L21
.L16:
	ldr	r3, [fp, #-64]
	add	r3, r3, #1
	str	r3, [fp, #-64]
.L15:
	ldr	r3, [fp, #-64]
	cmp	r3, #7
	ble	.L17
	mov	r3, #0
	str	r3, [fp, #-60]
	b	.L18
.L20:
	ldr	r3, [fp, #-60]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-44]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	mov	r3, r0
	cmp	r3, #0
	beq	.L19
	mvn	r3, #0
	b	.L21
.L19:
	ldr	r3, [fp, #-60]
	add	r3, r3, #1
	str	r3, [fp, #-60]
.L18:
	ldr	r3, [fp, #-60]
	cmp	r3, #7
	ble	.L20
	mov	r3, #0
.L21:
	ldr	r2, .L23
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L22
	bl	__stack_chk_fail
.L22:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	.LC0
	.word	critical_thread_routine
	.word	thread_routine
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
