#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__ has_bad_strings(char *);
int /*<<< orphan*/ has_double_letters(char *);
int /*<<< orphan*/ has_required_vowels(char *, int);
bool string_is_nice(char *text) {
  if (has_bad_strings(text)) {
    return false;
  } else if (!has_double_letters(text)) {
    return false;
  } else if (!has_required_vowels(text, 3)) {
    return false;
  } else {
    return true;
  }
}


x86 assembly (clang, -O0):
<string_is_nice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <has_bad_strings@plt>
cmp    $0x0,%rax
je     115b <string_is_nice+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    11a3 <string_is_nice+0x73>
mov    -0x10(%rbp),%rdi
call   1030 <has_double_letters@plt>
cmp    $0x0,%eax
jne    1179 <string_is_nice+0x49>
movl   $0x0,-0x4(%rbp)
jmp    11a3 <string_is_nice+0x73>
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1040 <has_required_vowels@plt>
cmp    $0x0,%eax
jne    119c <string_is_nice+0x6c>
movl   $0x0,-0x4(%rbp)
jmp    11a3 <string_is_nice+0x73>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_is_nice>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <has_bad_strings@plt>
xor    %ebx,%ebx
test   %rax,%rax
jne    1163 <string_is_nice+0x33>
mov    %r14,%rdi
call   1030 <has_double_letters@plt>
test   %eax,%eax
je     1163 <string_is_nice+0x33>
mov    %r14,%rdi
mov    $0x3,%esi
call   1040 <has_required_vowels@plt>
xor    %ebx,%ebx
test   %eax,%eax
setne  %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @string_is_nice(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @has_bad_strings(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %19
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @has_double_letters(i8* %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %8
store i32 0, i32* %2
br label %19
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = call i32 @has_required_vowels(i8* %14, i32 3)
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %13
store i32 0, i32* %2
br label %19
18: ; preds = %13
store i32 1, i32* %2
br label %19
19: ; preds = %18, %17, %12, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @string_is_nice(i8* %0) {
%2 = tail call i64 @has_bad_strings(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call i32 @has_double_letters(i8* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = tail call i32 @has_required_vowels(i8* %0, i32 3)
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 0, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}