	.file	"113310.c"
	.intel_syntax noprefix
	.text
	.globl	buf
	.bss
	.align 8
	.type	buf, @object
	.size	buf, 8
buf:
	.zero	8
	.globl	Write
	.align 32
	.type	Write, @object
	.size	Write, 32
Write:
	.zero	32
	.globl	take
	.align 32
	.type	take, @object
	.size	take, 32
take:
	.zero	32
	.globl	check_idx
	.align 32
	.type	check_idx, @object
	.size	check_idx, 32
check_idx:
	.zero	32
	.globl	insert_index
	.align 4
	.type	insert_index, @object
	.size	insert_index, 4
insert_index:
	.zero	4
	.text
	.globl	write_0
	.type	write_0, @function
write_0:
.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, 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -48[rbp], -1
	mov	DWORD PTR -44[rbp], -2
	mov	DWORD PTR -40[rbp], -3
	mov	DWORD PTR -36[rbp], -4
	mov	DWORD PTR -32[rbp], -5
	mov	DWORD PTR -28[rbp], -6
	mov	DWORD PTR -24[rbp], -7
	mov	DWORD PTR -20[rbp], -8
	mov	DWORD PTR -16[rbp], -9
	mov	DWORD PTR -12[rbp], -10
	mov	DWORD PTR -52[rbp], 0
	jmp	.L2
.L4:
	lea	rdi, Write[rip]
	call	sem_wait@PLT
	mov	edx, DWORD PTR insert_index[rip]
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	mov	eax, DWORD PTR -48[rbp+rax*4]
	movsx	rdx, edx
	lea	rcx, 0[0+rdx*4]
	lea	rdx, buf[rip]
	mov	DWORD PTR [rcx+rdx], eax
	mov	eax, DWORD PTR insert_index[rip]
	add	eax, 1
	cdq
	shr	edx, 31
	add	eax, edx
	and	eax, 1
	sub	eax, edx
	mov	DWORD PTR insert_index[rip], eax
	lea	rdi, check_idx[rip]
	call	sem_wait@PLT
	mov	eax, DWORD PTR insert_index[rip]
	test	eax, eax
	jne	.L3
	lea	rdi, take[rip]
	call	sem_post@PLT
.L3:
	lea	rdi, check_idx[rip]
	call	sem_post@PLT
	add	DWORD PTR -52[rbp], 1
.L2:
	cmp	DWORD PTR -52[rbp], 9
	jle	.L4
	mov	eax, 0
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	write_0, .-write_0
	.globl	write_1
	.type	write_1, @function
write_1:
.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	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -48[rbp], 1
	mov	DWORD PTR -44[rbp], 2
	mov	DWORD PTR -40[rbp], 3
	mov	DWORD PTR -36[rbp], 4
	mov	DWORD PTR -32[rbp], 5
	mov	DWORD PTR -28[rbp], 6
	mov	DWORD PTR -24[rbp], 7
	mov	DWORD PTR -20[rbp], 8
	mov	DWORD PTR -16[rbp], 9
	mov	DWORD PTR -12[rbp], 10
	mov	DWORD PTR -52[rbp], 0
	jmp	.L8
.L10:
	lea	rdi, Write[rip]
	call	sem_wait@PLT
	mov	edx, DWORD PTR insert_index[rip]
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	mov	eax, DWORD PTR -48[rbp+rax*4]
	movsx	rdx, edx
	lea	rcx, 0[0+rdx*4]
	lea	rdx, buf[rip]
	mov	DWORD PTR [rcx+rdx], eax
	mov	eax, DWORD PTR insert_index[rip]
	add	eax, 1
	cdq
	shr	edx, 31
	add	eax, edx
	and	eax, 1
	sub	eax, edx
	mov	DWORD PTR insert_index[rip], eax
	lea	rdi, check_idx[rip]
	call	sem_wait@PLT
	mov	eax, DWORD PTR insert_index[rip]
	test	eax, eax
	jne	.L9
	lea	rdi, take[rip]
	call	sem_post@PLT
.L9:
	lea	rdi, check_idx[rip]
	call	sem_post@PLT
	add	DWORD PTR -52[rbp], 1
.L8:
	cmp	DWORD PTR -52[rbp], 9
	jle	.L10
	mov	eax, 0
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	write_1, .-write_1
	.section	.rodata
.LC0:
	.string	"%d + %d = %d\n"
	.text
	.globl	AddFun
	.type	AddFun, @function
AddFun:
.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	DWORD PTR -12[rbp], 0
	jmp	.L14
