#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 */
void *atoi_2(char *);
int /*<<< orphan*/ clean_text(char *, int);
int /*<<< orphan*/ expand_my(char *, char *);
int getarray_sort(int *, char *);
int /*<<< orphan*/ getline_digit(char *);
int /*<<< orphan*/ getline_my(char *);
int /*<<< orphan*/ itob(int, char *, short);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ reverse_string(char *);
int /*<<< orphan*/ shellsort(int *, int);
void main() {
  char line[100];
  char short_line[30];
  char long_line[300];
  int sort[100];
  int digit = 0;
  int len = 0;
  int i = 0;
  short int base = 0;
  char choise = 0;
  char exit = 0;
  printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
         "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  printf("Choose please what you want to do (press q to exit):\n");
  printf("Variants :\n");
  printf("1. Convert from char to integer.\n");
  printf("2. Shellsorting.\n");
  printf("3. Reverse string.\n");
  printf("4. Expand string.\n");
  printf("5. Convert digit to string which is based on B.\n");
  exit = 0;
  while (exit == 0) {
    getline_my(line);
    choise = line[0];
    switch (choise) {
    case '1':
      clean_text(line, 100);
      printf("Input please chars to convert to integer:\n");
      getline_my(line);
      digit = atoi_2(line);
      printf("Getted digit from char = %d;\n", digit);
      exit = 1;
      break;
    case '2':
      len = getarray_sort(sort, line);
      shellsort(sort, len);
      printf("After sorting array seems so:");
      for (i = 0; i < len; ++i) {
        printf("%d,", sort[i]);
      };
      printf("\n");
      exit = 1;
      break;
    case '3':
      printf("Enter please line to reverse:\n");
      clean_text(line, 100);
      getline_my(line);
      reverse_string(line);
      printf("After reverse string seens so:\n%s\n", line);
      exit = 1;
      break;
    case '4':
      printf("Enter please string:\n");
      clean_text(short_line, 30);
      clean_text(long_line, 300);
      getline_my(short_line);
      expand_my(short_line, long_line);
      printf("After expand line seems so:%s\n", long_line);
      exit = 1;
      break;
    case '5':
      printf("Input please digit to convert:\n");
      clean_text(short_line, 30);
      getline_digit(short_line);
      digit = atoi_2(short_line);
      printf("And now input please base B:\n");
      clean_text(short_line, 30);
      getline_digit(short_line);
      base = atoi_2(short_line);
      clean_text(long_line, 300);
      itob(digit, long_line, base);
      printf("After convert string seems so:\n%s;\n", long_line);
      exit = 1;
      break;
    case 'q':
      exit = 1;
      break;
    default:
      printf("Wrong input, try again.\n");
      break;
    };
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x370,%rsp
movl   $0x0,-0x354(%rbp)
movl   $0x0,-0x358(%rbp)
movl   $0x0,-0x35c(%rbp)
movw   $0x0,-0x35e(%rbp)
movb   $0x0,-0x35f(%rbp)
movb   $0x0,-0x360(%rbp)
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movb   $0x0,-0x360(%rbp)
movsbl -0x360(%rbp),%eax
cmp    $0x0,%eax
jne    1589 <main+0x3e9>
lea    -0x70(%rbp),%rdi
call   1090 <getline_my@plt>
mov    -0x70(%rbp),%al
mov    %al,-0x35f(%rbp)
movsbl -0x35f(%rbp),%eax
mov    %eax,-0x364(%rbp)
sub    $0x31,%eax
je     12f8 <main+0x158>
jmp    1294 <main+0xf4>
mov    -0x364(%rbp),%eax
sub    $0x32,%eax
je     134c <main+0x1ac>
jmp    12a8 <main+0x108>
mov    -0x364(%rbp),%eax
sub    $0x33,%eax
je     13e8 <main+0x248>
jmp    12bc <main+0x11c>
mov    -0x364(%rbp),%eax
sub    $0x34,%eax
je     1434 <main+0x294>
jmp    12d0 <main+0x130>
mov    -0x364(%rbp),%eax
sub    $0x35,%eax
je     14a4 <main+0x304>
jmp    12e4 <main+0x144>
mov    -0x364(%rbp),%eax
sub    $0x71,%eax
je     156a <main+0x3ca>
jmp    1576 <main+0x3d6>
lea    -0x70(%rbp),%rdi
mov    $0x64,%esi
call   10c0 <clean_text@plt>
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1090 <getline_my@plt>
lea    -0x70(%rbp),%rdi
call   1080 <atoi_2@plt>
mov    %eax,-0x354(%rbp)
mov    -0x354(%rbp),%esi
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movb   $0x1,-0x360(%rbp)
jmp    1584 <main+0x3e4>
lea    -0x350(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   10a0 <getarray_sort@plt>
mov    %eax,-0x358(%rbp)
lea    -0x350(%rbp),%rdi
mov    -0x358(%rbp),%esi
call   10b0 <shellsort@plt>
lea    0xdd0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x35c(%rbp)
mov    -0x35c(%rbp),%eax
cmp    -0x358(%rbp),%eax
jge    13ce <main+0x22e>
movslq -0x35c(%rbp),%rax
mov    -0x350(%rbp,%rax,4),%esi
lea    0xdb6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x35c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x35c(%rbp)
jmp    138c <main+0x1ec>
lea    0xc5d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movb   $0x1,-0x360(%rbp)
jmp    1584 <main+0x3e4>
lea    0xd7e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    $0x64,%esi
call   10c0 <clean_text@plt>
lea    -0x70(%rbp),%rdi
call   1090 <getline_my@plt>
lea    -0x70(%rbp),%rdi
call   1040 <reverse_string@plt>
lea    -0x70(%rbp),%rsi
lea    0xd6b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movb   $0x1,-0x360(%rbp)
jmp    1584 <main+0x3e4>
lea    0xd74(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x90(%rbp),%rdi
mov    $0x1e,%esi
call   10c0 <clean_text@plt>
lea    -0x1c0(%rbp),%rdi
mov    $0x12c,%esi
call   10c0 <clean_text@plt>
lea    -0x90(%rbp),%rdi
call   1090 <getline_my@plt>
lea    -0x90(%rbp),%rdi
lea    -0x1c0(%rbp),%rsi
call   1030 <expand_my@plt>
lea    -0x1c0(%rbp),%rsi
lea    0xd34(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movb   $0x1,-0x360(%rbp)
jmp    1584 <main+0x3e4>
lea    0xd39(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x90(%rbp),%rdi
mov    $0x1e,%esi
call   10c0 <clean_text@plt>
lea    -0x90(%rbp),%rdi
call   1050 <getline_digit@plt>
lea    -0x90(%rbp),%rdi
call   1080 <atoi_2@plt>
mov    %eax,-0x354(%rbp)
lea    0xd1c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x90(%rbp),%rdi
mov    $0x1e,%esi
call   10c0 <clean_text@plt>
lea    -0x90(%rbp),%rdi
call   1050 <getline_digit@plt>
lea    -0x90(%rbp),%rdi
call   1080 <atoi_2@plt>
mov    %ax,-0x35e(%rbp)
lea    -0x1c0(%rbp),%rdi
mov    $0x12c,%esi
call   10c0 <clean_text@plt>
mov    -0x354(%rbp),%edi
lea    -0x1c0(%rbp),%rsi
movswl -0x35e(%rbp),%edx
call   1070 <itob@plt>
lea    -0x1c0(%rbp),%rsi
lea    0xccb(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movb   $0x1,-0x360(%rbp)
jmp    1584 <main+0x3e4>
movb   $0x1,-0x360(%rbp)
jmp    1584 <main+0x3e4>
lea    0xcc9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1257 <main+0xb7>
add    $0x370,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x220,%rsp
lea    0xee7(%rip),%rdi
call   1070 <puts@plt>
lea    0xf0e(%rip),%rdi
call   1070 <puts@plt>
lea    0xf37(%rip),%rdi
call   1070 <puts@plt>
lea    0xf36(%rip),%rdi
call   1070 <puts@plt>
lea    0xf4b(%rip),%rdi
call   1070 <puts@plt>
lea    0xf50(%rip),%rdi
call   1070 <puts@plt>
lea    0xf57(%rip),%rdi
call   1070 <puts@plt>
lea    0xf5d(%rip),%rdi
call   1070 <puts@plt>
lea    0x20(%rsp),%rbx
lea    0x1015(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   10b0 <getline_my@plt>
movsbl 0x20(%rsp),%ecx
lea    -0x31(%rcx),%eax
cmp    $0x4,%eax
jbe    1268 <main+0xa8>
cmp    $0x71,%ecx
je     1448 <main+0x288>
mov    %r14,%rdi
call   1070 <puts@plt>
jmp    1240 <main+0x80>
lea    0xd91(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   10e0 <clean_text@plt>
lea    0xf92(%rip),%rdi
call   1070 <puts@plt>
mov    %rbx,%rdi
call   10b0 <getline_my@plt>
mov    %rbx,%rdi
call   10a0 <atoi_2@plt>
lea    0xd67(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
jmp    1448 <main+0x288>
lea    0x90(%rsp),%r14
lea    0x20(%rsp),%rsi
mov    %r14,%rdi
call   10c0 <getarray_sort@plt>
mov    %eax,%ebx
mov    %r14,%rdi
mov    %eax,%esi
call   10d0 <shellsort@plt>
lea    0xd4f(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
test   %ebx,%ebx
jle    131a <main+0x15a>
mov    %ebx,%r15d
lea    0xd58(%rip),%r14
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    0x90(%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1300 <main+0x140>
mov    $0xa,%edi
call   1040 <putchar@plt>
jmp    1448 <main+0x288>
lea    0xed5(%rip),%rdi
call   1070 <puts@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   10e0 <clean_text@plt>
mov    %rbx,%rdi
call   10b0 <getline_my@plt>
mov    %rbx,%rdi
call   1050 <reverse_string@plt>
lea    0xcf6(%rip),%rdi
mov    %rbx,%rsi
jmp    1441 <main+0x281>
lea    0xe83(%rip),%rdi
call   1070 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1e,%esi
call   10e0 <clean_text@plt>
lea    0x90(%rsp),%r14
mov    %r14,%rdi
mov    $0x12c,%esi
call   10e0 <clean_text@plt>
mov    %rbx,%rdi
call   10b0 <getline_my@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <expand_my@plt>
lea    0xcc6(%rip),%rdi
mov    %r14,%rsi
jmp    1441 <main+0x281>
lea    0xdf4(%rip),%rdi
call   1070 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1e,%esi
call   10e0 <clean_text@plt>
mov    %rbx,%rdi
call   1060 <getline_digit@plt>
mov    %rbx,%rdi
call   10a0 <atoi_2@plt>
mov    %rax,%r14
lea    0xde4(%rip),%rdi
call   1070 <puts@plt>
mov    %rbx,%rdi
mov    $0x1e,%esi
call   10e0 <clean_text@plt>
mov    %rbx,%rdi
call   1060 <getline_digit@plt>
mov    %rbx,%rdi
call   10a0 <atoi_2@plt>
mov    %rax,%rbx
lea    0x90(%rsp),%r15
mov    %r15,%rdi
mov    $0x12c,%esi
call   10e0 <clean_text@plt>
movswl %bx,%edx
mov    %r14d,%edi
mov    %r15,%rsi
call   1090 <itob@plt>
lea    0xc58(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
add    $0x220,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [52 x i8] c"\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\00"
@.str.1 = [54 x i8] c"Choose please what you want to do (press q to exit):\0A\00"
@.str.2 = [12 x i8] c"Variants :\0A\00"
@.str.3 = [34 x i8] c"1. Convert from char to integer.\0A\00"
@.str.4 = [18 x i8] c"2. Shellsorting.\0A\00"
@.str.5 = [20 x i8] c"3. Reverse string.\0A\00"
@.str.6 = [19 x i8] c"4. Expand string.\0A\00"
@.str.7 = [49 x i8] c"5. Convert digit to string which is based on B.\0A\00"
@.str.8 = [43 x i8] c"Input please chars to convert to integer:\0A\00"
@.str.9 = [30 x i8] c"Getted digit from char = %d;\0A\00"
@.str.10 = [30 x i8] c"After sorting array seems so:\00"
@.str.11 = [4 x i8] c"%d,\00"
@.str.12 = [2 x i8] c"\0A\00"
@.str.13 = [31 x i8] c"Enter please line to reverse:\0A\00"
@.str.14 = [35 x i8] c"After reverse string seens so:\0A%s\0A\00"
@.str.15 = [22 x i8] c"Enter please string:\0A\00"
@.str.16 = [31 x i8] c"After expand line seems so:%s\0A\00"
@.str.17 = [32 x i8] c"Input please digit to convert:\0A\00"
@.str.18 = [30 x i8] c"And now input please base B:\0A\00"
@.str.19 = [36 x i8] c"After convert string seems so:\0A%s;\0A\00"
@.str.20 = [25 x i8] c"Wrong input, try again.\0A\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca [30 x i8]
%3 = alloca [300 x i8]
%4 = alloca [100 x i32]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i16
%9 = alloca i8
%10 = alloca i8
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i16 0, i16* %8
store i8 0, i8* %9
store i8 0, i8* %10
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0))
store i8 0, i8* %10
br label %19
19: ; preds = %115, %0
%20 = load i8, i8* %10
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %116
23: ; preds = %19
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%25 = call i32 @getline_my(i8* %24)
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%27 = load i8, i8* %26
store i8 %27, i8* %9
%28 = load i8, i8* %9
%29 = sext i8 %28 to i32
switch i32 %29, label %113 [
i32 49, label %30
i32 50, label %41
i32 51, label %64
i32 52, label %74
i32 53, label %87
i32 113, label %112
]
30: ; preds = %23
%31 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%32 = call i32 @clean_text(i8* %31, i32 100)
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0))
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%35 = call i32 @getline_my(i8* %34)
%36 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%37 = call i8* @atoi_2(i8* %36)
%38 = ptrtoint i8* %37 to i32
store i32 %38, i32* %5
%39 = load i32, i32* %5
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0), i32 %39)
store i8 1, i8* %10
br label %115
41: ; preds = %23
%42 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 0
%43 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%44 = call i32 @getarray_sort(i32* %42, i8* %43)
store i32 %44, i32* %6
%45 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 0
%46 = load i32, i32* %6
%47 = call i32 @shellsort(i32* %45, i32 %46)
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %7
br label %49
49: ; preds = %59, %41
%50 = load i32, i32* %7
%51 = load i32, i32* %6
%52 = icmp slt i32 %50, %51
br i1 %52, label %53, label %62
53: ; preds = %49
%54 = load i32, i32* %7
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 %55
%57 = load i32, i32* %56
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i32 %57)
br label %59
59: ; preds = %53
%60 = load i32, i32* %7
%61 = add nsw i32 %60, 1
store i32 %61, i32* %7
br label %49
62: ; preds = %49
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
store i8 1, i8* %10
br label %115
64: ; preds = %23
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.13, i64 0, i64 0))
%66 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%67 = call i32 @clean_text(i8* %66, i32 100)
%68 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%69 = call i32 @getline_my(i8* %68)
%70 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%71 = call i32 @reverse_string(i8* %70)
%72 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.14, i64 0, i64 0), i8* %72)
store i8 1, i8* %10
br label %115
74: ; preds = %23
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.15, i64 0, i64 0))
%76 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%77 = call i32 @clean_text(i8* %76, i32 30)
%78 = getelementptr inbounds [300 x i8], [300 x i8]* %3, i64 0, i64 0
%79 = call i32 @clean_text(i8* %78, i32 300)
%80 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%81 = call i32 @getline_my(i8* %80)
%82 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%83 = getelementptr inbounds [300 x i8], [300 x i8]* %3, i64 0, i64 0
%84 = call i32 @expand_my(i8* %82, i8* %83)
%85 = getelementptr inbounds [300 x i8], [300 x i8]* %3, i64 0, i64 0
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), i8* %85)
store i8 1, i8* %10
br label %115
87: ; preds = %23
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.17, i64 0, i64 0))
%89 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%90 = call i32 @clean_text(i8* %89, i32 30)
%91 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%92 = call i32 @getline_digit(i8* %91)
%93 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%94 = call i8* @atoi_2(i8* %93)
%95 = ptrtoint i8* %94 to i32
store i32 %95, i32* %5
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.18, i64 0, i64 0))
%97 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%98 = call i32 @clean_text(i8* %97, i32 30)
%99 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%100 = call i32 @getline_digit(i8* %99)
%101 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%102 = call i8* @atoi_2(i8* %101)
%103 = ptrtoint i8* %102 to i16
store i16 %103, i16* %8
%104 = getelementptr inbounds [300 x i8], [300 x i8]* %3, i64 0, i64 0
%105 = call i32 @clean_text(i8* %104, i32 300)
%106 = load i32, i32* %5
%107 = getelementptr inbounds [300 x i8], [300 x i8]* %3, i64 0, i64 0
%108 = load i16, i16* %8
%109 = call i32 @itob(i32 %106, i8* %107, i16 signext %108)
%110 = getelementptr inbounds [300 x i8], [300 x i8]* %3, i64 0, i64 0
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.19, i64 0, i64 0), i8* %110)
store i8 1, i8* %10
br label %115
112: ; preds = %23
store i8 1, i8* %10
br label %115
113: ; preds = %23
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.20, i64 0, i64 0))
br label %115
115: ; preds = %113, %112, %87, %74, %64, %62, %30
br label %19
116: ; preds = %19
ret void
}

