#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 */
typedef int /*<<< orphan*/ uid_str;
struct iovec {
  int dummy;
};
typedef int /*<<< orphan*/ gid_str;
typedef int /*<<< orphan*/ errmsg;

/* Variables and functions */
int /*<<< orphan*/ EX_OSERR;
int /*<<< orphan*/ EX_USAGE;
int MAXPATHLEN;
int /*<<< orphan*/ build_iovec(struct iovec **, int *, char *, char *, int);
scalar_t__ checkpath(char *, char *);
int /*<<< orphan*/ err(int /*<<< orphan*/, char *, char *, ...);
int /*<<< orphan*/ errx(int /*<<< orphan*/, char *, char *, char *, char *,
                        char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getopt(int, char **, char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
scalar_t__ nmount(struct iovec *, int, int /*<<< orphan*/);
char *optarg;
scalar_t__ optind;
int /*<<< orphan*/ parse_gid(char *, char *, int);
int /*<<< orphan*/ parse_uid(char *, char *, int);
int /*<<< orphan*/ printf(char *);
char *strchr(char *, char);
int /*<<< orphan*/ strcmp(char *, char *);
scalar_t__ subdir(char *, char *);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  struct iovec *iov;
  int ch, iovlen;
  char source[MAXPATHLEN], target[MAXPATHLEN], errmsg[255];
  char uid_str[20], gid_str[20];
  char fstype[] = "unionfs";
  char *p, *val;
  iov = NULL;
  iovlen = 0;
  memset(errmsg, 0, sizeof(errmsg));
  while ((ch = getopt(argc, argv, "bo:")) != -1) {
    switch (ch) {
    case 'b':
      printf("\n  -b is deprecated.  Use \"-o below\" instead\n");
      build_iovec(&iov, &iovlen, "below", NULL, 0);
      break;
    case 'o':
      p = strchr(optarg, '=');
      val = NULL;
      if (p != NULL) {
        *p = '\0';
        val = p + 1;
        if (strcmp(optarg, "gid") == 0) {
          parse_gid(val, gid_str, sizeof(gid_str));
          val = gid_str;
        } else if (strcmp(optarg, "uid") == 0) {
          parse_uid(val, uid_str, sizeof(uid_str));
          val = uid_str;
        }
      }
      build_iovec(&iov, &iovlen, optarg, val, (size_t)-1);
      break;
    case '?':
    default:
      usage();
    }
  }
  argc -= optind;
  argv += optind;
  if (argc != 2)
    usage();
  if (checkpath(argv[0], target) != 0)
    err(EX_USAGE, "%s", target);
  if (checkpath(argv[1], source) != 0)
    err(EX_USAGE, "%s", source);
  if (subdir(target, source) || subdir(source, target))
    errx(EX_USAGE, "%s (%s) and %s (%s) are not distinct paths", argv[0],
         target, argv[1], source);
  build_iovec(&iov, &iovlen, "fstype", fstype, (size_t)-1);
  build_iovec(&iov, &iovlen, "fspath", source, (size_t)-1);
  build_iovec(&iov, &iovlen, "from", target, (size_t)-1);
  build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg));
  if (nmount(iov, iovlen, 0))
    err(EX_OSERR, "%s: %s", source, errmsg);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2dc8(%rip),%rax
