	.file	"2352.c"
	.intel_syntax noprefix
	.text
	.globl	ready
	.bss
	.align 4
	.type	ready, @object
	.size	ready, 4
ready:
	.zero	4
	.globl	sigusr1_received
	.align 4
	.type	sigusr1_received, @object
	.size	sigusr1_received, 4
sigusr1_received:
	.zero	4
	.globl	sigusr2_received
	.align 4
	.type	sigusr2_received, @object
	.size	sigusr2_received, 4
sigusr2_received:
	.zero	4
	.globl	sigabrt_received
	.align 4
	.type	sigabrt_received, @object
	.size	sigabrt_received, 4
sigabrt_received:
	.zero	4
	.globl	thread_count
	.align 4
	.type	thread_count, @object
	.size	thread_count, 4
thread_count:
	.zero	4
	.globl	thread_count_mutex
	.align 32
	.type	thread_count_mutex, @object
	.size	thread_count_mutex, 40
thread_count_mutex:
	.zero	40
	.globl	thread_count_condvar
	.align 32
	.type	thread_count_condvar, @object
	.size	thread_count_condvar, 48
thread_count_condvar:
	.zero	48
	.text
	.type	incr_thread_count, @function
incr_thread_count:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, thread_count_mutex[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR thread_count[rip]
	add	eax, 1
	mov	DWORD PTR thread_count[rip], eax
	lea	rdi, thread_count_condvar[rip]
	call	pthread_cond_signal@PLT
	lea	rdi, thread_count_mutex[rip]
	call	pthread_mutex_unlock@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	incr_thread_count, .-incr_thread_count
	.type	sigusr1_handler, @function
sigusr1_handler:
.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 -4[rbp], edi
	mov	DWORD PTR sigusr1_received[rip], 1
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	sigusr1_handler, .-sigusr1_handler
	.type	sigusr2_handler, @function
sigusr2_handler:
.LFB8:
	.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 -4[rbp], edi
	mov	DWORD PTR sigusr2_received[rip], 1
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	sigusr2_handler, .-sigusr2_handler
	.type	sigabrt_handler, @function
sigabrt_handler:
.LFB9:
	.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 -4[rbp], edi
	mov	DWORD PTR sigabrt_received[rip], 1
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	sigabrt_handler, .-sigabrt_handler
	.type	sigusr1_thread_function, @function
sigusr1_thread_function:
.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
	call	incr_thread_count
	jmp	.L6
.L7:
	mov	edi, 100
	call	usleep@PLT
.L6:
	mov	eax, DWORD PTR ready[rip]
	test	eax, eax
	je	.L7
	call	pthread_self@PLT
	mov	esi, 10
	mov	rdi, rax
	call	pthread_kill@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	sigusr1_thread_function, .-sigusr1_thread_function
	.type	sigusr2_thread_function, @function
sigusr2_thread_function:
.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	QWORD PTR -8[rbp], rdi
	call	incr_thread_count
	jmp	.L9
.L10:
	mov	edi, 100
	call	usleep@PLT
.L9:
	mov	eax, DWORD PTR ready[rip]
	test	eax, eax
	je	.L10
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	sigusr2_thread_function, .-sigusr2_thread_function
	.type	wait_all_threads_running, @function
wait_all_threads_running:
.LFB12:
	.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 -4[rbp], edi
	lea	rdi, thread_count_mutex[rip]
	call	pthread_mutex_lock@PLT
.L14:
	mov	eax, DWORD PTR thread_count[rip]
	cmp	DWORD PTR -4[rbp], eax
	jne	.L12
	lea	rdi, thread_count_mutex[rip]
	call	pthread_mutex_unlock@PLT
	jmp	.L15
.L12:
	lea	rsi, thread_count_mutex[rip]
	lea	rdi, thread_count_condvar[rip]
	call	pthread_cond_wait@PLT
	jmp	.L14
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	wait_all_threads_running, .-wait_all_threads_running
	.type	all_threads_running, @function
all_threads_running:
.LFB13:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	jmp	.L17
.L18:
	mov	edi, 100
	call	usleep@PLT
.L17:
	mov	eax, DWORD PTR ready[rip]
	test	eax, eax
	je	.L18
	nop
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	all_threads_running, .-all_threads_running
	.type	all_threads_done, @function
all_threads_done:
.LFB14:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	all_threads_done, .-all_threads_done
	.globl	main
	.type	main, @function
main:
.LFB15:
	.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	edi, 60
	call	alarm@PLT
	lea	rsi, sigusr1_handler[rip]
	mov	edi, 10
	call	signal@PLT
	lea	rsi, sigusr2_handler[rip]
	mov	edi, 12
	call	signal@PLT
	lea	rsi, sigabrt_handler[rip]
	mov	edi, 6
	call	signal@PLT
	mov	DWORD PTR ready[rip], 0
	mov	esi, 0
	lea	rdi, thread_count_mutex[rip]
	call	pthread_mutex_init@PLT
	mov	esi, 0
	lea	rdi, thread_count_condvar[rip]
	call	pthread_cond_init@PLT
	lea	rax, -24[rbp]
	mov	ecx, 0
	lea	rdx, sigusr1_thread_function[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	lea	rax, -16[rbp]
	mov	ecx, 0
	lea	rdx, sigusr2_thread_function[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	edi, 2
	call	wait_all_threads_running
	call	all_threads_running
	call	pthread_self@PLT
	mov	esi, 6
	mov	rdi, rax
	call	pthread_kill@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
	call	all_threads_done
	mov	eax, 0
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.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	"2352.c"
	.text
	.comm	ready,4,4
	.comm	sigusr1_received,4,4
	.comm	sigusr2_received,4,4
	.comm	sigabrt_received,4,4
	.comm	thread_count,4,4
	.comm	thread_count_mutex,24,4
	.comm	thread_count_condvar,48,8
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	incr_thread_count, %function
incr_thread_count:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L2
	bl	pthread_mutex_lock
	ldr	r3, .L2+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L2+4
	str	r3, [r2]
	ldr	r0, .L2+8
	bl	pthread_cond_signal
	ldr	r0, .L2
	bl	pthread_mutex_unlock
	nop
	pop	{fp, pc}
.L3:
	.align	2
.L2:
	.word	thread_count_mutex
	.word	thread_count
	.word	thread_count_condvar
	.size	incr_thread_count, .-incr_thread_count
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sigusr1_handler, %function
sigusr1_handler:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	ldr	r3, .L5
	mov	r2, #1
	str	r2, [r3]
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L6:
	.align	2
.L5:
	.word	sigusr1_received
	.size	sigusr1_handler, .-sigusr1_handler
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sigusr2_handler, %function
sigusr2_handler:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	ldr	r3, .L8
	mov	r2, #1
	str	r2, [r3]
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L9:
	.align	2
.L8:
	.word	sigusr2_received
	.size	sigusr2_handler, .-sigusr2_handler
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sigabrt_handler, %function
sigabrt_handler:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	ldr	r3, .L11
	mov	r2, #1
	str	r2, [r3]
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L12:
	.align	2
.L11:
	.word	sigabrt_received
	.size	sigabrt_handler, .-sigabrt_handler
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sigusr1_thread_function, %function
sigusr1_thread_function:
	@ 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	incr_thread_count
	b	.L14
.L15:
	mov	r0, #100
	bl	usleep
.L14:
	ldr	r3, .L16
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L15
	bl	pthread_self
	mov	r3, r0
	mov	r1, #10
	mov	r0, r3
	bl	pthread_kill
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	ready
	.size	sigusr1_thread_function, .-sigusr1_thread_function
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sigusr2_thread_function, %function
sigusr2_thread_function:
	@ 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	incr_thread_count
	b	.L19
.L20:
	mov	r0, #100
	bl	usleep
.L19:
	ldr	r3, .L21
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L20
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L22:
	.align	2
.L21:
	.word	ready
	.size	sigusr2_thread_function, .-sigusr2_thread_function
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	wait_all_threads_running, %function
wait_all_threads_running:
	@ 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	r0, .L28
	bl	pthread_mutex_lock
.L26:
	ldr	r3, .L28+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	bne	.L24
	ldr	r0, .L28
	bl	pthread_mutex_unlock
	b	.L27
.L24:
	ldr	r1, .L28
	ldr	r0, .L28+8
	bl	pthread_cond_wait
	b	.L26
.L27:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L29:
	.align	2
.L28:
	.word	thread_count_mutex
	.word	thread_count
	.word	thread_count_condvar
	.size	wait_all_threads_running, .-wait_all_threads_running
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	all_threads_running, %function
all_threads_running:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	b	.L31
.L32:
	mov	r0, #100
	bl	usleep
.L31:
	ldr	r3, .L33
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L32
	nop
	nop
	pop	{fp, pc}
.L34:
	.align	2
.L33:
	.word	ready
	.size	all_threads_running, .-all_threads_running
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	all_threads_done, %function
all_threads_done:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	all_threads_done, .-all_threads_done
	.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, .L39
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r0, #60
	bl	alarm
	ldr	r1, .L39+4
	mov	r0, #10
	bl	signal
	ldr	r1, .L39+8
	mov	r0, #12
	bl	signal
	ldr	r1, .L39+12
	mov	r0, #6
	bl	signal
	ldr	r3, .L39+16
	mov	r2, #0
	str	r2, [r3]
	mov	r1, #0
	ldr	r0, .L39+20
	bl	pthread_mutex_init
	mov	r1, #0
	ldr	r0, .L39+24
	bl	pthread_cond_init
	sub	r0, fp, #16
	mov	r3, #0
	ldr	r2, .L39+28
	mov	r1, #0
	bl	pthread_create
	sub	r0, fp, #12
	mov	r3, #0
	ldr	r2, .L39+32
	mov	r1, #0
	bl	pthread_create
	mov	r0, #2
	bl	wait_all_threads_running
	bl	all_threads_running
	bl	pthread_self
	mov	r3, r0
	mov	r1, #6
	mov	r0, r3
	bl	pthread_kill
	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
	bl	all_threads_done
	mov	r3, #0
	ldr	r2, .L39
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L38
	bl	__stack_chk_fail
.L38:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L40:
	.align	2
.L39:
	.word	.LC0
	.word	sigusr1_handler
	.word	sigusr2_handler
	.word	sigabrt_handler
	.word	ready
	.word	thread_count_mutex
	.word	thread_count_condvar
	.word	sigusr1_thread_function
	.word	sigusr2_thread_function
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
