	.file	"190889.c"
	.intel_syntax noprefix
	.text
	.globl	semDownload
	.bss
	.align 32
	.type	semDownload, @object
	.size	semDownload, 32
semDownload:
	.zero	32
	.globl	a_thread
	.align 8
	.type	a_thread, @object
	.size	a_thread, 8
a_thread:
	.zero	8
	.globl	b_thread
	.align 8
	.type	b_thread, @object
	.size	b_thread, 8
b_thread:
	.zero	8
	.globl	c_thread
	.align 8
	.type	c_thread, @object
	.size	c_thread, 8
c_thread:
	.zero	8
	.section	.rodata
.LC0:
	.string	"sem getvalue error: \n"
.LC1:
	.string	"current value: %d\n"
	.align 8
.LC2:
	.string	"!!! You've reached a limit on the number of threads !!!"
	.text
	.globl	check
	.type	check, @function
check:
.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, 16
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -12[rbp], 0
	mov	DWORD PTR -16[rbp], 0
	lea	rax, -16[rbp]
	mov	rsi, rax
	lea	rdi, semDownload[rip]
	call	sem_getvalue@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], 0
	je	.L2
	lea	rdi, .LC0[rip]
	call	perror@PLT
.L2:
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -16[rbp]
	test	eax, eax
	jg	.L5
	lea	rdi, .LC2[rip]
	call	puts@PLT
.L5:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	check, .-check
	.section	.rodata
	.align 8
.LC3:
	.string	"****************************************"
	.align 8
.LC4:
	.string	"*** which task you want to download? ***"
	.align 8
.LC5:
	.string	"*** you can enter [1-3],[0] is done  ***"
	.text
	.globl	InputInfo
	.type	InputInfo, @function
InputInfo:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, .LC3[rip]
	call	puts@PLT
	lea	rdi, .LC4[rip]
	call	puts@PLT
	lea	rdi, .LC5[rip]
	call	puts@PLT
	lea	rdi, .LC3[rip]
	call	puts@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	InputInfo, .-InputInfo
	.section	.rodata
	.align 8
.LC6:
	.string	"==============  Downloading Task 1  ============== "
	.align 8
.LC7:
	.string	"==============    Finished Task 1   ============== "
	.text
	.globl	func1
	.type	func1, @function
func1:
.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	QWORD PTR -8[rbp], rdi
	mov	eax, 0
	call	check
	lea	rdi, semDownload[rip]
	call	sem_wait@PLT
	lea	rdi, .LC6[rip]
	call	puts@PLT
	mov	edi, 5
	mov	eax, 0
	call	sleep@PLT
	lea	rdi, .LC7[rip]
	call	puts@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	func1, .-func1
	.section	.rodata
	.align 8
.LC8:
	.string	"==============  Downloading Task 2  ============== "
	.align 8
.LC9:
	.string	"==============    Finished Task 2   ============== "
	.text
	.globl	func2
	.type	func2, @function
func2:
.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	QWORD PTR -8[rbp], rdi
	mov	eax, 0
	call	check
	lea	rdi, semDownload[rip]
	call	sem_wait@PLT
	lea	rdi, .LC8[rip]
	call	puts@PLT
	mov	edi, 3
	mov	eax, 0
	call	sleep@PLT
	lea	rdi, .LC9[rip]
	call	puts@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	func2, .-func2
	.section	.rodata
	.align 8
.LC10:
	.string	"==============  Downloading Task 3  ============== "
	.align 8
.LC11:
	.string	"==============    Finished Task 3   ============== "
	.text
	.globl	func3
	.type	func3, @function
func3:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	eax, 0
	call	check
	lea	rdi, semDownload[rip]
	call	sem_wait@PLT
	lea	rdi, .LC10[rip]
	call	puts@PLT
	mov	edi, 1
	mov	eax, 0
	call	sleep@PLT
	lea	rdi, .LC11[rip]
	call	puts@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	func3, .-func3
	.section	.rodata
	.align 8
.LC12:
	.string	"your choose Downloading Task [%d]\n"
.LC13:
	.string	"!!! eroor task [%d]  !!!\n"
.LC14:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.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
	call	InputInfo
	jmp	.L11
