#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 */

/* Variables and functions */
unsigned long MS_DIRSYNC;
unsigned long MS_NOATIME;
unsigned long MS_NODIRATIME;
unsigned long MS_NOEXEC;
unsigned long MS_NOSUID;
unsigned long MS_RDONLY;
unsigned long MS_RELATIME;
unsigned long MS_SYNCHRONOUS;
char *calloc(int, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char const *, char *);
char *strdup(char *);
int strlen(char const *);
char *strtok(char *, char *);
int process_mount_options(char **mnt_opts, unsigned long *flags) {
  char *tmp, *opts, *p;
  const char *opt;
  tmp = strdup(*mnt_opts);
  if (!tmp)
    goto out_mem;
  p = opts = calloc(1, strlen(*mnt_opts) + 1);
  if (!opts) {
    free(tmp);
    goto out_mem;
  }
  *flags = 0;
  opt = strtok(tmp, ",");
  while (opt) {
    if (!strcmp(opt, "rw"))
      ;
    else if (!strcmp(opt, "ro"))
      *flags |= MS_RDONLY;
    else if (!strcmp(opt, "dirsync"))
      *flags |= MS_DIRSYNC;
    else if (!strcmp(opt, "noatime"))
      *flags |= MS_NOATIME;
    else if (!strcmp(opt, "nodiratime"))
      *flags |= MS_NODIRATIME;
    else if (!strcmp(opt, "noexec"))
      *flags |= MS_NOEXEC;
    else if (!strcmp(opt, "nosuid"))
      *flags |= MS_NOSUID;
    else if (!strcmp(opt, "relatime"))
      *flags |= MS_RELATIME;
    else if (!strcmp(opt, "sync"))
      *flags |= MS_SYNCHRONOUS;
    else {
      int len = strlen(opt);
      if (p != opts)
        *p++ = ',';
      memcpy(p, opt, len);
      p += len;
      *p = '\0';
    }
    opt = strtok(NULL, ",");
  }
  free(tmp);
  *mnt_opts = opts;
  return 0;
out_mem:
  fprintf(stderr, "cannot allocate memory\n");
  return 1;
}


