#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 atoi(char **, int);
int check_string_at_digits(char **);
int /*<<< orphan*/ clear_string(char **);
int getline_my(char **);
int getop_my(char **);
int /*<<< orphan*/ itoa_my(char **, int);
int /*<<< orphan*/ print_variants();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ reverse_my(char **, char **);
int strindex_my(char **, char **, int, int);
int strlen_my(char **);
void main() {
  char string1[100];
  char string2[100];
  int rez = 0;
  int len1 = 0;
  int len2 = 0;
  int digit = 0;
  char choice = 0;
  short int exit = 0;
  print_variants();
  while (exit == 0) {
    clear_string(&string1);
    rez = getline_my(&string1);
    choice = string1[0];
    switch (choice) {
    case '1':
      rez = getline_my(&string1);
      printf("rez = %d; and string1 = \"%s\";\n", rez, string1);
      break;
    case '2':
      printf("\nInput please string of digits that you want \nto convert to "
             "integer value: ");
      clear_string(&string1);
      rez = getline_my(&string1);
      printf("--\n-");
      printf("Getted string:\"%s\";\n", string1);
      rez = check_string_at_digits(&string1);
      if (rez == 0) {
        rez = atoi(&string1, 10);
        printf("After atoi result = %d;\n", rez);
        printf("So, what do you want to do now? Enter your choise (1-6,r,q):");
      } else {
        printf("String, that you inputed, is not only digital. You may try "
               "again.\n");
      }
      break;
    case '3':
      printf("Input please digital value, that you want to convert to "
             "character array:");
      clear_string(&string1);
      digit = getline_my(&string1);
      rez = check_string_at_digits(&string1);
      if (rez == 0) {
        itoa_my(&string1, digit);
        printf("After converting string with your inputed digit =\"%s\";\n",
               string1);
      } else {
        printf("Number, that you inputed, is not only digital. You may try "
               "again.\n");
      }
      break;
    case '4':
      clear_string(&string1);
      clear_string(&string2);
      printf("Input please string to reverse:");
      getline_my(&string1);
      reverse_my(&string1, &string2);
      printf("After reverse string =\"%s\";\n", string2);
      break;
    case '5':
      clear_string(&string1);
      clear_string(&string2);
      printf("Input please first string, where search would be:");
      getline_my(&string1);
      printf("Input please second string, which would be searching:");
      getline_my(&string2);
      len1 = 0;
      len2 = 0;
      len1 = strlen_my(&string1);
      printf("Lenght of string_where = %d;\n", len1);
      len2 = strlen_my(&string2);
      printf("Lenght of string_what = %d;\n", len2);
      rez = strindex_my(&string1, &string2, len1, len2);
      if (rez == -1) {
        printf("There is no second string = \"%s\" in first string = \"%s\";\n",
               string1, string2);
      } else {
        printf("Theres is second string = \"%s\"in position %d in first string "
               "= \"%s\";\n",
               string2, rez, string1);
      }
      break;
    case '6':
      printf("Input please operand:");
      clear_string(&string1);
      rez = getop_my(&string1);
      switch (rez) {
      case 1:
        printf("Geted operand = \"%s\";\n", string1);
        break;
      case 0:
        printf("Inputed symbol(s) is(are) not digital.\n");
        break;
      };
      break;
    case 'q':
      printf("Exit. Goodbye!\n");
      exit = 1;
      break;
    case 'r':
      print_variants();
      break;
    default:
      printf("Wrong input. You may choose next variants:\n");
      print_variants();
    };
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0xe4(%rbp)
movl   $0x0,-0xe8(%rbp)
movl   $0x0,-0xec(%rbp)
movl   $0x0,-0xf0(%rbp)
movb   $0x0,-0xf1(%rbp)
movw   $0x0,-0xf4(%rbp)
mov    $0x0,%al
call   10a0 <print_variants@plt>
movswl -0xf4(%rbp),%eax
cmp    $0x0,%eax
jne    15f2 <main+0x442>
lea    -0x70(%rbp),%rdi
mov    %rdi,-0x108(%rbp)
call   1040 <clear_string@plt>
mov    -0x108(%rbp),%rdi
call   1090 <getline_my@plt>
mov    %eax,-0xe4(%rbp)
mov    -0x70(%rbp),%al
mov    %al,-0xf1(%rbp)
movsbl -0xf1(%rbp),%eax
add    $0xffffffcf,%eax
mov    %eax,%ecx
mov    %rcx,-0x100(%rbp)
sub    $0x41,%eax
ja     15d8 <main+0x428>
mov    -0x100(%rbp),%rax
lea    0xda1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    -0x70(%rbp),%rdi
call   1090 <getline_my@plt>
mov    %eax,-0xe4(%rbp)
mov    -0xe4(%rbp),%esi
lea    -0x70(%rbp),%rdx
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    15ed <main+0x43d>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1040 <clear_string@plt>
lea    -0x70(%rbp),%rdi
call   1090 <getline_my@plt>
mov    %eax,-0xe4(%rbp)
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <check_string_at_digits@plt>
mov    %eax,-0xe4(%rbp)
cmpl   $0x0,-0xe4(%rbp)
jne    1331 <main+0x181>
lea    -0x70(%rbp),%rdi
mov    $0xa,%esi
call   10c0 <atoi@plt>
mov    %eax,-0xe4(%rbp)
mov    -0xe4(%rbp),%esi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    133f <main+0x18f>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    15ed <main+0x43d>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1040 <clear_string@plt>
lea    -0x70(%rbp),%rdi
call   1090 <getline_my@plt>
mov    %eax,-0xf0(%rbp)
lea    -0x70(%rbp),%rdi
call   1030 <check_string_at_digits@plt>
mov    %eax,-0xe4(%rbp)
cmpl   $0x0,-0xe4(%rbp)
jne    13ac <main+0x1fc>
lea    -0x70(%rbp),%rdi
mov    -0xf0(%rbp),%esi
call   1080 <itoa_my@plt>
lea    -0x70(%rbp),%rsi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13ba <main+0x20a>
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    15ed <main+0x43d>
lea    -0x70(%rbp),%rdi
call   1040 <clear_string@plt>
lea    -0xe0(%rbp),%rdi
call   1040 <clear_string@plt>
lea    0xf0f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1090 <getline_my@plt>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   10b0 <reverse_my@plt>
lea    -0xe0(%rbp),%rsi
lea    0xf01(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    15ed <main+0x43d>
lea    -0x70(%rbp),%rdi
call   1040 <clear_string@plt>
lea    -0xe0(%rbp),%rdi
call   1040 <clear_string@plt>
lea    0xef6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1090 <getline_my@plt>
lea    0xf11(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xe0(%rbp),%rdi
call   1090 <getline_my@plt>
movl   $0x0,-0xe8(%rbp)
movl   $0x0,-0xec(%rbp)
lea    -0x70(%rbp),%rdi
call   1070 <strlen_my@plt>
mov    %eax,-0xe8(%rbp)
mov    -0xe8(%rbp),%esi
lea    0xf04(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xe0(%rbp),%rdi
call   1070 <strlen_my@plt>
mov    %eax,-0xec(%rbp)
mov    -0xec(%rbp),%esi
lea    0xefc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
mov    -0xe8(%rbp),%edx
mov    -0xec(%rbp),%ecx
call   1060 <strindex_my@plt>
mov    %eax,-0xe4(%rbp)
cmpl   $0xffffffff,-0xe4(%rbp)
jne    1505 <main+0x355>
lea    -0x70(%rbp),%rsi
lea    -0xe0(%rbp),%rdx
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1524 <main+0x374>
lea    -0xe0(%rbp),%rsi
mov    -0xe4(%rbp),%edx
lea    -0x70(%rbp),%rcx
lea    0xee7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    15ed <main+0x43d>
lea    0xf1a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    %rdi,-0x118(%rbp)
call   1040 <clear_string@plt>
mov    -0x118(%rbp),%rdi
call   10d0 <getop_my@plt>
mov    %eax,-0xe4(%rbp)
mov    -0xe4(%rbp),%eax
mov    %eax,-0x10c(%rbp)
test   %eax,%eax
je     159d <main+0x3ed>
jmp    1572 <main+0x3c2>
mov    -0x10c(%rbp),%eax
sub    $0x1,%eax
jne    15ab <main+0x3fb>
jmp    1586 <main+0x3d6>
lea    -0x70(%rbp),%rsi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    15ab <main+0x3fb>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    15ed <main+0x43d>
lea    0xee8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movw   $0x1,-0xf4(%rbp)
jmp    15ed <main+0x43d>
mov    $0x0,%al
call   10a0 <print_variants@plt>
jmp    15ed <main+0x43d>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   10a0 <print_variants@plt>
jmp    11fa <main+0x4a>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
xor    %eax,%eax
call   10b0 <print_variants@plt>
mov    %rsp,%r13
lea    0xe1e(%rip),%r12
lea    0x70(%rsp),%r15
jmp    11fc <main+0x3c>
lea    0x12bb(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   10b0 <print_variants@plt>
mov    %r13,%rdi
call   1050 <clear_string@plt>
mov    %r13,%rdi
call   10a0 <getline_my@plt>
movsbl (%rsp),%eax
add    $0xffffffcf,%eax
cmp    $0x41,%eax
ja     11e9 <main+0x29>
movslq (%r12,%rax,4),%rax
add    %r12,%rax
jmp    *%rax
mov    %r13,%rdi
call   10a0 <getline_my@plt>
lea    0xed8(%rip),%rdi
mov    %eax,%esi
mov    %r13,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
jmp    11fc <main+0x3c>
lea    0xee2(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r13,%rdi
call   1050 <clear_string@plt>
mov    %r13,%rdi
call   10a0 <getline_my@plt>
lea    0xf10(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xf07(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r13,%rdi
call   1040 <check_string_at_digits@plt>
test   %eax,%eax
je     13f5 <main+0x235>
lea    0x11d7(%rip),%rdi
call   1030 <puts@plt>
jmp    11fc <main+0x3c>
lea    0xf40(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r13,%rdi
call   1050 <clear_string@plt>
mov    %r13,%rdi
call   10a0 <getline_my@plt>
mov    %eax,%r14d
mov    %r13,%rdi
call   1040 <check_string_at_digits@plt>
test   %eax,%eax
je     1425 <main+0x265>
lea    0x1153(%rip),%rdi
call   1030 <puts@plt>
jmp    11fc <main+0x3c>
mov    %r13,%rdi
call   1050 <clear_string@plt>
mov    %r15,%rdi
call   1050 <clear_string@plt>
lea    0xf6f(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r13,%rdi
call   10a0 <getline_my@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   10c0 <reverse_my@plt>
lea    0xf6e(%rip),%rdi
mov    %r15,%rsi
jmp    143a <main+0x27a>
mov    %r13,%rdi
call   1050 <clear_string@plt>
mov    %r15,%rdi
call   1050 <clear_string@plt>
lea    0xf6c(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r13,%rdi
call   10a0 <getline_my@plt>
lea    0xf88(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
call   10a0 <getline_my@plt>
mov    %r13,%rdi
call   1080 <strlen_my@plt>
mov    %eax,%ebp
lea    0xf9e(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
call   1080 <strlen_my@plt>
mov    %eax,%ebx
lea    0xfa2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r13,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1070 <strindex_my@plt>
cmp    $0xffffffff,%eax
je     1446 <main+0x286>
lea    0xfd1(%rip),%rdi
mov    %r15,%rsi
mov    %eax,%edx
mov    %r13,%rcx
xor    %eax,%eax
call   1060 <printf@plt>
jmp    11fc <main+0x3c>
lea    0xffc(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r13,%rdi
call   1050 <clear_string@plt>
mov    %r13,%rdi
call   10e0 <getop_my@plt>
test   %eax,%eax
je     145f <main+0x29f>
cmp    $0x1,%eax
jne    11fc <main+0x3c>
lea    0xfe7(%rip),%rdi
jmp    1437 <main+0x277>
mov    %r13,%rdi
mov    $0xa,%esi
call   10d0 <atoi@plt>
lea    0xd84(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd8d(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    11fc <main+0x3c>
mov    %r13,%rdi
mov    %r14d,%esi
call   1090 <itoa_my@plt>
lea    0xdf5(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    11fc <main+0x3c>
lea    0xef7(%rip),%rdi
mov    %r13,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
jmp    11fc <main+0x3c>
lea    0xf9a(%rip),%rdi
call   1030 <puts@plt>
jmp    11fc <main+0x3c>
lea    0xf7a(%rip),%rdi
call   1030 <puts@plt>
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"rez = %d; and string1 = \22%s\22;\0A\00"
@.str.1 = [76 x i8] c"\0AInput please string of digits that you want \0Ato convert to integer value: \00"
@.str.2 = [5 x i8] c"--\0A-\00"
@.str.3 = [21 x i8] c"Getted string:\22%s\22;\0A\00"
@.str.4 = [25 x i8] c"After atoi result = %d;\0A\00"
@.str.5 = [61 x i8] c"So, what do you want to do now? Enter your choise (1-6,r,q):\00"
@.str.6 = [67 x i8] c"String, that you inputed, is not only digital. You may try again.\0A\00"
@.str.7 = [73 x i8] c"Input please digital value, that you want to convert to character array:\00"
@.str.8 = [56 x i8] c"After converting string with your inputed digit =\22%s\22;\0A\00"
@.str.9 = [67 x i8] c"Number, that you inputed, is not only digital. You may try again.\0A\00"
@.str.10 = [32 x i8] c"Input please string to reverse:\00"
@.str.11 = [29 x i8] c"After reverse string =\22%s\22;\0A\00"
@.str.12 = [50 x i8] c"Input please first string, where search would be:\00"
@.str.13 = [54 x i8] c"Input please second string, which would be searching:\00"
@.str.14 = [30 x i8] c"Lenght of string_where = %d;\0A\00"
@.str.15 = [29 x i8] c"Lenght of string_what = %d;\0A\00"
@.str.16 = [58 x i8] c"There is no second string = \22%s\22 in first string = \22%s\22;\0A\00"
@.str.17 = [70 x i8] c"Theres is second string = \22%s\22in position %d in first string = \22%s\22;\0A\00"
@.str.18 = [22 x i8] c"Input please operand:\00"
@.str.19 = [23 x i8] c"Geted operand = \22%s\22;\0A\00"
@.str.20 = [40 x i8] c"Inputed symbol(s) is(are) not digital.\0A\00"
@.str.21 = [16 x i8] c"Exit. Goodbye!\0A\00"
@.str.22 = [44 x i8] c"Wrong input. You may choose next variants:\0A\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
%8 = alloca i16
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i8 0, i8* %7
store i16 0, i16* %8
%9 = call i32 (...) @print_variants()
br label %10
10: ; preds = %139, %0
%11 = load i16, i16* %8
%12 = sext i16 %11 to i32
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %140
14: ; preds = %10
%15 = bitcast [100 x i8]* %1 to i8**
%16 = call i32 @clear_string(i8** %15)
%17 = bitcast [100 x i8]* %1 to i8**
%18 = call i32 @getline_my(i8** %17)
store i32 %18, i32* %3
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%20 = load i8, i8* %19
store i8 %20, i8* %7
%21 = load i8, i8* %7
%22 = sext i8 %21 to i32
switch i32 %22, label %136 [
i32 49, label %23
i32 50, label %29
i32 51, label %51
i32 52, label %70
i32 53, label %83
i32 54, label %119
i32 113, label %132
i32 114, label %134
]
23: ; preds = %14
%24 = bitcast [100 x i8]* %1 to i8**
%25 = call i32 @getline_my(i8** %24)
store i32 %25, i32* %3
%26 = load i32, i32* %3
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %26, i8* %27)
br label %139
29: ; preds = %14
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0))
%31 = bitcast [100 x i8]* %1 to i8**
%32 = call i32 @clear_string(i8** %31)
%33 = bitcast [100 x i8]* %1 to i8**
%34 = call i32 @getline_my(i8** %33)
store i32 %34, i32* %3
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%36 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %36)
%38 = bitcast [100 x i8]* %1 to i8**
%39 = call i32 @check_string_at_digits(i8** %38)
store i32 %39, i32* %3
%40 = load i32, i32* %3
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %48
42: ; preds = %29
%43 = bitcast [100 x i8]* %1 to i8**
%44 = call i32 @atoi(i8** %43, i32 10)
store i32 %44, i32* %3
%45 = load i32, i32* %3
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %45)
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.5, i64 0, i64 0))
br label %50
48: ; preds = %29
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.6, i64 0, i64 0))
br label %50
50: ; preds = %48, %42
br label %139
51: ; preds = %14
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.7, i64 0, i64 0))
%53 = bitcast [100 x i8]* %1 to i8**
%54 = call i32 @clear_string(i8** %53)
%55 = bitcast [100 x i8]* %1 to i8**
%56 = call i32 @getline_my(i8** %55)
store i32 %56, i32* %6
%57 = bitcast [100 x i8]* %1 to i8**
%58 = call i32 @check_string_at_digits(i8** %57)
store i32 %58, i32* %3
%59 = load i32, i32* %3
%60 = icmp eq i32 %59, 0
br i1 %60, label %61, label %67
61: ; preds = %51
%62 = bitcast [100 x i8]* %1 to i8**
%63 = load i32, i32* %6
%64 = call i32 @itoa_my(i8** %62, i32 %63)
%65 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.8, i64 0, i64 0), i8* %65)
br label %69
67: ; preds = %51
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.9, i64 0, i64 0))
br label %69
69: ; preds = %67, %61
br label %139
70: ; preds = %14
%71 = bitcast [100 x i8]* %1 to i8**
%72 = call i32 @clear_string(i8** %71)
%73 = bitcast [100 x i8]* %2 to i8**
%74 = call i32 @clear_string(i8** %73)
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0))
%76 = bitcast [100 x i8]* %1 to i8**
%77 = call i32 @getline_my(i8** %76)
%78 = bitcast [100 x i8]* %1 to i8**
%79 = bitcast [100 x i8]* %2 to i8**
%80 = call i32 @reverse_my(i8** %78, i8** %79)
%81 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i8* %81)
br label %139
83: ; preds = %14
%84 = bitcast [100 x i8]* %1 to i8**
%85 = call i32 @clear_string(i8** %84)
%86 = bitcast [100 x i8]* %2 to i8**
%87 = call i32 @clear_string(i8** %86)
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.12, i64 0, i64 0))
%89 = bitcast [100 x i8]* %1 to i8**
%90 = call i32 @getline_my(i8** %89)
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.13, i64 0, i64 0))
%92 = bitcast [100 x i8]* %2 to i8**
%93 = call i32 @getline_my(i8** %92)
store i32 0, i32* %4
store i32 0, i32* %5
%94 = bitcast [100 x i8]* %1 to i8**
%95 = call i32 @strlen_my(i8** %94)
store i32 %95, i32* %4
%96 = load i32, i32* %4
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0), i32 %96)
%98 = bitcast [100 x i8]* %2 to i8**
%99 = call i32 @strlen_my(i8** %98)
store i32 %99, i32* %5
%100 = load i32, i32* %5
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.15, i64 0, i64 0), i32 %100)
%102 = bitcast [100 x i8]* %1 to i8**
%103 = bitcast [100 x i8]* %2 to i8**
%104 = load i32, i32* %4
%105 = load i32, i32* %5
%106 = call i32 @strindex_my(i8** %102, i8** %103, i32 %104, i32 %105)
store i32 %106, i32* %3
%107 = load i32, i32* %3
%108 = icmp eq i32 %107, -1
br i1 %108, label %109, label %113
109: ; preds = %83
%110 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%111 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.16, i64 0, i64 0), i8* %110, i8* %111)
br label %118
113: ; preds = %83
%114 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%115 = load i32, i32* %3
%116 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.17, i64 0, i64 0), i8* %114, i32 %115, i8* %116)
br label %118
118: ; preds = %113, %109
br label %139
119: ; preds = %14
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.18, i64 0, i64 0))
%121 = bitcast [100 x i8]* %1 to i8**
%122 = call i32 @clear_string(i8** %121)
%123 = bitcast [100 x i8]* %1 to i8**
%124 = call i32 @getop_my(i8** %123)
store i32 %124, i32* %3
%125 = load i32, i32* %3
switch i32 %125, label %131 [
i32 1, label %126
i32 0, label %129
]
126: ; preds = %119
%127 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.19, i64 0, i64 0), i8* %127)
br label %131
129: ; preds = %119
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.20, i64 0, i64 0))
br label %131
131: ; preds = %119, %129, %126
br label %139
132: ; preds = %14
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.21, i64 0, i64 0))
store i16 1, i16* %8
br label %139
134: ; preds = %14
%135 = call i32 (...) @print_variants()
br label %139
136: ; preds = %14
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.22, i64 0, i64 0))
%138 = call i32 (...) @print_variants()
br label %139
139: ; preds = %136, %134, %132, %131, %118, %70, %69, %50, %23
br label %10
140: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"rez = %d; and string1 = \22%s\22;\0A\00"
@.str.1 = [76 x i8] c"\0AInput please string of digits that you want \0Ato convert to integer value: \00"
@.str.2 = [5 x i8] c"--\0A-\00"
@.str.3 = [21 x i8] c"Getted string:\22%s\22;\0A\00"
@.str.4 = [25 x i8] c"After atoi result = %d;\0A\00"
@.str.5 = [61 x i8] c"So, what do you want to do now? Enter your choise (1-6,r,q):\00"
@.str.7 = [73 x i8] c"Input please digital value, that you want to convert to character array:\00"
@.str.8 = [56 x i8] c"After converting string with your inputed digit =\22%s\22;\0A\00"
@.str.10 = [32 x i8] c"Input please string to reverse:\00"
@.str.11 = [29 x i8] c"After reverse string =\22%s\22;\0A\00"
@.str.12 = [50 x i8] c"Input please first string, where search would be:\00"
@.str.13 = [54 x i8] c"Input please second string, which would be searching:\00"
@.str.14 = [30 x i8] c"Lenght of string_where = %d;\0A\00"
@.str.15 = [29 x i8] c"Lenght of string_what = %d;\0A\00"
@.str.16 = [58 x i8] c"There is no second string = \22%s\22 in first string = \22%s\22;\0A\00"
@.str.17 = [70 x i8] c"Theres is second string = \22%s\22in position %d in first string = \22%s\22;\0A\00"
@.str.18 = [22 x i8] c"Input please operand:\00"
@.str.19 = [23 x i8] c"Geted operand = \22%s\22;\0A\00"
@str = [15 x i8] c"Exit. Goodbye!\00"
@str.23 = [39 x i8] c"Inputed symbol(s) is(are) not digital.\00"
@str.24 = [66 x i8] c"Number, that you inputed, is not only digital. You may try again.\00"
@str.25 = [66 x i8] c"String, that you inputed, is not only digital. You may try again.\00"
@str.26 = [43 x i8] c"Wrong input. You may choose next variants:\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (...) @print_variants()
%6 = bitcast [100 x i8]* %1 to i8**
%7 = bitcast [100 x i8]* %2 to i8**
br label %8
8: ; preds = %71, %0
%9 = call i32 @clear_string(i8** %6)
%10 = call i32 @getline_my(i8** %6)
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
switch i32 %12, label %76 [
i32 49, label %13
i32 50, label %16
i32 51, label %30
i32 52, label %41
i32 53, label %48
i32 54, label %65
i32 113, label %79
i32 114, label %74
]
13: ; preds = %8
%14 = call i32 @getline_my(i8** %6)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %14, i8* %3)
br label %71
16: ; preds = %8
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0))
%18 = call i32 @clear_string(i8** %6)
%19 = call i32 @getline_my(i8** %6)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %3)
%22 = call i32 @check_string_at_digits(i8** %6)
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %16
%25 = call i32 @atoi(i8** %6, i32 10)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %25)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.5, i64 0, i64 0))
br label %71
28: ; preds = %16
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.25, i64 0, i64 0))
br label %71
30: ; preds = %8
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str.7, i64 0, i64 0))
%32 = call i32 @clear_string(i8** %6)
%33 = call i32 @getline_my(i8** %6)
%34 = call i32 @check_string_at_digits(i8** %6)
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %30
%37 = call i32 @itoa_my(i8** %6, i32 %33)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.8, i64 0, i64 0), i8* %3)
br label %71
39: ; preds = %30
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.24, i64 0, i64 0))
br label %71
41: ; preds = %8
%42 = call i32 @clear_string(i8** %6)
%43 = call i32 @clear_string(i8** %7)
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0))
%45 = call i32 @getline_my(i8** %6)
%46 = call i32 @reverse_my(i8** %6, i8** %7)
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i8* %4)
br label %71
48: ; preds = %8
%49 = call i32 @clear_string(i8** %6)
%50 = call i32 @clear_string(i8** %7)
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.12, i64 0, i64 0))
%52 = call i32 @getline_my(i8** %6)
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.13, i64 0, i64 0))
%54 = call i32 @getline_my(i8** %7)
%55 = call i32 @strlen_my(i8** %6)
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0), i32 %55)
%57 = call i32 @strlen_my(i8** %7)
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.15, i64 0, i64 0), i32 %57)
%59 = call i32 @strindex_my(i8** %6, i8** %7, i32 %55, i32 %57)
%60 = icmp eq i32 %59, -1
br i1 %60, label %61, label %63
61: ; preds = %48
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.16, i64 0, i64 0), i8* %3, i8* %4)
br label %71
63: ; preds = %48
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str.17, i64 0, i64 0), i8* %4, i32 %59, i8* %3)
br label %71
65: ; preds = %8
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.18, i64 0, i64 0))
%67 = call i32 @clear_string(i8** %6)
%68 = call i32 @getop_my(i8** %6)
switch i32 %68, label %71 [
i32 1, label %69
i32 0, label %72
]
69: ; preds = %65
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.19, i64 0, i64 0), i8* %3)
br label %71
71: ; preds = %69, %72, %65, %61, %63, %36, %39, %24, %28, %76, %74, %41, %13
br label %8
72: ; preds = %65
%73 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.23, i64 0, i64 0))
br label %71
74: ; preds = %8
%75 = call i32 (...) @print_variants()
br label %71
76: ; preds = %8
%77 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.26, i64 0, i64 0))
%78 = call i32 (...) @print_variants()
br label %71
79: ; preds = %8
%80 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}