#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 *, ...);
int /*<<< orphan*/ strcmp(char *, char *);
char *strstr(char *, char *);
void Qt_setMaximumLimitSource(char *widget, int pen, char *token) {
  char strng[30] = {'\0'};
  if (strstr(widget, "Gauge") != (char *)0)
    return;
  if (strstr(token, "default") != (char *)0) {
    sprintf(strng, "%s::User", widget);
  } else if (strstr(token, "channel") != (char *)0) {
    sprintf(strng, "%s::Channel", widget);
  }
  if (!strcmp(widget, "caStripPlot") || !strcmp(widget, "caCartesianPlot")) {
    char asc[30];
    sprintf(asc, "YaxisScalingMax_%d", pen + 1);
    Qt_handleString(asc, "enum", strng);
  } else if (!strcmp(widget, "caSlider")) {
    Qt_handleString("highLimitMode", "enum", strng);
  } else {
    Qt_handleString("limitsMode", "enum", strng);
  }
}


x86 assembly (clang, -O0):
<Qt_setMaximumLimitSource>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x1e,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    0xe82(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
je     1192 <Qt_setMaximumLimitSource+0x42>
jmp    12b0 <Qt_setMaximumLimitSource+0x160>
mov    -0x18(%rbp),%rdi
lea    0xe69(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
je     11c7 <Qt_setMaximumLimitSource+0x77>
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe53(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
jmp    11fc <Qt_setMaximumLimitSource+0xac>
mov    -0x18(%rbp),%rdi
lea    0xe45(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
je     11f7 <Qt_setMaximumLimitSource+0xa7>
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe2f(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
jmp    11fc <Qt_setMaximumLimitSource+0xac>
mov    -0x8(%rbp),%rdi
lea    0xe24(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
je     122e <Qt_setMaximumLimitSource+0xde>
mov    -0x8(%rbp),%rdi
lea    0xe17(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    125f <Qt_setMaximumLimitSource+0x10f>
lea    -0x60(%rbp),%rdi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
lea    0xe08(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
lea    -0x60(%rbp),%rdi
lea    -0x40(%rbp),%rdx
lea    0xe05(%rip),%rsi
call   1030 <Qt_handleString@plt>
jmp    12b0 <Qt_setMaximumLimitSource+0x160>
mov    -0x8(%rbp),%rdi
lea    0xdf5(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1294 <Qt_setMaximumLimitSource+0x144>
lea    -0x40(%rbp),%rdx
lea    0xde5(%rip),%rdi
lea    0xdd0(%rip),%rsi
call   1030 <Qt_handleString@plt>
jmp    12ab <Qt_setMaximumLimitSource+0x15b>
lea    -0x40(%rbp),%rdx
lea    0xdd7(%rip),%rdi
lea    0xdb4(%rip),%rsi
call   1030 <Qt_handleString@plt>
jmp    12b0 <Qt_setMaximumLimitSource+0x160>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Qt_setMaximumLimitSource>:
push   %rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rdx,%rbp
mov    %esi,%r14d
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movups %xmm0,0xe(%rsp)
movaps %xmm0,(%rsp)
lea    0xe9c(%rip),%rsi
call   1060 <strstr@plt>
test   %rax,%rax
jne    123b <Qt_setMaximumLimitSource+0xfb>
lea    0xe8d(%rip),%rsi
mov    %rbp,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     118f <Qt_setMaximumLimitSource+0x4f>
lea    0xe81(%rip),%rsi
jmp    11aa <Qt_setMaximumLimitSource+0x6a>
lea    0xe81(%rip),%rsi
mov    %rbp,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     11b7 <Qt_setMaximumLimitSource+0x77>
lea    0xe75(%rip),%rsi
mov    %rsp,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <sprintf@plt>
lea    0xe6d(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11f9 <Qt_setMaximumLimitSource+0xb9>
lea    0xe66(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11f9 <Qt_setMaximumLimitSource+0xb9>
lea    0xe7b(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1225 <Qt_setMaximumLimitSource+0xe5>
lea    0xe7f(%rip),%rdi
jmp    122c <Qt_setMaximumLimitSource+0xec>
add    $0x1,%r14d
lea    0xe43(%rip),%rsi
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1050 <sprintf@plt>
lea    0xe3d(%rip),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
jmp    1236 <Qt_setMaximumLimitSource+0xf6>
lea    0xe3c(%rip),%rdi
lea    0xe27(%rip),%rsi
mov    %rsp,%rdx
call   1030 <Qt_handleString@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Gauge\00"
@.str.1 = [8 x i8] c"default\00"
@.str.2 = [9 x i8] c"%s::User\00"
@.str.3 = [8 x i8] c"channel\00"
@.str.4 = [12 x i8] c"%s::Channel\00"
@.str.5 = [12 x i8] c"caStripPlot\00"
@.str.6 = [16 x i8] c"caCartesianPlot\00"
@.str.7 = [19 x i8] c"YaxisScalingMax_%d\00"
@.str.8 = [5 x i8] c"enum\00"
@.str.9 = [9 x i8] c"caSlider\00"
@.str.10 = [14 x i8] c"highLimitMode\00"
@.str.11 = [11 x i8] c"limitsMode\00"
define void @Qt_setMaximumLimitSource(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca [30 x i8]
%8 = alloca [30 x i8]
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%9 = bitcast [30 x i8]* %7 to i8*
%10 = load i8*, i8** %4
%11 = call i8* @strstr(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %14
13: ; preds = %3
br label %58
14: ; preds = %3
%15 = load i8*, i8** %6
%16 = call i8* @strstr(i8* %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%20 = load i8*, i8** %4
%21 = call i32 (i8*, i8*, ...) @sprintf(i8* %19, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %20)
br label %31
22: ; preds = %14
%23 = load i8*, i8** %6
%24 = call i8* @strstr(i8* %23, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%25 = icmp ne i8* %24, null
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%28 = load i8*, i8** %4
%29 = call i32 (i8*, i8*, ...) @sprintf(i8* %27, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* %28)
br label %30
30: ; preds = %26, %22
br label %31
31: ; preds = %30, %18
%32 = load i8*, i8** %4
%33 = call i32 @strcmp(i8* %32, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %31
%36 = load i8*, i8** %4
%37 = call i32 @strcmp(i8* %36, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%38 = icmp ne i32 %37, 0
br i1 %38, label %47, label %39
39: ; preds = %35, %31
%40 = getelementptr inbounds [30 x i8], [30 x i8]* %8, i64 0, i64 0
%41 = load i32, i32* %5
%42 = add nsw i32 %41, 1
%43 = call i32 (i8*, i8*, ...) @sprintf(i8* %40, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 %42)
%44 = getelementptr inbounds [30 x i8], [30 x i8]* %8, i64 0, i64 0
%45 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%46 = call i32 @Qt_handleString(i8* %44, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %45)
br label %58
47: ; preds = %35
%48 = load i8*, i8** %4
%49 = call i32 @strcmp(i8* %48, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%50 = icmp ne i32 %49, 0
br i1 %50, label %54, label %51
51: ; preds = %47
%52 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%53 = call i32 @Qt_handleString(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %52)
br label %57
54: ; preds = %47
%55 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%56 = call i32 @Qt_handleString(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %55)
br label %57
57: ; preds = %54, %51
br label %58
58: ; preds = %13, %57, %39
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"Gauge\00"
@.str.1 = [8 x i8] c"default\00"
@.str.2 = [9 x i8] c"%s::User\00"
@.str.3 = [8 x i8] c"channel\00"
@.str.4 = [12 x i8] c"%s::Channel\00"
@.str.5 = [12 x i8] c"caStripPlot\00"
@.str.6 = [16 x i8] c"caCartesianPlot\00"
@.str.7 = [19 x i8] c"YaxisScalingMax_%d\00"
@.str.8 = [5 x i8] c"enum\00"
@.str.9 = [9 x i8] c"caSlider\00"
@.str.10 = [14 x i8] c"highLimitMode\00"
@.str.11 = [11 x i8] c"limitsMode\00"
define void @Qt_setMaximumLimitSource(i8* %0, i32 %1, i8* %2) {
%4 = alloca [30 x i8]
%5 = alloca [30 x i8]
%6 = getelementptr inbounds [30 x i8], [30 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 %36
9: ; preds = %3
%10 = tail call i8* @strstr(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = tail call i8* @strstr(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%14 = icmp eq i8* %13, null
br i1 %14, label %18, label %15
15: ; preds = %12, %9
%16 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), %9 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), %12 ]
%17 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* dereferenceable(1) %16, i8* %0)
br label %18
18: ; preds = %15, %12
%19 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(12) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %24, label %21
21: ; preds = %18
%22 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(16) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %29
24: ; preds = %21, %18
%25 = getelementptr inbounds [30 x i8], [30 x i8]* %5, i64 0, i64 0
%26 = add nsw i32 %1, 1
%27 = call i32 (i8*, i8*, ...) @sprintf(i8* %25, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 %26)
%28 = call i32 @Qt_handleString(i8* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %6)
br label %36
29: ; preds = %21
%30 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = call i32 @Qt_handleString(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %6)
br label %36
34: ; preds = %29
%35 = call i32 @Qt_handleString(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %6)
br label %36
36: ; preds = %24, %34, %32, %3
ret void
}