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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int sscanf(char *, char *, int *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ *xreadline(char *, char *, int);
void prompt_loop(void) {
  char buf[128], tmp[32];
  char plug[8][4];
  int num_plugs = 8;
  int plug_origin = 1;
  int i;
  int authenticated = 0;
  for (i = 0; i < num_plugs; i++)
    strcpy(plug[i], "OFF");
  for (;;) {
    if (xreadline("httppower> ", buf, sizeof(buf)) == NULL)
      break;
    if (!strcmp(buf, "help")) {
      printf("Commands are:\n");
      printf(" auth admin:admin\n");
      printf(" get\n");
      printf(" post outlet [1-8]=ON|OFF\n");
    } else if (!strcmp(buf, "auth admin:admin")) {
      authenticated = 1;
    } else if (!strcmp(buf, "get")) {
      if (!authenticated)
        goto err;
      printf(
          "<html>\n<head>\n\n<META HTTP-EQUIV=\"Refresh\" "
          "CONTENT=\"300\">\n<title>Outlet Control  - Lite Power "
          "Controller</title></head>\n\n<body alink=\"#0000FF\" "
          "vlink=\"#0000FF\">\n<FONT FACE=\"Arial, Helvetica, "
          "Sans-Serif\">\n<table width=\"100%%\" cellspacing=0 "
          "cellpadding=0>\n<tr>\n<td valign=top width=\"17%%\" "
          "height=\"100%%\">\n\n    <!-- menu -->\n    <table width=\"100%%\" "
          "height=\"100%%\" align=center border=0 cellspacing=1 "
          "cellpadding=0>\n    <tr><td valign=top bgcolor=\"#F4F4F4\">\n    "
          "<table width=\"100%%\" cellpadding=1 cellspacing=5>\n\n    <tr><td "
          "align=center>\n    <table><tr><td><a "
          "href=\"http://www.webpowerswitch.com/\"><img src=logo.gif width=195 "
          "height=65 border=0></a></td>\n    <td><b><font size=-1>Ethernet "
          "Power Controller</font></b></td></tr></table>\n    <hr>\n    "
          "</td></tr>\n\n\n\n<tr><td nowrap><b><a href=\"/index.htm\">Outlet "
          "Control</a></b></td></tr>\n<tr><td nowrap><b><a "
          "href=\"/admin.htm\">Setup</a></b></td></tr>\n\n\n\n<tr><td "
          "nowrap><b><a href=\"/ap.htm\">AutoPing</a></b></td></tr>\n<tr><td "
          "nowrap><b><a href=\"/logout\">Logout</a></b></td></tr>\n<tr><td "
          "nowrap><b><a "
          "href=\"http://www.digital-loggers.com/lpchelp.html\">Help</a></b></"
          "td></tr>\n\n<tr><td><hr></td></tr>\n\n\n<tr><td><b><a "
          "href=\"http://www.digital-loggers.com\">Link "
          "1</a></b></td></tr>\n\n<tr><td><b><a "
          "href=\"http://www.digital-loggers.com\">Link "
          "2</a></b></td></tr>\n\n<tr><td><b><a "
          "href=\"http://www.digital-loggers.com\">Link "
          "3</a></b></td></tr>\n\n<tr><td><b><a "
          "href=\"http://www.digital-loggers.com\">Link "
          "4</a></b></td></tr>\n\n\n    </table>\n    </td></tr>\n\n\n    "
          "<tr><td valign=bottom height=\"100%%\" bgcolor=\"#F4F4F4\">\n    "
          "<small>Version 1.2.1 (Aug 23 2007 / 20:14:33) "
          "1555A5A1-D43E3FC2</small>\n    </td></tr>\n    <tr><td "
          "valign=bottom height=\"100%%\" bgcolor=\"#F4F4F4\">\n    "
          "<small>S/N:0000130175</small>\n    </td></tr>\n\n    </table>\n    "
          "<!-- /menu -->\n\n</td>\n<td valign=top width=\"83%%\">\n\n    <!-- "
          "heading table -->\n    <table width=\"100%%\" align=center border=0 "
          "cellspacing=1 cellpadding=3>\n\n        <tr>\n        <th "
          "bgcolor=\"#DDDDFF\" align=left>\n        Controller: Lite Power "
          "Controller\n        </th>\n        </tr>\n\n        <tr "
          "bgcolor=\"#FFFFFF\" align=left>\n        <td>\n        Uptime:     "
          "0:35:01 <!-- 2101s up -->\n        </td>\n        </tr>\n\n    "
          "</table>\n    <!-- /heading table -->\n\n    <br>\n\n    <!-- "
          "individual control table -->\n    <table width=\"100%%\" "
          "align=center border=0 cellspacing=1 cellpadding=3>\n\n        "
          "<tr>\n        <th bgcolor=\"#DDDDFF\" colspan=5 align=left>\n       "
          " Individual Control\n        </th>\n        </tr>\n\n        <!-- "
          "heading rows -->\n        <tr bgcolor=\"#DDDDDD\">\n        "
          "<th>#</th>\n        <th align=left>Name</th>\n        <th "
          "align=left>State</th>\n        <th align=left "
          "colspan=2>Action</th>\n        </tr>\n        <!-- /heading rows "
          "-->\n\n\n\n\n<tr bgcolor=\"#F4F4F4\"><td "
          "align=center>1</td>\n<td>Outlet 1</td><td>\n<b><font "
          "color=red>%s</font></b></td><td>\n<a href=outlet?1=ON>Switch "
          "ON</a>\n</td><td>\n<!-- <a href=outlet?1=CCL>Cycle</a> "
          "-->\n</td></tr>\n\n\n<tr bgcolor=\"#F4F4F4\"><td "
          "align=center>2</td>\n<td>Outlet 2</td><td>\n<b><font "
          "color=red>%s</font></b></td><td>\n<a href=outlet?2=ON>Switch "
          "ON</a>\n</td><td>\n<!-- <a href=outlet?2=CCL>Cycle</a> "
          "-->\n</td></tr>\n\n\n<tr bgcolor=\"#F4F4F4\"><td "
          "align=center>3</td>\n<td>Outlet 3</td><td>\n<b><font "
          "color=red>%s</font></b></td><td>\n<a href=outlet?3=ON>Switch "
          "ON</a>\n</td><td>\n<!-- <a href=outlet?3=CCL>Cycle</a> "
          "-->\n</td></tr>\n\n\n<tr bgcolor=\"#F4F4F4\"><td "
          "align=center>4</td>\n<td>Outlet 4</td><td>\n<b><font "
          "color=red>%s</font></b></td><td>\n<a href=outlet?4=ON>Switch "
          "ON</a>\n</td><td>\n<!-- <a href=outlet?4=CCL>Cycle</a> "
          "-->\n</td></tr>\n\n\n<tr bgcolor=\"#F4F4F4\"><td "
          "align=center>5</td>\n<td>Outlet 5</td><td>\n<b><font "
          "color=red>%s</font></b></td><td>\n<a href=outlet?5=ON>Switch "
          "ON</a>\n</td><td>\n<!-- <a href=outlet?5=CCL>Cycle</a> "
          "-->\n</td></tr>\n\n\n<tr bgcolor=\"#F4F4F4\"><td "
          "align=center>6</td>\n<td>Outlet 6</td><td>\n<b><font "
          "color=red>%s</font></b></td><td>\n<a href=outlet?6=ON>Switch "
          "ON</a>\n</td><td>\n<!-- <a href=outlet?6=CCL>Cycle</a> "
          "-->\n</td></tr>\n\n\n<tr bgcolor=\"#F4F4F4\"><td "
          "align=center>7</td>\n<td>Outlet 7</td><td>\n<b><font "
          "color=red>%s</font></b></td><td>\n<a href=outlet?7=ON>Switch "
          "ON</a>\n</td><td>\n<!-- <a href=outlet?7=CCL>Cycle</a> "
          "-->\n</td></tr>\n\n\n<tr bgcolor=\"#F4F4F4\"><td "
          "align=center>8</td>\n<td>Outlet 8</td><td>\n<b><font "
          "color=red>%s</font></b></td><td>\n<a href=outlet?8=ON>Switch "
          "ON</a>\n</td><td>\n<!-- <a href=outlet?8=CCL>Cycle</a> "
          "-->\n</td></tr>\n\n\n    </table>\n    <!-- /individual control "
          "table -->\n\n    <br>\n\n<table width=\"100%%\" align=center "
          "border=0 cellspacing=1 cellpadding=3>\n<tr><th bgcolor=\"#DDDDFF\" "
          "align=left>Master Control</th></tr>\n<tr><td bgcolor=\"#F4F4F4\" "
          "align=left><a href=outlet?a=OFF>All outlets "
          "OFF</a></td></tr>\n<tr><td bgcolor=\"#F4F4F4\" align=left><a "
          "href=outlet?a=ON>All outlets ON</a></td></tr>\n<tr><td "
          "bgcolor=\"#F4F4F4\" align=left><a href=outlet?a=CCL>Cycle all "
          "outlets</a></td></tr>\n\n<tr><td align=center>Sequence delay: 1 "
          "sec.</td></tr>\n\n</table>\n\n\n</td>\n</tr>\n</table>\n\n</"
          "body>\n</html>\n",
          plug[0], plug[1], plug[2], plug[3], plug[4], plug[5], plug[6],
          plug[7]);
    } else if (sscanf(buf, "post outlet %d=%s", &i, tmp) == 2) {
      if (!authenticated)
        goto err;
      if (i < plug_origin || i >= num_plugs + plug_origin)
        goto err;
      if (!strcmp(tmp, "ON"))
        strcpy(plug[i - plug_origin], "ON");
      else if (!strcmp(tmp, "OFF"))
        strcpy(plug[i - plug_origin], "OFF");
      else
        goto err;
      printf("<HTML><HEAD>\n\n<META HTTP-EQUIV=\"refresh\" content=\"0; "
             "URL=/index.htm\">\n\n</HEAD><BODY></BODY>\n");
    } else
      goto err;
    continue;
  err:
    printf("Error\n");
  }
}


x86 assembly (clang, -O0):
<prompt_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x8,-0xc4(%rbp)
movl   $0x1,-0xc8(%rbp)
movl   $0x0,-0xd0(%rbp)
movl   $0x0,-0xcc(%rbp)
mov    -0xcc(%rbp),%eax
cmp    -0xc4(%rbp),%eax
jge    11ca <prompt_loop+0x7a>
movslq -0xcc(%rbp),%rax
lea    -0xc0(%rbp),%rdi
shl    $0x2,%rax
add    %rax,%rdi
lea    0xe4f(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0xcc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xcc(%rbp)
jmp    1183 <prompt_loop+0x33>
jmp    11cf <prompt_loop+0x7f>
lea    -0x80(%rbp),%rsi
lea    0xe2a(%rip),%rdi
mov    $0x80,%edx
call   1050 <xreadline@plt>
cmp    $0x0,%rax
jne    11f3 <prompt_loop+0xa3>
jmp    1456 <prompt_loop+0x306>
lea    -0x80(%rbp),%rdi
lea    0xe12(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1249 <prompt_loop+0xf9>
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe03(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    143e <prompt_loop+0x2ee>
lea    -0x80(%rbp),%rdi
lea    0xe04(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1271 <prompt_loop+0x121>
movl   $0x1,-0xd0(%rbp)
jmp    1439 <prompt_loop+0x2e9>
lea    -0x80(%rbp),%rdi
lea    0xded(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1311 <prompt_loop+0x1c1>
cmpl   $0x0,-0xd0(%rbp)
jne    129c <prompt_loop+0x14c>
jmp    1443 <prompt_loop+0x2f3>
lea    -0xc0(%rbp),%rsi
lea    -0xc0(%rbp),%rdx
add    $0x4,%rdx
lea    -0xc0(%rbp),%rcx
add    $0x8,%rcx
lea    -0xc0(%rbp),%r8
add    $0xc,%r8
lea    -0xc0(%rbp),%r9
add    $0x10,%r9
lea    -0xc0(%rbp),%r11
add    $0x14,%r11
lea    -0xc0(%rbp),%r10
add    $0x18,%r10
lea    -0xc0(%rbp),%rax
add    $0x1c,%rax
lea    0xd76(%rip),%rdi
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1434 <prompt_loop+0x2e4>
lea    -0x80(%rbp),%rdi
lea    -0xa0(%rbp),%rcx
lea    0x2088(%rip),%rsi
lea    -0xcc(%rbp),%rdx
call   1070 <sscanf@plt>
cmp    $0x2,%eax
jne    142a <prompt_loop+0x2da>
cmpl   $0x0,-0xd0(%rbp)
jne    134a <prompt_loop+0x1fa>
jmp    1443 <prompt_loop+0x2f3>
mov    -0xcc(%rbp),%eax
cmp    -0xc8(%rbp),%eax
jl     1376 <prompt_loop+0x226>
mov    -0xcc(%rbp),%eax
mov    -0xc4(%rbp),%ecx
add    -0xc8(%rbp),%ecx
cmp    %ecx,%eax
jl     137b <prompt_loop+0x22b>
jmp    1443 <prompt_loop+0x2f3>
lea    -0xa0(%rbp),%rdi
lea    0x2034(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    13c4 <prompt_loop+0x274>
mov    -0xcc(%rbp),%eax
sub    -0xc8(%rbp),%eax
cltq
lea    -0xc0(%rbp),%rdi
shl    $0x2,%rax
add    %rax,%rdi
lea    0x2003(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1417 <prompt_loop+0x2c7>
lea    -0xa0(%rbp),%rdi
lea    0xc2e(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    140d <prompt_loop+0x2bd>
mov    -0xcc(%rbp),%eax
sub    -0xc8(%rbp),%eax
cltq
lea    -0xc0(%rbp),%rdi
shl    $0x2,%rax
add    %rax,%rdi
lea    0xbfd(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1412 <prompt_loop+0x2c2>
jmp    1443 <prompt_loop+0x2f3>
jmp    1417 <prompt_loop+0x2c7>
lea    0x1fa2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    142f <prompt_loop+0x2df>
jmp    1443 <prompt_loop+0x2f3>
jmp    1434 <prompt_loop+0x2e4>
jmp    1439 <prompt_loop+0x2e9>
jmp    143e <prompt_loop+0x2ee>
jmp    11cf <prompt_loop+0x7f>
lea    0x1fd3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11cf <prompt_loop+0x7f>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt_loop>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
lea    0x2237(%rip),%rbx
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
movl   $0x1,0xc(%rsp)
lea    0x14(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
movl   $0x2,0xc(%rsp)
lea    0x18(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
movl   $0x3,0xc(%rsp)
lea    0x1c(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
movl   $0x4,0xc(%rsp)
lea    0x20(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
movl   $0x5,0xc(%rsp)
lea    0x24(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
movl   $0x6,0xc(%rsp)
lea    0x28(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
movl   $0x7,0xc(%rsp)
lea    0x2c(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
movl   $0x8,0xc(%rsp)
lea    0xde9(%rip),%rdi
lea    0x50(%rsp),%rsi
mov    $0x80,%edx
call   1060 <xreadline@plt>
test   %rax,%rax
je     1406 <prompt_loop+0x2b6>
lea    0x14(%rsp),%rbx
lea    0xdc5(%rip),%r13
lea    0x50(%rsp),%rbp
movabs $0x6d64612068747561,%r12
61 64 6d
xor    %r15d,%r15d
nopl   (%rax)
mov    0x50(%rsp),%eax
mov    $0x706c6568,%ecx
xor    %ecx,%eax
movzbl 0x54(%rsp),%ecx
or     %eax,%ecx
je     1387 <prompt_loop+0x237>
mov    0x58(%rsp),%rax
movabs $0x6e696d64613a6e69,%rcx
6d 69 6e
xor    %rcx,%rax
mov    0x50(%rsp),%rcx
xor    %r12,%rcx
movzbl 0x60(%rsp),%edx
or     %rcx,%rdx
mov    $0x1,%r14d
or     %rax,%rdx
je     13ba <prompt_loop+0x26a>
cmpl   $0x746567,0x50(%rsp)
jne    1300 <prompt_loop+0x1b0>
test   %r15d,%r15d
je     1360 <prompt_loop+0x210>
sub    $0x8,%rsp
lea    0xd5a(%rip),%rdi
lea    0x18(%rsp),%rsi
mov    %rbx,%rdx
lea    0x20(%rsp),%rcx
lea    0x24(%rsp),%r8
lea    0x28(%rsp),%r9
xor    %eax,%eax
mov    %rbx,%r10
lea    0x34(%rsp),%rbx
push   %rbx
lea    0x38(%rsp),%rbx
push   %rbx
lea    0x3c(%rsp),%rbx
push   %rbx
mov    %r10,%rbx
call   1050 <printf@plt>
add    $0x20,%rsp
jmp    13ba <prompt_loop+0x26a>
cs nopw 0x0(%rax,%rax,1)
mov    %rbp,%rdi
lea    0x2045(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x30(%rsp),%rcx
call   1070 <sscanf@plt>
cmp    $0x2,%eax
jne    1360 <prompt_loop+0x210>
test   %r15d,%r15d
je     1360 <prompt_loop+0x210>
mov    0xc(%rsp),%eax
lea    -0x9(%rax),%ecx
cmp    $0xfffffff8,%ecx
jb     1360 <prompt_loop+0x210>
mov    0x30(%rsp),%ecx
mov    $0x4e4f,%edx
xor    %edx,%ecx
movzbl 0x32(%rsp),%edx
or     %cx,%dx
je     13d8 <prompt_loop+0x288>
cmpl   $0x46464f,0x30(%rsp)
je     13e1 <prompt_loop+0x291>
cs nopw 0x0(%rax,%rax,1)
lea    0x203c(%rip),%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
mov    $0x80,%edx
call   1060 <xreadline@plt>
test   %rax,%rax
jne    1250 <prompt_loop+0x100>
jmp    1406 <prompt_loop+0x2b6>
lea    0x1fd6(%rip),%rdi
call   1040 <puts@plt>
lea    0x1fd8(%rip),%rdi
call   1040 <puts@plt>
lea    0x1fde(%rip),%rdi
call   1040 <puts@plt>
lea    0x1fd7(%rip),%rdi
call   1040 <puts@plt>
mov    %r15d,%r14d
mov    %r13,%rdi
mov    %rbp,%rsi
mov    $0x80,%edx
call   1060 <xreadline@plt>
mov    %r14d,%r15d
test   %rax,%rax
jne    1250 <prompt_loop+0x100>
jmp    1406 <prompt_loop+0x2b6>
lea    0x1f82(%rip),%rsi
jmp    13e8 <prompt_loop+0x298>
lea    0x1fb7(%rip),%rsi
add    $0xffffffff,%eax
lea    (%rsp,%rax,4),%rdi
add    $0x10,%rdi
call   1030 <strcpy@plt>
lea    0x1faa(%rip),%rdi
call   1040 <puts@plt>
jmp    13ba <prompt_loop+0x26a>
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"OFF\00"
@.str.1 = [12 x i8] c"httppower> \00"
@.str.2 = [5 x i8] c"help\00"
@.str.3 = [15 x i8] c"Commands are:\0A\00"
@.str.4 = [19 x i8] c" auth admin:admin\0A\00"
@.str.5 = [6 x i8] c" get\0A\00"
@.str.6 = [27 x i8] c" post outlet [1-8]=ON|OFF\0A\00"
@.str.7 = [17 x i8] c"auth admin:admin\00"
@.str.8 = [4 x i8] c"get\00"
@.str.9 = [4926 x i8] c"<html>\0A<head>\0A\0A<META HTTP-EQUIV=\22Refresh\22 CONTENT=\22300\22>\0A<title>Outlet Control - Lite Power Controller</title></head>\0A\0A<body alink=\22FF\22 vlink=\22FF\22>\0A<FONT FACE=\22Arial, Helvetica, Sans-Serif\22>\0A<table width=\22100%%\22 cellspacing=0 cellpadding=0>\0A<tr>\0A<td valign=top width=\2217%%\22 height=\22100%%\22>\0A\0A <!-- menu -->\0A <table width=\22100%%\22 height=\22100%%\22 align=center border=0 cellspacing=1 cellpadding=0>\0A <tr><td valign=top bgcolor=\22#F4F4F4\22>\0A <table width=\22100%%\22 cellpadding=1 cellspacing=5>\0A\0A <tr><td align=center>\0A <table><tr><td><a href=\22http://www.webpowerswitch.com/\22><img src=logo.gif width=195 height=65 border=0></a></td>\0A <td><b><font size=-1>Ethernet Power Controller</font></b></td></tr></table>\0A <hr>\0A </td></tr>\0A\0A\0A\0A<tr><td nowrap><b><a href=\22/index.htm\22>Outlet Control</a></b></td></tr>\0A<tr><td nowrap><b><a href=\22/admin.htm\22>Setup</a></b></td></tr>\0A\0A\0A\0A<tr><td nowrap><b><a href=\22/ap.htm\22>AutoPing</a></b></td></tr>\0A<tr><td nowrap><b><a href=\22/logout\22>Logout</a></b></td></tr>\0A<tr><td nowrap><b><a href=\22http://www.digital-loggers.com/lpchelp.html\22>Help</a></b></td></tr>\0A\0A<tr><td><hr></td></tr>\0A\0A\0A<tr><td><b><a href=\22http://www.digital-loggers.com\22>Link 1</a></b></td></tr>\0A\0A<tr><td><b><a href=\22http://www.digital-loggers.com\22>Link 2</a></b></td></tr>\0A\0A<tr><td><b><a href=\22http://www.digital-loggers.com\22>Link 3</a></b></td></tr>\0A\0A<tr><td><b><a href=\22http://www.digital-loggers.com\22>Link 4</a></b></td></tr>\0A\0A\0A </table>\0A </td></tr>\0A\0A\0A <tr><td valign=bottom height=\22100%%\22 bgcolor=\22#F4F4F4\22>\0A <small>Version 1.2.1 (Aug 23 2007 / 20:14:33) 1555A5A1-D43E3FC2</small>\0A </td></tr>\0A <tr><td valign=bottom height=\22100%%\22 bgcolor=\22#F4F4F4\22>\0A <small>S/N:0000130175</small>\0A </td></tr>\0A\0A </table>\0A <!-- /menu -->\0A\0A</td>\0A<td valign=top width=\2283%%\22>\0A\0A <!-- heading table -->\0A <table width=\22100%%\22 align=center border=0 cellspacing=1 cellpadding=3>\0A\0A <tr>\0A <th bgcolor=\22#DDDDFF\22 align=left>\0A Controller: Lite Power Controller\0A </th>\0A </tr>\0A\0A <tr bgcolor=\22#FFFFFF\22 align=left>\0A <td>\0A Uptime: 0:35:01 <!-- 2101s up -->\0A </td>\0A </tr>\0A\0A </table>\0A <!-- /heading table -->\0A\0A <br>\0A\0A <!-- individual control table -->\0A <table width=\22100%%\22 align=center border=0 cellspacing=1 cellpadding=3>\0A\0A <tr>\0A <th bgcolor=\22#DDDDFF\22 colspan=5 align=left>\0A Individual Control\0A </th>\0A </tr>\0A\0A <!-- heading rows -->\0A <tr bgcolor=\22#DDDDDD\22>\0A <th>#</th>\0A <th align=left>Name</th>\0A <th align=left>State</th>\0A <th align=left colspan=2>Action</th>\0A </tr>\0A <!-- /heading rows -->\0A\0A\0A\0A\0A<tr bgcolor=\22#F4F4F4\22><td align=center>1</td>\0A<td>Outlet 1</td><td>\0A<b><font color=red>%s</font></b></td><td>\0A<a href=outlet?1=ON>Switch ON</a>\0A</td><td>\0A<!-- <a href=outlet?1=CCL>Cycle</a> -->\0A</td></tr>\0A\0A\0A<tr bgcolor=\22#F4F4F4\22><td align=center>2</td>\0A<td>Outlet 2</td><td>\0A<b><font color=red>%s</font></b></td><td>\0A<a href=outlet?2=ON>Switch ON</a>\0A</td><td>\0A<!-- <a href=outlet?2=CCL>Cycle</a> -->\0A</td></tr>\0A\0A\0A<tr bgcolor=\22#F4F4F4\22><td align=center>3</td>\0A<td>Outlet 3</td><td>\0A<b><font color=red>%s</font></b></td><td>\0A<a href=outlet?3=ON>Switch ON</a>\0A</td><td>\0A<!-- <a href=outlet?3=CCL>Cycle</a> -->\0A</td></tr>\0A\0A\0A<tr bgcolor=\22#F4F4F4\22><td align=center>4</td>\0A<td>Outlet 4</td><td>\0A<b><font color=red>%s</font></b></td><td>\0A<a href=outlet?4=ON>Switch ON</a>\0A</td><td>\0A<!-- <a href=outlet?4=CCL>Cycle</a> -->\0A</td></tr>\0A\0A\0A<tr bgcolor=\22#F4F4F4\22><td align=center>5</td>\0A<td>Outlet 5</td><td>\0A<b><font color=red>%s</font></b></td><td>\0A<a href=outlet?5=ON>Switch ON</a>\0A</td><td>\0A<!-- <a href=outlet?5=CCL>Cycle</a> -->\0A</td></tr>\0A\0A\0A<tr bgcolor=\22#F4F4F4\22><td align=center>6</td>\0A<td>Outlet 6</td><td>\0A<b><font color=red>%s</font></b></td><td>\0A<a href=outlet?6=ON>Switch ON</a>\0A</td><td>\0A<!-- <a href=outlet?6=CCL>Cycle</a> -->\0A</td></tr>\0A\0A\0A<tr bgcolor=\22#F4F4F4\22><td align=center>7</td>\0A<td>Outlet 7</td><td>\0A<b><font color=red>%s</font></b></td><td>\0A<a href=outlet?7=ON>Switch ON</a>\0A</td><td>\0A<!-- <a href=outlet?7=CCL>Cycle</a> -->\0A</td></tr>\0A\0A\0A<tr bgcolor=\22#F4F4F4\22><td align=center>8</td>\0A<td>Outlet 8</td><td>\0A<b><font color=red>%s</font></b></td><td>\0A<a href=outlet?8=ON>Switch ON</a>\0A</td><td>\0A<!-- <a href=outlet?8=CCL>Cycle</a> -->\0A</td></tr>\0A\0A\0A </table>\0A <!-- /individual control table -->\0A\0A <br>\0A\0A<table width=\22100%%\22 align=center border=0 cellspacing=1 cellpadding=3>\0A<tr><th bgcolor=\22#DDDDFF\22 align=left>Master Control</th></tr>\0A<tr><td bgcolor=\22#F4F4F4\22 align=left><a href=outlet?a=OFF>All outlets OFF</a></td></tr>\0A<tr><td bgcolor=\22#F4F4F4\22 align=left><a href=outlet?a=ON>All outlets ON</a></td></tr>\0A<tr><td bgcolor=\22#F4F4F4\22 align=left><a href=outlet?a=CCL>Cycle all outlets</a></td></tr>\0A\0A<tr><td align=center>Sequence delay: 1 sec.</td></tr>\0A\0A</table>\0A\0A\0A</td>\0A</tr>\0A</table>\0A\0A</body>\0A</html>\0A\00"
@.str.10 = [18 x i8] c"post outlet %d=%s\00"
@.str.11 = [3 x i8] c"ON\00"
@.str.12 = [93 x i8] c"<HTML><HEAD>\0A\0A<META HTTP-EQUIV=\22refresh\22 content=\220; URL=/index.htm\22>\0A\0A</HEAD><BODY></BODY>\0A\00"
@.str.13 = [7 x i8] c"Error\0A\00"
define void @prompt_loop() {
%1 = alloca [128 x i8]
%2 = alloca [32 x i8]
%3 = alloca [8 x [4 x i8]]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 8, i32* %4
store i32 1, i32* %5
store i32 0, i32* %7
store i32 0, i32* %6
br label %8
8: ; preds = %18, %0
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %21
12: ; preds = %8
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 %14
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %15, i64 0, i64 0
%17 = call i32 @strcpy(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %12
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %8
21: ; preds = %8
br label %22
22: ; preds = %120, %119, %21
%23 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%24 = call i32* @xreadline(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %23, i32 128)
%25 = icmp eq i32* %24, null
br i1 %25, label %26, label %27
26: ; preds = %22
br label %122
27: ; preds = %22
%28 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%29 = call i32 @strcmp(i8* %28, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%30 = icmp ne i32 %29, 0
br i1 %30, label %36, label %31
31: ; preds = %27
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
br label %119
36: ; preds = %27
%37 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%38 = call i32 @strcmp(i8* %37, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0))
%39 = icmp ne i32 %38, 0
br i1 %39, label %41, label %40
40: ; preds = %36
store i32 1, i32* %7
br label %118
41: ; preds = %36
%42 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%43 = call i32 @strcmp(i8* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%44 = icmp ne i32 %43, 0
br i1 %44, label %67, label %45
45: ; preds = %41
%46 = load i32, i32* %7
%47 = icmp ne i32 %46, 0
br i1 %47, label %49, label %48
48: ; preds = %45
br label %120
49: ; preds = %45
%50 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 0
%51 = getelementptr inbounds [4 x i8], [4 x i8]* %50, i64 0, i64 0
%52 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 1
%53 = getelementptr inbounds [4 x i8], [4 x i8]* %52, i64 0, i64 0
%54 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 2
%55 = getelementptr inbounds [4 x i8], [4 x i8]* %54, i64 0, i64 0
%56 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 3
%57 = getelementptr inbounds [4 x i8], [4 x i8]* %56, i64 0, i64 0
%58 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 4
%59 = getelementptr inbounds [4 x i8], [4 x i8]* %58, i64 0, i64 0
%60 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 5
%61 = getelementptr inbounds [4 x i8], [4 x i8]* %60, i64 0, i64 0
%62 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 6
%63 = getelementptr inbounds [4 x i8], [4 x i8]* %62, i64 0, i64 0
%64 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 7
%65 = getelementptr inbounds [4 x i8], [4 x i8]* %64, i64 0, i64 0
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4926 x i8], [4926 x i8]* @.str.9, i64 0, i64 0), i8* %51, i8* %53, i8* %55, i8* %57, i8* %59, i8* %61, i8* %63, i8* %65)
br label %117
67: ; preds = %41
%68 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%69 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%70 = call i32 @sscanf(i8* %68, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32* %6, i8* %69)
%71 = icmp eq i32 %70, 2
br i1 %71, label %72, label %115
72: ; preds = %67
%73 = load i32, i32* %7
%74 = icmp ne i32 %73, 0
br i1 %74, label %76, label %75
75: ; preds = %72
br label %120
76: ; preds = %72
%77 = load i32, i32* %6
%78 = load i32, i32* %5
%79 = icmp slt i32 %77, %78
br i1 %79, label %86, label %80
80: ; preds = %76
%81 = load i32, i32* %6
%82 = load i32, i32* %4
%83 = load i32, i32* %5
%84 = add nsw i32 %82, %83
%85 = icmp sge i32 %81, %84
br i1 %85, label %86, label %87
86: ; preds = %80, %76
br label %120
87: ; preds = %80
%88 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%89 = call i32 @strcmp(i8* %88, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%90 = icmp ne i32 %89, 0
br i1 %90, label %99, label %91
91: ; preds = %87
%92 = load i32, i32* %6
%93 = load i32, i32* %5
%94 = sub nsw i32 %92, %93
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 %95
%97 = getelementptr inbounds [4 x i8], [4 x i8]* %96, i64 0, i64 0
%98 = call i32 @strcpy(i8* %97, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
br label %113
99: ; preds = %87
%100 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%101 = call i32 @strcmp(i8* %100, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%102 = icmp ne i32 %101, 0
br i1 %102, label %111, label %103
103: ; preds = %99
%104 = load i32, i32* %6
%105 = load i32, i32* %5
%106 = sub nsw i32 %104, %105
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 %107
%109 = getelementptr inbounds [4 x i8], [4 x i8]* %108, i64 0, i64 0
%110 = call i32 @strcpy(i8* %109, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %112
111: ; preds = %99
br label %120
112: ; preds = %103
br label %113
113: ; preds = %112, %91
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.12, i64 0, i64 0))
br label %116
115: ; preds = %67
br label %120
116: ; preds = %113
br label %117
117: ; preds = %116, %49
br label %118
118: ; preds = %117, %40
br label %119
119: ; preds = %118, %31
br label %22
120: ; preds = %115, %111, %86, %75, %48
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
br label %22
122: ; preds = %26
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"OFF\00"
@.str.1 = [12 x i8] c"httppower> \00"
@.str.2 = [5 x i8] c"help\00"
@.str.7 = [17 x i8] c"auth admin:admin\00"
@.str.9 = [4926 x i8] c"<html>\0A<head>\0A\0A<META HTTP-EQUIV=\22Refresh\22 CONTENT=\22300\22>\0A<title>Outlet Control - Lite Power Controller</title></head>\0A\0A<body alink=\22FF\22 vlink=\22FF\22>\0A<FONT FACE=\22Arial, Helvetica, Sans-Serif\22>\0A<table width=\22100%%\22 cellspacing=0 cellpadding=0>\0A<tr>\0A<td valign=top width=\2217%%\22 height=\22100%%\22>\0A\0A <!-- menu -->\0A <table width=\22100%%\22 height=\22100%%\22 align=center border=0 cellspacing=1 cellpadding=0>\0A <tr><td valign=top bgcolor=\22#F4F4F4\22>\0A <table width=\22100%%\22 cellpadding=1 cellspacing=5>\0A\0A <tr><td align=center>\0A <table><tr><td><a href=\22http://www.webpowerswitch.com/\22><img src=logo.gif width=195 height=65 border=0></a></td>\0A <td><b><font size=-1>Ethernet Power Controller</font></b></td></tr></table>\0A <hr>\0A </td></tr>\0A\0A\0A\0A<tr><td nowrap><b><a href=\22/index.htm\22>Outlet Control</a></b></td></tr>\0A<tr><td nowrap><b><a href=\22/admin.htm\22>Setup</a></b></td></tr>\0A\0A\0A\0A<tr><td nowrap><b><a href=\22/ap.htm\22>AutoPing</a></b></td></tr>\0A<tr><td nowrap><b><a href=\22/logout\22>Logout</a></b></td></tr>\0A<tr><td nowrap><b><a href=\22http://www.digital-loggers.com/lpchelp.html\22>Help</a></b></td></tr>\0A\0A<tr><td><hr></td></tr>\0A\0A\0A<tr><td><b><a href=\22http://www.digital-loggers.com\22>Link 1</a></b></td></tr>\0A\0A<tr><td><b><a href=\22http://www.digital-loggers.com\22>Link 2</a></b></td></tr>\0A\0A<tr><td><b><a href=\22http://www.digital-loggers.com\22>Link 3</a></b></td></tr>\0A\0A<tr><td><b><a href=\22http://www.digital-loggers.com\22>Link 4</a></b></td></tr>\0A\0A\0A </table>\0A </td></tr>\0A\0A\0A <tr><td valign=bottom height=\22100%%\22 bgcolor=\22#F4F4F4\22>\0A <small>Version 1.2.1 (Aug 23 2007 / 20:14:33) 1555A5A1-D43E3FC2</small>\0A </td></tr>\0A <tr><td valign=bottom height=\22100%%\22 bgcolor=\22#F4F4F4\22>\0A <small>S/N:0000130175</small>\0A </td></tr>\0A\0A </table>\0A <!-- /menu -->\0A\0A</td>\0A<td valign=top width=\2283%%\22>\0A\0A <!-- heading table -->\0A <table width=\22100%%\22 align=center border=0 cellspacing=1 cellpadding=3>\0A\0A <tr>\0A <th bgcolor=\22#DDDDFF\22 align=left>\0A Controller: Lite Power Controller\0A </th>\0A </tr>\0A\0A <tr bgcolor=\22#FFFFFF\22 align=left>\0A <td>\0A Uptime: 0:35:01 <!-- 2101s up -->\0A </td>\0A </tr>\0A\0A </table>\0A <!-- /heading table -->\0A\0A <br>\0A\0A <!-- individual control table -->\0A <table width=\22100%%\22 align=center border=0 cellspacing=1 cellpadding=3>\0A\0A <tr>\0A <th bgcolor=\22#DDDDFF\22 colspan=5 align=left>\0A Individual Control\0A </th>\0A </tr>\0A\0A <!-- heading rows -->\0A <tr bgcolor=\22#DDDDDD\22>\0A <th>#</th>\0A <th align=left>Name</th>\0A <th align=left>State</th>\0A <th align=left colspan=2>Action</th>\0A </tr>\0A <!-- /heading rows -->\0A\0A\0A\0A\0A<tr bgcolor=\22#F4F4F4\22><td align=center>1</td>\0A<td>Outlet 1</td><td>\0A<b><font color=red>%s</font></b></td><td>\0A<a href=outlet?1=ON>Switch ON</a>\0A</td><td>\0A<!-- <a href=outlet?1=CCL>Cycle</a> -->\0A</td></tr>\0A\0A\0A<tr bgcolor=\22#F4F4F4\22><td align=center>2</td>\0A<td>Outlet 2</td><td>\0A<b><font color=red>%s</font></b></td><td>\0A<a href=outlet?2=ON>Switch ON</a>\0A</td><td>\0A<!-- <a href=outlet?2=CCL>Cycle</a> -->\0A</td></tr>\0A\0A\0A<tr bgcolor=\22#F4F4F4\22><td align=center>3</td>\0A<td>Outlet 3</td><td>\0A<b><font color=red>%s</font></b></td><td>\0A<a href=outlet?3=ON>Switch ON</a>\0A</td><td>\0A<!-- <a href=outlet?3=CCL>Cycle</a> -->\0A</td></tr>\0A\0A\0A<tr bgcolor=\22#F4F4F4\22><td align=center>4</td>\0A<td>Outlet 4</td><td>\0A<b><font color=red>%s</font></b></td><td>\0A<a href=outlet?4=ON>Switch ON</a>\0A</td><td>\0A<!-- <a href=outlet?4=CCL>Cycle</a> -->\0A</td></tr>\0A\0A\0A<tr bgcolor=\22#F4F4F4\22><td align=center>5</td>\0A<td>Outlet 5</td><td>\0A<b><font color=red>%s</font></b></td><td>\0A<a href=outlet?5=ON>Switch ON</a>\0A</td><td>\0A<!-- <a href=outlet?5=CCL>Cycle</a> -->\0A</td></tr>\0A\0A\0A<tr bgcolor=\22#F4F4F4\22><td align=center>6</td>\0A<td>Outlet 6</td><td>\0A<b><font color=red>%s</font></b></td><td>\0A<a href=outlet?6=ON>Switch ON</a>\0A</td><td>\0A<!-- <a href=outlet?6=CCL>Cycle</a> -->\0A</td></tr>\0A\0A\0A<tr bgcolor=\22#F4F4F4\22><td align=center>7</td>\0A<td>Outlet 7</td><td>\0A<b><font color=red>%s</font></b></td><td>\0A<a href=outlet?7=ON>Switch ON</a>\0A</td><td>\0A<!-- <a href=outlet?7=CCL>Cycle</a> -->\0A</td></tr>\0A\0A\0A<tr bgcolor=\22#F4F4F4\22><td align=center>8</td>\0A<td>Outlet 8</td><td>\0A<b><font color=red>%s</font></b></td><td>\0A<a href=outlet?8=ON>Switch ON</a>\0A</td><td>\0A<!-- <a href=outlet?8=CCL>Cycle</a> -->\0A</td></tr>\0A\0A\0A </table>\0A <!-- /individual control table -->\0A\0A <br>\0A\0A<table width=\22100%%\22 align=center border=0 cellspacing=1 cellpadding=3>\0A<tr><th bgcolor=\22#DDDDFF\22 align=left>Master Control</th></tr>\0A<tr><td bgcolor=\22#F4F4F4\22 align=left><a href=outlet?a=OFF>All outlets OFF</a></td></tr>\0A<tr><td bgcolor=\22#F4F4F4\22 align=left><a href=outlet?a=ON>All outlets ON</a></td></tr>\0A<tr><td bgcolor=\22#F4F4F4\22 align=left><a href=outlet?a=CCL>Cycle all outlets</a></td></tr>\0A\0A<tr><td align=center>Sequence delay: 1 sec.</td></tr>\0A\0A</table>\0A\0A\0A</td>\0A</tr>\0A</table>\0A\0A</body>\0A</html>\0A\00"
@.str.10 = [18 x i8] c"post outlet %d=%s\00"
@.str.11 = [3 x i8] c"ON\00"
@str = [14 x i8] c"Commands are:\00"
@str.14 = [18 x i8] c" auth admin:admin\00"
@str.15 = [5 x i8] c" get\00"
@str.16 = [26 x i8] c" post outlet [1-8]=ON|OFF\00"
@str.17 = [6 x i8] c"Error\00"
@str.18 = [92 x i8] c"<HTML><HEAD>\0A\0A<META HTTP-EQUIV=\22refresh\22 content=\220; URL=/index.htm\22>\0A\0A</HEAD><BODY></BODY>\00"
define void @prompt_loop() {
%1 = alloca [128 x i8]
%2 = alloca [32 x i8]
%3 = alloca [8 x [4 x i8]]
%4 = alloca i32
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 0, i64 0
%8 = bitcast i32* %4 to i8*
%9 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 0, i64 0
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %4
%11 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 1, i64 0
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 2, i32* %4
%13 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 2, i64 0
%14 = call i32 @strcpy(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 3, i32* %4
%15 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 3, i64 0
%16 = call i32 @strcpy(i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 4, i32* %4
%17 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 4, i64 0
%18 = call i32 @strcpy(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 5, i32* %4
%19 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 5, i64 0
%20 = call i32 @strcpy(i8* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 6, i32* %4
%21 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 6, i64 0
%22 = call i32 @strcpy(i8* %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 7, i32* %4
%23 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 7, i64 0
%24 = call i32 @strcpy(i8* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 8, i32* %4
%25 = call i32* @xreadline(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32 128)
%26 = icmp eq i32* %25, null
br i1 %26, label %87, label %27
27: ; preds = %0
%28 = bitcast [128 x i8]* %1 to i32*
%29 = bitcast [32 x i8]* %2 to i32*
%30 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 1, i64 0
%31 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 2, i64 0
%32 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 3, i64 0
%33 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 4, i64 0
%34 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 5, i64 0
%35 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 6, i64 0
%36 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 7, i64 0
br label %79
37: ; preds = %79, %83
%38 = call i32 @bcmp(i8* dereferenceable(5) %5, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64 5)
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %45
40: ; preds = %37
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.14, i64 0, i64 0))
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.15, i64 0, i64 0))
%44 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.16, i64 0, i64 0))
br label %75
45: ; preds = %37
%46 = call i32 @bcmp(i8* dereferenceable(17) %5, i8* dereferenceable(17) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i64 17)
%47 = icmp eq i32 %46, 0
br i1 %47, label %75, label %48
48: ; preds = %45
%49 = load i32, i32* %28
%50 = icmp eq i32 %49, 7628135
br i1 %50, label %51, label %54
51: ; preds = %48
br i1 %82, label %83, label %52
52: ; preds = %51
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4926 x i8], [4926 x i8]* @.str.9, i64 0, i64 0), i8* %7, i8* %30, i8* %31, i8* %32, i8* %33, i8* %34, i8* %35, i8* %36)
br label %75
54: ; preds = %48
%55 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32* %4, i8* %6)
%56 = icmp eq i32 %55, 2
%57 = select i1 %56, i1 %81, i1 false
br i1 %57, label %58, label %83
58: ; preds = %54
%59 = load i32, i32* %4
%60 = add i32 %59, -9
%61 = icmp ult i32 %60, -8
br i1 %61, label %83, label %62
62: ; preds = %58
%63 = call i32 @bcmp(i8* dereferenceable(3) %6, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i64 3)
%64 = icmp eq i32 %63, 0
br i1 %64, label %68, label %65
65: ; preds = %62
%66 = load i32, i32* %29
%67 = icmp eq i32 %66, 4605519
br i1 %67, label %68, label %83
68: ; preds = %65, %62
%69 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), %62 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %65 ]
%70 = add nsw i32 %59, -1
%71 = zext i32 %70 to i64
%72 = getelementptr inbounds [8 x [4 x i8]], [8 x [4 x i8]]* %3, i64 0, i64 %71, i64 0
%73 = call i32 @strcpy(i8* %72, i8* %69)
%74 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([92 x i8], [92 x i8]* @str.18, i64 0, i64 0))
br label %75
75: ; preds = %45, %68, %52, %40
%76 = phi i32 [ 1, %68 ], [ 1, %52 ], [ %80, %40 ], [ 1, %45 ]
%77 = call i32* @xreadline(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32 128)
%78 = icmp eq i32* %77, null
br i1 %78, label %87, label %79
79: ; preds = %27, %75
%80 = phi i32 [ 0, %27 ], [ %76, %75 ]
%81 = icmp ne i32 %80, 0
%82 = icmp eq i32 %80, 0
br label %37
83: ; preds = %54, %65, %58, %51
%84 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.17, i64 0, i64 0))
%85 = call i32* @xreadline(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32 128)
%86 = icmp eq i32* %85, null
br i1 %86, label %87, label %37
87: ; preds = %75, %83, %0
ret void
}