#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 stat {
  int st_rdev;
  int /*<<< orphan*/ st_mode;
};
typedef int dev_t;

/* Variables and functions */
scalar_t__ S_ISBLK(int /*<<< orphan*/);
char *alloca(size_t);
scalar_t__ isdigit(char);
int makedev(unsigned int, unsigned int);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
int /*<<< orphan*/ stat(char const *, struct stat *);
char *strchr(char const *, char);
int /*<<< orphan*/ strcmp(char const *, char *);
int strlen(char const *);
scalar_t__ strncmp(char const *, char *, int);
void *strtoul(char const *, char **, int);
int try_name(char *, size_t);
dev_t name_to_dev_t_real(const char *name) {
  char *p;
  dev_t res = 0;
  char *s;
  struct stat st;
  size_t part, len;
  const char *devname;
  char *cptr, *e1, *e2;
  unsigned long int major_num, minor_num;
  if (strchr(name, ','))
    return ((((0) & 0xfff) << 8) | ((253) & 0xff) | (((253) & 0xfff00) << 12));
  if (name[0] == '/') {
    devname = name;
  } else {
    char *dname = alloca(strlen(name) + 6);
    sprintf(dname, "/dev/%s", name);
    devname = dname;
  }
  if (!stat(devname, &st) && S_ISBLK(st.st_mode))
    return st.st_rdev;
  if (strncmp(name, "/dev/", 5)) {
    cptr = strchr(devname + 5, ':');
    if (cptr && cptr[1] != '\0') {
      *cptr = '\0';
      major_num = strtoul(devname + 5, &e1, 10);
      minor_num = strtoul(cptr + 1, &e2, 10);
      if (!*e1 && !*e2)
        return makedev((unsigned int)major_num, (unsigned int)minor_num);
      *cptr = ':';
    } else {
      res = (dev_t)strtoul(name, &p, 16);
      if (!*p)
        return res;
    }
  } else {
    name += 5;
  }
  if (!strcmp(name, "nfs"))
    return ((((0) & 0xfff) << 8) | ((255) & 0xff) | (((255) & 0xfff00) << 12));
  if (!strcmp(name, "ram"))
    return ((((1) & 0xfff) << 8) | ((0) & 0xff) | (((0) & 0xfff00) << 12));
  if (!strncmp(name, "mtd", 3))
    return ((((0) & 0xfff) << 8) | ((254) & 0xff) | (((254) & 0xfff00) << 12));
  len = strlen(name);
  s = alloca(len + 1);
  memcpy(s, name, len + 1);
  for (p = s; *p; p++)
    if (*p == '/')
      *p = '!';
  res = try_name(s, 0);
  if (res)
    return res;
  while (p > s && isdigit(p[-1]))
    p--;
  if (p == s || !*p || *p == '0')
    goto fail;
  part = strtoul(p, NULL, 10);
  *p = '\0';
  res = try_name(s, part);
  if (res)
    return res;
  if (p < s + 2 || !isdigit(p[-2]) || p[-1] != 'p')
    goto fail;
  p[-1] = '\0';
  res = try_name(s, part);
  return res;
fail:
  return (dev_t)0;
}


