#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 tolower(char);
int wordLen(char *);
int numeroConsonanti(char *s) {
  int i;
  int consonanti = 0;
  int len = wordLen(s);
  for (i = 0; i < len; i++) {
    switch (tolower(s[i])) {
    case 'a':
    case 'e':
    case 'i':
    case 'o':
    case 'u':
      break;
    default:
      consonanti++;
      break;
    }
  }
}


x86 assembly (clang, -O0):
<numeroConsonanti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <wordLen@plt>
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11db <numeroConsonanti+0xbb>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <tolower@plt>
mov    %eax,%ecx
mov    %ecx,-0x20(%rbp)
sub    $0x61,%eax
je     11ba <numeroConsonanti+0x9a>
jmp    1176 <numeroConsonanti+0x56>
mov    -0x20(%rbp),%eax
sub    $0x65,%eax
je     11ba <numeroConsonanti+0x9a>
jmp    1187 <numeroConsonanti+0x67>
mov    -0x20(%rbp),%eax
sub    $0x69,%eax
je     11ba <numeroConsonanti+0x9a>
jmp    1198 <numeroConsonanti+0x78>
mov    -0x20(%rbp),%eax
sub    $0x6f,%eax
je     11ba <numeroConsonanti+0x9a>
jmp    11a9 <numeroConsonanti+0x89>
mov    -0x20(%rbp),%eax
sub    $0x75,%eax
jne    11bf <numeroConsonanti+0x9f>
jmp    11ba <numeroConsonanti+0x9a>
jmp    11c8 <numeroConsonanti+0xa8>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11cd <numeroConsonanti+0xad>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1146 <numeroConsonanti+0x26>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numeroConsonanti>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <wordLen@plt>
test   %eax,%eax
jle    1153 <numeroConsonanti+0x33>
mov    %eax,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1040 <tolower@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <numeroConsonanti+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @numeroConsonanti(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %5
%7 = load i8*, i8** %3
%8 = call i32 @wordLen(i8* %7)
store i32 %8, i32* %6
store i32 0, i32* %4
br label %9
9: ; preds = %25, %1
%10 = load i32, i32* %4
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %28
13: ; preds = %9
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = call i32 @tolower(i8 signext %18)
switch i32 %19, label %21 [
i32 97, label %20
i32 101, label %20
i32 105, label %20
i32 111, label %20
i32 117, label %20
]
20: ; preds = %13, %13, %13, %13, %13
br label %24
21: ; preds = %13
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %24
24: ; preds = %21, %20
br label %25
25: ; preds = %24
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %9
28: ; preds = %9
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @numeroConsonanti(i8* %0) {
%2 = tail call i32 @wordLen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @tolower(i8 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %1
ret i32 undef
}