#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 */
int /*<<< orphan*/ isdigit(char);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int ffinttyp(char *cval, int *dtype, int *negative, int *status) {
  int ii, len;
  char *p;
  if (*status > 0)
    return (*status);
  *dtype = 0;
  p = cval;
  if (*p == '+') {
    p++;
  } else if (*p == '-') {
    p++;
    *negative = 1;
  }
  if (*p == '0') {
    while (*p == '0')
      p++;
    if (*p == 0) {
      *dtype = 12;
      return (*status);
    }
  }
  len = strlen(p);
  for (ii = 0; ii < len; ii++) {
    if (!isdigit(*(p + ii))) {
      *status = 403;
      return (*status);
    }
  }
  if (len == 0) {
    *status = 204;
  } else if (len < 3) {
    *dtype = 12;
  } else if (len == 4) {
    *dtype = 21;
  } else if (len > 5 && len < 10) {
    *dtype = 31;
  } else if (len > 10 && len < 19) {
    *dtype = 81;
  } else if (len > 19) {
    *status = 403;
  } else {
    if (!(*negative)) {
      if (len == 3) {
        if (strcmp(p, "127") <= 0) {
          *dtype = 12;
        } else if (strcmp(p, "255") <= 0) {
          *dtype = 11;
        } else {
          *dtype = 21;
        }
      } else if (len == 5) {
        if (strcmp(p, "32767") <= 0) {
          *dtype = 21;
        } else if (strcmp(p, "65535") <= 0) {
          *dtype = 20;
        } else {
          *dtype = 31;
        }
      } else if (len == 10) {
        if (strcmp(p, "2147483647") <= 0) {
          *dtype = 31;
        } else if (strcmp(p, "4294967295") <= 0) {
          *dtype = 30;
        } else {
          *dtype = 81;
        }
      } else if (len == 19) {
        if (strcmp(p, "9223372036854775807") <= 0) {
          *dtype = 81;
        } else {
          *status = 403;
        }
      }
    } else {
      if (len == 3) {
        if (strcmp(p, "128") <= 0) {
          *dtype = 12;
        } else {
          *dtype = 21;
        }
      } else if (len == 5) {
        if (strcmp(p, "32768") <= 0) {
          *dtype = 21;
        } else {
          *dtype = 31;
        }
      } else if (len == 10) {
        if (strcmp(p, "2147483648") <= 0) {
          *dtype = 31;
        } else {
          *dtype = 81;
        }
      } else if (len == 19) {
        if (strcmp(p, "9223372036854775808") <= 0) {
          *dtype = 81;
        } else {
          *status = 403;
        }
      }
    }
  }
  return (*status);
}


