#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_setMinimumLimitSource(char *widget, int pen, char *token) {
  char strng[30];
  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, "YaxisScalingMin_%d", pen + 1);
    Qt_handleString(asc, "enum", strng);
  } else {
    Qt_handleString("limitsMode", "enum", strng);
  }
}


x86 assembly (clang, -O0):
<Qt_setMinimumLimitSource>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea2(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     1172 <Qt_setMinimumLimitSource+0x32>
jmp    1256 <Qt_setMinimumLimitSource+0x116>
mov    -0x18(%rbp),%rdi
lea    0xe89(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     11a7 <Qt_setMinimumLimitSource+0x67>
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe73(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
jmp    11dc <Qt_setMinimumLimitSource+0x9c>
mov    -0x18(%rbp),%rdi
lea    0xe65(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     11d7 <Qt_setMinimumLimitSource+0x97>
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe4f(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
jmp    11dc <Qt_setMinimumLimitSource+0x9c>
mov    -0x8(%rbp),%rdi
lea    0xe44(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     120e <Qt_setMinimumLimitSource+0xce>
mov    -0x8(%rbp),%rdi
lea    0xe37(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    123f <Qt_setMinimumLimitSource+0xff>
lea    -0x60(%rbp),%rdi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
lea    0xe28(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
lea    -0x60(%rbp),%rdi
lea    -0x40(%rbp),%rdx
lea    0xe25(%rip),%rsi
call   1030 <Qt_handleString@plt>
jmp    1256 <Qt_setMinimumLimitSource+0x116>
lea    -0x40(%rbp),%rdx
lea    0xe15(%rip),%rdi
lea    0xe09(%rip),%rsi
call   1030 <Qt_handleString@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Qt_setMinimumLimitSource>:
push   %rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rdx,%rbp
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xea8(%rip),%rsi
call   1060 <strstr@plt>
test   %rax,%rax
jne    1213 <Qt_setMinimumLimitSource+0xd3>
lea    0xe99(%rip),%rsi
mov    %rbp,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     1183 <Qt_setMinimumLimitSource+0x43>
lea    0xe8d(%rip),%rsi
jmp    119e <Qt_setMinimumLimitSource+0x5e>
lea    0xe8d(%rip),%rsi
mov    %rbp,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     11ab <Qt_setMinimumLimitSource+0x6b>
lea    0xe81(%rip),%rsi
mov    %rsp,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <sprintf@plt>
lea    0xe79(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11e4 <Qt_setMinimumLimitSource+0xa4>
lea    0xe72(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11e4 <Qt_setMinimumLimitSource+0xa4>
lea    0xe87(%rip),%rdi
lea    0xe7b(%rip),%rsi
mov    %rsp,%rdx
jmp    120e <Qt_setMinimumLimitSource+0xce>
add    $0x1,%r14d
lea    0xe58(%rip),%rsi
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1050 <sprintf@plt>
lea    0xe52(%rip),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
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"YaxisScalingMin_%d\00"
@.str.8 = [5 x i8] c"enum\00"
@.str.9 = [11 x i8] c"limitsMode\00"
define void @Qt_setMinimumLimitSource(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 = load i8*, i8** %4
%10 = call i8* @strstr(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %3
br label %49
13: ; preds = %3
%14 = load i8*, i8** %6
%15 = call i8* @strstr(i8* %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%19 = load i8*, i8** %4
%20 = call i32 (i8*, i8*, ...) @sprintf(i8* %18, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %19)
br label %30
21: ; preds = %13
%22 = load i8*, i8** %6
%23 = call i8* @strstr(i8* %22, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp ne i8* %23, null
br i1 %24, label %25, label %29
25: ; preds = %21
%26 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%27 = load i8*, i8** %4
%28 = call i32 (i8*, i8*, ...) @sprintf(i8* %26, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* %27)
br label %29
29: ; preds = %25, %21
br label %30
30: ; preds = %29, %17
%31 = load i8*, i8** %4
%32 = call i32 @strcmp(i8* %31, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %38
34: ; preds = %30
%35 = load i8*, i8** %4
%36 = call i32 @strcmp(i8* %35, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%37 = icmp ne i32 %36, 0
br i1 %37, label %46, label %38
38: ; preds = %34, %30
%39 = getelementptr inbounds [30 x i8], [30 x i8]* %8, i64 0, i64 0
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 1
%42 = call i32 (i8*, i8*, ...) @sprintf(i8* %39, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 %41)
%43 = getelementptr inbounds [30 x i8], [30 x i8]* %8, i64 0, i64 0
%44 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%45 = call i32 @Qt_handleString(i8* %43, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %44)
br label %49
46: ; preds = %34
%47 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%48 = call i32 @Qt_handleString(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %47)
br label %49
49: ; preds = %12, %46, %38
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"YaxisScalingMin_%d\00"
@.str.8 = [5 x i8] c"enum\00"
@.str.9 = [11 x i8] c"limitsMode\00"
define void @Qt_setMinimumLimitSource(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 %31
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 %31
29: ; preds = %21
%30 = call i32 @Qt_handleString(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %6)
br label %31
31: ; preds = %24, %29, %3
ret void
}