#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 mntent {
  char *mnt_fsname;
  char *mnt_dir;
  char *mnt_type;
  char *mnt_opts;
  int mnt_freq;
  int mnt_passno;
};
typedef int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ addmntent(int /*<<< orphan*/ *, struct mntent *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
struct mntent *getmntent(int /*<<< orphan*/ *);
scalar_t__ hasmntopt(struct mntent *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
void *strdupa(char *);
int main(int argc, char *argv[]) {
  int result = 0;
  struct mntent mef;
  struct mntent *mnt = &mef;
  char *name;
  FILE *fp;
  mef.mnt_fsname = strdupa("/dev/hda1");
  mef.mnt_dir = strdupa("/some dir");
  mef.mnt_type = strdupa("ext2");
  mef.mnt_opts = strdupa("defaults");
  mef.mnt_freq = 1;
  mef.mnt_passno = 2;
  if (hasmntopt(mnt, "defaults"))
    printf("Found!\n");
  else {
    printf("Didn't find it\n");
    result = 1;
  }
  name = "./fstab";
  fp = fopen(name, "wb+");
  if (fp == NULL) {
    printf("Cannot open temporary file: %m\n");
    result = 1;
  } else {
    char buf[1024];
    addmntent(fp, &mef);
    rewind(fp);
    if (fgets(buf, sizeof(buf), fp) == NULL) {
      printf("Cannot read temporary file: %m");
      result = 1;
    } else if (strcmp(buf, "/dev/hda1 /some\\040dir ext2 defaults 1 2\n") !=
               0) {
      puts("Raw file data not correct");
      result = 1;
    }
    rewind(fp);
    mnt = getmntent(fp);
    if (strcmp(mnt->mnt_fsname, "/dev/hda1") != 0 ||
        strcmp(mnt->mnt_dir, "/some dir") != 0 ||
        strcmp(mnt->mnt_type, "ext2") != 0 ||
        strcmp(mnt->mnt_opts, "defaults") != 0 || mnt->mnt_freq != 1 ||
        mnt->mnt_passno != 2) {
      puts("Error while reading written entry back in");
      fprintf(stderr, "mnt->mnt_fsname: %s\n", mnt->mnt_fsname);
      fprintf(stderr, "mnt->mnt_dir: %s\n", mnt->mnt_dir);
      fprintf(stderr, "mnt->mnt_type: %s\n", mnt->mnt_type);
      fprintf(stderr, "mnt->mnt_opts: %s\n", mnt->mnt_opts);
      result = 1;
    }
  }
  return result;
}


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,-0x14(%rbp)
lea    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    0xe21(%rip),%rdi
call   10b0 <strdupa@plt>
mov    %rax,-0x40(%rbp)
lea    0xe1b(%rip),%rdi
call   10b0 <strdupa@plt>
mov    %rax,-0x38(%rbp)
lea    0xe15(%rip),%rdi
call   10b0 <strdupa@plt>
mov    %rax,-0x30(%rbp)
lea    0xe0a(%rip),%rdi
call   10b0 <strdupa@plt>
mov    %rax,-0x28(%rbp)
movl   $0x1,-0x20(%rbp)
movl   $0x2,-0x1c(%rbp)
mov    -0x48(%rbp),%rdi
lea    0xde8(%rip),%rsi
call   10d0 <hasmntopt@plt>
cmp    $0x0,%rax
je     1251 <main+0xa1>
lea    0xddb(%rip),%rdi
call   1040 <printf@plt>
jmp    1264 <main+0xb4>
lea    0xdd2(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x14(%rbp)
lea    0xdcf(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
lea    0xdc8(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    12a6 <main+0xf6>
lea    0xdb1(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    145c <main+0x2ac>
mov    -0x58(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1070 <addmntent@plt>
mov    -0x58(%rbp),%rdi
call   1050 <rewind@plt>
lea    -0x460(%rbp),%rdi
mov    -0x58(%rbp),%rdx
mov    $0x400,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
jne    12f3 <main+0x143>
lea    0xd84(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    1328 <main+0x178>
lea    -0x460(%rbp),%rdi
lea    0xd84(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     1323 <main+0x173>
lea    0xd98(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x14(%rbp)
jmp    1328 <main+0x178>
mov    -0x58(%rbp),%rdi
call   1050 <rewind@plt>
mov    -0x58(%rbp),%rdi
call   10a0 <getmntent@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    (%rax),%rdi
lea    0xcb4(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    13d1 <main+0x221>
mov    -0x48(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xca0(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    13d1 <main+0x221>
mov    -0x48(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xc8c(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    13d1 <main+0x221>
mov    -0x48(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xc73(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    13d1 <main+0x221>
mov    -0x48(%rbp),%rax
cmpl   $0x1,0x20(%rax)
jne    13d1 <main+0x221>
mov    -0x48(%rbp),%rax
cmpl   $0x2,0x24(%rax)
je     1457 <main+0x2a7>
lea    0xcf1(%rip),%rdi
call   1030 <puts@plt>
mov    0x2bfc(%rip),%rax
mov    (%rax),%edi
mov    -0x48(%rbp),%rax
mov    (%rax),%rdx
lea    0xcff(%rip),%rsi
call   1090 <fprintf@plt>
mov    0x2be0(%rip),%rax
mov    (%rax),%edi
mov    -0x48(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xcf7(%rip),%rsi
call   1090 <fprintf@plt>
mov    0x2bc3(%rip),%rax
mov    (%rax),%edi
mov    -0x48(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xcec(%rip),%rsi
call   1090 <fprintf@plt>
mov    0x2ba6(%rip),%rax
mov    (%rax),%edi
mov    -0x48(%rbp),%rax
mov    0x18(%rax),%rdx
lea    0xce2(%rip),%rsi
call   1090 <fprintf@plt>
movl   $0x1,-0x14(%rbp)
jmp    145c <main+0x2ac>
mov    -0x14(%rbp),%eax
add    $0x460,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x430,%rsp
lea    0xe3e(%rip),%rdi
call   10b0 <strdupa@plt>
mov    %rax,0x8(%rsp)
lea    0xe37(%rip),%rdi
call   10b0 <strdupa@plt>
mov    %rax,0x10(%rsp)
lea    0xe30(%rip),%rdi
call   10b0 <strdupa@plt>
mov    %rax,0x18(%rsp)
lea    0xe24(%rip),%rbx
mov    %rbx,%rdi
call   10b0 <strdupa@plt>
mov    %rax,0x20(%rsp)
movabs $0x200000001,%rax
mov    %rax,0x28(%rsp)
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
call   10d0 <hasmntopt@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %r14b
lea    0xefa(%rip),%rax
lea    0xf02(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
lea    0xddd(%rip),%rdi
lea    0xdde(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     12a9 <main+0xf9>
mov    %rax,%rbx
lea    0x8(%rsp),%rsi
mov    %rax,%rdi
call   1070 <addmntent@plt>
mov    %rbx,%rdi
call   1050 <rewind@plt>
lea    0x30(%rsp),%rdi
mov    $0x400,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     12ba <main+0x10a>
lea    0xde1(%rip),%rsi
lea    0x30(%rsp),%rdi
call   1080 <strcmp@plt>
test   %rax,%rax
je     12cd <main+0x11d>
lea    0xdf5(%rip),%rdi
call   1030 <puts@plt>
jmp    12c6 <main+0x116>
lea    0xd7e(%rip),%rdi
call   1040 <printf@plt>
jmp    13a0 <main+0x1f0>
lea    0xd8d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%ebp
jmp    12d0 <main+0x120>
mov    %r14b,%bpl
mov    %rbx,%rdi
call   1050 <rewind@plt>
mov    %rbx,%rdi
call   10a0 <getmntent@plt>
mov    %rax,%rbx
mov    (%rax),%rdi
lea    0xd13(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    1342 <main+0x192>
mov    0x8(%rbx),%rdi
lea    0xd08(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    1342 <main+0x192>
mov    0x10(%rbx),%rdi
lea    0xcfd(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    1342 <main+0x192>
mov    0x18(%rbx),%rdi
lea    0xced(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    1342 <main+0x192>
cmpl   $0x1,0x20(%rbx)
jne    1342 <main+0x192>
cmpl   $0x2,0x24(%rbx)
je     13a5 <main+0x1f5>
lea    0xd68(%rip),%rdi
call   1030 <puts@plt>
mov    0x2c8b(%rip),%rbp
mov    0x0(%rbp),%edi
mov    (%rbx),%rdx
lea    0xd79(%rip),%rsi
call   1090 <fprintf@plt>
mov    0x0(%rbp),%edi
mov    0x8(%rbx),%rdx
lea    0xd7b(%rip),%rsi
call   1090 <fprintf@plt>
mov    0x0(%rbp),%edi
mov    0x10(%rbx),%rdx
lea    0xd7a(%rip),%rsi
call   1090 <fprintf@plt>
mov    0x0(%rbp),%edi
mov    0x18(%rbx),%rdx
lea    0xd7a(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x430,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.mntent = type { i8*, i8*, i8*, i8*, i32, i32 }
@.str = [10 x i8] c"/dev/hda1\00"
@.str.1 = [10 x i8] c"/some dir\00"
@.str.2 = [5 x i8] c"ext2\00"
@.str.3 = [9 x i8] c"defaults\00"
@.str.4 = [8 x i8] c"Found!\0A\00"
@.str.5 = [16 x i8] c"Didn't find it\0A\00"
@.str.6 = [8 x i8] c"./fstab\00"
@.str.7 = [4 x i8] c"wb+\00"
@.str.8 = [32 x i8] c"Cannot open temporary file: %m\0A\00"
@.str.9 = [31 x i8] c"Cannot read temporary file: %m\00"
@.str.10 = [42 x i8] c"/dev/hda1 /some\\040dir ext2 defaults 1 2\0A\00"
@.str.11 = [26 x i8] c"Raw file data not correct\00"
@.str.12 = [42 x i8] c"Error while reading written entry back in\00"
@stderr = global i32 0
@.str.13 = [21 x i8] c"mnt->mnt_fsname: %s\0A\00"
@.str.14 = [18 x i8] c"mnt->mnt_dir: %s\0A\00"
@.str.15 = [19 x i8] c"mnt->mnt_type: %s\0A\00"
@.str.16 = [19 x i8] c"mnt->mnt_opts: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca %struct.mntent
%8 = alloca %struct.mntent*
%9 = alloca i8*
%10 = alloca i32*
%11 = alloca [1024 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store %struct.mntent* %7, %struct.mntent** %8
%12 = call i8* @strdupa(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%13 = getelementptr inbounds %struct.mntent, %struct.mntent* %7, i32 0, i32 0
store i8* %12, i8** %13
%14 = call i8* @strdupa(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%15 = getelementptr inbounds %struct.mntent, %struct.mntent* %7, i32 0, i32 1
store i8* %14, i8** %15
%16 = call i8* @strdupa(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%17 = getelementptr inbounds %struct.mntent, %struct.mntent* %7, i32 0, i32 2
store i8* %16, i8** %17
%18 = call i8* @strdupa(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%19 = getelementptr inbounds %struct.mntent, %struct.mntent* %7, i32 0, i32 3
store i8* %18, i8** %19
%20 = getelementptr inbounds %struct.mntent, %struct.mntent* %7, i32 0, i32 4
store i32 1, i32* %20
%21 = getelementptr inbounds %struct.mntent, %struct.mntent* %7, i32 0, i32 5
store i32 2, i32* %21
%22 = load %struct.mntent*, %struct.mntent** %8
%23 = call i64 @hasmntopt(%struct.mntent* %22, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %2
%26 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
br label %29
27: ; preds = %2
%28 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %6
br label %29
29: ; preds = %27, %25
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8** %9
%30 = load i8*, i8** %9
%31 = call i32* @fopen(i8* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
store i32* %31, i32** %10
%32 = load i32*, i32** %10
%33 = icmp eq i32* %32, null
br i1 %33, label %34, label %36
34: ; preds = %29
%35 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0))
store i32 1, i32* %6
br label %115
36: ; preds = %29
%37 = load i32*, i32** %10
%38 = call i32 @addmntent(i32* %37, %struct.mntent* %7)
%39 = load i32*, i32** %10
%40 = call i32 @rewind(i32* %39)
%41 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%42 = load i32*, i32** %10
%43 = call i32* @fgets(i8* %41, i32 1024, i32* %42)
%44 = icmp eq i32* %43, null
br i1 %44, label %45, label %47
45: ; preds = %36
%46 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0))
store i32 1, i32* %6
br label %54
47: ; preds = %36
%48 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%49 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.10, i64 0, i64 0))
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %47
%52 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0))
store i32 1, i32* %6
br label %53
53: ; preds = %51, %47
br label %54
54: ; preds = %53, %45
%55 = load i32*, i32** %10
%56 = call i32 @rewind(i32* %55)
%57 = load i32*, i32** %10
%58 = call %struct.mntent* @getmntent(i32* %57)
store %struct.mntent* %58, %struct.mntent** %8
%59 = load %struct.mntent*, %struct.mntent** %8
%60 = getelementptr inbounds %struct.mntent, %struct.mntent* %59, i32 0, i32 0
%61 = load i8*, i8** %60
%62 = call i64 @strcmp(i8* %61, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%63 = icmp ne i64 %62, 0
br i1 %63, label %92, label %64
64: ; preds = %54
%65 = load %struct.mntent*, %struct.mntent** %8
%66 = getelementptr inbounds %struct.mntent, %struct.mntent* %65, i32 0, i32 1
%67 = load i8*, i8** %66
%68 = call i64 @strcmp(i8* %67, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%69 = icmp ne i64 %68, 0
br i1 %69, label %92, label %70
70: ; preds = %64
%71 = load %struct.mntent*, %struct.mntent** %8
%72 = getelementptr inbounds %struct.mntent, %struct.mntent* %71, i32 0, i32 2
%73 = load i8*, i8** %72
%74 = call i64 @strcmp(i8* %73, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%75 = icmp ne i64 %74, 0
br i1 %75, label %92, label %76
76: ; preds = %70
%77 = load %struct.mntent*, %struct.mntent** %8
%78 = getelementptr inbounds %struct.mntent, %struct.mntent* %77, i32 0, i32 3
%79 = load i8*, i8** %78
%80 = call i64 @strcmp(i8* %79, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%81 = icmp ne i64 %80, 0
br i1 %81, label %92, label %82
82: ; preds = %76
%83 = load %struct.mntent*, %struct.mntent** %8
%84 = getelementptr inbounds %struct.mntent, %struct.mntent* %83, i32 0, i32 4
%85 = load i32, i32* %84
%86 = icmp ne i32 %85, 1
br i1 %86, label %92, label %87
87: ; preds = %82
%88 = load %struct.mntent*, %struct.mntent** %8
%89 = getelementptr inbounds %struct.mntent, %struct.mntent* %88, i32 0, i32 5
%90 = load i32, i32* %89
%91 = icmp ne i32 %90, 2
br i1 %91, label %92, label %114
92: ; preds = %87, %82, %76, %70, %64, %54
%93 = call i32 @puts(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.12, i64 0, i64 0))
%94 = load i32, i32* @stderr
%95 = load %struct.mntent*, %struct.mntent** %8
%96 = getelementptr inbounds %struct.mntent, %struct.mntent* %95, i32 0, i32 0
%97 = load i8*, i8** %96
%98 = call i32 @fprintf(i32 %94, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0), i8* %97)
%99 = load i32, i32* @stderr
%100 = load %struct.mntent*, %struct.mntent** %8
%101 = getelementptr inbounds %struct.mntent, %struct.mntent* %100, i32 0, i32 1
%102 = load i8*, i8** %101
%103 = call i32 @fprintf(i32 %99, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i8* %102)
%104 = load i32, i32* @stderr
%105 = load %struct.mntent*, %struct.mntent** %8
%106 = getelementptr inbounds %struct.mntent, %struct.mntent* %105, i32 0, i32 2
%107 = load i8*, i8** %106
%108 = call i32 @fprintf(i32 %104, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.15, i64 0, i64 0), i8* %107)
%109 = load i32, i32* @stderr
%110 = load %struct.mntent*, %struct.mntent** %8
%111 = getelementptr inbounds %struct.mntent, %struct.mntent* %110, i32 0, i32 3
%112 = load i8*, i8** %111
%113 = call i32 @fprintf(i32 %109, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i8* %112)
store i32 1, i32* %6
br label %114
114: ; preds = %92, %87
br label %115
115: ; preds = %114, %34
%116 = load i32, i32* %6
ret i32 %116
}

LLVM IR (-O2):
%struct.mntent = type { i8*, i8*, i8*, i8*, i32, i32 }
@.str = [10 x i8] c"/dev/hda1\00"
@.str.1 = [10 x i8] c"/some dir\00"
@.str.2 = [5 x i8] c"ext2\00"
@.str.3 = [9 x i8] c"defaults\00"
@.str.6 = [8 x i8] c"./fstab\00"
@.str.7 = [4 x i8] c"wb+\00"
@.str.8 = [32 x i8] c"Cannot open temporary file: %m\0A\00"
@.str.9 = [31 x i8] c"Cannot read temporary file: %m\00"
@.str.10 = [42 x i8] c"/dev/hda1 /some\\040dir ext2 defaults 1 2\0A\00"
@.str.11 = [26 x i8] c"Raw file data not correct\00"
@.str.12 = [42 x i8] c"Error while reading written entry back in\00"
@stderr = global i32 0
@.str.13 = [21 x i8] c"mnt->mnt_fsname: %s\0A\00"
@.str.14 = [18 x i8] c"mnt->mnt_dir: %s\0A\00"
@.str.15 = [19 x i8] c"mnt->mnt_type: %s\0A\00"
@.str.16 = [19 x i8] c"mnt->mnt_opts: %s\0A\00"
@str = [15 x i8] c"Didn't find it\00"
@str.17 = [7 x i8] c"Found!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.mntent
%4 = alloca [1024 x i8]
%5 = bitcast %struct.mntent* %3 to i8*
%6 = tail call i8* @strdupa(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds %struct.mntent, %struct.mntent* %3, i64 0, i32 0
store i8* %6, i8** %7
%8 = tail call i8* @strdupa(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%9 = getelementptr inbounds %struct.mntent, %struct.mntent* %3, i64 0, i32 1
store i8* %8, i8** %9
%10 = tail call i8* @strdupa(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%11 = getelementptr inbounds %struct.mntent, %struct.mntent* %3, i64 0, i32 2
store i8* %10, i8** %11
%12 = tail call i8* @strdupa(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%13 = getelementptr inbounds %struct.mntent, %struct.mntent* %3, i64 0, i32 3
store i8* %12, i8** %13
%14 = getelementptr inbounds %struct.mntent, %struct.mntent* %3, i64 0, i32 4
store i32 1, i32* %14
%15 = getelementptr inbounds %struct.mntent, %struct.mntent* %3, i64 0, i32 5
store i32 2, i32* %15
%16 = call i64 @hasmntopt(%struct.mntent* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
%18 = select i1 %17, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str.17, i64 0, i64 0)
%19 = zext i1 %17 to i32
%20 = call i32 @puts(i8* dereferenceable(1) %18)
%21 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%22 = icmp eq i32* %21, null
br i1 %22, label %23, label %25
23: ; preds = %2
%24 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0))
br label %88
25: ; preds = %2
%26 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%27 = call i32 @addmntent(i32* %21, %struct.mntent* %3)
%28 = call i32 @rewind(i32* %21)
%29 = call i32* @fgets(i8* %26, i32 1024, i32* %21)
%30 = icmp eq i32* %29, null
br i1 %30, label %31, label %33
31: ; preds = %25
%32 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0))
br label %38
33: ; preds = %25
%34 = call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.10, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %38, label %36
36: ; preds = %33
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0))
br label %38
38: ; preds = %33, %36, %31
%39 = phi i32 [ 1, %31 ], [ 1, %36 ], [ %19, %33 ]
%40 = call i32 @rewind(i32* %21)
%41 = call %struct.mntent* @getmntent(i32* %21)
%42 = getelementptr inbounds %struct.mntent, %struct.mntent* %41, i64 0, i32 0
%43 = load i8*, i8** %42
%44 = call i64 @strcmp(i8* %43, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %69
46: ; preds = %38
%47 = getelementptr inbounds %struct.mntent, %struct.mntent* %41, i64 0, i32 1
%48 = load i8*, i8** %47
%49 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %69
51: ; preds = %46
%52 = getelementptr inbounds %struct.mntent, %struct.mntent* %41, i64 0, i32 2
%53 = load i8*, i8** %52
%54 = call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %69
56: ; preds = %51
%57 = getelementptr inbounds %struct.mntent, %struct.mntent* %41, i64 0, i32 3
%58 = load i8*, i8** %57
%59 = call i64 @strcmp(i8* %58, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %69
61: ; preds = %56
%62 = getelementptr inbounds %struct.mntent, %struct.mntent* %41, i64 0, i32 4
%63 = load i32, i32* %62
%64 = icmp eq i32 %63, 1
br i1 %64, label %65, label %69
65: ; preds = %61
%66 = getelementptr inbounds %struct.mntent, %struct.mntent* %41, i64 0, i32 5
%67 = load i32, i32* %66
%68 = icmp eq i32 %67, 2
br i1 %68, label %86, label %69
69: ; preds = %65, %61, %56, %51, %46, %38
%70 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.12, i64 0, i64 0))
%71 = load i32, i32* @stderr
%72 = load i8*, i8** %42
%73 = call i32 @fprintf(i32 %71, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0), i8* %72)
%74 = load i32, i32* @stderr
%75 = getelementptr inbounds %struct.mntent, %struct.mntent* %41, i64 0, i32 1
%76 = load i8*, i8** %75
%77 = call i32 @fprintf(i32 %74, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i8* %76)
%78 = load i32, i32* @stderr
%79 = getelementptr inbounds %struct.mntent, %struct.mntent* %41, i64 0, i32 2
%80 = load i8*, i8** %79
%81 = call i32 @fprintf(i32 %78, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.15, i64 0, i64 0), i8* %80)
%82 = load i32, i32* @stderr
%83 = getelementptr inbounds %struct.mntent, %struct.mntent* %41, i64 0, i32 3
%84 = load i8*, i8** %83
%85 = call i32 @fprintf(i32 %82, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i8* %84)
br label %86
86: ; preds = %69, %65
%87 = phi i32 [ 1, %69 ], [ %39, %65 ]
br label %88
88: ; preds = %86, %23
%89 = phi i32 [ 1, %23 ], [ %87, %86 ]
ret i32 %89
}