#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 */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
char *getenv(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ *statmbx_getFile(char *, char *);
int /*<<< orphan*/ statmbx_printMaybeBold(char *);
int /*<<< orphan*/ statmbx_printName(char *, char *);
int /*<<< orphan*/ statmbx_splitConfigLine(char *, char **, char **);
scalar_t__ strncasecmp(char *, char *, int);
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
int main(int argc, char **argv) {
  FILE *config_file;
  FILE *mail_file;
  char config_line[256];
  char mail_line[256];
  char cur_name[256];
  char cur_subj[256];
  int n, i;
  char *homedir;
  char *mailbox_title;
  char *mailbox_fname;
  int msgs, new_msgs;
  int inhdr, seen_status_read, printed_title;
  int just_print_names;
  just_print_names = 0;
  if (argc == 2 && strncmp(argv[1], "--only-names", 13) == 0)
    just_print_names = 1;
  else if (argc != 1) {
    printf("Usage: statmbx or statmbx --only-names\n");
    exit(-1);
  }
  if ((homedir = getenv("HOME")) == NULL) {
    printf("statmbx:: error, envrionment varible \"HOME\" not              "
           "found.\n");
    exit(-1);
  }
  config_file = statmbx_getFile(homedir, ".statmbx");
  n = 0;
  while (fgets(config_line, 256, config_file) != NULL) {
    config_line[256 - 1] = '\0';
    if (config_line[0] == '\0' || config_line[0] == '#')
      continue;
    statmbx_splitConfigLine(config_line, &mailbox_title, &mailbox_fname);
    mail_file = statmbx_getFile(homedir, mailbox_fname);
    if (mail_file == 0) {
      printf("statmbx: error, couldn't locate ");
      printf("mailfile %s relative to %s.\n", mailbox_fname, homedir);
    } else {
      msgs = new_msgs = seen_status_read = inhdr = printed_title = 0;
      while (fgets(mail_line, 256, mail_file) != NULL) {
        mail_line[256 - 1] = '\0';
        if (strncmp(mail_line, "From ", 5) == 0) {
          if (inhdr) {
            printf("statmbx: error, corrupt mail file \"%s\"", mailbox_fname);
            exit(-1);
          }
          seen_status_read = 0;
          inhdr = 1;
          cur_name[0] = '\0';
          cur_subj[0] = '\0';
        } else if (inhdr) {
          if (mail_line[0] == '\n') {
            if (!seen_status_read) {
              if (just_print_names) {
                printf("%s ", mailbox_title);
                break;
              }
              new_msgs++;
              if (!printed_title) {
                printed_title = 1;
                printf("\n");
                statmbx_printMaybeBold(mailbox_title);
                printf("\n");
              }
              statmbx_printName(cur_name, cur_subj);
            }
            msgs++;
            inhdr = 0;
          } else {
            if (strncmp(mail_line, "Status: R", 9) == 0)
              seen_status_read = 1;
            else if (strncmp(mail_line, "From: ", 6) == 0)
              strncpy(cur_name, mail_line, 256);
            else if (strncasecmp(mail_line, "Subject: ", 9) == 0)
              strncpy(cur_subj, mail_line, 256);
          }
        }
      }
    }
    n++;
  }
  if (just_print_names)
    printf("\n");
  fclose(config_file);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x460,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x458(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    121f <main+0x5f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe04(%rip),%rsi
mov    $0xd,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%rax
jne    121f <main+0x5f>
movl   $0x1,-0x458(%rbp)
jmp    1246 <main+0x86>
cmpl   $0x1,-0x8(%rbp)
je     1241 <main+0x81>
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0xffffffff,%edi
call   10d0 <exit@plt>
jmp    1246 <main+0x86>
lea    0xde8(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x430(%rbp)
cmp    $0x0,%rax
jne    127b <main+0xbb>
lea    0xdd0(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0xffffffff,%edi
call   10d0 <exit@plt>
mov    -0x430(%rbp),%rdi
lea    0xdf6(%rip),%rsi
call   10e0 <statmbx_getFile@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x424(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x100,%esi
call   10a0 <fgets@plt>
cmp    $0x0,%rax
je     15cd <main+0x40d>
movb   $0x0,-0x21(%rbp)
movsbl -0x120(%rbp),%eax
cmp    $0x0,%eax
je     12df <main+0x11f>
movsbl -0x120(%rbp),%eax
cmp    $0x23,%eax
jne    12e4 <main+0x124>
jmp    129c <main+0xdc>
lea    -0x120(%rbp),%rdi
lea    -0x438(%rbp),%rsi
lea    -0x440(%rbp),%rdx
call   1090 <statmbx_splitConfigLine@plt>
mov    -0x430(%rbp),%rdi
mov    -0x440(%rbp),%rsi
call   10e0 <statmbx_getFile@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    134f <main+0x18f>
lea    0xd61(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x440(%rbp),%rsi
mov    -0x430(%rbp),%rdx
lea    0xd66(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    15b9 <main+0x3f9>
movl   $0x0,-0x454(%rbp)
movl   $0x0,-0x44c(%rbp)
movl   $0x0,-0x450(%rbp)
movl   $0x0,-0x448(%rbp)
movl   $0x0,-0x444(%rbp)
lea    -0x220(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x100,%esi
call   10a0 <fgets@plt>
cmp    $0x0,%rax
je     15b4 <main+0x3f4>
movb   $0x0,-0x121(%rbp)
lea    -0x220(%rbp),%rdi
lea    0xd11(%rip),%rsi
mov    $0x5,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%rax
jne    141c <main+0x25c>
cmpl   $0x0,-0x44c(%rbp)
je     13f5 <main+0x235>
mov    -0x440(%rbp),%rsi
lea    0xce8(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0xffffffff,%edi
call   10d0 <exit@plt>
movl   $0x0,-0x450(%rbp)
movl   $0x1,-0x44c(%rbp)
movb   $0x0,-0x320(%rbp)
movb   $0x0,-0x420(%rbp)
jmp    15af <main+0x3ef>
cmpl   $0x0,-0x44c(%rbp)
je     15aa <main+0x3ea>
movsbl -0x220(%rbp),%eax
cmp    $0xa,%eax
jne    14ec <main+0x32c>
cmpl   $0x0,-0x450(%rbp)
jne    14ce <main+0x30e>
cmpl   $0x0,-0x458(%rbp)
je     146d <main+0x2ad>
mov    -0x438(%rbp),%rsi
lea    0xc92(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    15b4 <main+0x3f4>
mov    -0x448(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x448(%rbp)
cmpl   $0x0,-0x454(%rbp)
jne    14bb <main+0x2fb>
movl   $0x1,-0x454(%rbp)
lea    0xbe3(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x438(%rbp),%rdi
call   10c0 <statmbx_printMaybeBold@plt>
lea    0xbc9(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x320(%rbp),%rdi
lea    -0x420(%rbp),%rsi
call   1060 <statmbx_printName@plt>
mov    -0x444(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x444(%rbp)
movl   $0x0,-0x44c(%rbp)
jmp    15a5 <main+0x3e5>
lea    -0x220(%rbp),%rdi
lea    0xbfd(%rip),%rsi
mov    $0x9,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%rax
jne    151d <main+0x35d>
movl   $0x1,-0x450(%rbp)
jmp    15a0 <main+0x3e0>
lea    -0x220(%rbp),%rdi
lea    0xbd6(%rip),%rsi
mov    $0x6,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%rax
jne    155c <main+0x39c>
lea    -0x320(%rbp),%rdi
lea    -0x220(%rbp),%rsi
mov    $0x100,%edx
call   1040 <strncpy@plt>
jmp    159b <main+0x3db>
lea    -0x220(%rbp),%rdi
lea    0xb9e(%rip),%rsi
mov    $0x9,%edx
call   10b0 <strncasecmp@plt>
cmp    $0x0,%rax
jne    1596 <main+0x3d6>
lea    -0x420(%rbp),%rdi
lea    -0x220(%rbp),%rsi
mov    $0x100,%edx
call   1040 <strncpy@plt>
jmp    159b <main+0x3db>
jmp    15a0 <main+0x3e0>
jmp    15a5 <main+0x3e5>
jmp    15aa <main+0x3ea>
jmp    15af <main+0x3ef>
jmp    1381 <main+0x1c1>
jmp    15b9 <main+0x3f9>
mov    -0x424(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x424(%rbp)
jmp    129c <main+0xdc>
cmpl   $0x0,-0x458(%rbp)
je     15e8 <main+0x428>
lea    0xa9c(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x460,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x438,%rsp
mov    $0x1,%al
mov    %eax,0x8(%rsp)
cmp    $0x1,%edi
je     122b <main+0x4b>
cmp    $0x2,%edi
jne    1520 <main+0x340>
mov    0x8(%rsi),%rdi
lea    0xee6(%rip),%rsi
mov    $0xd,%edx
call   1060 <strncmp@plt>
test   %rax,%rax
jne    1520 <main+0x340>
movl   $0x0,0x8(%rsp)
lea    0xdce(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1529 <main+0x349>
mov    %rax,%r14
lea    0xdbb(%rip),%rsi
mov    %rax,%rdi
call   1100 <statmbx_getFile@plt>
mov    %rax,%r15
lea    0x30(%rsp),%rdi
mov    $0x100,%esi
mov    %rax,%rdx
call   10c0 <fgets@plt>
test   %rax,%rax
je     14d6 <main+0x2f6>
lea    0x30(%rsp),%rbx
lea    0x18(%rsp),%rbp
lea    0x330(%rsp),%r12
mov    %r14,0x20(%rsp)
mov    %r15,0x28(%rsp)
jmp    12a9 <main+0xc9>
xchg   %ax,%ax
mov    %rbx,%rdi
mov    $0x100,%esi
mov    %r15,%rdx
call   10c0 <fgets@plt>
test   %rax,%rax
je     14d6 <main+0x2f6>
movb   $0x0,0x12f(%rsp)
mov    0x30(%rsp),%al
cmp    $0x23,%al
je     1290 <main+0xb0>
test   %al,%al
je     1290 <main+0xb0>
mov    %rbx,%rdi
mov    %rbp,%rsi
lea    0x10(%rsp),%rdx
call   10b0 <statmbx_splitConfigLine@plt>
mov    0x10(%rsp),%rsi
mov    %r14,%rdi
call   1100 <statmbx_getFile@plt>
test   %rax,%rax
je     1473 <main+0x293>
mov    %rax,%r13
mov    %r12,%rdi
mov    $0x100,%esi
mov    %rax,%rdx
call   10c0 <fgets@plt>
test   %rax,%rax
je     1497 <main+0x2b7>
movl   $0x0,0xc(%rsp)
xor    %r15d,%r15d
xor    %ebx,%ebx
jmp    133c <main+0x15c>
mov    $0x1,%r15d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r12,%rdi
mov    $0x100,%esi
mov    %r13,%rdx
call   10c0 <fgets@plt>
mov    %r14d,%ebx
test   %rax,%rax
je     1497 <main+0x2b7>
movb   $0x0,0x42f(%rsp)
mov    %r12,%rdi
lea    0xcfe(%rip),%rsi
mov    $0x5,%edx
call   1060 <strncmp@plt>
test   %rax,%rax
je     13d0 <main+0x1f0>
xor    %r14d,%r14d
test   %ebx,%ebx
je     1320 <main+0x140>
cmpb   $0xa,0x330(%rsp)
0a
jne    13f6 <main+0x216>
test   %r15d,%r15d
jne    1320 <main+0x140>
cmpb   $0x0,0x8(%rsp)
je     14c1 <main+0x2e1>
cmpl   $0x0,0xc(%rsp)
jne    13a7 <main+0x1c7>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    0x18(%rsp),%rdi
call   10e0 <statmbx_printMaybeBold@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0x230(%rsp),%rdi
lea    0x130(%rsp),%rsi
call   1070 <statmbx_printName@plt>
movl   $0x1,0xc(%rsp)
xor    %r14d,%r14d
xor    %r15d,%r15d
jmp    1320 <main+0x140>
nop
test   %ebx,%ebx
jne    1503 <main+0x323>
movb   $0x0,0x230(%rsp)
movb   $0x0,0x130(%rsp)
xor    %r15d,%r15d
mov    $0x1,%r14d
jmp    1320 <main+0x140>
mov    %r12,%rdi
lea    0xc7d(%rip),%rsi
mov    $0x9,%edx
call   1060 <strncmp@plt>
mov    $0x1,%r14d
test   %rax,%rax
je     130e <main+0x12e>
mov    %r12,%rdi
lea    0xc64(%rip),%rsi
mov    $0x6,%edx
call   1060 <strncmp@plt>
test   %rax,%rax
je     1459 <main+0x279>
mov    %r12,%rdi
lea    0xc52(%rip),%rsi
mov    $0x9,%edx
call   10d0 <strncasecmp@plt>
test   %rax,%rax
jne    1320 <main+0x140>
lea    0x130(%rsp),%rdi
jmp    1461 <main+0x281>
lea    0x230(%rsp),%rdi
mov    %r12,%rsi
mov    $0x100,%edx
call   1050 <strncpy@plt>
jmp    1320 <main+0x140>
lea    0xb94(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    0x10(%rsp),%rsi
lea    0xba2(%rip),%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
mov    0x28(%rsp),%r15
mov    %r15,%rdx
call   10c0 <fgets@plt>
test   %rax,%rax
mov    0x20(%rsp),%r14
jne    12a9 <main+0xc9>
jmp    14d6 <main+0x2f6>
mov    0x18(%rsp),%rsi
lea    0xbac(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
jmp    1497 <main+0x2b7>
cmpb   $0x0,0x8(%rsp)
jne    14e7 <main+0x307>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    %r15,%rdi
call   1090 <fclose@plt>
xor    %eax,%eax
add    $0x438,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x10(%rsp),%rsi
lea    0xb43(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    $0xffffffff,%edi
call   10f0 <exit@plt>
lea    0xbb5(%rip),%rdi
jmp    1530 <main+0x350>
lea    0xb68(%rip),%rdi
call   1080 <puts@plt>
mov    $0xffffffff,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"--only-names\00"
@.str.1 = [40 x i8] c"Usage: statmbx or statmbx --only-names\0A\00"
@.str.2 = [5 x i8] c"HOME\00"
@.str.3 = [69 x i8] c"statmbx:: error, envrionment varible \22HOME\22 not found.\0A\00"
@.str.4 = [9 x i8] c".statmbx\00"
@.str.5 = [33 x i8] c"statmbx: error, couldn't locate \00"
@.str.6 = [29 x i8] c"mailfile %s relative to %s.\0A\00"
@.str.7 = [6 x i8] c"From \00"
@.str.8 = [39 x i8] c"statmbx: error, corrupt mail file \22%s\22\00"
@.str.9 = [4 x i8] c"%s \00"
@.str.10 = [2 x i8] c"\0A\00"
@.str.11 = [10 x i8] c"Status: R\00"
@.str.12 = [7 x i8] c"From: \00"
@.str.13 = [10 x i8] c"Subject: \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca [256 x i8]
%9 = alloca [256 x i8]
%10 = alloca [256 x i8]
%11 = alloca [256 x i8]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %22
%23 = load i32, i32* %4
%24 = icmp eq i32 %23, 2
br i1 %24, label %25, label %32
25: ; preds = %2
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i64 @strncmp(i8* %28, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 13)
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %25
store i32 1, i32* %22
br label %39
32: ; preds = %25, %2
%33 = load i32, i32* %4
%34 = icmp ne i32 %33, 1
br i1 %34, label %35, label %38
35: ; preds = %32
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%37 = call i32 @exit(i32 -1)
unreachable
38: ; preds = %32
br label %39
39: ; preds = %38, %31
%40 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
store i8* %40, i8** %14
%41 = icmp eq i8* %40, null
br i1 %41, label %42, label %45
42: ; preds = %39
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.3, i64 0, i64 0))
%44 = call i32 @exit(i32 -1)
unreachable
45: ; preds = %39
%46 = load i8*, i8** %14
%47 = call i32* @statmbx_getFile(i8* %46, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
store i32* %47, i32** %6
store i32 0, i32* %12
br label %48
48: ; preds = %161, %64, %45
%49 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%50 = load i32*, i32** %6
%51 = call i32* @fgets(i8* %49, i32 256, i32* %50)
%52 = icmp ne i32* %51, null
br i1 %52, label %53, label %164
53: ; preds = %48
%54 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 255
store i8 0, i8* %54
%55 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = icmp eq i32 %57, 0
br i1 %58, label %64, label %59
59: ; preds = %53
%60 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = icmp eq i32 %62, 35
br i1 %63, label %64, label %65
64: ; preds = %59, %53
br label %48
65: ; preds = %59
%66 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%67 = call i32 @statmbx_splitConfigLine(i8* %66, i8** %15, i8** %16)
%68 = load i8*, i8** %14
%69 = load i8*, i8** %16
%70 = call i32* @statmbx_getFile(i8* %68, i8* %69)
store i32* %70, i32** %7
%71 = load i32*, i32** %7
%72 = icmp eq i32* %71, null
br i1 %72, label %73, label %78
73: ; preds = %65
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
%75 = load i8*, i8** %16
%76 = load i8*, i8** %14
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i8* %75, i8* %76)
br label %161
78: ; preds = %65
store i32 0, i32* %21
store i32 0, i32* %19
store i32 0, i32* %20
store i32 0, i32* %18
store i32 0, i32* %17
br label %79
79: ; preds = %159, %78
%80 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%81 = load i32*, i32** %7
%82 = call i32* @fgets(i8* %80, i32 256, i32* %81)
%83 = icmp ne i32* %82, null
br i1 %83, label %84, label %160
84: ; preds = %79
%85 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 255
store i8 0, i8* %85
%86 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%87 = call i64 @strncmp(i8* %86, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 5)
%88 = icmp eq i64 %87, 0
br i1 %88, label %89, label %99
89: ; preds = %84
%90 = load i32, i32* %19
%91 = icmp ne i32 %90, 0
br i1 %91, label %92, label %96
92: ; preds = %89
%93 = load i8*, i8** %16
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.8, i64 0, i64 0), i8* %93)
%95 = call i32 @exit(i32 -1)
unreachable
96: ; preds = %89
store i32 0, i32* %20
store i32 1, i32* %19
%97 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
store i8 0, i8* %97
%98 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
store i8 0, i8* %98
br label %159
99: ; preds = %84
%100 = load i32, i32* %19
%101 = icmp ne i32 %100, 0
br i1 %101, label %102, label %158
102: ; preds = %99
%103 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%104 = load i8, i8* %103
%105 = sext i8 %104 to i32
%106 = icmp eq i32 %105, 10
br i1 %106, label %107, label %133
107: ; preds = %102
%108 = load i32, i32* %20
%109 = icmp ne i32 %108, 0
br i1 %109, label %130, label %110
110: ; preds = %107
%111 = load i32, i32* %22
%112 = icmp ne i32 %111, 0
br i1 %112, label %113, label %116
113: ; preds = %110
%114 = load i8*, i8** %15
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* %114)
br label %160
116: ; preds = %110
%117 = load i32, i32* %18
%118 = add nsw i32 %117, 1
store i32 %118, i32* %18
%119 = load i32, i32* %21
%120 = icmp ne i32 %119, 0
br i1 %120, label %126, label %121
121: ; preds = %116
store i32 1, i32* %21
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%123 = load i8*, i8** %15
%124 = call i32 @statmbx_printMaybeBold(i8* %123)
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %126
126: ; preds = %121, %116
%127 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%128 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%129 = call i32 @statmbx_printName(i8* %127, i8* %128)
br label %130
130: ; preds = %126, %107
%131 = load i32, i32* %17
%132 = add nsw i32 %131, 1
store i32 %132, i32* %17
store i32 0, i32* %19
br label %157
133: ; preds = %102
%134 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%135 = call i64 @strncmp(i8* %134, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i32 9)
%136 = icmp eq i64 %135, 0
br i1 %136, label %137, label %138
137: ; preds = %133
store i32 1, i32* %20
br label %156
138: ; preds = %133
%139 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%140 = call i64 @strncmp(i8* %139, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i32 6)
%141 = icmp eq i64 %140, 0
br i1 %141, label %142, label %146
142: ; preds = %138
%143 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%144 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%145 = call i32 @strncpy(i8* %143, i8* %144, i32 256)
br label %155
146: ; preds = %138
%147 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%148 = call i64 @strncasecmp(i8* %147, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), i32 9)
%149 = icmp eq i64 %148, 0
br i1 %149, label %150, label %154
150: ; preds = %146
%151 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%152 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%153 = call i32 @strncpy(i8* %151, i8* %152, i32 256)
br label %154
154: ; preds = %150, %146
br label %155
155: ; preds = %154, %142
br label %156
156: ; preds = %155, %137
br label %157
157: ; preds = %156, %130
br label %158
158: ; preds = %157, %99
br label %159
159: ; preds = %158, %96
br label %79
160: ; preds = %113, %79
br label %161
161: ; preds = %160, %73
%162 = load i32, i32* %12
%163 = add nsw i32 %162, 1
store i32 %163, i32* %12
br label %48
164: ; preds = %48
%165 = load i32, i32* %22
%166 = icmp ne i32 %165, 0
br i1 %166, label %167, label %169
167: ; preds = %164
%168 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %169
169: ; preds = %167, %164
%170 = load i32*, i32** %6
%171 = call i32 @fclose(i32* %170)
%172 = load i32, i32* %3
ret i32 %172
}

LLVM IR (-O2):
@.str = [13 x i8] c"--only-names\00"
@.str.2 = [5 x i8] c"HOME\00"
@.str.4 = [9 x i8] c".statmbx\00"
@.str.5 = [33 x i8] c"statmbx: error, couldn't locate \00"
@.str.6 = [29 x i8] c"mailfile %s relative to %s.\0A\00"
@.str.7 = [6 x i8] c"From \00"
@.str.8 = [39 x i8] c"statmbx: error, corrupt mail file \22%s\22\00"
@.str.9 = [4 x i8] c"%s \00"
@.str.11 = [10 x i8] c"Status: R\00"
@.str.12 = [7 x i8] c"From: \00"
@.str.13 = [10 x i8] c"Subject: \00"
@str = [68 x i8] c"statmbx:: error, envrionment varible \22HOME\22 not found.\00"
@str.14 = [39 x i8] c"Usage: statmbx or statmbx --only-names\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = alloca [256 x i8]
%6 = alloca [256 x i8]
%7 = alloca i8*
%8 = alloca i8*
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%13 = bitcast i8** %7 to i8*
%14 = bitcast i8** %8 to i8*
switch i32 %0, label %20 [
i32 2, label %15
i32 1, label %23
]
15: ; preds = %2
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = tail call i64 @strncmp(i8* %17, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 13)
%19 = icmp eq i64 %18, 0
br i1 %19, label %23, label %20
20: ; preds = %15, %2
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.14, i64 0, i64 0))
%22 = tail call i32 @exit(i32 -1)
unreachable
23: ; preds = %2, %15
%24 = phi i1 [ false, %15 ], [ true, %2 ]
%25 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%26 = icmp eq i8* %25, null
br i1 %26, label %27, label %30
27: ; preds = %23
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str, i64 0, i64 0))
%29 = tail call i32 @exit(i32 -1)
unreachable
30: ; preds = %23
%31 = tail call i32* @statmbx_getFile(i8* %25, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%32 = call i32* @fgets(i8* %9, i32 256, i32* %31)
%33 = icmp eq i32* %32, null
br i1 %33, label %109, label %34
34: ; preds = %30
%35 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 255
%36 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 255
br label %37
37: ; preds = %42, %34
store i8 0, i8* %35
%38 = load i8, i8* %9
switch i8 %38, label %43 [
i8 35, label %39
i8 0, label %39
]
39: ; preds = %37, %37
%40 = call i32* @fgets(i8* %9, i32 256, i32* %31)
%41 = icmp eq i32* %40, null
br i1 %41, label %109, label %42
42: ; preds = %39, %106
br label %37
43: ; preds = %37
%44 = call i32 @statmbx_splitConfigLine(i8* %9, i8** %7, i8** %8)
%45 = load i8*, i8** %8
%46 = call i32* @statmbx_getFile(i8* %25, i8* %45)
%47 = icmp eq i32* %46, null
br i1 %47, label %51, label %48
48: ; preds = %43
%49 = call i32* @fgets(i8* %10, i32 256, i32* %46)
%50 = icmp eq i32* %49, null
br i1 %50, label %106, label %55
51: ; preds = %43
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
%53 = load i8*, i8** %8
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i8* %53, i8* %25)
br label %106
55: ; preds = %48, %100
%56 = phi i32 [ %103, %100 ], [ 0, %48 ]
%57 = phi i32 [ %102, %100 ], [ 0, %48 ]
%58 = phi i32 [ %101, %100 ], [ 0, %48 ]
store i8 0, i8* %36
%59 = call i64 @strncmp(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 5)
%60 = icmp eq i64 %59, 0
%61 = icmp eq i32 %58, 0
br i1 %60, label %62, label %68
62: ; preds = %55
br i1 %61, label %67, label %63
63: ; preds = %62
%64 = load i8*, i8** %8
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.8, i64 0, i64 0), i8* %64)
%66 = call i32 @exit(i32 -1)
unreachable
67: ; preds = %62
store i8 0, i8* %11
store i8 0, i8* %12
br label %100
68: ; preds = %55
br i1 %61, label %100, label %69
69: ; preds = %68
%70 = load i8, i8* %10
%71 = icmp eq i8 %70, 10
br i1 %71, label %72, label %87
72: ; preds = %69
%73 = icmp eq i32 %57, 0
br i1 %73, label %74, label %100
74: ; preds = %72
br i1 %24, label %78, label %75
75: ; preds = %74
%76 = load i8*, i8** %7
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* %76)
br label %106
78: ; preds = %74
%79 = icmp eq i32 %56, 0
br i1 %79, label %80, label %85
80: ; preds = %78
%81 = call i32 @putchar(i32 10)
%82 = load i8*, i8** %7
%83 = call i32 @statmbx_printMaybeBold(i8* %82)
%84 = call i32 @putchar(i32 10)
br label %85
85: ; preds = %80, %78
%86 = call i32 @statmbx_printName(i8* %11, i8* %12)
br label %100
87: ; preds = %69
%88 = call i64 @strncmp(i8* %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i32 9)
%89 = icmp eq i64 %88, 0
br i1 %89, label %100, label %90
90: ; preds = %87
%91 = call i64 @strncmp(i8* %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i32 6)
%92 = icmp eq i64 %91, 0
br i1 %92, label %93, label %95
93: ; preds = %90
%94 = call i32 @strncpy(i8* %11, i8* %10, i32 256)
br label %100
95: ; preds = %90
%96 = call i64 @strncasecmp(i8* %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), i32 9)
%97 = icmp eq i64 %96, 0
br i1 %97, label %98, label %100
98: ; preds = %95
%99 = call i32 @strncpy(i8* %12, i8* %10, i32 256)
br label %100
100: ; preds = %72, %85, %87, %68, %95, %98, %93, %67
%101 = phi i32 [ 1, %67 ], [ 1, %93 ], [ 1, %98 ], [ 1, %95 ], [ 0, %68 ], [ 1, %87 ], [ 0, %85 ], [ 0, %72 ]
%102 = phi i32 [ 0, %67 ], [ %57, %93 ], [ %57, %98 ], [ %57, %95 ], [ %57, %68 ], [ 1, %87 ], [ 0, %85 ], [ %57, %72 ]
%103 = phi i32 [ %56, %67 ], [ %56, %93 ], [ %56, %98 ], [ %56, %95 ], [ %56, %68 ], [ %56, %87 ], [ 1, %85 ], [ %56, %72 ]
%104 = call i32* @fgets(i8* %10, i32 256, i32* %46)
%105 = icmp eq i32* %104, null
br i1 %105, label %106, label %55
106: ; preds = %100, %48, %75, %51
%107 = call i32* @fgets(i8* %9, i32 256, i32* %31)
%108 = icmp eq i32* %107, null
br i1 %108, label %109, label %42
109: ; preds = %106, %39, %30
br i1 %24, label %112, label %110
110: ; preds = %109
%111 = call i32 @putchar(i32 10)
br label %112
112: ; preds = %110, %109
%113 = call i32 @fclose(i32* %31)
ret i32 0
}