#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 /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcat(char *, char *);
char *strcpy(char *, char *);
scalar_t__ strlen(char *);
int /*<<< orphan*/ strsub(char *, char *, int, int);
char *ReadSubKey(char *Result, char *line, int *start_from, char begin_char,
                 char end_char, int compliance) {
  char line_local[4096];
  int i;
  int j;
  char data[4096];
  strcpy(line_local, line);
  strcat(line_local, " ");
  i = *start_from;
  if (i >= (int)strlen(line_local)) {
    Result[0] = '\0';
    return Result;
  }
  if (i < 1) {
    printf("auxfunc.c - ReadSubKey -- start_from is zero: %s\n", line);
    exit(EXIT_FAILURE);
  }
  while ((line_local[i - 1] != begin_char) && (i < (int)strlen(line_local)))
    i++;
  if (i != (int)strlen(line_local))
    j = i + 1;
  else
    j = i;
  while ((line_local[j - 1] != end_char) && (j < (int)strlen(line_local)))
    j++;
  switch (compliance) {
  case 0:
    break;
  case 1:
    if (line_local[i - 1] != begin_char) {
      printf("First not equal\n");
      printf("auxfunc.c - ReadSubKey -- Incorrect line format: %s\n", line);
      exit(EXIT_FAILURE);
    }
    break;
  case 2:
    if (line_local[j - 1] != end_char) {
      printf("Last not equal\n");
      printf("auxfunc.c - ReadSubKey -- Incorrect line format: %s\n", line);
      exit(EXIT_FAILURE);
    }
    break;
  case 3:
    if (i == (j - 1)) {
      printf("Size is zero\n");
      printf("auxfunc.c - ReadSubKey -- Incorrect line format: %s\n", line);
      exit(EXIT_FAILURE);
    }
    break;
  case 4:
    if (line_local[i - 1] != begin_char) {
      printf("First not equal\n");
      printf("auxfunc.c - ReadSubKey -- Incorrect line format: %s\n", line);
      exit(EXIT_FAILURE);
    }
    if (i == (j - 1)) {
      printf("Size is zero\n");
      printf("auxfunc.c - ReadSubKey -- Incorrect line format: %s\n", line);
      exit(EXIT_FAILURE);
    }
    break;
  case 5:
    if (line_local[i - 1] != begin_char) {
      printf("First not equal\n");
      printf("auxfunc.c - ReadSubKey -- Incorrect line format: %s\n", line);
      exit(EXIT_FAILURE);
    }
    if (line_local[j - 1] != end_char) {
      printf("Last not equal\n");
      printf("auxfunc.c - ReadSubKey -- Incorrect line format: %s\n", line);
      exit(EXIT_FAILURE);
    }
    if (i == (j - 1)) {
      printf("Size is zero\n");
      printf("auxfunc.c - ReadSubKey -- Incorrect line format: %s\n", line);
      exit(EXIT_FAILURE);
    }
    break;
  default:
    printf("auxfunc.c - ReadSubKey -- Something unexpected has happened!\n");
    exit(EXIT_FAILURE);
  }
  *start_from = j;
  strsub(data, line_local, (int)(i + 1), (int)(j - i - 1));
  return strcpy(Result, data);
}


