#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 cpu_in_cpuset(int, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ verify(int);
int main() {
  char *a = "1,2";
  char *b = "1-3,5";
  char *c = "1,4-5";
  char *d = "";
  char *e = "\n";
  printf("1 in %s", a);
  verify(cpu_in_cpuset(1, a));
  printf("2 in %s", a);
  verify(cpu_in_cpuset(2, a));
  printf("NOT 4 in %s", a);
  verify(!cpu_in_cpuset(4, a));
  printf("1 in %s", b);
  verify(cpu_in_cpuset(1, b));
  printf("NOT 4 in %s", b);
  verify(!cpu_in_cpuset(4, b));
  printf("5 in %s", b);
  verify(cpu_in_cpuset(5, b));
  printf("1 in %s", c);
  verify(cpu_in_cpuset(1, c));
  printf("5 in %s", c);
  verify(cpu_in_cpuset(5, c));
  printf("NOT 6 in %s", c);
  verify(!cpu_in_cpuset(6, c));
  printf("NOT 6 in empty set");
  verify(!cpu_in_cpuset(6, d));
  printf("NOT 6 in empty set(2)");
  verify(!cpu_in_cpuset(6, e));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xeb5(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xeb1(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xea5(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1040 <cpu_in_cpuset@plt>
mov    %eax,%edi
call   1050 <verify@plt>
mov    -0x8(%rbp),%rsi
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    $0x2,%edi
call   1040 <cpu_in_cpuset@plt>
mov    %eax,%edi
call   1050 <verify@plt>
mov    -0x8(%rbp),%rsi
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    $0x4,%edi
call   1040 <cpu_in_cpuset@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <verify@plt>
mov    -0x10(%rbp),%rsi
lea    0xe18(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1040 <cpu_in_cpuset@plt>
mov    %eax,%edi
call   1050 <verify@plt>
mov    -0x10(%rbp),%rsi
lea    0xe01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    $0x4,%edi
call   1040 <cpu_in_cpuset@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <verify@plt>
mov    -0x10(%rbp),%rsi
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    $0x5,%edi
call   1040 <cpu_in_cpuset@plt>
mov    %eax,%edi
call   1050 <verify@plt>
mov    -0x18(%rbp),%rsi
lea    0xd98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
mov    $0x1,%edi
call   1040 <cpu_in_cpuset@plt>
mov    %eax,%edi
call   1050 <verify@plt>
mov    -0x18(%rbp),%rsi
lea    0xd8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
mov    $0x5,%edi
call   1040 <cpu_in_cpuset@plt>
mov    %eax,%edi
call   1050 <verify@plt>
mov    -0x18(%rbp),%rsi
lea    0xd6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
mov    $0x6,%edi
call   1040 <cpu_in_cpuset@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <verify@plt>
lea    0xd4c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
mov    $0x6,%edi
call   1040 <cpu_in_cpuset@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <verify@plt>
lea    0xd31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
mov    $0x6,%edi
call   1040 <cpu_in_cpuset@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <verify@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xed6(%rip),%r14
lea    0xebd(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1040 <cpu_in_cpuset@plt>
mov    %eax,%edi
call   1050 <verify@plt>
lea    0xeaf(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
call   1040 <cpu_in_cpuset@plt>
mov    %eax,%edi
call   1050 <verify@plt>
lea    0xe92(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
call   1040 <cpu_in_cpuset@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <verify@plt>
lea    0xe46(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1040 <cpu_in_cpuset@plt>
mov    %eax,%edi
call   1050 <verify@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
call   1040 <cpu_in_cpuset@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <verify@plt>
lea    0xe21(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x5,%edi
mov    %rbx,%rsi
call   1040 <cpu_in_cpuset@plt>
mov    %eax,%edi
call   1050 <verify@plt>
lea    0xdd5(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1040 <cpu_in_cpuset@plt>
mov    %eax,%edi
call   1050 <verify@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x5,%edi
mov    %rbx,%rsi
call   1040 <cpu_in_cpuset@plt>
mov    %eax,%edi
call   1050 <verify@plt>
lea    0xdb8(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x6,%edi
mov    %rbx,%rsi
call   1040 <cpu_in_cpuset@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <verify@plt>
lea    0xd99(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xd5a(%rip),%rsi
mov    $0x6,%edi
call   1040 <cpu_in_cpuset@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <verify@plt>
lea    0xd80(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xd2d(%rip),%rsi
mov    $0x6,%edi
call   1040 <cpu_in_cpuset@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <verify@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"1,2\00"
@.str.1 = [6 x i8] c"1-3,5\00"
@.str.2 = [6 x i8] c"1,4-5\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [8 x i8] c"1 in %s\00"
@.str.6 = [8 x i8] c"2 in %s\00"
@.str.7 = [12 x i8] c"NOT 4 in %s\00"
@.str.8 = [8 x i8] c"5 in %s\00"
@.str.9 = [12 x i8] c"NOT 6 in %s\00"
@.str.10 = [19 x i8] c"NOT 6 in empty set\00"
@.str.11 = [22 x i8] c"NOT 6 in empty set(2)\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %3
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8** %4
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %1
%9 = call i32 @cpu_in_cpuset(i32 1, i8* %8)
%10 = call i32 @verify(i32 %9)
%11 = load i8*, i8** %1
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %1
%14 = call i32 @cpu_in_cpuset(i32 2, i8* %13)
%15 = call i32 @verify(i32 %14)
%16 = load i8*, i8** %1
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8* %16)
%18 = load i8*, i8** %1
%19 = call i32 @cpu_in_cpuset(i32 4, i8* %18)
%20 = icmp ne i32 %19, 0
%21 = xor i1 %20, true
%22 = zext i1 %21 to i32
%23 = call i32 @verify(i32 %22)
%24 = load i8*, i8** %2
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %24)
%26 = load i8*, i8** %2
%27 = call i32 @cpu_in_cpuset(i32 1, i8* %26)
%28 = call i32 @verify(i32 %27)
%29 = load i8*, i8** %2
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8* %29)
%31 = load i8*, i8** %2
%32 = call i32 @cpu_in_cpuset(i32 4, i8* %31)
%33 = icmp ne i32 %32, 0
%34 = xor i1 %33, true
%35 = zext i1 %34 to i32
%36 = call i32 @verify(i32 %35)
%37 = load i8*, i8** %2
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8* %37)
%39 = load i8*, i8** %2
%40 = call i32 @cpu_in_cpuset(i32 5, i8* %39)
%41 = call i32 @verify(i32 %40)
%42 = load i8*, i8** %3
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %42)
%44 = load i8*, i8** %3
%45 = call i32 @cpu_in_cpuset(i32 1, i8* %44)
%46 = call i32 @verify(i32 %45)
%47 = load i8*, i8** %3
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8* %47)
%49 = load i8*, i8** %3
%50 = call i32 @cpu_in_cpuset(i32 5, i8* %49)
%51 = call i32 @verify(i32 %50)
%52 = load i8*, i8** %3
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* %52)
%54 = load i8*, i8** %3
%55 = call i32 @cpu_in_cpuset(i32 6, i8* %54)
%56 = icmp ne i32 %55, 0
%57 = xor i1 %56, true
%58 = zext i1 %57 to i32
%59 = call i32 @verify(i32 %58)
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0))
%61 = load i8*, i8** %4
%62 = call i32 @cpu_in_cpuset(i32 6, i8* %61)
%63 = icmp ne i32 %62, 0
%64 = xor i1 %63, true
%65 = zext i1 %64 to i32
%66 = call i32 @verify(i32 %65)
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0))
%68 = load i8*, i8** %5
%69 = call i32 @cpu_in_cpuset(i32 6, i8* %68)
%70 = icmp ne i32 %69, 0
%71 = xor i1 %70, true
%72 = zext i1 %71 to i32
%73 = call i32 @verify(i32 %72)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"1,2\00"
@.str.1 = [6 x i8] c"1-3,5\00"
@.str.2 = [6 x i8] c"1,4-5\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [8 x i8] c"1 in %s\00"
@.str.6 = [8 x i8] c"2 in %s\00"
@.str.7 = [12 x i8] c"NOT 4 in %s\00"
@.str.8 = [8 x i8] c"5 in %s\00"
@.str.9 = [12 x i8] c"NOT 6 in %s\00"
@.str.10 = [19 x i8] c"NOT 6 in empty set\00"
@.str.11 = [22 x i8] c"NOT 6 in empty set(2)\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @cpu_in_cpuset(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @verify(i32 %2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @cpu_in_cpuset(i32 2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @verify(i32 %5)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @cpu_in_cpuset(i32 4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = tail call i32 @verify(i32 %10)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 @cpu_in_cpuset(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%14 = tail call i32 @verify(i32 %13)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%16 = tail call i32 @cpu_in_cpuset(i32 4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
%18 = zext i1 %17 to i32
%19 = tail call i32 @verify(i32 %18)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%21 = tail call i32 @cpu_in_cpuset(i32 5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%22 = tail call i32 @verify(i32 %21)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%24 = tail call i32 @cpu_in_cpuset(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%25 = tail call i32 @verify(i32 %24)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%27 = tail call i32 @cpu_in_cpuset(i32 5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%28 = tail call i32 @verify(i32 %27)
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%30 = tail call i32 @cpu_in_cpuset(i32 6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%31 = icmp eq i32 %30, 0
%32 = zext i1 %31 to i32
%33 = tail call i32 @verify(i32 %32)
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0))
%35 = tail call i32 @cpu_in_cpuset(i32 6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%36 = icmp eq i32 %35, 0
%37 = zext i1 %36 to i32
%38 = tail call i32 @verify(i32 %37)
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0))
%40 = tail call i32 @cpu_in_cpuset(i32 6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%41 = icmp eq i32 %40, 0
%42 = zext i1 %41 to i32
%43 = tail call i32 @verify(i32 %42)
ret i32 0
}