#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 */
struct stat {
  int st_mode;
};
struct dirent {
  char *d_name;
};
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int S_IFDIR;
int S_IFMT;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ *opendir(char *);
int parse_mail_flags(int /*<<< orphan*/ *);
long parse_mailid(int /*<<< orphan*/ *);
long parse_recipient(int /*<<< orphan*/ *);
long parse_send_time(int /*<<< orphan*/ *);
long parse_sender(int /*<<< orphan*/ *);
char *parse_subject(int /*<<< orphan*/ *);
char *parsefilename(char *);
struct dirent *readdir(int /*<<< orphan*/ *);
int /*<<< orphan*/ sprintascii(char *, int);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int stat(char *, struct stat *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strcmp(char *, char *);
void walkdir(FILE *index_file, char *dir) {
  char filename_qfd[1000], *subject, bits[65];
  struct dirent *dp;
  long id, sender, recipient, sent_time;
  int flags;
  DIR *dfd;
  FILE *mail_file;
  if ((dfd = opendir(dir)) == NULL) {
    fprintf(stderr, "Can't open %s\n", dir);
    return;
  }
  while ((dp = readdir(dfd)) != NULL) {
    struct stat stbuf;
    sprintf(filename_qfd, "%s/%s", dir, dp->d_name);
    if (stat(filename_qfd, &stbuf) == -1) {
      fprintf(stdout, "Unable to stat file: %s\n", filename_qfd);
      continue;
    }
    if ((stbuf.st_mode & S_IFMT) == S_IFDIR) {
      if (!strcmp(".", dp->d_name) || !strcmp("..", dp->d_name))
        continue;
      walkdir(index_file, filename_qfd);
    } else {
      char *name = parsefilename(dp->d_name);
      if (name != NULL) {
        mail_file = fopen(filename_qfd, "r");
        id = parse_mailid(mail_file);
        sender = parse_sender(mail_file);
        recipient = parse_recipient(mail_file);
        sent_time = parse_send_time(mail_file);
        flags = parse_mail_flags(mail_file);
        subject = parse_subject(mail_file);
        sprintascii(bits, flags);
        fprintf(index_file, "%ld %s %ld %ld %ld %s\n", id, *bits ? bits : "0",
                sender, recipient, sent_time, subject);
        fclose(mail_file);
      }
    }
  }
}


x86 assembly (clang, -O0):
<walkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4d0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <opendir@plt>
mov    %rax,-0x488(%rbp)
cmp    $0x0,%rax
jne    125e <walkdir+0x4e>
mov    0x2d94(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rdx
lea    0xdae(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
jmp    14c5 <walkdir+0x2b5>
jmp    1263 <walkdir+0x53>
mov    -0x488(%rbp),%rdi
call   10e0 <readdir@plt>
mov    %rax,-0x458(%rbp)
cmp    $0x0,%rax
je     14c5 <walkdir+0x2b5>
lea    -0x400(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x458(%rbp),%rax
mov    (%rax),%rcx
lea    0xd73(%rip),%rsi
call   1130 <sprintf@plt>
lea    -0x400(%rbp),%rdi
lea    -0x498(%rbp),%rsi
call   10d0 <stat@plt>
cmp    $0xffffffff,%eax
jne    12e1 <walkdir+0xd1>
mov    0x2d0c(%rip),%rax
movslq (%rax),%rdi
lea    -0x400(%rbp),%rdx
lea    0xd40(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
jmp    1263 <walkdir+0x53>
mov    -0x498(%rbp),%eax
mov    0x2cf2(%rip),%rcx
and    (%rcx),%eax
mov    0x2cc9(%rip),%rcx
cmp    (%rcx),%eax
jne    1357 <walkdir+0x147>
mov    -0x458(%rbp),%rax
mov    (%rax),%rsi
lea    0xd1f(%rip),%rdi
call   10a0 <strcmp@plt>
cmp    $0x0,%eax
je     133d <walkdir+0x12d>
mov    -0x458(%rbp),%rax
mov    (%rax),%rsi
lea    0xcff(%rip),%rdi
call   10a0 <strcmp@plt>
cmp    $0x0,%eax
jne    1342 <walkdir+0x132>
jmp    1263 <walkdir+0x53>
mov    -0x8(%rbp),%rdi
lea    -0x400(%rbp),%rsi
call   1100 <walkdir@plt>
jmp    14c0 <walkdir+0x2b0>
mov    -0x458(%rbp),%rax
mov    (%rax),%rdi
call   10f0 <parsefilename@plt>
mov    %rax,-0x4a0(%rbp)
cmpq   $0x0,-0x4a0(%rbp)
je     14bb <walkdir+0x2ab>
lea    -0x400(%rbp),%rdi
lea    0xca8(%rip),%rsi
call   1110 <fopen@plt>
mov    %rax,-0x490(%rbp)
mov    -0x490(%rbp),%rdi
call   1040 <parse_mailid@plt>
mov    %rax,-0x460(%rbp)
mov    -0x490(%rbp),%rdi
call   1120 <parse_sender@plt>
mov    %rax,-0x468(%rbp)
mov    -0x490(%rbp),%rdi
call   1050 <parse_recipient@plt>
mov    %rax,-0x470(%rbp)
mov    -0x490(%rbp),%rdi
call   1080 <parse_send_time@plt>
mov    %rax,-0x478(%rbp)
mov    -0x490(%rbp),%rdi
call   1090 <parse_mail_flags@plt>
mov    %eax,-0x47c(%rbp)
mov    -0x490(%rbp),%rdi
call   1030 <parse_subject@plt>
mov    %rax,-0x408(%rbp)
lea    -0x450(%rbp),%rdi
mov    -0x47c(%rbp),%esi
call   10c0 <sprintascii@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x4b0(%rbp)
mov    -0x460(%rbp),%rax
mov    %rax,-0x4a8(%rbp)
movsbl -0x450(%rbp),%eax
cmp    $0x0,%eax
je     1454 <walkdir+0x244>
lea    -0x450(%rbp),%rax
mov    %rax,-0x4b8(%rbp)
jmp    1467 <walkdir+0x257>
lea    0xbef(%rip),%rax
mov    %rax,-0x4b8(%rbp)
jmp    1467 <walkdir+0x257>
mov    -0x4a8(%rbp),%rdx
mov    -0x4b0(%rbp),%rdi
mov    -0x4b8(%rbp),%rcx
mov    -0x468(%rbp),%r8
mov    -0x470(%rbp),%r9
mov    -0x478(%rbp),%r10
mov    -0x408(%rbp),%rax
lea    0xb94(%rip),%rsi
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    -0x490(%rbp),%rdi
call   1060 <fclose@plt>
jmp    14c0 <walkdir+0x2b0>
jmp    1263 <walkdir+0x53>
add    $0x4d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<walkdir>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x478,%rsp
mov    %rsi,%r14
mov    %rdi,0x8(%rsp)
mov    %rsi,%rdi
call   1070 <opendir@plt>
test   %rax,%rax
je     140e <walkdir+0x1fe>
mov    %rax,%rbx
mov    %rax,%rdi
call   10e0 <readdir@plt>
test   %rax,%rax
je     13fc <walkdir+0x1ec>
mov    %rax,%rbp
lea    0xdb7(%rip),%r12
lea    0x90(%rsp),%r15
mov    %rsp,%r13
mov    %r14,0x18(%rsp)
mov    %rbx,0x10(%rsp)
jmp    129f <walkdir+0x8f>
nop
mov    0x2d59(%rip),%rax
movslq (%rax),%rdi
lea    0xd94(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    %rbx,%rdi
call   10e0 <readdir@plt>
mov    %rax,%rbp
test   %rax,%rax
je     13fc <walkdir+0x1ec>
mov    0x0(%rbp),%rcx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
call   1130 <sprintf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
call   10d0 <stat@plt>
cmp    $0xffffffff,%eax
je     1270 <walkdir+0x60>
mov    0x2d18(%rip),%rax
mov    (%rax),%eax
and    (%rsp),%eax
mov    0x0(%rbp),%rbp
mov    0x2ce8(%rip),%rcx
cmp    (%rcx),%eax
jne    1320 <walkdir+0x110>
lea    0xd4c(%rip),%rdi
mov    %rbp,%rsi
call   10a0 <strcmp@plt>
test   %eax,%eax
je     128b <walkdir+0x7b>
lea    0xd38(%rip),%rdi
mov    %rbp,%rsi
call   10a0 <strcmp@plt>
test   %eax,%eax
je     128b <walkdir+0x7b>
mov    0x8(%rsp),%rdi
mov    %r15,%rsi
call   1100 <walkdir@plt>
jmp    128b <walkdir+0x7b>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbp,%rdi
call   10f0 <parsefilename@plt>
test   %rax,%rax
je     128b <walkdir+0x7b>
mov    %r15,%rdi
lea    0xcf6(%rip),%rsi
call   1110 <fopen@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1040 <parse_mailid@plt>
mov    %rax,0x38(%rsp)
mov    %r14,%rdi
call   1120 <parse_sender@plt>
mov    %rax,0x30(%rsp)
mov    %r14,%rdi
call   1050 <parse_recipient@plt>
mov    %rax,0x28(%rsp)
mov    %r14,%rdi
call   1080 <parse_send_time@plt>
mov    %rax,0x20(%rsp)
mov    %r14,%rdi
call   1090 <parse_mail_flags@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <parse_subject@plt>
mov    %r12,%rbx
mov    %rax,%r12
lea    0x40(%rsp),%r13
mov    %r13,%rdi
mov    %ebp,%esi
call   10c0 <sprintascii@plt>
cmpb   $0x0,0x40(%rsp)
lea    0xca0(%rip),%rax
cmove  %rax,%r13
mov    0x8(%rsp),%rdi
lea    0xc79(%rip),%rsi
mov    0x38(%rsp),%rdx
mov    %r13,%rcx
mov    0x30(%rsp),%r8
mov    0x28(%rsp),%r9
xor    %eax,%eax
push   %r12
mov    %rbx,%r12
push   0x28(%rsp)
lea    0x10(%rsp),%r13
call   10b0 <fprintf@plt>
add    $0x10,%rsp
mov    %r14,%rdi
mov    0x10(%rsp),%rbx
mov    0x18(%rsp),%r14
call   1060 <fclose@plt>
jmp    128b <walkdir+0x7b>
add    $0x478,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2bc3(%rip),%rax
movslq (%rax),%rdi
lea    0xbe1(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
add    $0x478,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    10b0 <fprintf@plt>

LLVM IR (-O0):
%struct.dirent = type { i8* }
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [15 x i8] c"Can't open %s\0A\00"
@.str.1 = [6 x i8] c"%s/%s\00"
@stdout = global i32 0
@.str.2 = [25 x i8] c"Unable to stat file: %s\0A\00"
@S_IFMT = global i32 0
@S_IFDIR = global i32 0
@.str.3 = [2 x i8] c".\00"
@.str.4 = [3 x i8] c"..\00"
@.str.5 = [2 x i8] c"r\00"
@.str.6 = [23 x i8] c"%ld %s %ld %ld %ld %s\0A\00"
@.str.7 = [2 x i8] c"0\00"
define void @walkdir(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca [1000 x i8]
%6 = alloca i8*
%7 = alloca [65 x i8]
%8 = alloca %struct.dirent*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i32
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca %struct.stat
%17 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%18 = load i8*, i8** %4
%19 = call i32* @opendir(i8* %18)
store i32* %19, i32** %14
%20 = icmp eq i32* %19, null
br i1 %20, label %21, label %27
21: ; preds = %2
%22 = load i32, i32* @stderr
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to i32*
%25 = load i8*, i8** %4
%26 = call i32 (i32*, i8*, ...) @fprintf(i32* %24, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %25)
br label %116
27: ; preds = %2
br label %28
28: ; preds = %115, %67, %42, %27
%29 = load i32*, i32** %14
%30 = call %struct.dirent* @readdir(i32* %29)
store %struct.dirent* %30, %struct.dirent** %8
%31 = icmp ne %struct.dirent* %30, null
br i1 %31, label %32, label %116
32: ; preds = %28
%33 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%34 = load i8*, i8** %4
%35 = load %struct.dirent*, %struct.dirent** %8
%36 = getelementptr inbounds %struct.dirent, %struct.dirent* %35, i32 0, i32 0
%37 = load i8*, i8** %36
%38 = call i32 @sprintf(i8* %33, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %34, i8* %37)
%39 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%40 = call i32 @stat(i8* %39, %struct.stat* %16)
%41 = icmp eq i32 %40, -1
br i1 %41, label %42, label %48
42: ; preds = %32
%43 = load i32, i32* @stdout
%44 = sext i32 %43 to i64
%45 = inttoptr i64 %44 to i32*
%46 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%47 = call i32 (i32*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %46)
br label %28
48: ; preds = %32
%49 = getelementptr inbounds %struct.stat, %struct.stat* %16, i32 0, i32 0
%50 = load i32, i32* %49
%51 = load i32, i32* @S_IFMT
%52 = and i32 %50, %51
%53 = load i32, i32* @S_IFDIR
%54 = icmp eq i32 %52, %53
br i1 %54, label %55, label %71
55: ; preds = %48
%56 = load %struct.dirent*, %struct.dirent** %8
%57 = getelementptr inbounds %struct.dirent, %struct.dirent* %56, i32 0, i32 0
%58 = load i8*, i8** %57
%59 = call i32 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* %58)
%60 = icmp ne i32 %59, 0
br i1 %60, label %61, label %67
61: ; preds = %55
%62 = load %struct.dirent*, %struct.dirent** %8
%63 = getelementptr inbounds %struct.dirent, %struct.dirent* %62, i32 0, i32 0
%64 = load i8*, i8** %63
%65 = call i32 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %64)
%66 = icmp ne i32 %65, 0
br i1 %66, label %68, label %67
67: ; preds = %61, %55
br label %28
68: ; preds = %61
%69 = load i32*, i32** %3
%70 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
br label %115
71: ; preds = %48
%72 = load %struct.dirent*, %struct.dirent** %8
%73 = getelementptr inbounds %struct.dirent, %struct.dirent* %72, i32 0, i32 0
%74 = load i8*, i8** %73
%75 = call i8* @parsefilename(i8* %74)
store i8* %75, i8** %17
%76 = load i8*, i8** %17
%77 = icmp ne i8* %76, null
br i1 %77, label %78, label %114
78: ; preds = %71
%79 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%80 = call i32* @fopen(i8* %79, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %80, i32** %15
%81 = load i32*, i32** %15
%82 = call i64 @parse_mailid(i32* %81)
store i64 %82, i64* %9
%83 = load i32*, i32** %15
%84 = call i64 @parse_sender(i32* %83)
store i64 %84, i64* %10
%85 = load i32*, i32** %15
%86 = call i64 @parse_recipient(i32* %85)
store i64 %86, i64* %11
%87 = load i32*, i32** %15
%88 = call i64 @parse_send_time(i32* %87)
store i64 %88, i64* %12
%89 = load i32*, i32** %15
%90 = call i32 @parse_mail_flags(i32* %89)
store i32 %90, i32* %13
%91 = load i32*, i32** %15
%92 = call i8* @parse_subject(i32* %91)
store i8* %92, i8** %6
%93 = getelementptr inbounds [65 x i8], [65 x i8]* %7, i64 0, i64 0
%94 = load i32, i32* %13
%95 = call i32 @sprintascii(i8* %93, i32 %94)
%96 = load i32*, i32** %3
%97 = load i64, i64* %9
%98 = getelementptr inbounds [65 x i8], [65 x i8]* %7, i64 0, i64 0
%99 = load i8, i8* %98
%100 = sext i8 %99 to i32
%101 = icmp ne i32 %100, 0
br i1 %101, label %102, label %104
102: ; preds = %78
%103 = getelementptr inbounds [65 x i8], [65 x i8]* %7, i64 0, i64 0
br label %105
104: ; preds = %78
br label %105
105: ; preds = %104, %102
%106 = phi i8* [ %103, %102 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), %104 ]
%107 = load i64, i64* %10
%108 = load i64, i64* %11
%109 = load i64, i64* %12
%110 = load i8*, i8** %6
%111 = call i32 (i32*, i8*, ...) @fprintf(i32* %96, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i64 %97, i8* %106, i64 %107, i64 %108, i64 %109, i8* %110)
%112 = load i32*, i32** %15
%113 = call i32 @fclose(i32* %112)
br label %114
114: ; preds = %105, %71
br label %115
115: ; preds = %114, %68
br label %28
116: ; preds = %21, %28
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.dirent = type { i8* }
@stderr = global i32 0
@.str = [15 x i8] c"Can't open %s\0A\00"
@.str.1 = [6 x i8] c"%s/%s\00"
@stdout = global i32 0
@.str.2 = [25 x i8] c"Unable to stat file: %s\0A\00"
@S_IFMT = global i32 0
@S_IFDIR = global i32 0
@.str.3 = [2 x i8] c".\00"
@.str.4 = [3 x i8] c"..\00"
@.str.5 = [2 x i8] c"r\00"
@.str.6 = [23 x i8] c"%ld %s %ld %ld %ld %s\0A\00"
@.str.7 = [2 x i8] c"0\00"
define void @walkdir(i32* nocapture %0, i8* %1) {
%3 = alloca [1000 x i8]
%4 = alloca [65 x i8]
%5 = alloca %struct.stat
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [65 x i8], [65 x i8]* %4, i64 0, i64 0
%8 = tail call i32* @opendir(i8* %1)
%9 = icmp eq i32* %8, null
br i1 %9, label %16, label %10
10: ; preds = %2
%11 = call %struct.dirent* @readdir(i32* %8)
%12 = icmp eq %struct.dirent* %11, null
br i1 %12, label %67, label %13
13: ; preds = %10
%14 = bitcast %struct.stat* %5 to i8*
%15 = getelementptr inbounds %struct.stat, %struct.stat* %5, i64 0, i32 0
br label %21
16: ; preds = %2
%17 = load i32, i32* @stderr
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
%20 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %19, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %67
21: ; preds = %13, %64
%22 = phi %struct.dirent* [ %11, %13 ], [ %65, %64 ]
%23 = getelementptr inbounds %struct.dirent, %struct.dirent* %22, i64 0, i32 0
%24 = load i8*, i8** %23
%25 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %1, i8* %24)
%26 = call i32 @stat(i8* %6, %struct.stat* %5)
%27 = icmp eq i32 %26, -1
br i1 %27, label %28, label %33
28: ; preds = %21
%29 = load i32, i32* @stdout
%30 = sext i32 %29 to i64
%31 = inttoptr i64 %30 to i32*
%32 = call i32 (i32*, i8*, ...) @fprintf(i32* %31, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %6)
br label %64
33: ; preds = %21
%34 = load i32, i32* %15
%35 = load i32, i32* @S_IFMT
%36 = and i32 %35, %34
%37 = load i32, i32* @S_IFDIR
%38 = icmp eq i32 %36, %37
%39 = load i8*, i8** %23
br i1 %38, label %40, label %47
40: ; preds = %33
%41 = call i32 @strcmp(i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* dereferenceable(1) %39)
%42 = icmp eq i32 %41, 0
br i1 %42, label %64, label %43
43: ; preds = %40
%44 = call i32 @strcmp(i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* dereferenceable(1) %39)
%45 = icmp eq i32 %44, 0
br i1 %45, label %64, label %46
46: ; preds = %43
br label %64
47: ; preds = %33
%48 = call i8* @parsefilename(i8* %39)
%49 = icmp eq i8* %48, null
br i1 %49, label %64, label %50
50: ; preds = %47
%51 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%52 = call i64 @parse_mailid(i32* %51)
%53 = call i64 @parse_sender(i32* %51)
%54 = call i64 @parse_recipient(i32* %51)
%55 = call i64 @parse_send_time(i32* %51)
%56 = call i32 @parse_mail_flags(i32* %51)
%57 = call i8* @parse_subject(i32* %51)
%58 = call i32 @sprintascii(i8* %7, i32 %56)
%59 = load i8, i8* %7
%60 = icmp eq i8 %59, 0
%61 = select i1 %60, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8* %7
%62 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i64 %52, i8* %61, i64 %53, i64 %54, i64 %55, i8* %57)
%63 = call i32 @fclose(i32* %51)
br label %64
64: ; preds = %46, %50, %47, %40, %43, %28
%65 = call %struct.dirent* @readdir(i32* %8)
%66 = icmp eq %struct.dirent* %65, null
br i1 %66, label %67, label %21
67: ; preds = %64, %10, %16
ret void
}