#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*/ Qt_handleString(char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strstr(char *, char *);
int Qt_setColorMode(char *widget, char *token) {
  char asc[80];
  char aux[80];
  if (strstr(widget, "Gauge") != (char *)0)
    return 0;
  if (!strcmp(token, "static")) {
    sprintf(asc, "%s::Static", widget);
    Qt_handleString("colorMode", "enum", asc);
    return 0;
  } else if (!strcmp(token, "alarm")) {
    strcpy(aux, "Alarm");
    if (!strcmp(widget, "caTextEntry"))
      strcpy(aux, "Alarm_Static");
    if (!strcmp(widget, "caLineEdit"))
      strcpy(aux, "Alarm_Static");
    if (!strcmp(widget, "caThermo"))
      strcpy(aux, "Alarm_Static");
    if (!strcmp(widget, "caSlider"))
      strcpy(aux, "Alarm_Static");
    sprintf(asc, "%s::%s", widget, aux);
    Qt_handleString("colorMode", "enum", asc);
    return 1;
  } else if (!strcmp(token, "discrete")) {
    sprintf(asc, "%s::Static", widget);
    Qt_handleString("colorMode", "enum", asc);
    return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<Qt_setColorMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
je     1189 <Qt_setColorMode+0x39>
movl   $0x0,-0x4(%rbp)
jmp    135a <Qt_setColorMode+0x20a>
mov    -0x18(%rbp),%rdi
lea    0xe72(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    11db <Qt_setColorMode+0x8b>
lea    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe5c(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
lea    -0x70(%rbp),%rdx
lea    0xe55(%rip),%rdi
lea    0xe58(%rip),%rsi
call   1040 <Qt_handleString@plt>
movl   $0x0,-0x4(%rbp)
jmp    135a <Qt_setColorMode+0x20a>
mov    -0x18(%rbp),%rdi
lea    0xe41(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    12f7 <Qt_setColorMode+0x1a7>
lea    -0xc0(%rbp),%rdi
lea    0xe2b(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
lea    0xe21(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1233 <Qt_setColorMode+0xe3>
lea    -0xc0(%rbp),%rdi
lea    0xe11(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
lea    0xe0e(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    125f <Qt_setColorMode+0x10f>
lea    -0xc0(%rbp),%rdi
lea    0xde5(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
lea    0xded(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    128b <Qt_setColorMode+0x13b>
lea    -0xc0(%rbp),%rdi
lea    0xdb9(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
lea    0xdca(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    12b7 <Qt_setColorMode+0x167>
lea    -0xc0(%rbp),%rdi
lea    0xd8d(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    -0xc0(%rbp),%rcx
lea    0xd9c(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
lea    -0x70(%rbp),%rdx
lea    0xd39(%rip),%rdi
lea    0xd3c(%rip),%rsi
call   1040 <Qt_handleString@plt>
movl   $0x1,-0x4(%rbp)
jmp    135a <Qt_setColorMode+0x20a>
mov    -0x18(%rbp),%rdi
lea    0xd6e(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1349 <Qt_setColorMode+0x1f9>
lea    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xcee(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
lea    -0x70(%rbp),%rdx
lea    0xce7(%rip),%rdi
lea    0xcea(%rip),%rsi
call   1040 <Qt_handleString@plt>
movl   $0x0,-0x4(%rbp)
jmp    135a <Qt_setColorMode+0x20a>
jmp    134e <Qt_setColorMode+0x1fe>
jmp    1353 <Qt_setColorMode+0x203>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Qt_setColorMode>:
push   %rbp
push   %r14
push   %rbx
sub    $0xa0,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xe98(%rip),%rsi
call   1070 <strstr@plt>
xor    %ebp,%ebp
test   %rax,%rax
jne    129f <Qt_setColorMode+0x14f>
lea    0xe87(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     11b5 <Qt_setColorMode+0x65>
lea    0xe95(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     11d2 <Qt_setColorMode+0x82>
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    129f <Qt_setColorMode+0x14f>
lea    0xe51(%rip),%rsi
xor    %ebp,%ebp
lea    0x50(%rsp),%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1060 <sprintf@plt>
jmp    1287 <Qt_setColorMode+0x137>
lea    0xe54(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
lea    0xe4b(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    1203 <Qt_setColorMode+0xb3>
lea    0xe44(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
lea    0xe42(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    1225 <Qt_setColorMode+0xd5>
lea    0xe22(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
lea    0xe2b(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    1247 <Qt_setColorMode+0xf7>
lea    0xe00(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
lea    0xe12(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    1269 <Qt_setColorMode+0x119>
lea    0xdde(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
lea    0xdf9(%rip),%rsi
lea    0x50(%rsp),%rdi
mov    %rsp,%rcx
mov    %r14,%rdx
xor    %eax,%eax
call   1060 <sprintf@plt>
mov    $0x1,%ebp
lea    0xd8a(%rip),%rdi
lea    0xd8d(%rip),%rsi
lea    0x50(%rsp),%rdx
call   1040 <Qt_handleString@plt>
mov    %ebp,%eax
add    $0xa0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Gauge\00"
@.str.1 = [7 x i8] c"static\00"
@.str.2 = [11 x i8] c"%s::Static\00"
@.str.3 = [10 x i8] c"colorMode\00"
@.str.4 = [5 x i8] c"enum\00"
@.str.5 = [6 x i8] c"alarm\00"
@.str.6 = [6 x i8] c"Alarm\00"
@.str.7 = [12 x i8] c"caTextEntry\00"
@.str.8 = [13 x i8] c"Alarm_Static\00"
@.str.9 = [11 x i8] c"caLineEdit\00"
@.str.10 = [9 x i8] c"caThermo\00"
@.str.11 = [9 x i8] c"caSlider\00"
@.str.12 = [7 x i8] c"%s::%s\00"
@.str.13 = [9 x i8] c"discrete\00"
define i32 @Qt_setColorMode(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [80 x i8]
%7 = alloca [80 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call i8* @strstr(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %76
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = call i32 @strcmp(i8* %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
br i1 %15, label %22, label %16
16: ; preds = %12
%17 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%18 = load i8*, i8** %4
%19 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %17, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%21 = call i32 @Qt_handleString(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %20)
store i32 0, i32* %3
br label %76
22: ; preds = %12
%23 = load i8*, i8** %5
%24 = call i32 @strcmp(i8* %23, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%25 = icmp ne i32 %24, 0
br i1 %25, label %63, label %26
26: ; preds = %22
%27 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%28 = call i32 @strcpy(i8* %27, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%29 = load i8*, i8** %4
%30 = call i32 @strcmp(i8* %29, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
%31 = icmp ne i32 %30, 0
br i1 %31, label %35, label %32
32: ; preds = %26
%33 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%34 = call i32 @strcpy(i8* %33, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
br label %35
35: ; preds = %32, %26
%36 = load i8*, i8** %4
%37 = call i32 @strcmp(i8* %36, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
%38 = icmp ne i32 %37, 0
br i1 %38, label %42, label %39
39: ; preds = %35
%40 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%41 = call i32 @strcpy(i8* %40, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
br label %42
42: ; preds = %39, %35
%43 = load i8*, i8** %4
%44 = call i32 @strcmp(i8* %43, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%45 = icmp ne i32 %44, 0
br i1 %45, label %49, label %46
46: ; preds = %42
%47 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%48 = call i32 @strcpy(i8* %47, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
br label %49
49: ; preds = %46, %42
%50 = load i8*, i8** %4
%51 = call i32 @strcmp(i8* %50, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%52 = icmp ne i32 %51, 0
br i1 %52, label %56, label %53
53: ; preds = %49
%54 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%55 = call i32 @strcpy(i8* %54, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
br label %56
56: ; preds = %53, %49
%57 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%58 = load i8*, i8** %4
%59 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%60 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %57, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8* %58, i8* %59)
%61 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%62 = call i32 @Qt_handleString(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %61)
store i32 1, i32* %3
br label %76
63: ; preds = %22
%64 = load i8*, i8** %5
%65 = call i32 @strcmp(i8* %64, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
%66 = icmp ne i32 %65, 0
br i1 %66, label %73, label %67
67: ; preds = %63
%68 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%69 = load i8*, i8** %4
%70 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %68, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %69)
%71 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%72 = call i32 @Qt_handleString(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %71)
store i32 0, i32* %3
br label %76
73: ; preds = %63
br label %74
74: ; preds = %73
br label %75
75: ; preds = %74
store i32 0, i32* %3
br label %76
76: ; preds = %75, %67, %56, %16, %11
%77 = load i32, i32* %3
ret i32 %77
}

LLVM IR (-O2):
@.str = [6 x i8] c"Gauge\00"
@.str.1 = [7 x i8] c"static\00"
@.str.2 = [11 x i8] c"%s::Static\00"
@.str.3 = [10 x i8] c"colorMode\00"
@.str.4 = [5 x i8] c"enum\00"
@.str.5 = [6 x i8] c"alarm\00"
@.str.6 = [6 x i8] c"Alarm\00"
@.str.7 = [12 x i8] c"caTextEntry\00"
@.str.8 = [13 x i8] c"Alarm_Static\00"
@.str.9 = [11 x i8] c"caLineEdit\00"
@.str.10 = [9 x i8] c"caThermo\00"
@.str.11 = [9 x i8] c"caSlider\00"
@.str.12 = [7 x i8] c"%s::%s\00"
@.str.13 = [9 x i8] c"discrete\00"
define i32 @Qt_setColorMode(i8* %0, i8* nocapture %1) {
%3 = alloca [80 x i8]
%4 = alloca [80 x i8]
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%7 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %48
9: ; preds = %2
%10 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %0)
br label %45
14: ; preds = %9
%15 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %40
17: ; preds = %14
%18 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%19 = call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(12) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
br label %23
23: ; preds = %21, %17
%24 = call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
br label %28
28: ; preds = %26, %23
%29 = call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
br label %33
33: ; preds = %31, %28
%34 = call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
br label %38
38: ; preds = %36, %33
%39 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8* %0, i8* %6)
br label %45
40: ; preds = %14
%41 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %48
43: ; preds = %40
%44 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %0)
br label %45
45: ; preds = %12, %38, %43
%46 = phi i32 [ 0, %12 ], [ 1, %38 ], [ 0, %43 ]
%47 = call i32 @Qt_handleString(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %5)
br label %48
48: ; preds = %45, %40, %2
%49 = phi i32 [ 0, %2 ], [ 0, %40 ], [ %46, %45 ]
ret i32 %49
}