#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *concat(char *, char *);
int /*<<< orphan*/ decode_html_entities_utf8(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, ...);
int /*<<< orphan*/ free(char *);
char *get_manga_name();
char *get_series_folder();
char *get_substring(char *, char *, char *, int);
int /*<<< orphan*/ mangasee_info_search_and_write(char *, char *, char *,
                                                  char *, char *,
                                                  int /*<<< orphan*/ *);
int /*<<< orphan*/ *strchr(char *, char);
void download_mangasee_information(char *seriesPage) {
  char *fileName = "information.txt";
  char *filePath = concat(get_series_folder(), fileName);
  FILE *infoFile = fopen(filePath, "w");
  if (infoFile == NULL) {
    free(filePath);
    return;
  }
  fprintf(infoFile, "Name: %s\n", get_manga_name());
  char *alternativeNamesPart =
      get_substring(seriesPage, "Alternate Name", "</div>", -1);
  if (alternativeNamesPart != NULL) {
    char *alternativeNames =
        get_substring(alternativeNamesPart, "</b>", "\n", -1);
    free(alternativeNamesPart);
    if (alternativeNames != NULL) {
      decode_html_entities_utf8(alternativeNames, NULL);
      char *plural = "s";
      if (strchr(alternativeNames, ',') == NULL) {
        plural = "";
      }
      if (alternativeNames[0] != ' ') {
        char *toFree = alternativeNames;
        alternativeNames = concat(" ", alternativeNames);
        free(toFree);
      }
      fprintf(infoFile, "Alternative Name%s:%s\n", plural, alternativeNames);
      free(alternativeNames);
    }
  }
  char *authorPart = get_substring(seriesPage, "Author", "</div>", -1);
  if (authorPart != NULL) {
    mangasee_info_search_and_write(authorPart, "'>", "<",
                                   "Author: ", "Authors: ", infoFile);
    free(authorPart);
  }
  char *genrePart = get_substring(seriesPage, "Genre", "</div>", -1);
  if (genrePart != NULL) {
    mangasee_info_search_and_write(genrePart, "'>", "<",
                                   "Genre: ", "Genres: ", infoFile);
    free(genrePart);
  }
  char *typePart = get_substring(seriesPage, "Type:", "</div>", -1);
  if (typePart != NULL) {
    char *comicType = get_substring(typePart, "\">:", "</a>", -1);
    free(typePart);
    if (comicType != NULL) {
      decode_html_entities_utf8(comicType, NULL);
      fprintf(infoFile, "Type: %s\n", comicType);
      free(comicType);
    }
  }
  char *releasePart = get_substring(seriesPage, "Released", "</div>", -1);
  if (releasePart != NULL) {
    char *yearReleased = get_substring(releasePart, "\">", "</a>", -1);
    free(releasePart);
    if (yearReleased != NULL) {
      decode_html_entities_utf8(yearReleased, NULL);
      fprintf(infoFile, "Released: %s\n", yearReleased);
      free(yearReleased);
    }
  }
  char *statusPart = get_substring(seriesPage, "Status", "</div>", -1);
  if (statusPart != NULL) {
    mangasee_info_search_and_write(statusPart, "\">", "</a>",
                                   "Status: ", "Status: ", infoFile);
    free(statusPart);
  }
  char *description = get_substring(seriesPage, "description\">", "</div>", -1);
  if (description != NULL) {
    decode_html_entities_utf8(description, NULL);
    fprintf(infoFile, "Description:\n%s\n", description);
    free(description);
  }
  fflush(infoFile);
  fclose(infoFile);
  free(filePath);
}


