	.file	"978412.c"
	.intel_syntax noprefix
	.text
	.globl	barrier
	.bss
	.align 32
	.type	barrier, @object
	.size	barrier, 32
barrier:
	.zero	32
	.globl	got_sigusr1
	.align 4
	.type	got_sigusr1, @object
	.size	got_sigusr1, 4
got_sigusr1:
	.zero	4
	.globl	got_sigusr2
	.align 4
	.type	got_sigusr2, @object
	.size	got_sigusr2, 4
got_sigusr2:
	.zero	4
	.text
	.globl	handler_sigusr1
	.type	handler_sigusr1, @function
handler_sigusr1:
.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 -4[rbp], edi
	mov	DWORD PTR got_sigusr1[rip], 1
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	handler_sigusr1, .-handler_sigusr1
	.globl	handler_sigusr2
	.type	handler_sigusr2, @function
handler_sigusr2:
.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 got_sigusr2[rip], 1
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	handler_sigusr2, .-handler_sigusr2
	.globl	thread_function
	.type	thread_function, @function
thread_function:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -4[rbp], 1
	lea	rdi, barrier[rip]
	call	pthread_barrier_wait@PLT
	jmp	.L4
.L7:
	mov	eax, DWORD PTR got_sigusr1[rip]
	test	eax, eax
	je	.L5
	mov	eax, DWORD PTR got_sigusr2[rip]
	test	eax, eax
	jne	.L8
.L5:
	mov	edi, 1
	call	usleep@PLT
.L4:
	mov	eax, DWORD PTR -4[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -4[rbp], edx
	test	eax, eax
	jne	.L7
	jmp	.L6
.L8:
	nop
.L6:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	thread_function, .-thread_function
	.globl	all_threads_started
	.type	all_threads_started, @function
all_threads_started:
.LFB9:
	.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
.LFE9:
	.size	all_threads_started, .-all_threads_started
	.globl	all_threads_signalled
	.type	all_threads_signalled, @function
all_threads_signalled:
.LFB10:
	.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
.LFE10:
	.size	all_threads_signalled, .-all_threads_signalled
	.globl	end
	.type	end, @function
end:
.LFB11:
	.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
.LFE11:
	.size	end, .-end
	.globl	main
	.type	main, @function
main:
.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, 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rsi, handler_sigusr1[rip]
	mov	edi, 10
	call	signal@PLT
	lea	rsi, handler_sigusr2[rip]
	mov	edi, 12
	call	signal@PLT
	mov	DWORD PTR -36[rbp], 0
	jmp	.L13
.L14:
	mov	edx, 2
	mov	esi, 0
	lea	rdi, barrier[rip]
	call	pthread_barrier_init@PLT
	lea	rdx, -32[rbp]
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	ecx, 0
	lea	rdx, thread_function[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	lea	rdi, barrier[rip]
	call	pthread_barrier_wait@PLT
	lea	rdi, barrier[rip]
	call	pthread_barrier_destroy@PLT
	add	DWORD PTR -36[rbp], 1
.L13:
	cmp	DWORD PTR -36[rbp], 1
	jle	.L14
	call	all_threads_started
	mov	rax, QWORD PTR -32[rbp]
	mov	esi, 10
	mov	rdi, rax
	call	pthread_kill@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, 12
	mov	rdi, rax
	call	pthread_kill@PLT
	call	all_threads_signalled
	mov	DWORD PTR -36[rbp], 0
	jmp	.L15
.L16:
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	mov	rax, QWORD PTR -32[rbp+rax*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	add	DWORD PTR -36[rbp], 1
.L15:
	cmp	DWORD PTR -36[rbp], 1
	jle	.L16
	call	end
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.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	"978412.c"
	.text
	.comm	barrier,20,4
	.comm	got_sigusr1,4,4
	.comm	got_sigusr2,4,4
	.align	2
	.global	handler_sigusr1
	.syntax unified
	.arm
	.fpu softvfp
	.type	handler_sigusr1, %function
handler_sigusr1:
	@ 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, .L2
	mov	r2, #1
	str	r2, [r3]
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L3:
	.align	2
.L2:
	.word	got_sigusr1
	.size	handler_sigusr1, .-handler_sigusr1
	.align	2
	.global	handler_sigusr2
	.syntax unified
	.arm
	.fpu softvfp
	.type	handler_sigusr2, %function
handler_sigusr2:
	@ 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	got_sigusr2
	.size	handler_sigusr2, .-handler_sigusr2
	.align	2
	.global	thread_function
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread_function, %function
thread_function:
	@ 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]
	mov	r3, #1
	str	r3, [fp, #-8]
	ldr	r0, .L13
	bl	pthread_barrier_wait
	b	.L8
.L11:
	ldr	r3, .L13+4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L9
	ldr	r3, .L13+8
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L12
.L9:
	mov	r0, #1
	bl	usleep
.L8:
	ldr	r3, [fp, #-8]
	add	r2, r3, #1
	str	r2, [fp, #-8]
	cmp	r3, #0
	bne	.L11
	b	.L10
.L12:
	nop
.L10:
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L14:
	.align	2
.L13:
	.word	barrier
	.word	got_sigusr1
	.word	got_sigusr2
	.size	thread_function, .-thread_function
	.align	2
	.global	all_threads_started
	.syntax unified
	.arm
	.fpu softvfp
	.type	all_threads_started, %function
all_threads_started:
	@ 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_started, .-all_threads_started
	.align	2
	.global	all_threads_signalled
	.syntax unified
	.arm
	.fpu softvfp
	.type	all_threads_signalled, %function
all_threads_signalled:
	@ 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_signalled, .-all_threads_signalled
	.align	2
	.global	end
	.syntax unified
	.arm
	.fpu softvfp
	.type	end, %function
end:
	@ 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	end, .-end
	.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, .L25
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r1, .L25+4
	mov	r0, #10
	bl	signal
	ldr	r1, .L25+8
	mov	r0, #12
	bl	signal
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L19
.L20:
	mov	r2, #2
	mov	r1, #0
	ldr	r0, .L25+12
	bl	pthread_barrier_init
	sub	r2, fp, #16
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	add	r0, r2, r3
	mov	r3, #0
	ldr	r2, .L25+16
	mov	r1, #0
	bl	pthread_create
	ldr	r0, .L25+12
	bl	pthread_barrier_wait
	ldr	r0, .L25+12
	bl	pthread_barrier_destroy
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L19:
	ldr	r3, [fp, #-20]
	cmp	r3, #1
	ble	.L20
	bl	all_threads_started
	ldr	r3, [fp, #-16]
	mov	r1, #10
	mov	r0, r3
	bl	pthread_kill
	ldr	r3, [fp, #-12]
	mov	r1, #12
	mov	r0, r3
	bl	pthread_kill
	bl	all_threads_signalled
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L21
.L22:
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-12]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L21:
	ldr	r3, [fp, #-20]
	cmp	r3, #1
	ble	.L22
	bl	end
	mov	r3, #0
	ldr	r2, .L25
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L24
	bl	__stack_chk_fail
.L24:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L26:
	.align	2
.L25:
	.word	.LC0
	.word	handler_sigusr1
	.word	handler_sigusr2
	.word	barrier
	.word	thread_function
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
