#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 uid_t;
typedef scalar_t__ u_int;
typedef int mode_t;
typedef int gid_t;
typedef scalar_t__ dev_t;

/* Variables and functions */
int S_IFBLK;
int S_IFCHR;
int a_gid(char *);
int a_uid(char *);
scalar_t__ chown(char *, int, int);
int /*<<< orphan*/ err(int, char *, char *);
int errno;
int /*<<< orphan*/ errx(int, char *, ...);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
long major(scalar_t__);
scalar_t__ makedev(long, long);
scalar_t__ minor(scalar_t__);
scalar_t__ mknod(char *, int, scalar_t__);
char *strchr(char *, char);
scalar_t__ strtoul(char *, char **, int /*<<< orphan*/);
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  int range_error;
  uid_t uid;
  gid_t gid;
  mode_t mode;
  dev_t dev;
  char *cp, *endp;
  long mymajor, myminor;
  if (argc != 2 && argc != 5 && argc != 6)
    usage();
  if (argc >= 5) {
    mode = 0666;
    if (argv[2][0] == 'c')
      mode |= S_IFCHR;
    else if (argv[2][0] == 'b')
      mode |= S_IFBLK;
    else
      errx(1, "node must be type 'b' or 'c'");
    errno = 0;
    mymajor = (long)strtoul(argv[3], &endp, 0);
    if (endp == argv[3] || *endp != '\0')
      errx(1, "%s: non-numeric major number", argv[3]);
    range_error = errno;
    errno = 0;
    myminor = (long)strtoul(argv[4], &endp, 0);
    if (endp == argv[4] || *endp != '\0')
      errx(1, "%s: non-numeric minor number", argv[4]);
    range_error |= errno;
    dev = makedev(mymajor, myminor);
    if (range_error || major(dev) != mymajor ||
        (long)(u_int)minor(dev) != myminor)
      errx(1, "major or minor number too large");
  } else {
    mode = 0666 | S_IFCHR;
    dev = 0;
  }
  uid = gid = -1;
  if (6 == argc) {
    if ((cp = strchr(argv[5], ':')) != NULL) {
      *cp++ = '\0';
      gid = a_gid(cp);
    } else
      usage();
    uid = a_uid(argv[5]);
  }
  if (mknod(argv[1], mode, dev) != 0)
    err(1, "%s", argv[1]);
  if (6 == argc)
    if (chown(argv[1], uid, gid))
      err(1, "setting ownership on %s", argv[1]);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     120b <main+0x3b>
