#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 atoi(char *);
scalar_t__ isdigit(char);
scalar_t__ strcmp(char *, char *);
void par_color(int argc, char **argv, int *option, int *opt_color,
               int *bad_arg) {
  if (argc != 1 || *option)
    *bad_arg = 1;
  *option = 1;
  if (argc == 1) {
    if (strcmp(argv[0], "black") == 0)
      *opt_color = 0;
    else if (strcmp(argv[0], "red") == 0)
      *opt_color = 1;
    else if (strcmp(argv[0], "green") == 0)
      *opt_color = 2;
    else if (strcmp(argv[0], "yellow") == 0)
      *opt_color = 3;
    else if (strcmp(argv[0], "blue") == 0)
      *opt_color = 4;
    else if (strcmp(argv[0], "magenta") == 0)
      *opt_color = 5;
    else if (strcmp(argv[0], "cyan") == 0)
      *opt_color = 6;
    else if (strcmp(argv[0], "white") == 0)
      *opt_color = 7;
    else if (strcmp(argv[0], "default") == 0)
      *opt_color = 9;
    else if (isdigit(argv[0][0]))
      *opt_color = atoi(argv[0]);
    else
      *bad_arg = 1;
    if (*opt_color < 0 || *opt_color > 9 || *opt_color == 8)
      *bad_arg = 1;
  }
}


