	.file	"60954.c"
	.intel_syntax noprefix
	.text
	.globl	Pthread_barrier_init
	.type	Pthread_barrier_init, @function
Pthread_barrier_init:
.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, 32
	mov	QWORD PTR -8[rbp], rdi
	mov	QWORD PTR -16[rbp], rsi
	mov	DWORD PTR -20[rbp], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_mutex_init@PLT
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 40
	mov	esi, 0
	mov	rdi, rax
	call	pthread_cond_init@PLT
	mov	edx, DWORD PTR -20[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR 88[rax], rdx
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR 96[rax], 0
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	Pthread_barrier_init, .-Pthread_barrier_init
	.globl	Pthread_barrier_wait
	.type	Pthread_barrier_wait, @function
Pthread_barrier_wait:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 96[rax]
	mov	rdx, QWORD PTR -24[rbp]
	mov	rsi, QWORD PTR 88[rdx]
	mov	edx, 0
	div	rsi
	add	rax, 1
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 96[rax]
	lea	rdx, 1[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR 96[rax], rdx
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 96[rax]
	mov	rdx, QWORD PTR -24[rbp]
	mov	rcx, QWORD PTR 88[rdx]
	mov	edx, 0
	div	rcx
	mov	rax, rdx
	test	rax, rax
	jne	.L4
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 40
	mov	rdi, rax
	call	pthread_cond_broadcast@PLT
	jmp	.L5
.L4:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	add	rdx, 40
	mov	rsi, rax
	mov	rdi, rdx
	call	pthread_cond_wait@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 96[rax]
	mov	rdx, QWORD PTR -24[rbp]
	mov	rcx, QWORD PTR 88[rdx]
	mov	edx, 0
	div	rcx
	cmp	QWORD PTR -8[rbp], rax
	jne	.L4
.L5:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	Pthread_barrier_wait, .-Pthread_barrier_wait
	.globl	Pthread_barrier_destroy
	.type	Pthread_barrier_destroy, @function
Pthread_barrier_destroy:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -8[rbp], rdi
	mov	eax, 0
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	Pthread_barrier_destroy, .-Pthread_barrier_destroy
	.globl	b
	.bss
	.align 32
	.type	b, @object
	.size	b, 104
b:
	.zero	104
	.globl	max_thread
	.data
	.align 4
	.type	max_thread, @object
	.size	max_thread, 4
max_thread:
	.long	4
	.globl	global_count
	.bss
	.align 8
	.type	global_count, @object
	.size	global_count, 8
global_count:
	.zero	8
	.text
	.globl	main
	.type	main, @function
main:
.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, 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -32[rbp], -1
	mov	QWORD PTR -24[rbp], -1
	lea	rax, -32[rbp]
	mov	rsi, rax
	mov	edi, 4
	call	setrlimit@PLT
	mov	eax, DWORD PTR max_thread[rip]
	mov	edx, eax
	mov	esi, 0
	lea	rdi, b[rip]
	call	Pthread_barrier_init
	mov	DWORD PTR -44[rbp], 0
	jmp	.L10
.L11:
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	mov	rdx, rax
	lea	rax, -40[rbp]
	mov	rcx, rdx
	lea	rdx, thread[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	add	DWORD PTR -44[rbp], 1
.L10:
	mov	eax, DWORD PTR max_thread[rip]
	cmp	DWORD PTR -44[rbp], eax
	jl	.L11
	call	pause@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	main, .-main
	.section	.rodata
.LC0:
	.string	"STARTING %d\n"
.LC1:
	.string	"%ld\n"
	.align 8
.LC2:
	.string	"ERROR my_count %ld  global_count %ld\n"
	.text
	.globl	thread
	.type	thread, @function
thread:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR -12[rbp], eax
	mov	QWORD PTR -8[rbp], 0
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, b[rip]
	call	Pthread_barrier_wait
.L17:
	lea	rdi, b[rip]
	call	Pthread_barrier_wait
	cmp	DWORD PTR -12[rbp], 0
	jne	.L15
	mov	rax, QWORD PTR global_count[rip]
	add	rax, 1
	mov	QWORD PTR global_count[rip], rax
	mov	rcx, QWORD PTR global_count[rip]
	movabs	rdx, 3022314549036572937
	mov	rax, rcx
	imul	rdx
	mov	rax, rdx
	sar	rax, 14
	mov	rdx, rcx
	sar	rdx, 63
	sub	rax, rdx
	imul	rdx, rax, 100000
	mov	rax, rcx
	sub	rax, rdx
	test	rax, rax
	jne	.L15
	mov	rax, QWORD PTR global_count[rip]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
.L15:
	lea	rdi, b[rip]
	call	Pthread_barrier_wait
	add	QWORD PTR -8[rbp], 1
	mov	rax, QWORD PTR global_count[rip]
	cmp	QWORD PTR -8[rbp], rax
	je	.L17
	mov	rdx, QWORD PTR global_count[rip]
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE10:
	.size	thread, .-thread
	.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	"60954.c"
	.text
	.align	2
	.global	Pthread_barrier_init
	.syntax unified
	.arm
	.fpu softvfp
	.type	Pthread_barrier_init, %function
Pthread_barrier_init:
	@ 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, #-8]
	str	r1, [fp, #-12]
	str	r2, [fp, #-16]
	ldr	r3, [fp, #-8]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_mutex_init
	ldr	r3, [fp, #-8]
	add	r3, r3, #24
	mov	r1, #0
	mov	r0, r3
	bl	pthread_cond_init
	ldr	r3, [fp, #-16]
	mov	r2, r3
	mov	r3, #0
	ldr	r1, [fp, #-8]
	str	r2, [r1, #72]
	str	r3, [r1, #76]
	ldr	r1, [fp, #-8]
	mov	r2, #0
	mov	r3, #0
	str	r2, [r1, #80]
	str	r3, [r1, #84]
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	Pthread_barrier_init, .-Pthread_barrier_init
	.global	__aeabi_uldivmod
	.align	2
	.global	Pthread_barrier_wait
	.syntax unified
	.arm
	.fpu softvfp
	.type	Pthread_barrier_wait, %function
Pthread_barrier_wait:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, fp, lr}
	add	fp, sp, #20
	sub	sp, sp, #16
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	mov	r0, r3
	bl	pthread_mutex_lock
	ldr	r3, [fp, #-32]
	add	r1, r3, #80
	ldmia	r1, {r0-r1}
	ldr	r3, [fp, #-32]
	add	r3, r3, #72
	ldmia	r3, {r2-r3}
	bl	__aeabi_uldivmod
	mov	r2, r0
	mov	r3, r1
	adds	r6, r2, #1
	adc	r7, r3, #0
	str	r6, [fp, #-28]
	str	r7, [fp, #-24]
	ldr	r3, [fp, #-32]
	add	r3, r3, #80
	ldmia	r3, {r2-r3}
	adds	r4, r2, #1
	adc	r5, r3, #0
	ldr	r3, [fp, #-32]
	str	r4, [r3, #80]
	str	r5, [r3, #84]
	ldr	r3, [fp, #-32]
	add	r1, r3, #80
	ldmia	r1, {r0-r1}
	ldr	r3, [fp, #-32]
	add	r3, r3, #72
	ldmia	r3, {r2-r3}
	bl	__aeabi_uldivmod
	orrs	r3, r2, r3
	bne	.L4
	ldr	r3, [fp, #-32]
	add	r3, r3, #24
	mov	r0, r3
	bl	pthread_cond_broadcast
	b	.L5
.L4:
	ldr	r3, [fp, #-32]
	add	r3, r3, #24
	ldr	r2, [fp, #-32]
	mov	r1, r2
	mov	r0, r3
	bl	pthread_cond_wait
	ldr	r3, [fp, #-32]
	add	r1, r3, #80
	ldmia	r1, {r0-r1}
	ldr	r3, [fp, #-32]
	add	r3, r3, #72
	ldmia	r3, {r2-r3}
	bl	__aeabi_uldivmod
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	sub	r3, fp, #28
	ldmia	r3, {r2-r3}
	cmp	r3, r1
	cmpeq	r2, r0
	bne	.L4
.L5:
	ldr	r3, [fp, #-32]
	mov	r0, r3
	bl	pthread_mutex_unlock
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, fp, pc}
	.size	Pthread_barrier_wait, .-Pthread_barrier_wait
	.align	2
	.global	Pthread_barrier_destroy
	.syntax unified
	.arm
	.fpu softvfp
	.type	Pthread_barrier_destroy, %function
Pthread_barrier_destroy:
	@ 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]
	mov	r3, #0
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	Pthread_barrier_destroy, .-Pthread_barrier_destroy
	.comm	b,88,8
	.global	max_thread
	.data
	.align	2
	.type	max_thread, %object
	.size	max_thread, 4
max_thread:
	.word	4
	.comm	global_count,8,8
	.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 = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	ldr	r3, .L14
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mvn	r3, #0
	str	r3, [fp, #-16]
	mvn	r3, #0
	str	r3, [fp, #-12]
	sub	r3, fp, #16
	mov	r1, r3
	mov	r0, #4
	bl	setrlimit
	ldr	r3, .L14+4
	ldr	r3, [r3]
	mov	r2, r3
	mov	r1, #0
	ldr	r0, .L14+8
	bl	Pthread_barrier_init
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L10
.L11:
	ldr	r3, [fp, #-20]
	sub	r0, fp, #24
	ldr	r2, .L14+12
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L10:
	ldr	r3, .L14+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	blt	.L11
	bl	pause
	mov	r3, #0
	ldr	r2, .L14
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L13
	bl	__stack_chk_fail
.L13:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	.LC0
	.word	max_thread
	.word	b
	.word	thread
	.size	main, .-main
	.section	.rodata
	.align	2
.LC1:
	.ascii	"STARTING %d\012\000"
	.global	__aeabi_ldivmod
	.align	2
.LC2:
	.ascii	"%ld\012\000"
	.align	2
.LC3:
	.ascii	"ERROR my_count %ld  global_count %ld\012\000"
	.text
	.align	2
	.global	thread
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread, %function
thread:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, fp, lr}
	add	fp, sp, #20
	sub	sp, sp, #32
	str	r0, [fp, #-40]
	ldr	r3, [fp, #-40]
	str	r3, [fp, #-32]
	mov	r2, #0
	mov	r3, #0
	str	r2, [fp, #-28]
	str	r3, [fp, #-24]
	ldr	r1, [fp, #-32]
	ldr	r0, .L20
	bl	printf
	ldr	r0, .L20+4
	bl	Pthread_barrier_wait
.L19:
	ldr	r0, .L20+4
	bl	Pthread_barrier_wait
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L17
	ldr	r3, .L20+8
	ldmia	r3, {r2-r3}
	adds	r4, r2, #1
	adc	r5, r3, #0
	ldr	r3, .L20+8
	stm	r3, {r4-r5}
	ldr	r3, .L20+8
	ldmia	r3, {r0-r1}
	ldr	r2, .L20+12
	mov	r3, #0
	bl	__aeabi_ldivmod
	orrs	r3, r2, r3
	bne	.L17
	ldr	r3, .L20+8
	ldmia	r3, {r2-r3}
	ldr	r0, .L20+16
	bl	printf
.L17:
	ldr	r0, .L20+4
	bl	Pthread_barrier_wait
	sub	r3, fp, #28
	ldmia	r3, {r2-r3}
	adds	r6, r2, #1
	adc	r7, r3, #0
	str	r6, [fp, #-28]
	str	r7, [fp, #-24]
	ldr	r3, .L20+8
	ldmia	r3, {r2-r3}
	sub	r1, fp, #28
	ldmia	r1, {r0-r1}
	cmp	r1, r3
	cmpeq	r0, r2
	beq	.L19
	ldr	r3, .L20+8
	ldmia	r3, {r2-r3}
	stm	sp, {r2-r3}
	sub	r3, fp, #28
	ldmia	r3, {r2-r3}
	ldr	r0, .L20+20
	bl	printf
	mov	r0, #1
	bl	exit
.L21:
	.align	2
.L20:
	.word	.LC1
	.word	b
	.word	global_count
	.word	100000
	.word	.LC2
	.word	.LC3
	.size	thread, .-thread
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
