#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 strlen(char *);
int verifEmptyStr(char *str) {
  if ((strlen(str) == 1 && str[0] == '\n') ||
      (strlen(str) == 2 && str[0] == '\r' && str[1] == '\n'))
    return 1;
  return -1;
}


x86 assembly (clang, -O0):
<verifEmptyStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
jne    113e <verifEmptyStr+0x2e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1171 <verifEmptyStr+0x61>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jne    117d <verifEmptyStr+0x6d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    117d <verifEmptyStr+0x6d>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0xa,%eax
jne    117d <verifEmptyStr+0x6d>
movl   $0x1,-0x4(%rbp)
jmp    1184 <verifEmptyStr+0x74>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verifEmptyStr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x1,%eax
jne    1128 <verifEmptyStr+0x18>
mov    $0x1,%eax
cmpb   $0xa,(%rbx)
je     114a <verifEmptyStr+0x3a>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jne    1145 <verifEmptyStr+0x35>
cmpb   $0xd,(%rbx)
jne    1145 <verifEmptyStr+0x35>
mov    $0x1,%eax
cmpb   $0xa,0x1(%rbx)
je     114a <verifEmptyStr+0x3a>
mov    $0xffffffff,%eax
pop    %rbx
ret

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

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