mov    (%rax),%ecx
mov    %rsp,%rdx
mov    %rdx,-0x28(%rbp)
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x1a8(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x30(%rbp)
mov    (%rax),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x1a0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
mov    0xda0(%rip),%rax
mov    %rax,-0x188(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
lea    -0x140(%rbp),%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1080 <memset@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xd71(%rip),%rdx
call   10e0 <getopt@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
je     1436 <main+0x246>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x1ac(%rbp)
sub    $0x3f,%eax
je     1425 <main+0x235>
jmp    12bf <main+0xcf>
mov    -0x1ac(%rbp),%eax
sub    $0x62,%eax
je     12e7 <main+0xf7>
jmp    12d3 <main+0xe3>
mov    -0x1ac(%rbp),%eax
sub    $0x6f,%eax
je     1313 <main+0x123>
jmp    142a <main+0x23a>
lea    0xd1e(%rip),%rdi
call   1070 <printf@plt>
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    0xd38(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1100 <build_iovec@plt>
jmp    1431 <main+0x241>
mov    0x2cde(%rip),%rax
mov    (%rax),%rdi
mov    $0x3d,%esi
call   1060 <strchr@plt>
mov    %rax,-0x190(%rbp)
movq   $0x0,-0x198(%rbp)
cmpq   $0x0,-0x190(%rbp)
je     13fc <main+0x20c>
mov    -0x190(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x190(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x198(%rbp)
mov    0x2c8e(%rip),%rax
mov    (%rax),%rdi
lea    0xccc(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%eax
jne    13ad <main+0x1bd>
mov    -0x198(%rbp),%rdi
lea    -0x180(%rbp),%rsi
mov    $0x14,%edx
call   1030 <parse_gid@plt>
lea    -0x180(%rbp),%rax
mov    %rax,-0x198(%rbp)
jmp    13f7 <main+0x207>
mov    0x2c44(%rip),%rax
mov    (%rax),%rdi
lea    0xc86(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%eax
jne    13f2 <main+0x202>
mov    -0x198(%rbp),%rdi
lea    -0x160(%rbp),%rsi
mov    $0x14,%edx
call   10c0 <parse_uid@plt>
lea    -0x160(%rbp),%rax
mov    %rax,-0x198(%rbp)
jmp    13f7 <main+0x207>
jmp    13fc <main+0x20c>
mov    0x2bf5(%rip),%rax
mov    (%rax),%rdx
mov    -0x198(%rbp),%rcx
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xffffffff,%r8d
call   1100 <build_iovec@plt>
jmp    1431 <main+0x241>
jmp    142a <main+0x23a>
mov    $0x0,%al
call   10d0 <usage@plt>
jmp    1289 <main+0x99>
mov    0x2b93(%rip),%rax
mov    (%rax),%rcx
movslq -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    0x2b7f(%rip),%rax
mov    (%rax),%rax
shl    $0x3,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1471 <main+0x281>
mov    $0x0,%al
call   10d0 <usage@plt>
mov    -0x1a0(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10a0 <checkpath@plt>
cmp    $0x0,%rax
je     14ac <main+0x2bc>
mov    -0x1a0(%rbp),%rdx
mov    0x2b44(%rip),%rax
mov    (%rax),%edi
lea    0xbec(%rip),%rsi
mov    $0x0,%al
call   10b0 <err@plt>
mov    -0x1a8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10a0 <checkpath@plt>
cmp    $0x0,%rax
je     14e8 <main+0x2f8>
mov    -0x1a8(%rbp),%rdx
mov    0x2b08(%rip),%rax
mov    (%rax),%edi
lea    0xbb0(%rip),%rsi
mov    $0x0,%al
call   10b0 <err@plt>
mov    -0x1a8(%rbp),%rsi
mov    -0x1a0(%rbp),%rdi
call   1110 <subdir@plt>
cmp    $0x0,%rax
jne    1522 <main+0x332>
mov    -0x1a0(%rbp),%rsi
mov    -0x1a8(%rbp),%rdi
call   1110 <subdir@plt>
cmp    $0x0,%rax
je     1554 <main+0x364>
mov    -0x1a8(%rbp),%r9
mov    -0x1a0(%rbp),%rcx
mov    0x2aa9(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%r8
lea    0xaf9(%rip),%rsi
call   1050 <errx@plt>
lea    -0x188(%rbp),%rcx
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    0xb09(%rip),%rdx
mov    $0xffffffff,%r8d
call   1100 <build_iovec@plt>
mov    -0x1a8(%rbp),%rcx
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    0xaef(%rip),%rdx
mov    $0xffffffff,%r8d
call   1100 <build_iovec@plt>
mov    -0x1a0(%rbp),%rcx
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    0xad5(%rip),%rdx
mov    $0xffffffff,%r8d
call   1100 <build_iovec@plt>
lea    -0x140(%rbp),%rcx
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    0xab9(%rip),%rdx
mov    $0xff,%r8d
call   1100 <build_iovec@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%esi
xor    %edx,%edx
call   1040 <nmount@plt>
cmp    $0x0,%rax
je     1615 <main+0x425>
mov    -0x1a8(%rbp),%rdx
mov    0x29c2(%rip),%rax
mov    (%rax),%edi
lea    -0x140(%rbp),%rcx
lea    0xa7f(%rip),%rsi
mov    $0x0,%al
call   10b0 <err@plt>
xor    %edi,%edi
call   10f0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x168,%rsp
mov    %rsi,%r13
mov    %edi,%ebx
mov    0x2dc8(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x50(%rbp)
mov    %rcx,%rsp
mov    %rsp,%rcx
sub    %rax,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
movabs $0x73666e6f696e75,%rax
mov    %rax,-0x58(%rbp)
movq   $0x0,-0x38(%rbp)
movl   $0x0,-0x2c(%rbp)
lea    -0x190(%rbp),%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1080 <memset@plt>
lea    0xd95(%rip),%r15
mov    %ebx,-0x30(%rbp)
mov    %r13,-0x40(%rbp)
jmp    12b2 <main+0xc2>
mov    %r14,%rdi
lea    -0x70(%rbp),%r14
mov    %r14,%rsi
mov    $0x14,%edx
call   1030 <parse_gid@plt>
mov    %rbx,%rdi
mov    %r13,%r15
mov    -0x40(%rbp),%r13
mov    -0x30(%rbp),%ebx
mov    0x2d5c(%rip),%r12
mov    (%r12),%rdx
lea    -0x2c(%rbp),%rsi
mov    %r14,%rcx
mov    $0xffffffff,%r8d
call   1100 <build_iovec@plt>
mov    %ebx,%edi
mov    %r13,%rsi
mov    %r15,%rdx
call   10e0 <getopt@plt>
cmp    $0x62,%eax
je     12e0 <main+0xf0>
cmp    $0x6f,%eax
je     1310 <main+0x120>
cmp    $0xffffffff,%eax
je     1395 <main+0x1a5>
xor    %eax,%eax
call   10d0 <usage@plt>
jmp    12b2 <main+0xc2>
nopl   0x0(%rax,%rax,1)
lea    0xd77(%rip),%rdi
call   1040 <puts@plt>
lea    -0x38(%rbp),%rdi
lea    -0x2c(%rbp),%rsi
lea    0xd09(%rip),%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1100 <build_iovec@plt>
jmp    12b2 <main+0xc2>
nopw   0x0(%rax,%rax,1)
mov    0x2ce1(%rip),%r12
mov    (%r12),%rdi
mov    $0x3d,%esi
call   1070 <strchr@plt>
test   %rax,%rax
je     1389 <main+0x199>
mov    %rax,%r14
mov    %r15,%r13
lea    -0x38(%rbp),%rbx
movb   $0x0,(%rax)
add    $0x1,%r14
mov    (%r12),%r15
mov    %r15,%rdi
lea    0xcc1(%rip),%rsi
call   1090 <strcmp@plt>
test   %eax,%eax
je     1274 <main+0x84>
mov    %r15,%rdi
lea    0xcae(%rip),%rsi
call   1090 <strcmp@plt>
test   %eax,%eax
jne    1288 <main+0x98>
mov    %r14,%rdi
lea    -0x90(%rbp),%r14
mov    %r14,%rsi
mov    $0x14,%edx
call   10c0 <parse_uid@plt>
jmp    1288 <main+0x98>
xor    %r14d,%r14d
lea    -0x38(%rbp),%rdi
jmp    129c <main+0xac>
mov    0x2c34(%rip),%rax
mov    (%rax),%r14
sub    %r14d,%ebx
cmp    $0x2,%ebx
je     13ae <main+0x1be>
xor    %eax,%eax
call   10d0 <usage@plt>
mov    0x0(%r13,%r14,8),%rdi
mov    -0x48(%rbp),%rbx
mov    %rbx,%rsi
call   10a0 <checkpath@plt>
test   %rax,%rax
mov    -0x50(%rbp),%r15
je     13e2 <main+0x1f2>
mov    0x2c11(%rip),%rax
mov    (%rax),%edi
lea    0xc83(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   10b0 <err@plt>
mov    0x8(%r13,%r14,8),%rdi
mov    %r15,%rsi
call   10a0 <checkpath@plt>
test   %rax,%rax
je     140e <main+0x21e>
mov    0x2be5(%rip),%rax
mov    (%rax),%edi
lea    0xc57(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   10b0 <err@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1110 <subdir@plt>
test   %rax,%rax
jne    142e <main+0x23e>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1110 <subdir@plt>
test   %rax,%rax
je     1453 <main+0x263>
mov    0x2bab(%rip),%rax
mov    (%rax),%edi
mov    0x0(%r13,%r14,8),%rdx
mov    0x8(%r13,%r14,8),%r8
lea    0xbca(%rip),%rsi
mov    %rbx,%rcx
mov    %r15,%r9
call   1060 <errx@plt>
lea    0xbe3(%rip),%rdx
lea    -0x38(%rbp),%r12
lea    -0x2c(%rbp),%r14
lea    -0x58(%rbp),%rcx
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0xffffffff,%r8d
call   1100 <build_iovec@plt>
lea    0xbc6(%rip),%rdx
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r15,%rcx
mov    $0xffffffff,%r8d
call   1100 <build_iovec@plt>
lea    0xbb2(%rip),%rdx
mov    %r12,%rdi
mov    %r14,%rsi
mov    %rbx,%rcx
mov    $0xffffffff,%r8d
call   1100 <build_iovec@plt>
lea    0xb9c(%rip),%rdx
lea    -0x190(%rbp),%rcx
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0xff,%r8d
call   1100 <build_iovec@plt>
mov    -0x38(%rbp),%rdi
mov    -0x2c(%rbp),%esi
xor    %edx,%edx
call   1050 <nmount@plt>
test   %rax,%rax
je     1500 <main+0x310>
mov    0x2ada(%rip),%rax
mov    (%rax),%edi
lea    0xb68(%rip),%rsi
lea    -0x190(%rbp),%rcx
mov    %r15,%rdx
xor    %eax,%eax
call   10b0 <err@plt>
xor    %edi,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
%struct.iovec = type { i32 }
@MAXPATHLEN = global i32 0
@__const.main.fstype = [8 x i8] c"unionfs\00"
@.str = [4 x i8] c"bo:\00"
@.str.1 = [46 x i8] c"\0A -b is deprecated. Use \22-o below\22 instead\0A\00"
@.str.2 = [6 x i8] c"below\00"
@optarg = global i8* null
@.str.3 = [4 x i8] c"gid\00"
@.str.4 = [4 x i8] c"uid\00"
@optind = global i64 0
@EX_USAGE = global i32 0
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [43 x i8] c"%s (%s) and %s (%s) are not distinct paths\00"
@.str.7 = [7 x i8] c"fstype\00"
@.str.8 = [7 x i8] c"fspath\00"
@.str.9 = [5 x i8] c"from\00"
@.str.10 = [7 x i8] c"errmsg\00"
@EX_OSERR = global i32 0
@.str.11 = [7 x i8] c"%s: %s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.iovec*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
%12 = alloca [255 x i8]
%13 = alloca [20 x i8]
%14 = alloca [20 x i8]
%15 = alloca [8 x i8]
%16 = alloca i8*
%17 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = load i32, i32* @MAXPATHLEN
%19 = zext i32 %18 to i64
%20 = call i8* @llvm.stacksave()
store i8* %20, i8** %9
%21 = alloca i8, i64 %19
store i64 %19, i64* %10
%22 = load i32, i32* @MAXPATHLEN
%23 = zext i32 %22 to i64
%24 = alloca i8, i64 %23
store i64 %23, i64* %11
%25 = bitcast [8 x i8]* %15 to i8*
store %struct.iovec* null, %struct.iovec** %6
store i32 0, i32* %8
%26 = getelementptr inbounds [255 x i8], [255 x i8]* %12, i64 0, i64 0
%27 = call i32 @memset(i8* %26, i32 0, i32 255)
br label %28
28: ; preds = %73, %2
%29 = load i32, i32* %4
%30 = load i8**, i8*** %5
%31 = call i32 @getopt(i32 %29, i8** %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 %31, i32* %7
%32 = icmp ne i32 %31, -1
br i1 %32, label %33, label %74
33: ; preds = %28
%34 = load i32, i32* %7
switch i32 %34, label %71 [
i32 98, label %35
i32 111, label %38
i32 63, label %70
]
35: ; preds = %33
%36 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%37 = call i32 @build_iovec(%struct.iovec** %6, i32* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* null, i32 0)
br label %73
38: ; preds = %33
%39 = load i8*, i8** @optarg
%40 = call i8* @strchr(i8* %39, i8 signext 61)
store i8* %40, i8** %16
store i8* null, i8** %17
%41 = load i8*, i8** %16
%42 = icmp ne i8* %41, null
br i1 %42, label %43, label %66
43: ; preds = %38
%44 = load i8*, i8** %16
store i8 0, i8* %44
%45 = load i8*, i8** %16
%46 = getelementptr inbounds i8, i8* %45, i64 1
store i8* %46, i8** %17
%47 = load i8*, i8** @optarg
%48 = call i32 @strcmp(i8* %47, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%49 = icmp eq i32 %48, 0
br i1 %49, label %50, label %55
50: ; preds = %43
%51 = load i8*, i8** %17
%52 = getelementptr inbounds [20 x i8], [20 x i8]* %14, i64 0, i64 0
%53 = call i32 @parse_gid(i8* %51, i8* %52, i32 20)
%54 = getelementptr inbounds [20 x i8], [20 x i8]* %14, i64 0, i64 0
store i8* %54, i8** %17
br label %65
55: ; preds = %43
%56 = load i8*, i8** @optarg
%57 = call i32 @strcmp(i8* %56, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%58 = icmp eq i32 %57, 0
br i1 %58, label %59, label %64
59: ; preds = %55
%60 = load i8*, i8** %17
%61 = getelementptr inbounds [20 x i8], [20 x i8]* %13, i64 0, i64 0
%62 = call i32 @parse_uid(i8* %60, i8* %61, i32 20)
%63 = getelementptr inbounds [20 x i8], [20 x i8]* %13, i64 0, i64 0
store i8* %63, i8** %17
br label %64
64: ; preds = %59, %55
br label %65
65: ; preds = %64, %50
br label %66
66: ; preds = %65, %38
%67 = load i8*, i8** @optarg
%68 = load i8*, i8** %17
%69 = call i32 @build_iovec(%struct.iovec** %6, i32* %8, i8* %67, i8* %68, i32 -1)
br label %73
70: ; preds = %33
br label %71
71: ; preds = %33, %70
%72 = call i32 (...) @usage()
br label %73
73: ; preds = %71, %66, %35
br label %28
74: ; preds = %28
%75 = load i64, i64* @optind
%76 = load i32, i32* %4
%77 = sext i32 %76 to i64
%78 = sub nsw i64 %77, %75
%79 = trunc i64 %78 to i32
store i32 %79, i32* %4
%80 = load i64, i64* @optind
%81 = load i8**, i8*** %5
%82 = getelementptr inbounds i8*, i8** %81, i64 %80
store i8** %82, i8*** %5
%83 = load i32, i32* %4
%84 = icmp ne i32 %83, 2
br i1 %84, label %85, label %87
85: ; preds = %74
%86 = call i32 (...) @usage()
br label %87
87: ; preds = %85, %74
%88 = load i8**, i8*** %5
%89 = getelementptr inbounds i8*, i8** %88, i64 0
%90 = load i8*, i8** %89
%91 = call i64 @checkpath(i8* %90, i8* %24)
%92 = icmp ne i64 %91, 0
br i1 %92, label %93, label %96
93: ; preds = %87
%94 = load i32, i32* @EX_USAGE
%95 = call i32 (i32, i8*, i8*, ...) @err(i32 %94, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %24)
br label %96
96: ; preds = %93, %87
%97 = load i8**, i8*** %5
%98 = getelementptr inbounds i8*, i8** %97, i64 1
%99 = load i8*, i8** %98
%100 = call i64 @checkpath(i8* %99, i8* %21)
%101 = icmp ne i64 %100, 0
br i1 %101, label %102, label %105
102: ; preds = %96
%103 = load i32, i32* @EX_USAGE
%104 = call i32 (i32, i8*, i8*, ...) @err(i32 %103, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %21)
br label %105
105: ; preds = %102, %96
%106 = call i64 @subdir(i8* %24, i8* %21)
%107 = icmp ne i64 %106, 0
br i1 %107, label %111, label %108
108: ; preds = %105
%109 = call i64 @subdir(i8* %21, i8* %24)
%110 = icmp ne i64 %109, 0
br i1 %110, label %111, label %120
111: ; preds = %108, %105
%112 = load i32, i32* @EX_USAGE
%113 = load i8**, i8*** %5
%114 = getelementptr inbounds i8*, i8** %113, i64 0
%115 = load i8*, i8** %114
%116 = load i8**, i8*** %5
%117 = getelementptr inbounds i8*, i8** %116, i64 1
%118 = load i8*, i8** %117
%119 = call i32 @errx(i32 %112, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), i8* %115, i8* %24, i8* %118, i8* %21)
br label %120
120: ; preds = %111, %108
%121 = getelementptr inbounds [8 x i8], [8 x i8]* %15, i64 0, i64 0
%122 = call i32 @build_iovec(%struct.iovec** %6, i32* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* %121, i32 -1)
%123 = call i32 @build_iovec(%struct.iovec** %6, i32* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %21, i32 -1)
%124 = call i32 @build_iovec(%struct.iovec** %6, i32* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i8* %24, i32 -1)
%125 = getelementptr inbounds [255 x i8], [255 x i8]* %12, i64 0, i64 0
%126 = call i32 @build_iovec(%struct.iovec** %6, i32* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8* %125, i32 255)
%127 = load %struct.iovec*, %struct.iovec** %6
%128 = load i32, i32* %8
%129 = call i64 @nmount(%struct.iovec* %127, i32 %128, i32 0)
%130 = icmp ne i64 %129, 0
br i1 %130, label %131, label %135
131: ; preds = %120
%132 = load i32, i32* @EX_OSERR
%133 = getelementptr inbounds [255 x i8], [255 x i8]* %12, i64 0, i64 0
%134 = call i32 (i32, i8*, i8*, ...) @err(i32 %132, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i8* %21, i8* %133)
br label %135
135: ; preds = %131, %120
%136 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
@MAXPATHLEN = global i32 0
@.str = [4 x i8] c"bo:\00"
@.str.2 = [6 x i8] c"below\00"
@optarg = global i8* null
@.str.3 = [4 x i8] c"gid\00"
@.str.4 = [4 x i8] c"uid\00"
@optind = global i64 0
@EX_USAGE = global i32 0
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [43 x i8] c"%s (%s) and %s (%s) are not distinct paths\00"
@.str.7 = [7 x i8] c"fstype\00"
@.str.8 = [7 x i8] c"fspath\00"
@.str.9 = [5 x i8] c"from\00"
@.str.10 = [7 x i8] c"errmsg\00"
@EX_OSERR = global i32 0
@.str.11 = [7 x i8] c"%s: %s\00"
@str = [45 x i8] c"\0A -b is deprecated. Use \22-o below\22 instead\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca %struct.iovec*
%4 = alloca i32
%5 = alloca [255 x i8]
%6 = alloca [20 x i8]
%7 = alloca [20 x i8]
%8 = alloca i64
%9 = bitcast %struct.iovec** %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = load i32, i32* @MAXPATHLEN
%12 = zext i32 %11 to i64
%13 = alloca i8, i64 %12
%14 = alloca i8, i64 %12
%15 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%16 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%17 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%18 = bitcast i64* %8 to i8*
store i64 32482246823341685, i64* %8
store %struct.iovec* null, %struct.iovec** %3
store i32 0, i32* %4
%19 = call i32 @memset(i8* %15, i32 0, i32 255)
br label %20
20: ; preds = %47, %2
%21 = call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
switch i32 %21, label %45 [
i32 -1, label %48
i32 98, label %22
i32 111, label %25
]
22: ; preds = %20
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%24 = call i32 @build_iovec(%struct.iovec** %3, i32* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* null, i32 0)
br label %47
25: ; preds = %20
%26 = load i8*, i8** @optarg
%27 = call i8* @strchr(i8* dereferenceable(1) %26, i8 signext 61)
%28 = icmp eq i8* %27, null
br i1 %28, label %41, label %29
29: ; preds = %25
store i8 0, i8* %27
%30 = getelementptr inbounds i8, i8* %27, i64 1
%31 = load i8*, i8** @optarg
%32 = call i32 @strcmp(i8* dereferenceable(1) %31, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %29
%35 = call i32 @parse_gid(i8* %30, i8* %17, i32 20)
br label %41
36: ; preds = %29
%37 = call i32 @strcmp(i8* dereferenceable(1) %31, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = call i32 @parse_uid(i8* %30, i8* %16, i32 20)
br label %41
41: ; preds = %34, %39, %36, %25
%42 = phi i8* [ %17, %34 ], [ %16, %39 ], [ %30, %36 ], [ null, %25 ]
%43 = load i8*, i8** @optarg
%44 = call i32 @build_iovec(%struct.iovec** %3, i32* %4, i8* %43, i8* %42, i32 -1)
br label %47
45: ; preds = %20
%46 = call i32 (...) @usage()
br label %47
47: ; preds = %45, %41, %22
br label %20
48: ; preds = %20
%49 = load i64, i64* @optind
%50 = trunc i64 %49 to i32
%51 = sub i32 %0, %50
%52 = getelementptr inbounds i8*, i8** %1, i64 %49
%53 = icmp eq i32 %51, 2
br i1 %53, label %56, label %54
54: ; preds = %48
%55 = call i32 (...) @usage()
br label %56
56: ; preds = %54, %48
%57 = load i8*, i8** %52
%58 = call i64 @checkpath(i8* %57, i8* %14)
%59 = icmp eq i64 %58, 0
br i1 %59, label %63, label %60
60: ; preds = %56
%61 = load i32, i32* @EX_USAGE
%62 = call i32 (i32, i8*, i8*, ...) @err(i32 %61, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %14)
br label %63
63: ; preds = %60, %56
%64 = getelementptr inbounds i8*, i8** %52, i64 1
%65 = load i8*, i8** %64
%66 = call i64 @checkpath(i8* %65, i8* %13)
%67 = icmp eq i64 %66, 0
br i1 %67, label %71, label %68
68: ; preds = %63
%69 = load i32, i32* @EX_USAGE
%70 = call i32 (i32, i8*, i8*, ...) @err(i32 %69, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %13)
br label %71
71: ; preds = %68, %63
%72 = call i64 @subdir(i8* %14, i8* %13)
%73 = icmp eq i64 %72, 0
br i1 %73, label %74, label %77
74: ; preds = %71
%75 = call i64 @subdir(i8* %13, i8* %14)
%76 = icmp eq i64 %75, 0
br i1 %76, label %82, label %77
77: ; preds = %74, %71
%78 = load i32, i32* @EX_USAGE
%79 = load i8*, i8** %52
%80 = load i8*, i8** %64
%81 = call i32 @errx(i32 %78, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), i8* %79, i8* %14, i8* %80, i8* %13)
br label %82
82: ; preds = %77, %74
%83 = call i32 @build_iovec(%struct.iovec** %3, i32* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* %18, i32 -1)
%84 = call i32 @build_iovec(%struct.iovec** %3, i32* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %13, i32 -1)
%85 = call i32 @build_iovec(%struct.iovec** %3, i32* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i8* %14, i32 -1)
%86 = call i32 @build_iovec(%struct.iovec** %3, i32* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8* %15, i32 255)
%87 = load %struct.iovec*, %struct.iovec** %3
%88 = load i32, i32* %4
%89 = call i64 @nmount(%struct.iovec* %87, i32 %88, i32 0)
%90 = icmp eq i64 %89, 0
br i1 %90, label %94, label %91
91: ; preds = %82
%92 = load i32, i32* @EX_OSERR
%93 = call i32 (i32, i8*, i8*, ...) @err(i32 %92, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i8* %13, i8* %15)
br label %94
94: ; preds = %91, %82
%95 = call i32 @exit(i32 0)
unreachable
}