#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__ strchr(char *, char);
int strlen(char *);
int incompatibleopts(char *argstring) {
  int errbool = 0;
  if ((strchr(argstring, 'p') || strchr(argstring, 'v')) &&
      strlen(argstring) > 1) {
    errbool = 1;
  }
  if (strchr(argstring, 's')) {
    if (strlen(argstring) > 3)
      errbool = 1;
    if (strlen(argstring) == 3)
      if (!(strchr(argstring, 'f') && strchr(argstring, 'l')))
        errbool = 1;
    if (strlen(argstring) == 2)
      if (!(strchr(argstring, 'f') || strchr(argstring, 'l')))
        errbool = 1;
  }
  return errbool;
}


x86 assembly (clang, -O0):
<incompatibleopts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x70,%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
jne    1163 <incompatibleopts+0x43>
mov    -0x8(%rbp),%rdi
mov    $0x76,%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
je     117c <incompatibleopts+0x5c>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
jle    117c <incompatibleopts+0x5c>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x73,%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
je     124e <incompatibleopts+0x12e>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x3,%eax
jle    11ad <incompatibleopts+0x8d>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x3,%eax
jne    11fb <incompatibleopts+0xdb>
mov    -0x8(%rbp),%rdi
mov    $0x66,%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
je     11ef <incompatibleopts+0xcf>
mov    -0x8(%rbp),%rdi
mov    $0x6c,%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
jne    11f6 <incompatibleopts+0xd6>
movl   $0x1,-0xc(%rbp)
jmp    11fb <incompatibleopts+0xdb>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jne    1249 <incompatibleopts+0x129>
mov    -0x8(%rbp),%rdi
mov    $0x66,%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
jne    1244 <incompatibleopts+0x124>
mov    -0x8(%rbp),%rdi
mov    $0x6c,%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
jne    1244 <incompatibleopts+0x124>
movl   $0x1,-0xc(%rbp)
jmp    1249 <incompatibleopts+0x129>
jmp    124e <incompatibleopts+0x12e>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<incompatibleopts>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x70,%esi
call   1040 <strchr@plt>
test   %rax,%rax
jne    114b <incompatibleopts+0x2b>
mov    %rbx,%rdi
mov    $0x76,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     11fb <incompatibleopts+0xdb>
mov    %rbx,%rdi
call   1030 <strlen@plt>
xor    %ebp,%ebp
cmp    $0x2,%eax
setge  %bpl
mov    %rbx,%rdi
mov    $0x73,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     11f2 <incompatibleopts+0xd2>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
mov    $0x1,%eax
cmovge %eax,%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x3,%eax
jne    11bb <incompatibleopts+0x9b>
mov    %rbx,%rdi
mov    $0x66,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     11b6 <incompatibleopts+0x96>
mov    %rbx,%rdi
mov    $0x6c,%esi
call   1040 <strchr@plt>
test   %rax,%rax
jne    11bb <incompatibleopts+0x9b>
mov    $0x1,%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jne    11f2 <incompatibleopts+0xd2>
mov    %rbx,%rdi
mov    $0x66,%esi
call   1040 <strchr@plt>
test   %rax,%rax
jne    11f2 <incompatibleopts+0xd2>
mov    %rbx,%rdi
mov    $0x6c,%esi
call   1040 <strchr@plt>
test   %rax,%rax
mov    $0x1,%eax
cmove  %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %ebp,%ebp
jmp    115c <incompatibleopts+0x3c>