x86 assembly (clang, -O0):
<ReadSubKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2060,%rsp
mov    %r8b,%al
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %cl,-0x21(%rbp)
mov    %al,-0x22(%rbp)
mov    %r9d,-0x28(%rbp)
lea    -0x1030(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x1030(%rbp),%rdi
lea    0xe76(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1034(%rbp)
mov    -0x1034(%rbp),%eax
mov    %eax,-0x2044(%rbp)
lea    -0x1030(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x2044(%rbp),%eax
cmp    %ecx,%eax
jl     11f0 <ReadSubKey+0x90>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1664 <ReadSubKey+0x504>
cmpl   $0x1,-0x1034(%rbp)
jge    121d <ReadSubKey+0xbd>
mov    -0x18(%rbp),%rsi
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2dca(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
jmp    1222 <ReadSubKey+0xc2>
mov    -0x1034(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x1030(%rbp,%rax,1),%ecx
ff
movsbl -0x21(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x2045(%rbp)
je     1275 <ReadSubKey+0x115>
mov    -0x1034(%rbp),%eax
mov    %eax,-0x204c(%rbp)
lea    -0x1030(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x204c(%rbp),%eax
cmp    %ecx,%eax
setl   %al
mov    %al,-0x2045(%rbp)
mov    -0x2045(%rbp),%al
test   $0x1,%al
jne    1288 <ReadSubKey+0x128>
jmp    129c <ReadSubKey+0x13c>
mov    -0x1034(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1034(%rbp)
jmp    1222 <ReadSubKey+0xc2>
mov    -0x1034(%rbp),%eax
mov    %eax,-0x2050(%rbp)
lea    -0x1030(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x2050(%rbp),%eax
cmp    %ecx,%eax
je     12d9 <ReadSubKey+0x179>
mov    -0x1034(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1038(%rbp)
jmp    12e5 <ReadSubKey+0x185>
mov    -0x1034(%rbp),%eax
mov    %eax,-0x1038(%rbp)
jmp    12ea <ReadSubKey+0x18a>
mov    -0x1038(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x1030(%rbp,%rax,1),%ecx
ff
movsbl -0x22(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x2051(%rbp)
je     133d <ReadSubKey+0x1dd>
mov    -0x1038(%rbp),%eax
mov    %eax,-0x2058(%rbp)
lea    -0x1030(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x2058(%rbp),%eax
cmp    %ecx,%eax
setl   %al
mov    %al,-0x2051(%rbp)
mov    -0x2051(%rbp),%al
test   $0x1,%al
jne    1350 <ReadSubKey+0x1f0>
jmp    1364 <ReadSubKey+0x204>
mov    -0x1038(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1038(%rbp)
jmp    12ea <ReadSubKey+0x18a>
mov    -0x28(%rbp),%eax
mov    %rax,-0x2060(%rbp)
sub    $0x5,%rax
ja     15fd <ReadSubKey+0x49d>
mov    -0x2060(%rbp),%rax
lea    0xc7a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    1619 <ReadSubKey+0x4b9>
mov    -0x1034(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x1030(%rbp,%rax,1),%eax
ff
movsbl -0x21(%rbp),%ecx
cmp    %ecx,%eax
je     13e1 <ReadSubKey+0x281>
lea    0xc92(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xc91(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2c06(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
jmp    1619 <ReadSubKey+0x4b9>
mov    -0x1038(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x1030(%rbp,%rax,1),%eax
ff
movsbl -0x22(%rbp),%ecx
cmp    %ecx,%eax
je     1433 <ReadSubKey+0x2d3>
lea    0xc86(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xc3f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2bb4(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
jmp    1619 <ReadSubKey+0x4b9>
mov    -0x1034(%rbp),%eax
mov    -0x1038(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    147d <ReadSubKey+0x31d>
lea    0xc4c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xbf5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2b6a(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
jmp    1619 <ReadSubKey+0x4b9>
mov    -0x1034(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x1030(%rbp,%rax,1),%eax
ff
movsbl -0x21(%rbp),%ecx
cmp    %ecx,%eax
je     14cf <ReadSubKey+0x36f>
lea    0xba4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xba3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2b18(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x1034(%rbp),%eax
mov    -0x1038(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    1514 <ReadSubKey+0x3b4>
lea    0xbb5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xb5e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2ad3(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
jmp    1619 <ReadSubKey+0x4b9>
mov    -0x1034(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x1030(%rbp,%rax,1),%eax
ff
movsbl -0x21(%rbp),%ecx
cmp    %ecx,%eax
je     1566 <ReadSubKey+0x406>
lea    0xb0d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xb0c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2a81(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x1038(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x1030(%rbp,%rax,1),%eax
ff
movsbl -0x22(%rbp),%ecx
cmp    %ecx,%eax
je     15b3 <ReadSubKey+0x453>
lea    0xb06(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xabf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2a34(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x1034(%rbp),%eax
mov    -0x1038(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    15f8 <ReadSubKey+0x498>
lea    0xad1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xa7a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x29ef(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
jmp    1619 <ReadSubKey+0x4b9>
lea    0xaac(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x29ce(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x1038(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
lea    -0x2040(%rbp),%rdi
lea    -0x1030(%rbp),%rsi
mov    -0x1034(%rbp),%edx
add    $0x1,%edx
mov    -0x1038(%rbp),%ecx
sub    -0x1034(%rbp),%ecx
sub    $0x1,%ecx
call   1060 <strsub@plt>
mov    -0x10(%rbp),%rdi
lea    -0x2040(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2060,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadSubKey>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2028,%rsp
mov    %r9d,0x14(%rsp)
mov    %r8d,%r13d
mov    %ecx,%r15d
mov    %rdx,%rbp
mov    %rdi,%rbx
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    %rsi,0x8(%rsp)
call   1030 <strcpy@plt>
lea    0xe6d(%rip),%rsi
mov    %r14,%rdi
call   1080 <strcat@plt>
mov    %rbp,0x18(%rsp)
mov    0x0(%rbp),%r12d
mov    %r14,%rdi
call   1050 <strlen@plt>
cmp    %eax,%r12d
jge    126b <ReadSubKey+0xfb>
test   %r12d,%r12d
jle    12db <ReadSubKey+0x16b>
mov    %rbx,%r10
movslq %eax,%rsi
nopl   0x0(%rax)
movzbl 0x1f(%rsp,%r12,1),%ebx
lea    0x1(%r12),%rdx
cmp    %r15b,%bl
je     11f8 <ReadSubKey+0x88>
cmp    %rsi,%r12
mov    %rdx,%r12
jl     11e0 <ReadSubKey+0x70>
add    $0x1,%eax
lea    -0x1(%rdx),%r8d
cmp    %edx,%eax
cmovne %edx,%r8d
movslq %r8d,%r9
lea    (%r9,%r14,1),%rbp
add    $0xffffffffffffffff,%rbp
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0x0(%rbp,%rdi,1),%eax
lea    0x1(%rdi),%rcx
cmp    %r13b,%al
je     1239 <ReadSubKey+0xc9>
add    %r9,%rdi
cmp    %rsi,%rdi
mov    %rcx,%rdi
jl     1220 <ReadSubKey+0xb0>
mov    0x14(%rsp),%edi
cmp    $0x5,%edi
ja     1323 <ReadSubKey+0x1b3>
mov    %edx,%esi
sub    %r8d,%esi
add    $0x1,%esi
mov    %edi,%edi
lea    0xda9(%rip),%rbp
movslq 0x0(%rbp,%rdi,4),%rdi
add    %rbp,%rdi
mov    %r10,%rbp
jmp    *%rdi
cmp    %r15b,%bl
je     128f <ReadSubKey+0x11f>
jmp    12e4 <ReadSubKey+0x174>
movb   $0x0,(%rbx)
mov    %rbx,%rbp
jmp    12c6 <ReadSubKey+0x156>
cmp    %r13b,%al
je     128f <ReadSubKey+0x11f>
jmp    12f6 <ReadSubKey+0x186>
cmp    %r15b,%bl
je     128b <ReadSubKey+0x11b>
jmp    12e4 <ReadSubKey+0x174>
cmp    %r15b,%bl
jne    12e4 <ReadSubKey+0x174>
cmp    %r13b,%al
jne    12f6 <ReadSubKey+0x186>
cmp    %ecx,%esi
je     12ed <ReadSubKey+0x17d>
lea    -0x1(%r8),%eax
add    %rcx,%rax
mov    0x18(%rsp),%rsi
mov    %eax,(%rsi)
mov    %edx,%eax
not    %eax
add    %r8d,%eax
add    %eax,%ecx
lea    0x1020(%rsp),%rbx
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <strsub@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbp,%rax
add    $0x2028,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd38(%rip),%rdi
jmp    1309 <ReadSubKey+0x199>
lea    0xdb2(%rip),%rdi
jmp    12fd <ReadSubKey+0x18d>
lea    0xd8d(%rip),%rdi
jmp    12fd <ReadSubKey+0x18d>
lea    0xd91(%rip),%rdi
call   1040 <puts@plt>
lea    0xd43(%rip),%rdi
mov    0x8(%rsp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2cc4(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
lea    0xd83(%rip),%rdi
call   1040 <puts@plt>
jmp    1315 <ReadSubKey+0x1a5>

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [50 x i8] c"auxfunc.c - ReadSubKey -- start_from is zero: %s\0A\00"
@EXIT_FAILURE = global i32 0
@.str.3 = [53 x i8] c"auxfunc.c - ReadSubKey -- Incorrect line format: %s\0A\00"
@str.11 = [13 x i8] c"Size is zero\00"
@str.12 = [15 x i8] c"Last not equal\00"
@str.13 = [16 x i8] c"First not equal\00"
@str.14 = [61 x i8] c"auxfunc.c - ReadSubKey -- Something unexpected has happened!\00"
define i8* @ReadSubKey(i8* returned %0, i8* %1, i32* nocapture %2, i8 signext %3, i8 signext %4, i32 %5) {
%7 = alloca [4096 x i8]
%8 = alloca [4096 x i8]
%9 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%10 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%11 = call i8* @strcpy(i8* %9, i8* dereferenceable(1) %1)
%12 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* %2
%14 = call i64 @strlen(i8* %9)
%15 = trunc i64 %14 to i32
%16 = icmp slt i32 %13, %15
br i1 %16, label %18, label %17
17: ; preds = %6
store i8 0, i8* %0
br label %117
18: ; preds = %6
%19 = icmp slt i32 %13, 1
br i1 %19, label %24, label %20
20: ; preds = %18
%21 = zext i32 %13 to i64
%22 = shl i64 %14, 32
%23 = ashr exact i64 %22, 32
br label %28
24: ; preds = %18
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%26 = load i32, i32* @EXIT_FAILURE
%27 = call i32 @exit(i32 %26)
unreachable
28: ; preds = %20, %28
%29 = phi i64 [ %21, %20 ], [ %37, %28 ]
%30 = add nsw i64 %29, -1
%31 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = icmp eq i8 %32, %3
%34 = xor i1 %33, true
%35 = icmp slt i64 %29, %23
%36 = select i1 %34, i1 %35, i1 false
%37 = add nuw nsw i64 %29, 1
br i1 %36, label %28, label %38
38: ; preds = %28
%39 = trunc i64 %29 to i32
%40 = icmp eq i32 %39, %15
%41 = add nsw i32 %39, 1
%42 = select i1 %40, i32 %39, i32 %41
%43 = sext i32 %42 to i64
br label %44
44: ; preds = %44, %38
%45 = phi i64 [ %53, %44 ], [ %43, %38 ]
%46 = add nsw i64 %45, -1
%47 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 %46
%48 = load i8, i8* %47
%49 = icmp eq i8 %48, %4
%50 = xor i1 %49, true
%51 = icmp slt i64 %45, %23
%52 = select i1 %50, i1 %51, i1 false
%53 = add nsw i64 %45, 1
br i1 %52, label %44, label %54
54: ; preds = %44
%55 = trunc i64 %45 to i32
%56 = trunc i64 %46 to i32
switch i32 %5, label %108 [
i32 0, label %112
i32 1, label %57
i32 2, label %63
i32 3, label %69
i32 4, label %76
i32 5, label %89
]
57: ; preds = %54
br i1 %33, label %112, label %58
58: ; preds = %57
%59 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.13, i64 0, i64 0))
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%61 = load i32, i32* @EXIT_FAILURE
%62 = call i32 @exit(i32 %61)
unreachable
63: ; preds = %54
br i1 %49, label %112, label %64
64: ; preds = %63
%65 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.12, i64 0, i64 0))
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%67 = load i32, i32* @EXIT_FAILURE
%68 = call i32 @exit(i32 %67)
unreachable
69: ; preds = %54
%70 = icmp eq i32 %39, %56
br i1 %70, label %71, label %112
71: ; preds = %69
%72 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.11, i64 0, i64 0))
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%74 = load i32, i32* @EXIT_FAILURE
%75 = call i32 @exit(i32 %74)
unreachable
76: ; preds = %54
br i1 %33, label %82, label %77
77: ; preds = %76
%78 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.13, i64 0, i64 0))
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%80 = load i32, i32* @EXIT_FAILURE
%81 = call i32 @exit(i32 %80)
unreachable
82: ; preds = %76
%83 = icmp eq i32 %39, %56
br i1 %83, label %84, label %112
84: ; preds = %82
%85 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.11, i64 0, i64 0))
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%87 = load i32, i32* @EXIT_FAILURE
%88 = call i32 @exit(i32 %87)
unreachable
89: ; preds = %54
br i1 %33, label %95, label %90
90: ; preds = %89
%91 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.13, i64 0, i64 0))
%92 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%93 = load i32, i32* @EXIT_FAILURE
%94 = call i32 @exit(i32 %93)
unreachable
95: ; preds = %89
br i1 %49, label %101, label %96
96: ; preds = %95
%97 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.12, i64 0, i64 0))
%98 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%99 = load i32, i32* @EXIT_FAILURE
%100 = call i32 @exit(i32 %99)
unreachable
101: ; preds = %95
%102 = icmp eq i32 %39, %56
br i1 %102, label %103, label %112
103: ; preds = %101
%104 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.11, i64 0, i64 0))
%105 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%106 = load i32, i32* @EXIT_FAILURE
%107 = call i32 @exit(i32 %106)
unreachable
108: ; preds = %54
%109 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.14, i64 0, i64 0))
%110 = load i32, i32* @EXIT_FAILURE
%111 = call i32 @exit(i32 %110)
unreachable
112: ; preds = %101, %82, %69, %63, %57, %54
store i32 %55, i32* %2
%113 = xor i32 %39, -1
%114 = add i32 %55, %113
%115 = call i32 @strsub(i8* %10, i8* %9, i32 %41, i32 %114)
%116 = call i8* @strcpy(i8* dereferenceable(1) %0, i8* %10)
br label %117
117: ; preds = %112, %17
ret i8* %0
}