	.file	"643012.c"
	.intel_syntax noprefix
	.text
	.local	s_silent
	.comm	s_silent,4,4
	.section	.rodata
.LC0:
	.string	"thread %lx iteration 0\n"
	.align 8
.LC1:
	.string	"thread %lx iteration %d; writing to %p\n"
	.text
	.type	threadfunc, @function
threadfunc:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r12
	push	rbx
	sub	rsp, 48
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	mov	QWORD PTR -56[rbp], rdi
	mov	rax, QWORD PTR -56[rbp]
	mov	rax, QWORD PTR 16[rax]
	mov	QWORD PTR -32[rbp], rax
	mov	rax, QWORD PTR -56[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -24[rbp], rax
	mov	eax, DWORD PTR s_silent[rip]
	test	eax, eax
	jne	.L2
	call	pthread_self@PLT
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
.L2:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	pthread_barrier_wait@PLT
	mov	DWORD PTR -36[rbp], 0
	jmp	.L3
.L5:
	mov	eax, DWORD PTR s_silent[rip]
	test	eax, eax
	jne	.L4
	mov	eax, DWORD PTR -36[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -32[rbp]
	lea	r12, [rdx+rax]
	mov	eax, DWORD PTR -36[rbp]
	lea	ebx, 1[rax]
	call	pthread_self@PLT
	mov	rcx, r12
	mov	edx, ebx
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
.L4:
	mov	eax, DWORD PTR -36[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR -36[rbp]
	mov	BYTE PTR [rax], dl
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	pthread_barrier_wait@PLT
	add	DWORD PTR -36[rbp], 1
.L3:
	mov	rax, QWORD PTR -56[rbp]
	mov	eax, DWORD PTR 24[rax]
	cmp	DWORD PTR -36[rbp], eax
	jl	.L5
	mov	eax, 0
	add	rsp, 48
	pop	rbx
	pop	r12
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	threadfunc, .-threadfunc
	.section	.rodata
.LC2:
	.string	"&array[0] = %p\n"
.LC3:
	.string	"the_stack_data/643012.c"
.LC4:
	.string	"res == 0"
	.align 8
.LC5:
	.string	"Could not create thread #%d (of %d): %s\n"
	.text
	.type	barriers_and_races, @function
barriers_and_races:
.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, 144
	mov	DWORD PTR -132[rbp], edi
	mov	DWORD PTR -136[rbp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR -132[rbp]
	cdqe
	sal	rax, 5
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -112[rbp], rax
	mov	eax, DWORD PTR -136[rbp]
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -104[rbp], rax
	mov	eax, DWORD PTR s_silent[rip]
	test	eax, eax
	jne	.L8
	mov	rax, QWORD PTR -104[rbp]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
.L8:
	mov	edx, DWORD PTR -132[rbp]
	lea	rax, -96[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_barrier_init@PLT
	lea	rax, -64[rbp]
	mov	rdi, rax
	call	pthread_attr_init@PLT
	lea	rax, -64[rbp]
	mov	esi, 20480
	mov	rdi, rax
	call	pthread_attr_setstacksize@PLT
	mov	DWORD PTR -116[rbp], eax
	cmp	DWORD PTR -116[rbp], 0
	je	.L9
	lea	rcx, __PRETTY_FUNCTION__.0[rip]
	mov	edx, 85
	lea	rsi, .LC3[rip]
	lea	rdi, .LC4[rip]
	call	__assert_fail@PLT
.L9:
	mov	DWORD PTR -120[rbp], 0
	jmp	.L10
.L12:
	mov	eax, DWORD PTR -120[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -112[rbp]
	add	rdx, rax
	lea	rax, -96[rbp]
	mov	QWORD PTR [rdx], rax
	mov	eax, DWORD PTR -120[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -112[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -104[rbp]
	mov	QWORD PTR 16[rdx], rax
	mov	eax, DWORD PTR -120[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -112[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -136[rbp]
	mov	DWORD PTR 24[rdx], eax
	mov	eax, DWORD PTR -120[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -112[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -120[rbp]
	cdqe
	sal	rax, 5
	mov	rcx, rax
	mov	rax, QWORD PTR -112[rbp]
	add	rax, rcx
	lea	rdi, 8[rax]
	lea	rax, -64[rbp]
	mov	rcx, rdx
	lea	rdx, threadfunc[rip]
	mov	rsi, rax
	call	pthread_create@PLT
	mov	DWORD PTR -116[rbp], eax
	cmp	DWORD PTR -116[rbp], 0
	je	.L11
	mov	eax, DWORD PTR -116[rbp]
	mov	edi, eax
	call	strerror@PLT
	mov	rsi, rax
	mov	rax, QWORD PTR stderr[rip]
	mov	ecx, DWORD PTR -132[rbp]
	mov	edx, DWORD PTR -120[rbp]
	mov	r8, rsi
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L11:
	add	DWORD PTR -120[rbp], 1
.L10:
	mov	eax, DWORD PTR -120[rbp]
	cmp	eax, DWORD PTR -132[rbp]
	jl	.L12
	lea	rax, -64[rbp]
	mov	rdi, rax
	call	pthread_attr_destroy@PLT
	mov	DWORD PTR -120[rbp], 0
	jmp	.L13
.L14:
	mov	eax, DWORD PTR -120[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -112[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR 8[rax]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	add	DWORD PTR -120[rbp], 1
.L13:
	mov	eax, DWORD PTR -120[rbp]
	cmp	eax, DWORD PTR -132[rbp]
	jl	.L14
	lea	rax, -96[rbp]
	mov	rdi, rax
	call	pthread_barrier_destroy@PLT
	mov	rax, QWORD PTR -104[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -112[rbp]
	mov	rdi, rax
	call	free@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	barriers_and_races, .-barriers_and_races
	.globl	main
	.type	main, @function
main:
.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	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	cmp	DWORD PTR -20[rbp], 1
	jle	.L17
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	jmp	.L18
.L17:
	mov	eax, 2
.L18:
	mov	DWORD PTR -8[rbp], eax
	cmp	DWORD PTR -20[rbp], 2
	jle	.L19
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	jmp	.L20
.L19:
	mov	eax, 3
.L20:
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -20[rbp], 3
	jle	.L21
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	jmp	.L22
.L21:
	mov	eax, 0
.L22:
	mov	DWORD PTR s_silent[rip], eax
	mov	edx, DWORD PTR -4[rbp]
	mov	eax, DWORD PTR -8[rbp]
	mov	esi, edx
	mov	edi, eax
	call	barriers_and_races
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.section	.rodata
	.align 16
	.type	__PRETTY_FUNCTION__.0, @object
	.size	__PRETTY_FUNCTION__.0, 19
__PRETTY_FUNCTION__.0:
	.string	"barriers_and_races"
	.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	"643012.c"
	.text
	.local	s_silent
	.comm	s_silent,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"thread %lx iteration 0\012\000"
	.align	2
.LC1:
	.ascii	"thread %lx iteration %d; writing to %p\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	threadfunc, %function
threadfunc:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #8]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r3, .L7
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L2
	bl	pthread_self
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L7+4
	bl	printf
.L2:
	ldr	r0, [fp, #-8]
	bl	pthread_barrier_wait
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L3
.L5:
	ldr	r3, .L7
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L4
	bl	pthread_self
	ldr	r3, [fp, #-16]
	add	r1, r3, #1
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	mov	r2, r1
	mov	r1, r0
	ldr	r0, .L7+8
	bl	printf
.L4:
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	ldr	r2, [fp, #-16]
	lsl	r2, r2, #24
	asr	r2, r2, #24
	strb	r2, [r3]
	ldr	r0, [fp, #-8]
	bl	pthread_barrier_wait
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L3:
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #12]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	blt	.L5
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	s_silent
	.word	.LC0
	.word	.LC1
	.size	threadfunc, .-threadfunc
	.section	.rodata
	.align	2
.LC2:
	.ascii	"&array[0] = %p\012\000"
	.align	2
.LC3:
	.ascii	"the_stack_data/643012.c\000"
	.align	2
.LC4:
	.ascii	"res == 0\000"
	.align	2
.LC5:
	.ascii	"Could not create thread #%d (of %d): %s\012\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	barriers_and_races, %function
barriers_and_races:
	@ args = 0, pretend = 0, frame = 88
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #100
	str	r0, [fp, #-96]
	str	r1, [fp, #-100]
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, [fp, #-96]
	lsl	r3, r3, #4
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-84]
	ldr	r3, [fp, #-100]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-80]
	ldr	r3, .L18+4
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L10
	ldr	r1, [fp, #-80]
	ldr	r0, .L18+8
	bl	printf
.L10:
	ldr	r2, [fp, #-96]
	sub	r3, fp, #72
	mov	r1, #0
	mov	r0, r3
	bl	pthread_barrier_init
	sub	r3, fp, #52
	mov	r0, r3
	bl	pthread_attr_init
	sub	r3, fp, #52
	mov	r1, #20480
	mov	r0, r3
	bl	pthread_attr_setstacksize
	str	r0, [fp, #-76]
	ldr	r3, [fp, #-76]
	cmp	r3, #0
	beq	.L11
	ldr	r3, .L18+12
	mov	r2, #85
	ldr	r1, .L18+16
	ldr	r0, .L18+20
	bl	__assert_fail
.L11:
	mov	r3, #0
	str	r3, [fp, #-88]
	b	.L12
.L14:
	ldr	r3, [fp, #-88]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-84]
	add	r3, r2, r3
	sub	r2, fp, #72
	str	r2, [r3]
	ldr	r3, [fp, #-88]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-84]
	add	r3, r2, r3
	ldr	r2, [fp, #-80]
	str	r2, [r3, #8]
	ldr	r3, [fp, #-88]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-84]
	add	r3, r2, r3
	ldr	r2, [fp, #-100]
	str	r2, [r3, #12]
	ldr	r3, [fp, #-88]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-84]
	add	r3, r2, r3
	add	r0, r3, #4
	ldr	r3, [fp, #-88]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-84]
	add	r3, r2, r3
	sub	r1, fp, #52
	ldr	r2, .L18+24
	bl	pthread_create
	str	r0, [fp, #-76]
	ldr	r3, [fp, #-76]
	cmp	r3, #0
	beq	.L13
	ldr	r3, .L18+28
	ldr	r4, [r3]
	ldr	r0, [fp, #-76]
	bl	strerror
	mov	r3, r0
	str	r3, [sp]
	ldr	r3, [fp, #-96]
	ldr	r2, [fp, #-88]
	ldr	r1, .L18+32
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L13:
	ldr	r3, [fp, #-88]
	add	r3, r3, #1
	str	r3, [fp, #-88]
.L12:
	ldr	r2, [fp, #-88]
	ldr	r3, [fp, #-96]
	cmp	r2, r3
	blt	.L14
	sub	r3, fp, #52
	mov	r0, r3
	bl	pthread_attr_destroy
	mov	r3, #0
	str	r3, [fp, #-88]
	b	.L15
.L16:
	ldr	r3, [fp, #-88]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-84]
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-88]
	add	r3, r3, #1
	str	r3, [fp, #-88]
.L15:
	ldr	r2, [fp, #-88]
	ldr	r3, [fp, #-96]
	cmp	r2, r3
	blt	.L16
	sub	r3, fp, #72
	mov	r0, r3
	bl	pthread_barrier_destroy
	ldr	r0, [fp, #-80]
	bl	free
	ldr	r0, [fp, #-84]
	bl	free
	nop
	ldr	r3, .L18
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L17
	bl	__stack_chk_fail
.L17:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L19:
	.align	2
.L18:
	.word	.LC6
	.word	s_silent
	.word	.LC2
	.word	__PRETTY_FUNCTION__.6260
	.word	.LC3
	.word	.LC4
	.word	threadfunc
	.word	stderr
	.word	.LC5
	.size	barriers_and_races, .-barriers_and_races
	.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
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r3, [fp, #-16]
	cmp	r3, #1
	ble	.L21
	ldr	r3, [fp, #-20]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	b	.L22
.L21:
	mov	r3, #2
.L22:
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-16]
	cmp	r3, #2
	ble	.L23
	ldr	r3, [fp, #-20]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	b	.L24
.L23:
	mov	r3, #3
.L24:
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	cmp	r3, #3
	ble	.L25
	ldr	r3, [fp, #-20]
	add	r3, r3, #12
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	b	.L26
.L25:
	mov	r3, #0
.L26:
	ldr	r2, .L28
	str	r3, [r2]
	ldr	r1, [fp, #-8]
	ldr	r0, [fp, #-12]
	bl	barriers_and_races
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L29:
	.align	2
.L28:
	.word	s_silent
	.size	main, .-main
	.section	.rodata
	.align	2
	.type	__PRETTY_FUNCTION__.6260, %object
	.size	__PRETTY_FUNCTION__.6260, 19
__PRETTY_FUNCTION__.6260:
	.ascii	"barriers_and_races\000"
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