cmpl   $0x5,-0x8(%rbp)
je     120b <main+0x3b>
cmpl   $0x6,-0x8(%rbp)
je     120b <main+0x3b>
mov    $0x0,%al
call   10b0 <usage@plt>
cmpl   $0x5,-0x8(%rbp)
jl     13ba <main+0x1ea>
movl   $0x1b6,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsbl (%rax),%eax
cmp    $0x63,%eax
jne    1244 <main+0x74>
mov    0x2da1(%rip),%rax
mov    (%rax),%eax
or     -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1284 <main+0xb4>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsbl (%rax),%eax
cmp    $0x62,%eax
jne    126c <main+0x9c>
mov    0x2d81(%rip),%rax
mov    (%rax),%eax
or     -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    127f <main+0xaf>
mov    $0x1,%edi
lea    0xd88(%rip),%rsi
mov    $0x0,%al
call   1050 <errx@plt>
jmp    1284 <main+0xb4>
mov    0x2d45(%rip),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    -0x38(%rbp),%rsi
xor    %edx,%edx
call   10e0 <strtoul@plt>
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    0x18(%rcx),%rax
je     12ca <main+0xfa>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     12e5 <main+0x115>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
mov    $0x1,%edi
lea    0xd3f(%rip),%rsi
mov    $0x0,%al
call   1050 <errx@plt>
mov    0x2ce4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    0x2cd8(%rip),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
lea    -0x38(%rbp),%rsi
xor    %edx,%edx
call   10e0 <strtoul@plt>
mov    %rax,-0x48(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    0x20(%rcx),%rax
je     1337 <main+0x167>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1352 <main+0x182>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdx
mov    $0x1,%edi
lea    0xcef(%rip),%rsi
mov    $0x0,%al
call   1050 <errx@plt>
mov    0x2c77(%rip),%rax
mov    (%rax),%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   10d0 <makedev@plt>
mov    %rax,-0x28(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    13a2 <main+0x1d2>
mov    -0x28(%rbp),%rdi
call   1070 <major@plt>
cmp    -0x40(%rbp),%rax
jne    13a2 <main+0x1d2>
mov    -0x28(%rbp),%rdi
call   1040 <minor@plt>
cmp    -0x48(%rbp),%rax
je     13b5 <main+0x1e5>
mov    $0x1,%edi
lea    0xca9(%rip),%rsi
mov    $0x0,%al
call   1050 <errx@plt>
jmp    13d3 <main+0x203>
mov    0x2c17(%rip),%rax
mov    (%rax),%eax
or     $0x1b6,%eax
mov    %eax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
movl   $0xffffffff,-0x18(%rbp)
mov    $0x6,%eax
cmp    -0x8(%rbp),%eax
jne    1449 <main+0x279>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
mov    $0x3a,%esi
call   1060 <strchr@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
je     1432 <main+0x262>
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x30(%rbp)
movb   $0x0,(%rax)
mov    -0x30(%rbp),%rdi
call   1030 <a_gid@plt>
mov    %eax,-0x1c(%rbp)
jmp    1439 <main+0x269>
mov    $0x0,%al
call   10b0 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   10c0 <a_uid@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x20(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   1080 <mknod@plt>
cmp    $0x0,%rax
je     1480 <main+0x2b0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    $0x1,%edi
lea    0xc11(%rip),%rsi
call   1090 <err@plt>
mov    $0x6,%eax
cmp    -0x8(%rbp),%eax
jne    14c9 <main+0x2f9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   10a0 <chown@plt>
cmp    $0x0,%rax
je     14c4 <main+0x2f4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    $0x1,%edi
lea    0xbb8(%rip),%rsi
call   1090 <err@plt>
jmp    14c9 <main+0x2f9>
xor    %edi,%edi
call   10f0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r13
mov    %edi,%ebp
cmp    $0x6,%edi
ja     120e <main+0x3e>
mov    $0x64,%eax
bt     %ebp,%eax
jae    120e <main+0x3e>
cmp    $0x5,%ebp
jl     121a <main+0x4a>
mov    0x10(%r13),%rax
mov    (%rax),%al
cmp    $0x62,%al
je     123d <main+0x6d>
cmp    $0x63,%al
jne    1251 <main+0x81>
mov    0x2dcc(%rip),%rax
jmp    1244 <main+0x74>
xor    %eax,%eax
call   10b0 <usage@plt>
cmp    $0x5,%ebp
jge    11f7 <main+0x27>
mov    0x2db7(%rip),%rax
mov    $0x1b6,%esi
or     (%rax),%esi
mov    $0xffffffff,%r12d
xor    %ebx,%ebx
xor    %r15d,%r15d
mov    $0xffffffff,%ebp
jmp    1398 <main+0x1c8>
mov    0x2d9c(%rip),%rax
mov    $0x1b6,%ecx
or     (%rax),%ecx
mov    %ecx,0x4(%rsp)
jmp    126c <main+0x9c>
lea    0xda8(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1050 <errx@plt>
movl   $0x1b6,0x4(%rsp)
mov    0x2d5d(%rip),%r15
movl   $0x0,(%r15)
mov    0x18(%r13),%rdi
lea    0x8(%rsp),%rsi
xor    %edx,%edx
call   10e0 <strtoul@plt>
mov    %rax,%r14
mov    0x8(%rsp),%rax
mov    0x18(%r13),%rdx
cmp    %rdx,%rax
je     12a0 <main+0xd0>
cmpb   $0x0,(%rax)
je     12b3 <main+0xe3>
lea    0xd76(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1050 <errx@plt>
mov    (%r15),%r12d
movl   $0x0,(%r15)
mov    0x20(%r13),%rdi
lea    0x8(%rsp),%rsi
xor    %edx,%edx
call   10e0 <strtoul@plt>
mov    %rax,0x10(%rsp)
mov    0x8(%rsp),%rax
mov    0x20(%r13),%rdx
cmp    %rdx,%rax
je     12e5 <main+0x115>
cmpb   $0x0,(%rax)
je     12f8 <main+0x128>
lea    0xd4e(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1050 <errx@plt>
mov    (%r15),%ebx
mov    %r14,%rdi
mov    0x10(%rsp),%rsi
call   10d0 <makedev@plt>
mov    %rax,%r15
or     %ebx,%r12d
jne    132c <main+0x15c>
mov    %r15,%rdi
call   1070 <major@plt>
cmp    %r14,%rax
jne    132c <main+0x15c>
mov    %r15,%rdi
call   1040 <minor@plt>
cmp    0x10(%rsp),%rax
je     133f <main+0x16f>
lea    0xd24(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1050 <errx@plt>
cmp    $0x6,%ebp
jne    1366 <main+0x196>
mov    0x28(%r13),%rdi
mov    $0x3a,%esi
call   1060 <strchr@plt>
test   %rax,%rax
jne    1375 <main+0x1a5>
xor    %eax,%eax
call   10b0 <usage@plt>
mov    $0xffffffff,%r12d
jmp    1387 <main+0x1b7>
mov    $0xffffffff,%r12d
xor    %ebx,%ebx
mov    $0xffffffff,%ebp
jmp    1394 <main+0x1c4>
mov    %rax,%rdi
add    $0x1,%rdi
movb   $0x0,(%rax)
call   1030 <a_gid@plt>
mov    %eax,%r12d
mov    0x28(%r13),%rdi
call   10c0 <a_uid@plt>
mov    %eax,%ebp
mov    $0x1,%bl
mov    0x4(%rsp),%esi
mov    0x8(%r13),%rdi
mov    %r15,%rdx
call   1080 <mknod@plt>
test   %rax,%rax
je     13be <main+0x1ee>
mov    0x8(%r13),%rdx
lea    0xcd8(%rip),%rsi
mov    $0x1,%edi
call   1090 <err@plt>
test   %bl,%bl
je     13ea <main+0x21a>
mov    0x8(%r13),%rdi
mov    %ebp,%esi
mov    %r12d,%edx
call   10a0 <chown@plt>
test   %rax,%rax
je     13ea <main+0x21a>
mov    0x8(%r13),%rdx
lea    0xc97(%rip),%rsi
mov    $0x1,%edi
call   1090 <err@plt>
xor    %edi,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
@S_IFCHR = global i32 0
@S_IFBLK = global i32 0
@.str = [29 x i8] c"node must be type 'b' or 'c'\00"
@errno = global i32 0
@.str.1 = [29 x i8] c"%s: non-numeric major number\00"
@.str.2 = [29 x i8] c"%s: non-numeric minor number\00"
@.str.3 = [32 x i8] c"major or minor number too large\00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [24 x i8] c"setting ownership on %s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 2
br i1 %16, label %17, label %25
17: ; preds = %2
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 5
br i1 %19, label %20, label %25
20: ; preds = %17
%21 = load i32, i32* %4
%22 = icmp ne i32 %21, 6
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 (...) @usage()
br label %25
25: ; preds = %23, %20, %17, %2
%26 = load i32, i32* %4
%27 = icmp sge i32 %26, 5
br i1 %27, label %28, label %118
28: ; preds = %25
store i32 438, i32* %9
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 2
%31 = load i8*, i8** %30
%32 = getelementptr inbounds i8, i8* %31, i64 0
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 99
br i1 %35, label %36, label %40
36: ; preds = %28
%37 = load i32, i32* @S_IFCHR
%38 = load i32, i32* %9
%39 = or i32 %38, %37
store i32 %39, i32* %9
br label %55
40: ; preds = %28
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 2
%43 = load i8*, i8** %42
%44 = getelementptr inbounds i8, i8* %43, i64 0
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp eq i32 %46, 98
br i1 %47, label %48, label %52
48: ; preds = %40
%49 = load i32, i32* @S_IFBLK
%50 = load i32, i32* %9
%51 = or i32 %50, %49
store i32 %51, i32* %9
br label %54
52: ; preds = %40
%53 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %54
54: ; preds = %52, %48
br label %55
55: ; preds = %54, %36
store i32 0, i32* @errno
%56 = load i8**, i8*** %5
%57 = getelementptr inbounds i8*, i8** %56, i64 3
%58 = load i8*, i8** %57
%59 = call i64 @strtoul(i8* %58, i8** %12, i32 0)
store i64 %59, i64* %13
%60 = load i8*, i8** %12
%61 = load i8**, i8*** %5
%62 = getelementptr inbounds i8*, i8** %61, i64 3
%63 = load i8*, i8** %62
%64 = icmp eq i8* %60, %63
br i1 %64, label %70, label %65
65: ; preds = %55
%66 = load i8*, i8** %12
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
%69 = icmp ne i32 %68, 0
br i1 %69, label %70, label %75
70: ; preds = %65, %55
%71 = load i8**, i8*** %5
%72 = getelementptr inbounds i8*, i8** %71, i64 3
%73 = load i8*, i8** %72
%74 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %73)
br label %75
75: ; preds = %70, %65
%76 = load i32, i32* @errno
store i32 %76, i32* %6
store i32 0, i32* @errno
%77 = load i8**, i8*** %5
%78 = getelementptr inbounds i8*, i8** %77, i64 4
%79 = load i8*, i8** %78
%80 = call i64 @strtoul(i8* %79, i8** %12, i32 0)
store i64 %80, i64* %14
%81 = load i8*, i8** %12
%82 = load i8**, i8*** %5
%83 = getelementptr inbounds i8*, i8** %82, i64 4
%84 = load i8*, i8** %83
%85 = icmp eq i8* %81, %84
br i1 %85, label %91, label %86
86: ; preds = %75
%87 = load i8*, i8** %12
%88 = load i8, i8* %87
%89 = sext i8 %88 to i32
%90 = icmp ne i32 %89, 0
br i1 %90, label %91, label %96
91: ; preds = %86, %75
%92 = load i8**, i8*** %5
%93 = getelementptr inbounds i8*, i8** %92, i64 4
%94 = load i8*, i8** %93
%95 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %94)
br label %96
96: ; preds = %91, %86
%97 = load i32, i32* @errno
%98 = load i32, i32* %6
%99 = or i32 %98, %97
store i32 %99, i32* %6
%100 = load i64, i64* %13
%101 = load i64, i64* %14
%102 = call i64 @makedev(i64 %100, i64 %101)
store i64 %102, i64* %10
%103 = load i32, i32* %6
%104 = icmp ne i32 %103, 0
br i1 %104, label %115, label %105
105: ; preds = %96
%106 = load i64, i64* %10
%107 = call i64 @major(i64 %106)
%108 = load i64, i64* %13
%109 = icmp ne i64 %107, %108
br i1 %109, label %115, label %110
110: ; preds = %105
%111 = load i64, i64* %10
%112 = call i64 @minor(i64 %111)
%113 = load i64, i64* %14
%114 = icmp ne i64 %112, %113
br i1 %114, label %115, label %117
115: ; preds = %110, %105, %96
%116 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
br label %117
117: ; preds = %115, %110
br label %121
118: ; preds = %25
%119 = load i32, i32* @S_IFCHR
%120 = or i32 438, %119
store i32 %120, i32* %9
store i64 0, i64* %10
br label %121
121: ; preds = %118, %117
store i32 -1, i32* %8
store i32 -1, i32* %7
%122 = load i32, i32* %4
%123 = icmp eq i32 6, %122
br i1 %123, label %124, label %142
124: ; preds = %121
%125 = load i8**, i8*** %5
%126 = getelementptr inbounds i8*, i8** %125, i64 5
%127 = load i8*, i8** %126
%128 = call i8* @strchr(i8* %127, i8 signext 58)
store i8* %128, i8** %11
%129 = icmp ne i8* %128, null
br i1 %129, label %130, label %135
130: ; preds = %124
%131 = load i8*, i8** %11
%132 = getelementptr inbounds i8, i8* %131, i32 1
store i8* %132, i8** %11
store i8 0, i8* %131
%133 = load i8*, i8** %11
%134 = call i32 @a_gid(i8* %133)
store i32 %134, i32* %8
br label %137
135: ; preds = %124
%136 = call i32 (...) @usage()
br label %137
137: ; preds = %135, %130
%138 = load i8**, i8*** %5
%139 = getelementptr inbounds i8*, i8** %138, i64 5
%140 = load i8*, i8** %139
%141 = call i32 @a_uid(i8* %140)
store i32 %141, i32* %7
br label %142
142: ; preds = %137, %121
%143 = load i8**, i8*** %5
%144 = getelementptr inbounds i8*, i8** %143, i64 1
%145 = load i8*, i8** %144
%146 = load i32, i32* %9
%147 = load i64, i64* %10
%148 = call i64 @mknod(i8* %145, i32 %146, i64 %147)
%149 = icmp ne i64 %148, 0
br i1 %149, label %150, label %155
150: ; preds = %142
%151 = load i8**, i8*** %5
%152 = getelementptr inbounds i8*, i8** %151, i64 1
%153 = load i8*, i8** %152
%154 = call i32 @err(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %153)
br label %155
155: ; preds = %150, %142
%156 = load i32, i32* %4
%157 = icmp eq i32 6, %156
br i1 %157, label %158, label %172
158: ; preds = %155
%159 = load i8**, i8*** %5
%160 = getelementptr inbounds i8*, i8** %159, i64 1
%161 = load i8*, i8** %160
%162 = load i32, i32* %7
%163 = load i32, i32* %8
%164 = call i64 @chown(i8* %161, i32 %162, i32 %163)
%165 = icmp ne i64 %164, 0
br i1 %165, label %166, label %171
166: ; preds = %158
%167 = load i8**, i8*** %5
%168 = getelementptr inbounds i8*, i8** %167, i64 1
%169 = load i8*, i8** %168
%170 = call i32 @err(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i8* %169)
br label %171
171: ; preds = %166, %158
br label %172
172: ; preds = %171, %155
%173 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@S_IFCHR = global i32 0
@S_IFBLK = global i32 0
@.str = [29 x i8] c"node must be type 'b' or 'c'\00"
@errno = global i32 0
@.str.1 = [29 x i8] c"%s: non-numeric major number\00"
@.str.2 = [29 x i8] c"%s: non-numeric minor number\00"
@.str.3 = [32 x i8] c"major or minor number too large\00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [24 x i8] c"setting ownership on %s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
switch i32 %0, label %5 [
i32 6, label %7
i32 5, label %7
i32 2, label %7
]
5: ; preds = %2
%6 = tail call i32 (...) @usage()
br label %7
7: ; preds = %2, %2, %2, %5
%8 = icmp sgt i32 %0, 4
br i1 %8, label %9, label %60
9: ; preds = %7
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = load i8, i8* %11
switch i8 %12, label %19 [
i8 99, label %13
i8 98, label %16
]
13: ; preds = %9
%14 = load i32, i32* @S_IFCHR
%15 = or i32 %14, 438
br label %21
16: ; preds = %9
%17 = load i32, i32* @S_IFBLK
%18 = or i32 %17, 438
br label %21
19: ; preds = %9
%20 = tail call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %21
21: ; preds = %16, %19, %13
%22 = phi i32 [ %15, %13 ], [ %18, %16 ], [ 438, %19 ]
store i32 0, i32* @errno
%23 = getelementptr inbounds i8*, i8** %1, i64 3
%24 = load i8*, i8** %23
%25 = call i64 @strtoul(i8* %24, i8** %3, i32 0)
%26 = load i8*, i8** %3
%27 = load i8*, i8** %23
%28 = icmp eq i8* %26, %27
br i1 %28, label %32, label %29
29: ; preds = %21
%30 = load i8, i8* %26
%31 = icmp eq i8 %30, 0
br i1 %31, label %34, label %32
32: ; preds = %29, %21
%33 = tail call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %27)
br label %34
34: ; preds = %32, %29
%35 = load i32, i32* @errno
store i32 0, i32* @errno
%36 = getelementptr inbounds i8*, i8** %1, i64 4
%37 = load i8*, i8** %36
%38 = call i64 @strtoul(i8* %37, i8** %3, i32 0)
%39 = load i8*, i8** %3
%40 = load i8*, i8** %36
%41 = icmp eq i8* %39, %40
br i1 %41, label %45, label %42
42: ; preds = %34
%43 = load i8, i8* %39
%44 = icmp eq i8 %43, 0
br i1 %44, label %47, label %45
45: ; preds = %42, %34
%46 = tail call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %40)
br label %47
47: ; preds = %45, %42
%48 = load i32, i32* @errno
%49 = or i32 %48, %35
%50 = tail call i64 @makedev(i64 %25, i64 %38)
%51 = icmp eq i32 %49, 0
br i1 %51, label %52, label %58
52: ; preds = %47
%53 = tail call i64 @major(i64 %50)
%54 = icmp eq i64 %53, %25
br i1 %54, label %55, label %58
55: ; preds = %52
%56 = tail call i64 @minor(i64 %50)
%57 = icmp eq i64 %56, %38
br i1 %57, label %63, label %58
58: ; preds = %55, %52, %47
%59 = tail call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
br label %63
60: ; preds = %7
%61 = load i32, i32* @S_IFCHR
%62 = or i32 %61, 438
br label %79
63: ; preds = %55, %58
%64 = icmp eq i32 %0, 6
br i1 %64, label %65, label %79
65: ; preds = %63
%66 = getelementptr inbounds i8*, i8** %1, i64 5
%67 = load i8*, i8** %66
%68 = tail call i8* @strchr(i8* dereferenceable(1) %67, i8 signext 58)
%69 = icmp eq i8* %68, null
br i1 %69, label %73, label %70
70: ; preds = %65
%71 = getelementptr inbounds i8, i8* %68, i64 1
store i8 0, i8* %68
%72 = tail call i32 @a_gid(i8* %71)
br label %75
73: ; preds = %65
%74 = tail call i32 (...) @usage()
br label %75
75: ; preds = %73, %70
%76 = phi i32 [ %72, %70 ], [ -1, %73 ]
%77 = load i8*, i8** %66
%78 = tail call i32 @a_uid(i8* %77)
br label %79
79: ; preds = %60, %75, %63
%80 = phi i1 [ true, %75 ], [ false, %63 ], [ false, %60 ]
%81 = phi i64 [ %50, %75 ], [ %50, %63 ], [ 0, %60 ]
%82 = phi i32 [ %22, %75 ], [ %22, %63 ], [ %62, %60 ]
%83 = phi i32 [ %76, %75 ], [ -1, %63 ], [ -1, %60 ]
%84 = phi i32 [ %78, %75 ], [ -1, %63 ], [ -1, %60 ]
%85 = getelementptr inbounds i8*, i8** %1, i64 1
%86 = load i8*, i8** %85
%87 = tail call i64 @mknod(i8* %86, i32 %82, i64 %81)
%88 = icmp eq i64 %87, 0
br i1 %88, label %92, label %89
89: ; preds = %79
%90 = load i8*, i8** %85
%91 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %90)
br label %92
92: ; preds = %89, %79
br i1 %80, label %93, label %100
93: ; preds = %92
%94 = load i8*, i8** %85
%95 = tail call i64 @chown(i8* %94, i32 %84, i32 %83)
%96 = icmp eq i64 %95, 0
br i1 %96, label %100, label %97
97: ; preds = %93
%98 = load i8*, i8** %85
%99 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i8* %98)
br label %100
100: ; preds = %93, %97, %92
%101 = tail call i32 @exit(i32 0)
unreachable
}