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

/* Variables and functions */
char *decode_name(char *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int sscanf(char *, char *, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
char *strchr(char *, char);
char *strsep(char **, char *);
int strspn(char *, char *);
struct mntent *getmntent_r(FILE *stream, struct mntent *mp, char *buffer,
                           int bufsiz) {
  char *cp;
  char *head;
  do {
    char *end_ptr;
    if (fgets(buffer, bufsiz, stream) == NULL) {
      return NULL;
    }
    end_ptr = strchr(buffer, '\n');
    if (end_ptr != NULL)
      *end_ptr = '\0';
    else {
      char tmp[1024];
      while (fgets(tmp, sizeof tmp, stream) != NULL)
        if (strchr(tmp, '\n') != NULL)
          break;
    }
    head = buffer + strspn(buffer, " \t");
  } while (head[0] == '\0' || head[0] == '#');
  cp = strsep(&head, " \t");
  mp->mnt_fsname = cp != NULL ? decode_name(cp) : (char *)"";
  if (head)
    head += strspn(head, " \t");
  cp = strsep(&head, " \t");
  mp->mnt_dir = cp != NULL ? decode_name(cp) : (char *)"";
  if (head)
    head += strspn(head, " \t");
  cp = strsep(&head, " \t");
  mp->mnt_type = cp != NULL ? decode_name(cp) : (char *)"";
  if (head)
    head += strspn(head, " \t");
  cp = strsep(&head, " \t");
  mp->mnt_opts = cp != NULL ? decode_name(cp) : (char *)"";
  switch (head ? sscanf(head, " %d %d ", &mp->mnt_freq, &mp->mnt_passno) : 0) {
  case 0:
    mp->mnt_freq = 0;
  case 1:
    mp->mnt_passno = 0;
  case 2:
    break;
  }
  return mp;
}


x86 assembly (clang, -O0):
<getmntent_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x480,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1060 <fgets@plt>
cmp    $0x0,%rax
jne    11a1 <getmntent_r+0x41>
movq   $0x0,-0x8(%rbp)
jmp    14fe <getmntent_r+0x39e>
mov    -0x20(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     11ca <getmntent_r+0x6a>
mov    -0x40(%rbp),%rax
movb   $0x0,(%rax)
jmp    1218 <getmntent_r+0xb8>
jmp    11cf <getmntent_r+0x6f>
lea    -0x440(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x400,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     1213 <getmntent_r+0xb3>
lea    -0x440(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     120e <getmntent_r+0xae>
jmp    1213 <getmntent_r+0xb3>
jmp    11cf <getmntent_r+0x6f>
jmp    1218 <getmntent_r+0xb8>
mov    -0x20(%rbp),%rax
mov    %rax,-0x448(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xdd2(%rip),%rsi
call   1050 <strspn@plt>
mov    %eax,%ecx
mov    -0x448(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x449(%rbp)
je     1271 <getmntent_r+0x111>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
sete   %al
mov    %al,-0x449(%rbp)
mov    -0x449(%rbp),%al
test   $0x1,%al
jne    117a <getmntent_r+0x1a>
lea    -0x38(%rbp),%rdi
lea    0xd76(%rip),%rsi
call   1070 <strsep@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     12b3 <getmntent_r+0x153>
mov    -0x30(%rbp),%rdi
call   1040 <decode_name@plt>
mov    %rax,-0x458(%rbp)
jmp    12c6 <getmntent_r+0x166>
lea    0xd48(%rip),%rax
mov    %rax,-0x458(%rbp)
jmp    12c6 <getmntent_r+0x166>
mov    -0x458(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x38(%rbp)
je     12ff <getmntent_r+0x19f>
mov    -0x38(%rbp),%rdi
lea    0xd16(%rip),%rsi
call   1050 <strspn@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
lea    -0x38(%rbp),%rdi
lea    0xcf6(%rip),%rsi
call   1070 <strsep@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1333 <getmntent_r+0x1d3>
mov    -0x30(%rbp),%rdi
call   1040 <decode_name@plt>
mov    %rax,-0x460(%rbp)
jmp    1346 <getmntent_r+0x1e6>
lea    0xcc8(%rip),%rax
mov    %rax,-0x460(%rbp)
jmp    1346 <getmntent_r+0x1e6>
mov    -0x460(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x8(%rax)
cmpq   $0x0,-0x38(%rbp)
je     1380 <getmntent_r+0x220>
mov    -0x38(%rbp),%rdi
lea    0xc95(%rip),%rsi
call   1050 <strspn@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
lea    -0x38(%rbp),%rdi
lea    0xc75(%rip),%rsi
call   1070 <strsep@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     13b4 <getmntent_r+0x254>
mov    -0x30(%rbp),%rdi
call   1040 <decode_name@plt>
mov    %rax,-0x468(%rbp)
jmp    13c7 <getmntent_r+0x267>
lea    0xc47(%rip),%rax
mov    %rax,-0x468(%rbp)
jmp    13c7 <getmntent_r+0x267>
mov    -0x468(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x10(%rax)
cmpq   $0x0,-0x38(%rbp)
je     1401 <getmntent_r+0x2a1>
mov    -0x38(%rbp),%rdi
lea    0xc14(%rip),%rsi
call   1050 <strspn@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
lea    -0x38(%rbp),%rdi
lea    0xbf4(%rip),%rsi
call   1070 <strsep@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1435 <getmntent_r+0x2d5>
mov    -0x30(%rbp),%rdi
call   1040 <decode_name@plt>
mov    %rax,-0x470(%rbp)
jmp    1448 <getmntent_r+0x2e8>
lea    0xbc6(%rip),%rax
mov    %rax,-0x470(%rbp)
jmp    1448 <getmntent_r+0x2e8>
mov    -0x470(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x18(%rax)
cmpq   $0x0,-0x38(%rbp)
je     148d <getmntent_r+0x32d>
mov    -0x38(%rbp),%rdi
mov    -0x18(%rbp),%rdx
add    $0x24,%rdx
mov    -0x18(%rbp),%rcx
add    $0x20,%rcx
lea    0xb86(%rip),%rsi
call   1080 <sscanf@plt>
mov    %eax,-0x474(%rbp)
jmp    149a <getmntent_r+0x33a>
xor    %eax,%eax
mov    %eax,-0x474(%rbp)
jmp    149a <getmntent_r+0x33a>
mov    -0x474(%rbp),%eax
mov    %eax,-0x478(%rbp)
test   %eax,%eax
je     14db <getmntent_r+0x37b>
jmp    14b3 <getmntent_r+0x353>
mov    -0x478(%rbp),%eax
sub    $0x1,%eax
je     14e6 <getmntent_r+0x386>
jmp    14c7 <getmntent_r+0x367>
mov    -0x478(%rbp),%eax
sub    $0x2,%eax
je     14f1 <getmntent_r+0x391>
jmp    14f6 <getmntent_r+0x396>
mov    -0x18(%rbp),%rax
movl   $0x0,0x24(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,0x20(%rax)
jmp    14f6 <getmntent_r+0x396>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x480,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmntent_r>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
mov    %ecx,%r15d
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%rbp
mov    %rdx,%rdi
mov    %ecx,%esi
mov    %rbp,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1256 <getmntent_r+0xf6>
lea    0x10(%rsp),%rbx
lea    0xe61(%rip),%r13
jmp    11c7 <getmntent_r+0x67>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r15d,%esi
mov    %rbp,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1256 <getmntent_r+0xf6>
mov    %r12,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     11e0 <getmntent_r+0x80>
movb   $0x0,(%rax)
jmp    1210 <getmntent_r+0xb0>
xchg   %ax,%ax
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %rbp,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1210 <getmntent_r+0xb0>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     11e0 <getmntent_r+0x80>
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r13,%rsi
call   1050 <strspn@plt>
cltq
lea    (%r12,%rax,1),%rcx
mov    %rcx,0x8(%rsp)
mov    (%r12,%rax,1),%al
cmp    $0x23,%al
je     11b0 <getmntent_r+0x50>
test   %al,%al
je     11b0 <getmntent_r+0x50>
lea    0xdc3(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1070 <strsep@plt>
test   %rax,%rax
je     126e <getmntent_r+0x10e>
mov    %rax,%rdi
call   1040 <decode_name@plt>
jmp    1275 <getmntent_r+0x115>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd8d(%rip),%rax
mov    %rax,(%r14)
mov    0x8(%rsp),%rbx
test   %rbx,%rbx
je     129b <getmntent_r+0x13b>
lea    0xd77(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strspn@plt>
cltq
add    %rbx,%rax
mov    %rax,0x8(%rsp)
lea    0xd5e(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1070 <strsep@plt>
test   %rax,%rax
je     12bb <getmntent_r+0x15b>
mov    %rax,%rdi
call   1040 <decode_name@plt>
jmp    12c2 <getmntent_r+0x162>
lea    0xd40(%rip),%rax
mov    %rax,0x8(%r14)
mov    0x8(%rsp),%rbx
test   %rbx,%rbx
je     12e9 <getmntent_r+0x189>
lea    0xd29(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strspn@plt>
cltq
add    %rbx,%rax
mov    %rax,0x8(%rsp)
lea    0xd10(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1070 <strsep@plt>
test   %rax,%rax
je     1309 <getmntent_r+0x1a9>
mov    %rax,%rdi
call   1040 <decode_name@plt>
jmp    1310 <getmntent_r+0x1b0>
lea    0xcf2(%rip),%rax
mov    %rax,0x10(%r14)
mov    0x8(%rsp),%rbx
test   %rbx,%rbx
je     1337 <getmntent_r+0x1d7>
lea    0xcdb(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strspn@plt>
cltq
add    %rbx,%rax
mov    %rax,0x8(%rsp)
lea    0xcc2(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1070 <strsep@plt>
test   %rax,%rax
je     1357 <getmntent_r+0x1f7>
mov    %rax,%rdi
call   1040 <decode_name@plt>
jmp    135e <getmntent_r+0x1fe>
lea    0xca4(%rip),%rax
mov    %rax,0x18(%r14)
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     138d <getmntent_r+0x22d>
lea    0x24(%r14),%rdx
lea    0x20(%r14),%rcx
lea    0xc88(%rip),%rsi
call   1080 <sscanf@plt>
cmp    $0x1,%eax
je     1395 <getmntent_r+0x235>
test   %eax,%eax
jne    1259 <getmntent_r+0xf9>
movl   $0x0,0x24(%r14)
movl   $0x0,0x20(%r14)
jmp    1259 <getmntent_r+0xf9>

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

LLVM IR (-O2):
%struct.mntent = type { i8*, i8*, i8*, i8*, i32, i32 }
@.str = [3 x i8] c" \09\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [8 x i8] c" %d %d \00"
define %struct.mntent* @getmntent_r(i32* nocapture %0, %struct.mntent* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca [1024 x i8]
%7 = bitcast i8** %5 to i8*
%8 = call i32* @fgets(i8* %2, i32 %3, i32* %0)
%9 = icmp eq i32* %8, null
br i1 %9, label %92, label %10
10: ; preds = %4
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
br label %12
12: ; preds = %10, %29
%13 = call i8* @strchr(i8* dereferenceable(1) %2, i8 signext 10)
%14 = icmp eq i8* %13, null
br i1 %14, label %16, label %15
15: ; preds = %12
store i8 0, i8* %13
br label %24
16: ; preds = %12
br label %17
17: ; preds = %20, %16
%18 = call i32* @fgets(i8* %11, i32 1024, i32* %0)
%19 = icmp eq i32* %18, null
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = call i8* @strchr(i8* %11, i8 signext 10)
%22 = icmp eq i8* %21, null
br i1 %22, label %17, label %23
23: ; preds = %20, %17
br label %24
24: ; preds = %15, %23
%25 = call i32 @strspn(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %2, i64 %26
store i8* %27, i8** %5
%28 = load i8, i8* %27
switch i8 %28, label %32 [
i8 0, label %29
i8 35, label %29
]
29: ; preds = %24, %24
%30 = call i32* @fgets(i8* %2, i32 %3, i32* %0)
%31 = icmp eq i32* %30, null
br i1 %31, label %92, label %12
32: ; preds = %24
%33 = call i8* @strsep(i8** %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%34 = icmp eq i8* %33, null
br i1 %34, label %37, label %35
35: ; preds = %32
%36 = call i8* @decode_name(i8* %33)
br label %37
37: ; preds = %32, %35
%38 = phi i8* [ %36, %35 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %32 ]
%39 = getelementptr inbounds %struct.mntent, %struct.mntent* %1, i64 0, i32 0
store i8* %38, i8** %39
%40 = load i8*, i8** %5
%41 = icmp eq i8* %40, null
br i1 %41, label %46, label %42
42: ; preds = %37
%43 = call i32 @strspn(i8* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8, i8* %40, i64 %44
store i8* %45, i8** %5
br label %46
46: ; preds = %42, %37
%47 = call i8* @strsep(i8** %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%48 = icmp eq i8* %47, null
br i1 %48, label %51, label %49
49: ; preds = %46
%50 = call i8* @decode_name(i8* %47)
br label %51
51: ; preds = %46, %49
%52 = phi i8* [ %50, %49 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %46 ]
%53 = getelementptr inbounds %struct.mntent, %struct.mntent* %1, i64 0, i32 1
store i8* %52, i8** %53
%54 = load i8*, i8** %5
%55 = icmp eq i8* %54, null
br i1 %55, label %60, label %56
56: ; preds = %51
%57 = call i32 @strspn(i8* %54, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i8, i8* %54, i64 %58
store i8* %59, i8** %5
br label %60
60: ; preds = %56, %51
%61 = call i8* @strsep(i8** %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%62 = icmp eq i8* %61, null
br i1 %62, label %65, label %63
63: ; preds = %60
%64 = call i8* @decode_name(i8* %61)
br label %65
65: ; preds = %60, %63
%66 = phi i8* [ %64, %63 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %60 ]
%67 = getelementptr inbounds %struct.mntent, %struct.mntent* %1, i64 0, i32 2
store i8* %66, i8** %67
%68 = load i8*, i8** %5
%69 = icmp eq i8* %68, null
br i1 %69, label %74, label %70
70: ; preds = %65
%71 = call i32 @strspn(i8* %68, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds i8, i8* %68, i64 %72
store i8* %73, i8** %5
br label %74
74: ; preds = %70, %65
%75 = call i8* @strsep(i8** %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%76 = icmp eq i8* %75, null
br i1 %76, label %79, label %77
77: ; preds = %74
%78 = call i8* @decode_name(i8* %75)
br label %79
79: ; preds = %74, %77
%80 = phi i8* [ %78, %77 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %74 ]
%81 = getelementptr inbounds %struct.mntent, %struct.mntent* %1, i64 0, i32 3
store i8* %80, i8** %81
%82 = load i8*, i8** %5
%83 = icmp eq i8* %82, null
br i1 %83, label %88, label %84
84: ; preds = %79
%85 = getelementptr inbounds %struct.mntent, %struct.mntent* %1, i64 0, i32 5
%86 = getelementptr inbounds %struct.mntent, %struct.mntent* %1, i64 0, i32 4
%87 = call i32 @sscanf(i8* %82, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32* %85, i32* %86)
switch i32 %87, label %92 [
i32 0, label %88
i32 1, label %90
]
88: ; preds = %79, %84
%89 = getelementptr inbounds %struct.mntent, %struct.mntent* %1, i64 0, i32 5
store i32 0, i32* %89
br label %90
90: ; preds = %84, %88
%91 = getelementptr inbounds %struct.mntent, %struct.mntent* %1, i64 0, i32 4
store i32 0, i32* %91
br label %92
92: ; preds = %29, %4, %90, %84
%93 = phi %struct.mntent* [ %1, %84 ], [ %1, %90 ], [ null, %4 ], [ null, %29 ]
ret %struct.mntent* %93
}