x86 assembly (clang, -O0):
<par_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1162 <par_color+0x32>
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
je     116c <par_color+0x3c>
mov    -0x28(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
cmpl   $0x1,-0x4(%rbp)
jne    13ab <par_color+0x27b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe72(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11ac <par_color+0x7c>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
jmp    1375 <par_color+0x245>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe4c(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11d8 <par_color+0xa8>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
jmp    1370 <par_color+0x240>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe24(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1204 <par_color+0xd4>
mov    -0x20(%rbp),%rax
movl   $0x2,(%rax)
jmp    136b <par_color+0x23b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xdfe(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1230 <par_color+0x100>
mov    -0x20(%rbp),%rax
movl   $0x3,(%rax)
jmp    1366 <par_color+0x236>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xdd9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    125c <par_color+0x12c>
mov    -0x20(%rbp),%rax
movl   $0x4,(%rax)
jmp    1361 <par_color+0x231>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xdb2(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1288 <par_color+0x158>
mov    -0x20(%rbp),%rax
movl   $0x5,(%rax)
jmp    135c <par_color+0x22c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd8e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    12b4 <par_color+0x184>
mov    -0x20(%rbp),%rax
movl   $0x6,(%rax)
jmp    1357 <par_color+0x227>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd67(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    12e0 <par_color+0x1b0>
mov    -0x20(%rbp),%rax
movl   $0x7,(%rax)
jmp    1352 <par_color+0x222>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd41(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    130c <par_color+0x1dc>
mov    -0x20(%rbp),%rax
movl   $0x9,(%rax)
jmp    134d <par_color+0x21d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     133e <par_color+0x20e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
jmp    1348 <par_color+0x218>
mov    -0x28(%rbp),%rax
movl   $0x1,(%rax)
jmp    134d <par_color+0x21d>
jmp    1352 <par_color+0x222>
jmp    1357 <par_color+0x227>
jmp    135c <par_color+0x22c>
jmp    1361 <par_color+0x231>
jmp    1366 <par_color+0x236>
jmp    136b <par_color+0x23b>
jmp    1370 <par_color+0x240>
jmp    1375 <par_color+0x245>
mov    -0x20(%rbp),%rax
cmpl   $0x0,(%rax)
jl     139c <par_color+0x26c>
mov    -0x20(%rbp),%rax
cmpl   $0x9,(%rax)
jg     139c <par_color+0x26c>
mov    -0x20(%rbp),%rax
cmpl   $0x8,(%rax)
jne    13a6 <par_color+0x276>
mov    -0x28(%rbp),%rax
movl   $0x1,(%rax)
jmp    13ab <par_color+0x27b>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<par_color>:
push   %r15
push   %r14
push   %rbx
mov    %r8,%r15
cmp    $0x1,%edi
jne    1255 <par_color+0x125>
mov    %rcx,%r14
mov    %rsi,%rbx
cmpl   $0x0,(%rdx)
je     1153 <par_color+0x23>
movl   $0x1,(%r15)
movl   $0x1,(%rdx)
mov    (%rbx),%rdi
lea    0xe9d(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     126b <par_color+0x13b>
mov    (%rbx),%rdi
lea    0xe8b(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1276 <par_color+0x146>
mov    (%rbx),%rdi
lea    0xe77(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1284 <par_color+0x154>
mov    (%rbx),%rdi
lea    0xe65(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1292 <par_color+0x162>
mov    (%rbx),%rdi
lea    0xe54(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12a0 <par_color+0x170>
mov    (%rbx),%rdi
lea    0xe41(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12ae <par_color+0x17e>
mov    (%rbx),%rdi
lea    0xe31(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12bc <par_color+0x18c>
mov    (%rbx),%rdi
lea    0xe1e(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12ca <par_color+0x19a>
mov    (%rbx),%rdi
lea    0xe0c(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12d8 <par_color+0x1a8>
mov    (%rbx),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     12e6 <par_color+0x1b6>
mov    (%rbx),%rdi
call   1050 <atoi@plt>
mov    %eax,(%r14)
jmp    12f0 <par_color+0x1c0>
movl   $0x1,(%r15)
mov    %rdx,%r15
movl   $0x1,(%r15)
jmp    1302 <par_color+0x1d2>
movl   $0x0,(%r14)
xor    %eax,%eax
jmp    12f0 <par_color+0x1c0>
movl   $0x1,(%r14)
mov    $0x1,%eax
jmp    12f0 <par_color+0x1c0>
movl   $0x2,(%r14)
mov    $0x2,%eax
jmp    12f0 <par_color+0x1c0>
movl   $0x3,(%r14)
mov    $0x3,%eax
jmp    12f0 <par_color+0x1c0>
movl   $0x4,(%r14)
mov    $0x4,%eax
jmp    12f0 <par_color+0x1c0>
movl   $0x5,(%r14)
mov    $0x5,%eax
jmp    12f0 <par_color+0x1c0>
movl   $0x6,(%r14)
mov    $0x6,%eax
jmp    12f0 <par_color+0x1c0>
movl   $0x7,(%r14)
mov    $0x7,%eax
jmp    12f0 <par_color+0x1c0>
movl   $0x9,(%r14)
mov    $0x9,%eax
jmp    12f0 <par_color+0x1c0>
movl   $0x1,(%r15)
mov    (%r14),%eax
cmp    $0x9,%eax
ja     125f <par_color+0x12f>
cmp    $0x8,%eax
je     125f <par_color+0x12f>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"black\00"
@.str.1 = [4 x i8] c"red\00"
@.str.2 = [6 x i8] c"green\00"
@.str.3 = [7 x i8] c"yellow\00"
@.str.4 = [5 x i8] c"blue\00"
@.str.5 = [8 x i8] c"magenta\00"
@.str.6 = [5 x i8] c"cyan\00"
@.str.7 = [6 x i8] c"white\00"
@.str.8 = [8 x i8] c"default\00"
define void @par_color(i32 %0, i8** %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 1
br i1 %12, label %17, label %13
13: ; preds = %5
%14 = load i32*, i32** %8
%15 = load i32, i32* %14
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13, %5
%18 = load i32*, i32** %10
store i32 1, i32* %18
br label %19
19: ; preds = %17, %13
%20 = load i32*, i32** %8
store i32 1, i32* %20
%21 = load i32, i32* %6
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %135
23: ; preds = %19
%24 = load i8**, i8*** %7
%25 = getelementptr inbounds i8*, i8** %24, i64 0
%26 = load i8*, i8** %25
%27 = call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %23
%30 = load i32*, i32** %9
store i32 0, i32* %30
br label %120
31: ; preds = %23
%32 = load i8**, i8*** %7
%33 = getelementptr inbounds i8*, i8** %32, i64 0
%34 = load i8*, i8** %33
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %31
%38 = load i32*, i32** %9
store i32 1, i32* %38
br label %119
39: ; preds = %31
%40 = load i8**, i8*** %7
%41 = getelementptr inbounds i8*, i8** %40, i64 0
%42 = load i8*, i8** %41
%43 = call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %39
%46 = load i32*, i32** %9
store i32 2, i32* %46
br label %118
47: ; preds = %39
%48 = load i8**, i8*** %7
%49 = getelementptr inbounds i8*, i8** %48, i64 0
%50 = load i8*, i8** %49
%51 = call i64 @strcmp(i8* %50, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %55
53: ; preds = %47
%54 = load i32*, i32** %9
store i32 3, i32* %54
br label %117
55: ; preds = %47
%56 = load i8**, i8*** %7
%57 = getelementptr inbounds i8*, i8** %56, i64 0
%58 = load i8*, i8** %57
%59 = call i64 @strcmp(i8* %58, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %55
%62 = load i32*, i32** %9
store i32 4, i32* %62
br label %116
63: ; preds = %55
%64 = load i8**, i8*** %7
%65 = getelementptr inbounds i8*, i8** %64, i64 0
%66 = load i8*, i8** %65
%67 = call i64 @strcmp(i8* %66, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%68 = icmp eq i64 %67, 0
br i1 %68, label %69, label %71
69: ; preds = %63
%70 = load i32*, i32** %9
store i32 5, i32* %70
br label %115
71: ; preds = %63
%72 = load i8**, i8*** %7
%73 = getelementptr inbounds i8*, i8** %72, i64 0
%74 = load i8*, i8** %73
%75 = call i64 @strcmp(i8* %74, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%76 = icmp eq i64 %75, 0
br i1 %76, label %77, label %79
77: ; preds = %71
%78 = load i32*, i32** %9
store i32 6, i32* %78
br label %114
79: ; preds = %71
%80 = load i8**, i8*** %7
%81 = getelementptr inbounds i8*, i8** %80, i64 0
%82 = load i8*, i8** %81
%83 = call i64 @strcmp(i8* %82, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%84 = icmp eq i64 %83, 0
br i1 %84, label %85, label %87
85: ; preds = %79
%86 = load i32*, i32** %9
store i32 7, i32* %86
br label %113
87: ; preds = %79
%88 = load i8**, i8*** %7
%89 = getelementptr inbounds i8*, i8** %88, i64 0
%90 = load i8*, i8** %89
%91 = call i64 @strcmp(i8* %90, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%92 = icmp eq i64 %91, 0
br i1 %92, label %93, label %95
93: ; preds = %87
%94 = load i32*, i32** %9
store i32 9, i32* %94
br label %112
95: ; preds = %87
%96 = load i8**, i8*** %7
%97 = getelementptr inbounds i8*, i8** %96, i64 0
%98 = load i8*, i8** %97
%99 = getelementptr inbounds i8, i8* %98, i64 0
%100 = load i8, i8* %99
%101 = call i64 @isdigit(i8 signext %100)
%102 = icmp ne i64 %101, 0
br i1 %102, label %103, label %109
103: ; preds = %95
%104 = load i8**, i8*** %7
%105 = getelementptr inbounds i8*, i8** %104, i64 0
%106 = load i8*, i8** %105
%107 = call i32 @atoi(i8* %106)
%108 = load i32*, i32** %9
store i32 %107, i32* %108
br label %111
109: ; preds = %95
%110 = load i32*, i32** %10
store i32 1, i32* %110
br label %111
111: ; preds = %109, %103
br label %112
112: ; preds = %111, %93
br label %113
113: ; preds = %112, %85
br label %114
114: ; preds = %113, %77
br label %115
115: ; preds = %114, %69
br label %116
116: ; preds = %115, %61
br label %117
117: ; preds = %116, %53
br label %118
118: ; preds = %117, %45
br label %119
119: ; preds = %118, %37
br label %120
120: ; preds = %119, %29
%121 = load i32*, i32** %9
%122 = load i32, i32* %121
%123 = icmp slt i32 %122, 0
br i1 %123, label %132, label %124
124: ; preds = %120
%125 = load i32*, i32** %9
%126 = load i32, i32* %125
%127 = icmp sgt i32 %126, 9
br i1 %127, label %132, label %128
128: ; preds = %124
%129 = load i32*, i32** %9
%130 = load i32, i32* %129
%131 = icmp eq i32 %130, 8
br i1 %131, label %132, label %134
132: ; preds = %128, %124, %120
%133 = load i32*, i32** %10
store i32 1, i32* %133
br label %134
134: ; preds = %132, %128
br label %135
135: ; preds = %134, %19
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"black\00"
@.str.1 = [4 x i8] c"red\00"
@.str.2 = [6 x i8] c"green\00"
@.str.3 = [7 x i8] c"yellow\00"
@.str.4 = [5 x i8] c"blue\00"
@.str.5 = [8 x i8] c"magenta\00"
@.str.6 = [5 x i8] c"cyan\00"
@.str.7 = [6 x i8] c"white\00"
@.str.8 = [8 x i8] c"default\00"
define void @par_color(i32 %0, i8** nocapture %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture writeonly %4) {
%6 = icmp eq i32 %0, 1
br i1 %6, label %7, label %11
7: ; preds = %5
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
store i32 1, i32* %4
br label %12
11: ; preds = %5
store i32 1, i32* %4
br label %72
12: ; preds = %7, %10
store i32 1, i32* %2
%13 = load i8*, i8** %1
%14 = tail call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 0, i32* %3
br label %67
17: ; preds = %12
%18 = load i8*, i8** %1
%19 = tail call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 1, i32* %3
br label %67
22: ; preds = %17
%23 = load i8*, i8** %1
%24 = tail call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %22
store i32 2, i32* %3
br label %67
27: ; preds = %22
%28 = load i8*, i8** %1
%29 = tail call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %27
store i32 3, i32* %3
br label %67
32: ; preds = %27
%33 = load i8*, i8** %1
%34 = tail call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %32
store i32 4, i32* %3
br label %67
37: ; preds = %32
%38 = load i8*, i8** %1
%39 = tail call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %42
41: ; preds = %37
store i32 5, i32* %3
br label %67
42: ; preds = %37
%43 = load i8*, i8** %1
%44 = tail call i64 @strcmp(i8* %43, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %47
46: ; preds = %42
store i32 6, i32* %3
br label %67
47: ; preds = %42
%48 = load i8*, i8** %1
%49 = tail call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %52
51: ; preds = %47
store i32 7, i32* %3
br label %67
52: ; preds = %47
%53 = load i8*, i8** %1
%54 = tail call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %57
56: ; preds = %52
store i32 9, i32* %3
br label %67
57: ; preds = %52
%58 = load i8*, i8** %1
%59 = load i8, i8* %58
%60 = tail call i64 @isdigit(i8 signext %59)
%61 = icmp eq i64 %60, 0
br i1 %61, label %65, label %62
62: ; preds = %57
%63 = load i8*, i8** %1
%64 = tail call i32 @atoi(i8* %63)
store i32 %64, i32* %3
br label %67
65: ; preds = %57
store i32 1, i32* %4
%66 = load i32, i32* %3
br label %67
67: ; preds = %21, %31, %41, %51, %62, %65, %56, %46, %36, %26, %16
%68 = phi i32 [ 1, %21 ], [ 3, %31 ], [ 5, %41 ], [ 7, %51 ], [ %64, %62 ], [ %66, %65 ], [ 9, %56 ], [ 6, %46 ], [ 4, %36 ], [ 2, %26 ], [ 0, %16 ]
%69 = icmp ugt i32 %68, 9
%70 = icmp eq i32 %68, 8
%71 = or i1 %69, %70
br i1 %71, label %72, label %74
72: ; preds = %67, %11
%73 = phi i32* [ %2, %11 ], [ %4, %67 ]
store i32 1, i32* %73
br label %74
74: ; preds = %72, %67
ret void
}