#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 */
scalar_t__ isupper(unsigned char);
int /*<<< orphan*/ strcasecmp(char *, char const *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char const *, int);
char *strpbrk(char *, char *);
char tolower(unsigned char);
char *dos_name2(const char *name) {
  static const char *dev[9] = {"con", "aux",  "com1", "com2", "lpt1",
                               "prn", "lpt2", "lpt3", "nul"};
  char *s;
  char *ext, *temp;
  char buf[128];
  int i, dot;
  static char ans[13];
  strncpy(buf, name, 128 - 1);
  temp = buf;
  ext = 0;
  dot = 0;
  for (i = strlen(buf) - 1; i >= 0; i--) {
    if (buf[i] == '.' && !dot) {
      dot = 1;
      buf[i] = '\0';
      ext = &buf[i + 1];
    }
    if (isupper((unsigned char)buf[i]))
      buf[i] = tolower((unsigned char)buf[i]);
  }
  if (*temp == '\0')
    strcpy(ans, "x");
  else {
    for (i = 0; i < 9; i++) {
      if (!strcasecmp(temp, dev[i]))
        *temp = 'x';
    }
    if (strlen(temp) > 8)
      *(temp + 8) = '\0';
    if (ext && strlen(ext) > 3)
      *(ext + 3) = '\0';
    while ((s = strpbrk(temp, "^+=/[]:',?*\\<>|\". ")))
      *s = 'x';
    while (ext && (s = strpbrk(ext, "^+=/[]:',?*\\<>|\". ")))
      *s = 'x';
    strncpy(ans, temp, 12);
  }
  if (ext && *ext) {
    strcat(ans, ".");
    strcat(ans, ext);
  }
  return (ans);
}


