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

/* Variables and functions */
char *decode_name(char *);
scalar_t__ 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))
      return NULL;
    end_ptr = strchr(buffer, '\n');
    if (end_ptr != NULL) {
      *end_ptr = '\0';
    } else {
      char tmp[1024] = {0};
      while (fgets(tmp, sizeof tmp, stream))
        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 ? decode_name(cp) : (char *)"";
  if (head)
    head += strspn(head, " \t");
  cp = strsep(&head, " \t");
  mp->mnt_dir = cp ? decode_name(cp) : (char *)"";
  if (head)
    head += strspn(head, " \t");
  cp = strsep(&head, " \t");
  mp->mnt_type = cp ? decode_name(cp) : (char *)"";
  if (head)
    head += strspn(head, " \t");
  cp = strsep(&head, " \t");
  mp->mnt_opts = cp ? decode_name(cp) : (char *)"";
  if (head) {
    int ret = sscanf(head, " %d %d ", &mp->mnt_freq, &mp->mnt_passno);
    switch (ret) {
    case 0:
      mp->mnt_freq = 0;
    case 1:
      mp->mnt_passno = 0;
    case 2:
      break;
    }
  } else {
    mp->mnt_freq = 0;
  }
  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   1070 <fgets@plt>
cmp    $0x0,%rax
jne    11b1 <getmntent_r+0x41>
movq   $0x0,-0x8(%rbp)
jmp    1519 <getmntent_r+0x3a9>
mov    -0x20(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     11da <getmntent_r+0x6a>
mov    -0x40(%rbp),%rax
movb   $0x0,(%rax)
jmp    1236 <getmntent_r+0xc6>
lea    -0x440(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
lea    -0x440(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x400,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     1231 <getmntent_r+0xc1>
lea    -0x440(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     122c <getmntent_r+0xbc>
jmp    1231 <getmntent_r+0xc1>
jmp    11ed <getmntent_r+0x7d>
jmp    1236 <getmntent_r+0xc6>
mov    -0x20(%rbp),%rax
mov    %rax,-0x450(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xdb4(%rip),%rsi
call   1060 <strspn@plt>
mov    %eax,%ecx
mov    -0x450(%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,-0x451(%rbp)
je     128f <getmntent_r+0x11f>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
sete   %al
mov    %al,-0x451(%rbp)
mov    -0x451(%rbp),%al
test   $0x1,%al
jne    118a <getmntent_r+0x1a>
lea    -0x38(%rbp),%rdi
lea    0xd58(%rip),%rsi
call   1080 <strsep@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     12d1 <getmntent_r+0x161>
mov    -0x30(%rbp),%rdi
call   1050 <decode_name@plt>
mov    %rax,-0x460(%rbp)
jmp    12e4 <getmntent_r+0x174>
lea    0xd2a(%rip),%rax
mov    %rax,-0x460(%rbp)
jmp    12e4 <getmntent_r+0x174>
mov    -0x460(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x38(%rbp)
je     131d <getmntent_r+0x1ad>
mov    -0x38(%rbp),%rdi
lea    0xcf8(%rip),%rsi
call   1060 <strspn@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
lea    -0x38(%rbp),%rdi
lea    0xcd8(%rip),%rsi
call   1080 <strsep@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1351 <getmntent_r+0x1e1>
mov    -0x30(%rbp),%rdi
call   1050 <decode_name@plt>
mov    %rax,-0x468(%rbp)
jmp    1364 <getmntent_r+0x1f4>
lea    0xcaa(%rip),%rax
mov    %rax,-0x468(%rbp)
jmp    1364 <getmntent_r+0x1f4>
mov    -0x468(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x8(%rax)
cmpq   $0x0,-0x38(%rbp)
je     139e <getmntent_r+0x22e>
mov    -0x38(%rbp),%rdi
lea    0xc77(%rip),%rsi
call   1060 <strspn@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
lea    -0x38(%rbp),%rdi
lea    0xc57(%rip),%rsi
call   1080 <strsep@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     13d2 <getmntent_r+0x262>
mov    -0x30(%rbp),%rdi
call   1050 <decode_name@plt>
mov    %rax,-0x470(%rbp)
jmp    13e5 <getmntent_r+0x275>
lea    0xc29(%rip),%rax
mov    %rax,-0x470(%rbp)
jmp    13e5 <getmntent_r+0x275>
mov    -0x470(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x10(%rax)
cmpq   $0x0,-0x38(%rbp)
je     141f <getmntent_r+0x2af>
mov    -0x38(%rbp),%rdi
lea    0xbf6(%rip),%rsi
call   1060 <strspn@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
lea    -0x38(%rbp),%rdi
lea    0xbd6(%rip),%rsi
call   1080 <strsep@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1453 <getmntent_r+0x2e3>
mov    -0x30(%rbp),%rdi
call   1050 <decode_name@plt>
mov    %rax,-0x478(%rbp)
jmp    1466 <getmntent_r+0x2f6>
lea    0xba8(%rip),%rax
mov    %rax,-0x478(%rbp)
jmp    1466 <getmntent_r+0x2f6>
mov    -0x478(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x18(%rax)
cmpq   $0x0,-0x38(%rbp)
je     1506 <getmntent_r+0x396>
mov    -0x38(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x20,%rdx
add    $0x24,%rcx
lea    0xb69(%rip),%rsi
call   1090 <sscanf@plt>
mov    %eax,-0x444(%rbp)
mov    -0x444(%rbp),%eax
mov    %eax,-0x47c(%rbp)
test   %eax,%eax
je     14e6 <getmntent_r+0x376>
jmp    14be <getmntent_r+0x34e>
mov    -0x47c(%rbp),%eax
sub    $0x1,%eax
je     14f1 <getmntent_r+0x381>
jmp    14d2 <getmntent_r+0x362>
mov    -0x47c(%rbp),%eax
sub    $0x2,%eax
je     14fc <getmntent_r+0x38c>
jmp    1501 <getmntent_r+0x391>
mov    -0x18(%rbp),%rax
movl   $0x0,0x20(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,0x24(%rax)
jmp    1501 <getmntent_r+0x391>
jmp    1511 <getmntent_r+0x3a1>
mov    -0x18(%rbp),%rax
movl   $0x0,0x20(%rax)
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   1070 <fgets@plt>
test   %rax,%rax
je     127a <getmntent_r+0x10a>
lea    0x10(%rsp),%rbx
lea    0xe51(%rip),%r13
jmp    11d7 <getmntent_r+0x67>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r15d,%esi
mov    %rbp,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     127a <getmntent_r+0x10a>
mov    %r12,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     11f0 <getmntent_r+0x80>
movb   $0x0,(%rax)
jmp    1230 <getmntent_r+0xc0>
xchg   %ax,%ax
mov    $0x400,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
nop
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %rbp,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     1230 <getmntent_r+0xc0>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1200 <getmntent_r+0x90>
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r13,%rsi
call   1060 <strspn@plt>
cltq
lea    (%r12,%rax,1),%rcx
mov    %rcx,0x8(%rsp)
mov    (%r12,%rax,1),%al
cmp    $0x23,%al
je     11c0 <getmntent_r+0x50>
test   %al,%al
je     11c0 <getmntent_r+0x50>
lea    0xd9f(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1080 <strsep@plt>
test   %rax,%rax
je     1292 <getmntent_r+0x122>
mov    %rax,%rdi
call   1050 <decode_name@plt>
jmp    1299 <getmntent_r+0x129>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd69(%rip),%rax
mov    %rax,(%r14)
mov    0x8(%rsp),%rbx
test   %rbx,%rbx
je     12bf <getmntent_r+0x14f>
lea    0xd53(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strspn@plt>
cltq
add    %rbx,%rax
mov    %rax,0x8(%rsp)
lea    0xd3a(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1080 <strsep@plt>
test   %rax,%rax
je     12df <getmntent_r+0x16f>
mov    %rax,%rdi
call   1050 <decode_name@plt>
jmp    12e6 <getmntent_r+0x176>
lea    0xd1c(%rip),%rax
mov    %rax,0x8(%r14)
mov    0x8(%rsp),%rbx
test   %rbx,%rbx
je     130d <getmntent_r+0x19d>
lea    0xd05(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strspn@plt>
cltq
add    %rbx,%rax
mov    %rax,0x8(%rsp)
lea    0xcec(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1080 <strsep@plt>
test   %rax,%rax
je     132d <getmntent_r+0x1bd>
mov    %rax,%rdi
call   1050 <decode_name@plt>
jmp    1334 <getmntent_r+0x1c4>
lea    0xcce(%rip),%rax
mov    %rax,0x10(%r14)
mov    0x8(%rsp),%rbx
test   %rbx,%rbx
je     135b <getmntent_r+0x1eb>
lea    0xcb7(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strspn@plt>
cltq
add    %rbx,%rax
mov    %rax,0x8(%rsp)
lea    0xc9e(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1080 <strsep@plt>
test   %rax,%rax
je     137b <getmntent_r+0x20b>
mov    %rax,%rdi
call   1050 <decode_name@plt>
jmp    1382 <getmntent_r+0x212>
lea    0xc80(%rip),%rax
mov    %rax,0x18(%r14)
mov    0x8(%rsp),%rdi
lea    0x20(%r14),%rbx
test   %rdi,%rdi
je     13c9 <getmntent_r+0x259>
lea    0x24(%r14),%rbp
lea    0xc64(%rip),%rsi
mov    %rbx,%rdx
mov    %rbp,%rcx
call   1090 <sscanf@plt>
cmp    $0x1,%eax
je     13bd <getmntent_r+0x24d>
test   %eax,%eax
jne    127d <getmntent_r+0x10d>
movl   $0x0,(%rbx)
movl   $0x0,0x0(%rbp)
jmp    127d <getmntent_r+0x10d>
movl   $0x0,(%rbx)
jmp    127d <getmntent_r+0x10d>

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

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 i64 @fgets(i8* %2, i32 %3, i32* %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %91, 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 i64 @fgets(i8* %11, i32 1024, i32* %0)
%19 = icmp eq i64 %18, 0
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 i64 @fgets(i8* %2, i32 %3, i32* %0)
%31 = icmp eq i64 %30, 0
br i1 %31, label %91, 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
%84 = getelementptr inbounds %struct.mntent, %struct.mntent* %1, i64 0, i32 4
br i1 %83, label %90, label %85
85: ; preds = %79
%86 = getelementptr inbounds %struct.mntent, %struct.mntent* %1, i64 0, i32 5
%87 = call i32 @sscanf(i8* %82, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32* %84, i32* %86)
switch i32 %87, label %91 [
i32 0, label %88
i32 1, label %89
]
88: ; preds = %85
store i32 0, i32* %84
br label %89
89: ; preds = %85, %88
store i32 0, i32* %86
br label %91
90: ; preds = %79
store i32 0, i32* %84
br label %91
91: ; preds = %29, %4, %90, %85, %89
%92 = phi %struct.mntent* [ %1, %89 ], [ %1, %85 ], [ %1, %90 ], [ null, %4 ], [ null, %29 ]
ret %struct.mntent* %92
}