x86 assembly (clang, -O0):
<download_mangasee_information>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xe2a(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   10a0 <get_series_folder@plt>
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1070 <concat@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe14(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    121e <download_mangasee_information+0x5e>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
jmp    15e4 <download_mangasee_information+0x424>
mov    -0x20(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    $0x0,%al
call   10c0 <get_manga_name@plt>
mov    -0x88(%rbp),%rdi
mov    %rax,%rdx
lea    0xdd1(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xdc9(%rip),%rsi
lea    0xdd1(%rip),%rdx
mov    $0xffffffff,%ecx
call   10e0 <get_substring@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     133f <download_mangasee_information+0x17f>
mov    -0x28(%rbp),%rdi
lea    0xdb4(%rip),%rsi
lea    0xe5c(%rip),%rdx
mov    $0xffffffff,%ecx
call   10e0 <get_substring@plt>
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x30(%rbp)
je     133a <download_mangasee_information+0x17a>
mov    -0x30(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <decode_html_entities_utf8@plt>
lea    0xdfe(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rdi
mov    $0x2c,%esi
call   1050 <strchr@plt>
cmp    $0x0,%rax
jne    12e2 <download_mangasee_information+0x122>
lea    0xe04(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1317 <download_mangasee_information+0x157>
mov    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rsi
lea    0xd74(%rip),%rdi
call   1070 <concat@plt>
mov    %rax,-0x30(%rbp)
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    0xd0d(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
jmp    133f <download_mangasee_information+0x17f>
mov    -0x8(%rbp),%rdi
lea    0xd04(%rip),%rsi
lea    0xcda(%rip),%rdx
mov    $0xffffffff,%ecx
call   10e0 <get_substring@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
je     139c <download_mangasee_information+0x1dc>
mov    -0x48(%rbp),%rdi
mov    -0x20(%rbp),%r9
lea    0xcdc(%rip),%rsi
lea    0xcd8(%rip),%rdx
lea    0xcd3(%rip),%rcx
lea    0xcd5(%rip),%r8
call   10b0 <mangasee_info_search_and_write@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
lea    0xcc6(%rip),%rsi
lea    0xc7d(%rip),%rdx
mov    $0xffffffff,%ecx
call   10e0 <get_substring@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
je     13f9 <download_mangasee_information+0x239>
mov    -0x50(%rbp),%rdi
mov    -0x20(%rbp),%r9
lea    0xc7f(%rip),%rsi
lea    0xc7b(%rip),%rdx
lea    0xc8f(%rip),%rcx
lea    0xc90(%rip),%r8
call   10b0 <mangasee_info_search_and_write@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
lea    0xc80(%rip),%rsi
lea    0xc20(%rip),%rdx
mov    $0xffffffff,%ecx
call   10e0 <get_substring@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
je     1489 <download_mangasee_information+0x2c9>
mov    -0x58(%rbp),%rdi
lea    0xc5b(%rip),%rsi
lea    0xc58(%rip),%rdx
mov    $0xffffffff,%ecx
call   10e0 <get_substring@plt>
mov    %rax,-0x60(%rbp)
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x60(%rbp)
je     1484 <download_mangasee_information+0x2c4>
mov    -0x60(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <decode_html_entities_utf8@plt>
mov    -0x20(%rbp),%rdi
mov    -0x60(%rbp),%rdx
lea    0xc1f(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
jmp    1489 <download_mangasee_information+0x2c9>
mov    -0x8(%rbp),%rdi
lea    0xc09(%rip),%rsi
lea    0xb90(%rip),%rdx
mov    $0xffffffff,%ecx
call   10e0 <get_substring@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
je     1519 <download_mangasee_information+0x359>
mov    -0x68(%rbp),%rdi
lea    0xc10(%rip),%rsi
lea    0xbc8(%rip),%rdx
mov    $0xffffffff,%ecx
call   10e0 <get_substring@plt>
mov    %rax,-0x70(%rbp)
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x70(%rbp)
je     1514 <download_mangasee_information+0x354>
mov    -0x70(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <decode_html_entities_utf8@plt>
mov    -0x20(%rbp),%rdi
mov    -0x70(%rbp),%rdx
lea    0xba2(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
jmp    1519 <download_mangasee_information+0x359>
mov    -0x8(%rbp),%rdi
lea    0xb90(%rip),%rsi
lea    0xb00(%rip),%rdx
mov    $0xffffffff,%ecx
call   10e0 <get_substring@plt>
mov    %rax,-0x78(%rbp)
cmpq   $0x0,-0x78(%rbp)
je     1572 <download_mangasee_information+0x3b2>
mov    -0x78(%rbp),%rdi
mov    -0x20(%rbp),%r9
lea    0xb7c(%rip),%rsi
lea    0xb34(%rip),%rdx
lea    0xb5a(%rip),%r8
mov    %r8,%rcx
call   10b0 <mangasee_info_search_and_write@plt>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
lea    0xb47(%rip),%rsi
lea    0xaa7(%rip),%rdx
mov    $0xffffffff,%ecx
call   10e0 <get_substring@plt>
mov    %rax,-0x80(%rbp)
cmpq   $0x0,-0x80(%rbp)
je     15c9 <download_mangasee_information+0x409>
mov    -0x80(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <decode_html_entities_utf8@plt>
mov    -0x20(%rbp),%rdi
mov    -0x80(%rbp),%rdx
lea    0xb19(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x80(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1090 <fflush@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<download_mangasee_information>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r15
xor    %eax,%eax
call   10a0 <get_series_folder@plt>
lea    0xe24(%rip),%rsi
mov    %rax,%rdi
call   1070 <concat@plt>
mov    %rax,%r14
lea    0xe22(%rip),%rsi
mov    %rax,%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
je     1510 <download_mangasee_information+0x350>
mov    %rax,%r12
xor    %eax,%eax
call   10c0 <get_manga_name@plt>
lea    0xe02(%rip),%rsi
mov    %r12,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0xdf8(%rip),%rsi
lea    0xe00(%rip),%rdx
mov    %r15,%rdi
mov    $0xffffffff,%ecx
call   10e0 <get_substring@plt>
test   %rax,%rax
je     12dd <download_mangasee_information+0x11d>
mov    %rax,%rbx
lea    0xde7(%rip),%rsi
lea    0xe8f(%rip),%rdx
mov    %rax,%rdi
mov    $0xffffffff,%ecx
call   10e0 <get_substring@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1030 <free@plt>
test   %rbp,%rbp
je     12dd <download_mangasee_information+0x11d>
mov    %rbp,%rdi
xor    %esi,%esi
call   1060 <decode_html_entities_utf8@plt>
mov    %rbp,%rdi
mov    $0x2c,%esi
call   1050 <strchr@plt>
test   %rax,%rax
lea    0xe52(%rip),%rax
lea    0xe22(%rip),%r13
cmove  %rax,%r13
cmpb   $0x20,0x0(%rbp)
je     12be <download_mangasee_information+0xfe>
lea    0xdd1(%rip),%rdi
mov    %rbp,%rsi
call   1070 <concat@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %rbx,%rbp
lea    0xd72(%rip),%rsi
mov    %r12,%rdi
mov    %r13,%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
lea    0xd6a(%rip),%rsi
lea    0xd40(%rip),%rdx
mov    %r15,%rdi
mov    $0xffffffff,%ecx
call   10e0 <get_substring@plt>
test   %rax,%rax
je     132f <download_mangasee_information+0x16f>
mov    %rax,%rbx
lea    0xd4e(%rip),%rsi
lea    0xd4a(%rip),%rdx
lea    0xd45(%rip),%rcx
lea    0xd47(%rip),%r8
mov    %rax,%rdi
mov    %r12,%r9
call   10b0 <mangasee_info_search_and_write@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xd37(%rip),%rsi
lea    0xcee(%rip),%rdx
mov    %r15,%rdi
mov    $0xffffffff,%ecx
call   10e0 <get_substring@plt>
test   %rax,%rax
je     1381 <download_mangasee_information+0x1c1>
mov    %rax,%rbx
lea    0xcfc(%rip),%rsi
lea    0xcf8(%rip),%rdx
lea    0xd0c(%rip),%rcx
lea    0xd0d(%rip),%r8
mov    %rax,%rdi
mov    %r12,%r9
call   10b0 <mangasee_info_search_and_write@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xcfc(%rip),%rsi
lea    0xc9c(%rip),%rdx
mov    %r15,%rdi
mov    $0xffffffff,%ecx
call   10e0 <get_substring@plt>
test   %rax,%rax
je     13f5 <download_mangasee_information+0x235>
mov    %rax,%rbp
lea    0xcdf(%rip),%rsi
lea    0xcdc(%rip),%rdx
mov    %rax,%rdi
mov    $0xffffffff,%ecx
call   10e0 <get_substring@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   1030 <free@plt>
test   %rbx,%rbx
je     13f5 <download_mangasee_information+0x235>
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <decode_html_entities_utf8@plt>
lea    0xcb3(%rip),%rsi
mov    %r12,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xca1(%rip),%rsi
lea    0xc28(%rip),%rdx
mov    %r15,%rdi
mov    $0xffffffff,%ecx
call   10e0 <get_substring@plt>
test   %rax,%rax
je     1469 <download_mangasee_information+0x2a9>
mov    %rax,%rbp
lea    0xcb0(%rip),%rsi
lea    0xc68(%rip),%rdx
mov    %rax,%rdi
mov    $0xffffffff,%ecx
call   10e0 <get_substring@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   1030 <free@plt>
test   %rbx,%rbx
je     1469 <download_mangasee_information+0x2a9>
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <decode_html_entities_utf8@plt>
lea    0xc52(%rip),%rsi
mov    %r12,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xc44(%rip),%rsi
lea    0xbb4(%rip),%rdx
mov    %r15,%rdi
mov    $0xffffffff,%ecx
call   10e0 <get_substring@plt>
test   %rax,%rax
je     14b7 <download_mangasee_information+0x2f7>
mov    %rax,%rbx
lea    0xc3c(%rip),%rsi
lea    0xbf4(%rip),%rdx
lea    0xc1a(%rip),%rcx
mov    %rax,%rdi
mov    %rcx,%r8
mov    %r12,%r9
call   10b0 <mangasee_info_search_and_write@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xc06(%rip),%rsi
lea    0xb66(%rip),%rdx
mov    %r15,%rdi
mov    $0xffffffff,%ecx
call   10e0 <get_substring@plt>
test   %rax,%rax
je     1500 <download_mangasee_information+0x340>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
call   1060 <decode_html_entities_utf8@plt>
lea    0xbe7(%rip),%rsi
mov    %r12,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1090 <fflush@plt>
mov    %r12,%rdi
call   1040 <fclose@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"information.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [10 x i8] c"Name: %s\0A\00"
@.str.3 = [15 x i8] c"Alternate Name\00"
@.str.4 = [7 x i8] c"</div>\00"
@.str.5 = [5 x i8] c"</b>\00"
@.str.6 = [2 x i8] c"\0A\00"
@.str.7 = [2 x i8] c"s\00"
@.str.8 = [1 x i8] zeroinitializer
@.str.9 = [2 x i8] c" \00"
@.str.10 = [23 x i8] c"Alternative Name%s:%s\0A\00"
@.str.11 = [7 x i8] c"Author\00"
@.str.12 = [3 x i8] c"'>\00"
@.str.13 = [2 x i8] c"<\00"
@.str.14 = [9 x i8] c"Author: \00"
@.str.15 = [10 x i8] c"Authors: \00"
@.str.16 = [6 x i8] c"Genre\00"
@.str.17 = [8 x i8] c"Genre: \00"
@.str.18 = [9 x i8] c"Genres: \00"
@.str.19 = [6 x i8] c"Type:\00"
@.str.20 = [4 x i8] c"\22>:\00"
@.str.21 = [5 x i8] c"</a>\00"
@.str.22 = [10 x i8] c"Type: %s\0A\00"
@.str.23 = [9 x i8] c"Released\00"
@.str.24 = [3 x i8] c"\22>\00"
@.str.25 = [14 x i8] c"Released: %s\0A\00"
@.str.26 = [7 x i8] c"Status\00"
@.str.27 = [9 x i8] c"Status: \00"
@.str.28 = [14 x i8] c"description\22>\00"
@.str.29 = [17 x i8] c"Description:\0A%s\0A\00"
define void @download_mangasee_information(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %3
%18 = call i8* (...) @get_series_folder()
%19 = load i8*, i8** %3
%20 = call i8* @concat(i8* %18, i8* %19)
store i8* %20, i8** %4
%21 = load i8*, i8** %4
%22 = call i32* @fopen(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %22, i32** %5
%23 = load i32*, i32** %5
%24 = icmp eq i32* %23, null
br i1 %24, label %25, label %28
25: ; preds = %1
%26 = load i8*, i8** %4
%27 = call i32 @free(i8* %26)
br label %165
28: ; preds = %1
%29 = load i32*, i32** %5
%30 = call i8* (...) @get_manga_name()
%31 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %30)
%32 = load i8*, i8** %2
%33 = call i8* @get_substring(i8* %32, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 -1)
store i8* %33, i8** %6
%34 = load i8*, i8** %6
%35 = icmp ne i8* %34, null
br i1 %35, label %36, label %70
36: ; preds = %28
%37 = load i8*, i8** %6
%38 = call i8* @get_substring(i8* %37, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i32 -1)
store i8* %38, i8** %7
%39 = load i8*, i8** %6
%40 = call i32 @free(i8* %39)
%41 = load i8*, i8** %7
%42 = icmp ne i8* %41, null
br i1 %42, label %43, label %69
43: ; preds = %36
%44 = load i8*, i8** %7
%45 = call i32 @decode_html_entities_utf8(i8* %44, i32* null)
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8** %8
%46 = load i8*, i8** %7
%47 = call i32* @strchr(i8* %46, i8 signext 44)
%48 = icmp eq i32* %47, null
br i1 %48, label %49, label %50
49: ; preds = %43
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0), i8** %8
br label %50
50: ; preds = %49, %43
%51 = load i8*, i8** %7
%52 = getelementptr inbounds i8, i8* %51, i64 0
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = icmp ne i32 %54, 32
br i1 %55, label %56, label %62
56: ; preds = %50
%57 = load i8*, i8** %7
store i8* %57, i8** %9
%58 = load i8*, i8** %7
%59 = call i8* @concat(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i8* %58)
store i8* %59, i8** %7
%60 = load i8*, i8** %9
%61 = call i32 @free(i8* %60)
br label %62
62: ; preds = %56, %50
%63 = load i32*, i32** %5
%64 = load i8*, i8** %8
%65 = load i8*, i8** %7
%66 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %63, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0), i8* %64, i8* %65)
%67 = load i8*, i8** %7
%68 = call i32 @free(i8* %67)
br label %69
69: ; preds = %62, %36
br label %70
70: ; preds = %69, %28
%71 = load i8*, i8** %2
%72 = call i8* @get_substring(i8* %71, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 -1)
store i8* %72, i8** %10
%73 = load i8*, i8** %10
%74 = icmp ne i8* %73, null
br i1 %74, label %75, label %81
75: ; preds = %70
%76 = load i8*, i8** %10
%77 = load i32*, i32** %5
%78 = call i32 @mangasee_info_search_and_write(i8* %76, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0), i32* %77)
%79 = load i8*, i8** %10
%80 = call i32 @free(i8* %79)
br label %81
81: ; preds = %75, %70
%82 = load i8*, i8** %2
%83 = call i8* @get_substring(i8* %82, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 -1)
store i8* %83, i8** %11
%84 = load i8*, i8** %11
%85 = icmp ne i8* %84, null
br i1 %85, label %86, label %92
86: ; preds = %81
%87 = load i8*, i8** %11
%88 = load i32*, i32** %5
%89 = call i32 @mangasee_info_search_and_write(i8* %87, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i64 0, i64 0), i32* %88)
%90 = load i8*, i8** %11
%91 = call i32 @free(i8* %90)
br label %92
92: ; preds = %86, %81
%93 = load i8*, i8** %2
%94 = call i8* @get_substring(i8* %93, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 -1)
store i8* %94, i8** %12
%95 = load i8*, i8** %12
%96 = icmp ne i8* %95, null
br i1 %96, label %97, label %113
97: ; preds = %92
%98 = load i8*, i8** %12
%99 = call i8* @get_substring(i8* %98, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i32 -1)
store i8* %99, i8** %13
%100 = load i8*, i8** %12
%101 = call i32 @free(i8* %100)
%102 = load i8*, i8** %13
%103 = icmp ne i8* %102, null
br i1 %103, label %104, label %112
104: ; preds = %97
%105 = load i8*, i8** %13
%106 = call i32 @decode_html_entities_utf8(i8* %105, i32* null)
%107 = load i32*, i32** %5
%108 = load i8*, i8** %13
%109 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %107, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.22, i64 0, i64 0), i8* %108)
%110 = load i8*, i8** %13
%111 = call i32 @free(i8* %110)
br label %112
112: ; preds = %104, %97
br label %113
113: ; preds = %112, %92
%114 = load i8*, i8** %2
%115 = call i8* @get_substring(i8* %114, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 -1)
store i8* %115, i8** %14
%116 = load i8*, i8** %14
%117 = icmp ne i8* %116, null
br i1 %117, label %118, label %134
118: ; preds = %113
%119 = load i8*, i8** %14
%120 = call i8* @get_substring(i8* %119, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.24, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i32 -1)
store i8* %120, i8** %15
%121 = load i8*, i8** %14
%122 = call i32 @free(i8* %121)
%123 = load i8*, i8** %15
%124 = icmp ne i8* %123, null
br i1 %124, label %125, label %133
125: ; preds = %118
%126 = load i8*, i8** %15
%127 = call i32 @decode_html_entities_utf8(i8* %126, i32* null)
%128 = load i32*, i32** %5
%129 = load i8*, i8** %15
%130 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %128, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.25, i64 0, i64 0), i8* %129)
%131 = load i8*, i8** %15
%132 = call i32 @free(i8* %131)
br label %133
133: ; preds = %125, %118
br label %134
134: ; preds = %133, %113
%135 = load i8*, i8** %2
%136 = call i8* @get_substring(i8* %135, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 -1)
store i8* %136, i8** %16
%137 = load i8*, i8** %16
%138 = icmp ne i8* %137, null
br i1 %138, label %139, label %145
139: ; preds = %134
%140 = load i8*, i8** %16
%141 = load i32*, i32** %5
%142 = call i32 @mangasee_info_search_and_write(i8* %140, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.24, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.27, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.27, i64 0, i64 0), i32* %141)
%143 = load i8*, i8** %16
%144 = call i32 @free(i8* %143)
br label %145
145: ; preds = %139, %134
%146 = load i8*, i8** %2
%147 = call i8* @get_substring(i8* %146, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.28, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 -1)
store i8* %147, i8** %17
%148 = load i8*, i8** %17
%149 = icmp ne i8* %148, null
br i1 %149, label %150, label %158
150: ; preds = %145
%151 = load i8*, i8** %17
%152 = call i32 @decode_html_entities_utf8(i8* %151, i32* null)
%153 = load i32*, i32** %5
%154 = load i8*, i8** %17
%155 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %153, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.29, i64 0, i64 0), i8* %154)
%156 = load i8*, i8** %17
%157 = call i32 @free(i8* %156)
br label %158
158: ; preds = %150, %145
%159 = load i32*, i32** %5
%160 = call i32 @fflush(i32* %159)
%161 = load i32*, i32** %5
%162 = call i32 @fclose(i32* %161)
%163 = load i8*, i8** %4
%164 = call i32 @free(i8* %163)
br label %165
165: ; preds = %158, %25
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"information.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [10 x i8] c"Name: %s\0A\00"
@.str.3 = [15 x i8] c"Alternate Name\00"
@.str.4 = [7 x i8] c"</div>\00"
@.str.5 = [5 x i8] c"</b>\00"
@.str.6 = [2 x i8] c"\0A\00"
@.str.7 = [2 x i8] c"s\00"
@.str.8 = [1 x i8] zeroinitializer
@.str.9 = [2 x i8] c" \00"
@.str.10 = [23 x i8] c"Alternative Name%s:%s\0A\00"
@.str.11 = [7 x i8] c"Author\00"
@.str.12 = [3 x i8] c"'>\00"
@.str.13 = [2 x i8] c"<\00"
@.str.14 = [9 x i8] c"Author: \00"
@.str.15 = [10 x i8] c"Authors: \00"
@.str.16 = [6 x i8] c"Genre\00"
@.str.17 = [8 x i8] c"Genre: \00"
@.str.18 = [9 x i8] c"Genres: \00"
@.str.19 = [6 x i8] c"Type:\00"
@.str.20 = [4 x i8] c"\22>:\00"
@.str.21 = [5 x i8] c"</a>\00"
@.str.22 = [10 x i8] c"Type: %s\0A\00"
@.str.23 = [9 x i8] c"Released\00"
@.str.24 = [3 x i8] c"\22>\00"
@.str.25 = [14 x i8] c"Released: %s\0A\00"
@.str.26 = [7 x i8] c"Status\00"
@.str.27 = [9 x i8] c"Status: \00"
@.str.28 = [14 x i8] c"description\22>\00"
@.str.29 = [17 x i8] c"Description:\0A%s\0A\00"
define void @download_mangasee_information(i8* %0) {
%2 = tail call i8* (...) @get_series_folder()
%3 = tail call i8* @concat(i8* %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32* @fopen(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %79, label %6
6: ; preds = %1
%7 = tail call i8* (...) @get_manga_name()
%8 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = tail call i8* @get_substring(i8* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 -1)
%10 = icmp eq i8* %9, null
br i1 %10, label %29, label %11
11: ; preds = %6
%12 = tail call i8* @get_substring(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i32 -1)
%13 = tail call i32 @free(i8* %9)
%14 = icmp eq i8* %12, null
br i1 %14, label %29, label %15
15: ; preds = %11
%16 = tail call i32 @decode_html_entities_utf8(i8* %12, i32* null)
%17 = tail call i32* @strchr(i8* %12, i8 signext 44)
%18 = icmp eq i32* %17, null
%19 = select i1 %18, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0)
%20 = load i8, i8* %12
%21 = icmp eq i8 %20, 32
br i1 %21, label %25, label %22
22: ; preds = %15
%23 = tail call i8* @concat(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i8* %12)
%24 = tail call i32 @free(i8* %12)
br label %25
25: ; preds = %22, %15
%26 = phi i8* [ %23, %22 ], [ %12, %15 ]
%27 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0), i8* %19, i8* %26)
%28 = tail call i32 @free(i8* %26)
br label %29
29: ; preds = %11, %25, %6
%30 = tail call i8* @get_substring(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 -1)
%31 = icmp eq i8* %30, null
br i1 %31, label %35, label %32
32: ; preds = %29
%33 = tail call i32 @mangasee_info_search_and_write(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0), i32* %4)
%34 = tail call i32 @free(i8* %30)
br label %35
35: ; preds = %32, %29
%36 = tail call i8* @get_substring(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 -1)
%37 = icmp eq i8* %36, null
br i1 %37, label %41, label %38
38: ; preds = %35
%39 = tail call i32 @mangasee_info_search_and_write(i8* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i64 0, i64 0), i32* %4)
%40 = tail call i32 @free(i8* %36)
br label %41
41: ; preds = %38, %35
%42 = tail call i8* @get_substring(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 -1)
%43 = icmp eq i8* %42, null
br i1 %43, label %52, label %44
44: ; preds = %41
%45 = tail call i8* @get_substring(i8* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i32 -1)
%46 = tail call i32 @free(i8* %42)
%47 = icmp eq i8* %45, null
br i1 %47, label %52, label %48
48: ; preds = %44
%49 = tail call i32 @decode_html_entities_utf8(i8* %45, i32* null)
%50 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.22, i64 0, i64 0), i8* %45)
%51 = tail call i32 @free(i8* %45)
br label %52
52: ; preds = %44, %48, %41
%53 = tail call i8* @get_substring(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 -1)
%54 = icmp eq i8* %53, null
br i1 %54, label %63, label %55
55: ; preds = %52
%56 = tail call i8* @get_substring(i8* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.24, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i32 -1)
%57 = tail call i32 @free(i8* %53)
%58 = icmp eq i8* %56, null
br i1 %58, label %63, label %59
59: ; preds = %55
%60 = tail call i32 @decode_html_entities_utf8(i8* %56, i32* null)
%61 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.25, i64 0, i64 0), i8* %56)
%62 = tail call i32 @free(i8* %56)
br label %63
63: ; preds = %55, %59, %52
%64 = tail call i8* @get_substring(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 -1)
%65 = icmp eq i8* %64, null
br i1 %65, label %69, label %66
66: ; preds = %63
%67 = tail call i32 @mangasee_info_search_and_write(i8* %64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.24, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.27, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.27, i64 0, i64 0), i32* %4)
%68 = tail call i32 @free(i8* %64)
br label %69
69: ; preds = %66, %63
%70 = tail call i8* @get_substring(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.28, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 -1)
%71 = icmp eq i8* %70, null
br i1 %71, label %76, label %72
72: ; preds = %69
%73 = tail call i32 @decode_html_entities_utf8(i8* %70, i32* null)
%74 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.29, i64 0, i64 0), i8* %70)
%75 = tail call i32 @free(i8* %70)
br label %76
76: ; preds = %72, %69
%77 = tail call i32 @fflush(i32* %4)
%78 = tail call i32 @fclose(i32* %4)
br label %79
79: ; preds = %1, %76
%80 = tail call i32 @free(i8* %3)
ret void
}