LLVM IR (-O2):
@.str.9 = [30 x i8] c"Getted digit from char = %d;\0A\00"
@.str.10 = [30 x i8] c"After sorting array seems so:\00"
@.str.11 = [4 x i8] c"%d,\00"
@.str.14 = [35 x i8] c"After reverse string seens so:\0A%s\0A\00"
@.str.16 = [31 x i8] c"After expand line seems so:%s\0A\00"
@.str.19 = [36 x i8] c"After convert string seems so:\0A%s;\0A\00"
@str = [51 x i8] c"\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\00"
@str.21 = [53 x i8] c"Choose please what you want to do (press q to exit):\00"
@str.22 = [11 x i8] c"Variants :\00"
@str.23 = [33 x i8] c"1. Convert from char to integer.\00"
@str.24 = [17 x i8] c"2. Shellsorting.\00"
@str.25 = [19 x i8] c"3. Reverse string.\00"
@str.26 = [18 x i8] c"4. Expand string.\00"
@str.27 = [48 x i8] c"5. Convert digit to string which is based on B.\00"
@str.28 = [31 x i8] c"Input please digit to convert:\00"
@str.29 = [29 x i8] c"And now input please base B:\00"
@str.30 = [21 x i8] c"Enter please string:\00"
@str.31 = [30 x i8] c"Enter please line to reverse:\00"
@str.32 = [42 x i8] c"Input please chars to convert to integer:\00"
@str.33 = [24 x i8] c"Wrong input, try again.\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca [30 x i8]
%3 = alloca [300 x i8]
%4 = alloca [100 x i32]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [300 x i8], [300 x i8]* %3, i64 0, i64 0
%8 = bitcast [100 x i32]* %4 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.21, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.22, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.23, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.24, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.25, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.26, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.27, i64 0, i64 0))
%17 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 0
br label %18
18: ; preds = %75, %0
%19 = call i32 @getline_my(i8* %5)
%20 = load i8, i8* %5
%21 = sext i8 %20 to i32
switch i32 %21, label %75 [
i32 49, label %22
i32 50, label %30
i32 51, label %46
i32 52, label %52
i32 53, label %59
i32 113, label %77
]
22: ; preds = %18
%23 = call i32 @clean_text(i8* %5, i32 100)
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.32, i64 0, i64 0))
%25 = call i32 @getline_my(i8* %5)
%26 = call i8* @atoi_2(i8* %5)
%27 = ptrtoint i8* %26 to i64
%28 = trunc i64 %27 to i32
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0), i32 %28)
br label %77
30: ; preds = %18
%31 = call i32 @getarray_sort(i32* %17, i8* %5)
%32 = call i32 @shellsort(i32* %17, i32 %31)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0))
%34 = icmp sgt i32 %31, 0
br i1 %34, label %35, label %44
35: ; preds = %30
%36 = zext i32 %31 to i64
br label %37
37: ; preds = %35, %37
%38 = phi i64 [ 0, %35 ], [ %42, %37 ]
%39 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 %38
%40 = load i32, i32* %39
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i32 %40)
%42 = add nuw nsw i64 %38, 1
%43 = icmp eq i64 %42, %36
br i1 %43, label %44, label %37
44: ; preds = %37, %30
%45 = call i32 @putchar(i32 10)
br label %77
46: ; preds = %18
%47 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.31, i64 0, i64 0))
%48 = call i32 @clean_text(i8* %5, i32 100)
%49 = call i32 @getline_my(i8* %5)
%50 = call i32 @reverse_string(i8* %5)
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.14, i64 0, i64 0), i8* %5)
br label %77
52: ; preds = %18
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.30, i64 0, i64 0))
%54 = call i32 @clean_text(i8* %6, i32 30)
%55 = call i32 @clean_text(i8* %7, i32 300)
%56 = call i32 @getline_my(i8* %6)
%57 = call i32 @expand_my(i8* %6, i8* %7)
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), i8* %7)
br label %77
59: ; preds = %18
%60 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.28, i64 0, i64 0))
%61 = call i32 @clean_text(i8* %6, i32 30)
%62 = call i32 @getline_digit(i8* %6)
%63 = call i8* @atoi_2(i8* %6)
%64 = ptrtoint i8* %63 to i64
%65 = trunc i64 %64 to i32
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.29, i64 0, i64 0))
%67 = call i32 @clean_text(i8* %6, i32 30)
%68 = call i32 @getline_digit(i8* %6)
%69 = call i8* @atoi_2(i8* %6)
%70 = ptrtoint i8* %69 to i64
%71 = trunc i64 %70 to i16
%72 = call i32 @clean_text(i8* %7, i32 300)
%73 = call i32 @itob(i32 %65, i8* %7, i16 signext %71)
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.19, i64 0, i64 0), i8* %7)
br label %77
75: ; preds = %18
%76 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.33, i64 0, i64 0))
br label %18
77: ; preds = %18, %59, %52, %46, %44, %22
ret void
}