#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 /*<<< orphan*/ clear_string_my(char **);
int /*<<< orphan*/ getline_my(char **);
int /*<<< orphan*/ printf(char *, ...);
int strlen_my(char *);
int strncat(char **, char **, int);
int strncmp_my(char **, char **, int);
int /*<<< orphan*/ strncpy_my(char **, char **, int);
void main() {
  char line_dest[100];
  char line_src[100];
  char num_s[100];
  char choise[100];
  int len_s = 0;
  int len_d = 0;
  int con = 0;
  int i = 0;
  int num = 0;
  int rez = 0;
  int ch = 0;
  printf("Choose what you want to do:\n");
  printf("1. Test strncpy function.\n");
  printf("2. Test strncat function.\n");
  printf("3. Test strncmp function.\n");
  getline_my(&choise);
  ch = atoi(choise);
  switch (ch) {
  case 1:
    printf("\nInput please string for copiyng:");
    getline_my(&line_src);
    printf("\nGetted string = %s;\n\n", line_src);
    len_s = strlen_my(line_src);
    printf("lenght of string line_src = %d;\n\n", len_s);
    printf("And now input please number of symbols of string2 that you want to "
           "place in line_dest:");
    getline_my(&num_s);
    num = atoi(num_s);
    printf("Number of symbols = %d;\n\n", num);
    strncpy_my(&line_dest, &line_src, num);
    printf("After strncpy_my destination string = \"%s\";\n", line_dest);
    clear_string_my(&line_dest);
    clear_string_my(&line_src);
    break;
  case 2:
    printf("Input please string for where concatenate:");
    getline_my(&line_dest);
    printf("\nGetted string = %s;\n\n", line_dest);
    printf("Input please string, which is for concatenate:");
    getline_my(&line_src);
    printf("\nGetted string = %s;\n\n", line_src);
    len_s = strlen_my(line_src);
    rez = strncat(&line_dest, &line_src, len_s);
    printf("After concatination destination string = \"%s\";\n", line_dest);
    break;
  case 3:
    printf("Input please first string for comparison:");
    getline_my(&line_src);
    printf("\nGetted string = %s;\n\n", line_src);
    printf("Input please second for where comparison:");
    getline_my(&line_dest);
    printf("\nGetted string = %s;\n\n", line_dest);
    printf("And now input please number of symbols of strings that you want to "
           "compare:");
    getline_my(&num_s);
    num = atoi(num_s);
    printf("Number of symbols = %d;\n\n", num);
    len_s = strlen_my(line_src);
    len_d = strlen_my(line_dest);
    if (len_s != 0 && len_d != 0) {
      rez = strncmp_my(&line_dest, &line_src, num);
      if (rez == 0) {
        printf("Strings are equal. Rez of strncmp_my = %d;\n", rez);
      } else {
        if (rez > 0) {
          printf("First string is more, than second;\n");
        } else {
          printf("Second string is more, than first;\n");
        }
      }
    } else {
      printf("One of compares string is empty.\n");
    }
    break;
  default:
    printf("Invalid value.\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f0,%rsp
movl   $0x0,-0x1c4(%rbp)
movl   $0x0,-0x1c8(%rbp)
movl   $0x0,-0x1cc(%rbp)
movl   $0x0,-0x1d0(%rbp)
movl   $0x0,-0x1d4(%rbp)
movl   $0x0,-0x1d8(%rbp)
movl   $0x0,-0x1dc(%rbp)
lea    0xe28(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x1e9(%rbp)
call   1030 <printf@plt>
mov    -0x1e9(%rbp),%al
lea    0xe2b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1e9(%rbp),%al
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1e9(%rbp),%al
lea    0xe3d(%rip),%rdi
call   1030 <printf@plt>
lea    -0x1c0(%rbp),%rdi
mov    %rdi,-0x1e8(%rbp)
call   1060 <getline_my@plt>
mov    -0x1e8(%rbp),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x1dc(%rbp)
mov    -0x1dc(%rbp),%eax
mov    %eax,-0x1e0(%rbp)
sub    $0x1,%eax
je     1282 <main+0x102>
jmp    125a <main+0xda>
mov    -0x1e0(%rbp),%eax
sub    $0x2,%eax
je     1359 <main+0x1d9>
jmp    126e <main+0xee>
mov    -0x1e0(%rbp),%eax
sub    $0x3,%eax
je     13f6 <main+0x276>
jmp    1556 <main+0x3d6>
lea    0xde5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xe0(%rbp),%rdi
call   1060 <getline_my@plt>
lea    -0xe0(%rbp),%rsi
lea    0xde6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xe0(%rbp),%rdi
call   1050 <strlen_my@plt>
mov    %eax,-0x1c4(%rbp)
mov    -0x1c4(%rbp),%esi
lea    0xdd7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x150(%rbp),%rdi
call   1060 <getline_my@plt>
lea    -0x150(%rbp),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x1d4(%rbp)
mov    -0x1d4(%rbp),%esi
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
mov    -0x1d4(%rbp),%edx
call   1090 <strncpy_my@plt>
lea    -0x70(%rbp),%rsi
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1080 <clear_string_my@plt>
lea    -0xe0(%rbp),%rdi
call   1080 <clear_string_my@plt>
jmp    1564 <main+0x3e4>
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1060 <getline_my@plt>
lea    -0x70(%rbp),%rsi
lea    0xd15(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xe0(%rbp),%rdi
call   1060 <getline_my@plt>
lea    -0xe0(%rbp),%rsi
lea    0xce6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xe0(%rbp),%rdi
call   1050 <strlen_my@plt>
mov    %eax,-0x1c4(%rbp)
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
mov    -0x1c4(%rbp),%edx
call   1040 <strncat@plt>
mov    %eax,-0x1d8(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xdd7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1564 <main+0x3e4>
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xe0(%rbp),%rdi
call   1060 <getline_my@plt>
lea    -0xe0(%rbp),%rsi
lea    0xc72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1060 <getline_my@plt>
lea    -0x70(%rbp),%rsi
lea    0xc49(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdf0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x150(%rbp),%rdi
call   1060 <getline_my@plt>
lea    -0x150(%rbp),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x1d4(%rbp)
mov    -0x1d4(%rbp),%esi
lea    0xc99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xe0(%rbp),%rdi
call   1050 <strlen_my@plt>
mov    %eax,-0x1c4(%rbp)
lea    -0x70(%rbp),%rdi
call   1050 <strlen_my@plt>
mov    %eax,-0x1c8(%rbp)
cmpl   $0x0,-0x1c4(%rbp)
je     1543 <main+0x3c3>
cmpl   $0x0,-0x1c8(%rbp)
je     1543 <main+0x3c3>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
mov    -0x1d4(%rbp),%edx
call   1070 <strncmp_my@plt>
mov    %eax,-0x1d8(%rbp)
cmpl   $0x0,-0x1d8(%rbp)
jne    150b <main+0x38b>
mov    -0x1d8(%rbp),%esi
lea    0xd92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    153e <main+0x3be>
cmpl   $0x0,-0x1d8(%rbp)
jle    152b <main+0x3ab>
lea    0xd9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1539 <main+0x3b9>
lea    0xdaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    153e <main+0x3be>
jmp    1551 <main+0x3d1>
lea    0xdbb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1564 <main+0x3e4>
lea    0xdca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x1f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x1b8,%rsp
lea    0x10ab(%rip),%rdi
call   1030 <puts@plt>
lea    0x10bb(%rip),%rdi
call   1030 <puts@plt>
lea    0x10c9(%rip),%rdi
call   1030 <puts@plt>
lea    0x10d7(%rip),%rdi
call   1030 <puts@plt>
lea    0x150(%rsp),%rbx
mov    %rbx,%rdi
call   1070 <getline_my@plt>
mov    %rbx,%rdi
call   10b0 <atoi@plt>
cmp    $0x3,%eax
je     12b2 <main+0x122>
cmp    $0x2,%eax
je     138a <main+0x1fa>
cmp    $0x1,%eax
jne    1407 <main+0x277>
lea    0xdf9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%r14
mov    %r14,%rdi
call   1070 <getline_my@plt>
lea    0xe02(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1060 <strlen_my@plt>
lea    0xe00(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe12(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe0(%rsp),%rbp
mov    %rbp,%rdi
call   1070 <getline_my@plt>
mov    %rbp,%rdi
call   10b0 <atoi@plt>
mov    %eax,%ebp
lea    0xe41(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   10a0 <strncpy_my@plt>
lea    0xe39(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1090 <clear_string_my@plt>
mov    %r14,%rdi
call   1090 <clear_string_my@plt>
jmp    141c <main+0x28c>
lea    0xeca(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%r14
mov    %r14,%rdi
call   1070 <getline_my@plt>
lea    0xd50(%rip),%rbp
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x70(%rsp),%r15
mov    %r15,%rdi
call   1070 <getline_my@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe0(%rsp),%rbp
mov    %rbp,%rdi
call   1070 <getline_my@plt>
mov    %rbp,%rdi
call   10b0 <atoi@plt>
mov    %eax,%ebp
lea    0xd7c(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1060 <strlen_my@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1060 <strlen_my@plt>
test   %ebx,%ebx
je     1410 <main+0x280>
test   %eax,%eax
je     1410 <main+0x280>
lea    0x70(%rsp),%rdi
mov    %rsp,%rsi
mov    %ebp,%edx
call   1080 <strncmp_my@plt>
test   %eax,%eax
je     142a <main+0x29a>
jle    143c <main+0x2ac>
lea    0xf78(%rip),%rdi
jmp    1417 <main+0x287>
lea    0xd68(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
call   1070 <getline_my@plt>
lea    0xc76(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd64(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rbp
mov    %rbp,%rdi
call   1070 <getline_my@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
call   1060 <strlen_my@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %eax,%edx
call   1050 <strncat@plt>
lea    0xd58(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    141c <main+0x28c>
lea    0xf12(%rip),%rdi
jmp    1417 <main+0x287>
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
add    $0x1b8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdf2(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    141c <main+0x28c>
lea    0xe97(%rip),%rdi
jmp    1417 <main+0x287>

LLVM IR (-O0):
@.str = [29 x i8] c"Choose what you want to do:\0A\00"
@.str.1 = [27 x i8] c"1. Test strncpy function.\0A\00"
@.str.2 = [27 x i8] c"2. Test strncat function.\0A\00"
@.str.3 = [27 x i8] c"3. Test strncmp function.\0A\00"
@.str.4 = [34 x i8] c"\0AInput please string for copiyng:\00"
@.str.5 = [23 x i8] c"\0AGetted string = %s;\0A\0A\00"
@.str.6 = [34 x i8] c"lenght of string line_src = %d;\0A\0A\00"
@.str.7 = [87 x i8] c"And now input please number of symbols of string2 that you want to place in line_dest:\00"
@.str.8 = [26 x i8] c"Number of symbols = %d;\0A\0A\00"
@.str.9 = [45 x i8] c"After strncpy_my destination string = \22%s\22;\0A\00"
@.str.10 = [43 x i8] c"Input please string for where concatenate:\00"
@.str.11 = [47 x i8] c"Input please string, which is for concatenate:\00"
@.str.12 = [48 x i8] c"After concatination destination string = \22%s\22;\0A\00"
@.str.13 = [42 x i8] c"Input please first string for comparison:\00"
@.str.14 = [42 x i8] c"Input please second for where comparison:\00"
@.str.15 = [76 x i8] c"And now input please number of symbols of strings that you want to compare:\00"
@.str.16 = [44 x i8] c"Strings are equal. Rez of strncmp_my = %d;\0A\00"
@.str.17 = [36 x i8] c"First string is more, than second;\0A\00"
@.str.18 = [36 x i8] c"Second string is more, than first;\0A\00"
@.str.19 = [34 x i8] c"One of compares string is empty.\0A\00"
@.str.20 = [16 x i8] c"Invalid value.\0A\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%16 = bitcast [100 x i8]* %4 to i8**
%17 = call i32 @getline_my(i8** %16)
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%19 = call i32 @atoi(i8* %18)
store i32 %19, i32* %11
%20 = load i32, i32* %11
switch i32 %20, label %116 [
i32 1, label %21
i32 2, label %48
i32 3, label %67
]
21: ; preds = %0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
%23 = bitcast [100 x i8]* %2 to i8**
%24 = call i32 @getline_my(i8** %23)
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* %25)
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%28 = call i32 @strlen_my(i8* %27)
store i32 %28, i32* %5
%29 = load i32, i32* %5
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i32 %29)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.7, i64 0, i64 0))
%32 = bitcast [100 x i8]* %3 to i8**
%33 = call i32 @getline_my(i8** %32)
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%35 = call i32 @atoi(i8* %34)
store i32 %35, i32* %9
%36 = load i32, i32* %9
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i32 %36)
%38 = bitcast [100 x i8]* %1 to i8**
%39 = bitcast [100 x i8]* %2 to i8**
%40 = load i32, i32* %9
%41 = call i32 @strncpy_my(i8** %38, i8** %39, i32 %40)
%42 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.9, i64 0, i64 0), i8* %42)
%44 = bitcast [100 x i8]* %1 to i8**
%45 = call i32 @clear_string_my(i8** %44)
%46 = bitcast [100 x i8]* %2 to i8**
%47 = call i32 @clear_string_my(i8** %46)
br label %118
48: ; preds = %0
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.10, i64 0, i64 0))
%50 = bitcast [100 x i8]* %1 to i8**
%51 = call i32 @getline_my(i8** %50)
%52 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* %52)
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.11, i64 0, i64 0))
%55 = bitcast [100 x i8]* %2 to i8**
%56 = call i32 @getline_my(i8** %55)
%57 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* %57)
%59 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%60 = call i32 @strlen_my(i8* %59)
store i32 %60, i32* %5
%61 = bitcast [100 x i8]* %1 to i8**
%62 = bitcast [100 x i8]* %2 to i8**
%63 = load i32, i32* %5
%64 = call i32 @strncat(i8** %61, i8** %62, i32 %63)
store i32 %64, i32* %10
%65 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.12, i64 0, i64 0), i8* %65)
br label %118
67: ; preds = %0
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.13, i64 0, i64 0))
%69 = bitcast [100 x i8]* %2 to i8**
%70 = call i32 @getline_my(i8** %69)
%71 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* %71)
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.14, i64 0, i64 0))
%74 = bitcast [100 x i8]* %1 to i8**
%75 = call i32 @getline_my(i8** %74)
%76 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* %76)
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.15, i64 0, i64 0))
%79 = bitcast [100 x i8]* %3 to i8**
%80 = call i32 @getline_my(i8** %79)
%81 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%82 = call i32 @atoi(i8* %81)
store i32 %82, i32* %9
%83 = load i32, i32* %9
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i32 %83)
%85 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%86 = call i32 @strlen_my(i8* %85)
store i32 %86, i32* %5
%87 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%88 = call i32 @strlen_my(i8* %87)
store i32 %88, i32* %6
%89 = load i32, i32* %5
%90 = icmp ne i32 %89, 0
br i1 %90, label %91, label %113
91: ; preds = %67
%92 = load i32, i32* %6
%93 = icmp ne i32 %92, 0
br i1 %93, label %94, label %113
94: ; preds = %91
%95 = bitcast [100 x i8]* %1 to i8**
%96 = bitcast [100 x i8]* %2 to i8**
%97 = load i32, i32* %9
%98 = call i32 @strncmp_my(i8** %95, i8** %96, i32 %97)
store i32 %98, i32* %10
%99 = load i32, i32* %10
%100 = icmp eq i32 %99, 0
br i1 %100, label %101, label %104
101: ; preds = %94
%102 = load i32, i32* %10
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.16, i64 0, i64 0), i32 %102)
br label %112
104: ; preds = %94
%105 = load i32, i32* %10
%106 = icmp sgt i32 %105, 0
br i1 %106, label %107, label %109
107: ; preds = %104
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.17, i64 0, i64 0))
br label %111
109: ; preds = %104
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.18, i64 0, i64 0))
br label %111
111: ; preds = %109, %107
br label %112
112: ; preds = %111, %101
br label %115
113: ; preds = %91, %67
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.19, i64 0, i64 0))
br label %115
115: ; preds = %113, %112
br label %118
116: ; preds = %0
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.20, i64 0, i64 0))
br label %118
118: ; preds = %116, %115, %48, %21
ret void
}

