#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned char, int, int,
                           unsigned char);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char *);
int test();
scalar_t__ unlink(char *);
int main(void) {
  char name[256];
  unsigned char map[256], upper[256], lower[256];
  int i, j, c;
  FILE *fd;
  if (test()) {
    printf("There are *.TST files, please remove\n");
    return 0;
  }
  for (i = 0; ++i < 256;) {
    lower[i] = i;
    upper[i] = 0;
  }
  for (i = 256; --i;) {
    map[i] = i;
    strcpy(name, "..TST");
    name[0] = i;
    printf("%d:", i);
    if ((fd = fopen(name, "w")) == 0)
      printf(" open");
    else
      fclose(fd);
    c = test();
    if (unlink(name))
      printf(" unlink");
    if (c == i)
      printf(" ok");
    else
      printf(" %d", c);
    printf("\n");
    if (c != i) {
      upper[c]++;
      lower[c] = i;
    }
    map[i] = c;
  }
  printf("\n   valid chars =");
  for (i = 0; ++i < 256;)
    if (map[i] && map[i] != i && lower[map[i]] != i) {
      if (!upper[i])
        printf(" %d:%d %d:%d %d:%d", map[i], i, i, map[i], map[i], map[i]);
      else
        fprintf(stderr, "ignoring map %d->%d because of %d->%d\n", lower[i], i,
                i, map[i]);
    }
  for (i = 0; ++i < 256;)
    if (map[i] && map[i] == i)
      if (upper[i])
        printf(" %d:%d", lower[i], i);
      else
        printf(" %d", i);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1090 <test@plt>
cmp    $0x0,%eax
je     11ac <main+0x3c>
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    158c <main+0x41c>
movl   $0x0,-0x414(%rbp)
mov    -0x414(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x414(%rbp)
cmp    $0x100,%eax
jge    11fa <main+0x8a>
mov    -0x414(%rbp),%eax
mov    %al,%cl
movslq -0x414(%rbp),%rax
mov    %cl,-0x410(%rbp,%rax,1)
movslq -0x414(%rbp),%rax
movb   $0x0,-0x310(%rbp,%rax,1)
jmp    11b6 <main+0x46>
movl   $0x100,-0x414(%rbp)
mov    -0x414(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x414(%rbp)
cmp    $0x0,%eax
je     137b <main+0x20b>
mov    -0x414(%rbp),%eax
mov    %al,%cl
movslq -0x414(%rbp),%rax
mov    %cl,-0x210(%rbp,%rax,1)
lea    -0x110(%rbp),%rdi
lea    0xde6(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x414(%rbp),%eax
mov    %al,-0x110(%rbp)
mov    -0x414(%rbp),%esi
lea    0xdce(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x110(%rbp),%rdi
lea    0xdbd(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x428(%rbp)
cmp    $0x0,%rax
jne    129c <main+0x12c>
lea    0xda2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    12a8 <main+0x138>
mov    -0x428(%rbp),%rdi
call   1050 <fclose@plt>
mov    $0x0,%al
call   1090 <test@plt>
mov    %eax,-0x41c(%rbp)
lea    -0x110(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%rax
je     12d9 <main+0x169>
lea    0xd66(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x41c(%rbp),%eax
cmp    -0x414(%rbp),%eax
jne    12fe <main+0x18e>
lea    0xd4e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1312 <main+0x1a2>
mov    -0x41c(%rbp),%esi
lea    0xd39(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd79(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x41c(%rbp),%eax
cmp    -0x414(%rbp),%eax
je     1360 <main+0x1f0>
movslq -0x41c(%rbp),%rax
mov    -0x310(%rbp,%rax,1),%cl
add    $0x1,%cl
mov    %cl,-0x310(%rbp,%rax,1)
mov    -0x414(%rbp),%eax
mov    %al,%cl
movslq -0x41c(%rbp),%rax
mov    %cl,-0x410(%rbp,%rax,1)
mov    -0x41c(%rbp),%eax
mov    %al,%cl
movslq -0x414(%rbp),%rax
mov    %cl,-0x210(%rbp,%rax,1)
jmp    1204 <main+0x94>
lea    0xcc6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x414(%rbp)
mov    -0x414(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x414(%rbp)
cmp    $0x100,%eax
jge    14c5 <main+0x355>
movslq -0x414(%rbp),%rax
movzbl -0x210(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     14c0 <main+0x350>
movslq -0x414(%rbp),%rax
movzbl -0x210(%rbp,%rax,1),%eax
ff
cmp    -0x414(%rbp),%eax
je     14c0 <main+0x350>
movslq -0x414(%rbp),%rax
movzbl -0x210(%rbp,%rax,1),%eax
ff
movzbl -0x410(%rbp,%rax,1),%eax
ff
cmp    -0x414(%rbp),%eax
je     14c0 <main+0x350>
movslq -0x414(%rbp),%rax
cmpb   $0x0,-0x310(%rbp,%rax,1)
jne    1478 <main+0x308>
movslq -0x414(%rbp),%rax
movzbl -0x210(%rbp,%rax,1),%esi
ff
mov    -0x414(%rbp),%edx
mov    -0x414(%rbp),%ecx
movslq -0x414(%rbp),%rax
movzbl -0x210(%rbp,%rax,1),%r8d
ff ff
movslq -0x414(%rbp),%rax
movzbl -0x210(%rbp,%rax,1),%r9d
ff ff
movslq -0x414(%rbp),%rax
movzbl -0x210(%rbp,%rax,1),%eax
ff
lea    0xbf1(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1060 <printf@plt>
jmp    14bb <main+0x34b>
mov    0x2b61(%rip),%rax
mov    (%rax),%edi
movslq -0x414(%rbp),%rax
mov    -0x410(%rbp,%rax,1),%dl
mov    -0x414(%rbp),%ecx
mov    -0x414(%rbp),%r8d
movslq -0x414(%rbp),%rax
lea    0xbc3(%rip),%rsi
movzbl %dl,%edx
movzbl -0x210(%rbp,%rax,1),%r9d
ff ff
call   1070 <fprintf@plt>
jmp    14c0 <main+0x350>
jmp    1393 <main+0x223>
movl   $0x0,-0x414(%rbp)
mov    -0x414(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x414(%rbp)
cmp    $0x100,%eax
jge    1577 <main+0x407>
movslq -0x414(%rbp),%rax
movzbl -0x210(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     1572 <main+0x402>
movslq -0x414(%rbp),%rax
movzbl -0x210(%rbp,%rax,1),%eax
ff
cmp    -0x414(%rbp),%eax
jne    1572 <main+0x402>
movslq -0x414(%rbp),%rax
cmpb   $0x0,-0x310(%rbp,%rax,1)
je     1559 <main+0x3e9>
movslq -0x414(%rbp),%rax
movzbl -0x410(%rbp,%rax,1),%esi
ff
mov    -0x414(%rbp),%edx
lea    0xb19(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    156d <main+0x3fd>
mov    -0x414(%rbp),%esi
lea    0xade(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1572 <main+0x402>
jmp    14cf <main+0x35f>
lea    0xb14(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
xor    %eax,%eax
call   10b0 <test@plt>
test   %eax,%eax
je     11bd <main+0x2d>
lea    0xfab(%rip),%rdi
call   1060 <puts@plt>
jmp    1536 <main+0x3a6>
xorps  %xmm0,%xmm0
movups %xmm0,0x200(%rsp)
movups %xmm0,0x1f1(%rsp)
movups %xmm0,0x1e1(%rsp)
movups %xmm0,0x1d1(%rsp)
movups %xmm0,0x1c1(%rsp)
movups %xmm0,0x1b1(%rsp)
movups %xmm0,0x1a1(%rsp)
movups %xmm0,0x191(%rsp)
movups %xmm0,0x181(%rsp)
movups %xmm0,0x171(%rsp)
movups %xmm0,0x161(%rsp)
movups %xmm0,0x151(%rsp)
movups %xmm0,0x141(%rsp)
movups %xmm0,0x131(%rsp)
movups %xmm0,0x121(%rsp)
movups %xmm0,0x111(%rsp)
movaps 0xdb9(%rip),%xmm0
movups %xmm0,0x11(%rsp)
movaps 0xdbd(%rip),%xmm0
movups %xmm0,0x21(%rsp)
movaps 0xdc1(%rip),%xmm0
movups %xmm0,0x31(%rsp)
movaps 0xdc5(%rip),%xmm0
movups %xmm0,0x41(%rsp)
movaps 0xdc9(%rip),%xmm0
movups %xmm0,0x51(%rsp)
movaps 0xdcd(%rip),%xmm0
movups %xmm0,0x61(%rsp)
movaps 0xdd1(%rip),%xmm0
movups %xmm0,0x71(%rsp)
movaps 0xdd5(%rip),%xmm0
movups %xmm0,0x81(%rsp)
movaps 0xdd6(%rip),%xmm0
movups %xmm0,0x91(%rsp)
movaps 0xdd7(%rip),%xmm0
movups %xmm0,0xa1(%rsp)
movaps 0xdd8(%rip),%xmm0
movups %xmm0,0xb1(%rsp)
movaps 0xdd9(%rip),%xmm0
movups %xmm0,0xc1(%rsp)
movaps 0xdda(%rip),%xmm0
movups %xmm0,0xd1(%rsp)
movaps 0xddb(%rip),%xmm0
movups %xmm0,0xe1(%rsp)
movaps 0xddc(%rip),%xmm0
movups %xmm0,0xf1(%rsp)
movabs $0xf8f7f6f5f4f3f2f1,%rax
f6 f7 f8
mov    %rax,0x101(%rsp)
movl   $0xfcfbfaf9,0x109(%rsp)
f9 fa fb fc
movw   $0xfefd,0x10d(%rsp)
movb   $0xff,0x10f(%rsp)
ff
mov    $0xff,%ebx
lea    0xda9(%rip),%r14
lea    0x310(%rsp),%r15
lea    0xda0(%rip),%r12
lea    0xd9d(%rip),%r13
jmp    139b <main+0x20b>
nop
lea    0xda7(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movslq %ebp,%rax
addb   $0x1,0x110(%rsp,%rax,1)
01
mov    %bl,0x10(%rsp,%rax,1)
mov    %bpl,0x210(%rsp,%rbx,1)
add    $0xffffffffffffffff,%rbx
je     143a <main+0x2aa>
mov    %bl,0x210(%rsp,%rbx,1)
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <strcpy@plt>
mov    %bl,0x310(%rsp)
mov    %r12,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     13e0 <main+0x250>
mov    %rax,%rdi
call   1070 <fclose@plt>
jmp    13ee <main+0x25e>
nopw   0x0(%rax,%rax,1)
lea    0xd15(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
xor    %eax,%eax
call   10b0 <test@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1040 <unlink@plt>
test   %rax,%rax
je     1412 <main+0x282>
lea    0xcf7(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %ebp,%eax
cmp    %rax,%rbx
jne    1360 <main+0x1d0>
lea    0xce6(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1389 <main+0x1f9>
lea    0xcd1(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x1,%ebx
lea    0xcd0(%rip),%r14
mov    0x2b85(%rip),%r15
lea    0xcd5(%rip),%rbp
jmp    148d <main+0x2fd>
mov    (%r15),%edi
movzbl 0x10(%rsp,%rbx,1),%edx
mov    %rbp,%rsi
mov    %ebx,%ecx
mov    %ebx,%r8d
call   1090 <fprintf@plt>
nopl   0x0(%rax)
add    $0x1,%rbx
cmp    $0x100,%rbx
je     14cf <main+0x33f>
movzbl 0x210(%rsp,%rbx,1),%r9d
test   %r9d,%r9d
je     1480 <main+0x2f0>
cmp    %r9,%rbx
je     1480 <main+0x2f0>
movzbl 0x10(%rsp,%r9,1),%eax
cmp    %rax,%rbx
je     1480 <main+0x2f0>
cmpb   $0x0,0x110(%rsp,%rbx,1)
jne    1464 <main+0x2d4>
mov    %r9d,(%rsp)
mov    %r14,%rdi
mov    %r9d,%esi
mov    %ebx,%edx
mov    %ebx,%ecx
mov    %r9d,%r8d
xor    %eax,%eax
call   1080 <printf@plt>
jmp    1480 <main+0x2f0>
mov    $0x1,%ebx
lea    0xc33(%rip),%r14
lea    0xc4e(%rip),%rbp
jmp    14fd <main+0x36d>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1080 <printf@plt>
add    $0x1,%rbx
cmp    $0x100,%rbx
je     152c <main+0x39c>
movzbl 0x210(%rsp,%rbx,1),%eax
test   %rax,%rax
je     14f0 <main+0x360>
cmp    %rax,%rbx
jne    14f0 <main+0x360>
cmpb   $0x0,0x110(%rsp,%rbx,1)
je     14e4 <main+0x354>
movzbl 0x10(%rsp,%rbx,1),%esi
mov    %rbp,%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1080 <printf@plt>
jmp    14f0 <main+0x360>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [38 x i8] c"There are *.TST files, please remove\0A\00"
@.str.1 = [6 x i8] c"..TST\00"
@.str.2 = [4 x i8] c"%d:\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [6 x i8] c" open\00"
@.str.5 = [8 x i8] c" unlink\00"
@.str.6 = [4 x i8] c" ok\00"
@.str.7 = [4 x i8] c" %d\00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [18 x i8] c"\0A valid chars =\00"
@.str.10 = [19 x i8] c" %d:%d %d:%d %d:%d\00"
@stderr = global i32 0
@.str.11 = [39 x i8] c"ignoring map %d->%d because of %d->%d\0A\00"
@.str.12 = [7 x i8] c" %d:%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = alloca [256 x i8]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
store i32 0, i32* %1
%10 = call i32 (...) @test()
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %210
14: ; preds = %0
store i32 0, i32* %6
br label %15
15: ; preds = %19, %14
%16 = load i32, i32* %6
%17 = add nsw i32 %16, 1
store i32 %17, i32* %6
%18 = icmp slt i32 %17, 256
br i1 %18, label %19, label %28
19: ; preds = %15
%20 = load i32, i32* %6
%21 = trunc i32 %20 to i8
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 %23
store i8 %21, i8* %24
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %26
store i8 0, i8* %27
br label %15
28: ; preds = %15
store i32 256, i32* %6
br label %29
29: ; preds = %86, %28
%30 = load i32, i32* %6
%31 = add nsw i32 %30, -1
store i32 %31, i32* %6
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %92
33: ; preds = %29
%34 = load i32, i32* %6
%35 = trunc i32 %34 to i8
%36 = load i32, i32* %6
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %37
store i8 %35, i8* %38
%39 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%40 = call i32 @strcpy(i8* %39, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%41 = load i32, i32* %6
%42 = trunc i32 %41 to i8
%43 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
store i8 %42, i8* %43
%44 = load i32, i32* %6
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %44)
%46 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%47 = call i32* @fopen(i8* %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %47, i32** %9
%48 = icmp eq i32* %47, null
br i1 %48, label %49, label %51
49: ; preds = %33
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %54
51: ; preds = %33
%52 = load i32*, i32** %9
%53 = call i32 @fclose(i32* %52)
br label %54
54: ; preds = %51, %49
%55 = call i32 (...) @test()
store i32 %55, i32* %8
%56 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%57 = call i64 @unlink(i8* %56)
%58 = icmp ne i64 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %54
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
br label %61
61: ; preds = %59, %54
%62 = load i32, i32* %8
%63 = load i32, i32* %6
%64 = icmp eq i32 %62, %63
br i1 %64, label %65, label %67
65: ; preds = %61
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
br label %70
67: ; preds = %61
%68 = load i32, i32* %8
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %68)
br label %70
70: ; preds = %67, %65
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%72 = load i32, i32* %8
%73 = load i32, i32* %6
%74 = icmp ne i32 %72, %73
br i1 %74, label %75, label %86
75: ; preds = %70
%76 = load i32, i32* %8
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %77
%79 = load i8, i8* %78
%80 = add i8 %79, 1
store i8 %80, i8* %78
%81 = load i32, i32* %6
%82 = trunc i32 %81 to i8
%83 = load i32, i32* %8
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 %84
store i8 %82, i8* %85
br label %86
86: ; preds = %75, %70
%87 = load i32, i32* %8
%88 = trunc i32 %87 to i8
%89 = load i32, i32* %6
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %90
store i8 %88, i8* %91
br label %29
92: ; preds = %29
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %6
br label %94
94: ; preds = %168, %92
%95 = load i32, i32* %6
%96 = add nsw i32 %95, 1
store i32 %96, i32* %6
%97 = icmp slt i32 %96, 256
br i1 %97, label %98, label %169
98: ; preds = %94
%99 = load i32, i32* %6
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %100
%102 = load i8, i8* %101
%103 = zext i8 %102 to i32
%104 = icmp ne i32 %103, 0
br i1 %104, label %105, label %168
105: ; preds = %98
%106 = load i32, i32* %6
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %107
%109 = load i8, i8* %108
%110 = zext i8 %109 to i32
%111 = load i32, i32* %6
%112 = icmp ne i32 %110, %111
br i1 %112, label %113, label %168
113: ; preds = %105
%114 = load i32, i32* %6
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %115
%117 = load i8, i8* %116
%118 = zext i8 %117 to i64
%119 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 %118
%120 = load i8, i8* %119
%121 = zext i8 %120 to i32
%122 = load i32, i32* %6
%123 = icmp ne i32 %121, %122
br i1 %123, label %124, label %168
124: ; preds = %113
%125 = load i32, i32* %6
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %126
%128 = load i8, i8* %127
%129 = icmp ne i8 %128, 0
br i1 %129, label %154, label %130
130: ; preds = %124
%131 = load i32, i32* %6
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %132
%134 = load i8, i8* %133
%135 = zext i8 %134 to i32
%136 = load i32, i32* %6
%137 = load i32, i32* %6
%138 = load i32, i32* %6
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %139
%141 = load i8, i8* %140
%142 = zext i8 %141 to i32
%143 = load i32, i32* %6
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %144
%146 = load i8, i8* %145
%147 = zext i8 %146 to i32
%148 = load i32, i32* %6
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %149
%151 = load i8, i8* %150
%152 = zext i8 %151 to i32
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i32 %135, i32 %136, i32 %137, i32 %142, i32 %147, i32 %152)
br label %167
154: ; preds = %124
%155 = load i32, i32* @stderr
%156 = load i32, i32* %6
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 %157
%159 = load i8, i8* %158
%160 = load i32, i32* %6
%161 = load i32, i32* %6
%162 = load i32, i32* %6
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %163
%165 = load i8, i8* %164
%166 = call i32 @fprintf(i32 %155, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0), i8 zeroext %159, i32 %160, i32 %161, i8 zeroext %165)
br label %167
167: ; preds = %154, %130
br label %168
168: ; preds = %167, %113, %105, %98
br label %94
169: ; preds = %94
store i32 0, i32* %6
br label %170
170: ; preds = %207, %169
%171 = load i32, i32* %6
%172 = add nsw i32 %171, 1
store i32 %172, i32* %6
%173 = icmp slt i32 %172, 256
br i1 %173, label %174, label %208
174: ; preds = %170
%175 = load i32, i32* %6
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %176
%178 = load i8, i8* %177
%179 = zext i8 %178 to i32
%180 = icmp ne i32 %179, 0
br i1 %180, label %181, label %207
181: ; preds = %174
%182 = load i32, i32* %6
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %183
%185 = load i8, i8* %184
%186 = zext i8 %185 to i32
%187 = load i32, i32* %6
%188 = icmp eq i32 %186, %187
br i1 %188, label %189, label %207
189: ; preds = %181
%190 = load i32, i32* %6
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %191
%193 = load i8, i8* %192
%194 = icmp ne i8 %193, 0
br i1 %194, label %195, label %203
195: ; preds = %189
%196 = load i32, i32* %6
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 %197
%199 = load i8, i8* %198
%200 = zext i8 %199 to i32
%201 = load i32, i32* %6
%202 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i32 %200, i32 %201)
br label %206
203: ; preds = %189
%204 = load i32, i32* %6
%205 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %204)
br label %206
206: ; preds = %203, %195
br label %207
207: ; preds = %206, %181, %174
br label %170
208: ; preds = %170
%209 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %1
br label %210
210: ; preds = %208, %12
%211 = load i32, i32* %1
ret i32 %211
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"..TST\00"
@.str.2 = [4 x i8] c"%d:\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [6 x i8] c" open\00"
@.str.5 = [8 x i8] c" unlink\00"
@.str.6 = [4 x i8] c" ok\00"
@.str.7 = [4 x i8] c" %d\00"
@.str.9 = [18 x i8] c"\0A valid chars =\00"
@.str.10 = [19 x i8] c" %d:%d %d:%d %d:%d\00"
@stderr = global i32 0
@.str.11 = [39 x i8] c"ignoring map %d->%d because of %d->%d\0A\00"
@.str.12 = [7 x i8] c" %d:%d\00"
@str = [37 x i8] c"There are *.TST files, please remove\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = alloca [256 x i8]
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%9 = tail call i32 (...) @test()
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %58
11: ; preds = %0
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 1
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 1
%14 = bitcast i8* %13 to <16 x i8>*
store <16 x i8> <i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15, i8 16>, <16 x i8>* %14
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 17
%16 = bitcast i8* %15 to <16 x i8>*
store <16 x i8> <i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31, i8 32>, <16 x i8>* %16
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 33
%18 = bitcast i8* %17 to <16 x i8>*
store <16 x i8> <i8 33, i8 34, i8 35, i8 36, i8 37, i8 38, i8 39, i8 40, i8 41, i8 42, i8 43, i8 44, i8 45, i8 46, i8 47, i8 48>, <16 x i8>* %18
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 49
%20 = bitcast i8* %19 to <16 x i8>*
store <16 x i8> <i8 49, i8 50, i8 51, i8 52, i8 53, i8 54, i8 55, i8 56, i8 57, i8 58, i8 59, i8 60, i8 61, i8 62, i8 63, i8 64>, <16 x i8>* %20
%21 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 65
%22 = bitcast i8* %21 to <16 x i8>*
store <16 x i8> <i8 65, i8 66, i8 67, i8 68, i8 69, i8 70, i8 71, i8 72, i8 73, i8 74, i8 75, i8 76, i8 77, i8 78, i8 79, i8 80>, <16 x i8>* %22
%23 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 81
%24 = bitcast i8* %23 to <16 x i8>*
store <16 x i8> <i8 81, i8 82, i8 83, i8 84, i8 85, i8 86, i8 87, i8 88, i8 89, i8 90, i8 91, i8 92, i8 93, i8 94, i8 95, i8 96>, <16 x i8>* %24
%25 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 97
%26 = bitcast i8* %25 to <16 x i8>*
store <16 x i8> <i8 97, i8 98, i8 99, i8 100, i8 101, i8 102, i8 103, i8 104, i8 105, i8 106, i8 107, i8 108, i8 109, i8 110, i8 111, i8 112>, <16 x i8>* %26
%27 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 113
%28 = bitcast i8* %27 to <16 x i8>*
store <16 x i8> <i8 113, i8 114, i8 115, i8 116, i8 117, i8 118, i8 119, i8 120, i8 121, i8 122, i8 123, i8 124, i8 125, i8 126, i8 127, i8 -128>, <16 x i8>* %28
%29 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 129
%30 = bitcast i8* %29 to <16 x i8>*
store <16 x i8> <i8 -127, i8 -126, i8 -125, i8 -124, i8 -123, i8 -122, i8 -121, i8 -120, i8 -119, i8 -118, i8 -117, i8 -116, i8 -115, i8 -114, i8 -113, i8 -112>, <16 x i8>* %30
%31 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 145
%32 = bitcast i8* %31 to <16 x i8>*
store <16 x i8> <i8 -111, i8 -110, i8 -109, i8 -108, i8 -107, i8 -106, i8 -105, i8 -104, i8 -103, i8 -102, i8 -101, i8 -100, i8 -99, i8 -98, i8 -97, i8 -96>, <16 x i8>* %32
%33 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 161
%34 = bitcast i8* %33 to <16 x i8>*
store <16 x i8> <i8 -95, i8 -94, i8 -93, i8 -92, i8 -91, i8 -90, i8 -89, i8 -88, i8 -87, i8 -86, i8 -85, i8 -84, i8 -83, i8 -82, i8 -81, i8 -80>, <16 x i8>* %34
%35 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 177
%36 = bitcast i8* %35 to <16 x i8>*
store <16 x i8> <i8 -79, i8 -78, i8 -77, i8 -76, i8 -75, i8 -74, i8 -73, i8 -72, i8 -71, i8 -70, i8 -69, i8 -68, i8 -67, i8 -66, i8 -65, i8 -64>, <16 x i8>* %36
%37 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 193
%38 = bitcast i8* %37 to <16 x i8>*
store <16 x i8> <i8 -63, i8 -62, i8 -61, i8 -60, i8 -59, i8 -58, i8 -57, i8 -56, i8 -55, i8 -54, i8 -53, i8 -52, i8 -51, i8 -50, i8 -49, i8 -48>, <16 x i8>* %38
%39 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 209
%40 = bitcast i8* %39 to <16 x i8>*
store <16 x i8> <i8 -47, i8 -46, i8 -45, i8 -44, i8 -43, i8 -42, i8 -41, i8 -40, i8 -39, i8 -38, i8 -37, i8 -36, i8 -35, i8 -34, i8 -33, i8 -32>, <16 x i8>* %40
%41 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 225
%42 = bitcast i8* %41 to <16 x i8>*
store <16 x i8> <i8 -31, i8 -30, i8 -29, i8 -28, i8 -27, i8 -26, i8 -25, i8 -24, i8 -23, i8 -22, i8 -21, i8 -20, i8 -19, i8 -18, i8 -17, i8 -16>, <16 x i8>* %42
%43 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 241
store i8 -15, i8* %43
%44 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 242
store i8 -14, i8* %44
%45 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 243
store i8 -13, i8* %45
%46 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 244
store i8 -12, i8* %46
%47 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 245
store i8 -11, i8* %47
%48 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 246
store i8 -10, i8* %48
%49 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 247
store i8 -9, i8* %49
%50 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 248
store i8 -8, i8* %50
%51 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 249
store i8 -7, i8* %51
%52 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 250
store i8 -6, i8* %52
%53 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 251
store i8 -5, i8* %53
%54 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 252
store i8 -4, i8* %54
%55 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 253
store i8 -3, i8* %55
%56 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 254
store i8 -2, i8* %56
%57 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 255
store i8 -1, i8* %57
br label %60
58: ; preds = %0
%59 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
br label %156
60: ; preds = %11, %93
%61 = phi i64 [ %95, %93 ], [ 255, %11 ]
%62 = trunc i64 %61 to i32
%63 = trunc i64 %61 to i8
%64 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %61
store i8 %63, i8* %64
%65 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i8 %63, i8* %5
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %62)
%67 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%68 = icmp eq i32* %67, null
br i1 %68, label %69, label %71
69: ; preds = %60
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %73
71: ; preds = %60
%72 = call i32 @fclose(i32* %67)
br label %73
73: ; preds = %71, %69
%74 = call i32 (...) @test()
%75 = call i64 @unlink(i8* %5)
%76 = icmp eq i64 %75, 0
br i1 %76, label %79, label %77
77: ; preds = %73
%78 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
br label %79
79: ; preds = %77, %73
%80 = zext i32 %74 to i64
%81 = icmp eq i64 %61, %80
br i1 %81, label %82, label %85
82: ; preds = %79
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%84 = call i32 @putchar(i32 10)
br label %93
85: ; preds = %79
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %74)
%87 = call i32 @putchar(i32 10)
%88 = sext i32 %74 to i64
%89 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %88
%90 = load i8, i8* %89
%91 = add i8 %90, 1
store i8 %91, i8* %89
%92 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %88
store i8 %63, i8* %92
br label %93
93: ; preds = %82, %85
%94 = trunc i32 %74 to i8
store i8 %94, i8* %64
%95 = add nsw i64 %61, -1
%96 = icmp eq i64 %95, 0
br i1 %96, label %97, label %60
97: ; preds = %93
%98 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
br label %99
99: ; preds = %97, %127
%100 = phi i64 [ 1, %97 ], [ %128, %127 ]
%101 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %100
%102 = load i8, i8* %101
%103 = zext i8 %102 to i32
%104 = icmp eq i8 %102, 0
%105 = zext i8 %102 to i64
%106 = icmp eq i64 %100, %105
%107 = select i1 %104, i1 true, i1 %106
br i1 %107, label %127, label %108
108: ; preds = %99
%109 = zext i8 %102 to i64
%110 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %109
%111 = load i8, i8* %110
%112 = zext i8 %111 to i64
%113 = icmp eq i64 %100, %112
br i1 %113, label %127, label %114
114: ; preds = %108
%115 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %100
%116 = load i8, i8* %115
%117 = icmp eq i8 %116, 0
br i1 %117, label %118, label %121
118: ; preds = %114
%119 = trunc i64 %100 to i32
%120 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i32 %103, i32 %119, i32 %119, i32 %103, i32 %103, i32 %103)
br label %127
121: ; preds = %114
%122 = load i32, i32* @stderr
%123 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %100
%124 = load i8, i8* %123
%125 = trunc i64 %100 to i32
%126 = call i32 @fprintf(i32 %122, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0), i8 zeroext %124, i32 %125, i32 %125, i8 zeroext %102)
br label %127
127: ; preds = %118, %121, %108, %99
%128 = add nuw nsw i64 %100, 1
%129 = icmp eq i64 %128, 256
br i1 %129, label %130, label %99
130: ; preds = %127, %151
%131 = phi i64 [ %152, %151 ], [ 1, %127 ]
%132 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %131
%133 = load i8, i8* %132
%134 = icmp ne i8 %133, 0
%135 = zext i8 %133 to i64
%136 = icmp eq i64 %131, %135
%137 = select i1 %134, i1 %136, i1 false
br i1 %137, label %138, label %151
138: ; preds = %130
%139 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %131
%140 = load i8, i8* %139
%141 = icmp eq i8 %140, 0
br i1 %141, label %148, label %142
142: ; preds = %138
%143 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %131
%144 = load i8, i8* %143
%145 = zext i8 %144 to i32
%146 = trunc i64 %131 to i32
%147 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i32 %145, i32 %146)
br label %151
148: ; preds = %138
%149 = trunc i64 %131 to i32
%150 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %149)
br label %151
151: ; preds = %142, %148, %130
%152 = add nuw nsw i64 %131, 1
%153 = icmp eq i64 %152, 256
br i1 %153, label %154, label %130
154: ; preds = %151
%155 = call i32 @putchar(i32 10)
br label %156
156: ; preds = %154, %58
ret i32 0
}