#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 */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
scalar_t__ isVowel(char);
scalar_t__ isalpha(char);
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ stdin;
int strlen(char *);
int main() {
  char *line = (char *)calloc(128, sizeof(char));
  char *outConsonants = (char *)calloc(128, sizeof(char));
  char *outVowels = (char *)calloc(128, sizeof(char));
  int c = 0, v = 0;
  fgets(line, 128, stdin);
  for (int i = 0; i < strlen(line); i++) {
    if (isVowel(line[i]))
      outVowels[v++] = line[i];
    else if (isalpha(line[i]))
      outConsonants[c++] = line[i];
  }
  printf("%s\n%s", outConsonants, outVowels);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x80,%edi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x80,%edi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x80,%edi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e27(%rip),%rax
mov    (%rax),%edx
mov    $0x80,%esi
call   1050 <fgets@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
cmp    %ecx,%eax
jge    1283 <main+0x123>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1080 <isVowel@plt>
cmp    $0x0,%rax
je     1230 <main+0xd0>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x28(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1270 <main+0x110>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1070 <isalpha@plt>
cmp    $0x0,%rax
je     126b <main+0x10b>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x24(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1270 <main+0x110>
jmp    1275 <main+0x115>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11d4 <main+0x74>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xd6e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x80,%edi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,%r12
mov    $0x80,%edi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,%r14
mov    $0x80,%edi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,%r15
mov    0x2e40(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
mov    $0x80,%esi
call   1050 <fgets@plt>
mov    %r12,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    1227 <main+0xc7>
xor    %ebx,%ebx
xor    %r13d,%r13d
xor    %ebp,%ebp
jmp    11f5 <main+0x95>
nopl   0x0(%rax)
mov    %r13d,%eax
lea    0x1(%r13),%esi
mov    %r15,%rdx
mov    %esi,%r13d
cltq
mov    %cl,(%rdx,%rax,1)
add    $0x1,%rbx
mov    %r12,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jge    1227 <main+0xc7>
movsbl (%r12,%rbx,1),%edi
call   1080 <isVowel@plt>
movzbl (%r12,%rbx,1),%ecx
test   %rax,%rax
jne    11d0 <main+0x70>
movsbl %cl,%edi
call   1070 <isalpha@plt>
test   %rax,%rax
je     11e2 <main+0x82>
movzbl (%r12,%rbx,1),%ecx
mov    %ebp,%eax
lea    0x1(%rbp),%esi
mov    %r14,%rdx
mov    %esi,%ebp
jmp    11dd <main+0x7d>
lea    0xdd2(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [6 x i8] c"%s\0A%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i64 @calloc(i32 128, i32 1)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %2
%10 = call i64 @calloc(i32 128, i32 1)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %3
%12 = call i64 @calloc(i32 128, i32 1)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %4
store i32 0, i32* %5
store i32 0, i32* %6
%14 = load i8*, i8** %2
%15 = load i32, i32* @stdin
%16 = call i32 @fgets(i8* %14, i32 128, i32 %15)
store i32 0, i32* %7
br label %17
17: ; preds = %62, %0
%18 = load i32, i32* %7
%19 = load i8*, i8** %2
%20 = call i32 @strlen(i8* %19)
%21 = icmp slt i32 %18, %20
br i1 %21, label %22, label %65
22: ; preds = %17
%23 = load i8*, i8** %2
%24 = load i32, i32* %7
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
%27 = load i8, i8* %26
%28 = call i64 @isVowel(i8 signext %27)
%29 = icmp ne i64 %28, 0
br i1 %29, label %30, label %41
30: ; preds = %22
%31 = load i8*, i8** %2
%32 = load i32, i32* %7
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %31, i64 %33
%35 = load i8, i8* %34
%36 = load i8*, i8** %4
%37 = load i32, i32* %6
%38 = add nsw i32 %37, 1
store i32 %38, i32* %6
%39 = sext i32 %37 to i64
%40 = getelementptr inbounds i8, i8* %36, i64 %39
store i8 %35, i8* %40
br label %61
41: ; preds = %22
%42 = load i8*, i8** %2
%43 = load i32, i32* %7
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8, i8* %42, i64 %44
%46 = load i8, i8* %45
%47 = call i64 @isalpha(i8 signext %46)
%48 = icmp ne i64 %47, 0
br i1 %48, label %49, label %60
49: ; preds = %41
%50 = load i8*, i8** %2
%51 = load i32, i32* %7
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8, i8* %50, i64 %52
%54 = load i8, i8* %53
%55 = load i8*, i8** %3
%56 = load i32, i32* %5
%57 = add nsw i32 %56, 1
store i32 %57, i32* %5
%58 = sext i32 %56 to i64
%59 = getelementptr inbounds i8, i8* %55, i64 %58
store i8 %54, i8* %59
br label %60
60: ; preds = %49, %41
br label %61
61: ; preds = %60, %30
br label %62
62: ; preds = %61
%63 = load i32, i32* %7
%64 = add nsw i32 %63, 1
store i32 %64, i32* %7
br label %17
65: ; preds = %17
%66 = load i8*, i8** %3
%67 = load i8*, i8** %4
%68 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %66, i8* %67)
%69 = load i32, i32* %1
ret i32 %69
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [6 x i8] c"%s\0A%s\00"
define i32 @main() {
%1 = tail call i64 @calloc(i32 128, i32 1)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i64 @calloc(i32 128, i32 1)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i64 @calloc(i32 128, i32 1)
%6 = inttoptr i64 %5 to i8*
%7 = load i32, i32* @stdin
%8 = tail call i32 @fgets(i8* %2, i32 128, i32 %7)
%9 = tail call i32 @strlen(i8* %2)
%10 = icmp sgt i32 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %38, %0
%12 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
ret i32 0
13: ; preds = %0, %38
%14 = phi i64 [ %41, %38 ], [ 0, %0 ]
%15 = phi i32 [ %40, %38 ], [ 0, %0 ]
%16 = phi i32 [ %39, %38 ], [ 0, %0 ]
%17 = getelementptr inbounds i8, i8* %2, i64 %14
%18 = load i8, i8* %17
%19 = tail call i64 @isVowel(i8 signext %18)
%20 = icmp eq i64 %19, 0
%21 = load i8, i8* %17
br i1 %20, label %24, label %22
22: ; preds = %13
%23 = add nsw i32 %15, 1
br label %30
24: ; preds = %13
%25 = tail call i64 @isalpha(i8 signext %21)
%26 = icmp eq i64 %25, 0
br i1 %26, label %38, label %27
27: ; preds = %24
%28 = load i8, i8* %17
%29 = add nsw i32 %16, 1
br label %30
30: ; preds = %27, %22
%31 = phi i32 [ %15, %22 ], [ %16, %27 ]
%32 = phi i8* [ %6, %22 ], [ %4, %27 ]
%33 = phi i8 [ %21, %22 ], [ %28, %27 ]
%34 = phi i32 [ %16, %22 ], [ %29, %27 ]
%35 = phi i32 [ %23, %22 ], [ %15, %27 ]
%36 = sext i32 %31 to i64
%37 = getelementptr inbounds i8, i8* %32, i64 %36
store i8 %33, i8* %37
br label %38
38: ; preds = %30, %24
%39 = phi i32 [ %16, %24 ], [ %34, %30 ]
%40 = phi i32 [ %15, %24 ], [ %35, %30 ]
%41 = add nuw nsw i64 %14, 1
%42 = tail call i32 @strlen(i8* %2)
%43 = sext i32 %42 to i64
%44 = icmp slt i64 %41, %43
br i1 %44, label %13, label %11
}