	.file	"1000180.c"
	.intel_syntax noprefix
	.text
	.globl	mybarrier
	.bss
	.align 32
	.type	mybarrier, @object
	.size	mybarrier, 32
mybarrier:
	.zero	32
	.section	.rodata
	.align 8
.LC0:
	.string	"thread %d: Wait for %d seconds.\n"
.LC1:
	.string	"thread %d: I'm ready...\n"
.LC2:
	.string	"thread %d: going!\n"
	.text
	.globl	threadFn
	.type	threadFn, @function
threadFn:
.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 -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -8[rbp], eax
	call	rand@PLT
	movsx	rdx, eax
	imul	rdx, rdx, 1717986919
	shr	rdx, 32
	sar	edx
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	mov	ecx, edx
	sal	ecx, 2
	add	ecx, edx
	sub	eax, ecx
	mov	edx, eax
	lea	eax, 1[rdx]
	mov	DWORD PTR -4[rbp], eax
	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
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	sleep@PLT
	mov	eax, DWORD PTR -8[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, mybarrier[rip]
	call	pthread_barrier_wait@PLT
	mov	eax, DWORD PTR -8[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	threadFn, .-threadFn
	.section	.rodata
.LC3:
	.string	"main() is ready."
.LC4:
	.string	"main() is going!"
	.text
	.globl	main
	.type	main, @function
main:
.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, 80
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edi, 0
	call	time@PLT
	mov	edi, eax
	call	srand@PLT
	mov	edx, 5
	mov	esi, 0
	lea	rdi, mybarrier[rip]
	call	pthread_barrier_init@PLT
	mov	DWORD PTR -68[rbp], 0
	jmp	.L4
.L5:
	mov	eax, DWORD PTR -68[rbp]
	cdqe
	mov	edx, DWORD PTR -68[rbp]
	mov	DWORD PTR -64[rbp+rax*4], edx
	lea	rdx, -64[rbp]
	mov	eax, DWORD PTR -68[rbp]
	cdqe
	sal	rax, 2
	add	rdx, rax
	lea	rcx, -48[rbp]
	mov	eax, DWORD PTR -68[rbp]
	cdqe
	sal	rax, 3
	add	rax, rcx
	mov	rcx, rdx
	lea	rdx, threadFn[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	add	DWORD PTR -68[rbp], 1
.L4:
	cmp	DWORD PTR -68[rbp], 3
	jle	.L5
	lea	rdi, .LC3[rip]
	call	puts@PLT
	lea	rdi, mybarrier[rip]
	call	pthread_barrier_wait@PLT
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	DWORD PTR -68[rbp], 0
	jmp	.L6
.L7:
	mov	eax, DWORD PTR -68[rbp]
	cdqe
	mov	rax, QWORD PTR -48[rbp+rax*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	add	DWORD PTR -68[rbp], 1
.L6:
	cmp	DWORD PTR -68[rbp], 3
	jle	.L7
	lea	rdi, mybarrier[rip]
	call	pthread_barrier_destroy@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	"1000180.c"
	.text
	.comm	mybarrier,20,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"thread %d: Wait for %d seconds.\012\000"
	.align	2
.LC1:
	.ascii	"thread %d: I'm ready...\012\000"
	.align	2
.LC2:
	.ascii	"thread %d: going!\012\000"
	.text
	.align	2
	.global	threadFn
	.syntax unified
	.arm
	.fpu softvfp
	.type	threadFn, %function
threadFn:
	@ 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]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	bl	rand
	mov	r1, r0
	ldr	r3, .L3
	smull	r2, r3, r1, r3
	asr	r2, r3, #1
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	sub	r2, r1, r3
	add	r3, r2, #1
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-8]
	ldr	r1, [fp, #-12]
	ldr	r0, .L3+4
	bl	printf
	ldr	r3, [fp, #-8]
	mov	r0, r3
	bl	sleep
	ldr	r1, [fp, #-12]
	ldr	r0, .L3+8
	bl	printf
	ldr	r0, .L3+12
	bl	pthread_barrier_wait
	ldr	r1, [fp, #-12]
	ldr	r0, .L3+16
	bl	printf
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L4:
	.align	2
.L3:
	.word	1717986919
	.word	.LC0
	.word	.LC1
	.word	mybarrier
	.word	.LC2
	.size	threadFn, .-threadFn
	.section	.rodata
	.align	2
.LC3:
	.ascii	"main() is ready.\000"
	.align	2
.LC4:
	.ascii	"main() is going!\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	ldr	r3, .L12
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r0, #0
	bl	time
	mov	r3, r0
	mov	r0, r3
	bl	srand
	mov	r2, #5
	mov	r1, #0
	ldr	r0, .L12+4
	bl	pthread_barrier_init
	mov	r3, #0
	str	r3, [fp, #-44]
	b	.L6
.L7:
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r2, [fp, #-44]
	str	r2, [r3, #-20]
	sub	r2, fp, #40
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	add	r0, r2, r3
	sub	r2, fp, #24
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, .L12+8
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
.L6:
	ldr	r3, [fp, #-44]
	cmp	r3, #3
	ble	.L7
	ldr	r0, .L12+12
	bl	puts
	ldr	r0, .L12+4
	bl	pthread_barrier_wait
	ldr	r0, .L12+16
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-44]
	b	.L8
.L9:
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-36]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
.L8:
	ldr	r3, [fp, #-44]
	cmp	r3, #3
	ble	.L9
	ldr	r0, .L12+4
	bl	pthread_barrier_destroy
	mov	r3, #0
	ldr	r2, .L12
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L11
	bl	__stack_chk_fail
.L11:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L13:
	.align	2
.L12:
	.word	.LC5
	.word	mybarrier
	.word	threadFn
	.word	.LC3
	.word	.LC4
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
