#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int load_cities(char **);
int /*<<< orphan*/ load_input(char **, char *);
int /*<<< orphan*/ print_enable(char *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sort(char *, int);
int /*<<< orphan*/ stderr;
scalar_t__ strlen(char *);
int test_input(int, char **);
int main(int argc, char *argv[]) {
  char cities[42][101];
  int cities_count = 0;
  int input_len = test_input(argc, argv);
  char input[input_len];
  if (input_len > 0) {
    load_input(argv, input);
  } else if (input_len == -1) {
    fprintf(stderr, "Error: Invalid input!\n");
    return EXIT_FAILURE;
  } else {
    fprintf(stderr, "Warning: No input parameter detected!\n");
  }
  cities_count = load_cities(cities);
  if (cities_count > 42) {
    fprintf(
        stderr,
        "Error: Cities count is bigger than 42! Program won't accept it!\n");
    return EXIT_FAILURE;
  } else if (cities_count == -1) {
    fprintf(stderr, "Error: Cities input is not valid ASCII characters!\n");
    return EXIT_FAILURE;
  }
  char result_chars[cities_count + 1];
  int result_count = 0;
  int i = 0;
  int found = 0;
  int prefix_found = 0;
  int prefix_id = 0;
  while (i < cities_count) {
    if (strlen(cities[i]) == strlen(input)) {
      int equal = 1;
      int z = 0;
      while (cities[i][z] != '\0') {
        if (input[z] == cities[i][z]) {
        } else {
          equal = 0;
          break;
        }
        z++;
      }
      if (equal == 1 && input_len != 0 && found == 0) {
        found = 1;
        printf("Found: %s\n", input);
      }
    } else if (strlen(cities[i]) > strlen(input)) {
      int equal = 1;
      int z = 0;
      while (input[z] != '\0') {
        if (input[z] == cities[i][z]) {
        } else {
          equal = 0;
          break;
        }
        z++;
      }
      if (equal == 1) {
        prefix_found++;
        prefix_id = i;
        int exist = 0;
        for (int y = 0; y < result_count; y++) {
          if (result_chars[y] == cities[i][z]) {
            exist = 1;
            break;
          }
        }
        if (exist == 0)
          result_chars[result_count++] = cities[i][z];
      }
    }
    i++;
  }
  if (prefix_found == 1 && found == 0) {
    printf("Found: %s\n", cities[prefix_id]);
  } else if (result_count > 0) {
    sort(result_chars, result_count);
    print_enable(result_chars, result_count);
  } else if (found == 0) {
    printf("Not found\n");
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1130,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x10b4(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <test_input@plt>
mov    %eax,-0x10b8(%rbp)
mov    -0x10b8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10c0(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x1110(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x10c8(%rbp)
cmpl   $0x0,-0x10b8(%rbp)
jle    1209 <main+0x89>
mov    -0x1110(%rbp),%rsi
mov    -0x10(%rbp),%rdi
call   10a0 <load_input@plt>
jmp    1260 <main+0xe0>
cmpl   $0xffffffff,-0x10b8(%rbp)
jne    1246 <main+0xc6>
mov    0x2dc3(%rip),%rax
mov    (%rax),%edi
lea    0xdda(%rip),%rsi
call   1070 <fprintf@plt>
mov    0x2da6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x10cc(%rbp)
jmp    172b <main+0x5ab>
mov    0x2d93(%rip),%rax
mov    (%rax),%edi
lea    0xdc1(%rip),%rsi
call   1070 <fprintf@plt>
jmp    1260 <main+0xe0>
lea    -0x10b0(%rbp),%rdi
call   1090 <load_cities@plt>
mov    %eax,-0x10b4(%rbp)
cmpl   $0x2a,-0x10b4(%rbp)
jle    12af <main+0x12f>
mov    0x2d5a(%rip),%rax
mov    (%rax),%edi
lea    0xdaf(%rip),%rsi
call   1070 <fprintf@plt>
mov    0x2d3d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x10cc(%rbp)
jmp    172b <main+0x5ab>
cmpl   $0xffffffff,-0x10b4(%rbp)
jne    12ec <main+0x16c>
mov    0x2d1d(%rip),%rax
mov    (%rax),%edi
lea    0xdb3(%rip),%rsi
call   1070 <fprintf@plt>
mov    0x2d00(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x10cc(%rbp)
jmp    172b <main+0x5ab>
jmp    12f1 <main+0x171>
mov    -0x10b4(%rbp),%eax
add    $0x1,%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x1118(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x10d8(%rbp)
movl   $0x0,-0x10dc(%rbp)
movl   $0x0,-0x10e0(%rbp)
movl   $0x0,-0x10e4(%rbp)
movl   $0x0,-0x10e8(%rbp)
movl   $0x0,-0x10ec(%rbp)
mov    -0x10e0(%rbp),%eax
cmp    -0x10b4(%rbp),%eax
jge    1678 <main+0x4f8>
movslq -0x10e0(%rbp),%rax
lea    -0x10b0(%rbp),%rdi
imul   $0x65,%rax,%rax
add    %rax,%rdi
call   1030 <strlen@plt>
mov    -0x1110(%rbp),%rdi
mov    %rax,-0x1120(%rbp)
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x1120(%rbp),%rax
cmp    %rcx,%rax
jne    148a <main+0x30a>
movl   $0x1,-0x10f0(%rbp)
movl   $0x0,-0x10f4(%rbp)
movslq -0x10e0(%rbp),%rcx
lea    -0x10b0(%rbp),%rax
imul   $0x65,%rcx,%rcx
add    %rcx,%rax
movslq -0x10f4(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     143f <main+0x2bf>
mov    -0x1110(%rbp),%rax
movslq -0x10f4(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movslq -0x10e0(%rbp),%rdx
lea    -0x10b0(%rbp),%rcx
imul   $0x65,%rdx,%rdx
add    %rdx,%rcx
movslq -0x10f4(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    141c <main+0x29c>
jmp    142b <main+0x2ab>
movl   $0x0,-0x10f0(%rbp)
jmp    143f <main+0x2bf>
mov    -0x10f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10f4(%rbp)
jmp    13b4 <main+0x234>
cmpl   $0x1,-0x10f0(%rbp)
jne    1485 <main+0x305>
cmpl   $0x0,-0x10b8(%rbp)
je     1485 <main+0x305>
cmpl   $0x0,-0x10e4(%rbp)
jne    1485 <main+0x305>
mov    -0x1110(%rbp),%rsi
movl   $0x1,-0x10e4(%rbp)
lea    0xc35(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1664 <main+0x4e4>
movslq -0x10e0(%rbp),%rax
lea    -0x10b0(%rbp),%rdi
imul   $0x65,%rax,%rax
add    %rax,%rdi
call   1030 <strlen@plt>
mov    -0x1110(%rbp),%rdi
mov    %rax,-0x1128(%rbp)
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x1128(%rbp),%rax
cmp    %rcx,%rax
jle    165f <main+0x4df>
movl   $0x1,-0x10f8(%rbp)
movl   $0x0,-0x10fc(%rbp)
mov    -0x1110(%rbp),%rax
movslq -0x10fc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     155b <main+0x3db>
mov    -0x1110(%rbp),%rax
movslq -0x10fc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movslq -0x10e0(%rbp),%rdx
lea    -0x10b0(%rbp),%rcx
imul   $0x65,%rdx,%rdx
add    %rdx,%rcx
movslq -0x10fc(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1538 <main+0x3b8>
jmp    1547 <main+0x3c7>
movl   $0x0,-0x10f8(%rbp)
jmp    155b <main+0x3db>
mov    -0x10fc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10fc(%rbp)
jmp    14de <main+0x35e>
cmpl   $0x1,-0x10f8(%rbp)
jne    165a <main+0x4da>
mov    -0x10e8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10e8(%rbp)
mov    -0x10e0(%rbp),%eax
mov    %eax,-0x10ec(%rbp)
movl   $0x0,-0x1100(%rbp)
movl   $0x0,-0x1104(%rbp)
mov    -0x1104(%rbp),%eax
cmp    -0x10dc(%rbp),%eax
jge    160b <main+0x48b>
mov    -0x1118(%rbp),%rax
movslq -0x1104(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movslq -0x10e0(%rbp),%rdx
lea    -0x10b0(%rbp),%rcx
imul   $0x65,%rdx,%rdx
add    %rdx,%rcx
movslq -0x10fc(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    15f2 <main+0x472>
movl   $0x1,-0x1100(%rbp)
jmp    160b <main+0x48b>
jmp    15f7 <main+0x477>
mov    -0x1104(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1104(%rbp)
jmp    1597 <main+0x417>
cmpl   $0x0,-0x1100(%rbp)
jne    1655 <main+0x4d5>
mov    -0x1118(%rbp),%rax
movslq -0x10e0(%rbp),%rdx
lea    -0x10b0(%rbp),%rcx
imul   $0x65,%rdx,%rdx
add    %rdx,%rcx
movslq -0x10fc(%rbp),%rdx
mov    (%rcx,%rdx,1),%dl
mov    -0x10dc(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x10dc(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    165a <main+0x4da>
jmp    165f <main+0x4df>
jmp    1664 <main+0x4e4>
mov    -0x10e0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10e0(%rbp)
jmp    134e <main+0x1ce>
cmpl   $0x1,-0x10e8(%rbp)
jne    16ba <main+0x53a>
cmpl   $0x0,-0x10e4(%rbp)
jne    16ba <main+0x53a>
movslq -0x10ec(%rbp),%rax
lea    -0x10b0(%rbp),%rsi
imul   $0x65,%rax,%rax
add    %rax,%rsi
lea    0xa05(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1715 <main+0x595>
cmpl   $0x0,-0x10dc(%rbp)
jle    16f0 <main+0x570>
mov    -0x1118(%rbp),%rdi
mov    -0x10dc(%rbp),%esi
call   1050 <sort@plt>
mov    -0x1118(%rbp),%rdi
mov    -0x10dc(%rbp),%esi
call   1080 <print_enable@plt>
jmp    1710 <main+0x590>
cmpl   $0x0,-0x10e4(%rbp)
jne    170b <main+0x58b>
lea    0x9ba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1710 <main+0x590>
jmp    1715 <main+0x595>
mov    0x28b4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x10cc(%rbp)
mov    -0x10c0(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10c8,%rsp
mov    %rsi,%rbx
call   1070 <test_input@plt>
mov    %eax,%r12d
mov    %rsp,%r14
mov    %eax,%eax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%r15
sub    %rax,%r15
mov    %r15,%rsp
test   %r12d,%r12d
jle    11d7 <main+0x47>
mov    %rbx,%rdi
mov    %r15,%rsi
call   10b0 <load_input@plt>
jmp    11f6 <main+0x66>
mov    0x2e02(%rip),%rax
mov    (%rax),%edi
cmp    $0xffffffff,%r12d
je     13d8 <main+0x248>
lea    0xe26(%rip),%rsi
call   1080 <fprintf@plt>
lea    -0x10f0(%rbp),%rbx
mov    %rbx,%rdi
call   10a0 <load_cities@plt>
cmp    $0x2b,%eax
jl     121f <main+0x8f>
mov    0x2dcf(%rip),%rax
mov    (%rax),%edi
lea    0xe24(%rip),%rsi
jmp    13df <main+0x24f>
cmp    $0xffffffff,%eax
je     13c6 <main+0x236>
lea    0x1(%rax),%ecx
mov    %rsp,%rdx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%rdx
mov    %rdx,-0x40(%rbp)
mov    %rdx,%rsp
test   %eax,%eax
jle    1428 <main+0x298>
mov    %r12d,-0x44(%rbp)
mov    %r14,-0x50(%rbp)
mov    %eax,%eax
mov    %rax,-0x58(%rbp)
xor    %r12d,%r12d
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x2c(%rbp)
jmp    12b2 <main+0x122>
mov    -0x2c(%rbp),%edx
movslq %edx,%rcx
add    $0x1,%edx
mov    %edx,-0x2c(%rbp)
mov    -0x40(%rbp),%rdx
mov    %al,(%rdx,%rcx,1)
mov    %r12d,%eax
mov    %r12d,-0x30(%rbp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r12
add    $0x65,%rbx
cmp    -0x58(%rbp),%r12
je     138b <main+0x1fb>
imul   $0x65,%r12,%rax
lea    (%rax,%rbp,1),%r13
add    $0xffffffffffffef10,%r13
mov    %r13,%rdi
call   1040 <strlen@plt>
mov    %rax,%r14
mov    %r15,%rdi
call   1040 <strlen@plt>
cmp    %rax,%r14
jne    1330 <main+0x1a0>
mov    0x0(%r13),%al
test   %al,%al
je     1303 <main+0x173>
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
cmp    %al,-0x1(%r15,%rcx,1)
jne    12a0 <main+0x110>
movzbl (%rbx,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    12f0 <main+0x160>
cmpl   $0x0,-0x44(%rbp)
je     12a0 <main+0x110>
cmpl   $0x0,-0x34(%rbp)
jne    12a0 <main+0x110>
lea    0xd9d(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
movl   $0x1,-0x34(%rbp)
jmp    12a0 <main+0x110>
nopl   0x0(%rax)
jle    12a0 <main+0x110>
mov    (%r15),%cl
xor    %eax,%eax
test   %cl,%cl
je     1357 <main+0x1c7>
nop
cmp    (%rbx,%rax,1),%cl
jne    12a0 <main+0x110>
movzbl 0x1(%r15,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1340 <main+0x1b0>
mov    %eax,%eax
addl   $0x1,-0x38(%rbp)
mov    (%rax,%r13,1),%al
cmpl   $0x0,-0x2c(%rbp)
jle    1277 <main+0xe7>
mov    -0x2c(%rbp),%ecx
xor    %edx,%edx
mov    -0x40(%rbp),%rsi
cmp    %al,(%rsi,%rdx,1)
je     128a <main+0xfa>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1370 <main+0x1e0>
jmp    1277 <main+0xe7>
cmpl   $0x1,-0x38(%rbp)
mov    -0x34(%rbp),%eax
jne    13ff <main+0x26f>
test   %eax,%eax
jne    13ff <main+0x26f>
movslq -0x30(%rbp),%rax
imul   $0x65,%rax,%rax
lea    (%rax,%rbp,1),%rsi
add    $0xffffffffffffef10,%rsi
lea    0xd01(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2c10(%rip),%rax
mov    -0x50(%rbp),%r14
jmp    13eb <main+0x25b>
mov    0x2c13(%rip),%rax
mov    (%rax),%edi
lea    0xca9(%rip),%rsi
jmp    13df <main+0x24f>
lea    0xc21(%rip),%rsi
call   1080 <fprintf@plt>
mov    0x2bed(%rip),%rax
mov    (%rax),%eax
mov    %r14,%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    -0x2c(%rbp),%ebx
test   %ebx,%ebx
mov    -0x50(%rbp),%r14
jle    1424 <main+0x294>
mov    -0x40(%rbp),%r15
mov    %r15,%rdi
mov    %ebx,%esi
call   1060 <sort@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   1090 <print_enable@plt>
jmp    1434 <main+0x2a4>
test   %eax,%eax
jne    1434 <main+0x2a4>
lea    0xc8f(%rip),%rdi
call   1030 <puts@plt>
mov    0x2b95(%rip),%rax
jmp    13eb <main+0x25b>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Error: Invalid input!\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [39 x i8] c"Warning: No input parameter detected!\0A\00"
@.str.2 = [65 x i8] c"Error: Cities count is bigger than 42! Program won't accept it!\0A\00"
@.str.3 = [52 x i8] c"Error: Cities input is not valid ASCII characters!\0A\00"
@.str.4 = [11 x i8] c"Found: %s\0A\00"
@.str.5 = [11 x i8] c"Not found\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [42 x [101 x i8]]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32
%12 = alloca i64
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%24 = load i32, i32* %4
%25 = load i8**, i8*** %5
%26 = call i32 @test_input(i32 %24, i8** %25)
store i32 %26, i32* %8
%27 = load i32, i32* %8
%28 = zext i32 %27 to i64
%29 = call i8* @llvm.stacksave()
store i8* %29, i8** %9
%30 = alloca i8, i64 %28
store i64 %28, i64* %10
%31 = load i32, i32* %8
%32 = icmp sgt i32 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %2
%34 = load i8**, i8*** %5
%35 = call i32 @load_input(i8** %34, i8* %30)
br label %47
36: ; preds = %2
%37 = load i32, i32* %8
%38 = icmp eq i32 %37, -1
br i1 %38, label %39, label %43
39: ; preds = %36
%40 = load i32, i32* @stderr
%41 = call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%42 = load i32, i32* @EXIT_FAILURE
store i32 %42, i32* %3
store i32 1, i32* %11
br label %242
43: ; preds = %36
%44 = load i32, i32* @stderr
%45 = call i32 @fprintf(i32 %44, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
br label %46
46: ; preds = %43
br label %47
47: ; preds = %46, %33
%48 = getelementptr inbounds [42 x [101 x i8]], [42 x [101 x i8]]* %6, i64 0, i64 0
%49 = bitcast [101 x i8]* %48 to i8**
%50 = call i32 @load_cities(i8** %49)
store i32 %50, i32* %7
%51 = load i32, i32* %7
%52 = icmp sgt i32 %51, 42
br i1 %52, label %53, label %57
53: ; preds = %47
%54 = load i32, i32* @stderr
%55 = call i32 @fprintf(i32 %54, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.2, i64 0, i64 0))
%56 = load i32, i32* @EXIT_FAILURE
store i32 %56, i32* %3
store i32 1, i32* %11
br label %242
57: ; preds = %47
%58 = load i32, i32* %7
%59 = icmp eq i32 %58, -1
br i1 %59, label %60, label %64
60: ; preds = %57
%61 = load i32, i32* @stderr
%62 = call i32 @fprintf(i32 %61, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
%63 = load i32, i32* @EXIT_FAILURE
store i32 %63, i32* %3
store i32 1, i32* %11
br label %242
64: ; preds = %57
br label %65
65: ; preds = %64
%66 = load i32, i32* %7
%67 = add nsw i32 %66, 1
%68 = zext i32 %67 to i64
%69 = alloca i8, i64 %68
store i64 %68, i64* %12
store i32 0, i32* %13
store i32 0, i32* %14
store i32 0, i32* %15
store i32 0, i32* %16
store i32 0, i32* %17
br label %70
70: ; preds = %210, %65
%71 = load i32, i32* %14
%72 = load i32, i32* %7
%73 = icmp slt i32 %71, %72
br i1 %73, label %74, label %213
74: ; preds = %70
%75 = load i32, i32* %14
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [42 x [101 x i8]], [42 x [101 x i8]]* %6, i64 0, i64 %76
%78 = getelementptr inbounds [101 x i8], [101 x i8]* %77, i64 0, i64 0
%79 = call i64 @strlen(i8* %78)
%80 = call i64 @strlen(i8* %30)
%81 = icmp eq i64 %79, %80
br i1 %81, label %82, label %125
82: ; preds = %74
store i32 1, i32* %18
store i32 0, i32* %19
br label %83
83: ; preds = %110, %82
%84 = load i32, i32* %14
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [42 x [101 x i8]], [42 x [101 x i8]]* %6, i64 0, i64 %85
%87 = load i32, i32* %19
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [101 x i8], [101 x i8]* %86, i64 0, i64 %88
%90 = load i8, i8* %89
%91 = sext i8 %90 to i32
%92 = icmp ne i32 %91, 0
br i1 %92, label %93, label %113
93: ; preds = %83
%94 = load i32, i32* %19
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds i8, i8* %30, i64 %95
%97 = load i8, i8* %96
%98 = sext i8 %97 to i32
%99 = load i32, i32* %14
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [42 x [101 x i8]], [42 x [101 x i8]]* %6, i64 0, i64 %100
%102 = load i32, i32* %19
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [101 x i8], [101 x i8]* %101, i64 0, i64 %103
%105 = load i8, i8* %104
%106 = sext i8 %105 to i32
%107 = icmp eq i32 %98, %106
br i1 %107, label %108, label %109
108: ; preds = %93
br label %110
109: ; preds = %93
store i32 0, i32* %18
br label %113
110: ; preds = %108
%111 = load i32, i32* %19
%112 = add nsw i32 %111, 1
store i32 %112, i32* %19
br label %83
113: ; preds = %109, %83
%114 = load i32, i32* %18
%115 = icmp eq i32 %114, 1
br i1 %115, label %116, label %124
116: ; preds = %113
%117 = load i32, i32* %8
%118 = icmp ne i32 %117, 0
br i1 %118, label %119, label %124
119: ; preds = %116
%120 = load i32, i32* %15
%121 = icmp eq i32 %120, 0
br i1 %121, label %122, label %124
122: ; preds = %119
store i32 1, i32* %15
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %30)
br label %124
124: ; preds = %122, %119, %116, %113
br label %210
125: ; preds = %74
%126 = load i32, i32* %14
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds [42 x [101 x i8]], [42 x [101 x i8]]* %6, i64 0, i64 %127
%129 = getelementptr inbounds [101 x i8], [101 x i8]* %128, i64 0, i64 0
%130 = call i64 @strlen(i8* %129)
%131 = call i64 @strlen(i8* %30)
%132 = icmp sgt i64 %130, %131
br i1 %132, label %133, label %209
133: ; preds = %125
store i32 1, i32* %20
store i32 0, i32* %21
br label %134
134: ; preds = %158, %133
%135 = load i32, i32* %21
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds i8, i8* %30, i64 %136
%138 = load i8, i8* %137
%139 = sext i8 %138 to i32
%140 = icmp ne i32 %139, 0
br i1 %140, label %141, label %161
141: ; preds = %134
%142 = load i32, i32* %21
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds i8, i8* %30, i64 %143
%145 = load i8, i8* %144
%146 = sext i8 %145 to i32
%147 = load i32, i32* %14
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds [42 x [101 x i8]], [42 x [101 x i8]]* %6, i64 0, i64 %148
%150 = load i32, i32* %21
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds [101 x i8], [101 x i8]* %149, i64 0, i64 %151
%153 = load i8, i8* %152
%154 = sext i8 %153 to i32
%155 = icmp eq i32 %146, %154
br i1 %155, label %156, label %157
156: ; preds = %141
br label %158
157: ; preds = %141
store i32 0, i32* %20
br label %161
158: ; preds = %156
%159 = load i32, i32* %21
%160 = add nsw i32 %159, 1
store i32 %160, i32* %21
br label %134
161: ; preds = %157, %134
%162 = load i32, i32* %20
%163 = icmp eq i32 %162, 1
br i1 %163, label %164, label %208
164: ; preds = %161
%165 = load i32, i32* %16
%166 = add nsw i32 %165, 1
store i32 %166, i32* %16
%167 = load i32, i32* %14
store i32 %167, i32* %17
store i32 0, i32* %22
store i32 0, i32* %23
br label %168
168: ; preds = %189, %164
%169 = load i32, i32* %23
%170 = load i32, i32* %13
%171 = icmp slt i32 %169, %170
br i1 %171, label %172, label %192
172: ; preds = %168
%173 = load i32, i32* %23
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds i8, i8* %69, i64 %174
%176 = load i8, i8* %175
%177 = sext i8 %176 to i32
%178 = load i32, i32* %14
%179 = sext i32 %178 to i64
%180 = getelementptr inbounds [42 x [101 x i8]], [42 x [101 x i8]]* %6, i64 0, i64 %179
%181 = load i32, i32* %21
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds [101 x i8], [101 x i8]* %180, i64 0, i64 %182
%184 = load i8, i8* %183
%185 = sext i8 %184 to i32
%186 = icmp eq i32 %177, %185
br i1 %186, label %187, label %188
187: ; preds = %172
store i32 1, i32* %22
br label %192
188: ; preds = %172
br label %189
189: ; preds = %188
%190 = load i32, i32* %23
%191 = add nsw i32 %190, 1
store i32 %191, i32* %23
br label %168
192: ; preds = %187, %168
%193 = load i32, i32* %22
%194 = icmp eq i32 %193, 0
br i1 %194, label %195, label %207
195: ; preds = %192
%196 = load i32, i32* %14
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds [42 x [101 x i8]], [42 x [101 x i8]]* %6, i64 0, i64 %197
%199 = load i32, i32* %21
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds [101 x i8], [101 x i8]* %198, i64 0, i64 %200
%202 = load i8, i8* %201
%203 = load i32, i32* %13
%204 = add nsw i32 %203, 1
store i32 %204, i32* %13
%205 = sext i32 %203 to i64
%206 = getelementptr inbounds i8, i8* %69, i64 %205
store i8 %202, i8* %206
br label %207
207: ; preds = %195, %192
br label %208
208: ; preds = %207, %161
br label %209
209: ; preds = %208, %125
br label %210
210: ; preds = %209, %124
%211 = load i32, i32* %14
%212 = add nsw i32 %211, 1
store i32 %212, i32* %14
br label %70
213: ; preds = %70
%214 = load i32, i32* %16
%215 = icmp eq i32 %214, 1
br i1 %215, label %216, label %225
216: ; preds = %213
%217 = load i32, i32* %15
%218 = icmp eq i32 %217, 0
br i1 %218, label %219, label %225
219: ; preds = %216
%220 = load i32, i32* %17
%221 = sext i32 %220 to i64
%222 = getelementptr inbounds [42 x [101 x i8]], [42 x [101 x i8]]* %6, i64 0, i64 %221
%223 = getelementptr inbounds [101 x i8], [101 x i8]* %222, i64 0, i64 0
%224 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %223)
br label %240
225: ; preds = %216, %213
%226 = load i32, i32* %13
%227 = icmp sgt i32 %226, 0
br i1 %227, label %228, label %233
228: ; preds = %225
%229 = load i32, i32* %13
%230 = call i32 @sort(i8* %69, i32 %229)
%231 = load i32, i32* %13
%232 = call i32 @print_enable(i8* %69, i32 %231)
br label %239
233: ; preds = %225
%234 = load i32, i32* %15
%235 = icmp eq i32 %234, 0
br i1 %235, label %236, label %238
236: ; preds = %233
%237 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
br label %238
238: ; preds = %236, %233
br label %239
239: ; preds = %238, %228
br label %240
240: ; preds = %239, %219
%241 = load i32, i32* @EXIT_SUCCESS
store i32 %241, i32* %3
store i32 1, i32* %11
br label %242
242: ; preds = %240, %60, %53, %39
%243 = load i8*, i8** %9
%244 = load i32, i32* %3
ret i32 %244
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Error: Invalid input!\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [39 x i8] c"Warning: No input parameter detected!\0A\00"
@.str.2 = [65 x i8] c"Error: Cities count is bigger than 42! Program won't accept it!\0A\00"
@.str.3 = [52 x i8] c"Error: Cities input is not valid ASCII characters!\0A\00"
@.str.4 = [11 x i8] c"Found: %s\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [10 x i8] c"Not found\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [42 x [101 x i8]]
%4 = getelementptr inbounds [42 x [101 x i8]], [42 x [101 x i8]]* %3, i64 0, i64 0, i64 0
%5 = tail call i32 @test_input(i32 %0, i8** %1)
%6 = zext i32 %5 to i64
%7 = tail call i8* @llvm.stacksave()
%8 = alloca i8, i64 %6
%9 = icmp sgt i32 %5, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @load_input(i8** %1, i8* %8)
br label %19
12: ; preds = %2
%13 = icmp eq i32 %5, -1
%14 = load i32, i32* @stderr
br i1 %13, label %15, label %17
15: ; preds = %12
%16 = tail call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %129
17: ; preds = %12
%18 = tail call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %10
%20 = bitcast [42 x [101 x i8]]* %3 to i8**
%21 = call i32 @load_cities(i8** %20)
%22 = icmp sgt i32 %21, 42
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = load i32, i32* @stderr
%25 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.2, i64 0, i64 0))
br label %129
26: ; preds = %19
%27 = icmp eq i32 %21, -1
br i1 %27, label %28, label %31
28: ; preds = %26
%29 = load i32, i32* @stderr
%30 = call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
br label %129
31: ; preds = %26
%32 = add nsw i32 %21, 1
%33 = zext i32 %32 to i64
%34 = alloca i8, i64 %33
%35 = icmp sgt i32 %21, 0
br i1 %35, label %36, label %127
36: ; preds = %31
%37 = icmp ne i32 %5, 0
%38 = zext i32 %21 to i64
br label %39
39: ; preds = %36, %106
%40 = phi i64 [ 0, %36 ], [ %111, %106 ]
%41 = phi i32 [ 0, %36 ], [ %110, %106 ]
%42 = phi i32 [ 0, %36 ], [ %109, %106 ]
%43 = phi i32 [ 0, %36 ], [ %108, %106 ]
%44 = phi i32 [ 0, %36 ], [ %107, %106 ]
%45 = getelementptr inbounds [42 x [101 x i8]], [42 x [101 x i8]]* %3, i64 0, i64 %40, i64 0
%46 = call i64 @strlen(i8* %45)
%47 = call i64 @strlen(i8* %8)
%48 = icmp eq i64 %46, %47
br i1 %48, label %49, label %68
49: ; preds = %39
%50 = load i8, i8* %45
%51 = icmp eq i8 %50, 0
br i1 %51, label %63, label %56
52: ; preds = %56
%53 = getelementptr inbounds [42 x [101 x i8]], [42 x [101 x i8]]* %3, i64 0, i64 %40, i64 %62
%54 = load i8, i8* %53
%55 = icmp eq i8 %54, 0
br i1 %55, label %63, label %56
56: ; preds = %49, %52
%57 = phi i64 [ %62, %52 ], [ 0, %49 ]
%58 = phi i8 [ %54, %52 ], [ %50, %49 ]
%59 = getelementptr inbounds i8, i8* %8, i64 %57
%60 = load i8, i8* %59
%61 = icmp eq i8 %60, %58
%62 = add nuw i64 %57, 1
br i1 %61, label %52, label %106
63: ; preds = %52, %49
%64 = icmp eq i32 %43, 0
%65 = select i1 %37, i1 %64, i1 false
br i1 %65, label %66, label %106
66: ; preds = %63
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %8)
br label %106
68: ; preds = %39
%69 = icmp sgt i64 %46, %47
br i1 %69, label %70, label %106
70: ; preds = %68
%71 = load i8, i8* %8
%72 = icmp eq i8 %71, 0
br i1 %72, label %84, label %73
73: ; preds = %70, %79
%74 = phi i64 [ %80, %79 ], [ 0, %70 ]
%75 = phi i8 [ %82, %79 ], [ %71, %70 ]
%76 = getelementptr inbounds [42 x [101 x i8]], [42 x [101 x i8]]* %3, i64 0, i64 %40, i64 %74
%77 = load i8, i8* %76
%78 = icmp eq i8 %75, %77
br i1 %78, label %79, label %106
79: ; preds = %73
%80 = add nuw i64 %74, 1
%81 = getelementptr inbounds i8, i8* %8, i64 %80
%82 = load i8, i8* %81
%83 = icmp eq i8 %82, 0
br i1 %83, label %84, label %73
84: ; preds = %79, %70
%85 = phi i64 [ 0, %70 ], [ %80, %79 ]
%86 = and i64 %85, 4294967295
%87 = add nsw i32 %42, 1
%88 = icmp sgt i32 %44, 0
%89 = trunc i64 %40 to i32
%90 = getelementptr inbounds [42 x [101 x i8]], [42 x [101 x i8]]* %3, i64 0, i64 %40, i64 %86
%91 = load i8, i8* %90
br i1 %88, label %92, label %102
92: ; preds = %84
%93 = zext i32 %44 to i64
br label %96
94: ; preds = %96
%95 = icmp eq i64 %101, %93
br i1 %95, label %102, label %96
96: ; preds = %92, %94
%97 = phi i64 [ 0, %92 ], [ %101, %94 ]
%98 = getelementptr inbounds i8, i8* %34, i64 %97
%99 = load i8, i8* %98
%100 = icmp eq i8 %99, %91
%101 = add nuw nsw i64 %97, 1
br i1 %100, label %106, label %94
102: ; preds = %94, %84
%103 = add nsw i32 %44, 1
%104 = sext i32 %44 to i64
%105 = getelementptr inbounds i8, i8* %34, i64 %104
store i8 %91, i8* %105
br label %106
106: ; preds = %73, %96, %56, %102, %63, %66, %68
%107 = phi i32 [ %44, %68 ], [ %44, %66 ], [ %44, %63 ], [ %103, %102 ], [ %44, %56 ], [ %44, %96 ], [ %44, %73 ]
%108 = phi i32 [ %43, %68 ], [ 1, %66 ], [ %43, %63 ], [ %43, %102 ], [ %43, %56 ], [ %43, %96 ], [ %43, %73 ]
%109 = phi i32 [ %42, %68 ], [ %42, %66 ], [ %42, %63 ], [ %87, %102 ], [ %42, %56 ], [ %87, %96 ], [ %42, %73 ]
%110 = phi i32 [ %41, %68 ], [ %41, %66 ], [ %41, %63 ], [ %89, %102 ], [ %41, %56 ], [ %89, %96 ], [ %41, %73 ]
%111 = add nuw nsw i64 %40, 1
%112 = icmp eq i64 %111, %38
br i1 %112, label %113, label %39
113: ; preds = %106
%114 = icmp eq i32 %109, 1
%115 = icmp eq i32 %108, 0
%116 = select i1 %114, i1 %115, i1 false
br i1 %116, label %117, label %121
117: ; preds = %113
%118 = sext i32 %110 to i64
%119 = getelementptr inbounds [42 x [101 x i8]], [42 x [101 x i8]]* %3, i64 0, i64 %118, i64 0
%120 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %119)
br label %129
121: ; preds = %113
%122 = icmp sgt i32 %107, 0
br i1 %122, label %123, label %126
123: ; preds = %121
%124 = call i32 @sort(i8* %34, i32 %107)
%125 = call i32 @print_enable(i8* %34, i32 %107)
br label %129
126: ; preds = %121
br i1 %115, label %127, label %129
127: ; preds = %31, %126
%128 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
br label %129
129: ; preds = %117, %126, %127, %123, %28, %23, %15
%130 = phi i32* [ @EXIT_FAILURE, %23 ], [ @EXIT_FAILURE, %28 ], [ @EXIT_FAILURE, %15 ], [ @EXIT_SUCCESS, %123 ], [ @EXIT_SUCCESS, %127 ], [ @EXIT_SUCCESS, %126 ], [ @EXIT_SUCCESS, %117 ]
%131 = load i32, i32* %130
ret i32 %131
}