.L15:
	lea	rdi, take[rip]
	call	sem_wait@PLT
	mov	eax, DWORD PTR buf[rip]
	mov	DWORD PTR -8[rbp], eax
	mov	eax, DWORD PTR buf[rip+4]
	mov	DWORD PTR -4[rbp], eax
	mov	edx, DWORD PTR -8[rbp]
	mov	eax, DWORD PTR -4[rbp]
	lea	ecx, [rdx+rax]
	mov	edx, DWORD PTR -4[rbp]
	mov	eax, DWORD PTR -8[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, Write[rip]
	call	sem_post@PLT
	lea	rdi, Write[rip]
	call	sem_post@PLT
	add	DWORD PTR -12[rbp], 1
.L14:
	cmp	DWORD PTR -12[rbp], 9
	jle	.L15
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	AddFun, .-AddFun
	.section	.rodata
.LC1:
	.string	"%d * %d = %d\n"
	.text
	.globl	MulFun
	.type	MulFun, @function
MulFun:
.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, 16
	mov	DWORD PTR -12[rbp], 0
	jmp	.L18
.L19:
	lea	rdi, take[rip]
	call	sem_wait@PLT
	mov	eax, DWORD PTR buf[rip]
	mov	DWORD PTR -8[rbp], eax
	mov	eax, DWORD PTR buf[rip+4]
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -8[rbp]
	imul	eax, DWORD PTR -4[rbp]
	mov	ecx, eax
	mov	edx, DWORD PTR -4[rbp]
	mov	eax, DWORD PTR -8[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, Write[rip]
	call	sem_post@PLT
	lea	rdi, Write[rip]
	call	sem_post@PLT
	add	DWORD PTR -12[rbp], 1
.L18:
	cmp	DWORD PTR -12[rbp], 9
	jle	.L19
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	MulFun, .-MulFun
	.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, 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	edx, 2
	mov	esi, 0
	lea	rdi, Write[rip]
	call	sem_init@PLT
	mov	edx, 0
	mov	esi, 0
	lea	rdi, take[rip]
	call	sem_init@PLT
	mov	edx, 1
	mov	esi, 0
	lea	rdi, check_idx[rip]
	call	sem_init@PLT
	mov	DWORD PTR insert_index[rip], 0
	lea	rax, -32[rbp]
	mov	ecx, 0
	lea	rdx, write_1[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	lea	rax, -40[rbp]
	mov	ecx, 0
	lea	rdx, write_0[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	lea	rax, -16[rbp]
	mov	ecx, 0
	lea	rdx, MulFun[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	lea	rax, -24[rbp]
	mov	ecx, 0
	lea	rdx, AddFun[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rax, QWORD PTR -32[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	.L23
	call	__stack_chk_fail@PLT
.L23:
	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	"113310.c"
	.text
	.comm	buf,8,4
	.comm	Write,16,4
	.comm	take,16,4
	.comm	check_idx,16,4
	.comm	insert_index,4,4
	.section	.rodata
	.align	2
.LC0:
	.word	-1
	.word	-2
	.word	-3
	.word	-4
	.word	-5
	.word	-6
	.word	-7
	.word	-8
	.word	-9
	.word	-10
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	write_0
	.syntax unified
	.arm
	.fpu softvfp
	.type	write_0, %function
write_0:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	ldr	r3, .L7
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L7+4
	sub	ip, fp, #48
	mov	lr, r3
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldm	lr, {r0, r1}
	stm	ip, {r0, r1}
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L2
.L4:
	ldr	r0, .L7+8
	bl	sem_wait
	ldr	r3, .L7+12
	ldr	r2, [r3]
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	ldr	r3, [r3, #-44]
	ldr	r1, .L7+16
	str	r3, [r1, r2, lsl #2]
	ldr	r3, .L7+12
	ldr	r3, [r3]
	add	r3, r3, #1
	cmp	r3, #0
	and	r3, r3, #1
	rsblt	r3, r3, #0
	ldr	r2, .L7+12
	str	r3, [r2]
	ldr	r0, .L7+20
	bl	sem_wait
	ldr	r3, .L7+12
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L3
	ldr	r0, .L7+24
	bl	sem_post
.L3:
	ldr	r0, .L7+20
	bl	sem_post
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L2:
	ldr	r3, [fp, #-52]
	cmp	r3, #9
	ble	.L4
	mov	r3, #0
	ldr	r2, .L7
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L6
	bl	__stack_chk_fail
.L6:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	.LC2
	.word	.LC0
	.word	Write
	.word	insert_index
	.word	buf
	.word	check_idx
	.word	take
	.size	write_0, .-write_0
	.section	.rodata
	.align	2
.LC1:
	.word	1
	.word	2
	.word	3
	.word	4
	.word	5
	.word	6
	.word	7
	.word	8
	.word	9
	.word	10
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	write_1
	.syntax unified
	.arm
	.fpu softvfp
	.type	write_1, %function
write_1:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	ldr	r3, .L15
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L15+4
	sub	ip, fp, #48
	mov	lr, r3
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldm	lr, {r0, r1}
	stm	ip, {r0, r1}
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L10
.L12:
	ldr	r0, .L15+8
	bl	sem_wait
	ldr	r3, .L15+12
	ldr	r2, [r3]
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	ldr	r3, [r3, #-44]
	ldr	r1, .L15+16
	str	r3, [r1, r2, lsl #2]
	ldr	r3, .L15+12
	ldr	r3, [r3]
	add	r3, r3, #1
	cmp	r3, #0
	and	r3, r3, #1
	rsblt	r3, r3, #0
	ldr	r2, .L15+12
	str	r3, [r2]
	ldr	r0, .L15+20
	bl	sem_wait
	ldr	r3, .L15+12
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L11
	ldr	r0, .L15+24
	bl	sem_post
.L11:
	ldr	r0, .L15+20
	bl	sem_post
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L10:
	ldr	r3, [fp, #-52]
	cmp	r3, #9
	ble	.L12
	mov	r3, #0
	ldr	r2, .L15
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L14
	bl	__stack_chk_fail
.L14:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	.LC3
	.word	.LC1
	.word	Write
	.word	insert_index
	.word	buf
	.word	check_idx
	.word	take
	.size	write_1, .-write_1
	.section	.rodata
	.align	2
.LC4:
	.ascii	"%d + %d = %d\012\000"
	.text
	.align	2
	.global	AddFun
	.syntax unified
	.arm
	.fpu softvfp
	.type	AddFun, %function
AddFun:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L18
.L19:
	ldr	r0, .L21
	bl	sem_wait
	ldr	r3, .L21+4
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	ldr	r3, .L21+4
	ldr	r3, [r3, #4]
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	ldr	r2, [fp, #-8]
	ldr	r1, [fp, #-12]
	ldr	r0, .L21+8
	bl	printf
	ldr	r0, .L21+12
	bl	sem_post
	ldr	r0, .L21+12
	bl	sem_post
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L18:
	ldr	r3, [fp, #-16]
	cmp	r3, #9
	ble	.L19
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L22:
	.align	2
.L21:
	.word	take
	.word	buf
	.word	.LC4
	.word	Write
	.size	AddFun, .-AddFun
	.section	.rodata
	.align	2
.LC5:
	.ascii	"%d * %d = %d\012\000"
	.text
	.align	2
	.global	MulFun
	.syntax unified
	.arm
	.fpu softvfp
	.type	MulFun, %function
MulFun:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L24
.L25:
	ldr	r0, .L27
	bl	sem_wait
	ldr	r3, .L27+4
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	ldr	r3, .L27+4
	ldr	r3, [r3, #4]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-8]
	mul	r3, r2, r3
	ldr	r2, [fp, #-8]
	ldr	r1, [fp, #-12]
	ldr	r0, .L27+8
	bl	printf
	ldr	r0, .L27+12
	bl	sem_post
	ldr	r0, .L27+12
	bl	sem_post
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L24:
	ldr	r3, [fp, #-16]
	cmp	r3, #9
	ble	.L25
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L28:
	.align	2
.L27:
	.word	take
	.word	buf
	.word	.LC5
	.word	Write
	.size	MulFun, .-MulFun
	.section	.rodata
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r3, .L32
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r2, #2
	mov	r1, #0
	ldr	r0, .L32+4
	bl	sem_init
	mov	r2, #0
	mov	r1, #0
	ldr	r0, .L32+8
	bl	sem_init
	mov	r2, #1
	mov	r1, #0
	ldr	r0, .L32+12
	bl	sem_init
	ldr	r3, .L32+16
	mov	r2, #0
	str	r2, [r3]
	sub	r0, fp, #20
	mov	r3, #0
	ldr	r2, .L32+20
	mov	r1, #0
	bl	pthread_create
	sub	r0, fp, #24
	mov	r3, #0
	ldr	r2, .L32+24
	mov	r1, #0
	bl	pthread_create
	sub	r0, fp, #12
	mov	r3, #0
	ldr	r2, .L32+28
	mov	r1, #0
	bl	pthread_create
	sub	r0, fp, #16
	mov	r3, #0
	ldr	r2, .L32+32
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-16]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-12]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-24]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-20]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	mov	r3, #0
	ldr	r2, .L32
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L31
	bl	__stack_chk_fail
.L31:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L33:
	.align	2
.L32:
	.word	.LC6
	.word	Write
	.word	take
	.word	check_idx
	.word	insert_index
	.word	write_1
	.word	write_0
	.word	MulFun
	.word	AddFun
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