LLVM IR (-O0):
define i32 @incompatibleopts(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = call i64 @strchr(i8* %4, i8 signext 112)
%6 = icmp ne i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i64 @strchr(i8* %8, i8 signext 118)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %7, %1
%12 = load i8*, i8** %2
%13 = call i32 @strlen(i8* %12)
%14 = icmp sgt i32 %13, 1
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 1, i32* %3
br label %16
16: ; preds = %15, %11, %7
%17 = load i8*, i8** %2
%18 = call i64 @strchr(i8* %17, i8 signext 115)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %54
20: ; preds = %16
%21 = load i8*, i8** %2
%22 = call i32 @strlen(i8* %21)
%23 = icmp sgt i32 %22, 3
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 1, i32* %3
br label %25
25: ; preds = %24, %20
%26 = load i8*, i8** %2
%27 = call i32 @strlen(i8* %26)
%28 = icmp eq i32 %27, 3
br i1 %28, label %29, label %39
29: ; preds = %25
%30 = load i8*, i8** %2
%31 = call i64 @strchr(i8* %30, i8 signext 102)
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %37
33: ; preds = %29
%34 = load i8*, i8** %2
%35 = call i64 @strchr(i8* %34, i8 signext 108)
%36 = icmp ne i64 %35, 0
br i1 %36, label %38, label %37
37: ; preds = %33, %29
store i32 1, i32* %3
br label %38
38: ; preds = %37, %33
br label %39
39: ; preds = %38, %25
%40 = load i8*, i8** %2
%41 = call i32 @strlen(i8* %40)
%42 = icmp eq i32 %41, 2
br i1 %42, label %43, label %53
43: ; preds = %39
%44 = load i8*, i8** %2
%45 = call i64 @strchr(i8* %44, i8 signext 102)
%46 = icmp ne i64 %45, 0
br i1 %46, label %52, label %47
47: ; preds = %43
%48 = load i8*, i8** %2
%49 = call i64 @strchr(i8* %48, i8 signext 108)
%50 = icmp ne i64 %49, 0
br i1 %50, label %52, label %51
51: ; preds = %47
store i32 1, i32* %3
br label %52
52: ; preds = %51, %47, %43
br label %53
53: ; preds = %52, %39
br label %54
54: ; preds = %53, %16
%55 = load i32, i32* %3
ret i32 %55
}

LLVM IR (-O2):
define i32 @incompatibleopts(i8* %0) {
%2 = tail call i64 @strchr(i8* %0, i8 signext 112)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i64 @strchr(i8* %0, i8 signext 118)
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4, %1
%8 = tail call i32 @strlen(i8* %0)
%9 = icmp sgt i32 %8, 1
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ 0, %4 ], [ %10, %7 ]
%13 = tail call i64 @strchr(i8* %0, i8 signext 115)
%14 = icmp eq i64 %13, 0
br i1 %14, label %39, label %15
15: ; preds = %11
%16 = tail call i32 @strlen(i8* %0)
%17 = icmp sgt i32 %16, 3
%18 = select i1 %17, i32 1, i32 %12
%19 = tail call i32 @strlen(i8* %0)
%20 = icmp eq i32 %19, 3
br i1 %20, label %21, label %28
21: ; preds = %15
%22 = tail call i64 @strchr(i8* %0, i8 signext 102)
%23 = icmp eq i64 %22, 0
br i1 %23, label %27, label %24
24: ; preds = %21
%25 = tail call i64 @strchr(i8* %0, i8 signext 108)
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %24, %21
br label %28
28: ; preds = %24, %27, %15
%29 = phi i32 [ %18, %24 ], [ 1, %27 ], [ %18, %15 ]
%30 = tail call i32 @strlen(i8* %0)
%31 = icmp eq i32 %30, 2
br i1 %31, label %32, label %39
32: ; preds = %28
%33 = tail call i64 @strchr(i8* %0, i8 signext 102)
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %32
%36 = tail call i64 @strchr(i8* %0, i8 signext 108)
%37 = icmp eq i64 %36, 0
%38 = select i1 %37, i32 1, i32 %29
br label %39
39: ; preds = %35, %28, %32, %11
%40 = phi i32 [ %29, %32 ], [ %29, %28 ], [ %12, %11 ], [ %38, %35 ]
ret i32 %40
}