#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 /*<<< orphan*/ hasConflict(char *);
char *strtok(char *, char *);
int isSatisfiable(char expr[]) {
  char *andClause[1000], *token, delimExpr[] = "|\n";
  int numAndClause = 0, i;
  token = strtok(expr, delimExpr);
  while (token != NULL) {
    andClause[numAndClause] = token;
    numAndClause++;
    token = strtok(NULL, delimExpr);
  }
  for (i = 0; i < numAndClause; i++)
    if (!hasConflict(andClause[i]))
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isSatisfiable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f70,%rsp
mov    %rdi,-0x10(%rbp)
mov    0xeca(%rip),%ax
mov    %ax,-0x1f5b(%rbp)
mov    0xebf(%rip),%al
mov    %al,-0x1f59(%rbp)
movl   $0x0,-0x1f60(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x1f5b(%rbp),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x1f58(%rbp)
cmpq   $0x0,-0x1f58(%rbp)
je     11b9 <isSatisfiable+0x99>
mov    -0x1f58(%rbp),%rcx
movslq -0x1f60(%rbp),%rax
mov    %rcx,-0x1f50(%rbp,%rax,8)
ff
mov    -0x1f60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1f60(%rbp)
lea    -0x1f5b(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1040 <strtok@plt>
mov    %rax,-0x1f58(%rbp)
jmp    116a <isSatisfiable+0x4a>
movl   $0x0,-0x1f64(%rbp)
mov    -0x1f64(%rbp),%eax
cmp    -0x1f60(%rbp),%eax
jge    1217 <isSatisfiable+0xf7>
movslq -0x1f64(%rbp),%rax
mov    -0x1f50(%rbp,%rax,8),%rdi
ff
call   1030 <hasConflict@plt>
cmp    $0x0,%eax
jne    11fe <isSatisfiable+0xde>
movl   $0x1,-0x4(%rbp)
jmp    121e <isSatisfiable+0xfe>
jmp    1203 <isSatisfiable+0xe3>
mov    -0x1f64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1f64(%rbp)
jmp    11c3 <isSatisfiable+0xa3>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1f70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSatisfiable>:
push   %r14
push   %rbx
sub    $0x1f58,%rsp
movb   $0x0,0xe(%rsp)
movw   $0xa7c,0xc(%rsp)
lea    0xc(%rsp),%rsi
call   1040 <strtok@plt>
test   %rax,%rax
je     1197 <isSatisfiable+0x77>
xor    %ebx,%ebx
lea    0xc(%rsp),%r14
nopl   0x0(%rax)
mov    %rax,0x10(%rsp,%rbx,8)
add    $0x1,%rbx
xor    %edi,%edi
mov    %r14,%rsi
call   1040 <strtok@plt>
test   %rax,%rax
jne    1150 <isSatisfiable+0x30>
test   %ebx,%ebx
je     1197 <isSatisfiable+0x77>
mov    %ebx,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp,%rbx,8),%rdi
call   1030 <hasConflict@plt>
test   %eax,%eax
je     119b <isSatisfiable+0x7b>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1180 <isSatisfiable+0x60>
xor    %eax,%eax
jmp    11a0 <isSatisfiable+0x80>
mov    $0x1,%eax
add    $0x1f58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.isSatisfiable.delimExpr = [3 x i8] c"|\0A\00"
define i32 @isSatisfiable(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [1000 x i8*]
%5 = alloca i8*
%6 = alloca [3 x i8]
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %3
%9 = bitcast [3 x i8]* %6 to i8*
store i32 0, i32* %7
%10 = load i8*, i8** %3
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%12 = call i8* @strtok(i8* %10, i8* %11)
store i8* %12, i8** %5
br label %13
13: ; preds = %16, %1
%14 = load i8*, i8** %5
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %25
16: ; preds = %13
%17 = load i8*, i8** %5
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %4, i64 0, i64 %19
store i8* %17, i8** %20
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
%23 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%24 = call i8* @strtok(i8* null, i8* %23)
store i8* %24, i8** %5
br label %13
25: ; preds = %13
store i32 0, i32* %8
br label %26
26: ; preds = %39, %25
%27 = load i32, i32* %8
%28 = load i32, i32* %7
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %42
30: ; preds = %26
%31 = load i32, i32* %8
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %4, i64 0, i64 %32
%34 = load i8*, i8** %33
%35 = call i32 @hasConflict(i8* %34)
%36 = icmp ne i32 %35, 0
br i1 %36, label %38, label %37
37: ; preds = %30
store i32 1, i32* %2
br label %43
38: ; preds = %30
br label %39
39: ; preds = %38
%40 = load i32, i32* %8
%41 = add nsw i32 %40, 1
store i32 %41, i32* %8
br label %26
42: ; preds = %26
store i32 0, i32* %2
br label %43
43: ; preds = %42, %37
%44 = load i32, i32* %2
ret i32 %44
}

LLVM IR (-O2):
@__const.isSatisfiable.delimExpr = [3 x i8] c"|\0A\00"
define i32 @isSatisfiable(i8* %0) {
%2 = alloca [1000 x i8*]
%3 = alloca [3 x i8]
%4 = bitcast [1000 x i8*]* %2 to i8*
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%6 = call i8* @strtok(i8* %0, i8* %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %29, label %13
8: ; preds = %13
%9 = trunc i64 %17 to i32
%10 = icmp eq i32 %9, 0
br i1 %10, label %29, label %11
11: ; preds = %8
%12 = and i64 %17, 4294967295
br label %22
13: ; preds = %1, %13
%14 = phi i64 [ %17, %13 ], [ 0, %1 ]
%15 = phi i8* [ %18, %13 ], [ %6, %1 ]
%16 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %2, i64 0, i64 %14
store i8* %15, i8** %16
%17 = add nuw i64 %14, 1
%18 = call i8* @strtok(i8* null, i8* %5)
%19 = icmp eq i8* %18, null
br i1 %19, label %8, label %13
20: ; preds = %22
%21 = icmp eq i64 %28, %12
br i1 %21, label %29, label %22
22: ; preds = %11, %20
%23 = phi i64 [ 0, %11 ], [ %28, %20 ]
%24 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %2, i64 0, i64 %23
%25 = load i8*, i8** %24
%26 = tail call i32 @hasConflict(i8* %25)
%27 = icmp eq i32 %26, 0
%28 = add nuw nsw i64 %23, 1
br i1 %27, label %29, label %20
29: ; preds = %22, %20, %1, %8
%30 = phi i32 [ 0, %8 ], [ 0, %1 ], [ 0, %20 ], [ 1, %22 ]
ret i32 %30
}