#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 *copyString(char *const);
int /*<<< orphan*/ free(char *const);
scalar_t__ strchr(char *, char);
int strlen(char *);
char *strtok(char *const, char *);
bool lineHasShortOpt(char *const string, char *list) {
  char *const copy = copyString(string);
  char *token = strtok(copy, " ,;");
  while (token && strlen(token) >= 2) {
    if (token[0] != '-') {
      free(copy);
      return false;
    } else if (token[1] && strchr(list, token[1])) {
      free(copy);
      return true;
    }
    token = strtok(NULL, " ,;");
  }
  free(copy);
  return false;
}


x86 assembly (clang, -O0):
<lineHasShortOpt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <copyString@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe88(%rip),%rsi
call   1070 <strtok@plt>
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x28(%rbp)
mov    %al,-0x29(%rbp)
je     11a3 <lineHasShortOpt+0x53>
mov    -0x28(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x2,%eax
setge  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
test   $0x1,%al
jne    11b3 <lineHasShortOpt+0x63>
jmp    1237 <lineHasShortOpt+0xe7>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     11d8 <lineHasShortOpt+0x88>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
jmp    1247 <lineHasShortOpt+0xf7>
mov    -0x28(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     1219 <lineHasShortOpt+0xc9>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rax
movsbl 0x1(%rax),%esi
call   1060 <strchr@plt>
cmp    $0x0,%rax
je     1219 <lineHasShortOpt+0xc9>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
jmp    1247 <lineHasShortOpt+0xf7>
jmp    121e <lineHasShortOpt+0xce>
xor    %eax,%eax
mov    %eax,%edi
lea    0xdd7(%rip),%rsi
call   1070 <strtok@plt>
mov    %rax,-0x28(%rbp)
jmp    1181 <lineHasShortOpt+0x31>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lineHasShortOpt>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rsi,%r12
call   1040 <copyString@plt>
mov    %rax,%r14
lea    0xe95(%rip),%rsi
mov    %rax,%rdi
call   1070 <strtok@plt>
test   %rax,%rax
je     11d7 <lineHasShortOpt+0x87>
mov    %rax,%rbx
lea    0xe7e(%rip),%r15
jmp    11a5 <lineHasShortOpt+0x55>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %r13d,%r13d
xor    %edi,%edi
mov    %r15,%rsi
call   1070 <strtok@plt>
mov    %rax,%rbx
test   %rax,%rax
je     11da <lineHasShortOpt+0x8a>
mov    %rbx,%rdi
call   1050 <strlen@plt>
cmp    $0x2,%eax
jl     11d7 <lineHasShortOpt+0x87>
cmpb   $0x2d,(%rbx)
jne    11d7 <lineHasShortOpt+0x87>
movzbl 0x1(%rbx),%eax
test   %al,%al
je     1190 <lineHasShortOpt+0x40>
movsbl %al,%esi
mov    %r12,%rdi
call   1060 <strchr@plt>
test   %rax,%rax
je     1190 <lineHasShortOpt+0x40>
mov    $0x1,%r13d
jmp    11da <lineHasShortOpt+0x8a>
xor    %r13d,%r13d
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r13d,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c" ,;\00"
define i32 @lineHasShortOpt(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call i8* @copyString(i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = call i8* @strtok(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i8* %11, i8** %7
br label %12
12: ; preds = %47, %2
%13 = load i8*, i8** %7
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i8*, i8** %7
%17 = call i32 @strlen(i8* %16)
%18 = icmp sge i32 %17, 2
br label %19
19: ; preds = %15, %12
%20 = phi i1 [ false, %12 ], [ %18, %15 ]
br i1 %20, label %21, label %49
21: ; preds = %19
%22 = load i8*, i8** %7
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %25, 45
br i1 %26, label %27, label %30
27: ; preds = %21
%28 = load i8*, i8** %6
%29 = call i32 @free(i8* %28)
store i32 0, i32* %3
br label %52
30: ; preds = %21
%31 = load i8*, i8** %7
%32 = getelementptr inbounds i8, i8* %31, i64 1
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %46
36: ; preds = %30
%37 = load i8*, i8** %5
%38 = load i8*, i8** %7
%39 = getelementptr inbounds i8, i8* %38, i64 1
%40 = load i8, i8* %39
%41 = call i64 @strchr(i8* %37, i8 signext %40)
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %36
%44 = load i8*, i8** %6
%45 = call i32 @free(i8* %44)
store i32 1, i32* %3
br label %52
46: ; preds = %36, %30
br label %47
47: ; preds = %46
%48 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i8* %48, i8** %7
br label %12
49: ; preds = %19
%50 = load i8*, i8** %6
%51 = call i32 @free(i8* %50)
store i32 0, i32* %3
br label %52
52: ; preds = %49, %43, %27
%53 = load i32, i32* %3
ret i32 %53
}

LLVM IR (-O2):
@.str = [4 x i8] c" ,;\00"
define i32 @lineHasShortOpt(i8* %0, i8* %1) {
%3 = tail call i8* @copyString(i8* %0)
%4 = tail call i8* @strtok(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i8* %4, null
br i1 %5, label %23, label %6
6: ; preds = %2, %20
%7 = phi i8* [ %21, %20 ], [ %4, %2 ]
%8 = tail call i32 @strlen(i8* %7)
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %23
10: ; preds = %6
%11 = load i8, i8* %7
%12 = icmp eq i8 %11, 45
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = getelementptr inbounds i8, i8* %7, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %13
%18 = tail call i64 @strchr(i8* %1, i8 signext %15)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %13, %17
%21 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%22 = icmp eq i8* %21, null
br i1 %22, label %23, label %6
23: ; preds = %20, %6, %17, %10, %2
%24 = phi i32 [ 0, %2 ], [ 0, %10 ], [ 1, %17 ], [ 0, %6 ], [ 0, %20 ]
%25 = tail call i32 @free(i8* %3)
ret i32 %24
}