// File: dekanfrus[P]pThreads/osproj2c.cpp
// Function: con(void*)
void *con(void*)
{
	sched_yield();
	// Stores the length of the phrase vector as an integer.
	int end = (int)phrase.size();

	// Iterate through the phrase vector and look for consonants.
	// If the word begins with a consonant, print that word.
	// Otherwise, yield the CPU to the other thread.
	for (int i = 0; i != end; i++)
	{
		if (phrase[i][0] != 'A' && phrase[i][0] != 'a' && phrase[i][0] != 'E' && phrase[i][0] != 'e' && phrase[i][0] != 'I' && phrase[i][0] != 'i' && phrase[i][0] != 'O' && phrase[i][0] != 'o' && phrase[i][0] != 'U' && phrase[i][0] != 'u')
			cout << "Con: " << phrase[i] << endl;
		else sched_yield();
	}
	// Exit the thread once the function has completed running.
	pthread_exit(NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
callq 0x2180
leaq 0x3da0(%rip), %rdi      # 0x6128
callq 0x29e0
movl %eax, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
je 0x2584
movslq -0x10(%rbp), %rsi
leaq 0x3d7a(%rip), %rdi      # 0x6128
callq 0x2a00
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x21f0
movsbl (%rax), %eax
cmpl $0x41, %eax
je 0x256f
movslq -0x10(%rbp), %rsi
leaq 0x3d52(%rip), %rdi      # 0x6128
callq 0x2a00
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x21f0
movsbl (%rax), %eax
cmpl $0x61, %eax
je 0x256f
movslq -0x10(%rbp), %rsi
leaq 0x3d2a(%rip), %rdi      # 0x6128
callq 0x2a00
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x21f0
movsbl (%rax), %eax
cmpl $0x45, %eax
je 0x256f
movslq -0x10(%rbp), %rsi
leaq 0x3d02(%rip), %rdi      # 0x6128
callq 0x2a00
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x21f0
movsbl (%rax), %eax
cmpl $0x65, %eax
je 0x256f
movslq -0x10(%rbp), %rsi
leaq 0x3cda(%rip), %rdi      # 0x6128
callq 0x2a00
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x21f0
movsbl (%rax), %eax
cmpl $0x49, %eax
je 0x256f
movslq -0x10(%rbp), %rsi
leaq 0x3cb2(%rip), %rdi      # 0x6128
callq 0x2a00
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x21f0
movsbl (%rax), %eax
cmpl $0x69, %eax
je 0x256f
movslq -0x10(%rbp), %rsi
leaq 0x3c8a(%rip), %rdi      # 0x6128
callq 0x2a00
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x21f0
movsbl (%rax), %eax
cmpl $0x4f, %eax
je 0x256f
movslq -0x10(%rbp), %rsi
leaq 0x3c62(%rip), %rdi      # 0x6128
callq 0x2a00
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x21f0
movsbl (%rax), %eax
cmpl $0x6f, %eax
je 0x256f
movslq -0x10(%rbp), %rsi
leaq 0x3c3a(%rip), %rdi      # 0x6128
callq 0x2a00
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x21f0
movsbl (%rax), %eax
cmpl $0x55, %eax
je 0x256f
movslq -0x10(%rbp), %rsi
leaq 0x3c16(%rip), %rdi      # 0x6128
callq 0x2a00
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x21f0
movsbl (%rax), %eax
cmpl $0x75, %eax
je 0x256f
movq 0x3a9e(%rip), %rdi      # 0x5fd0
leaq 0x1acb(%rip), %rsi      # 0x4004
callq 0x2100
movq %rax, -0x18(%rbp)
movslq -0x10(%rbp), %rsi
leaq 0x3bdb(%rip), %rdi      # 0x6128
callq 0x2a00
movq -0x18(%rbp), %rdi
movq %rax, %rsi
callq 0x20e0
movq %rax, %rdi
movq 0x3a58(%rip), %rsi      # 0x5fc0
callq 0x2130
jmp 0x2574
callq 0x2180
jmp 0x2576
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x2397
xorl %eax, %eax
movl %eax, %edi
callq 0x21d0
nopl (%rax)