#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*/ states;

/* Variables and functions */
scalar_t__ isprint(char);
scalar_t__ isspace(char);
int /*<<< orphan*/ printf(char *, ...);
void state_table(const char *name) {
  static const char *states[] = {
      "URI_STATE_START", "URI_STATE_NAME", "URI_STATE_EQUALS",
      "URI_STATE_VALUE", "URI_STATE_END",  "URI_STATE_ERROR",
  };
  int size = sizeof(states) / sizeof(states[0]);
  printf("/*\n");
  printf(" * Table has the next state given last read character and current "
         "state.\n");
  printf(" */\n");
  printf("\n");
  for (int state = 0; state < size; ++state) {
    printf("#define %-20.20s %2d\n", states[state], state);
  }
  printf("\n");
  printf("/* Minimum state that indicates we must terminate processing */\n");
  printf("#define %-20.20s %s\n", "URI_STATE_TERMINATE", "URI_STATE_END");
  printf("\n");
  printf("static char %s[%d][%d] =\n", name, (1 << 4) * (1 << 4), size + 1);
  printf("/* ");
  for (int state = 0; state < size; ++state) {
    printf("%5d", state);
  }
  printf("*/\n");
  printf("{\n");
  for (int x = 0; x < 256; ++x) {
    char c = (char)x;
    printf("    {");
    for (int state = 0; state < size; ++state) {
      int next = state;
      if (c == '\0' || c == ';') {
        if (state == 1 || state == 2 || state == 3) {
          next = 4;
        } else {
          next = 5;
        }
      } else if (isspace(c)) {
      } else if (c == '=') {
        if (state == 1) {
          next = 2;
        } else if (state == 2) {
          next = 3;
        } else if (state == 3) {
        } else {
          next = 5;
        }
      } else {
        if (state == 0) {
          next = 1;
        } else if (state == 2) {
          next = 3;
        } else {
        }
      }
      printf("%3d, ", next);
    }
    printf("},  /* %2x -- %3d -- %c */\n", x, x, isprint(c) ? c : '.');
  }
  printf("};\n\n");
}