.L20:
	mov	eax, DWORD PTR -16[rbp]
	test	eax, eax
	jne	.L12
	mov	DWORD PTR -12[rbp], 0
	jmp	.L13
.L14:
	lea	rdi, semDownload[rip]
	call	sem_post@PLT
	add	DWORD PTR -12[rbp], 1
.L13:
	cmp	DWORD PTR -12[rbp], 1
	jle	.L14
	jmp	.L11
.L12:
	mov	edx, 0
	mov	esi, 0
	lea	rdi, semDownload[rip]
	call	sem_init@PLT
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, eax
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, 3
	je	.L15
	cmp	eax, 3
	jg	.L16
	cmp	eax, 1
	je	.L17
	cmp	eax, 2
	je	.L18
	jmp	.L16
.L17:
	mov	ecx, 0
	lea	rdx, func1[rip]
	mov	esi, 0
	lea	rdi, a_thread[rip]
	call	pthread_create@PLT
	jmp	.L19
.L18:
	mov	ecx, 0
	lea	rdx, func2[rip]
	mov	esi, 0
	lea	rdi, b_thread[rip]
	call	pthread_create@PLT
	jmp	.L19
.L15:
	mov	ecx, 0
	lea	rdx, func3[rip]
	mov	esi, 0
	lea	rdi, c_thread[rip]
	call	pthread_create@PLT
	jmp	.L19
.L16:
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, eax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	printf@PLT
	nop
.L19:
	call	InputInfo
.L11:
	lea	rax, -16[rbp]
	mov	rsi, rax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	cmp	eax, -1
	jne	.L20
	lea	rdi, semDownload[rip]
	call	sem_destroy@PLT
	mov	eax, 0
	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
.LFE11:
	.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	"190889.c"
	.text
	.comm	semDownload,16,4
	.comm	a_thread,4,4
	.comm	b_thread,4,4
	.comm	c_thread,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"sem getvalue error: \012\000"
	.align	2
.LC1:
	.ascii	"current value: %d\012\000"
	.align	2
.LC2:
	.ascii	"!!! You've reached a limit on the number of threads"
	.ascii	" !!!\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	check
	.syntax unified
	.arm
	.fpu softvfp
	.type	check, %function
check:
	@ 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, .L6
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-16]
	sub	r3, fp, #16
	mov	r1, r3
	ldr	r0, .L6+4
	bl	sem_getvalue
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L2
	ldr	r0, .L6+8
	bl	perror
.L2:
	ldr	r3, [fp, #-16]
	mov	r1, r3
	ldr	r0, .L6+12
	bl	printf
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bgt	.L5
	ldr	r0, .L6+16
	bl	puts
.L5:
	nop
	ldr	r3, .L6
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L4
	bl	__stack_chk_fail
.L4:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	.LC3
	.word	semDownload
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.size	check, .-check
	.section	.rodata
	.align	2
.LC4:
	.ascii	"****************************************\000"
	.align	2
.LC5:
	.ascii	"*** which task you want to download? ***\000"
	.align	2
.LC6:
	.ascii	"*** you can enter [1-3],[0] is done  ***\000"
	.text
	.align	2
	.global	InputInfo
	.syntax unified
	.arm
	.fpu softvfp
	.type	InputInfo, %function
InputInfo:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L9
	bl	puts
	ldr	r0, .L9+4
	bl	puts
	ldr	r0, .L9+8
	bl	puts
	ldr	r0, .L9
	bl	puts
	nop
	pop	{fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.size	InputInfo, .-InputInfo
	.section	.rodata
	.align	2
.LC7:
	.ascii	"==============  Downloading Task 1  ============== "
	.ascii	"\000"
	.align	2
.LC8:
	.ascii	"==============    Finished Task 1   ============== "
	.ascii	"\000"
	.text
	.align	2
	.global	func1
	.syntax unified
	.arm
	.fpu softvfp
	.type	func1, %function
func1:
	@ 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]
	bl	check
	ldr	r0, .L12
	bl	sem_wait
	ldr	r0, .L12+4
	bl	puts
	mov	r0, #5
	bl	sleep
	ldr	r0, .L12+8
	bl	puts
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L13:
	.align	2
.L12:
	.word	semDownload
	.word	.LC7
	.word	.LC8
	.size	func1, .-func1
	.section	.rodata
	.align	2
.LC9:
	.ascii	"==============  Downloading Task 2  ============== "
	.ascii	"\000"
	.align	2
.LC10:
	.ascii	"==============    Finished Task 2   ============== "
	.ascii	"\000"
	.text
	.align	2
	.global	func2
	.syntax unified
	.arm
	.fpu softvfp
	.type	func2, %function
func2:
	@ 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]
	bl	check
	ldr	r0, .L15
	bl	sem_wait
	ldr	r0, .L15+4
	bl	puts
	mov	r0, #3
	bl	sleep
	ldr	r0, .L15+8
	bl	puts
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	semDownload
	.word	.LC9
	.word	.LC10
	.size	func2, .-func2
	.section	.rodata
	.align	2
