	.file	"932850.c"
	.intel_syntax noprefix
	.text
	.globl	mail_box
	.bss
	.align 8
	.type	mail_box, @object
	.size	mail_box, 8
mail_box:
	.zero	8
	.globl	lock
	.align 32
	.type	lock, @object
	.size	lock, 40
lock:
	.zero	40
	.globl	flag
	.align 32
	.type	flag, @object
	.size	flag, 48
flag:
	.zero	48
	.section	.rodata
	.align 8
.LC0:
	.string	"usage: ./twordcount4 file1 file2"
	.align 8
.LC1:
	.string	"MAIN: waiting for flag to go up"
	.align 8
.LC2:
	.string	"MAIN: wow! flag was raised, I have the lock"
.LC3:
	.string	"the_stack_data/932850.c"
.LC4:
	.string	"mail_box != NULL"
.LC5:
	.string	"%d: %s\n"
.LC6:
	.string	"%d: total words\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 96
	mov	DWORD PTR -84[rbp], edi
	mov	QWORD PTR -96[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -84[rbp], 3
	je	.L2
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	DWORD PTR -72[rbp], 0
	mov	DWORD PTR -68[rbp], 0
	lea	rdi, lock[rip]
	call	pthread_mutex_lock@PLT
	mov	rax, QWORD PTR -96[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -48[rbp], rax
	mov	DWORD PTR -40[rbp], 0
	lea	rdx, -48[rbp]
	lea	rax, -64[rbp]
	mov	rcx, rdx
	lea	rdx, count_words[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	rax, QWORD PTR -96[rbp]
	mov	rax, QWORD PTR 16[rax]
	mov	QWORD PTR -32[rbp], rax
	mov	DWORD PTR -24[rbp], 0
	lea	rdx, -32[rbp]
	lea	rax, -56[rbp]
	mov	rcx, rdx
	lea	rdx, count_words[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	jmp	.L3
.L7:
	lea	rdi, .LC1[rip]
	call	puts@PLT
	lea	rsi, lock[rip]
	lea	rdi, flag[rip]
	call	pthread_cond_wait@PLT
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	rax, QWORD PTR mail_box[rip]
	test	rax, rax
	jne	.L4
	lea	rcx, __PRETTY_FUNCTION__.0[rip]
	mov	edx, 54
	lea	rsi, .LC3[rip]
	lea	rdi, .LC4[rip]
	call	__assert_fail@PLT
.L4:
	mov	rax, QWORD PTR mail_box[rip]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR mail_box[rip]
	mov	eax, DWORD PTR 8[rax]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR mail_box[rip]
	mov	eax, DWORD PTR 8[rax]
	add	DWORD PTR -68[rbp], eax
	mov	rdx, QWORD PTR mail_box[rip]
	lea	rax, -48[rbp]
	cmp	rdx, rax
	jne	.L5
	mov	rax, QWORD PTR -64[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
.L5:
	mov	rdx, QWORD PTR mail_box[rip]
	lea	rax, -32[rbp]
	cmp	rdx, rax
	jne	.L6
	mov	rax, QWORD PTR -56[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
.L6:
	mov	QWORD PTR mail_box[rip], 0
	lea	rdi, flag[rip]
	call	pthread_cond_signal@PLT
	add	DWORD PTR -72[rbp], 1
.L3:
	cmp	DWORD PTR -72[rbp], 1
	jle	.L7
	mov	eax, DWORD PTR -68[rbp]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@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
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC7:
	.string	"r"
.LC8:
	.string	"COUNT: waiting to get lock"
	.align 8
.LC9:
	.string	"COUNT: have lock, storing data"
.LC10:
	.string	"COUNT: raising flag"
.LC11:
	.string	"COUNT: unlocking box"
	.text
	.globl	count_words
	.type	count_words, @function
count_words:
.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, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -16[rbp], rax
	mov	QWORD PTR -8[rbp], 0
	mov	DWORD PTR -20[rbp], -1
	mov	DWORD PTR -24[rbp], 0
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	je	.L11
	jmp	.L12
.L14:
	call	__ctype_b_loc@PLT
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	add	rax, rax
	add	rax, rdx
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	and	eax, 8
	test	eax, eax
	jne	.L13
	call	__ctype_b_loc@PLT
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	add	rax, rax
	add	rax, rdx
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	and	eax, 8
	test	eax, eax
	je	.L13
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 8[rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	DWORD PTR 8[rax], edx
.L13:
	mov	eax, DWORD PTR -20[rbp]
	mov	DWORD PTR -24[rbp], eax
.L12:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	getc@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], -1
	jne	.L14
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	jmp	.L15
.L11:
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	perror@PLT
.L15:
	lea	rdi, .LC8[rip]
	call	puts@PLT
	lea	rdi, lock[rip]
	call	pthread_mutex_lock@PLT
	lea	rdi, .LC9[rip]
	call	puts@PLT
	mov	rax, QWORD PTR mail_box[rip]
	test	rax, rax
	je	.L16
	lea	rsi, lock[rip]
	lea	rdi, flag[rip]
	call	pthread_cond_wait@PLT
.L16:
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR mail_box[rip], rax
	lea	rdi, .LC10[rip]
	call	puts@PLT
	lea	rdi, flag[rip]
	call	pthread_cond_signal@PLT
	lea	rdi, .LC11[rip]
	call	puts@PLT
	lea	rdi, lock[rip]
	call	pthread_mutex_unlock@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	count_words, .-count_words
	.section	.rodata
	.type	__PRETTY_FUNCTION__.0, @object
	.size	__PRETTY_FUNCTION__.0, 5
__PRETTY_FUNCTION__.0:
	.string	"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	"932850.c"
	.text
	.comm	mail_box,4,4
	.global	lock
	.bss
	.align	2
	.type	lock, %object
	.size	lock, 24
lock:
	.space	24
	.global	flag
	.align	3
	.type	flag, %object
	.size	flag, 48
flag:
	.space	48
	.section	.rodata
	.align	2
.LC0:
	.ascii	"usage: ./twordcount4 file1 file2\000"
	.align	2
.LC1:
	.ascii	"MAIN: waiting for flag to go up\000"
	.align	2
.LC2:
	.ascii	"MAIN: wow! flag was raised, I have the lock\000"
	.align	2
.LC3:
	.ascii	"the_stack_data/932850.c\000"
	.align	2
.LC4:
	.ascii	"mail_box != NULL\000"
	.align	2
.LC5:
	.ascii	"%d: %s\012\000"
	.align	2
.LC6:
	.ascii	"%d: total words\012\000"
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	ldr	r3, .L10
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-48]
	cmp	r3, #3
	beq	.L2
	ldr	r0, .L10+4
	bl	puts
	mov	r0, #1
	bl	exit
.L2:
	mov	r3, #0
	str	r3, [fp, #-32]
	mov	r3, #0
	str	r3, [fp, #-28]
	ldr	r0, .L10+8
	bl	pthread_mutex_lock
	ldr	r3, [fp, #-52]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-20]
	sub	r3, fp, #24
	sub	r0, fp, #40
	ldr	r2, .L10+12
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-52]
	ldr	r3, [r3, #8]
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-12]
	sub	r3, fp, #16
	sub	r0, fp, #36
	ldr	r2, .L10+12
	mov	r1, #0
	bl	pthread_create
	b	.L3
.L7:
	ldr	r0, .L10+16
	bl	puts
	ldr	r1, .L10+8
	ldr	r0, .L10+20
	bl	pthread_cond_wait
	ldr	r0, .L10+24
	bl	puts
	ldr	r3, .L10+28
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L4
	ldr	r3, .L10+32
	mov	r2, #54
	ldr	r1, .L10+36
	ldr	r0, .L10+40
	bl	__assert_fail
.L4:
	ldr	r3, .L10+28
	ldr	r3, [r3]
	ldr	r1, [r3, #4]
	ldr	r3, .L10+28
	ldr	r3, [r3]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r0, .L10+44
	bl	printf
	ldr	r3, .L10+28
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	str	r3, [fp, #-28]
	ldr	r3, .L10+28
	ldr	r2, [r3]
	sub	r3, fp, #24
	cmp	r2, r3
	bne	.L5
	ldr	r3, [fp, #-40]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
.L5:
	ldr	r3, .L10+28
	ldr	r2, [r3]
	sub	r3, fp, #16
	cmp	r2, r3
	bne	.L6
	ldr	r3, [fp, #-36]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
.L6:
	ldr	r3, .L10+28
	mov	r2, #0
	str	r2, [r3]
	ldr	r0, .L10+20
	bl	pthread_cond_signal
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L3:
	ldr	r3, [fp, #-32]
	cmp	r3, #1
	ble	.L7
	ldr	r1, [fp, #-28]
	ldr	r0, .L10+48
	bl	printf
	mov	r3, #0
	ldr	r2, .L10
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L9
	bl	__stack_chk_fail
.L9:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC7
	.word	.LC0
	.word	lock
	.word	count_words
	.word	.LC1
	.word	flag
	.word	.LC2
	.word	mail_box
	.word	__PRETTY_FUNCTION__.5752
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.size	main, .-main
	.section	.rodata
	.align	2
.LC8:
	.ascii	"r\000"
	.align	2
.LC9:
	.ascii	"COUNT: waiting to get lock\000"
	.align	2
.LC10:
	.ascii	"COUNT: have lock, storing data\000"
	.align	2
.LC11:
	.ascii	"COUNT: raising flag\000"
	.align	2
.LC12:
	.ascii	"COUNT: unlocking box\000"
	.text
	.align	2
	.global	count_words
	.syntax unified
	.arm
	.fpu softvfp
	.type	count_words, %function
count_words:
	@ 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]
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-12]
	mvn	r3, #0
	str	r3, [fp, #-8]
	mov	r3, #0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	ldr	r1, .L20
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L13
	b	.L14
.L16:
	bl	__ctype_b_loc
	mov	r3, r0
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r3, [r3]
	and	r3, r3, #8
	cmp	r3, #0
	bne	.L15
	bl	__ctype_b_loc
	mov	r3, r0
	ldr	r2, [r3]
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r3, [r3]
	and	r3, r3, #8
	cmp	r3, #0
	beq	.L15
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	add	r2, r3, #1
	ldr	r3, [fp, #-16]
	str	r2, [r3, #4]
.L15:
	ldr	r3, [fp, #-8]
	str	r3, [fp, #-20]
.L14:
	ldr	r0, [fp, #-12]
	bl	getc
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L16
	ldr	r0, [fp, #-12]
	bl	fclose
	b	.L17
.L13:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	mov	r0, r3
	bl	perror
.L17:
	ldr	r0, .L20+4
	bl	puts
	ldr	r0, .L20+8
	bl	pthread_mutex_lock
	ldr	r0, .L20+12
	bl	puts
	ldr	r3, .L20+16
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L18
	ldr	r1, .L20+8
	ldr	r0, .L20+20
	bl	pthread_cond_wait
.L18:
	ldr	r2, .L20+16
	ldr	r3, [fp, #-16]
	str	r3, [r2]
	ldr	r0, .L20+24
	bl	puts
	ldr	r0, .L20+20
	bl	pthread_cond_signal
	ldr	r0, .L20+28
	bl	puts
	ldr	r0, .L20+8
	bl	pthread_mutex_unlock
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC8
	.word	.LC9
	.word	lock
	.word	.LC10
	.word	mail_box
	.word	flag
	.word	.LC11
	.word	.LC12
	.size	count_words, .-count_words
	.section	.rodata
	.align	2
	.type	__PRETTY_FUNCTION__.5752, %object
	.size	__PRETTY_FUNCTION__.5752, 5
__PRETTY_FUNCTION__.5752:
	.ascii	"main\000"
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
