#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*/ printf(char *);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
int isSwara(char *akshara, int *idx, int buf_count) {
  char *swara[] = {"a",   "aa",  "A",   "i",   "ii",  "I",   "u",   "uu",
                   "U",   "RRi", "R^i", "RRI", "R^I", "LLi", "L^i", "LLI",
                   "L^I", "e",   "ai",  "o",   "au",  "ou"};
  int i = 0, flag = 0;
  for (i = 0; i < 22; i++) {
    if (buf_count == 9) {
      if (!strcmp(swara[i], akshara)) {
        printf("\nFound a pure swara\n");
        *idx = i;
        flag = 1;
        break;
      }
    } else if (!strncmp(swara[i], akshara, buf_count)) {
      printf("\nFound a partial swara\n");
      *idx = i;
      flag = 1;
      break;
    }
  }
  return flag;
}


x86 assembly (clang, -O0):
<isSwara>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0xd0(%rbp),%rdi
lea    0x2c0c(%rip),%rsi
mov    $0xb0,%edx
call   1060 <memcpy@plt>
movl   $0x0,-0xd4(%rbp)
movl   $0x0,-0xd8(%rbp)
movl   $0x0,-0xd4(%rbp)
cmpl   $0x16,-0xd4(%rbp)
jge    1259 <isSwara+0x119>
cmpl   $0x9,-0x14(%rbp)
jne    11f0 <isSwara+0xb0>
movslq -0xd4(%rbp),%rax
mov    -0xd0(%rbp,%rax,8),%rdi
ff
mov    -0x8(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    11eb <isSwara+0xab>
lea    0xe6f(%rip),%rdi
call   1040 <printf@plt>
mov    -0xd4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0xd8(%rbp)
jmp    1259 <isSwara+0x119>
jmp    1240 <isSwara+0x100>
movslq -0xd4(%rbp),%rax
mov    -0xd0(%rbp,%rax,8),%rdi
ff
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    123b <isSwara+0xfb>
lea    0xe34(%rip),%rdi
call   1040 <printf@plt>
mov    -0xd4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0xd8(%rbp)
jmp    1259 <isSwara+0x119>
jmp    1240 <isSwara+0x100>
jmp    1245 <isSwara+0x105>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    118c <isSwara+0x4c>
mov    -0xd8(%rbp),%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSwara>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%r13d
mov    %rsi,%r14
mov    %rdi,%r12
lea    0x2c25(%rip),%rbp
xor    %ebx,%ebx
lea    0xee6(%rip),%r15
jmp    117a <isSwara+0x4a>
cs nopw 0x0(%rax,%rax,1)
mov    %r13d,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1197 <isSwara+0x67>
add    $0x1,%rbx
add    $0x8,%rbp
cmp    $0x16,%rbx
je     11a9 <isSwara+0x79>
mov    0x0(%rbp),%rdi
mov    %r12,%rsi
cmp    $0x9,%r13d
jne    1160 <isSwara+0x30>
call   1050 <strcmp@plt>
test   %eax,%eax
jne    116c <isSwara+0x3c>
lea    0xeba(%rip),%r15
mov    %r15,%rdi
call   1040 <puts@plt>
mov    %ebx,(%r14)
mov    $0x1,%eax
jmp    11ab <isSwara+0x7b>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [3 x i8] c"aa\00"
@.str.2 = [2 x i8] c"A\00"
@.str.3 = [2 x i8] c"i\00"
@.str.4 = [3 x i8] c"ii\00"
@.str.5 = [2 x i8] c"I\00"
@.str.6 = [2 x i8] c"u\00"
@.str.7 = [3 x i8] c"uu\00"
@.str.8 = [2 x i8] c"U\00"
@.str.9 = [4 x i8] c"RRi\00"
@.str.10 = [4 x i8] c"R^i\00"
@.str.11 = [4 x i8] c"RRI\00"
@.str.12 = [4 x i8] c"R^I\00"
@.str.13 = [4 x i8] c"LLi\00"
@.str.14 = [4 x i8] c"L^i\00"
@.str.15 = [4 x i8] c"LLI\00"
@.str.16 = [4 x i8] c"L^I\00"
@.str.17 = [2 x i8] c"e\00"
@.str.18 = [3 x i8] c"ai\00"
@.str.19 = [2 x i8] c"o\00"
@.str.20 = [3 x i8] c"au\00"
@.str.21 = [3 x i8] c"ou\00"
@__const.isSwara.swara = [22 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.21, i32 0, i32 0)]
@.str.22 = [21 x i8] c"\0AFound a pure swara\0A\00"
@.str.23 = [24 x i8] c"\0AFound a partial swara\0A\00"
define i32 @isSwara(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca [22 x i8*]
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%10 = bitcast [22 x i8*]* %7 to i8*
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %8
br label %11
11: ; preds = %45, %3
%12 = load i32, i32* %8
%13 = icmp slt i32 %12, 22
br i1 %13, label %14, label %48
14: ; preds = %11
%15 = load i32, i32* %6
%16 = icmp eq i32 %15, 9
br i1 %16, label %17, label %30
17: ; preds = %14
%18 = load i32, i32* %8
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [22 x i8*], [22 x i8*]* %7, i64 0, i64 %19
%21 = load i8*, i8** %20
%22 = load i8*, i8** %4
%23 = call i32 @strcmp(i8* %21, i8* %22)
%24 = icmp ne i32 %23, 0
br i1 %24, label %29, label %25
25: ; preds = %17
%26 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.22, i64 0, i64 0))
%27 = load i32, i32* %8
%28 = load i32*, i32** %5
store i32 %27, i32* %28
store i32 1, i32* %9
br label %48
29: ; preds = %17
br label %44
30: ; preds = %14
%31 = load i32, i32* %8
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [22 x i8*], [22 x i8*]* %7, i64 0, i64 %32
%34 = load i8*, i8** %33
%35 = load i8*, i8** %4
%36 = load i32, i32* %6
%37 = call i32 @strncmp(i8* %34, i8* %35, i32 %36)
%38 = icmp ne i32 %37, 0
br i1 %38, label %43, label %39
39: ; preds = %30
%40 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.23, i64 0, i64 0))
%41 = load i32, i32* %8
%42 = load i32*, i32** %5
store i32 %41, i32* %42
store i32 1, i32* %9
br label %48
43: ; preds = %30
br label %44
44: ; preds = %43, %29
br label %45
45: ; preds = %44
%46 = load i32, i32* %8
%47 = add nsw i32 %46, 1
store i32 %47, i32* %8
br label %11
48: ; preds = %39, %25, %11
%49 = load i32, i32* %9
ret i32 %49
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@.str.1 = [3 x i8] c"aa\00"
@.str.2 = [2 x i8] c"A\00"
@.str.3 = [2 x i8] c"i\00"
@.str.4 = [3 x i8] c"ii\00"
@.str.5 = [2 x i8] c"I\00"
@.str.6 = [2 x i8] c"u\00"
@.str.7 = [3 x i8] c"uu\00"
@.str.8 = [2 x i8] c"U\00"
@.str.9 = [4 x i8] c"RRi\00"
@.str.10 = [4 x i8] c"R^i\00"
@.str.11 = [4 x i8] c"RRI\00"
@.str.12 = [4 x i8] c"R^I\00"
@.str.13 = [4 x i8] c"LLi\00"
@.str.14 = [4 x i8] c"L^i\00"
@.str.15 = [4 x i8] c"LLI\00"
@.str.16 = [4 x i8] c"L^I\00"
@.str.17 = [2 x i8] c"e\00"
@.str.18 = [3 x i8] c"ai\00"
@.str.19 = [2 x i8] c"o\00"
@.str.20 = [3 x i8] c"au\00"
@.str.21 = [3 x i8] c"ou\00"
@__const.isSwara.swara = [22 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.21, i32 0, i32 0)]
@str = [23 x i8] c"\0AFound a partial swara\00"
@str.24 = [20 x i8] c"\0AFound a pure swara\00"
define i32 @isSwara(i8* %0, i32* nocapture writeonly %1, i32 %2) {
%4 = icmp eq i32 %2, 9
br label %5
5: ; preds = %3, %15
%6 = phi i64 [ 0, %3 ], [ %16, %15 ]
%7 = getelementptr inbounds [22 x i8*], [22 x i8*]* @__const.isSwara.swara, i64 0, i64 %6
%8 = load i8*, i8** %7
br i1 %4, label %9, label %12
9: ; preds = %5
%10 = tail call i32 @strcmp(i8* dereferenceable(1) %8, i8* dereferenceable(1) %0)
%11 = icmp eq i32 %10, 0
br i1 %11, label %18, label %15
12: ; preds = %5
%13 = tail call i32 @strncmp(i8* %8, i8* %0, i32 %2)
%14 = icmp eq i32 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %9, %12
%16 = add nuw nsw i64 %6, 1
%17 = icmp eq i64 %16, 22
br i1 %17, label %22, label %5
18: ; preds = %12, %9
%19 = phi i8* [ getelementptr inbounds ([20 x i8], [20 x i8]* @str.24, i64 0, i64 0), %9 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0), %12 ]
%20 = trunc i64 %6 to i32
%21 = tail call i32 @puts(i8* dereferenceable(1) %19)
store i32 %20, i32* %1
br label %22
22: ; preds = %15, %18
%23 = phi i32 [ 1, %18 ], [ 0, %15 ]
ret i32 %23
}