#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 *);
char *strstr(char *, char *);
void Qt_setXaxisLimitSource(char *widget, char *token) {
  char asc[80];
  if (strstr(token, "auto") != (char *)0) {
    sprintf(asc, "%s::Auto", widget);
  } else if (strstr(token, "default") != (char *)0) {
    sprintf(asc, "%s::User", widget);
  } else if (strstr(token, "user") != (char *)0) {
    sprintf(asc, "%s::User", widget);
  } else if (strstr(token, "channel") != (char *)0) {
    sprintf(asc, "%s::Channel", widget);
  }
  Qt_handleString("XaxisScaling", "enum", asc);
}


x86 assembly (clang, -O0):
<Qt_setXaxisLimitSource>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
je     1173 <Qt_setXaxisLimitSource+0x43>
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe9c(%rip),%rsi
call   1040 <sprintf@plt>
jmp    1216 <Qt_setXaxisLimitSource+0xe6>
mov    -0x10(%rbp),%rdi
lea    0xe90(%rip),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
je     11a6 <Qt_setXaxisLimitSource+0x76>
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe7a(%rip),%rsi
call   1040 <sprintf@plt>
jmp    1211 <Qt_setXaxisLimitSource+0xe1>
mov    -0x10(%rbp),%rdi
lea    0xe6e(%rip),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
je     11d9 <Qt_setXaxisLimitSource+0xa9>
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe47(%rip),%rsi
call   1040 <sprintf@plt>
jmp    120c <Qt_setXaxisLimitSource+0xdc>
mov    -0x10(%rbp),%rdi
lea    0xe40(%rip),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
je     1207 <Qt_setXaxisLimitSource+0xd7>
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe2a(%rip),%rsi
call   1040 <sprintf@plt>
jmp    120c <Qt_setXaxisLimitSource+0xdc>
jmp    1211 <Qt_setXaxisLimitSource+0xe1>
jmp    1216 <Qt_setXaxisLimitSource+0xe6>
lea    -0x60(%rbp),%rdx
lea    0xe17(%rip),%rdi
lea    0xe1d(%rip),%rsi
call   1030 <Qt_handleString@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Qt_setXaxisLimitSource>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xeba(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strstr@plt>
test   %rax,%rax
je     115c <Qt_setXaxisLimitSource+0x2c>
lea    0xeab(%rip),%r15
jmp    11a6 <Qt_setXaxisLimitSource+0x76>
lea    0xeab(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strstr@plt>
lea    0xea4(%rip),%r15
test   %rax,%rax
jne    11a6 <Qt_setXaxisLimitSource+0x76>
lea    0xea1(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strstr@plt>
test   %rax,%rax
jne    11a6 <Qt_setXaxisLimitSource+0x76>
lea    0xe92(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strstr@plt>
test   %rax,%rax
je     11b4 <Qt_setXaxisLimitSource+0x84>
lea    0xe86(%rip),%r15
mov    %rsp,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <sprintf@plt>
lea    0xe7d(%rip),%rdi
lea    0xe83(%rip),%rsi
mov    %rsp,%rdx
call   1030 <Qt_handleString@plt>
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"auto\00"
@.str.1 = [9 x i8] c"%s::Auto\00"
@.str.2 = [8 x i8] c"default\00"
@.str.3 = [9 x i8] c"%s::User\00"
@.str.4 = [5 x i8] c"user\00"
@.str.5 = [8 x i8] c"channel\00"
@.str.6 = [12 x i8] c"%s::Channel\00"
@.str.7 = [13 x i8] c"XaxisScaling\00"
@.str.8 = [5 x i8] c"enum\00"
define void @Qt_setXaxisLimitSource(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [80 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i8* @strstr(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%11 = load i8*, i8** %3
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %40
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = call i8* @strstr(i8* %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%19 = load i8*, i8** %3
%20 = call i32 @sprintf(i8* %18, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %19)
br label %39
21: ; preds = %13
%22 = load i8*, i8** %4
%23 = call i8* @strstr(i8* %22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%24 = icmp ne i8* %23, null
br i1 %24, label %25, label %29
25: ; preds = %21
%26 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%27 = load i8*, i8** %3
%28 = call i32 @sprintf(i8* %26, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %27)
br label %38
29: ; preds = %21
%30 = load i8*, i8** %4
%31 = call i8* @strstr(i8* %30, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%32 = icmp ne i8* %31, null
br i1 %32, label %33, label %37
33: ; preds = %29
%34 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%35 = load i8*, i8** %3
%36 = call i32 @sprintf(i8* %34, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %35)
br label %37
37: ; preds = %33, %29
br label %38
38: ; preds = %37, %25
br label %39
39: ; preds = %38, %17
br label %40
40: ; preds = %39, %9
%41 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%42 = call i32 @Qt_handleString(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %41)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"auto\00"
@.str.1 = [9 x i8] c"%s::Auto\00"
@.str.2 = [8 x i8] c"default\00"
@.str.3 = [9 x i8] c"%s::User\00"
@.str.4 = [5 x i8] c"user\00"
@.str.5 = [8 x i8] c"channel\00"
@.str.6 = [12 x i8] c"%s::Channel\00"
@.str.7 = [13 x i8] c"XaxisScaling\00"
@.str.8 = [5 x i8] c"enum\00"
define void @Qt_setXaxisLimitSource(i8* %0, i8* %1) {
%3 = alloca [80 x i8]
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = tail call i8* @strstr(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = tail call i8* @strstr(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = tail call i8* @strstr(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = tail call i8* @strstr(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%15 = icmp eq i8* %14, null
br i1 %15, label %19, label %16
16: ; preds = %13, %10, %7, %2
%17 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), %7 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), %10 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), %13 ]
%18 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) %17, i8* %0)
br label %19
19: ; preds = %16, %13
%20 = call i32 @Qt_handleString(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %4)
ret void
}