#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 */
char *basename(char *);
char *eval_expression(char const *, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                      int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
char *getenv(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
scalar_t__ strcmp(char *, char *);
char *strdup(char *);
scalar_t__ strlen(char *);
scalar_t__ strncmp(char *, char *, int);
void gui_window_set_title(const char *title) {
  char *new_title, *envterm, *envshell, *shell, *shellname;
  envterm = getenv("TERM");
  if (!envterm)
    return;
  new_title = (title && title[0]) ? eval_expression(title, NULL, NULL, NULL)
                                  : strdup("Terminal");
  if (!new_title)
    return;
  if (strcmp(envterm, "sun-cmd") == 0) {
    printf("\033]l%s\033\\", new_title);
  } else if (strcmp(envterm, "hpterm") == 0) {
    printf("\033&f0k%dD%s", (int)(strlen(new_title) + 1), new_title);
  } else if ((strncmp(envterm, "xterm", 5) == 0) ||
             (strncmp(envterm, "rxvt", 4) == 0) ||
             (strcmp(envterm, "Eterm") == 0) ||
             (strcmp(envterm, "aixterm") == 0) ||
             (strcmp(envterm, "iris-ansi") == 0) ||
             (strcmp(envterm, "dtterm") == 0)) {
    printf("\33]0;%s\7", new_title);
  } else if ((strncmp(envterm, "screen", 6) == 0) ||
             (strncmp(envterm, "tmux", 4) == 0)) {
    if (title && title[0]) {
      printf("\033k%s\033\\", new_title);
    } else {
      envshell = getenv("SHELL");
      if (envshell) {
        shell = strdup(envshell);
        if (shell) {
          shellname = basename(shell);
          printf("\033k%s\033\\", (shellname) ? shellname : shell);
          free(shell);
        } else {
          printf("\033k%s\033\\", envterm);
        }
      } else {
        printf("\033k%s\033\\", envterm);
      }
    }
    printf("\33]0;%s\7", new_title);
  }
  fflush(stdout);
  free(new_title);
}


x86 assembly (clang, -O0):
<gui_window_set_title>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xe4d(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11cc <gui_window_set_title+0x2c>
jmp    14af <gui_window_set_title+0x30f>
cmpq   $0x0,-0x8(%rbp)
je     1203 <gui_window_set_title+0x63>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1203 <gui_window_set_title+0x63>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1080 <eval_expression@plt>
mov    %rax,-0x38(%rbp)
jmp    1213 <gui_window_set_title+0x73>
lea    0xdfb(%rip),%rdi
call   10c0 <strdup@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    122b <gui_window_set_title+0x8b>
jmp    14af <gui_window_set_title+0x30f>
mov    -0x18(%rbp),%rdi
lea    0xdd8(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    125c <gui_window_set_title+0xbc>
mov    -0x10(%rbp),%rsi
lea    0xdc6(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1498 <gui_window_set_title+0x2f8>
mov    -0x18(%rbp),%rdi
lea    0xdb7(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    129c <gui_window_set_title+0xfc>
mov    -0x10(%rbp),%rdi
call   1060 <strlen@plt>
add    $0x1,%rax
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
lea    0xd95(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1493 <gui_window_set_title+0x2f3>
mov    -0x18(%rbp),%rdi
lea    0xd96(%rip),%rsi
mov    $0x5,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%rax
je     1342 <gui_window_set_title+0x1a2>
mov    -0x18(%rbp),%rdi
lea    0xd6a(%rip),%rsi
mov    $0x4,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%rax
je     1342 <gui_window_set_title+0x1a2>
mov    -0x18(%rbp),%rdi
lea    0xd50(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     1342 <gui_window_set_title+0x1a2>
mov    -0x18(%rbp),%rdi
lea    0xd3c(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     1342 <gui_window_set_title+0x1a2>
mov    -0x18(%rbp),%rdi
lea    0xd2a(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     1342 <gui_window_set_title+0x1a2>
mov    -0x18(%rbp),%rdi
lea    0xd1a(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1359 <gui_window_set_title+0x1b9>
mov    -0x10(%rbp),%rsi
lea    0xd07(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    148e <gui_window_set_title+0x2ee>
mov    -0x18(%rbp),%rdi
lea    0xcf8(%rip),%rsi
mov    $0x6,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%rax
je     1397 <gui_window_set_title+0x1f7>
mov    -0x18(%rbp),%rdi
lea    0xce0(%rip),%rsi
mov    $0x4,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%rax
jne    1489 <gui_window_set_title+0x2e9>
cmpq   $0x0,-0x8(%rbp)
je     13c9 <gui_window_set_title+0x229>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     13c9 <gui_window_set_title+0x229>
mov    -0x10(%rbp),%rsi
lea    0xcab(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1477 <gui_window_set_title+0x2d7>
lea    0xc9f(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1460 <gui_window_set_title+0x2c0>
mov    -0x20(%rbp),%rdi
call   10c0 <strdup@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1449 <gui_window_set_title+0x2a9>
mov    -0x28(%rbp),%rdi
call   10a0 <basename@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1421 <gui_window_set_title+0x281>
mov    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    1429 <gui_window_set_title+0x289>
mov    -0x28(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rsi
lea    0xc34(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x28(%rbp),%rdi
call   1040 <free@plt>
jmp    145b <gui_window_set_title+0x2bb>
mov    -0x18(%rbp),%rsi
lea    0xc14(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1472 <gui_window_set_title+0x2d2>
mov    -0x18(%rbp),%rsi
lea    0xbfd(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1477 <gui_window_set_title+0x2d7>
mov    -0x10(%rbp),%rsi
lea    0xbd2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    148e <gui_window_set_title+0x2ee>
jmp    1493 <gui_window_set_title+0x2f3>
jmp    1498 <gui_window_set_title+0x2f8>
mov    0x2b41(%rip),%rax
mov    (%rax),%edi
call   10b0 <fflush@plt>
mov    -0x10(%rbp),%rdi
call   1040 <free@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_window_set_title>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
lea    0xe51(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     130d <gui_window_set_title+0x16d>
mov    %rax,%rbx
test   %r15,%r15
je     11db <gui_window_set_title+0x3b>
cmpb   $0x0,(%r15)
je     11db <gui_window_set_title+0x3b>
mov    %r15,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1080 <eval_expression@plt>
jmp    11e7 <gui_window_set_title+0x47>
lea    0xe23(%rip),%rdi
call   10c0 <strdup@plt>
mov    %rax,%r14
test   %rax,%rax
je     130d <gui_window_set_title+0x16d>
lea    0xe14(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1313 <gui_window_set_title+0x173>
lea    0xe0c(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     131f <gui_window_set_title+0x17f>
lea    0xe13(%rip),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1050 <strncmp@plt>
test   %rax,%rax
je     1399 <gui_window_set_title+0x1f9>
lea    0xde9(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1050 <strncmp@plt>
test   %rax,%rax
je     1399 <gui_window_set_title+0x1f9>
lea    0xdd1(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1399 <gui_window_set_title+0x1f9>
lea    0xdbf(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1399 <gui_window_set_title+0x1f9>
lea    0xdaf(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1399 <gui_window_set_title+0x1f9>
lea    0xda1(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1399 <gui_window_set_title+0x1f9>
lea    0xd98(%rip),%rsi
mov    %rbx,%rdi
mov    $0x6,%edx
call   1050 <strncmp@plt>
test   %rax,%rax
je     12f3 <gui_window_set_title+0x153>
lea    0xd86(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1050 <strncmp@plt>
test   %rax,%rax
jne    13aa <gui_window_set_title+0x20a>
test   %r15,%r15
je     133d <gui_window_set_title+0x19d>
cmpb   $0x0,(%r15)
je     133d <gui_window_set_title+0x19d>
lea    0xd63(%rip),%rdi
mov    %r14,%rsi
jmp    1392 <gui_window_set_title+0x1f2>
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xcfc(%rip),%rdi
jmp    13a0 <gui_window_set_title+0x200>
mov    %r14,%rdi
call   1060 <strlen@plt>
lea    0x1(%rax),%esi
lea    0xcf4(%rip),%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
jmp    13aa <gui_window_set_title+0x20a>
lea    0xd2b(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1388 <gui_window_set_title+0x1e8>
mov    %rax,%rdi
call   10c0 <strdup@plt>
test   %rax,%rax
je     1388 <gui_window_set_title+0x1e8>
mov    %rax,%r15
mov    %rax,%rdi
call   10a0 <basename@plt>
test   %rax,%rax
mov    %r15,%rsi
cmovne %rax,%rsi
lea    0xcf1(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
call   1040 <free@plt>
jmp    1399 <gui_window_set_title+0x1f9>
lea    0xcd9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xcb4(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x2c2f(%rip),%rax
mov    (%rax),%edi
call   10b0 <fflush@plt>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <free@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"TERM\00"
@.str.1 = [9 x i8] c"Terminal\00"
@.str.2 = [8 x i8] c"sun-cmd\00"
@.str.3 = [8 x i8] c"\1B]l%s\1B\\\00"
@.str.4 = [7 x i8] c"hpterm\00"
@.str.5 = [11 x i8] c"\1B&f0k%dD%s\00"
@.str.6 = [6 x i8] c"xterm\00"
@.str.7 = [5 x i8] c"rxvt\00"
@.str.8 = [6 x i8] c"Eterm\00"
@.str.9 = [8 x i8] c"aixterm\00"
@.str.10 = [10 x i8] c"iris-ansi\00"
@.str.11 = [7 x i8] c"dtterm\00"
@.str.12 = [8 x i8] c"\1B]0;%s\07\00"
@.str.13 = [7 x i8] c"screen\00"
@.str.14 = [5 x i8] c"tmux\00"
@.str.15 = [7 x i8] c"\1Bk%s\1B\\\00"
@.str.16 = [6 x i8] c"SHELL\00"
@stdout = global i32 0
define void @gui_window_set_title(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %2
%8 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %1
br label %138
12: ; preds = %1
%13 = load i8*, i8** %2
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %24
15: ; preds = %12
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %15
%22 = load i8*, i8** %2
%23 = call i8* @eval_expression(i8* %22, i32* null, i32* null, i32* null)
br label %26
24: ; preds = %15, %12
%25 = call i8* @strdup(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %26
26: ; preds = %24, %21
%27 = phi i8* [ %23, %21 ], [ %25, %24 ]
store i8* %27, i8** %3
%28 = load i8*, i8** %3
%29 = icmp ne i8* %28, null
br i1 %29, label %31, label %30
30: ; preds = %26
br label %138
31: ; preds = %26
%32 = load i8*, i8** %4
%33 = call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %38
35: ; preds = %31
%36 = load i8*, i8** %3
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %36)
br label %133
38: ; preds = %31
%39 = load i8*, i8** %4
%40 = call i64 @strcmp(i8* %39, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %49
42: ; preds = %38
%43 = load i8*, i8** %3
%44 = call i64 @strlen(i8* %43)
%45 = add nsw i64 %44, 1
%46 = trunc i64 %45 to i32
%47 = load i8*, i8** %3
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 %46, i8* %47)
br label %132
49: ; preds = %38
%50 = load i8*, i8** %4
%51 = call i64 @strncmp(i8* %50, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 5)
%52 = icmp eq i64 %51, 0
br i1 %52, label %73, label %53
53: ; preds = %49
%54 = load i8*, i8** %4
%55 = call i64 @strncmp(i8* %54, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 4)
%56 = icmp eq i64 %55, 0
br i1 %56, label %73, label %57
57: ; preds = %53
%58 = load i8*, i8** %4
%59 = call i64 @strcmp(i8* %58, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %73, label %61
61: ; preds = %57
%62 = load i8*, i8** %4
%63 = call i64 @strcmp(i8* %62, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%64 = icmp eq i64 %63, 0
br i1 %64, label %73, label %65
65: ; preds = %61
%66 = load i8*, i8** %4
%67 = call i64 @strcmp(i8* %66, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0))
%68 = icmp eq i64 %67, 0
br i1 %68, label %73, label %69
69: ; preds = %65
%70 = load i8*, i8** %4
%71 = call i64 @strcmp(i8* %70, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
%72 = icmp eq i64 %71, 0
br i1 %72, label %73, label %76
73: ; preds = %69, %65, %61, %57, %53, %49
%74 = load i8*, i8** %3
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i8* %74)
br label %131
76: ; preds = %69
%77 = load i8*, i8** %4
%78 = call i64 @strncmp(i8* %77, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i32 6)
%79 = icmp eq i64 %78, 0
br i1 %79, label %84, label %80
80: ; preds = %76
%81 = load i8*, i8** %4
%82 = call i64 @strncmp(i8* %81, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i32 4)
%83 = icmp eq i64 %82, 0
br i1 %83, label %84, label %130
84: ; preds = %80, %76
%85 = load i8*, i8** %2
%86 = icmp ne i8* %85, null
br i1 %86, label %87, label %96
87: ; preds = %84
%88 = load i8*, i8** %2
%89 = getelementptr inbounds i8, i8* %88, i64 0
%90 = load i8, i8* %89
%91 = sext i8 %90 to i32
%92 = icmp ne i32 %91, 0
br i1 %92, label %93, label %96
93: ; preds = %87
%94 = load i8*, i8** %3
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i8* %94)
br label %127
96: ; preds = %87, %84
%97 = call i8* @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
store i8* %97, i8** %5
%98 = load i8*, i8** %5
%99 = icmp ne i8* %98, null
br i1 %99, label %100, label %123
100: ; preds = %96
%101 = load i8*, i8** %5
%102 = call i8* @strdup(i8* %101)
store i8* %102, i8** %6
%103 = load i8*, i8** %6
%104 = icmp ne i8* %103, null
br i1 %104, label %105, label %119
105: ; preds = %100
%106 = load i8*, i8** %6
%107 = call i8* @basename(i8* %106)
store i8* %107, i8** %7
%108 = load i8*, i8** %7
%109 = icmp ne i8* %108, null
br i1 %109, label %110, label %112
110: ; preds = %105
%111 = load i8*, i8** %7
br label %114
112: ; preds = %105
%113 = load i8*, i8** %6
br label %114
114: ; preds = %112, %110
%115 = phi i8* [ %111, %110 ], [ %113, %112 ]
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i8* %115)
%117 = load i8*, i8** %6
%118 = call i32 @free(i8* %117)
br label %122
119: ; preds = %100
%120 = load i8*, i8** %4
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i8* %120)
br label %122
122: ; preds = %119, %114
br label %126
123: ; preds = %96
%124 = load i8*, i8** %4
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i8* %124)
br label %126
126: ; preds = %123, %122
br label %127
127: ; preds = %126, %93
%128 = load i8*, i8** %3
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i8* %128)
br label %130
130: ; preds = %127, %80
br label %131
131: ; preds = %130, %73
br label %132
132: ; preds = %131, %42
br label %133
133: ; preds = %132, %35
%134 = load i32, i32* @stdout
%135 = call i32 @fflush(i32 %134)
%136 = load i8*, i8** %3
%137 = call i32 @free(i8* %136)
br label %138
138: ; preds = %133, %30, %11
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"TERM\00"
@.str.1 = [9 x i8] c"Terminal\00"
@.str.2 = [8 x i8] c"sun-cmd\00"
@.str.3 = [8 x i8] c"\1B]l%s\1B\\\00"
@.str.4 = [7 x i8] c"hpterm\00"
@.str.5 = [11 x i8] c"\1B&f0k%dD%s\00"
@.str.6 = [6 x i8] c"xterm\00"
@.str.7 = [5 x i8] c"rxvt\00"
@.str.8 = [6 x i8] c"Eterm\00"
@.str.9 = [8 x i8] c"aixterm\00"
@.str.10 = [10 x i8] c"iris-ansi\00"
@.str.11 = [7 x i8] c"dtterm\00"
@.str.12 = [8 x i8] c"\1B]0;%s\07\00"
@.str.13 = [7 x i8] c"screen\00"
@.str.14 = [5 x i8] c"tmux\00"
@.str.15 = [7 x i8] c"\1Bk%s\1B\\\00"
@.str.16 = [6 x i8] c"SHELL\00"
@stdout = global i32 0
define void @gui_window_set_title(i8* %0) {
%2 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %83, label %4
4: ; preds = %1
%5 = icmp eq i8* %0, null
br i1 %5, label %11, label %6
6: ; preds = %4
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i8* @eval_expression(i8* %0, i32* null, i32* null, i32* null)
br label %13
11: ; preds = %6, %4
%12 = tail call dereferenceable_or_null(9) i8* @strdup(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = phi i8* [ %10, %9 ], [ %12, %11 ]
%15 = icmp eq i8* %14, null
br i1 %15, label %83, label %16
16: ; preds = %13
%17 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %14)
br label %79
21: ; preds = %16
%22 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %29
24: ; preds = %21
%25 = tail call i64 @strlen(i8* %14)
%26 = trunc i64 %25 to i32
%27 = add i32 %26, 1
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 %27, i8* %14)
br label %79
29: ; preds = %21
%30 = tail call i64 @strncmp(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 5)
%31 = icmp eq i64 %30, 0
br i1 %31, label %47, label %32
32: ; preds = %29
%33 = tail call i64 @strncmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 4)
%34 = icmp eq i64 %33, 0
br i1 %34, label %47, label %35
35: ; preds = %32
%36 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %47, label %38
38: ; preds = %35
%39 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %47, label %41
41: ; preds = %38
%42 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %47, label %44
44: ; preds = %41
%45 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %49
47: ; preds = %44, %41, %38, %35, %32, %29
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i8* %14)
br label %79
49: ; preds = %44
%50 = tail call i64 @strncmp(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i32 6)
%51 = icmp eq i64 %50, 0
br i1 %51, label %55, label %52
52: ; preds = %49
%53 = tail call i64 @strncmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i32 4)
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %79
55: ; preds = %52, %49
br i1 %5, label %61, label %56
56: ; preds = %55
%57 = load i8, i8* %0
%58 = icmp eq i8 %57, 0
br i1 %58, label %61, label %59
59: ; preds = %56
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i8* %14)
br label %77
61: ; preds = %56, %55
%62 = tail call i8* @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
%63 = icmp eq i8* %62, null
br i1 %63, label %75, label %64
64: ; preds = %61
%65 = tail call i8* @strdup(i8* %62)
%66 = icmp eq i8* %65, null
br i1 %66, label %73, label %67
67: ; preds = %64
%68 = tail call i8* @basename(i8* %65)
%69 = icmp eq i8* %68, null
%70 = select i1 %69, i8* %65, i8* %68
%71 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i8* %70)
%72 = tail call i32 @free(i8* %65)
br label %77
73: ; preds = %64
%74 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i8* %2)
br label %77
75: ; preds = %61
%76 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i8* %2)
br label %77
77: ; preds = %75, %73, %67, %59
%78 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i8* %14)
br label %79
79: ; preds = %24, %52, %77, %47, %19
%80 = load i32, i32* @stdout
%81 = tail call i32 @fflush(i32 %80)
%82 = tail call i32 @free(i8* %14)
br label %83
83: ; preds = %13, %1, %79
ret void
}