#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*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strlower(char *);
char toupper(char);
void iglatinpay(char *english) {
  char piglatin[32];
  char *e;
  char append[] = "h";
  char ch;
  e = english;
  strlower(english);
  ch = *english;
  switch (ch) {
  case 'a':
  case 'e':
  case 'i':
  case 'o':
  case 'u':
    strcpy(piglatin, english);
    strcat(piglatin, "ay");
    break;
  case 'c':
  case 'p':
  case 'r':
  case 's':
  case 't':
  case 'w':
    if (*(english + 1) == 'h') {
      english += 2;
      strcpy(piglatin, english);
      append[0] = ch;
      strcat(piglatin, append);
      strcat(piglatin, "hay");
      break;
    }
  case 'q':
    if (*(english + 1) == 'u') {
      english += 2;
      strcpy(piglatin, english);
      append[0] = ch;
      strcat(piglatin, append);
      strcat(piglatin, "uay");
      break;
    }
  default:
    english++;
    strcpy(piglatin, english);
    append[0] = ch;
    strcat(piglatin, append);
    strcat(piglatin, "ay");
    break;
  }
  strcpy(e, piglatin);
  *e = toupper(*e);
}


x86 assembly (clang, -O0):
<iglatinpay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movw   $0x68,-0x3a(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <strlower@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x3b(%rbp)
movsbl -0x3b(%rbp),%eax
mov    %eax,-0x40(%rbp)
sub    $0x61,%eax
je     121d <iglatinpay+0xdd>
jmp    1181 <iglatinpay+0x41>
mov    -0x40(%rbp),%eax
sub    $0x63,%eax
je     123f <iglatinpay+0xff>
jmp    1192 <iglatinpay+0x52>
mov    -0x40(%rbp),%eax
sub    $0x65,%eax
je     121d <iglatinpay+0xdd>
jmp    11a3 <iglatinpay+0x63>
mov    -0x40(%rbp),%eax
sub    $0x69,%eax
je     121d <iglatinpay+0xdd>
jmp    11b4 <iglatinpay+0x74>
mov    -0x40(%rbp),%eax
sub    $0x6f,%eax
je     121d <iglatinpay+0xdd>
jmp    11c5 <iglatinpay+0x85>
mov    -0x40(%rbp),%eax
sub    $0x70,%eax
je     123f <iglatinpay+0xff>
jmp    11d6 <iglatinpay+0x96>
mov    -0x40(%rbp),%eax
sub    $0x71,%eax
je     1296 <iglatinpay+0x156>
jmp    11e7 <iglatinpay+0xa7>
mov    -0x40(%rbp),%eax
add    $0xffffff8e,%eax
sub    $0x3,%eax
jb     123f <iglatinpay+0xff>
jmp    11fb <iglatinpay+0xbb>
mov    -0x40(%rbp),%eax
sub    $0x75,%eax
je     121d <iglatinpay+0xdd>
jmp    120c <iglatinpay+0xcc>
mov    -0x40(%rbp),%eax
sub    $0x77,%eax
je     123f <iglatinpay+0xff>
jmp    12ed <iglatinpay+0x1ad>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x30(%rbp),%rdi
lea    0xdce(%rip),%rsi
call   1050 <strcat@plt>
jmp    1329 <iglatinpay+0x1e9>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x68,%eax
jne    1291 <iglatinpay+0x151>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x3b(%rbp),%al
mov    %al,-0x3a(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x3a(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0x30(%rbp),%rdi
lea    0xd7b(%rip),%rsi
call   1050 <strcat@plt>
jmp    1329 <iglatinpay+0x1e9>
jmp    1296 <iglatinpay+0x156>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x75,%eax
jne    12e8 <iglatinpay+0x1a8>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x3b(%rbp),%al
mov    %al,-0x3a(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x3a(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0x30(%rbp),%rdi
lea    0xd28(%rip),%rsi
call   1050 <strcat@plt>
jmp    1329 <iglatinpay+0x1e9>
jmp    12ed <iglatinpay+0x1ad>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x3b(%rbp),%al
mov    %al,-0x3a(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x3a(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0x30(%rbp),%rdi
lea    0xcdf(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x38(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x38(%rbp),%rax
movsbl (%rax),%edi
call   1040 <toupper@plt>
mov    %al,%cl
mov    -0x38(%rbp),%rax
mov    %cl,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iglatinpay>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rdi,%rbx
movw   $0x68,0xe(%rsp)
call   1060 <strlower@plt>
movsbl (%rbx),%ebp
mov    %ebp,%eax
add    $0xffffff9f,%eax
cmp    $0x16,%eax
ja     11f9 <iglatinpay+0xb9>
mov    $0x4e8004,%ecx
bt     %eax,%ecx
jb     118e <iglatinpay+0x4e>
mov    $0x104111,%ecx
bt     %eax,%ecx
jae    11c1 <iglatinpay+0x81>
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    121c <iglatinpay+0xdc>
mov    0x1(%rbx),%al
cmp    $0x68,%al
jne    11c9 <iglatinpay+0x89>
lea    0x2(%rbx),%rsi
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %bpl,0xe(%rsp)
lea    0xe(%rsp),%rsi
mov    %r14,%rdi
call   1050 <strcat@plt>
lea    0xe41(%rip),%rsi
jmp    1223 <iglatinpay+0xe3>
cmp    $0x10,%eax
jne    11f9 <iglatinpay+0xb9>
mov    0x1(%rbx),%al
cmp    $0x75,%al
jne    11f9 <iglatinpay+0xb9>
lea    0x2(%rbx),%rsi
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %bpl,0xe(%rsp)
lea    0xe(%rsp),%rsi
mov    %r14,%rdi
call   1050 <strcat@plt>
lea    0xe0d(%rip),%rsi
jmp    1223 <iglatinpay+0xe3>
lea    0x1(%rbx),%rsi
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %bpl,0xe(%rsp)
lea    0xe(%rsp),%rsi
mov    %r14,%rdi
call   1050 <strcat@plt>
lea    0xdde(%rip),%rsi
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1050 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
movsbl (%rbx),%edi
call   1040 <toupper@plt>
mov    %al,(%rbx)
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@__const.iglatinpay.append = [2 x i8] c"h\00"
@.str = [3 x i8] c"ay\00"
@.str.1 = [4 x i8] c"hay\00"
@.str.2 = [4 x i8] c"uay\00"
define void @iglatinpay(i8* %0) {
%2 = alloca i8*
%3 = alloca [32 x i8]
%4 = alloca i8*
%5 = alloca [2 x i8]
%6 = alloca i8
store i8* %0, i8** %2
%7 = bitcast [2 x i8]* %5 to i8*
%8 = load i8*, i8** %2
store i8* %8, i8** %4
%9 = load i8*, i8** %2
%10 = call i32 @strlower(i8* %9)
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
store i8 %12, i8* %6
%13 = load i8, i8* %6
%14 = sext i8 %13 to i32
switch i32 %14, label %61 [
i32 97, label %15
i32 101, label %15
i32 105, label %15
i32 111, label %15
i32 117, label %15
i32 99, label %21
i32 112, label %21
i32 114, label %21
i32 115, label %21
i32 116, label %21
i32 119, label %21
i32 113, label %41
]
15: ; preds = %1, %1, %1, %1, %1
%16 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%17 = load i8*, i8** %2
%18 = call i32 @strcpy(i8* %16, i8* %17)
%19 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%20 = call i32 @strcat(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %74
21: ; preds = %1, %1, %1, %1, %1, %1
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i64 1
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 104
br i1 %26, label %27, label %40
27: ; preds = %21
%28 = load i8*, i8** %2
%29 = getelementptr inbounds i8, i8* %28, i64 2
store i8* %29, i8** %2
%30 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%31 = load i8*, i8** %2
%32 = call i32 @strcpy(i8* %30, i8* %31)
%33 = load i8, i8* %6
%34 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %33, i8* %34
%35 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%36 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%37 = call i32 @strcat(i8* %35, i8* %36)
%38 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%39 = call i32 @strcat(i8* %38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %74
40: ; preds = %21
br label %41
41: ; preds = %1, %40
%42 = load i8*, i8** %2
%43 = getelementptr inbounds i8, i8* %42, i64 1
%44 = load i8, i8* %43
%45 = sext i8 %44 to i32
%46 = icmp eq i32 %45, 117
br i1 %46, label %47, label %60
47: ; preds = %41
%48 = load i8*, i8** %2
%49 = getelementptr inbounds i8, i8* %48, i64 2
store i8* %49, i8** %2
%50 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%51 = load i8*, i8** %2
%52 = call i32 @strcpy(i8* %50, i8* %51)
%53 = load i8, i8* %6
%54 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %53, i8* %54
%55 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%56 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%57 = call i32 @strcat(i8* %55, i8* %56)
%58 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%59 = call i32 @strcat(i8* %58, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %74
60: ; preds = %41
br label %61
61: ; preds = %1, %60
%62 = load i8*, i8** %2
%63 = getelementptr inbounds i8, i8* %62, i32 1
store i8* %63, i8** %2
%64 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%65 = load i8*, i8** %2
%66 = call i32 @strcpy(i8* %64, i8* %65)
%67 = load i8, i8* %6
%68 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %67, i8* %68
%69 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%70 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%71 = call i32 @strcat(i8* %69, i8* %70)
%72 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%73 = call i32 @strcat(i8* %72, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %74
74: ; preds = %61, %47, %27, %15
%75 = load i8*, i8** %4
%76 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%77 = call i32 @strcpy(i8* %75, i8* %76)
%78 = load i8*, i8** %4
%79 = load i8, i8* %78
%80 = call signext i8 @toupper(i8 signext %79)
%81 = load i8*, i8** %4
store i8 %80, i8* %81
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"ay\00"
@.str.1 = [4 x i8] c"hay\00"
@.str.2 = [4 x i8] c"uay\00"
define void @iglatinpay(i8* %0) {
%2 = alloca [32 x i8]
%3 = alloca i16
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%5 = bitcast i16* %3 to i8*
store i16 104, i16* %3
%6 = tail call i32 @strlower(i8* %0)
%7 = load i8, i8* %0
%8 = sext i8 %7 to i32
switch i32 %8, label %29 [
i32 97, label %12
i32 101, label %12
i32 105, label %12
i32 111, label %12
i32 117, label %12
i32 99, label %14
i32 112, label %14
i32 114, label %14
i32 115, label %14
i32 116, label %14
i32 119, label %14
i32 113, label %9
]
9: ; preds = %1
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = load i8, i8* %10
br label %22
12: ; preds = %1, %1, %1, %1, %1
%13 = call i32 @strcpy(i8* %4, i8* %0)
br label %33
14: ; preds = %1, %1, %1, %1, %1, %1
%15 = getelementptr inbounds i8, i8* %0, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 104
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = getelementptr inbounds i8, i8* %0, i64 2
%20 = call i32 @strcpy(i8* %4, i8* %19)
store i8 %7, i8* %5
%21 = call i32 @strcat(i8* %4, i8* %5)
br label %33
22: ; preds = %9, %14
%23 = phi i8 [ %11, %9 ], [ %16, %14 ]
%24 = icmp eq i8 %23, 117
br i1 %24, label %25, label %29
25: ; preds = %22
%26 = getelementptr inbounds i8, i8* %0, i64 2
%27 = call i32 @strcpy(i8* %4, i8* %26)
store i8 %7, i8* %5
%28 = call i32 @strcat(i8* %4, i8* %5)
br label %33
29: ; preds = %22, %1
%30 = getelementptr inbounds i8, i8* %0, i64 1
%31 = call i32 @strcpy(i8* %4, i8* %30)
store i8 %7, i8* %5
%32 = call i32 @strcat(i8* %4, i8* %5)
br label %33
33: ; preds = %29, %25, %18, %12
%34 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %29 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %25 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %18 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %12 ]
%35 = call i32 @strcat(i8* %4, i8* %34)
%36 = call i32 @strcpy(i8* %0, i8* %4)
%37 = load i8, i8* %0
%38 = call signext i8 @toupper(i8 signext %37)
store i8 %38, i8* %0
ret void
}