x86 assembly (clang, -O0):
<name_to_dev_t_real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2c,%esi
call   1060 <strchr@plt>
cmp    $0x0,%rax
je     120a <name_to_dev_t_real+0x3a>
movl   $0xfd,-0x4(%rbp)
jmp    15db <name_to_dev_t_real+0x40b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1227 <name_to_dev_t_real+0x57>
mov    -0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
jmp    125b <name_to_dev_t_real+0x8b>
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
add    $0x6,%eax
movslq %eax,%rdi
call   1080 <alloca@plt>
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xdb2(%rip),%rsi
call   10f0 <sprintf@plt>
mov    -0x78(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1090 <stat@plt>
cmp    $0x0,%eax
jne    128e <name_to_dev_t_real+0xbe>
mov    -0x2c(%rbp),%edi
call   10b0 <S_ISBLK@plt>
cmp    $0x0,%rax
je     128e <name_to_dev_t_real+0xbe>
mov    -0x30(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    15db <name_to_dev_t_real+0x40b>
mov    -0x10(%rbp),%rdi
lea    0xd6f(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1390 <name_to_dev_t_real+0x1c0>
mov    -0x48(%rbp),%rdi
add    $0x5,%rdi
mov    $0x3a,%esi
call   1060 <strchr@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
je     1359 <name_to_dev_t_real+0x189>
mov    -0x50(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     1359 <name_to_dev_t_real+0x189>
mov    -0x50(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x48(%rbp),%rdi
add    $0x5,%rdi
lea    -0x58(%rbp),%rsi
mov    $0xa,%edx
call   10d0 <strtoul@plt>
mov    %rax,-0x68(%rbp)
mov    -0x50(%rbp),%rdi
add    $0x1,%rdi
lea    -0x60(%rbp),%rsi
mov    $0xa,%edx
call   10d0 <strtoul@plt>
mov    %rax,-0x70(%rbp)
mov    -0x58(%rbp),%rax
cmpb   $0x0,(%rax)
jne    134d <name_to_dev_t_real+0x17d>
mov    -0x60(%rbp),%rax
cmpb   $0x0,(%rax)
jne    134d <name_to_dev_t_real+0x17d>
mov    -0x68(%rbp),%rax
mov    %eax,%edi
mov    -0x70(%rbp),%rax
mov    %eax,%esi
call   10c0 <makedev@plt>
mov    %eax,-0x4(%rbp)
jmp    15db <name_to_dev_t_real+0x40b>
mov    -0x50(%rbp),%rax
movb   $0x3a,(%rax)
jmp    138b <name_to_dev_t_real+0x1bb>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x10,%edx
call   10d0 <strtoul@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1386 <name_to_dev_t_real+0x1b6>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    15db <name_to_dev_t_real+0x40b>
jmp    138b <name_to_dev_t_real+0x1bb>
jmp    139c <name_to_dev_t_real+0x1cc>
mov    -0x10(%rbp),%rax
add    $0x5,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xc67(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    13c1 <name_to_dev_t_real+0x1f1>
movl   $0xff,-0x4(%rbp)
jmp    15db <name_to_dev_t_real+0x40b>
mov    -0x10(%rbp),%rdi
lea    0xc46(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    13e6 <name_to_dev_t_real+0x216>
movl   $0x100,-0x4(%rbp)
jmp    15db <name_to_dev_t_real+0x40b>
mov    -0x10(%rbp),%rdi
lea    0xc25(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1411 <name_to_dev_t_real+0x241>
movl   $0xfe,-0x4(%rbp)
jmp    15db <name_to_dev_t_real+0x40b>
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
cltq
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
add    $0x1,%rdi
call   1080 <alloca@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x40(%rbp),%rdx
add    $0x1,%rdx
call   10a0 <memcpy@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1488 <name_to_dev_t_real+0x2b8>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1472 <name_to_dev_t_real+0x2a2>
mov    -0x18(%rbp),%rax
movb   $0x21,(%rax)
jmp    1477 <name_to_dev_t_real+0x2a7>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    144e <name_to_dev_t_real+0x27e>
mov    -0x28(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   10e0 <try_name@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     14ad <name_to_dev_t_real+0x2dd>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    15db <name_to_dev_t_real+0x40b>
jmp    14b2 <name_to_dev_t_real+0x2e2>
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x28(%rbp),%rcx
mov    %al,-0x79(%rbp)
jbe    14dc <name_to_dev_t_real+0x30c>
mov    -0x18(%rbp),%rax
movsbl -0x1(%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x79(%rbp)
mov    -0x79(%rbp),%al
test   $0x1,%al
jne    14ec <name_to_dev_t_real+0x31c>
jmp    14fd <name_to_dev_t_real+0x32d>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    14b2 <name_to_dev_t_real+0x2e2>
mov    -0x18(%rbp),%rax
cmp    -0x28(%rbp),%rax
je     1528 <name_to_dev_t_real+0x358>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1528 <name_to_dev_t_real+0x358>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    152d <name_to_dev_t_real+0x35d>
jmp    15d4 <name_to_dev_t_real+0x404>
mov    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   10d0 <strtoul@plt>
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x28(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   10e0 <try_name@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     156f <name_to_dev_t_real+0x39f>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    15db <name_to_dev_t_real+0x40b>
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
add    $0x2,%rcx
cmp    %rcx,%rax
jb     15ac <name_to_dev_t_real+0x3dc>
mov    -0x18(%rbp),%rax
movsbl -0x2(%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
je     15ac <name_to_dev_t_real+0x3dc>
mov    -0x18(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x70,%eax
je     15b1 <name_to_dev_t_real+0x3e1>
jmp    15d4 <name_to_dev_t_real+0x404>
mov    -0x18(%rbp),%rax
movb   $0x0,-0x1(%rax)
mov    -0x28(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   10e0 <try_name@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    15db <name_to_dev_t_real+0x40b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<name_to_dev_t_real>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%r14
mov    $0x2c,%esi
call   1060 <strchr@plt>
mov    %rax,%rcx
mov    $0xfd,%eax
test   %rcx,%rcx
je     1201 <name_to_dev_t_real+0x31>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
cmpb   $0x2f,(%r14)
mov    %r14,%rbx
je     1232 <name_to_dev_t_real+0x62>
mov    %r14,%rdi
call   1050 <strlen@plt>
add    $0x6,%eax
movslq %eax,%rdi
call   1080 <alloca@plt>
mov    %rax,%rbx
lea    0xdd9(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   10f0 <sprintf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1090 <stat@plt>
test   %eax,%eax
je     12d3 <name_to_dev_t_real+0x103>
lea    0xdba(%rip),%rsi
mov    %r14,%rdi
mov    $0x5,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     130f <name_to_dev_t_real+0x13f>
add    $0x5,%rbx
mov    %rbx,%rdi
mov    $0x3a,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     12ee <name_to_dev_t_real+0x11e>
mov    %rax,%r15
cmpb   $0x0,0x1(%rax)
je     12ee <name_to_dev_t_real+0x11e>
mov    %r15,%r12
add    $0x1,%r12
movb   $0x0,(%r15)
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
mov    $0xa,%edx
call   10d0 <strtoul@plt>
mov    %rax,%rbx
lea    0x18(%rsp),%rsi
mov    %r12,%rdi
mov    $0xa,%edx
call   10d0 <strtoul@plt>
mov    0x20(%rsp),%rcx
cmpb   $0x0,(%rcx)
jne    12cd <name_to_dev_t_real+0xfd>
mov    0x18(%rsp),%rcx
cmpb   $0x0,(%rcx)
je     141c <name_to_dev_t_real+0x24c>
movb   $0x3a,(%r15)
jmp    1313 <name_to_dev_t_real+0x143>
mov    0x14(%rsp),%edi
call   10b0 <S_ISBLK@plt>
test   %rax,%rax
je     1247 <name_to_dev_t_real+0x77>
mov    0x10(%rsp),%eax
jmp    11f5 <name_to_dev_t_real+0x25>
lea    0x8(%rsp),%rsi
mov    %r14,%rdi
mov    $0x10,%edx
call   10d0 <strtoul@plt>
mov    0x8(%rsp),%rcx
cmpb   $0x0,(%rcx)
jne    1313 <name_to_dev_t_real+0x143>
jmp    11f5 <name_to_dev_t_real+0x25>
add    $0x5,%r14
lea    0xcf4(%rip),%rsi
mov    %r14,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     13fe <name_to_dev_t_real+0x22e>
lea    0xce1(%rip),%rsi
mov    %r14,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1408 <name_to_dev_t_real+0x238>
lea    0xcce(%rip),%rsi
mov    %r14,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1412 <name_to_dev_t_real+0x242>
mov    %r14,%rdi
call   1050 <strlen@plt>
movslq %eax,%r15
add    $0x1,%r15
mov    %r15,%rdi
call   1080 <alloca@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   10a0 <memcpy@plt>
xor    %ebx,%ebx
jmp    1399 <name_to_dev_t_real+0x1c9>
nopw   0x0(%rax,%rax,1)
movb   $0x21,(%r12,%rbx,1)
add    $0x1,%rbx
movzbl (%r12,%rbx,1),%eax
cmp    $0x2f,%al
je     1390 <name_to_dev_t_real+0x1c0>
test   %al,%al
jne    1395 <name_to_dev_t_real+0x1c5>
mov    %r12,%rdi
xor    %esi,%esi
call   10e0 <try_name@plt>
test   %eax,%eax
jne    11f5 <name_to_dev_t_real+0x25>
test   %rbx,%rbx
je     1430 <name_to_dev_t_real+0x260>
lea    0x1(%rbx),%r14
neg    %rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl -0x2(%r12,%r14,1),%edi
call   1040 <isdigit@plt>
test   %rax,%rax
je     143f <name_to_dev_t_real+0x26f>
add    $0x1,%rbx
add    $0xffffffffffffffff,%r14
cmp    $0x2,%r14
jge    13d0 <name_to_dev_t_real+0x200>
test   %rbx,%rbx
je     1438 <name_to_dev_t_real+0x268>
mov    %r12,%r14
sub    %rbx,%r14
neg    %rbx
jmp    144d <name_to_dev_t_real+0x27d>
mov    $0xff,%eax
jmp    11f5 <name_to_dev_t_real+0x25>
mov    $0x100,%eax
jmp    11f5 <name_to_dev_t_real+0x25>
mov    $0xfe,%eax
jmp    11f5 <name_to_dev_t_real+0x25>
mov    %ebx,%edi
mov    %eax,%esi
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    10c0 <makedev@plt>
add    %rbx,%r12
mov    %r12,0x8(%rsp)
xor    %eax,%eax
jmp    11f5 <name_to_dev_t_real+0x25>
mov    %r12,%r14
sub    %rbx,%r14
neg    %rbx
mov    %r14,0x8(%rsp)
mov    (%r14),%cl
xor    %eax,%eax
test   %cl,%cl
je     11f5 <name_to_dev_t_real+0x25>
cmp    $0x30,%cl
je     11f5 <name_to_dev_t_real+0x25>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   10d0 <strtoul@plt>
mov    %rax,%r15
movb   $0x0,(%r14)
mov    %r12,%rdi
mov    %rax,%rsi
call   10e0 <try_name@plt>
test   %eax,%eax
jne    11f5 <name_to_dev_t_real+0x25>
cmp    $0x2,%rbx
jl     1438 <name_to_dev_t_real+0x268>
movsbl -0x2(%r14),%edi
call   1040 <isdigit@plt>
test   %rax,%rax
je     1438 <name_to_dev_t_real+0x268>
cmpb   $0x70,-0x1(%r14)
mov    $0x0,%eax
jne    11f5 <name_to_dev_t_real+0x25>
movb   $0x0,-0x1(%r14)
mov    %r12,%rdi
mov    %r15,%rsi
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    10e0 <try_name@plt>

LLVM IR (-O0):
%struct.stat = type { i32, i32 }
@.str = [8 x i8] c"/dev/%s\00"
@.str.1 = [6 x i8] c"/dev/\00"
@.str.2 = [4 x i8] c"nfs\00"
@.str.3 = [4 x i8] c"ram\00"
@.str.4 = [4 x i8] c"mtd\00"
define i32 @name_to_dev_t_real(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca %struct.stat
%8 = alloca i64
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i64
%15 = alloca i64
%16 = alloca i8*
store i8* %0, i8** %3
store i32 0, i32* %5
%17 = load i8*, i8** %3
%18 = call i8* @strchr(i8* %17, i8 signext 44)
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %21
20: ; preds = %1
store i32 253, i32* %2
br label %224
21: ; preds = %1
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 47
br i1 %26, label %27, label %29
27: ; preds = %21
%28 = load i8*, i8** %3
store i8* %28, i8** %10
br label %39
29: ; preds = %21
%30 = load i8*, i8** %3
%31 = call i32 @strlen(i8* %30)
%32 = add nsw i32 %31, 6
%33 = sext i32 %32 to i64
%34 = call i8* @alloca(i64 %33)
store i8* %34, i8** %16
%35 = load i8*, i8** %16
%36 = load i8*, i8** %3
%37 = call i32 @sprintf(i8* %35, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %36)
%38 = load i8*, i8** %16
store i8* %38, i8** %10
br label %39
39: ; preds = %29, %27
%40 = load i8*, i8** %10
%41 = call i32 @stat(i8* %40, %struct.stat* %7)
%42 = icmp ne i32 %41, 0
br i1 %42, label %51, label %43
43: ; preds = %39
%44 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 1
%45 = load i32, i32* %44
%46 = call i64 @S_ISBLK(i32 %45)
%47 = icmp ne i64 %46, 0
br i1 %47, label %48, label %51
48: ; preds = %43
%49 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%50 = load i32, i32* %49
store i32 %50, i32* %2
br label %224
51: ; preds = %43, %39
%52 = load i8*, i8** %3
%53 = call i64 @strncmp(i8* %52, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
%54 = icmp ne i64 %53, 0
br i1 %54, label %55, label %103
55: ; preds = %51
%56 = load i8*, i8** %10
%57 = getelementptr inbounds i8, i8* %56, i64 5
%58 = call i8* @strchr(i8* %57, i8 signext 58)
store i8* %58, i8** %11
%59 = load i8*, i8** %11
%60 = icmp ne i8* %59, null
br i1 %60, label %61, label %92
61: ; preds = %55
%62 = load i8*, i8** %11
%63 = getelementptr inbounds i8, i8* %62, i64 1
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp ne i32 %65, 0
br i1 %66, label %67, label %92
67: ; preds = %61
%68 = load i8*, i8** %11
store i8 0, i8* %68
%69 = load i8*, i8** %10
%70 = getelementptr inbounds i8, i8* %69, i64 5
%71 = call i8* @strtoul(i8* %70, i8** %12, i32 10)
%72 = ptrtoint i8* %71 to i64
store i64 %72, i64* %14
%73 = load i8*, i8** %11
%74 = getelementptr inbounds i8, i8* %73, i64 1
%75 = call i8* @strtoul(i8* %74, i8** %13, i32 10)
%76 = ptrtoint i8* %75 to i64
store i64 %76, i64* %15
%77 = load i8*, i8** %12
%78 = load i8, i8* %77
%79 = icmp ne i8 %78, 0
br i1 %79, label %90, label %80
80: ; preds = %67
%81 = load i8*, i8** %13
%82 = load i8, i8* %81
%83 = icmp ne i8 %82, 0
br i1 %83, label %90, label %84
84: ; preds = %80
%85 = load i64, i64* %14
%86 = trunc i64 %85 to i32
%87 = load i64, i64* %15
%88 = trunc i64 %87 to i32
%89 = call i32 @makedev(i32 %86, i32 %88)
store i32 %89, i32* %2
br label %224
90: ; preds = %80, %67
%91 = load i8*, i8** %11
store i8 58, i8* %91
br label %102
92: ; preds = %61, %55
%93 = load i8*, i8** %3
%94 = call i8* @strtoul(i8* %93, i8** %4, i32 16)
%95 = ptrtoint i8* %94 to i32
store i32 %95, i32* %5
%96 = load i8*, i8** %4
%97 = load i8, i8* %96
%98 = icmp ne i8 %97, 0
br i1 %98, label %101, label %99
99: ; preds = %92
%100 = load i32, i32* %5
store i32 %100, i32* %2
br label %224
101: ; preds = %92
br label %102
102: ; preds = %101, %90
br label %106
103: ; preds = %51
%104 = load i8*, i8** %3
%105 = getelementptr inbounds i8, i8* %104, i64 5
store i8* %105, i8** %3
br label %106
106: ; preds = %103, %102
%107 = load i8*, i8** %3
%108 = call i32 @strcmp(i8* %107, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%109 = icmp ne i32 %108, 0
br i1 %109, label %111, label %110
110: ; preds = %106
store i32 255, i32* %2
br label %224
111: ; preds = %106
%112 = load i8*, i8** %3
%113 = call i32 @strcmp(i8* %112, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%114 = icmp ne i32 %113, 0
br i1 %114, label %116, label %115
115: ; preds = %111
store i32 256, i32* %2
br label %224
116: ; preds = %111
%117 = load i8*, i8** %3
%118 = call i64 @strncmp(i8* %117, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 3)
%119 = icmp ne i64 %118, 0
br i1 %119, label %121, label %120
120: ; preds = %116
store i32 254, i32* %2
br label %224
121: ; preds = %116
%122 = load i8*, i8** %3
%123 = call i32 @strlen(i8* %122)
%124 = sext i32 %123 to i64
store i64 %124, i64* %9
%125 = load i64, i64* %9
%126 = add i64 %125, 1
%127 = call i8* @alloca(i64 %126)
store i8* %127, i8** %6
%128 = load i8*, i8** %6
%129 = load i8*, i8** %3
%130 = load i64, i64* %9
%131 = add i64 %130, 1
%132 = call i32 @memcpy(i8* %128, i8* %129, i64 %131)
%133 = load i8*, i8** %6
store i8* %133, i8** %4
br label %134
134: ; preds = %146, %121
%135 = load i8*, i8** %4
%136 = load i8, i8* %135
%137 = icmp ne i8 %136, 0
br i1 %137, label %138, label %149
138: ; preds = %134
%139 = load i8*, i8** %4
%140 = load i8, i8* %139
%141 = sext i8 %140 to i32
%142 = icmp eq i32 %141, 47
br i1 %142, label %143, label %145
143: ; preds = %138
%144 = load i8*, i8** %4
store i8 33, i8* %144
br label %145
145: ; preds = %143, %138
br label %146
146: ; preds = %145
%147 = load i8*, i8** %4
%148 = getelementptr inbounds i8, i8* %147, i32 1
store i8* %148, i8** %4
br label %134
149: ; preds = %134
%150 = load i8*, i8** %6
%151 = call i32 @try_name(i8* %150, i64 0)
store i32 %151, i32* %5
%152 = load i32, i32* %5
%153 = icmp ne i32 %152, 0
br i1 %153, label %154, label %156
154: ; preds = %149
%155 = load i32, i32* %5
store i32 %155, i32* %2
br label %224
156: ; preds = %149
br label %157
157: ; preds = %169, %156
%158 = load i8*, i8** %4
%159 = load i8*, i8** %6
%160 = icmp ugt i8* %158, %159
br i1 %160, label %161, label %167
161: ; preds = %157
%162 = load i8*, i8** %4
%163 = getelementptr inbounds i8, i8* %162, i64 -1
%164 = load i8, i8* %163
%165 = call i64 @isdigit(i8 signext %164)
%166 = icmp ne i64 %165, 0
br label %167
167: ; preds = %161, %157
%168 = phi i1 [ false, %157 ], [ %166, %161 ]
br i1 %168, label %169, label %172
169: ; preds = %167
%170 = load i8*, i8** %4
%171 = getelementptr inbounds i8, i8* %170, i32 -1
store i8* %171, i8** %4
br label %157
172: ; preds = %167
%173 = load i8*, i8** %4
%174 = load i8*, i8** %6
%175 = icmp eq i8* %173, %174
br i1 %175, label %185, label %176
176: ; preds = %172
%177 = load i8*, i8** %4
%178 = load i8, i8* %177
%179 = icmp ne i8 %178, 0
br i1 %179, label %180, label %185
180: ; preds = %176
%181 = load i8*, i8** %4
%182 = load i8, i8* %181
%183 = sext i8 %182 to i32
%184 = icmp eq i32 %183, 48
br i1 %184, label %185, label %186
185: ; preds = %180, %176, %172
br label %223
186: ; preds = %180
%187 = load i8*, i8** %4
%188 = call i8* @strtoul(i8* %187, i8** null, i32 10)
%189 = ptrtoint i8* %188 to i64
store i64 %189, i64* %8
%190 = load i8*, i8** %4
store i8 0, i8* %190
%191 = load i8*, i8** %6
%192 = load i64, i64* %8
%193 = call i32 @try_name(i8* %191, i64 %192)
store i32 %193, i32* %5
%194 = load i32, i32* %5
%195 = icmp ne i32 %194, 0
br i1 %195, label %196, label %198
196: ; preds = %186
%197 = load i32, i32* %5
store i32 %197, i32* %2
br label %224
198: ; preds = %186
%199 = load i8*, i8** %4
%200 = load i8*, i8** %6
%201 = getelementptr inbounds i8, i8* %200, i64 2
%202 = icmp ult i8* %199, %201
br i1 %202, label %215, label %203
203: ; preds = %198
%204 = load i8*, i8** %4
%205 = getelementptr inbounds i8, i8* %204, i64 -2
%206 = load i8, i8* %205
%207 = call i64 @isdigit(i8 signext %206)
%208 = icmp ne i64 %207, 0
br i1 %208, label %209, label %215
209: ; preds = %203
%210 = load i8*, i8** %4
%211 = getelementptr inbounds i8, i8* %210, i64 -1
%212 = load i8, i8* %211
%213 = sext i8 %212 to i32
%214 = icmp ne i32 %213, 112
br i1 %214, label %215, label %216
215: ; preds = %209, %203, %198
br label %223
216: ; preds = %209
%217 = load i8*, i8** %4
%218 = getelementptr inbounds i8, i8* %217, i64 -1
store i8 0, i8* %218
%219 = load i8*, i8** %6
%220 = load i64, i64* %8
%221 = call i32 @try_name(i8* %219, i64 %220)
store i32 %221, i32* %5
%222 = load i32, i32* %5
store i32 %222, i32* %2
br label %224
223: ; preds = %215, %185
store i32 0, i32* %2
br label %224
224: ; preds = %223, %216, %196, %154, %120, %115, %110, %99, %84, %48, %20
%225 = load i32, i32* %2
ret i32 %225
}

LLVM IR (-O2):
%struct.stat = type { i32, i32 }
@.str = [8 x i8] c"/dev/%s\00"
@.str.1 = [6 x i8] c"/dev/\00"
@.str.2 = [4 x i8] c"nfs\00"
@.str.3 = [4 x i8] c"ram\00"
@.str.4 = [4 x i8] c"mtd\00"
define i32 @name_to_dev_t_real(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
%4 = alloca i8*
%5 = alloca i8*
%6 = bitcast i8** %2 to i8*
%7 = bitcast %struct.stat* %3 to i8*
%8 = bitcast i8** %4 to i8*
%9 = bitcast i8** %5 to i8*
%10 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 44)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %137
12: ; preds = %1
%13 = load i8, i8* %0
%14 = icmp eq i8 %13, 47
br i1 %14, label %21, label %15
15: ; preds = %12
%16 = tail call i32 @strlen(i8* %0)
%17 = add nsw i32 %16, 6
%18 = sext i32 %17 to i64
%19 = tail call i8* @alloca(i64 %18)
%20 = tail call i32 @sprintf(i8* dereferenceable(1) %19, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %21
21: ; preds = %12, %15
%22 = phi i8* [ %19, %15 ], [ %0, %12 ]
%23 = call i32 @stat(i8* %22, %struct.stat* %3)
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %33
25: ; preds = %21
%26 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 1
%27 = load i32, i32* %26
%28 = tail call i64 @S_ISBLK(i32 %27)
%29 = icmp eq i64 %28, 0
br i1 %29, label %33, label %30
30: ; preds = %25
%31 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%32 = load i32, i32* %31
br label %137
33: ; preds = %25, %21
%34 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
%35 = icmp eq i64 %34, 0
br i1 %35, label %69, label %36
36: ; preds = %33
%37 = getelementptr inbounds i8, i8* %22, i64 5
%38 = tail call i8* @strchr(i8* %37, i8 signext 58)
%39 = icmp eq i8* %38, null
br i1 %39, label %61, label %40
40: ; preds = %36
%41 = getelementptr inbounds i8, i8* %38, i64 1
%42 = load i8, i8* %41
%43 = icmp eq i8 %42, 0
br i1 %43, label %61, label %44
44: ; preds = %40
store i8 0, i8* %38
%45 = call i8* @strtoul(i8* %37, i8** %4, i32 10)
%46 = ptrtoint i8* %45 to i64
%47 = call i8* @strtoul(i8* %41, i8** %5, i32 10)
%48 = ptrtoint i8* %47 to i64
%49 = load i8*, i8** %4
%50 = load i8, i8* %49
%51 = icmp eq i8 %50, 0
br i1 %51, label %52, label %60
52: ; preds = %44
%53 = load i8*, i8** %5
%54 = load i8, i8* %53
%55 = icmp eq i8 %54, 0
br i1 %55, label %56, label %60
56: ; preds = %52
%57 = trunc i64 %46 to i32
%58 = trunc i64 %48 to i32
%59 = tail call i32 @makedev(i32 %57, i32 %58)
br label %137
60: ; preds = %52, %44
store i8 58, i8* %38
br label %71
61: ; preds = %40, %36
%62 = call i8* @strtoul(i8* %0, i8** %2, i32 16)
%63 = load i8*, i8** %2
%64 = load i8, i8* %63
%65 = icmp eq i8 %64, 0
br i1 %65, label %66, label %71
66: ; preds = %61
%67 = ptrtoint i8* %62 to i64
%68 = trunc i64 %67 to i32
br label %137
69: ; preds = %33
%70 = getelementptr inbounds i8, i8* %0, i64 5
br label %71
71: ; preds = %60, %61, %69
%72 = phi i8* [ %0, %60 ], [ %0, %61 ], [ %70, %69 ]
%73 = tail call i32 @strcmp(i8* %72, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%74 = icmp eq i32 %73, 0
br i1 %74, label %137, label %75
75: ; preds = %71
%76 = tail call i32 @strcmp(i8* %72, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%77 = icmp eq i32 %76, 0
br i1 %77, label %137, label %78
78: ; preds = %75
%79 = tail call i64 @strncmp(i8* %72, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 3)
%80 = icmp eq i64 %79, 0
br i1 %80, label %137, label %81
81: ; preds = %78
%82 = tail call i32 @strlen(i8* %72)
%83 = sext i32 %82 to i64
%84 = add nsw i64 %83, 1
%85 = tail call i8* @alloca(i64 %84)
%86 = tail call i32 @memcpy(i8* %85, i8* %72, i64 %84)
br label %87
87: ; preds = %92, %81
%88 = phi i64 [ 0, %81 ], [ %93, %92 ]
%89 = getelementptr inbounds i8, i8* %85, i64 %88
%90 = load i8, i8* %89
switch i8 %90, label %92 [
i8 0, label %94
i8 47, label %91
]
91: ; preds = %87
store i8 33, i8* %89
br label %92
92: ; preds = %87, %91
%93 = add nuw nsw i64 %88, 1
br label %87
94: ; preds = %87
%95 = tail call i32 @try_name(i8* %85, i64 0)
%96 = icmp eq i32 %95, 0
br i1 %96, label %97, label %137
97: ; preds = %94
%98 = icmp eq i64 %88, 0
br i1 %98, label %99, label %103
99: ; preds = %97
%100 = getelementptr inbounds i8, i8* %85, i64 %88
store i8* %100, i8** %2
br label %137
101: ; preds = %103
%102 = icmp sgt i64 %104, 1
br i1 %102, label %103, label %112
103: ; preds = %97, %101
%104 = phi i64 [ %105, %101 ], [ %88, %97 ]
%105 = add nsw i64 %104, -1
%106 = getelementptr inbounds i8, i8* %85, i64 %105
%107 = load i8, i8* %106
%108 = tail call i64 @isdigit(i8 signext %107)
%109 = icmp eq i64 %108, 0
br i1 %109, label %110, label %101
110: ; preds = %103
%111 = getelementptr inbounds i8, i8* %85, i64 %104
store i8* %111, i8** %2
br label %115
112: ; preds = %101
%113 = getelementptr inbounds i8, i8* %85, i64 %105
%114 = icmp eq i64 %105, 0
br i1 %114, label %137, label %115
115: ; preds = %110, %112
%116 = phi i8* [ %111, %110 ], [ %113, %112 ]
%117 = phi i64 [ %104, %110 ], [ %105, %112 ]
%118 = load i8, i8* %116
switch i8 %118, label %119 [
i8 0, label %137
i8 48, label %137
]
119: ; preds = %115
%120 = tail call i8* @strtoul(i8* nocapture %116, i8** null, i32 10)
%121 = ptrtoint i8* %120 to i64
store i8 0, i8* %116
%122 = tail call i32 @try_name(i8* %85, i64 %121)
%123 = icmp eq i32 %122, 0
br i1 %123, label %124, label %137
124: ; preds = %119
%125 = icmp slt i64 %117, 2
br i1 %125, label %137, label %126
126: ; preds = %124
%127 = getelementptr inbounds i8, i8* %116, i64 -2
%128 = load i8, i8* %127
%129 = tail call i64 @isdigit(i8 signext %128)
%130 = icmp eq i64 %129, 0
br i1 %130, label %137, label %131
131: ; preds = %126
%132 = getelementptr inbounds i8, i8* %116, i64 -1
%133 = load i8, i8* %132
%134 = icmp eq i8 %133, 112
br i1 %134, label %135, label %137
135: ; preds = %131
store i8 0, i8* %132
%136 = tail call i32 @try_name(i8* %85, i64 %121)
br label %137
137: ; preds = %99, %112, %131, %126, %124, %115, %115, %119, %94, %78, %75, %71, %1, %135, %66, %56, %30
%138 = phi i32 [ %136, %135 ], [ %59, %56 ], [ %68, %66 ], [ %32, %30 ], [ 253, %1 ], [ 255, %71 ], [ 256, %75 ], [ 254, %78 ], [ %95, %94 ], [ %122, %119 ], [ 0, %115 ], [ 0, %115 ], [ 0, %124 ], [ 0, %126 ], [ 0, %131 ], [ 0, %112 ], [ 0, %99 ]
ret i32 %138
}