x86 assembly (clang, -O0):
<state_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
lea    0xf14(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x100e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1008(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11bc <state_table+0x8c>
movslq -0x10(%rbp),%rcx
lea    0x2ea7(%rip),%rax
mov    (%rax,%rcx,8),%rsi
mov    -0x10(%rbp),%edx
lea    0xf05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1182 <state_table+0x52>
lea    0xfb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf24(%rip),%rdi
lea    0xf32(%rip),%rsi
lea    0xe53(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
lea    0xf19(%rip),%rdi
mov    $0x100,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    125f <state_table+0x12f>
mov    -0x14(%rbp),%esi
lea    0xf00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1234 <state_table+0x104>
lea    0xf0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x100,-0x18(%rbp)
jge    1443 <state_table+0x313>
mov    -0x18(%rbp),%eax
mov    %al,-0x19(%rbp)
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    13e6 <state_table+0x2b6>
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x0,%eax
je     12d6 <state_table+0x1a6>
movsbl -0x19(%rbp),%eax
cmp    $0x3b,%eax
jne    130c <state_table+0x1dc>
cmpl   $0x1,-0x20(%rbp)
je     12f4 <state_table+0x1c4>
cmpl   $0x2,-0x20(%rbp)
je     12f4 <state_table+0x1c4>
cmpl   $0x3,-0x20(%rbp)
jne    1300 <state_table+0x1d0>
movl   $0x4,-0x24(%rbp)
jmp    1307 <state_table+0x1d7>
movl   $0x5,-0x24(%rbp)
jmp    13c7 <state_table+0x297>
movsbl -0x19(%rbp),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     1324 <state_table+0x1f4>
jmp    13c2 <state_table+0x292>
movsbl -0x19(%rbp),%eax
cmp    $0x3d,%eax
jne    1382 <state_table+0x252>
cmpl   $0x1,-0x20(%rbp)
jne    1347 <state_table+0x217>
movl   $0x2,-0x24(%rbp)
jmp    137d <state_table+0x24d>
cmpl   $0x2,-0x20(%rbp)
jne    135d <state_table+0x22d>
movl   $0x3,-0x24(%rbp)
jmp    1378 <state_table+0x248>
cmpl   $0x3,-0x20(%rbp)
jne    136c <state_table+0x23c>
jmp    1373 <state_table+0x243>
movl   $0x5,-0x24(%rbp)
jmp    1378 <state_table+0x248>
jmp    137d <state_table+0x24d>
jmp    13bd <state_table+0x28d>
cmpl   $0x0,-0x20(%rbp)
jne    1398 <state_table+0x268>
movl   $0x1,-0x24(%rbp)
jmp    13b8 <state_table+0x288>
cmpl   $0x2,-0x20(%rbp)
jne    13ae <state_table+0x27e>
movl   $0x3,-0x24(%rbp)
jmp    13b3 <state_table+0x283>
jmp    13b3 <state_table+0x283>
jmp    13b8 <state_table+0x288>
jmp    13bd <state_table+0x28d>
jmp    13c2 <state_table+0x292>
jmp    13c7 <state_table+0x297>
mov    -0x24(%rbp),%esi
lea    0xd86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12aa <state_table+0x17a>
mov    -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x28(%rbp)
movsbl -0x19(%rbp),%edi
call   1050 <isprint@plt>
cmp    $0x0,%rax
je     1411 <state_table+0x2e1>
movsbl -0x19(%rbp),%eax
mov    %eax,-0x30(%rbp)
jmp    141e <state_table+0x2ee>
mov    $0x2e,%eax
mov    %eax,-0x30(%rbp)
jmp    141e <state_table+0x2ee>
mov    -0x28(%rbp),%edx
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%ecx
lea    0xd2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1282 <state_table+0x152>
lea    0xd2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<state_table>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xf82(%rip),%rdi
call   1040 <puts@plt>
lea    0xf79(%rip),%rdi
call   1040 <puts@plt>
lea    0xff2(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xecb(%rip),%rbp
lea    0xe66(%rip),%rsi
mov    %rbp,%rdi
xor    %edx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe63(%rip),%rsi
mov    %rbp,%rdi
mov    $0x1,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe5c(%rip),%rsi
mov    %rbp,%rdi
mov    $0x2,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe57(%rip),%rsi
mov    %rbp,%rdi
mov    $0x3,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe51(%rip),%rbx
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe46(%rip),%rsi
mov    %rbp,%rdi
mov    $0x5,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xf0b(%rip),%rdi
call   1040 <puts@plt>
lea    0xe40(%rip),%rdi
lea    0xe4e(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe47(%rip),%rdi
mov    %r14,%rsi
mov    $0x100,%edx
mov    $0x7,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe46(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe3c(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe93(%rip),%rdi
call   1040 <puts@plt>
lea    0xdda(%rip),%rdi
call   1040 <puts@plt>
lea    0xdca(%rip),%r14
lea    0xdc9(%rip),%r12
lea    0xdc8(%rip),%r15
xor    %r13d,%r13d
xor    %ebp,%ebp
jmp    1375 <state_table+0x225>
nopw   0x0(%rax,%rax,1)
mov    $0x5,%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl %bpl,%edi
call   1060 <isspace@plt>
mov    %r12,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl %bpl,%edi
call   1070 <isprint@plt>
mov    %r13d,%ecx
sar    $0x18,%ecx
test   %rax,%rax
mov    $0x2e,%eax
cmove  %eax,%ecx
mov    %r15,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebp
add    $0x1000000,%r13d
cmp    $0x100,%ebp
je     1564 <state_table+0x414>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x5,%esi
test   %r13d,%r13d
je     139b <state_table+0x24b>
mov    $0x5,%esi
cmp    $0x3b000000,%r13d
jne    1490 <state_table+0x340>
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x4,%ebx
mov    $0x4,%esi
test   %r13d,%r13d
je     13c6 <state_table+0x276>
mov    $0x4,%esi
cmp    $0x3b000000,%r13d
jne    14e0 <state_table+0x390>
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r13d,%r13d
je     13f2 <state_table+0x2a2>
cmp    $0x3b000000,%r13d
je     13f2 <state_table+0x2a2>
movsbl %bpl,%edi
call   1060 <isspace@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
or     $0x2,%ebx
mov    %r12,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x4,%esi
test   %r13d,%r13d
je     141f <state_table+0x2cf>
cmp    $0x3b000000,%r13d
je     141f <state_table+0x2cf>
movsbl %bpl,%edi
call   1060 <isspace@plt>
mov    $0x3,%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x5,%esi
test   %r13d,%r13d
je     1460 <state_table+0x310>
cmp    $0x3b000000,%r13d
je     1460 <state_table+0x310>
movsbl %bpl,%edi
call   1060 <isspace@plt>
mov    $0x4,%esi
test   %rax,%rax
jne    1460 <state_table+0x310>
cmp    $0x3d000000,%r13d
je     1310 <state_table+0x1c0>
nopl   0x0(%rax)
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r13d,%r13d
je     1328 <state_table+0x1d8>
cmp    $0x3b000000,%r13d
je     1328 <state_table+0x1d8>
jmp    131f <state_table+0x1cf>
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %bpl,%edi
call   1060 <isspace@plt>
xor    %esi,%esi
test   %rax,%rax
sete   %sil
jne    139b <state_table+0x24b>
cmp    $0x3d000000,%r13d
jne    139b <state_table+0x24b>
mov    %r12,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl %bpl,%edi
call   1060 <isspace@plt>
mov    $0x1,%esi
test   %rax,%rax
jne    1509 <state_table+0x3b9>
jmp    1504 <state_table+0x3b4>
nopl   0x0(%rax)
movsbl %bpl,%edi
call   1060 <isspace@plt>
mov    $0x1,%esi
test   %rax,%rax
jne    13c6 <state_table+0x276>
cmp    $0x3d000000,%r13d
jne    13c6 <state_table+0x276>
mov    $0x2,%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl %bpl,%ebx
mov    %ebx,%edi
call   1060 <isspace@plt>
xor    %esi,%esi
test   %rax,%rax
sete   %sil
or     $0x2,%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%edi
call   1060 <isspace@plt>
mov    %r12,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%edi
call   1060 <isspace@plt>
mov    $0x4,%esi
test   %rax,%rax
jne    1315 <state_table+0x1c5>
jmp    1310 <state_table+0x1c0>
lea    0xc08(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

LLVM IR (-O0):
@state_table.states = internal global [6 x i8*] [i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i32 0, i32 0)]
@.str = [16 x i8] c"URI_STATE_START\00"
@.str.1 = [15 x i8] c"URI_STATE_NAME\00"
@.str.2 = [17 x i8] c"URI_STATE_EQUALS\00"
@.str.3 = [16 x i8] c"URI_STATE_VALUE\00"
@.str.4 = [14 x i8] c"URI_STATE_END\00"
@.str.5 = [16 x i8] c"URI_STATE_ERROR\00"
@.str.6 = [4 x i8] c"/*\0A\00"
@.str.7 = [74 x i8] c" * Table has the next state given last read character and current state.\0A\00"
@.str.8 = [5 x i8] c" */\0A\00"
@.str.9 = [2 x i8] c"\0A\00"
@.str.10 = [22 x i8] c"#define %-20.20s %2d\0A\00"
@.str.11 = [65 x i8] c"/* Minimum state that indicates we must terminate processing */\0A\00"
@.str.12 = [21 x i8] c"#define %-20.20s %s\0A\00"
@.str.13 = [20 x i8] c"URI_STATE_TERMINATE\00"
@.str.14 = [26 x i8] c"static char %s[%d][%d] =\0A\00"
@.str.15 = [4 x i8] c"/* \00"
@.str.16 = [4 x i8] c"%5d\00"
@.str.17 = [4 x i8] c"*/\0A\00"
@.str.18 = [3 x i8] c"{\0A\00"
@.str.19 = [6 x i8] c" {\00"
@.str.20 = [6 x i8] c"%3d, \00"
@.str.21 = [28 x i8] c"}, /* %2x -- %3d -- %c */\0A\00"
@.str.22 = [5 x i8] c"};\0A\0A\00"
define void @state_table(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %2
store i32 6, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.7, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %4
br label %14
14: ; preds = %25, %1
%15 = load i32, i32* %4
%16 = load i32, i32* %3
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %28
18: ; preds = %14
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [6 x i8*], [6 x i8*]* @state_table.states, i64 0, i64 %20
%22 = load i8*, i8** %21
%23 = load i32, i32* %4
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* %22, i32 %23)
br label %25
25: ; preds = %18
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %14
28: ; preds = %14
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.11, i64 0, i64 0))
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%33 = load i8*, i8** %2
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i64 0, i64 0), i8* %33, i32 256, i32 %35)
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
store i32 0, i32* %5
br label %38
38: ; preds = %45, %28
%39 = load i32, i32* %5
%40 = load i32, i32* %3
%41 = icmp slt i32 %39, %40
br i1 %41, label %42, label %48
42: ; preds = %38
%43 = load i32, i32* %5
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i32 %43)
br label %45
45: ; preds = %42
%46 = load i32, i32* %5
%47 = add nsw i32 %46, 1
store i32 %47, i32* %5
br label %38
48: ; preds = %38
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0))
store i32 0, i32* %6
br label %51
51: ; preds = %140, %48
%52 = load i32, i32* %6
%53 = icmp slt i32 %52, 256
br i1 %53, label %54, label %143
54: ; preds = %51
%55 = load i32, i32* %6
%56 = trunc i32 %55 to i8
store i8 %56, i8* %7
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0))
store i32 0, i32* %8
br label %58
58: ; preds = %124, %54
%59 = load i32, i32* %8
%60 = load i32, i32* %3
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %127
62: ; preds = %58
%63 = load i32, i32* %8
store i32 %63, i32* %9
%64 = load i8, i8* %7
%65 = sext i8 %64 to i32
%66 = icmp eq i32 %65, 0
br i1 %66, label %71, label %67
67: ; preds = %62
%68 = load i8, i8* %7
%69 = sext i8 %68 to i32
%70 = icmp eq i32 %69, 59
br i1 %70, label %71, label %83
71: ; preds = %67, %62
%72 = load i32, i32* %8
%73 = icmp eq i32 %72, 1
br i1 %73, label %80, label %74
74: ; preds = %71
%75 = load i32, i32* %8
%76 = icmp eq i32 %75, 2
br i1 %76, label %80, label %77
77: ; preds = %74
%78 = load i32, i32* %8
%79 = icmp eq i32 %78, 3
br i1 %79, label %80, label %81
80: ; preds = %77, %74, %71
store i32 4, i32* %9
br label %82
81: ; preds = %77
store i32 5, i32* %9
br label %82
82: ; preds = %81, %80
br label %121
83: ; preds = %67
%84 = load i8, i8* %7
%85 = call i64 @isspace(i8 signext %84)
%86 = icmp ne i64 %85, 0
br i1 %86, label %87, label %88
87: ; preds = %83
br label %120
88: ; preds = %83
%89 = load i8, i8* %7
%90 = sext i8 %89 to i32
%91 = icmp eq i32 %90, 61
br i1 %91, label %92, label %108
92: ; preds = %88
%93 = load i32, i32* %8
%94 = icmp eq i32 %93, 1
br i1 %94, label %95, label %96
95: ; preds = %92
store i32 2, i32* %9
br label %107
96: ; preds = %92
%97 = load i32, i32* %8
%98 = icmp eq i32 %97, 2
br i1 %98, label %99, label %100
99: ; preds = %96
store i32 3, i32* %9
br label %106
100: ; preds = %96
%101 = load i32, i32* %8
%102 = icmp eq i32 %101, 3
br i1 %102, label %103, label %104
103: ; preds = %100
br label %105
104: ; preds = %100
store i32 5, i32* %9
br label %105
105: ; preds = %104, %103
br label %106
106: ; preds = %105, %99
br label %107
107: ; preds = %106, %95
br label %119
108: ; preds = %88
%109 = load i32, i32* %8
%110 = icmp eq i32 %109, 0
br i1 %110, label %111, label %112
111: ; preds = %108
store i32 1, i32* %9
br label %118
112: ; preds = %108
%113 = load i32, i32* %8
%114 = icmp eq i32 %113, 2
br i1 %114, label %115, label %116
115: ; preds = %112
store i32 3, i32* %9
br label %117
116: ; preds = %112
br label %117
117: ; preds = %116, %115
br label %118
118: ; preds = %117, %111
br label %119
119: ; preds = %118, %107
br label %120
120: ; preds = %119, %87
br label %121
121: ; preds = %120, %82
%122 = load i32, i32* %9
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 %122)
br label %124
124: ; preds = %121
%125 = load i32, i32* %8
%126 = add nsw i32 %125, 1
store i32 %126, i32* %8
br label %58
127: ; preds = %58
%128 = load i32, i32* %6
%129 = load i32, i32* %6
%130 = load i8, i8* %7
%131 = call i64 @isprint(i8 signext %130)
%132 = icmp ne i64 %131, 0
br i1 %132, label %133, label %136
133: ; preds = %127
%134 = load i8, i8* %7
%135 = sext i8 %134 to i32
br label %137
136: ; preds = %127
br label %137
137: ; preds = %136, %133
%138 = phi i32 [ %135, %133 ], [ 46, %136 ]
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.21, i64 0, i64 0), i32 %128, i32 %129, i32 %138)
br label %140
140: ; preds = %137
%141 = load i32, i32* %6
%142 = add nsw i32 %141, 1
store i32 %142, i32* %6
br label %51
143: ; preds = %51
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"URI_STATE_START\00"
@.str.1 = [15 x i8] c"URI_STATE_NAME\00"
@.str.2 = [17 x i8] c"URI_STATE_EQUALS\00"
@.str.3 = [16 x i8] c"URI_STATE_VALUE\00"
@.str.4 = [14 x i8] c"URI_STATE_END\00"
@.str.5 = [16 x i8] c"URI_STATE_ERROR\00"
@.str.10 = [22 x i8] c"#define %-20.20s %2d\0A\00"
@.str.12 = [21 x i8] c"#define %-20.20s %s\0A\00"
@.str.13 = [20 x i8] c"URI_STATE_TERMINATE\00"
@.str.14 = [26 x i8] c"static char %s[%d][%d] =\0A\00"
@.str.15 = [4 x i8] c"/* \00"
@.str.16 = [4 x i8] c"%5d\00"
@.str.19 = [6 x i8] c" {\00"
@.str.20 = [6 x i8] c"%3d, \00"
@.str.21 = [28 x i8] c"}, /* %2x -- %3d -- %c */\0A\00"
@str = [3 x i8] c"/*\00"
@str.23 = [73 x i8] c" * Table has the next state given last read character and current state.\00"
@str.24 = [4 x i8] c" */\00"
@str.25 = [64 x i8] c"/* Minimum state that indicates we must terminate processing */\00"
@str.26 = [3 x i8] c"*/\00"
@str.27 = [2 x i8] c"{\00"
@str.28 = [4 x i8] c"};\0A\00"
define void @state_table(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.23, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.24, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 0)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 1)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 2)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 3)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 4)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 5)
%12 = tail call i32 @putchar(i32 10)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.25, i64 0, i64 0))
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%15 = tail call i32 @putchar(i32 10)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i64 0, i64 0), i8* %0, i32 256, i32 7)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i32 0)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i32 1)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i32 2)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i32 3)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i32 4)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i32 5)
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.26, i64 0, i64 0))
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.27, i64 0, i64 0))
br label %28
26: ; preds = %94
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.28, i64 0, i64 0))
ret void
28: ; preds = %1, %94
%29 = phi i32 [ 0, %1 ], [ %101, %94 ]
%30 = trunc i32 %29 to i8
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0))
%32 = shl i32 %29, 24
%33 = icmp eq i32 %32, 1023410176
switch i32 %32, label %34 [
i32 989855744, label %41
i32 0, label %41
]
34: ; preds = %28
%35 = tail call i64 @isspace(i8 signext %30)
%36 = icmp ne i64 %35, 0
%37 = xor i1 %33, true
%38 = select i1 %36, i1 true, i1 %37
%39 = xor i1 %36, true
%40 = zext i1 %39 to i32
br i1 %38, label %41, label %49
41: ; preds = %34, %28, %28
%42 = phi i32 [ %40, %34 ], [ 5, %28 ], [ 5, %28 ]
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 %42)
switch i32 %32, label %44 [
i32 989855744, label %54
i32 0, label %54
]
44: ; preds = %41
%45 = tail call i64 @isspace(i8 signext %30)
%46 = icmp ne i64 %45, 0
%47 = xor i1 %33, true
%48 = select i1 %46, i1 true, i1 %47
br i1 %48, label %54, label %53
49: ; preds = %34
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 5)
%51 = tail call i64 @isspace(i8 signext %30)
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %61
53: ; preds = %44, %49
br label %61
54: ; preds = %44, %41, %41
%55 = phi i32 [ 1, %44 ], [ 4, %41 ], [ 4, %41 ]
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 %55)
switch i32 %32, label %57 [
i32 989855744, label %72
i32 0, label %72
]
57: ; preds = %54
%58 = tail call i64 @isspace(i8 signext %30)
%59 = icmp eq i64 %58, 0
%60 = select i1 %59, i32 3, i32 2
br label %72
61: ; preds = %49, %53
%62 = phi i32 [ 1, %49 ], [ 2, %53 ]
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 %62)
%64 = tail call i64 @isspace(i8 signext %30)
%65 = icmp eq i64 %64, 0
%66 = select i1 %65, i32 3, i32 2
%67 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 %66)
%68 = tail call i64 @isspace(i8 signext %30)
%69 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 3)
%70 = tail call i64 @isspace(i8 signext %30)
%71 = icmp eq i64 %70, 0
br i1 %71, label %85, label %89
72: ; preds = %57, %54, %54
%73 = phi i32 [ 4, %54 ], [ 4, %54 ], [ %60, %57 ]
%74 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 %73)
switch i32 %32, label %75 [
i32 989855744, label %77
i32 0, label %77
]
75: ; preds = %72
%76 = tail call i64 @isspace(i8 signext %30)
br label %77
77: ; preds = %75, %72, %72
%78 = phi i32 [ 4, %72 ], [ 4, %72 ], [ 3, %75 ]
%79 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 %78)
switch i32 %32, label %80 [
i32 989855744, label %86
i32 0, label %86
]
80: ; preds = %77
%81 = tail call i64 @isspace(i8 signext %30)
%82 = icmp ne i64 %81, 0
%83 = xor i1 %33, true
%84 = select i1 %82, i1 true, i1 %83
br i1 %84, label %86, label %85
85: ; preds = %80, %61
br label %89
86: ; preds = %80, %77, %77
%87 = phi i32 [ 4, %80 ], [ 5, %77 ], [ 5, %77 ]
%88 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 %87)
switch i32 %32, label %92 [
i32 989855744, label %94
i32 0, label %94
]
89: ; preds = %85, %61
%90 = phi i32 [ 4, %61 ], [ 5, %85 ]
%91 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 %90)
br label %92
92: ; preds = %86, %89
%93 = tail call i64 @isspace(i8 signext %30)
br label %94
94: ; preds = %92, %86, %86
%95 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 5)
%96 = tail call i64 @isprint(i8 signext %30)
%97 = icmp eq i64 %96, 0
%98 = ashr exact i32 %32, 24
%99 = select i1 %97, i32 46, i32 %98
%100 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.21, i64 0, i64 0), i32 %29, i32 %29, i32 %99)
%101 = add nuw nsw i32 %29, 1
%102 = icmp eq i32 %101, 256
br i1 %102, label %26, label %28
}