x86 assembly (clang, -O0):
<ffinttyp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmpl   $0x0,(%rax)
jle    1163 <ffinttyp+0x33>
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1628 <ffinttyp+0x4f8>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    1196 <ffinttyp+0x66>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    11c1 <ffinttyp+0x91>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    11bc <ffinttyp+0x8c>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
jmp    11c1 <ffinttyp+0x91>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    1224 <ffinttyp+0xf4>
jmp    11d6 <ffinttyp+0xa6>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    11f7 <ffinttyp+0xc7>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    11d6 <ffinttyp+0xa6>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    121f <ffinttyp+0xef>
mov    -0x18(%rbp),%rax
movl   $0xc,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1628 <ffinttyp+0x4f8>
jmp    1224 <ffinttyp+0xf4>
mov    -0x38(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x30(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    1288 <ffinttyp+0x158>
mov    -0x38(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1275 <ffinttyp+0x145>
mov    -0x28(%rbp),%rax
movl   $0x193,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1628 <ffinttyp+0x4f8>
jmp    127a <ffinttyp+0x14a>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1237 <ffinttyp+0x107>
cmpl   $0x0,-0x30(%rbp)
jne    12a1 <ffinttyp+0x171>
mov    -0x28(%rbp),%rax
movl   $0xcc,(%rax)
jmp    161f <ffinttyp+0x4ef>
cmpl   $0x3,-0x30(%rbp)
jge    12ba <ffinttyp+0x18a>
mov    -0x18(%rbp),%rax
movl   $0xc,(%rax)
jmp    161a <ffinttyp+0x4ea>
cmpl   $0x4,-0x30(%rbp)
jne    12d3 <ffinttyp+0x1a3>
mov    -0x18(%rbp),%rax
movl   $0x15,(%rax)
jmp    1615 <ffinttyp+0x4e5>
cmpl   $0x5,-0x30(%rbp)
jle    12f6 <ffinttyp+0x1c6>
cmpl   $0xa,-0x30(%rbp)
jge    12f6 <ffinttyp+0x1c6>
mov    -0x18(%rbp),%rax
movl   $0x1f,(%rax)
jmp    1610 <ffinttyp+0x4e0>
cmpl   $0xa,-0x30(%rbp)
jle    1319 <ffinttyp+0x1e9>
cmpl   $0x13,-0x30(%rbp)
jge    1319 <ffinttyp+0x1e9>
mov    -0x18(%rbp),%rax
movl   $0x51,(%rax)
jmp    160b <ffinttyp+0x4db>
cmpl   $0x13,-0x30(%rbp)
jle    1332 <ffinttyp+0x202>
mov    -0x28(%rbp),%rax
movl   $0x193,(%rax)
jmp    1606 <ffinttyp+0x4d6>
mov    -0x20(%rbp),%rax
cmpl   $0x0,(%rax)
jne    14e5 <ffinttyp+0x3b5>
cmpl   $0x3,-0x30(%rbp)
jne    13af <ffinttyp+0x27f>
mov    -0x38(%rbp),%rdi
lea    0xcac(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jg     1372 <ffinttyp+0x242>
mov    -0x18(%rbp),%rax
movl   $0xc,(%rax)
jmp    13aa <ffinttyp+0x27a>
mov    -0x38(%rbp),%rdi
lea    0xc87(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jg     139b <ffinttyp+0x26b>
mov    -0x18(%rbp),%rax
movl   $0xb,(%rax)
jmp    13a5 <ffinttyp+0x275>
mov    -0x18(%rbp),%rax
movl   $0x15,(%rax)
jmp    13aa <ffinttyp+0x27a>
jmp    14e0 <ffinttyp+0x3b0>
cmpl   $0x5,-0x30(%rbp)
jne    141f <ffinttyp+0x2ef>
mov    -0x38(%rbp),%rdi
lea    0xc44(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jg     13e2 <ffinttyp+0x2b2>
mov    -0x18(%rbp),%rax
movl   $0x15,(%rax)
jmp    141a <ffinttyp+0x2ea>
mov    -0x38(%rbp),%rdi
lea    0xc21(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jg     140b <ffinttyp+0x2db>
mov    -0x18(%rbp),%rax
movl   $0x14,(%rax)
jmp    1415 <ffinttyp+0x2e5>
mov    -0x18(%rbp),%rax
movl   $0x1f,(%rax)
jmp    141a <ffinttyp+0x2ea>
jmp    14db <ffinttyp+0x3ab>
cmpl   $0xa,-0x30(%rbp)
jne    148f <ffinttyp+0x35f>
mov    -0x38(%rbp),%rdi
lea    0xbe0(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jg     1452 <ffinttyp+0x322>
mov    -0x18(%rbp),%rax
movl   $0x1f,(%rax)
jmp    148a <ffinttyp+0x35a>
mov    -0x38(%rbp),%rdi
lea    0xbc2(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jg     147b <ffinttyp+0x34b>
mov    -0x18(%rbp),%rax
movl   $0x1e,(%rax)
jmp    1485 <ffinttyp+0x355>
mov    -0x18(%rbp),%rax
movl   $0x51,(%rax)
jmp    148a <ffinttyp+0x35a>
jmp    14d6 <ffinttyp+0x3a6>
cmpl   $0x13,-0x30(%rbp)
jne    14d1 <ffinttyp+0x3a1>
mov    -0x38(%rbp),%rdi
lea    0xb86(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jg     14c2 <ffinttyp+0x392>
mov    -0x18(%rbp),%rax
movl   $0x51,(%rax)
jmp    14cc <ffinttyp+0x39c>
mov    -0x28(%rbp),%rax
movl   $0x193,(%rax)
jmp    14d1 <ffinttyp+0x3a1>
jmp    14d6 <ffinttyp+0x3a6>
jmp    14db <ffinttyp+0x3ab>
jmp    14e0 <ffinttyp+0x3b0>
jmp    1601 <ffinttyp+0x4d1>
cmpl   $0x3,-0x30(%rbp)
jne    1527 <ffinttyp+0x3f7>
mov    -0x38(%rbp),%rdi
lea    0xb44(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jg     1518 <ffinttyp+0x3e8>
mov    -0x18(%rbp),%rax
movl   $0xc,(%rax)
jmp    1522 <ffinttyp+0x3f2>
mov    -0x18(%rbp),%rax
movl   $0x15,(%rax)
jmp    15fc <ffinttyp+0x4cc>
cmpl   $0x5,-0x30(%rbp)
jne    1569 <ffinttyp+0x439>
mov    -0x38(%rbp),%rdi
lea    0xb06(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jg     155a <ffinttyp+0x42a>
mov    -0x18(%rbp),%rax
movl   $0x15,(%rax)
jmp    1564 <ffinttyp+0x434>
mov    -0x18(%rbp),%rax
movl   $0x1f,(%rax)
jmp    15f7 <ffinttyp+0x4c7>
cmpl   $0xa,-0x30(%rbp)
jne    15ab <ffinttyp+0x47b>
mov    -0x38(%rbp),%rdi
lea    0xaca(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jg     159c <ffinttyp+0x46c>
mov    -0x18(%rbp),%rax
movl   $0x1f,(%rax)
jmp    15a6 <ffinttyp+0x476>
mov    -0x18(%rbp),%rax
movl   $0x51,(%rax)
jmp    15f2 <ffinttyp+0x4c2>
cmpl   $0x13,-0x30(%rbp)
jne    15ed <ffinttyp+0x4bd>
mov    -0x38(%rbp),%rdi
lea    0xa93(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jg     15de <ffinttyp+0x4ae>
mov    -0x18(%rbp),%rax
movl   $0x51,(%rax)
jmp    15e8 <ffinttyp+0x4b8>
mov    -0x28(%rbp),%rax
movl   $0x193,(%rax)
jmp    15ed <ffinttyp+0x4bd>
jmp    15f2 <ffinttyp+0x4c2>
jmp    15f7 <ffinttyp+0x4c7>
jmp    15fc <ffinttyp+0x4cc>
jmp    1601 <ffinttyp+0x4d1>
jmp    1606 <ffinttyp+0x4d6>
jmp    160b <ffinttyp+0x4db>
jmp    1610 <ffinttyp+0x4e0>
jmp    1615 <ffinttyp+0x4e5>
jmp    161a <ffinttyp+0x4ea>
jmp    161f <ffinttyp+0x4ef>
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffinttyp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    (%rcx),%eax
test   %eax,%eax
jg     1251 <ffinttyp+0x121>
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rdi,%rbx
movl   $0x0,(%rsi)
mov    (%rdi),%al
cmp    $0x2b,%al
je     1166 <ffinttyp+0x36>
cmp    $0x2d,%al
jne    116d <ffinttyp+0x3d>
movl   $0x1,(%r12)
mov    0x1(%rbx),%al
add    $0x1,%rbx
cmp    $0x30,%al
jne    119b <ffinttyp+0x6b>
mov    $0x30,%al
cmp    $0x30,%al
jne    118c <ffinttyp+0x5c>
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
cmp    $0x30,%al
je     1180 <ffinttyp+0x50>
test   %al,%al
jne    119b <ffinttyp+0x6b>
movl   $0xc,(%rsi)
jmp    124e <ffinttyp+0x11e>
mov    %rsi,(%rsp)
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,%r13d
test   %eax,%eax
jle    11d7 <ffinttyp+0xa7>
mov    %r13d,%ebp
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx,%r14,1),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     11ee <ffinttyp+0xbe>
add    $0x1,%r14
cmp    %r14,%rbp
jne    11c0 <ffinttyp+0x90>
test   %r13d,%r13d
je     11fc <ffinttyp+0xcc>
cmp    $0x2,%r13d
jg     1205 <ffinttyp+0xd5>
mov    (%rsp),%rax
movl   $0xc,(%rax)
jmp    124e <ffinttyp+0x11e>
movl   $0x193,(%r15)
mov    $0x193,%eax
jmp    1251 <ffinttyp+0x121>
movl   $0xcc,(%r15)
jmp    124e <ffinttyp+0x11e>
cmp    $0x4,%r13d
jne    1217 <ffinttyp+0xe7>
mov    (%rsp),%rax
movl   $0x15,(%rax)
jmp    124e <ffinttyp+0x11e>
lea    -0x6(%r13),%eax
cmp    $0x3,%eax
ja     122c <ffinttyp+0xfc>
mov    (%rsp),%rax
movl   $0x1f,(%rax)
jmp    124e <ffinttyp+0x11e>
lea    -0xb(%r13),%eax
cmp    $0x7,%eax
ja     1241 <ffinttyp+0x111>
mov    (%rsp),%rax
movl   $0x51,(%rax)
jmp    124e <ffinttyp+0x11e>
cmp    $0x14,%r13d
jb     1260 <ffinttyp+0x130>
movl   $0x193,(%r15)
mov    (%r15),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cmpl   $0x0,(%r12)
je     129e <ffinttyp+0x16e>
add    $0xfffffffd,%r13d
cmp    $0x10,%r13d
ja     124e <ffinttyp+0x11e>
lea    0xd88(%rip),%rax
movslq (%rax,%r13,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0xe3e(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
jle    11e2 <ffinttyp+0xb2>
jmp    120b <ffinttyp+0xdb>
add    $0xfffffffd,%r13d
cmp    $0x10,%r13d
ja     124e <ffinttyp+0x11e>
lea    0xd95(%rip),%rax
movslq (%rax,%r13,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0xdc9(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
jle    11e2 <ffinttyp+0xb2>
lea    0xdb5(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
mov    (%rsp),%rax
jg     13cd <ffinttyp+0x29d>
movl   $0xb,(%rax)
jmp    124e <ffinttyp+0x11e>
lea    0xdcc(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
jle    120b <ffinttyp+0xdb>
jmp    1220 <ffinttyp+0xf0>
lea    0xdb5(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
jle    1220 <ffinttyp+0xf0>
jmp    1235 <ffinttyp+0x105>
lea    0xda3(%rip),%rsi
jmp    13b7 <ffinttyp+0x287>
lea    0xd4f(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
jle    120b <ffinttyp+0xdb>
lea    0xd3d(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
mov    (%rsp),%rax
jg     13d8 <ffinttyp+0x2a8>
movl   $0x14,(%rax)
jmp    124e <ffinttyp+0x11e>
lea    0xd20(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
jle    1220 <ffinttyp+0xf0>
lea    0xd13(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
mov    (%rsp),%rax
jg     13e3 <ffinttyp+0x2b3>
movl   $0x1e,(%rax)
jmp    124e <ffinttyp+0x11e>
lea    0xcfb(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
jle    1235 <ffinttyp+0x105>
jmp    1247 <ffinttyp+0x117>
movl   $0x15,(%rax)
jmp    124e <ffinttyp+0x11e>
movl   $0x1f,(%rax)
jmp    124e <ffinttyp+0x11e>
movl   $0x51,(%rax)
jmp    124e <ffinttyp+0x11e>

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

LLVM IR (-O2):
@.str = [4 x i8] c"127\00"
@.str.1 = [4 x i8] c"255\00"
@.str.2 = [6 x i8] c"32767\00"
@.str.3 = [6 x i8] c"65535\00"
@.str.4 = [11 x i8] c"2147483647\00"
@.str.5 = [11 x i8] c"4294967295\00"
@.str.6 = [20 x i8] c"9223372036854775807\00"
@.str.7 = [4 x i8] c"128\00"
@.str.8 = [6 x i8] c"32768\00"
@.str.9 = [11 x i8] c"2147483648\00"
@.str.10 = [20 x i8] c"9223372036854775808\00"
define i32 @ffinttyp(i8* %0, i32* writeonly %1, i32* nocapture %2, i32* nocapture %3) {
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 0
br i1 %6, label %120, label %7
7: ; preds = %4
store i32 0, i32* %1
%8 = load i8, i8* %0
switch i8 %8, label %13 [
i8 43, label %10
i8 45, label %9
]
9: ; preds = %7
store i32 1, i32* %2
br label %10
10: ; preds = %7, %9
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
br label %13
13: ; preds = %10, %7
%14 = phi i8 [ %12, %10 ], [ %8, %7 ]
%15 = phi i8* [ %11, %10 ], [ %0, %7 ]
%16 = icmp eq i8 %14, 48
br i1 %16, label %17, label %25
17: ; preds = %13, %20
%18 = phi i8 [ %22, %20 ], [ 48, %13 ]
%19 = phi i8* [ %21, %20 ], [ %15, %13 ]
switch i8 %18, label %25 [
i8 48, label %20
i8 0, label %23
]
20: ; preds = %17
%21 = getelementptr inbounds i8, i8* %19, i64 1
%22 = load i8, i8* %21
br label %17
23: ; preds = %17
store i32 12, i32* %1
%24 = load i32, i32* %3
br label %120
25: ; preds = %17, %13
%26 = phi i8* [ %15, %13 ], [ %19, %17 ]
%27 = tail call i32 @strlen(i8* %26)
%28 = icmp sgt i32 %27, 0
br i1 %28, label %29, label %41
29: ; preds = %25
%30 = zext i32 %27 to i64
br label %33
31: ; preds = %33
%32 = icmp eq i64 %39, %30
br i1 %32, label %41, label %33
33: ; preds = %29, %31
%34 = phi i64 [ 0, %29 ], [ %39, %31 ]
%35 = getelementptr inbounds i8, i8* %26, i64 %34
%36 = load i8, i8* %35
%37 = tail call i32 @isdigit(i8 signext %36)
%38 = icmp eq i32 %37, 0
%39 = add nuw nsw i64 %34, 1
br i1 %38, label %40, label %31
40: ; preds = %33
store i32 403, i32* %3
br label %120
41: ; preds = %31, %25
%42 = icmp eq i32 %27, 0
br i1 %42, label %43, label %44
43: ; preds = %41
store i32 204, i32* %3
br label %118
44: ; preds = %41
%45 = icmp slt i32 %27, 3
br i1 %45, label %46, label %47
46: ; preds = %44
store i32 12, i32* %1
br label %118
47: ; preds = %44
%48 = icmp eq i32 %27, 4
br i1 %48, label %49, label %50
49: ; preds = %47
store i32 21, i32* %1
br label %118
50: ; preds = %47
%51 = add nsw i32 %27, -6
%52 = icmp ult i32 %51, 4
br i1 %52, label %53, label %54
53: ; preds = %50
store i32 31, i32* %1
br label %118
54: ; preds = %50
%55 = add nsw i32 %27, -11
%56 = icmp ult i32 %55, 8
br i1 %56, label %57, label %58
57: ; preds = %54
store i32 81, i32* %1
br label %118
58: ; preds = %54
%59 = icmp ugt i32 %27, 19
br i1 %59, label %60, label %61
60: ; preds = %58
store i32 403, i32* %3
br label %118
61: ; preds = %58
%62 = load i32, i32* %2
%63 = icmp eq i32 %62, 0
br i1 %63, label %64, label %97
64: ; preds = %61
switch i32 %27, label %118 [
i32 3, label %65
i32 5, label %74
i32 10, label %83
i32 19, label %92
]
65: ; preds = %64
%66 = tail call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%67 = icmp slt i64 %66, 1
br i1 %67, label %68, label %69
68: ; preds = %65
store i32 12, i32* %1
br label %118
69: ; preds = %65
%70 = tail call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%71 = icmp slt i64 %70, 1
br i1 %71, label %72, label %73
72: ; preds = %69
store i32 11, i32* %1
br label %118
73: ; preds = %69
store i32 21, i32* %1
br label %118
74: ; preds = %64
%75 = tail call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%76 = icmp slt i64 %75, 1
br i1 %76, label %77, label %78
77: ; preds = %74
store i32 21, i32* %1
br label %118
78: ; preds = %74
%79 = tail call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%80 = icmp slt i64 %79, 1
br i1 %80, label %81, label %82
81: ; preds = %78
store i32 20, i32* %1
br label %118
82: ; preds = %78
store i32 31, i32* %1
br label %118
83: ; preds = %64
%84 = tail call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%85 = icmp slt i64 %84, 1
br i1 %85, label %86, label %87
86: ; preds = %83
store i32 31, i32* %1
br label %118
87: ; preds = %83
%88 = tail call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%89 = icmp slt i64 %88, 1
br i1 %89, label %90, label %91
90: ; preds = %87
store i32 30, i32* %1
br label %118
91: ; preds = %87
store i32 81, i32* %1
br label %118
92: ; preds = %64
%93 = tail call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%94 = icmp slt i64 %93, 1
br i1 %94, label %95, label %96
95: ; preds = %92
store i32 81, i32* %1
br label %118
96: ; preds = %92
store i32 403, i32* %3
br label %118
97: ; preds = %61
switch i32 %27, label %118 [
i32 3, label %98
i32 5, label %103
i32 10, label %108
i32 19, label %113
]
98: ; preds = %97
%99 = tail call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%100 = icmp slt i64 %99, 1
br i1 %100, label %101, label %102
101: ; preds = %98
store i32 12, i32* %1
br label %118
102: ; preds = %98
store i32 21, i32* %1
br label %118
103: ; preds = %97
%104 = tail call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%105 = icmp slt i64 %104, 1
br i1 %105, label %106, label %107
106: ; preds = %103
store i32 21, i32* %1
br label %118
107: ; preds = %103
store i32 31, i32* %1
br label %118
108: ; preds = %97
%109 = tail call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
%110 = icmp slt i64 %109, 1
br i1 %110, label %111, label %112
111: ; preds = %108
store i32 31, i32* %1
br label %118
112: ; preds = %108
store i32 81, i32* %1
br label %118
113: ; preds = %97
%114 = tail call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0))
%115 = icmp slt i64 %114, 1
br i1 %115, label %116, label %117
116: ; preds = %113
store i32 81, i32* %1
br label %118
117: ; preds = %113
store i32 403, i32* %3
br label %118
118: ; preds = %97, %64, %46, %53, %60, %102, %101, %112, %111, %116, %117, %106, %107, %72, %73, %68, %90, %91, %86, %95, %96, %77, %82, %81, %57, %49, %43
%119 = load i32, i32* %3
br label %120
120: ; preds = %4, %118, %40, %23
%121 = phi i32 [ %24, %23 ], [ 403, %40 ], [ %119, %118 ], [ %5, %4 ]
ret i32 %121
}