LLVM IR (-O2):
@.str.4 = [34 x i8] c"\0AInput please string for copiyng:\00"
@.str.5 = [23 x i8] c"\0AGetted string = %s;\0A\0A\00"
@.str.6 = [34 x i8] c"lenght of string line_src = %d;\0A\0A\00"
@.str.7 = [87 x i8] c"And now input please number of symbols of string2 that you want to place in line_dest:\00"
@.str.8 = [26 x i8] c"Number of symbols = %d;\0A\0A\00"
@.str.9 = [45 x i8] c"After strncpy_my destination string = \22%s\22;\0A\00"
@.str.10 = [43 x i8] c"Input please string for where concatenate:\00"
@.str.11 = [47 x i8] c"Input please string, which is for concatenate:\00"
@.str.12 = [48 x i8] c"After concatination destination string = \22%s\22;\0A\00"
@.str.13 = [42 x i8] c"Input please first string for comparison:\00"
@.str.14 = [42 x i8] c"Input please second for where comparison:\00"
@.str.15 = [76 x i8] c"And now input please number of symbols of strings that you want to compare:\00"
@.str.16 = [44 x i8] c"Strings are equal. Rez of strncmp_my = %d;\0A\00"
@str = [28 x i8] c"Choose what you want to do:\00"
@str.21 = [26 x i8] c"1. Test strncpy function.\00"
@str.22 = [26 x i8] c"2. Test strncat function.\00"
@str.23 = [26 x i8] c"3. Test strncmp function.\00"
@str.24 = [33 x i8] c"One of compares string is empty.\00"
@str.25 = [35 x i8] c"Second string is more, than first;\00"
@str.26 = [35 x i8] c"First string is more, than second;\00"
@str.27 = [15 x i8] c"Invalid value.\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.21, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.22, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.23, i64 0, i64 0))
%13 = bitcast [100 x i8]* %4 to i8**
%14 = call i32 @getline_my(i8** %13)
%15 = call i32 @atoi(i8* %8)
switch i32 %15, label %77 [
i32 1, label %16
i32 2, label %33
i32 3, label %45
]
16: ; preds = %0
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
%18 = bitcast [100 x i8]* %2 to i8**
%19 = call i32 @getline_my(i8** %18)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* %6)
%21 = call i32 @strlen_my(i8* %6)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i32 %21)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([87 x i8], [87 x i8]* @.str.7, i64 0, i64 0))
%24 = bitcast [100 x i8]* %3 to i8**
%25 = call i32 @getline_my(i8** %24)
%26 = call i32 @atoi(i8* %7)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i32 %26)
%28 = bitcast [100 x i8]* %1 to i8**
%29 = call i32 @strncpy_my(i8** %28, i8** %18, i32 %26)
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.9, i64 0, i64 0), i8* %5)
%31 = call i32 @clear_string_my(i8** %28)
%32 = call i32 @clear_string_my(i8** %18)
br label %79
33: ; preds = %0
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.10, i64 0, i64 0))
%35 = bitcast [100 x i8]* %1 to i8**
%36 = call i32 @getline_my(i8** %35)
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* %5)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.11, i64 0, i64 0))
%39 = bitcast [100 x i8]* %2 to i8**
%40 = call i32 @getline_my(i8** %39)
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* %6)
%42 = call i32 @strlen_my(i8* %6)
%43 = call i32 @strncat(i8** %35, i8** %39, i32 %42)
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.12, i64 0, i64 0), i8* %5)
br label %79
45: ; preds = %0
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.13, i64 0, i64 0))
%47 = bitcast [100 x i8]* %2 to i8**
%48 = call i32 @getline_my(i8** %47)
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* %6)
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.14, i64 0, i64 0))
%51 = bitcast [100 x i8]* %1 to i8**
%52 = call i32 @getline_my(i8** %51)
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* %5)
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @.str.15, i64 0, i64 0))
%55 = bitcast [100 x i8]* %3 to i8**
%56 = call i32 @getline_my(i8** %55)
%57 = call i32 @atoi(i8* %7)
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i32 %57)
%59 = call i32 @strlen_my(i8* %6)
%60 = call i32 @strlen_my(i8* %5)
%61 = icmp ne i32 %59, 0
%62 = icmp ne i32 %60, 0
%63 = select i1 %61, i1 %62, i1 false
br i1 %63, label %64, label %75
64: ; preds = %45
%65 = call i32 @strncmp_my(i8** %51, i8** %47, i32 %57)
%66 = icmp eq i32 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %64
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.16, i64 0, i64 0), i32 0)
br label %79
69: ; preds = %64
%70 = icmp sgt i32 %65, 0
br i1 %70, label %71, label %73
71: ; preds = %69
%72 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.26, i64 0, i64 0))
br label %79
73: ; preds = %69
%74 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.25, i64 0, i64 0))
br label %79
75: ; preds = %45
%76 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.24, i64 0, i64 0))
br label %79
77: ; preds = %0
%78 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.27, i64 0, i64 0))
br label %79
79: ; preds = %75, %71, %73, %67, %77, %33, %16
ret void
}