#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 Qt_setVisibilityMode(char *widget, char *token) {
  char asc[80];
  if (!strcmp(token, "static")) {
    sprintf(asc, "%s::StaticV", widget);
    Qt_handleString("visibility", "enum", asc);
    return 0;
  } else if (!strcmp(token, "if not zero")) {
    sprintf(asc, "%s::IfNotZero", widget);
    Qt_handleString("visibility", "enum", asc);
    return 1;
  } else if (!strcmp(token, "if zero")) {
    sprintf(asc, "%s::IfZero", widget);
    Qt_handleString("visibility", "enum", asc);
    return 1;
  } else if (!strcmp(token, "calc")) {
    sprintf(asc, "%s::Calc", widget);
    Qt_handleString("visibility", "enum", asc);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<Qt_setVisibilityMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1190 <Qt_setVisibilityMode+0x60>
lea    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe9f(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x70(%rbp),%rdx
lea    0xe9b(%rip),%rdi
lea    0xe9f(%rip),%rsi
call   1030 <Qt_handleString@plt>
movl   $0x0,-0x4(%rbp)
jmp    1296 <Qt_setVisibilityMode+0x166>
mov    -0x18(%rbp),%rdi
lea    0xe88(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11e0 <Qt_setVisibilityMode+0xb0>
lea    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe77(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x70(%rbp),%rdx
lea    0xe4b(%rip),%rdi
lea    0xe4f(%rip),%rsi
call   1030 <Qt_handleString@plt>
movl   $0x1,-0x4(%rbp)
jmp    1296 <Qt_setVisibilityMode+0x166>
mov    -0x18(%rbp),%rdi
lea    0xe52(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1230 <Qt_setVisibilityMode+0x100>
lea    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe3d(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x70(%rbp),%rdx
lea    0xdfb(%rip),%rdi
lea    0xdff(%rip),%rsi
call   1030 <Qt_handleString@plt>
movl   $0x1,-0x4(%rbp)
jmp    1296 <Qt_setVisibilityMode+0x166>
mov    -0x18(%rbp),%rdi
lea    0xe15(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1280 <Qt_setVisibilityMode+0x150>
lea    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xdfd(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x70(%rbp),%rdx
lea    0xdab(%rip),%rdi
lea    0xdaf(%rip),%rsi
call   1030 <Qt_handleString@plt>
movl   $0x1,-0x4(%rbp)
jmp    1296 <Qt_setVisibilityMode+0x166>
jmp    1285 <Qt_setVisibilityMode+0x155>
jmp    128a <Qt_setVisibilityMode+0x15a>
jmp    128f <Qt_setVisibilityMode+0x15f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Qt_setVisibilityMode>:
push   %rbp
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     119c <Qt_setVisibilityMode+0x6c>
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
mov    $0x1,%ebp
test   %eax,%eax
je     11a7 <Qt_setVisibilityMode+0x77>
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11b0 <Qt_setVisibilityMode+0x80>
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
jne    11dd <Qt_setVisibilityMode+0xad>
lea    0xebb(%rip),%rsi
jmp    11b7 <Qt_setVisibilityMode+0x87>
xor    %ebp,%ebp
lea    0xe62(%rip),%rsi
jmp    11b7 <Qt_setVisibilityMode+0x87>
lea    0xe81(%rip),%rsi
jmp    11b7 <Qt_setVisibilityMode+0x87>
lea    0xe8e(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %r14,%rdx
call   1050 <sprintf@plt>
lea    0xe47(%rip),%rdi
lea    0xe4b(%rip),%rsi
mov    %rbx,%rdx
call   1030 <Qt_handleString@plt>
mov    %ebp,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"static\00"
@.str.1 = [12 x i8] c"%s::StaticV\00"
@.str.2 = [11 x i8] c"visibility\00"
@.str.3 = [5 x i8] c"enum\00"
@.str.4 = [12 x i8] c"if not zero\00"
@.str.5 = [14 x i8] c"%s::IfNotZero\00"
@.str.6 = [8 x i8] c"if zero\00"
@.str.7 = [11 x i8] c"%s::IfZero\00"
@.str.8 = [5 x i8] c"calc\00"
@.str.9 = [9 x i8] c"%s::Calc\00"
define i32 @Qt_setVisibilityMode(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [80 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @strcmp(i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
br i1 %9, label %16, label %10
10: ; preds = %2
%11 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%12 = load i8*, i8** %4
%13 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%15 = call i32 @Qt_handleString(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %14)
store i32 0, i32* %3
br label %50
16: ; preds = %2
%17 = load i8*, i8** %5
%18 = call i32 @strcmp(i8* %17, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%19 = icmp ne i32 %18, 0
br i1 %19, label %26, label %20
20: ; preds = %16
%21 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%22 = load i8*, i8** %4
%23 = call i32 @sprintf(i8* %21, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* %22)
%24 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%25 = call i32 @Qt_handleString(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %24)
store i32 1, i32* %3
br label %50
26: ; preds = %16
%27 = load i8*, i8** %5
%28 = call i32 @strcmp(i8* %27, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%29 = icmp ne i32 %28, 0
br i1 %29, label %36, label %30
30: ; preds = %26
%31 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%32 = load i8*, i8** %4
%33 = call i32 @sprintf(i8* %31, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* %32)
%34 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%35 = call i32 @Qt_handleString(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %34)
store i32 1, i32* %3
br label %50
36: ; preds = %26
%37 = load i8*, i8** %5
%38 = call i32 @strcmp(i8* %37, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%39 = icmp ne i32 %38, 0
br i1 %39, label %46, label %40
40: ; preds = %36
%41 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%42 = load i8*, i8** %4
%43 = call i32 @sprintf(i8* %41, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i8* %42)
%44 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%45 = call i32 @Qt_handleString(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %44)
store i32 1, i32* %3
br label %50
46: ; preds = %36
br label %47
47: ; preds = %46
br label %48
48: ; preds = %47
br label %49
49: ; preds = %48
store i32 0, i32* %3
br label %50
50: ; preds = %49, %40, %30, %20, %10
%51 = load i32, i32* %3
ret i32 %51
}

LLVM IR (-O2):
@.str = [7 x i8] c"static\00"
@.str.1 = [12 x i8] c"%s::StaticV\00"
@.str.2 = [11 x i8] c"visibility\00"
@.str.3 = [5 x i8] c"enum\00"
@.str.4 = [12 x i8] c"if not zero\00"
@.str.5 = [14 x i8] c"%s::IfNotZero\00"
@.str.6 = [8 x i8] c"if zero\00"
@.str.7 = [11 x i8] c"%s::IfZero\00"
@.str.8 = [5 x i8] c"calc\00"
@.str.9 = [9 x i8] c"%s::Calc\00"
define i32 @Qt_setVisibilityMode(i8* %0, i8* nocapture %1) {
%3 = alloca [80 x i8]
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %2
%8 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(12) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %16, label %10
10: ; preds = %7
%11 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %13, %10, %7, %2
%17 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), %7 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), %10 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), %13 ]
%18 = phi i32 [ 0, %2 ], [ 1, %7 ], [ 1, %10 ], [ 1, %13 ]
%19 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) %17, i8* %0)
%20 = call i32 @Qt_handleString(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %4)
br label %21
21: ; preds = %16, %13
%22 = phi i32 [ 0, %13 ], [ %18, %16 ]
ret i32 %22
}