.LC11:
	.ascii	"==============  Downloading Task 3  ============== "
	.ascii	"\000"
	.align	2
.LC12:
	.ascii	"==============    Finished Task 3   ============== "
	.ascii	"\000"
	.text
	.align	2
	.global	func3
	.syntax unified
	.arm
	.fpu softvfp
	.type	func3, %function
func3:
	@ 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]
	bl	check
	ldr	r0, .L18
	bl	sem_wait
	ldr	r0, .L18+4
	bl	puts
	mov	r0, #1
	bl	sleep
	ldr	r0, .L18+8
	bl	puts
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L19:
	.align	2
.L18:
	.word	semDownload
	.word	.LC11
	.word	.LC12
	.size	func3, .-func3
	.section	.rodata
	.align	2
.LC13:
	.ascii	"your choose Downloading Task [%d]\012\000"
	.align	2
.LC14:
	.ascii	"!!! eroor task [%d]  !!!\012\000"
	.align	2
.LC15:
	.ascii	"%d\000"
	.align	2
.LC16:
	.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, .L33
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	bl	InputInfo
	b	.L21
.L30:
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L22
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L23
.L24:
	ldr	r0, .L33+4
	bl	sem_post
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L23:
	ldr	r3, [fp, #-12]
	cmp	r3, #1
	ble	.L24
	b	.L21
.L22:
	mov	r2, #0
	mov	r1, #0
	ldr	r0, .L33+4
	bl	sem_init
	ldr	r3, [fp, #-16]
	mov	r1, r3
	ldr	r0, .L33+8
	bl	printf
	ldr	r3, [fp, #-16]
	cmp	r3, #3
	beq	.L25
	cmp	r3, #3
	bgt	.L26
	cmp	r3, #1
	beq	.L27
	cmp	r3, #2
	beq	.L28
	b	.L26
.L27:
	mov	r3, #0
	ldr	r2, .L33+12
	mov	r1, #0
	ldr	r0, .L33+16
	bl	pthread_create
	b	.L29
.L28:
	mov	r3, #0
	ldr	r2, .L33+20
	mov	r1, #0
	ldr	r0, .L33+24
	bl	pthread_create
	b	.L29
.L25:
	mov	r3, #0
	ldr	r2, .L33+28
	mov	r1, #0
	ldr	r0, .L33+32
	bl	pthread_create
	b	.L29
.L26:
	ldr	r3, [fp, #-16]
	mov	r1, r3
	ldr	r0, .L33+36
	bl	printf
	nop
.L29:
	bl	InputInfo
.L21:
	sub	r3, fp, #16
	mov	r1, r3
	ldr	r0, .L33+40
	bl	__isoc99_scanf
	mov	r3, r0
	cmn	r3, #1
	bne	.L30
	ldr	r0, .L33+4
	bl	sem_destroy
	mov	r3, #0
	ldr	r2, .L33
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L32
	bl	__stack_chk_fail
.L32:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L34:
	.align	2
.L33:
	.word	.LC16
	.word	semDownload
	.word	.LC13
	.word	func1
	.word	a_thread
	.word	func2
	.word	b_thread
	.word	func3
	.word	c_thread
	.word	.LC14
	.word	.LC15
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
