#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__ detect_no_uppercase(unsigned char *);
int /*<<< orphan*/ printf(char *, char *);
int strnlen(char *, int);
int filterTitle(char title[]) {
  if (title[0] == '\0') {
    printf("title \"%s\" is emty\n", title);
    return 1;
  } else if (strnlen(title, 200) < 2) {
    printf("title \"%s\" is to short\n", title);
    return 1;
  } else if (detect_no_uppercase((unsigned char *)title)) {
    printf("title \"%s\" is all lovercase\n", title);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<filterTitle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1168 <filterTitle+0x38>
mov    -0x10(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11db <filterTitle+0xab>
mov    -0x10(%rbp),%rdi
mov    $0xc8,%esi
call   1050 <strnlen@plt>
cmp    $0x2,%eax
jge    119b <filterTitle+0x6b>
mov    -0x10(%rbp),%rsi
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11db <filterTitle+0xab>
mov    -0x10(%rbp),%rdi
call   1030 <detect_no_uppercase@plt>
cmp    $0x0,%rax
je     11ca <filterTitle+0x9a>
mov    -0x10(%rbp),%rsi
lea    0xe73(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11db <filterTitle+0xab>
jmp    11cf <filterTitle+0x9f>
jmp    11d4 <filterTitle+0xa4>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filterTitle>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1154 <filterTitle+0x24>
mov    %rbx,%rdi
mov    $0xc8,%esi
call   1050 <strnlen@plt>
cmp    $0x2,%eax
jge    115d <filterTitle+0x2d>
lea    0xec2(%rip),%rdi
jmp    1171 <filterTitle+0x41>
lea    0xea5(%rip),%rdi
jmp    1171 <filterTitle+0x41>
mov    %rbx,%rdi
call   1030 <detect_no_uppercase@plt>
test   %rax,%rax
je     1180 <filterTitle+0x50>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"title \22%s\22 is emty\0A\00"
@.str.1 = [24 x i8] c"title \22%s\22 is to short\0A\00"
@.str.2 = [29 x i8] c"title \22%s\22 is all lovercase\0A\00"
define i32 @filterTitle(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %10)
store i32 1, i32* %2
br label %29
12: ; preds = %1
%13 = load i8*, i8** %3
%14 = call i32 @strnlen(i8* %13, i32 200)
%15 = icmp slt i32 %14, 2
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i8*, i8** %3
%18 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %17)
store i32 1, i32* %2
br label %29
19: ; preds = %12
%20 = load i8*, i8** %3
%21 = call i64 @detect_no_uppercase(i8* %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = load i8*, i8** %3
%25 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %24)
store i32 1, i32* %2
br label %29
26: ; preds = %19
br label %27
27: ; preds = %26
br label %28
28: ; preds = %27
store i32 0, i32* %2
br label %29
29: ; preds = %28, %23, %16, %9
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
@.str = [20 x i8] c"title \22%s\22 is emty\0A\00"
@.str.1 = [24 x i8] c"title \22%s\22 is to short\0A\00"
@.str.2 = [29 x i8] c"title \22%s\22 is all lovercase\0A\00"
define i32 @filterTitle(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = tail call i32 @strnlen(i8* %0, i32 200)
%6 = icmp slt i32 %5, 2
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = tail call i64 @detect_no_uppercase(i8* %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %7, %4, %1
%11 = phi i8* [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), %7 ]
%12 = tail call i32 @printf(i8* %11, i8* %0)
br label %13
13: ; preds = %10, %7
%14 = phi i32 [ 0, %7 ], [ 1, %10 ]
ret i32 %14
}