#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 */
char *disemvowel(char *);
int /*<<< orphan*/ free(char *);
int strlen(char *);
int copy_non_vowels(int num_chars, char *in_buf, char *out_buf) {
  char *result;
  int i = 0;
  result = disemvowel(in_buf);
  for (i = 0; i <= strlen(result); i++) {
    out_buf[i] = result[i];
  }
  free(result);
  return strlen(out_buf);
}


x86 assembly (clang, -O0):
<copy_non_vowels>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <disemvowel@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
cmp    %ecx,%eax
jg     119e <copy_non_vowels+0x6e>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115e <copy_non_vowels+0x2e>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_non_vowels>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rdi
call   1040 <disemvowel@plt>
mov    %rax,%r15
mov    %rax,%rdi
call   1050 <strlen@plt>
test   %eax,%eax
js     117e <copy_non_vowels+0x4e>
mov    $0xffffffffffffffff,%rbx
cs nopw 0x0(%rax,%rax,1)
movzbl 0x1(%r15,%rbx,1),%eax
mov    %al,0x1(%r14,%rbx,1)
mov    %r15,%rdi
call   1050 <strlen@plt>
cltq
add    $0x1,%rbx
cmp    %rax,%rbx
jl     1160 <copy_non_vowels+0x30>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <strlen@plt>

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

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