#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ es_vocal(char);
int strlen(char *);
bool tiene_dos_consonantes(char *palabra) {
  int largo = strlen(palabra);
  int i;
  int consonantes = 0;
  for (i = 0; i < largo; ++i) {
    if (!es_vocal(palabra[i])) {
      ++consonantes;
    }
    if (consonantes == 2) {
      return true;
    }
  }
  return false;
}


x86 assembly (clang, -O0):
<tiene_dos_consonantes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    119e <tiene_dos_consonantes+0x7e>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <es_vocal@plt>
cmp    $0x0,%eax
jne    1175 <tiene_dos_consonantes+0x55>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x2,-0x1c(%rbp)
jne    118b <tiene_dos_consonantes+0x6b>
movl   $0x1,-0x4(%rbp)
jmp    11a5 <tiene_dos_consonantes+0x85>
jmp    1190 <tiene_dos_consonantes+0x70>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1146 <tiene_dos_consonantes+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tiene_dos_consonantes>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
call   1030 <strlen@plt>
test   %eax,%eax
jle    115e <tiene_dos_consonantes+0x3e>
mov    %eax,%r14d
xor    %ebx,%ebx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1040 <es_vocal@plt>
cmp    $0x1,%eax
adc    $0x0,%ebp
cmp    $0x2,%ebp
je     1162 <tiene_dos_consonantes+0x42>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <tiene_dos_consonantes+0x20>
xor    %eax,%eax
jmp    1167 <tiene_dos_consonantes+0x47>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @tiene_dos_consonantes(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %4
store i32 0, i32* %6
store i32 0, i32* %5
br label %9
9: ; preds = %29, %1
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %32
13: ; preds = %9
%14 = load i8*, i8** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = call i32 @es_vocal(i8 signext %18)
%20 = icmp ne i32 %19, 0
br i1 %20, label %24, label %21
21: ; preds = %13
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %24
24: ; preds = %21, %13
%25 = load i32, i32* %6
%26 = icmp eq i32 %25, 2
br i1 %26, label %27, label %28
27: ; preds = %24
store i32 1, i32* %2
br label %33
28: ; preds = %24
br label %29
29: ; preds = %28
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 1
store i32 %31, i32* %5
br label %9
32: ; preds = %9
store i32 0, i32* %2
br label %33
33: ; preds = %32, %27
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @tiene_dos_consonantes(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %19
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %18, %5
br i1 %7, label %19, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 0, %4 ], [ %18, %6 ]
%10 = phi i32 [ 0, %4 ], [ %16, %6 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %9
%12 = load i8, i8* %11
%13 = tail call i32 @es_vocal(i8 signext %12)
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = add nuw nsw i32 %10, %15
%17 = icmp eq i32 %16, 2
%18 = add nuw nsw i64 %9, 1
br i1 %17, label %19, label %6
19: ; preds = %8, %6, %1
%20 = phi i32 [ 0, %1 ], [ 0, %6 ], [ 1, %8 ]
ret i32 %20
}