x86 assembly (clang, -O0):
<dos_name2>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x7f,%edx
call   1040 <strncpy@plt>
lea    -0xa0(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0xa8(%rbp)
lea    -0xa0(%rbp),%rdi
call   1060 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xa4(%rbp)
cmpl   $0x0,-0xa4(%rbp)
jl     1296 <dos_name2+0x116>
movslq -0xa4(%rbp),%rax
movsbl -0xa0(%rbp,%rax,1),%eax
ff
cmp    $0x2e,%eax
jne    123b <dos_name2+0xbb>
cmpl   $0x0,-0xa8(%rbp)
jne    123b <dos_name2+0xbb>
movl   $0x1,-0xa8(%rbp)
movslq -0xa4(%rbp),%rax
movb   $0x0,-0xa0(%rbp,%rax,1)
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    -0xa0(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
movslq -0xa4(%rbp),%rax
movzbl -0xa0(%rbp,%rax,1),%edi
ff
call   1090 <isupper@plt>
cmp    $0x0,%rax
je     127d <dos_name2+0xfd>
movslq -0xa4(%rbp),%rax
movzbl -0xa0(%rbp,%rax,1),%edi
ff
call   1070 <tolower@plt>
mov    %al,%cl
movslq -0xa4(%rbp),%rax
mov    %cl,-0xa0(%rbp,%rax,1)
jmp    1282 <dos_name2+0x102>
mov    -0xa4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xa4(%rbp)
jmp    11d6 <dos_name2+0x56>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    12be <dos_name2+0x13e>
lea    0x2e0c(%rip),%rdi
lea    0xd52(%rip),%rsi
call   1050 <strcpy@plt>
jmp    13f4 <dos_name2+0x274>
movl   $0x0,-0xa4(%rbp)
cmpl   $0x9,-0xa4(%rbp)
jge    1319 <dos_name2+0x199>
mov    -0x20(%rbp),%rdi
movslq -0xa4(%rbp),%rcx
lea    0x2d89(%rip),%rax
mov    (%rax,%rcx,8),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1300 <dos_name2+0x180>
mov    -0x20(%rbp),%rax
movb   $0x78,(%rax)
jmp    1305 <dos_name2+0x185>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    12c8 <dos_name2+0x148>
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
cmp    $0x8,%eax
jle    1333 <dos_name2+0x1b3>
mov    -0x20(%rbp),%rax
movb   $0x0,0x8(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1358 <dos_name2+0x1d8>
mov    -0x18(%rbp),%rdi
call   1060 <strlen@plt>
cmp    $0x3,%eax
jle    1358 <dos_name2+0x1d8>
mov    -0x18(%rbp),%rax
movb   $0x0,0x3(%rax)
jmp    135d <dos_name2+0x1dd>
mov    -0x20(%rbp),%rdi
lea    0xcc1(%rip),%rsi
call   1080 <strpbrk@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1387 <dos_name2+0x207>
mov    -0x10(%rbp),%rax
movb   $0x78,(%rax)
jmp    135d <dos_name2+0x1dd>
jmp    138c <dos_name2+0x20c>
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0xa9(%rbp)
je     13c0 <dos_name2+0x240>
mov    -0x18(%rbp),%rdi
lea    0xc7f(%rip),%rsi
call   1080 <strpbrk@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
setne  %al
mov    %al,-0xa9(%rbp)
mov    -0xa9(%rbp),%al
test   $0x1,%al
jne    13d3 <dos_name2+0x253>
jmp    13df <dos_name2+0x25f>
mov    -0x10(%rbp),%rax
movb   $0x78,(%rax)
jmp    138c <dos_name2+0x20c>
mov    -0x20(%rbp),%rsi
lea    0x2ccf(%rip),%rdi
mov    $0xc,%edx
call   1040 <strncpy@plt>
cmpq   $0x0,-0x18(%rbp)
je     1432 <dos_name2+0x2b2>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1432 <dos_name2+0x2b2>
lea    0x2ca3(%rip),%rdi
lea    0xc1f(%rip),%rsi
call   10a0 <strcat@plt>
mov    -0x18(%rbp),%rsi
lea    0x2c8c(%rip),%rdi
call   10a0 <strcat@plt>
lea    0x2c80(%rip),%rax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dos_name2>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7f,%edx
call   1040 <strncpy@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
xor    %r15d,%r15d
test   %eax,%eax
jle    120e <dos_name2+0x8e>
mov    %eax,%eax
xor    %r14d,%r14d
jmp    11ce <dos_name2+0x4e>
nopw   0x0(%rax,%rax,1)
lea    0x1(%r12),%rcx
mov    %r12,%rax
cmp    $0x1,%rcx
jbe    1211 <dos_name2+0x91>
lea    -0x1(%rax),%r12
mov    %r12d,%ebx
movzbl (%rsp,%rbx,1),%ecx
cmp    $0x2e,%cl
jne    11f3 <dos_name2+0x73>
test   %r15d,%r15d
jne    11f3 <dos_name2+0x73>
movb   $0x0,(%rsp,%rbx,1)
lea    (%rsp,%rax,1),%r14
mov    $0x1,%r15d
xor    %ecx,%ecx
movzbl %cl,%edi
call   1090 <isupper@plt>
test   %rax,%rax
je     11c0 <dos_name2+0x40>
movzbl (%rsp,%rbx,1),%edi
call   1070 <tolower@plt>
mov    %al,(%rsp,%rbx,1)
jmp    11c0 <dos_name2+0x40>
xor    %r14d,%r14d
cmpb   $0x0,(%rsp)
je     13ae <dos_name2+0x22e>
lea    0xdde(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    1232 <dos_name2+0xb2>
movb   $0x78,(%rsp)
lea    0xdcb(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    1249 <dos_name2+0xc9>
movb   $0x78,(%rsp)
lea    0xdb8(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    1260 <dos_name2+0xe0>
movb   $0x78,(%rsp)
lea    0xda6(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    1277 <dos_name2+0xf7>
movb   $0x78,(%rsp)
lea    0xd94(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    128e <dos_name2+0x10e>
movb   $0x78,(%rsp)
lea    0xd82(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    12a5 <dos_name2+0x125>
movb   $0x78,(%rsp)
lea    0xd6f(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    12bc <dos_name2+0x13c>
movb   $0x78,(%rsp)
lea    0xd5d(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    12d3 <dos_name2+0x153>
movb   $0x78,(%rsp)
lea    0xd4b(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    12ea <dos_name2+0x16a>
movb   $0x78,(%rsp)
mov    %rsp,%rdi
call   1060 <strlen@plt>
cmp    $0x9,%eax
jl     12fc <dos_name2+0x17c>
movb   $0x0,0x8(%rsp)
test   %r14,%r14
je     1313 <dos_name2+0x193>
mov    %r14,%rdi
call   1060 <strlen@plt>
cmp    $0x4,%eax
jl     1313 <dos_name2+0x193>
movb   $0x0,0x3(%r14)
lea    0xd0f(%rip),%rsi
mov    %rsp,%rdi
call   1080 <strpbrk@plt>
test   %rax,%rax
je     1353 <dos_name2+0x1d3>
lea    0xcfb(%rip),%r15
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movb   $0x78,(%rax)
mov    %rbx,%rdi
mov    %r15,%rsi
call   1080 <strpbrk@plt>
test   %rax,%rax
jne    1340 <dos_name2+0x1c0>
test   %r14,%r14
je     1393 <dos_name2+0x213>
lea    0xcca(%rip),%rsi
mov    %r14,%rdi
call   1080 <strpbrk@plt>
test   %rax,%rax
je     1393 <dos_name2+0x213>
lea    0xcb6(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movb   $0x78,(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1080 <strpbrk@plt>
test   %rax,%rax
jne    1380 <dos_name2+0x200>
lea    0x2cc7(%rip),%rdi
mov    %rsp,%rsi
mov    $0xc,%edx
call   1040 <strncpy@plt>
test   %r14,%r14
jne    13c6 <dos_name2+0x246>
jmp    13ed <dos_name2+0x26d>
lea    0x2cac(%rip),%rdi
lea    0xc4a(%rip),%rsi
call   1050 <strcpy@plt>
test   %r14,%r14
je     13ed <dos_name2+0x26d>
cmpb   $0x0,(%r14)
je     13ed <dos_name2+0x26d>
lea    0x2c8e(%rip),%rbx
lea    0xc62(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10a0 <strcat@plt>
lea    0x2c6d(%rip),%rax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@dos_name2.dev = internal global [9 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i32 0, i32 0)]
@.str = [4 x i8] c"con\00"
@.str.1 = [4 x i8] c"aux\00"
@.str.2 = [5 x i8] c"com1\00"
@.str.3 = [5 x i8] c"com2\00"
@.str.4 = [5 x i8] c"lpt1\00"
@.str.5 = [4 x i8] c"prn\00"
@.str.6 = [5 x i8] c"lpt2\00"
@.str.7 = [5 x i8] c"lpt3\00"
@.str.8 = [4 x i8] c"nul\00"
@dos_name2.ans = internal global [13 x i8] zeroinitializer
@.str.9 = [2 x i8] c"x\00"
@.str.10 = [19 x i8] c"^+=/[]:',?*\\<>|\22. \00"
@.str.11 = [2 x i8] c".\00"
define i8* @dos_name2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [128 x i8]
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %2
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%10 = load i8*, i8** %2
%11 = call i32 @strncpy(i8* %9, i8* %10, i32 127)
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
store i8* %12, i8** %5
store i8* null, i8** %4
store i32 0, i32* %8
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%14 = call i32 @strlen(i8* %13)
%15 = sub nsw i32 %14, 1
store i32 %15, i32* %7
br label %16
16: ; preds = %54, %1
%17 = load i32, i32* %7
%18 = icmp sge i32 %17, 0
br i1 %18, label %19, label %57
19: ; preds = %16
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 46
br i1 %25, label %26, label %37
26: ; preds = %19
%27 = load i32, i32* %8
%28 = icmp ne i32 %27, 0
br i1 %28, label %37, label %29
29: ; preds = %26
store i32 1, i32* %8
%30 = load i32, i32* %7
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 %31
store i8 0, i8* %32
%33 = load i32, i32* %7
%34 = add nsw i32 %33, 1
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 %35
store i8* %36, i8** %4
br label %37
37: ; preds = %29, %26, %19
%38 = load i32, i32* %7
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 %39
%41 = load i8, i8* %40
%42 = call i64 @isupper(i8 zeroext %41)
%43 = icmp ne i64 %42, 0
br i1 %43, label %44, label %53
44: ; preds = %37
%45 = load i32, i32* %7
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 %46
%48 = load i8, i8* %47
%49 = call signext i8 @tolower(i8 zeroext %48)
%50 = load i32, i32* %7
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 %51
store i8 %49, i8* %52
br label %53
53: ; preds = %44, %37
br label %54
54: ; preds = %53
%55 = load i32, i32* %7
%56 = add nsw i32 %55, -1
store i32 %56, i32* %7
br label %16
57: ; preds = %16
%58 = load i8*, i8** %5
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = icmp eq i32 %60, 0
br i1 %61, label %62, label %64
62: ; preds = %57
%63 = call i32 @strcpy(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @dos_name2.ans, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %121
64: ; preds = %57
store i32 0, i32* %7
br label %65
65: ; preds = %79, %64
%66 = load i32, i32* %7
%67 = icmp slt i32 %66, 9
br i1 %67, label %68, label %82
68: ; preds = %65
%69 = load i8*, i8** %5
%70 = load i32, i32* %7
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [9 x i8*], [9 x i8*]* @dos_name2.dev, i64 0, i64 %71
%73 = load i8*, i8** %72
%74 = call i32 @strcasecmp(i8* %69, i8* %73)
%75 = icmp ne i32 %74, 0
br i1 %75, label %78, label %76
76: ; preds = %68
%77 = load i8*, i8** %5
store i8 120, i8* %77
br label %78
78: ; preds = %76, %68
br label %79
79: ; preds = %78
%80 = load i32, i32* %7
%81 = add nsw i32 %80, 1
store i32 %81, i32* %7
br label %65
82: ; preds = %65
%83 = load i8*, i8** %5
%84 = call i32 @strlen(i8* %83)
%85 = icmp sgt i32 %84, 8
br i1 %85, label %86, label %89
86: ; preds = %82
%87 = load i8*, i8** %5
%88 = getelementptr inbounds i8, i8* %87, i64 8
store i8 0, i8* %88
br label %89
89: ; preds = %86, %82
%90 = load i8*, i8** %4
%91 = icmp ne i8* %90, null
br i1 %91, label %92, label %99
92: ; preds = %89
%93 = load i8*, i8** %4
%94 = call i32 @strlen(i8* %93)
%95 = icmp sgt i32 %94, 3
br i1 %95, label %96, label %99
96: ; preds = %92
%97 = load i8*, i8** %4
%98 = getelementptr inbounds i8, i8* %97, i64 3
store i8 0, i8* %98
br label %99
99: ; preds = %96, %92, %89
br label %100
100: ; preds = %104, %99
%101 = load i8*, i8** %5
%102 = call i8* @strpbrk(i8* %101, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0))
store i8* %102, i8** %3
%103 = icmp ne i8* %102, null
br i1 %103, label %104, label %106
104: ; preds = %100
%105 = load i8*, i8** %3
store i8 120, i8* %105
br label %100
106: ; preds = %100
br label %107
107: ; preds = %116, %106
%108 = load i8*, i8** %4
%109 = icmp ne i8* %108, null
br i1 %109, label %110, label %114
110: ; preds = %107
%111 = load i8*, i8** %4
%112 = call i8* @strpbrk(i8* %111, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0))
store i8* %112, i8** %3
%113 = icmp ne i8* %112, null
br label %114
114: ; preds = %110, %107
%115 = phi i1 [ false, %107 ], [ %113, %110 ]
br i1 %115, label %116, label %118
116: ; preds = %114
%117 = load i8*, i8** %3
store i8 120, i8* %117
br label %107
118: ; preds = %114
%119 = load i8*, i8** %5
%120 = call i32 @strncpy(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @dos_name2.ans, i64 0, i64 0), i8* %119, i32 12)
br label %121
121: ; preds = %118, %62
%122 = load i8*, i8** %4
%123 = icmp ne i8* %122, null
br i1 %123, label %124, label %133
124: ; preds = %121
%125 = load i8*, i8** %4
%126 = load i8, i8* %125
%127 = sext i8 %126 to i32
%128 = icmp ne i32 %127, 0
br i1 %128, label %129, label %133
129: ; preds = %124
%130 = call i32 @strcat(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @dos_name2.ans, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%131 = load i8*, i8** %4
%132 = call i32 @strcat(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @dos_name2.ans, i64 0, i64 0), i8* %131)
br label %133
133: ; preds = %129, %124, %121
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @dos_name2.ans, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"con\00"
@.str.1 = [4 x i8] c"aux\00"
@.str.2 = [5 x i8] c"com1\00"
@.str.3 = [5 x i8] c"com2\00"
@.str.4 = [5 x i8] c"lpt1\00"
@.str.5 = [4 x i8] c"prn\00"
@.str.6 = [5 x i8] c"lpt2\00"
@.str.7 = [5 x i8] c"lpt3\00"
@.str.8 = [4 x i8] c"nul\00"
@dos_name2.ans = internal global [13 x i8] zeroinitializer
@.str.9 = [2 x i8] c"x\00"
@.str.10 = [19 x i8] c"^+=/[]:',?*\\<>|\22. \00"
@.str.11 = [2 x i8] c".\00"
define i8* @dos_name2(i8* %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @strncpy(i8* %3, i8* %0, i32 127)
%5 = call i32 @strlen(i8* %3)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %33
7: ; preds = %1
%8 = zext i32 %5 to i64
br label %9
9: ; preds = %7, %31
%10 = phi i64 [ %8, %7 ], [ %13, %31 ]
%11 = phi i32 [ 0, %7 ], [ %25, %31 ]
%12 = phi i8* [ null, %7 ], [ %24, %31 ]
%13 = add nsw i64 %10, -1
%14 = and i64 %13, 4294967295
%15 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = icmp ne i8 %16, 46
%18 = icmp ne i32 %11, 0
%19 = select i1 %17, i1 true, i1 %18
br i1 %19, label %22, label %20
20: ; preds = %9
store i8 0, i8* %15
%21 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 %10
br label %22
22: ; preds = %20, %9
%23 = phi i8 [ %16, %9 ], [ 0, %20 ]
%24 = phi i8* [ %12, %9 ], [ %21, %20 ]
%25 = phi i32 [ %11, %9 ], [ 1, %20 ]
%26 = call i64 @isupper(i8 zeroext %23)
%27 = icmp eq i64 %26, 0
br i1 %27, label %31, label %28
28: ; preds = %22
%29 = load i8, i8* %15
%30 = call signext i8 @tolower(i8 zeroext %29)
store i8 %30, i8* %15
br label %31
31: ; preds = %22, %28
%32 = icmp ugt i64 %10, 1
br i1 %32, label %9, label %33
33: ; preds = %31, %1
%34 = phi i8* [ null, %1 ], [ %24, %31 ]
%35 = load i8, i8* %3
%36 = icmp eq i8 %35, 0
br i1 %36, label %40, label %37
37: ; preds = %33
%38 = call i32 @strcasecmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%39 = icmp eq i32 %38, 0
br i1 %39, label %42, label %43
40: ; preds = %33
%41 = call i32 @strcpy(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @dos_name2.ans, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %104
42: ; preds = %37
store i8 120, i8* %3
br label %43
43: ; preds = %37, %42
%44 = call i32 @strcasecmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %47
46: ; preds = %43
store i8 120, i8* %3
br label %47
47: ; preds = %46, %43
%48 = call i32 @strcasecmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%49 = icmp eq i32 %48, 0
br i1 %49, label %50, label %51
50: ; preds = %47
store i8 120, i8* %3
br label %51
51: ; preds = %50, %47
%52 = call i32 @strcasecmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %55
54: ; preds = %51
store i8 120, i8* %3
br label %55
55: ; preds = %54, %51
%56 = call i32 @strcasecmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%57 = icmp eq i32 %56, 0
br i1 %57, label %58, label %59
58: ; preds = %55
store i8 120, i8* %3
br label %59
59: ; preds = %58, %55
%60 = call i32 @strcasecmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%61 = icmp eq i32 %60, 0
br i1 %61, label %62, label %63
62: ; preds = %59
store i8 120, i8* %3
br label %63
63: ; preds = %62, %59
%64 = call i32 @strcasecmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%65 = icmp eq i32 %64, 0
br i1 %65, label %66, label %67
66: ; preds = %63
store i8 120, i8* %3
br label %67
67: ; preds = %66, %63
%68 = call i32 @strcasecmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%69 = icmp eq i32 %68, 0
br i1 %69, label %70, label %71
70: ; preds = %67
store i8 120, i8* %3
br label %71
71: ; preds = %70, %67
%72 = call i32 @strcasecmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%73 = icmp eq i32 %72, 0
br i1 %73, label %74, label %75
74: ; preds = %71
store i8 120, i8* %3
br label %75
75: ; preds = %74, %71
%76 = call i32 @strlen(i8* %3)
%77 = icmp sgt i32 %76, 8
br i1 %77, label %78, label %80
78: ; preds = %75
%79 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 8
store i8 0, i8* %79
br label %80
80: ; preds = %78, %75
%81 = icmp eq i8* %34, null
br i1 %81, label %87, label %82
82: ; preds = %80
%83 = call i32 @strlen(i8* %34)
%84 = icmp sgt i32 %83, 3
br i1 %84, label %85, label %87
85: ; preds = %82
%86 = getelementptr inbounds i8, i8* %34, i64 3
store i8 0, i8* %86
br label %87
87: ; preds = %85, %82, %80
%88 = call i8* @strpbrk(i8* %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0))
%89 = icmp eq i8* %88, null
br i1 %89, label %90, label %94
90: ; preds = %94, %87
br i1 %81, label %102, label %91
91: ; preds = %90
%92 = call i8* @strpbrk(i8* %34, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0))
%93 = icmp eq i8* %92, null
br i1 %93, label %102, label %98
94: ; preds = %87, %94
%95 = phi i8* [ %96, %94 ], [ %88, %87 ]
store i8 120, i8* %95
%96 = call i8* @strpbrk(i8* %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0))
%97 = icmp eq i8* %96, null
br i1 %97, label %90, label %94
98: ; preds = %91, %98
%99 = phi i8* [ %100, %98 ], [ %92, %91 ]
store i8 120, i8* %99
%100 = call i8* @strpbrk(i8* %34, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0))
%101 = icmp eq i8* %100, null
br i1 %101, label %102, label %98
102: ; preds = %98, %91, %90
%103 = call i32 @strncpy(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @dos_name2.ans, i64 0, i64 0), i8* %3, i32 12)
br label %104
104: ; preds = %102, %40
%105 = icmp eq i8* %34, null
br i1 %105, label %112, label %106
106: ; preds = %104
%107 = load i8, i8* %34
%108 = icmp eq i8 %107, 0
br i1 %108, label %112, label %109
109: ; preds = %106
%110 = call i32 @strcat(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @dos_name2.ans, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%111 = call i32 @strcat(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @dos_name2.ans, i64 0, i64 0), i8* %34)
br label %112
112: ; preds = %109, %106, %104
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @dos_name2.ans, i64 0, i64 0)
}