main(argc, argv) int argc;
char *argv[];
{
  int mode, major, minor;
  if (argc != 5)
    badcomm();
  if (*argv[2] != 'b' && *argv[2] != 'c')
    badcomm();
  mode = (*argv[2] == 'b' ? 060666 : 020666);
  major = atoi(argv[3]);
  minor = atoi(argv[4]);
  if (major < 0 || minor < 0)
    badcomm();
  if (mknod(argv[1], mode, (major << 8) | minor) < 0)
    perror("mknod");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x5,-0x8(%rbp)
je     1177 <main+0x27>
mov    $0x0,%al
call   1040 <badcomm@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsbl (%rax),%eax
cmp    $0x62,%eax
je     11a6 <main+0x56>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsbl (%rax),%eax
cmp    $0x63,%eax
je     11a6 <main+0x56>
mov    $0x0,%al
call   1040 <badcomm@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsbl (%rax),%edx
mov    $0x21b6,%eax
mov    $0x61b6,%ecx
cmp    $0x62,%edx
cmove  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
mov    $0x0,%al
call   1060 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
mov    $0x0,%al
call   1060 <atoi@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     11fc <main+0xac>
cmpl   $0x0,-0x1c(%rbp)
jge    1203 <main+0xb3>
mov    $0x0,%al
call   1040 <badcomm@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
shl    $0x8,%edx
or     -0x1c(%rbp),%edx
mov    $0x0,%al
call   1030 <mknod@plt>
cmp    $0x0,%eax
jge    1235 <main+0xe5>
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1050 <perror@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
cmp    $0x5,%edi
je     1166 <main+0x16>
xor    %eax,%eax
call   1040 <badcomm@plt>
mov    0x10(%r14),%rax
mov    (%rax),%al
mov    %eax,%ecx
and    $0xfe,%cl
cmp    $0x62,%cl
je     1183 <main+0x33>
xor    %eax,%eax
call   1040 <badcomm@plt>
mov    0x10(%r14),%rax
mov    (%rax),%al
xor    %ebp,%ebp
cmp    $0x62,%al
sete   %bpl
shl    $0xe,%ebp
or     $0x21b6,%ebp
mov    0x18(%r14),%rdi
xor    %eax,%eax
call   1060 <atoi@plt>
mov    %eax,%ebx
mov    0x20(%r14),%rdi
xor    %eax,%eax
call   1060 <atoi@plt>
mov    %eax,%r15d
test   %ebx,%ebx
js     11b8 <main+0x68>
test   %r15d,%r15d
jns    11bf <main+0x6f>
xor    %eax,%eax
call   1040 <badcomm@plt>
mov    0x8(%r14),%rdi
shl    $0x8,%ebx
or     %ebx,%r15d
mov    %ebp,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1030 <mknod@plt>
test   %eax,%eax
jns    11e7 <main+0x97>
lea    0xe20(%rip),%rdi
xor    %eax,%eax
call   1050 <perror@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"mknod\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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 5
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @badcomm()
br label %13
13: ; preds = %11, %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 98
br i1 %19, label %20, label %29
20: ; preds = %13
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 2
%23 = load i8*, i8** %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %25, 99
br i1 %26, label %27, label %29
27: ; preds = %20
%28 = call i32 (...) @badcomm()
br label %29
29: ; preds = %27, %20, %13
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 2
%32 = load i8*, i8** %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 98
%36 = zext i1 %35 to i64
%37 = select i1 %35, i32 25014, i32 8630
store i32 %37, i32* %6
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 3
%40 = load i8*, i8** %39
%41 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %40)
store i32 %41, i32* %7
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 4
%44 = load i8*, i8** %43
%45 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %44)
store i32 %45, i32* %8
%46 = load i32, i32* %7
%47 = icmp slt i32 %46, 0
br i1 %47, label %51, label %48
48: ; preds = %29
%49 = load i32, i32* %8
%50 = icmp slt i32 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %48, %29
%52 = call i32 (...) @badcomm()
br label %53
53: ; preds = %51, %48
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 1
%56 = load i8*, i8** %55
%57 = load i32, i32* %6
%58 = load i32, i32* %7
%59 = shl i32 %58, 8
%60 = load i32, i32* %8
%61 = or i32 %59, %60
%62 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @mknod to i32 (i8*, i32, i32, ...)*)(i8* %56, i32 %57, i32 %61)
%63 = icmp slt i32 %62, 0
br i1 %63, label %64, label %66
64: ; preds = %53
%65 = call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %66
66: ; preds = %64, %53
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"mknod\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 5
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @badcomm()
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = load i8, i8* %8
%10 = and i8 %9, -2
%11 = icmp eq i8 %10, 98
br i1 %11, label %16, label %12
12: ; preds = %6
%13 = tail call i32 (...) @badcomm()
%14 = load i8*, i8** %7
%15 = load i8, i8* %14
br label %16
16: ; preds = %6, %12
%17 = phi i8 [ %9, %6 ], [ %15, %12 ]
%18 = icmp eq i8 %17, 98
%19 = select i1 %18, i32 25014, i32 8630
%20 = getelementptr inbounds i8*, i8** %1, i64 3
%21 = load i8*, i8** %20
%22 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %21)
%23 = getelementptr inbounds i8*, i8** %1, i64 4
%24 = load i8*, i8** %23
%25 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %24)
%26 = icmp slt i32 %22, 0
%27 = icmp slt i32 %25, 0
%28 = select i1 %26, i1 true, i1 %27
br i1 %28, label %29, label %31
29: ; preds = %16
%30 = tail call i32 (...) @badcomm()
br label %31
31: ; preds = %16, %29
%32 = getelementptr inbounds i8*, i8** %1, i64 1
%33 = load i8*, i8** %32
%34 = shl i32 %22, 8
%35 = or i32 %25, %34
%36 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @mknod to i32 (i8*, i32, i32, ...)*)(i8* %33, i32 %19, i32 %35)
%37 = icmp slt i32 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %31
%39 = tail call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %40
40: ; preds = %38, %31
tail call void @exit(i32 0)
unreachable
}