x86 assembly (clang, -O0):
<process_mount_options>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10a0 <strdup@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    11b0 <process_mount_options+0x30>
jmp    1479 <process_mount_options+0x2f9>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <strlen@plt>
mov    %eax,%esi
add    $0x1,%esi
mov    $0x1,%edi
call   1050 <calloc@plt>
mov    %rax,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    11ec <process_mount_options+0x6c>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
jmp    1479 <process_mount_options+0x2f9>
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x20(%rbp),%rdi
lea    0xdfe(%rip),%rsi
call   1090 <strtok@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     1459 <process_mount_options+0x2d9>
mov    -0x38(%rbp),%rdi
lea    0xde1(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1234 <process_mount_options+0xb4>
jmp    1440 <process_mount_options+0x2c0>
mov    -0x38(%rbp),%rdi
lea    0xdc6(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1266 <process_mount_options+0xe6>
mov    0x2d74(%rip),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
jmp    143b <process_mount_options+0x2bb>
mov    -0x38(%rbp),%rdi
lea    0xd97(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1298 <process_mount_options+0x118>
mov    0x2d52(%rip),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
jmp    1436 <process_mount_options+0x2b6>
mov    -0x38(%rbp),%rdi
lea    0xd6d(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    12ca <process_mount_options+0x14a>
mov    0x2d38(%rip),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
jmp    1431 <process_mount_options+0x2b1>
mov    -0x38(%rbp),%rdi
lea    0xd43(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    12fc <process_mount_options+0x17c>
mov    0x2cbe(%rip),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
jmp    142c <process_mount_options+0x2ac>
mov    -0x38(%rbp),%rdi
lea    0xd1c(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    132e <process_mount_options+0x1ae>
mov    0x2c7c(%rip),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
jmp    1427 <process_mount_options+0x2a7>
mov    -0x38(%rbp),%rdi
lea    0xcf1(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1360 <process_mount_options+0x1e0>
mov    0x2c92(%rip),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
jmp    1422 <process_mount_options+0x2a2>
mov    -0x38(%rbp),%rdi
lea    0xcc6(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1392 <process_mount_options+0x212>
mov    0x2c30(%rip),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
jmp    141d <process_mount_options+0x29d>
mov    -0x38(%rbp),%rdi
lea    0xc6e(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    13c4 <process_mount_options+0x244>
mov    0x2c1e(%rip),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
jmp    1418 <process_mount_options+0x298>
mov    -0x38(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x28(%rbp),%rax
je     13f0 <process_mount_options+0x270>
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x30(%rbp)
movb   $0x2c,(%rax)
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x3c(%rbp),%edx
call   1080 <memcpy@plt>
mov    -0x3c(%rbp),%ecx
mov    -0x30(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movb   $0x0,(%rax)
jmp    141d <process_mount_options+0x29d>
jmp    1422 <process_mount_options+0x2a2>
jmp    1427 <process_mount_options+0x2a7>
jmp    142c <process_mount_options+0x2ac>
jmp    1431 <process_mount_options+0x2b1>
jmp    1436 <process_mount_options+0x2b6>
jmp    143b <process_mount_options+0x2bb>
jmp    1440 <process_mount_options+0x2c0>
xor    %eax,%eax
mov    %eax,%edi
lea    0xbb5(%rip),%rsi
call   1090 <strtok@plt>
mov    %rax,-0x38(%rbp)
jmp    120b <process_mount_options+0x8b>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1495 <process_mount_options+0x315>
mov    0x2b38(%rip),%rax
mov    (%rax),%edi
lea    0xbb1(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_mount_options>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r12
mov    %rdi,%r15
mov    (%rdi),%rbp
mov    %rbp,%rdi
call   10a0 <strdup@plt>
test   %rax,%rax
je     13c9 <process_mount_options+0x249>
mov    %rax,%rbx
mov    %rbp,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%esi
mov    $0x1,%edi
call   1050 <calloc@plt>
mov    %rax,0x8(%rsp)
test   %rax,%rax
je     13c1 <process_mount_options+0x241>
movq   $0x0,(%r12)
lea    0xe23(%rip),%rsi
mov    %rbx,0x20(%rsp)
mov    %rbx,%rdi
call   1090 <strtok@plt>
test   %rax,%rax
je     13ab <process_mount_options+0x22b>
mov    %rax,%r14
lea    0xe05(%rip),%r13
lea    0xdfc(%rip),%rbp
lea    0xdfa(%rip),%rbx
mov    0x8(%rsp),%rax
mov    %rax,0x10(%rsp)
jmp    1244 <process_mount_options+0xc4>
nopw   0x0(%rax,%rax,1)
mov    0x2da1(%rip),%rax
mov    (%rax),%rax
or     %rax,(%r12)
xor    %edi,%edi
mov    %rbp,%rsi
call   1090 <strtok@plt>
mov    %rax,%r14
test   %rax,%rax
je     13ab <process_mount_options+0x22b>
mov    %r14,%rdi
mov    %r13,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     122e <process_mount_options+0xae>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1220 <process_mount_options+0xa0>
mov    %r14,%rdi
lea    0xd9c(%rip),%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1357 <process_mount_options+0x1d7>
mov    %r14,%rdi
lea    0xd8d(%rip),%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1363 <process_mount_options+0x1e3>
mov    %r14,%rdi
lea    0xd7e(%rip),%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     136f <process_mount_options+0x1ef>
mov    %r14,%rdi
lea    0xd72(%rip),%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     137b <process_mount_options+0x1fb>
mov    %r14,%rdi
lea    0xd62(%rip),%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1387 <process_mount_options+0x207>
mov    %r14,%rdi
lea    0xd52(%rip),%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1393 <process_mount_options+0x213>
mov    %r14,%rdi
lea    0xd15(%rip),%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     139f <process_mount_options+0x21f>
mov    %r15,0x18(%rsp)
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    0x8(%rsp),%rdx
mov    %rdx,%r15
mov    0x10(%rsp),%rcx
cmp    %rdx,%rcx
je     132c <process_mount_options+0x1ac>
movb   $0x2c,(%rcx)
add    $0x1,%rcx
mov    %rcx,%r15
mov    %r15,%rdi
mov    %r14,%rsi
mov    %eax,%r14d
mov    %eax,%edx
call   1080 <memcpy@plt>
movslq %r14d,%rax
lea    (%r15,%rax,1),%rcx
mov    %rcx,0x10(%rsp)
movb   $0x0,(%r15,%rax,1)
mov    0x18(%rsp),%r15
jmp    122e <process_mount_options+0xae>
mov    0x2c7a(%rip),%rax
jmp    1227 <process_mount_options+0xa7>
mov    0x2c86(%rip),%rax
jmp    1227 <process_mount_options+0xa7>
mov    0x2c32(%rip),%rax
jmp    1227 <process_mount_options+0xa7>
mov    0x2c16(%rip),%rax
jmp    1227 <process_mount_options+0xa7>
mov    0x2c52(%rip),%rax
jmp    1227 <process_mount_options+0xa7>
mov    0x2c16(%rip),%rax
jmp    1227 <process_mount_options+0xa7>
mov    0x2c2a(%rip),%rax
jmp    1227 <process_mount_options+0xa7>
mov    0x20(%rsp),%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rax
mov    %rax,(%r15)
xor    %eax,%eax
jmp    13e3 <process_mount_options+0x263>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x2be8(%rip),%rax
mov    (%rax),%edi
lea    0xc61(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c",\00"
@.str.1 = [3 x i8] c"rw\00"
@.str.2 = [3 x i8] c"ro\00"
@MS_RDONLY = global i64 0
@.str.3 = [8 x i8] c"dirsync\00"
@MS_DIRSYNC = global i64 0
@.str.4 = [8 x i8] c"noatime\00"
@MS_NOATIME = global i64 0
@.str.5 = [11 x i8] c"nodiratime\00"
@MS_NODIRATIME = global i64 0
@.str.6 = [7 x i8] c"noexec\00"
@MS_NOEXEC = global i64 0
@.str.7 = [7 x i8] c"nosuid\00"
@MS_NOSUID = global i64 0
@.str.8 = [9 x i8] c"relatime\00"
@MS_RELATIME = global i64 0
@.str.9 = [5 x i8] c"sync\00"
@MS_SYNCHRONOUS = global i64 0
@stderr = global i32 0
@.str.10 = [24 x i8] c"cannot allocate memory\0A\00"
define i32 @process_mount_options(i8** %0, i64* %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i64*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
store i8** %0, i8*** %4
store i64* %1, i64** %5
%11 = load i8**, i8*** %4
%12 = load i8*, i8** %11
%13 = call i8* @strdup(i8* %12)
store i8* %13, i8** %6
%14 = load i8*, i8** %6
%15 = icmp ne i8* %14, null
br i1 %15, label %17, label %16
16: ; preds = %2
br label %146
17: ; preds = %2
%18 = load i8**, i8*** %4
%19 = load i8*, i8** %18
%20 = call i32 @strlen(i8* %19)
%21 = add nsw i32 %20, 1
%22 = call i8* @calloc(i32 1, i32 %21)
store i8* %22, i8** %7
store i8* %22, i8** %8
%23 = load i8*, i8** %7
%24 = icmp ne i8* %23, null
br i1 %24, label %28, label %25
25: ; preds = %17
%26 = load i8*, i8** %6
%27 = call i32 @free(i8* %26)
br label %146
28: ; preds = %17
%29 = load i64*, i64** %5
store i64 0, i64* %29
%30 = load i8*, i8** %6
%31 = call i8* @strtok(i8* %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %31, i8** %9
br label %32
32: ; preds = %139, %28
%33 = load i8*, i8** %9
%34 = icmp ne i8* %33, null
br i1 %34, label %35, label %141
35: ; preds = %32
%36 = load i8*, i8** %9
%37 = call i32 @strcmp(i8* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%38 = icmp ne i32 %37, 0
br i1 %38, label %40, label %39
39: ; preds = %35
br label %139
40: ; preds = %35
%41 = load i8*, i8** %9
%42 = call i32 @strcmp(i8* %41, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%43 = icmp ne i32 %42, 0
br i1 %43, label %49, label %44
44: ; preds = %40
%45 = load i64, i64* @MS_RDONLY
%46 = load i64*, i64** %5
%47 = load i64, i64* %46
%48 = or i64 %47, %45
store i64 %48, i64* %46
br label %138
49: ; preds = %40
%50 = load i8*, i8** %9
%51 = call i32 @strcmp(i8* %50, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%52 = icmp ne i32 %51, 0
br i1 %52, label %58, label %53
53: ; preds = %49
%54 = load i64, i64* @MS_DIRSYNC
%55 = load i64*, i64** %5
%56 = load i64, i64* %55
%57 = or i64 %56, %54
store i64 %57, i64* %55
br label %137
58: ; preds = %49
%59 = load i8*, i8** %9
%60 = call i32 @strcmp(i8* %59, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%61 = icmp ne i32 %60, 0
br i1 %61, label %67, label %62
62: ; preds = %58
%63 = load i64, i64* @MS_NOATIME
%64 = load i64*, i64** %5
%65 = load i64, i64* %64
%66 = or i64 %65, %63
store i64 %66, i64* %64
br label %136
67: ; preds = %58
%68 = load i8*, i8** %9
%69 = call i32 @strcmp(i8* %68, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%70 = icmp ne i32 %69, 0
br i1 %70, label %76, label %71
71: ; preds = %67
%72 = load i64, i64* @MS_NODIRATIME
%73 = load i64*, i64** %5
%74 = load i64, i64* %73
%75 = or i64 %74, %72
store i64 %75, i64* %73
br label %135
76: ; preds = %67
%77 = load i8*, i8** %9
%78 = call i32 @strcmp(i8* %77, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%79 = icmp ne i32 %78, 0
br i1 %79, label %85, label %80
80: ; preds = %76
%81 = load i64, i64* @MS_NOEXEC
%82 = load i64*, i64** %5
%83 = load i64, i64* %82
%84 = or i64 %83, %81
store i64 %84, i64* %82
br label %134
85: ; preds = %76
%86 = load i8*, i8** %9
%87 = call i32 @strcmp(i8* %86, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%88 = icmp ne i32 %87, 0
br i1 %88, label %94, label %89
89: ; preds = %85
%90 = load i64, i64* @MS_NOSUID
%91 = load i64*, i64** %5
%92 = load i64, i64* %91
%93 = or i64 %92, %90
store i64 %93, i64* %91
br label %133
94: ; preds = %85
%95 = load i8*, i8** %9
%96 = call i32 @strcmp(i8* %95, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%97 = icmp ne i32 %96, 0
br i1 %97, label %103, label %98
98: ; preds = %94
%99 = load i64, i64* @MS_RELATIME
%100 = load i64*, i64** %5
%101 = load i64, i64* %100
%102 = or i64 %101, %99
store i64 %102, i64* %100
br label %132
103: ; preds = %94
%104 = load i8*, i8** %9
%105 = call i32 @strcmp(i8* %104, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%106 = icmp ne i32 %105, 0
br i1 %106, label %112, label %107
107: ; preds = %103
%108 = load i64, i64* @MS_SYNCHRONOUS
%109 = load i64*, i64** %5
%110 = load i64, i64* %109
%111 = or i64 %110, %108
store i64 %111, i64* %109
br label %131
112: ; preds = %103
%113 = load i8*, i8** %9
%114 = call i32 @strlen(i8* %113)
store i32 %114, i32* %10
%115 = load i8*, i8** %8
%116 = load i8*, i8** %7
%117 = icmp ne i8* %115, %116
br i1 %117, label %118, label %121
118: ; preds = %112
%119 = load i8*, i8** %8
%120 = getelementptr inbounds i8, i8* %119, i32 1
store i8* %120, i8** %8
store i8 44, i8* %119
br label %121
121: ; preds = %118, %112
%122 = load i8*, i8** %8
%123 = load i8*, i8** %9
%124 = load i32, i32* %10
%125 = call i32 @memcpy(i8* %122, i8* %123, i32 %124)
%126 = load i32, i32* %10
%127 = load i8*, i8** %8
%128 = sext i32 %126 to i64
%129 = getelementptr inbounds i8, i8* %127, i64 %128
store i8* %129, i8** %8
%130 = load i8*, i8** %8
store i8 0, i8* %130
br label %131
131: ; preds = %121, %107
br label %132
132: ; preds = %131, %98
br label %133
133: ; preds = %132, %89
br label %134
134: ; preds = %133, %80
br label %135
135: ; preds = %134, %71
br label %136
136: ; preds = %135, %62
br label %137
137: ; preds = %136, %53
br label %138
138: ; preds = %137, %44
br label %139
139: ; preds = %138, %39
%140 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %140, i8** %9
br label %32
141: ; preds = %32
%142 = load i8*, i8** %6
%143 = call i32 @free(i8* %142)
%144 = load i8*, i8** %7
%145 = load i8**, i8*** %4
store i8* %144, i8** %145
store i32 0, i32* %3
br label %149
146: ; preds = %25, %16
%147 = load i32, i32* @stderr
%148 = call i32 @fprintf(i32 %147, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0))
store i32 1, i32* %3
br label %149
149: ; preds = %146, %141
%150 = load i32, i32* %3
ret i32 %150
}

LLVM IR (-O2):
@.str = [2 x i8] c",\00"
@.str.1 = [3 x i8] c"rw\00"
@.str.2 = [3 x i8] c"ro\00"
@MS_RDONLY = global i64 0
@.str.3 = [8 x i8] c"dirsync\00"
@MS_DIRSYNC = global i64 0
@.str.4 = [8 x i8] c"noatime\00"
@MS_NOATIME = global i64 0
@.str.5 = [11 x i8] c"nodiratime\00"
@MS_NODIRATIME = global i64 0
@.str.6 = [7 x i8] c"noexec\00"
@MS_NOEXEC = global i64 0
@.str.7 = [7 x i8] c"nosuid\00"
@MS_NOSUID = global i64 0
@.str.8 = [9 x i8] c"relatime\00"
@MS_RELATIME = global i64 0
@.str.9 = [5 x i8] c"sync\00"
@MS_SYNCHRONOUS = global i64 0
@stderr = global i32 0
@.str.10 = [24 x i8] c"cannot allocate memory\0A\00"
define i32 @process_mount_options(i8** nocapture %0, i64* nocapture %1) {
%3 = load i8*, i8** %0
%4 = tail call i8* @strdup(i8* %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %93, label %6
6: ; preds = %2
%7 = tail call i32 @strlen(i8* %3)
%8 = add nsw i32 %7, 1
%9 = tail call i8* @calloc(i32 1, i32 %8)
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = tail call i32 @free(i8* %4)
br label %93
13: ; preds = %6
store i64 0, i64* %1
%14 = tail call i8* @strtok(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i8* %14, null
br i1 %15, label %91, label %16
16: ; preds = %13, %87
%17 = phi i8* [ %89, %87 ], [ %14, %13 ]
%18 = phi i8* [ %88, %87 ], [ %9, %13 ]
%19 = tail call i32 @strcmp(i8* %17, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %87, label %21
21: ; preds = %16
%22 = tail call i32 @strcmp(i8* %17, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = load i64, i64* @MS_RDONLY
%26 = load i64, i64* %1
%27 = or i64 %26, %25
store i64 %27, i64* %1
br label %87
28: ; preds = %21
%29 = tail call i32 @strcmp(i8* %17, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %35
31: ; preds = %28
%32 = load i64, i64* @MS_DIRSYNC
%33 = load i64, i64* %1
%34 = or i64 %33, %32
store i64 %34, i64* %1
br label %87
35: ; preds = %28
%36 = tail call i32 @strcmp(i8* %17, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %42
38: ; preds = %35
%39 = load i64, i64* @MS_NOATIME
%40 = load i64, i64* %1
%41 = or i64 %40, %39
store i64 %41, i64* %1
br label %87
42: ; preds = %35
%43 = tail call i32 @strcmp(i8* %17, i8* dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %49
45: ; preds = %42
%46 = load i64, i64* @MS_NODIRATIME
%47 = load i64, i64* %1
%48 = or i64 %47, %46
store i64 %48, i64* %1
br label %87
49: ; preds = %42
%50 = tail call i32 @strcmp(i8* %17, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %56
52: ; preds = %49
%53 = load i64, i64* @MS_NOEXEC
%54 = load i64, i64* %1
%55 = or i64 %54, %53
store i64 %55, i64* %1
br label %87
56: ; preds = %49
%57 = tail call i32 @strcmp(i8* %17, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%58 = icmp eq i32 %57, 0
br i1 %58, label %59, label %63
59: ; preds = %56
%60 = load i64, i64* @MS_NOSUID
%61 = load i64, i64* %1
%62 = or i64 %61, %60
store i64 %62, i64* %1
br label %87
63: ; preds = %56
%64 = tail call i32 @strcmp(i8* %17, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%65 = icmp eq i32 %64, 0
br i1 %65, label %66, label %70
66: ; preds = %63
%67 = load i64, i64* @MS_RELATIME
%68 = load i64, i64* %1
%69 = or i64 %68, %67
store i64 %69, i64* %1
br label %87
70: ; preds = %63
%71 = tail call i32 @strcmp(i8* %17, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%72 = icmp eq i32 %71, 0
br i1 %72, label %73, label %77
73: ; preds = %70
%74 = load i64, i64* @MS_SYNCHRONOUS
%75 = load i64, i64* %1
%76 = or i64 %75, %74
store i64 %76, i64* %1
br label %87
77: ; preds = %70
%78 = tail call i32 @strlen(i8* %17)
%79 = icmp eq i8* %18, %9
br i1 %79, label %82, label %80
80: ; preds = %77
%81 = getelementptr inbounds i8, i8* %18, i64 1
store i8 44, i8* %18
br label %82
82: ; preds = %80, %77
%83 = phi i8* [ %81, %80 ], [ %9, %77 ]
%84 = tail call i32 @memcpy(i8* %83, i8* %17, i32 %78)
%85 = sext i32 %78 to i64
%86 = getelementptr inbounds i8, i8* %83, i64 %85
store i8 0, i8* %86
br label %87
87: ; preds = %24, %38, %52, %66, %82, %73, %59, %45, %31, %16
%88 = phi i8* [ %86, %82 ], [ %18, %73 ], [ %18, %66 ], [ %18, %59 ], [ %18, %52 ], [ %18, %45 ], [ %18, %38 ], [ %18, %31 ], [ %18, %24 ], [ %18, %16 ]
%89 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%90 = icmp eq i8* %89, null
br i1 %90, label %91, label %16
91: ; preds = %87, %13
%92 = tail call i32 @free(i8* %4)
store i8* %9, i8** %0
br label %96
93: ; preds = %2, %11
%94 = load i32, i32* @stderr
%95 = tail call i32 @fprintf(i32 %94, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0))
br label %96
96: ; preds = %93, %91
%97 = phi i32 [ 0, %91 ], [ 1, %93 ]
ret i32 %97
}