#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*/ free(char *);
char *getenv(char *);
scalar_t__ isspace(char);
scalar_t__ malloc(int);
scalar_t__ realloc(char *, int);
char *strchr(char *, char);
int strlen(char *);
int /*<<< orphan*/ strncat(char *, char *, int);
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
int readDescription(char *start, char *bufstop, char **english_desc,
                    char **serv_desc) {
  char english;
  char my_lang_loaded = 0;
  char is_my_lang = 0;
  char *lang = getenv("LANG");
  char *final_parenthesis;
  char *end, *next;
  int i;
  english = *start == ':';
  end = strchr(start, '\n');
  if (!end)
    next = end = bufstop;
  else
    next = end + 1;
  if (!english) {
    if (*start != '(') {
      return 1;
    }
    ++start;
    final_parenthesis = strchr(start, ')');
    if (final_parenthesis == NULL || final_parenthesis - start > 5) {
      return 1;
    }
    is_my_lang = lang ? strncmp(lang, start, strlen(lang)) == 0 : 0;
    start = final_parenthesis + 2;
  } else
    ++start;
  while (isspace(*start) && start < end)
    start++;
  if (start == end) {
    return 1;
  }
  {
    char *desc = (char *)malloc(end - start + 1);
    strncpy(desc, start, end - start);
    desc[end - start] = '\0';
    start = next;
    while (desc[strlen(desc) - 1] == '\\') {
      desc[strlen(desc) - 1] = '\0';
      start = next;
      while (isspace(*start) && start < bufstop)
        start++;
      if (start == bufstop || *start != '#') {
        return 1;
      }
      start++;
      while (isspace(*start) && start < bufstop)
        start++;
      if (start == bufstop) {
        return 1;
      }
      end = strchr(start, '\n');
      if (!end)
        next = end = bufstop;
      else
        next = end + 1;
      i = strlen(desc);
      desc = (char *)realloc(desc, i + end - start + 1);
      strncat(desc, start, end - start);
      desc[i + end - start] = '\0';
      start = next;
    }
    if (desc) {
      if (my_lang_loaded) {
        free(desc);
      } else if (is_my_lang) {
        if (*serv_desc)
          free(*serv_desc);
        *serv_desc = desc;
        return 0;
      } else if (english) {
        if (*serv_desc)
          free(*serv_desc);
        if (*english_desc)
          free(*english_desc);
        *english_desc = desc;
      } else
        free(desc);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<readDescription>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movb   $0x0,-0x2a(%rbp)
movb   $0x0,-0x2b(%rbp)
lea    0xe36(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x29(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1080 <strchr@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1216 <readDescription+0x76>
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    %rax,-0x50(%rbp)
jmp    1222 <readDescription+0x82>
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x50(%rbp)
cmpb   $0x0,-0x29(%rbp)
jne    12fa <readDescription+0x15a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x28,%eax
je     1248 <readDescription+0xa8>
movl   $0x1,-0x4(%rbp)
jmp    1697 <readDescription+0x4f7>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x29,%esi
call   1080 <strchr@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     1286 <readDescription+0xe6>
mov    -0x40(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x5,%rax
jle    1292 <readDescription+0xf2>
movl   $0x1,-0x4(%rbp)
jmp    1697 <readDescription+0x4f7>
cmpq   $0x0,-0x38(%rbp)
je     12d9 <readDescription+0x139>
mov    -0x38(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x38(%rbp),%rdi
call   1070 <strlen@plt>
mov    -0x78(%rbp),%rdi
mov    -0x70(%rbp),%rsi
mov    %eax,%edx
call   1060 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x64(%rbp)
jmp    12e3 <readDescription+0x143>
xor    %eax,%eax
mov    %eax,-0x64(%rbp)
jmp    12e3 <readDescription+0x143>
mov    -0x64(%rbp),%eax
mov    %al,-0x2b(%rbp)
mov    -0x40(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
jmp    1306 <readDescription+0x166>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    130b <readDescription+0x16b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   10a0 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x79(%rbp)
je     1337 <readDescription+0x197>
mov    -0x10(%rbp),%rax
cmp    -0x48(%rbp),%rax
setb   %al
mov    %al,-0x79(%rbp)
mov    -0x79(%rbp),%al
test   $0x1,%al
jne    1347 <readDescription+0x1a7>
jmp    1358 <readDescription+0x1b8>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    130b <readDescription+0x16b>
mov    -0x10(%rbp),%rax
cmp    -0x48(%rbp),%rax
jne    1372 <readDescription+0x1d2>
movl   $0x1,-0x4(%rbp)
jmp    1697 <readDescription+0x4f7>
mov    -0x48(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
mov    %eax,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x48(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
call   1050 <strncpy@plt>
mov    -0x60(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    -0x10(%rbp),%rdx
sub    %rdx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x50(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x60(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,%ecx
mov    -0x88(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
jne    15cc <readDescription+0x42c>
mov    -0x60(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x60(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,%ecx
mov    -0x90(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x50(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   10a0 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x91(%rbp)
je     1452 <readDescription+0x2b2>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
setb   %al
mov    %al,-0x91(%rbp)
mov    -0x91(%rbp),%al
test   $0x1,%al
jne    1465 <readDescription+0x2c5>
jmp    1476 <readDescription+0x2d6>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1420 <readDescription+0x280>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1494 <readDescription+0x2f4>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
je     14a0 <readDescription+0x300>
movl   $0x1,-0x4(%rbp)
jmp    1697 <readDescription+0x4f7>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   10a0 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x92(%rbp)
je     14de <readDescription+0x33e>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
setb   %al
mov    %al,-0x92(%rbp)
mov    -0x92(%rbp),%al
test   $0x1,%al
jne    14f1 <readDescription+0x351>
jmp    1502 <readDescription+0x362>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    14ac <readDescription+0x30c>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    151c <readDescription+0x37c>
movl   $0x1,-0x4(%rbp)
jmp    1697 <readDescription+0x4f7>
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1080 <strchr@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    154a <readDescription+0x3aa>
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    %rax,-0x50(%rbp)
jmp    1556 <readDescription+0x3b6>
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x50(%rbp)
mov    -0x60(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,-0x54(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x54(%rbp),%ecx
mov    -0x48(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
mov    %eax,%esi
call   10c0 <realloc@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x48(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
call   1090 <strncat@plt>
mov    -0x60(%rbp),%rax
mov    -0x54(%rbp),%edx
mov    -0x48(%rbp),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    -0x10(%rbp),%rdx
sub    %rdx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x50(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    13c1 <readDescription+0x221>
cmpq   $0x0,-0x60(%rbp)
je     1690 <readDescription+0x4f0>
cmpb   $0x0,-0x2a(%rbp)
je     15ef <readDescription+0x44f>
mov    -0x60(%rbp),%rdi
call   1040 <free@plt>
jmp    168b <readDescription+0x4eb>
cmpb   $0x0,-0x2b(%rbp)
je     162a <readDescription+0x48a>
mov    -0x28(%rbp),%rax
cmpq   $0x0,(%rax)
je     1613 <readDescription+0x473>
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
call   1040 <free@plt>
mov    -0x60(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1697 <readDescription+0x4f7>
cmpb   $0x0,-0x29(%rbp)
je     1678 <readDescription+0x4d8>
mov    -0x28(%rbp),%rax
cmpq   $0x0,(%rax)
je     164e <readDescription+0x4ae>
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
call   1040 <free@plt>
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
je     1668 <readDescription+0x4c8>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
call   1040 <free@plt>
mov    -0x60(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
jmp    1681 <readDescription+0x4e1>
mov    -0x60(%rbp),%rdi
call   1040 <free@plt>
jmp    1686 <readDescription+0x4e6>
jmp    168b <readDescription+0x4eb>
jmp    1690 <readDescription+0x4f0>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readDescription>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rcx,0x20(%rsp)
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbp
lea    0xe3d(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,0x10(%rsp)
mov    0x0(%rbp),%bl
mov    %rbp,%rdi
mov    $0xa,%esi
call   1080 <strchr@plt>
mov    %rax,%r13
mov    %ebx,%eax
lea    0x1(%r13),%r12
test   %r13,%r13
cmove  %r15,%r13
cmove  %r15,%r12
cmp    $0x3a,%bl
jne    13d8 <readDescription+0x238>
mov    %al,0xb(%rsp)
mov    %r14,0x18(%rsp)
add    $0x1,%rbp
movl   $0x0,0xc(%rsp)
mov    %rbp,%r14
mov    %r13,%rbx
sub    %r14,%rbx
add    $0x1,%rbx
xor    %ebp,%ebp
xchg   %ax,%ax
movsbl (%r14,%rbp,1),%edi
call   10a0 <isspace@plt>
lea    0x1(%rbp),%rcx
add    $0xffffffffffffffff,%rbx
test   %rax,%rax
je     1242 <readDescription+0xa2>
add    %r14,%rbp
cmp    %r13,%rbp
mov    %rcx,%rbp
jb     1220 <readDescription+0x80>
lea    (%r14,%rcx,1),%rbp
add    $0xffffffffffffffff,%rbp
cmp    %r13,%rbp
je     1442 <readDescription+0x2a2>
sub    %r14d,%r13d
sub    %ecx,%r13d
lea    0x1(%r13),%r14d
add    $0x2,%r13d
mov    %r13d,%edi
call   10b0 <malloc@plt>
mov    %rax,%r13
mov    %rax,%rdi
mov    %rbp,%rsi
mov    %r14d,%edx
call   1050 <strncpy@plt>
movb   $0x0,0x0(%r13,%rbx,1)
mov    %r13,%rdi
call   1070 <strlen@plt>
cltq
cmpb   $0x5c,-0x1(%rax,%r13,1)
jne    13c7 <readDescription+0x227>
cs nopw 0x0(%rax,%rax,1)
mov    %r13,%rdi
call   1070 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%r13,1)
mov    %r12,%rdx
neg    %rdx
mov    $0x1,%esi
mov    %r12,%rcx
xchg   %ax,%ax
mov    %rcx,%rbx
mov    %rsi,%r14
mov    %rdx,%rbp
movsbl (%rcx),%edi
call   10a0 <isspace@plt>
lea    0x1(%rbx),%rcx
cmp    %r15,%rbx
jae    12e7 <readDescription+0x147>
lea    0x1(%r14),%rsi
lea    -0x1(%rbp),%rdx
test   %rax,%rax
jne    12c0 <readDescription+0x120>
lea    -0x1(%rcx),%rax
cmp    %r15,%rax
je     1442 <readDescription+0x2a2>
cmpb   $0x23,-0x1(%rcx)
jne    1442 <readDescription+0x2a2>
xchg   %ax,%ax
lea    (%r12,%r14,1),%rbx
movsbl (%r12,%r14,1),%edi
call   10a0 <isspace@plt>
add    $0x1,%r14
add    $0xffffffffffffffff,%rbp
cmp    %r15,%rbx
jae    1320 <readDescription+0x180>
test   %rax,%rax
jne    1300 <readDescription+0x160>
lea    (%r12,%r14,1),%rbx
add    $0xffffffffffffffff,%rbx
cmp    %r15,%rbx
je     1442 <readDescription+0x2a2>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <strchr@plt>
mov    %r13,%rdi
mov    %r13,0x28(%rsp)
mov    %rax,%r13
add    $0x1,%rax
test   %r13,%r13
cmove  %r15,%r13
cmove  %r15,%rax
mov    %rax,0x10(%rsp)
call   1070 <strlen@plt>
movslq %eax,%rsi
lea    (%rsi,%r13,1),%rax
mov    %rax,0x30(%rsp)
add    %r13d,%esi
sub    %r12d,%esi
sub    %r14d,%esi
add    $0x2,%esi
mov    0x28(%rsp),%rdi
call   10c0 <realloc@plt>
sub    %r12d,%r13d
sub    %r14d,%r13d
add    $0x1,%r13d
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r13d,%edx
mov    %rax,%r13
call   1090 <strncat@plt>
mov    0x30(%rsp),%rax
add    %r13,%rax
movb   $0x0,0x0(%rbp,%rax,1)
mov    %r13,%rdi
call   1070 <strlen@plt>
cltq
cmpb   $0x5c,-0x1(%rax,%r13,1)
mov    0x10(%rsp),%r12
je     12a0 <readDescription+0x100>
cmpb   $0x0,0xc(%rsp)
je     1449 <readDescription+0x2a9>
mov    0x20(%rsp),%rbx
jmp    1467 <readDescription+0x2c7>
mov    $0x1,%ebx
cmp    $0x28,%al
jne    1479 <readDescription+0x2d9>
mov    %al,0xb(%rsp)
mov    %r14,0x18(%rsp)
add    $0x1,%rbp
mov    %rbp,%rdi
mov    $0x29,%esi
call   1080 <strchr@plt>
test   %rax,%rax
je     1479 <readDescription+0x2d9>
mov    %rax,%r14
sub    %rbp,%rax
cmp    $0x5,%rax
jg     1479 <readDescription+0x2d9>
mov    0x10(%rsp),%rbx
test   %rbx,%rbx
je     148a <readDescription+0x2ea>
mov    %rbx,%rdi
call   1070 <strlen@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %eax,%edx
call   1060 <strncmp@plt>
test   %rax,%rax
sete   %al
mov    %eax,0xc(%rsp)
add    $0x2,%r14
jmp    1212 <readDescription+0x72>
mov    $0x1,%ebx
jmp    1479 <readDescription+0x2d9>
cmpb   $0x3a,0xb(%rsp)
jne    149b <readDescription+0x2fb>
mov    0x20(%rsp),%rax
mov    (%rax),%rdi
test   %rdi,%rdi
je     1462 <readDescription+0x2c2>
call   1040 <free@plt>
mov    0x18(%rsp),%rbx
mov    (%rbx),%rdi
test   %rdi,%rdi
je     1474 <readDescription+0x2d4>
call   1040 <free@plt>
mov    %r13,(%rbx)
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movl   $0x0,0xc(%rsp)
add    $0x2,%r14
jmp    1212 <readDescription+0x72>
mov    %r13,%rdi
call   1040 <free@plt>
jmp    1477 <readDescription+0x2d7>

LLVM IR (-O0):
@.str = [5 x i8] c"LANG\00"
define i32 @readDescription(i8* %0, i8* %1, i8** %2, i8** %3) {
%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 i32
%18 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8** %2, i8*** %8
store i8** %3, i8*** %9
store i8 0, i8* %11
store i8 0, i8* %12
%19 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %19, i8** %13
%20 = load i8*, i8** %6
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 58
%24 = zext i1 %23 to i32
%25 = trunc i32 %24 to i8
store i8 %25, i8* %10
%26 = load i8*, i8** %6
%27 = call i8* @strchr(i8* %26, i8 signext 10)
store i8* %27, i8** %15
%28 = load i8*, i8** %15
%29 = icmp ne i8* %28, null
br i1 %29, label %32, label %30
30: ; preds = %4
%31 = load i8*, i8** %7
store i8* %31, i8** %15
store i8* %31, i8** %16
br label %35
32: ; preds = %4
%33 = load i8*, i8** %15
%34 = getelementptr inbounds i8, i8* %33, i64 1
store i8* %34, i8** %16
br label %35
35: ; preds = %32, %30
%36 = load i8, i8* %10
%37 = icmp ne i8 %36, 0
br i1 %37, label %76, label %38
38: ; preds = %35
%39 = load i8*, i8** %6
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp ne i32 %41, 40
br i1 %42, label %43, label %44
43: ; preds = %38
store i32 1, i32* %5
br label %288
44: ; preds = %38
%45 = load i8*, i8** %6
%46 = getelementptr inbounds i8, i8* %45, i32 1
store i8* %46, i8** %6
%47 = load i8*, i8** %6
%48 = call i8* @strchr(i8* %47, i8 signext 41)
store i8* %48, i8** %14
%49 = load i8*, i8** %14
%50 = icmp eq i8* %49, null
br i1 %50, label %58, label %51
51: ; preds = %44
%52 = load i8*, i8** %14
%53 = load i8*, i8** %6
%54 = ptrtoint i8* %52 to i64
%55 = ptrtoint i8* %53 to i64
%56 = sub i64 %54, %55
%57 = icmp sgt i64 %56, 5
br i1 %57, label %58, label %59
58: ; preds = %51, %44
store i32 1, i32* %5
br label %288
59: ; preds = %51
%60 = load i8*, i8** %13
%61 = icmp ne i8* %60, null
br i1 %61, label %62, label %70
62: ; preds = %59
%63 = load i8*, i8** %13
%64 = load i8*, i8** %6
%65 = load i8*, i8** %13
%66 = call i32 @strlen(i8* %65)
%67 = call i64 @strncmp(i8* %63, i8* %64, i32 %66)
%68 = icmp eq i64 %67, 0
%69 = zext i1 %68 to i32
br label %71
70: ; preds = %59
br label %71
71: ; preds = %70, %62
%72 = phi i32 [ %69, %62 ], [ 0, %70 ]
%73 = trunc i32 %72 to i8
store i8 %73, i8* %12
%74 = load i8*, i8** %14
%75 = getelementptr inbounds i8, i8* %74, i64 2
store i8* %75, i8** %6
br label %79
76: ; preds = %35
%77 = load i8*, i8** %6
%78 = getelementptr inbounds i8, i8* %77, i32 1
store i8* %78, i8** %6
br label %79
79: ; preds = %76, %71
br label %80
80: ; preds = %91, %79
%81 = load i8*, i8** %6
%82 = load i8, i8* %81
%83 = call i64 @isspace(i8 signext %82)
%84 = icmp ne i64 %83, 0
br i1 %84, label %85, label %89
85: ; preds = %80
%86 = load i8*, i8** %6
%87 = load i8*, i8** %15
%88 = icmp ult i8* %86, %87
br label %89
89: ; preds = %85, %80
%90 = phi i1 [ false, %80 ], [ %88, %85 ]
br i1 %90, label %91, label %94
91: ; preds = %89
%92 = load i8*, i8** %6
%93 = getelementptr inbounds i8, i8* %92, i32 1
store i8* %93, i8** %6
br label %80
94: ; preds = %89
%95 = load i8*, i8** %6
%96 = load i8*, i8** %15
%97 = icmp eq i8* %95, %96
br i1 %97, label %98, label %99
98: ; preds = %94
store i32 1, i32* %5
br label %288
99: ; preds = %94
%100 = load i8*, i8** %15
%101 = load i8*, i8** %6
%102 = ptrtoint i8* %100 to i64
%103 = ptrtoint i8* %101 to i64
%104 = sub i64 %102, %103
%105 = add nsw i64 %104, 1
%106 = trunc i64 %105 to i32
%107 = call i64 @malloc(i32 %106)
%108 = inttoptr i64 %107 to i8*
store i8* %108, i8** %18
%109 = load i8*, i8** %18
%110 = load i8*, i8** %6
%111 = load i8*, i8** %15
%112 = load i8*, i8** %6
%113 = ptrtoint i8* %111 to i64
%114 = ptrtoint i8* %112 to i64
%115 = sub i64 %113, %114
%116 = trunc i64 %115 to i32
%117 = call i32 @strncpy(i8* %109, i8* %110, i32 %116)
%118 = load i8*, i8** %18
%119 = load i8*, i8** %15
%120 = load i8*, i8** %6
%121 = ptrtoint i8* %119 to i64
%122 = ptrtoint i8* %120 to i64
%123 = sub i64 %121, %122
%124 = getelementptr inbounds i8, i8* %118, i64 %123
store i8 0, i8* %124
%125 = load i8*, i8** %16
store i8* %125, i8** %6
br label %126
126: ; preds = %200, %99
%127 = load i8*, i8** %18
%128 = load i8*, i8** %18
%129 = call i32 @strlen(i8* %128)
%130 = sub nsw i32 %129, 1
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds i8, i8* %127, i64 %131
%133 = load i8, i8* %132
%134 = sext i8 %133 to i32
%135 = icmp eq i32 %134, 92
br i1 %135, label %136, label %236
136: ; preds = %126
%137 = load i8*, i8** %18
%138 = load i8*, i8** %18
%139 = call i32 @strlen(i8* %138)
%140 = sub nsw i32 %139, 1
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds i8, i8* %137, i64 %141
store i8 0, i8* %142
%143 = load i8*, i8** %16
store i8* %143, i8** %6
br label %144
144: ; preds = %155, %136
%145 = load i8*, i8** %6
%146 = load i8, i8* %145
%147 = call i64 @isspace(i8 signext %146)
%148 = icmp ne i64 %147, 0
br i1 %148, label %149, label %153
149: ; preds = %144
%150 = load i8*, i8** %6
%151 = load i8*, i8** %7
%152 = icmp ult i8* %150, %151
br label %153
153: ; preds = %149, %144
%154 = phi i1 [ false, %144 ], [ %152, %149 ]
br i1 %154, label %155, label %158
155: ; preds = %153
%156 = load i8*, i8** %6
%157 = getelementptr inbounds i8, i8* %156, i32 1
store i8* %157, i8** %6
br label %144
158: ; preds = %153
%159 = load i8*, i8** %6
%160 = load i8*, i8** %7
%161 = icmp eq i8* %159, %160
br i1 %161, label %167, label %162
162: ; preds = %158
%163 = load i8*, i8** %6
%164 = load i8, i8* %163
%165 = sext i8 %164 to i32
%166 = icmp ne i32 %165, 35
br i1 %166, label %167, label %168
167: ; preds = %162, %158
store i32 1, i32* %5
br label %288
168: ; preds = %162
%169 = load i8*, i8** %6
%170 = getelementptr inbounds i8, i8* %169, i32 1
store i8* %170, i8** %6
br label %171
171: ; preds = %182, %168
%172 = load i8*, i8** %6
%173 = load i8, i8* %172
%174 = call i64 @isspace(i8 signext %173)
%175 = icmp ne i64 %174, 0
br i1 %175, label %176, label %180
176: ; preds = %171
%177 = load i8*, i8** %6
%178 = load i8*, i8** %7
%179 = icmp ult i8* %177, %178
br label %180
180: ; preds = %176, %171
%181 = phi i1 [ false, %171 ], [ %179, %176 ]
br i1 %181, label %182, label %185
182: ; preds = %180
%183 = load i8*, i8** %6
%184 = getelementptr inbounds i8, i8* %183, i32 1
store i8* %184, i8** %6
br label %171
185: ; preds = %180
%186 = load i8*, i8** %6
%187 = load i8*, i8** %7
%188 = icmp eq i8* %186, %187
br i1 %188, label %189, label %190
189: ; preds = %185
store i32 1, i32* %5
br label %288
190: ; preds = %185
%191 = load i8*, i8** %6
%192 = call i8* @strchr(i8* %191, i8 signext 10)
store i8* %192, i8** %15
%193 = load i8*, i8** %15
%194 = icmp ne i8* %193, null
br i1 %194, label %197, label %195
195: ; preds = %190
%196 = load i8*, i8** %7
store i8* %196, i8** %15
store i8* %196, i8** %16
br label %200
197: ; preds = %190
%198 = load i8*, i8** %15
%199 = getelementptr inbounds i8, i8* %198, i64 1
store i8* %199, i8** %16
br label %200
200: ; preds = %197, %195
%201 = load i8*, i8** %18
%202 = call i32 @strlen(i8* %201)
store i32 %202, i32* %17
%203 = load i8*, i8** %18
%204 = load i32, i32* %17
%205 = load i8*, i8** %15
%206 = sext i32 %204 to i64
%207 = getelementptr inbounds i8, i8* %205, i64 %206
%208 = load i8*, i8** %6
%209 = ptrtoint i8* %207 to i64
%210 = ptrtoint i8* %208 to i64
%211 = sub i64 %209, %210
%212 = add nsw i64 %211, 1
%213 = trunc i64 %212 to i32
%214 = call i64 @realloc(i8* %203, i32 %213)
%215 = inttoptr i64 %214 to i8*
store i8* %215, i8** %18
%216 = load i8*, i8** %18
%217 = load i8*, i8** %6
%218 = load i8*, i8** %15
%219 = load i8*, i8** %6
%220 = ptrtoint i8* %218 to i64
%221 = ptrtoint i8* %219 to i64
%222 = sub i64 %220, %221
%223 = trunc i64 %222 to i32
%224 = call i32 @strncat(i8* %216, i8* %217, i32 %223)
%225 = load i8*, i8** %18
%226 = load i32, i32* %17
%227 = load i8*, i8** %15
%228 = sext i32 %226 to i64
%229 = getelementptr inbounds i8, i8* %227, i64 %228
%230 = load i8*, i8** %6
%231 = ptrtoint i8* %229 to i64
%232 = ptrtoint i8* %230 to i64
%233 = sub i64 %231, %232
%234 = getelementptr inbounds i8, i8* %225, i64 %233
store i8 0, i8* %234
%235 = load i8*, i8** %16
store i8* %235, i8** %6
br label %126
236: ; preds = %126
%237 = load i8*, i8** %18
%238 = icmp ne i8* %237, null
br i1 %238, label %239, label %287
239: ; preds = %236
%240 = load i8, i8* %11
%241 = icmp ne i8 %240, 0
br i1 %241, label %242, label %245
242: ; preds = %239
%243 = load i8*, i8** %18
%244 = call i32 @free(i8* %243)
br label %286
245: ; preds = %239
%246 = load i8, i8* %12
%247 = icmp ne i8 %246, 0
br i1 %247, label %248, label %259
248: ; preds = %245
%249 = load i8**, i8*** %9
%250 = load i8*, i8** %249
%251 = icmp ne i8* %250, null
br i1 %251, label %252, label %256
252: ; preds = %248
%253 = load i8**, i8*** %9
%254 = load i8*, i8** %253
%255 = call i32 @free(i8* %254)
br label %256
256: ; preds = %252, %248
%257 = load i8*, i8** %18
%258 = load i8**, i8*** %9
store i8* %257, i8** %258
store i32 0, i32* %5
br label %288
259: ; preds = %245
%260 = load i8, i8* %10
%261 = icmp ne i8 %260, 0
br i1 %261, label %262, label %281
262: ; preds = %259
%263 = load i8**, i8*** %9
%264 = load i8*, i8** %263
%265 = icmp ne i8* %264, null
br i1 %265, label %266, label %270
266: ; preds = %262
%267 = load i8**, i8*** %9
%268 = load i8*, i8** %267
%269 = call i32 @free(i8* %268)
br label %270
270: ; preds = %266, %262
%271 = load i8**, i8*** %8
%272 = load i8*, i8** %271
%273 = icmp ne i8* %272, null
br i1 %273, label %274, label %278
274: ; preds = %270
%275 = load i8**, i8*** %8
%276 = load i8*, i8** %275
%277 = call i32 @free(i8* %276)
br label %278
278: ; preds = %274, %270
%279 = load i8*, i8** %18
%280 = load i8**, i8*** %8
store i8* %279, i8** %280
br label %284
281: ; preds = %259
%282 = load i8*, i8** %18
%283 = call i32 @free(i8* %282)
br label %284
284: ; preds = %281, %278
br label %285
285: ; preds = %284
br label %286
286: ; preds = %285, %242
br label %287
287: ; preds = %286, %236
store i32 0, i32* %5
br label %288
288: ; preds = %287, %256, %189, %167, %98, %58, %43
%289 = load i32, i32* %5
ret i32 %289
}

LLVM IR (-O2):
@.str = [5 x i8] c"LANG\00"
define i32 @readDescription(i8* %0, i8* %1, i8** nocapture %2, i8** nocapture %3) {
%5 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 58
%8 = tail call i8* @strchr(i8* %0, i8 signext 10)
%9 = icmp eq i8* %8, null
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = select i1 %9, i8* %1, i8* %8
%12 = select i1 %9, i8* %1, i8* %10
br i1 %7, label %34, label %13
13: ; preds = %4
%14 = icmp eq i8 %6, 40
br i1 %14, label %15, label %147
15: ; preds = %13
%16 = getelementptr inbounds i8, i8* %0, i64 1
%17 = tail call i8* @strchr(i8* %16, i8 signext 41)
%18 = icmp eq i8* %17, null
%19 = ptrtoint i8* %17 to i64
%20 = ptrtoint i8* %16 to i64
%21 = sub i64 %19, %20
%22 = icmp sgt i64 %21, 5
%23 = select i1 %18, i1 true, i1 %22
br i1 %23, label %147, label %24
24: ; preds = %15
%25 = icmp eq i8* %5, null
br i1 %25, label %31, label %26
26: ; preds = %24
%27 = tail call i32 @strlen(i8* %5)
%28 = tail call i64 @strncmp(i8* %5, i8* %16, i32 %27)
%29 = icmp eq i64 %28, 0
%30 = zext i1 %29 to i8
br label %31
31: ; preds = %24, %26
%32 = phi i8 [ %30, %26 ], [ 0, %24 ]
%33 = getelementptr inbounds i8, i8* %17, i64 2
br label %36
34: ; preds = %4
%35 = getelementptr inbounds i8, i8* %0, i64 1
br label %36
36: ; preds = %34, %31
%37 = phi i8 [ 0, %34 ], [ %32, %31 ]
%38 = phi i8* [ %35, %34 ], [ %33, %31 ]
br label %39
39: ; preds = %39, %36
%40 = phi i8* [ %38, %36 ], [ %46, %39 ]
%41 = load i8, i8* %40
%42 = tail call i64 @isspace(i8 signext %41)
%43 = icmp ne i64 %42, 0
%44 = icmp ult i8* %40, %11
%45 = select i1 %43, i1 %44, i1 false
%46 = getelementptr inbounds i8, i8* %40, i64 1
br i1 %45, label %39, label %47
47: ; preds = %39
%48 = icmp eq i8* %40, %11
br i1 %48, label %147, label %49
49: ; preds = %47
%50 = ptrtoint i8* %11 to i64
%51 = ptrtoint i8* %40 to i64
%52 = sub i64 %50, %51
%53 = trunc i64 %52 to i32
%54 = add i32 %53, 1
%55 = tail call i64 @malloc(i32 %54)
%56 = inttoptr i64 %55 to i8*
%57 = tail call i32 @strncpy(i8* %56, i8* %40, i32 %53)
%58 = getelementptr inbounds i8, i8* %56, i64 %52
store i8 0, i8* %58
%59 = tail call i32 @strlen(i8* %56)
%60 = add nsw i32 %59, -1
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i8, i8* %56, i64 %61
%63 = load i8, i8* %62
%64 = icmp eq i8 %63, 92
br i1 %64, label %65, label %124
65: ; preds = %49, %95
%66 = phi i8* [ %110, %95 ], [ %56, %49 ]
%67 = phi i8* [ %100, %95 ], [ %12, %49 ]
%68 = tail call i32 @strlen(i8* %66)
%69 = add nsw i32 %68, -1
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8, i8* %66, i64 %70
store i8 0, i8* %71
br label %72
72: ; preds = %72, %65
%73 = phi i8* [ %67, %65 ], [ %79, %72 ]
%74 = load i8, i8* %73
%75 = tail call i64 @isspace(i8 signext %74)
%76 = icmp ne i64 %75, 0
%77 = icmp ult i8* %73, %1
%78 = and i1 %77, %76
%79 = getelementptr inbounds i8, i8* %73, i64 1
br i1 %78, label %72, label %80
80: ; preds = %72
%81 = icmp eq i8* %73, %1
br i1 %81, label %147, label %82
82: ; preds = %80
%83 = load i8, i8* %73
%84 = icmp eq i8 %83, 35
br i1 %84, label %85, label %147
85: ; preds = %82, %85
%86 = phi i8* [ %87, %85 ], [ %73, %82 ]
%87 = getelementptr inbounds i8, i8* %86, i64 1
%88 = load i8, i8* %87
%89 = tail call i64 @isspace(i8 signext %88)
%90 = icmp ne i64 %89, 0
%91 = icmp ult i8* %87, %1
%92 = and i1 %91, %90
br i1 %92, label %85, label %93
93: ; preds = %85
%94 = icmp eq i8* %87, %1
br i1 %94, label %147, label %95
95: ; preds = %93
%96 = tail call i8* @strchr(i8* %87, i8 signext 10)
%97 = icmp eq i8* %96, null
%98 = getelementptr inbounds i8, i8* %96, i64 1
%99 = select i1 %97, i8* %1, i8* %96
%100 = select i1 %97, i8* %1, i8* %98
%101 = tail call i32 @strlen(i8* %66)
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds i8, i8* %99, i64 %102
%104 = ptrtoint i8* %103 to i64
%105 = ptrtoint i8* %87 to i64
%106 = sub i64 %104, %105
%107 = trunc i64 %106 to i32
%108 = add i32 %107, 1
%109 = tail call i64 @realloc(i8* %66, i32 %108)
%110 = inttoptr i64 %109 to i8*
%111 = ptrtoint i8* %99 to i64
%112 = sub i64 %111, %105
%113 = trunc i64 %112 to i32
%114 = tail call i32 @strncat(i8* %110, i8* %87, i32 %113)
%115 = getelementptr inbounds i8, i8* %110, i64 %106
store i8 0, i8* %115
%116 = tail call i32 @strlen(i8* %110)
%117 = add nsw i32 %116, -1
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds i8, i8* %110, i64 %118
%120 = load i8, i8* %119
%121 = icmp eq i8 %120, 92
br i1 %121, label %65, label %122
122: ; preds = %95
%123 = inttoptr i64 %109 to i8*
br label %124
124: ; preds = %122, %49
%125 = phi i8* [ %56, %49 ], [ %123, %122 ]
%126 = icmp eq i8 %37, 0
br i1 %126, label %133, label %127
127: ; preds = %124
%128 = load i8*, i8** %3
%129 = icmp eq i8* %128, null
br i1 %129, label %132, label %130
130: ; preds = %127
%131 = tail call i32 @free(i8* %128)
br label %132
132: ; preds = %130, %127
store i8* %125, i8** %3
br label %147
133: ; preds = %124
br i1 %7, label %134, label %145
134: ; preds = %133
%135 = load i8*, i8** %3
%136 = icmp eq i8* %135, null
br i1 %136, label %139, label %137
137: ; preds = %134
%138 = tail call i32 @free(i8* %135)
br label %139
139: ; preds = %137, %134
%140 = load i8*, i8** %2
%141 = icmp eq i8* %140, null
br i1 %141, label %144, label %142
142: ; preds = %139
%143 = tail call i32 @free(i8* %140)
br label %144
144: ; preds = %142, %139
store i8* %125, i8** %2
br label %147
145: ; preds = %133
%146 = tail call i32 @free(i8* %125)
br label %147
147: ; preds = %93, %80, %82, %132, %144, %145, %47, %15, %13
%148 = phi i32 [ 1, %13 ], [ 1, %15 ], [ 1, %47 ], [ 0, %144 ], [ 0, %145 ], [ 0, %132 ], [ 1, %82 ], [ 1, %80 ], [ 1, %93 ]
ret i32 %148
}