void BUSView() {
  unsigned char p0_pol = iGetPortConfig(0, 3);
  unsigned char p1_pol = iGetPortConfig(1, 3);
  unsigned char p2_pol = iGetPortConfig(2, 3);
  unsigned char p3_pol = iGetPortConfig(3, 3);
  unsigned char p0_pul = iGetPortConfig(0, 2);
  unsigned char p1_pul = iGetPortConfig(1, 2);
  unsigned char p2_pul = iGetPortConfig(2, 2);
  unsigned char p3_pul = iGetPortConfig(3, 2);
  unsigned char p0_dir = iGetPortConfig(0, 1);
  unsigned char p1_dir = iGetPortConfig(1, 1);
  unsigned char p2_dir = iGetPortConfig(2, 1);
  unsigned char p3_dir = iGetPortConfig(3, 1);
  unsigned char p0_data = bReadPort(0);
  unsigned char p1_data = bReadPort(1);
  unsigned char p2_data = bReadPort(2);
  unsigned char p3_data = bReadPort(3);
  system("clear");
  printf(
      " +------+------+-----+-----+-----+-----+-----+-----+------+------+------"
      "-+------+------+-----+-----+-----+-----+-----+-----+------+------+\n");
  printf(" |                                                             BUS "
         "Information                                                          "
         " |\n");
  printf(
      " +------+------+-----+-----+-----+-----+-----+-----+------+------+------"
      "-+------+------+-----+-----+-----+-----+-----+-----+------+------+\n");
  printf(" |                          BUS 1 [0x%02x]                         | "
         "      |                         BUS 2 [0x%02x]                       "
         "   |\n",
         0x20, 0x21);
  printf(
      " +------+------+-----+-----+-----+-----+-----+-----+------+------+------"
      "-+------+------+-----+-----+-----+-----+-----+-----+------+------+\n");
  printf(
      " |  POL |  PUL | DIR | VAL |    PIN    | VAL | DIR |  PUL |  POL |      "
      " |  POL |  PUL | DIR | VAL |    PIN    | VAL | DIR |  PUL |  POL |\n");
  printf(
      " +------+------+-----+-----+-----+-----+-----+-----+------+------+------"
      "-+------+------+-----+-----+-----+-----+-----+-----+------+------+\n");
  int pin = 1;
  for (pin; pin <= 8; pin++) {
    printf(" | %4s ", ((((p0_pol) & (({
                           unsigned char r;
                           unsigned char x = 0x00;
                           if (pin >= 1 && pin <= 32) {
                             r = (x |= 1 << ((pin - 1) % 8));
                           } else {
                             r = -10;
                           }
                           r;
                         }))) != 0))
                          ? "INV"
                          : "NOR");
    ;
    printf("| %4s ", ((((p0_pul) & (({
                          unsigned char r;
                          unsigned char x = 0x00;
                          if (pin >= 1 && pin <= 32) {
                            r = (x |= 1 << ((pin - 1) % 8));
                          } else {
                            r = -10;
                          }
                          r;
                        }))) != 0))
                         ? "UP"
                         : "DOWN");
    ;
    printf("| %3s", ((((p0_dir) & (({
                         unsigned char r;
                         unsigned char x = 0x00;
                         if (pin >= 1 && pin <= 32) {
                           r = (x |= 1 << ((pin - 1) % 8));
                         } else {
                           r = -10;
                         }
                         r;
                       }))) != 0))
                        ? "IN"
                        : "OUT");
    ;
    printf(" |  %d  ", ((((p0_data) & (({
                            unsigned char r;
                            unsigned char x = 0x00;
                            if (pin >= 1 && pin <= 32) {
                              r = (x |= 1 << ((pin - 1) % 8));
                            } else {
                              r = -10;
                            }
                            r;
                          }))) != 0))
                           ? 1
                           : 0);
    ;
    printf("|  %d  - %2d ", pin, (pin + 8));
    ;
    printf(" |  %d  ", ((((p1_data) & (({
                            unsigned char r;
                            unsigned char x = 0x00;
                            if ((pin + (8 * 1)) >= 1 && (pin + (8 * 1)) <= 32) {
                              r = (x |= 1 << (((pin + (8 * 1)) - 1) % 8));
                            } else {
                              r = -10;
                            }
                            r;
                          }))) != 0))
                           ? 1
                           : 0);
    ;
    printf("| %3s", ((((p1_dir) & (({
                         unsigned char r;
                         unsigned char x = 0x00;
                         if ((pin + (8 * 1)) >= 1 && (pin + (8 * 1)) <= 32) {
                           r = (x |= 1 << (((pin + (8 * 1)) - 1) % 8));
                         } else {
                           r = -10;
                         }
                         r;
                       }))) != 0))
                        ? "IN"
                        : "OUT");
    ;
    printf("| %4s ", ((((p1_pul) & (({
                          unsigned char r;
                          unsigned char x = 0x00;
                          if ((pin + (8 * 1)) >= 1 && (pin + (8 * 1)) <= 32) {
                            r = (x |= 1 << (((pin + (8 * 1)) - 1) % 8));
                          } else {
                            r = -10;
                          }
                          r;
                        }))) != 0))
                         ? "UP"
                         : "DOWN");
    ;
    printf(" | %4s ", ((((p1_pol) & (({
                           unsigned char r;
                           unsigned char x = 0x00;
                           if ((pin + (8 * 1)) >= 1 && (pin + (8 * 1)) <= 32) {
                             r = (x |= 1 << (((pin + (8 * 1)) - 1) % 8));
                           } else {
                             r = -10;
                           }
                           r;
                         }))) != 0))
                          ? "INV"
                          : "NOR");
    ;
    printf("|      ");
    ;
    printf(" | %4s ", ((((p2_pol) & (({
                           unsigned char r;
                           unsigned char x = 0x00;
                           if ((pin + (8 * 2)) >= 1 && (pin + (8 * 2)) <= 32) {
                             r = (x |= 1 << (((pin + (8 * 2)) - 1) % 8));
                           } else {
                             r = -10;
                           }
                           r;
                         }))) != 0))
                          ? "INV"
                          : "NOR");
    ;
    printf("| %4s ", ((((p2_pul) & (({
                          unsigned char r;
                          unsigned char x = 0x00;
                          if ((pin + (8 * 2)) >= 1 && (pin + (8 * 2)) <= 32) {
                            r = (x |= 1 << (((pin + (8 * 2)) - 1) % 8));
                          } else {
                            r = -10;
                          }
                          r;
                        }))) != 0))
                         ? "UP"
                         : "DOWN");
    ;
    printf("| %3s", ((((p2_dir) & (({
                         unsigned char r;
                         unsigned char x = 0x00;
                         if ((pin + (8 * 2)) >= 1 && (pin + (8 * 2)) <= 32) {
                           r = (x |= 1 << (((pin + (8 * 2)) - 1) % 8));
                         } else {
                           r = -10;
                         }
                         r;
                       }))) != 0))
                        ? "IN"
                        : "OUT");
    ;
    printf(" |  %d  ", ((((p2_data) & (({
                            unsigned char r;
                            unsigned char x = 0x00;
                            if ((pin + (8 * 2)) >= 1 && (pin + (8 * 2)) <= 32) {
                              r = (x |= 1 << (((pin + (8 * 2)) - 1) % 8));
                            } else {
                              r = -10;
                            }
                            r;
                          }))) != 0))
                           ? 1
                           : 0);
    ;
    printf("|  %d  - %2d ", pin, (pin + 8));
    ;
    printf(" |  %d  ", ((((p3_data) & (({
                            unsigned char r;
                            unsigned char x = 0x00;
                            if ((pin + (8 * 3)) >= 1 && (pin + (8 * 3)) <= 32) {
                              r = (x |= 1 << (((pin + (8 * 3)) - 1) % 8));
                            } else {
                              r = -10;
                            }
                            r;
                          }))) != 0))
                           ? 1
                           : 0);
    ;
    printf("| %3s", ((((p3_dir) & (({
                         unsigned char r;
                         unsigned char x = 0x00;
                         if ((pin + (8 * 3)) >= 1 && (pin + (8 * 3)) <= 32) {
                           r = (x |= 1 << (((pin + (8 * 3)) - 1) % 8));
                         } else {
                           r = -10;
                         }
                         r;
                       }))) != 0))
                        ? "IN"
                        : "OUT");
    ;
    printf("| %4s ", ((((p3_pul) & (({
                          unsigned char r;
                          unsigned char x = 0x00;
                          if ((pin + (8 * 3)) >= 1 && (pin + (8 * 3)) <= 32) {
                            r = (x |= 1 << (((pin + (8 * 3)) - 1) % 8));
                          } else {
                            r = -10;
                          }
                          r;
                        }))) != 0))
                         ? "UP"
                         : "DOWN");
    ;
    printf(" | %4s |\n", ((((p3_pol) & (({
                              unsigned char r;
                              unsigned char x = 0x00;
                              if (pin + (8 * 3) >= 1 && pin + (8 * 3) <= 32) {
                                r = (x |= 1 << ((pin + (8 * 3) - 1) % 8));
                              } else {
                                r = -10;
                              }
                              r;
                            }))) != 0))
                             ? "INV"
                             : "NOR");
    ;
  }
  printf(
      " +------+------+-----+-----+-----+-----+-----+-----+------+------+------"
      "-+------+------+-----+-----+-----+-----+-----+-----+------+------+\n");
  printf("\nPress 'ctrl+c' to escape...\n");
}


x86 assembly (clang, -O0):
<BUSView>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
xor    %edi,%edi
mov    $0x3,%esi
mov    $0x0,%al
call   1050 <iGetPortConfig@plt>
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
mov    $0x3,%esi
mov    $0x0,%al
call   1050 <iGetPortConfig@plt>
mov    %al,-0x2(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
mov    $0x0,%al
call   1050 <iGetPortConfig@plt>
mov    %al,-0x3(%rbp)
mov    $0x3,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1050 <iGetPortConfig@plt>
mov    %al,-0x4(%rbp)
xor    %edi,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1050 <iGetPortConfig@plt>
mov    %al,-0x5(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1050 <iGetPortConfig@plt>
mov    %al,-0x6(%rbp)
mov    $0x2,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1050 <iGetPortConfig@plt>
mov    %al,-0x7(%rbp)
mov    $0x3,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1050 <iGetPortConfig@plt>
mov    %al,-0x8(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1050 <iGetPortConfig@plt>
mov    %al,-0x9(%rbp)
mov    $0x1,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1050 <iGetPortConfig@plt>
mov    %al,-0xa(%rbp)
mov    $0x2,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1050 <iGetPortConfig@plt>
mov    %al,-0xb(%rbp)
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1050 <iGetPortConfig@plt>
mov    %al,-0xc(%rbp)
xor    %edi,%edi
mov    $0x0,%al
call   1060 <bReadPort@plt>
mov    %al,-0xd(%rbp)
mov    $0x1,%edi
mov    $0x0,%al
call   1060 <bReadPort@plt>
mov    %al,-0xe(%rbp)
mov    $0x2,%edi
mov    $0x0,%al
call   1060 <bReadPort@plt>
mov    %al,-0xf(%rbp)
mov    $0x3,%edi
mov    $0x0,%al
call   1060 <bReadPort@plt>
mov    %al,-0x10(%rbp)
lea    0xd97(%rip),%rdi
mov    $0x0,%al
call   1030 <system@plt>
lea    0xd8f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd73(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe7d(%rip),%rdi
mov    $0x20,%esi
mov    $0x21,%edx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd4d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd31(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jg     1ba9 <BUSView+0xa69>
movzbl -0x1(%rbp),%eax
mov    %eax,-0x48(%rbp)
movb   $0x0,-0x16(%rbp)
cmpl   $0x1,-0x14(%rbp)
jl     1336 <BUSView+0x1f6>
cmpl   $0x20,-0x14(%rbp)
jg     1336 <BUSView+0x1f6>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x16(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x16(%rbp)
mov    %al,-0x15(%rbp)
jmp    133a <BUSView+0x1fa>
movb   $0xf6,-0x15(%rbp)
mov    -0x48(%rbp),%ecx
mov    -0x15(%rbp),%al
mov    %al,-0x17(%rbp)
movzbl -0x17(%rbp),%eax
and    %eax,%ecx
lea    0xef6(%rip),%rsi
lea    0xeeb(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movzbl -0x5(%rbp),%eax
mov    %eax,-0x4c(%rbp)
movb   $0x0,-0x19(%rbp)
cmpl   $0x1,-0x14(%rbp)
jl     13b5 <BUSView+0x275>
cmpl   $0x20,-0x14(%rbp)
jg     13b5 <BUSView+0x275>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x19(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x19(%rbp)
mov    %al,-0x18(%rbp)
jmp    13b9 <BUSView+0x279>
movb   $0xf6,-0x18(%rbp)
mov    -0x4c(%rbp),%ecx
mov    -0x18(%rbp),%al
mov    %al,-0x1a(%rbp)
movzbl -0x1a(%rbp),%eax
and    %eax,%ecx
lea    0xe7e(%rip),%rsi
lea    0xe74(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movzbl -0x9(%rbp),%eax
mov    %eax,-0x50(%rbp)
movb   $0x0,-0x1c(%rbp)
cmpl   $0x1,-0x14(%rbp)
jl     1434 <BUSView+0x2f4>
cmpl   $0x20,-0x14(%rbp)
jg     1434 <BUSView+0x2f4>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x1c(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x1c(%rbp)
mov    %al,-0x1b(%rbp)
jmp    1438 <BUSView+0x2f8>
movb   $0xf6,-0x1b(%rbp)
mov    -0x50(%rbp),%ecx
mov    -0x1b(%rbp),%al
mov    %al,-0x1d(%rbp)
movzbl -0x1d(%rbp),%eax
and    %eax,%ecx
lea    0xe0d(%rip),%rsi
lea    0xe03(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movzbl -0xd(%rbp),%eax
mov    %eax,-0x54(%rbp)
movb   $0x0,-0x1f(%rbp)
cmpl   $0x1,-0x14(%rbp)
jl     14b3 <BUSView+0x373>
cmpl   $0x20,-0x14(%rbp)
jg     14b3 <BUSView+0x373>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x1f(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x1f(%rbp)
mov    %al,-0x1e(%rbp)
jmp    14b7 <BUSView+0x377>
movb   $0xf6,-0x1e(%rbp)
mov    -0x54(%rbp),%ecx
mov    -0x1e(%rbp),%al
mov    %al,-0x20(%rbp)
movzbl -0x20(%rbp),%eax
and    %eax,%ecx
xor    %esi,%esi
mov    $0x1,%eax
cmp    $0x0,%ecx
cmovne %eax,%esi
lea    0xd85(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
add    $0x8,%edx
lea    0xd77(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movzbl -0xe(%rbp),%eax
mov    %eax,-0x58(%rbp)
movb   $0x0,-0x22(%rbp)
mov    -0x14(%rbp),%eax
add    $0x8,%eax
cmp    $0x1,%eax
jl     154e <BUSView+0x40e>
mov    -0x14(%rbp),%eax
add    $0x8,%eax
cmp    $0x20,%eax
jg     154e <BUSView+0x40e>
mov    -0x14(%rbp),%eax
add    $0x8,%eax
sub    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x22(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x22(%rbp)
mov    %al,-0x21(%rbp)
jmp    1552 <BUSView+0x412>
movb   $0xf6,-0x21(%rbp)
mov    -0x58(%rbp),%ecx
mov    -0x21(%rbp),%al
mov    %al,-0x23(%rbp)
movzbl -0x23(%rbp),%eax
and    %eax,%ecx
xor    %esi,%esi
mov    $0x1,%eax
cmp    $0x0,%ecx
cmovne %eax,%esi
lea    0xcea(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movzbl -0xa(%rbp),%eax
mov    %eax,-0x5c(%rbp)
movb   $0x0,-0x25(%rbp)
mov    -0x14(%rbp),%eax
add    $0x8,%eax
cmp    $0x1,%eax
jl     15d2 <BUSView+0x492>
mov    -0x14(%rbp),%eax
add    $0x8,%eax
cmp    $0x20,%eax
jg     15d2 <BUSView+0x492>
mov    -0x14(%rbp),%eax
add    $0x8,%eax
sub    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x25(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x25(%rbp)
mov    %al,-0x24(%rbp)
jmp    15d6 <BUSView+0x496>
movb   $0xf6,-0x24(%rbp)
mov    -0x5c(%rbp),%ecx
mov    -0x24(%rbp),%al
mov    %al,-0x26(%rbp)
movzbl -0x26(%rbp),%eax
and    %eax,%ecx
lea    0xc6f(%rip),%rsi
lea    0xc65(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xc51(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movzbl -0x6(%rbp),%eax
mov    %eax,-0x60(%rbp)
movb   $0x0,-0x28(%rbp)
mov    -0x14(%rbp),%eax
add    $0x8,%eax
cmp    $0x1,%eax
jl     165e <BUSView+0x51e>
mov    -0x14(%rbp),%eax
add    $0x8,%eax
cmp    $0x20,%eax
jg     165e <BUSView+0x51e>
mov    -0x14(%rbp),%eax
add    $0x8,%eax
sub    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x28(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x28(%rbp)
mov    %al,-0x27(%rbp)
jmp    1662 <BUSView+0x522>
movb   $0xf6,-0x27(%rbp)
mov    -0x60(%rbp),%ecx
mov    -0x27(%rbp),%al
mov    %al,-0x29(%rbp)
movzbl -0x29(%rbp),%eax
and    %eax,%ecx
lea    0xbd5(%rip),%rsi
lea    0xbcb(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xbae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movzbl -0x2(%rbp),%eax
mov    %eax,-0x64(%rbp)
movb   $0x0,-0x2b(%rbp)
mov    -0x14(%rbp),%eax
add    $0x8,%eax
cmp    $0x1,%eax
jl     16ea <BUSView+0x5aa>
mov    -0x14(%rbp),%eax
add    $0x8,%eax
cmp    $0x20,%eax
jg     16ea <BUSView+0x5aa>
mov    -0x14(%rbp),%eax
add    $0x8,%eax
sub    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x2b(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x2b(%rbp)
mov    %al,-0x2a(%rbp)
jmp    16ee <BUSView+0x5ae>
movb   $0xf6,-0x2a(%rbp)
mov    -0x64(%rbp),%ecx
mov    -0x2a(%rbp),%al
mov    %al,-0x2c(%rbp)
movzbl -0x2c(%rbp),%eax
and    %eax,%ecx
lea    0xb42(%rip),%rsi
lea    0xb37(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xb21(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xb4f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movzbl -0x3(%rbp),%eax
mov    %eax,-0x68(%rbp)
movb   $0x0,-0x2e(%rbp)
mov    -0x14(%rbp),%eax
add    $0x10,%eax
cmp    $0x1,%eax
jl     1784 <BUSView+0x644>
mov    -0x14(%rbp),%eax
add    $0x10,%eax
cmp    $0x20,%eax
jg     1784 <BUSView+0x644>
mov    -0x14(%rbp),%eax
add    $0x10,%eax
sub    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x2e(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x2e(%rbp)
mov    %al,-0x2d(%rbp)
jmp    1788 <BUSView+0x648>
movb   $0xf6,-0x2d(%rbp)
mov    -0x68(%rbp),%ecx
mov    -0x2d(%rbp),%al
mov    %al,-0x2f(%rbp)
movzbl -0x2f(%rbp),%eax
and    %eax,%ecx
lea    0xaa8(%rip),%rsi
lea    0xa9d(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xa87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movzbl -0x7(%rbp),%eax
mov    %eax,-0x6c(%rbp)
movb   $0x0,-0x31(%rbp)
mov    -0x14(%rbp),%eax
add    $0x10,%eax
cmp    $0x1,%eax
jl     1810 <BUSView+0x6d0>
mov    -0x14(%rbp),%eax
add    $0x10,%eax
cmp    $0x20,%eax
jg     1810 <BUSView+0x6d0>
mov    -0x14(%rbp),%eax
add    $0x10,%eax
sub    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x31(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x31(%rbp)
mov    %al,-0x30(%rbp)
jmp    1814 <BUSView+0x6d4>
movb   $0xf6,-0x30(%rbp)
mov    -0x6c(%rbp),%ecx
mov    -0x30(%rbp),%al
mov    %al,-0x32(%rbp)
movzbl -0x32(%rbp),%eax
and    %eax,%ecx
lea    0xa23(%rip),%rsi
lea    0xa19(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0x9fc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movzbl -0xb(%rbp),%eax
mov    %eax,-0x70(%rbp)
movb   $0x0,-0x34(%rbp)
mov    -0x14(%rbp),%eax
add    $0x10,%eax
cmp    $0x1,%eax
jl     189c <BUSView+0x75c>
mov    -0x14(%rbp),%eax
add    $0x10,%eax
cmp    $0x20,%eax
jg     189c <BUSView+0x75c>
mov    -0x14(%rbp),%eax
add    $0x10,%eax
sub    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x34(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x34(%rbp)
mov    %al,-0x33(%rbp)
jmp    18a0 <BUSView+0x760>
movb   $0xf6,-0x33(%rbp)
mov    -0x70(%rbp),%ecx
mov    -0x33(%rbp),%al
mov    %al,-0x35(%rbp)
movzbl -0x35(%rbp),%eax
and    %eax,%ecx
lea    0x9a5(%rip),%rsi
lea    0x99b(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0x987(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movzbl -0xf(%rbp),%eax
mov    %eax,-0x74(%rbp)
movb   $0x0,-0x37(%rbp)
mov    -0x14(%rbp),%eax
add    $0x10,%eax
cmp    $0x1,%eax
jl     1928 <BUSView+0x7e8>
mov    -0x14(%rbp),%eax
add    $0x10,%eax
cmp    $0x20,%eax
jg     1928 <BUSView+0x7e8>
mov    -0x14(%rbp),%eax
add    $0x10,%eax
sub    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x37(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x37(%rbp)
mov    %al,-0x36(%rbp)
jmp    192c <BUSView+0x7ec>
movb   $0xf6,-0x36(%rbp)
mov    -0x74(%rbp),%ecx
mov    -0x36(%rbp),%al
mov    %al,-0x38(%rbp)
movzbl -0x38(%rbp),%eax
and    %eax,%ecx
xor    %esi,%esi
mov    $0x1,%eax
cmp    $0x0,%ecx
cmovne %eax,%esi
lea    0x910(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
add    $0x8,%edx
lea    0x902(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movzbl -0x10(%rbp),%eax
mov    %eax,-0x78(%rbp)
movb   $0x0,-0x3a(%rbp)
mov    -0x14(%rbp),%eax
add    $0x18,%eax
cmp    $0x1,%eax
jl     19c3 <BUSView+0x883>
mov    -0x14(%rbp),%eax
add    $0x18,%eax
cmp    $0x20,%eax
jg     19c3 <BUSView+0x883>
mov    -0x14(%rbp),%eax
add    $0x18,%eax
sub    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x3a(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x3a(%rbp)
mov    %al,-0x39(%rbp)
jmp    19c7 <BUSView+0x887>
movb   $0xf6,-0x39(%rbp)
mov    -0x78(%rbp),%ecx
mov    -0x39(%rbp),%al
mov    %al,-0x3b(%rbp)
movzbl -0x3b(%rbp),%eax
and    %eax,%ecx
xor    %esi,%esi
mov    $0x1,%eax
cmp    $0x0,%ecx
cmovne %eax,%esi
lea    0x875(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movzbl -0xc(%rbp),%eax
mov    %eax,-0x7c(%rbp)
movb   $0x0,-0x3d(%rbp)
mov    -0x14(%rbp),%eax
add    $0x18,%eax
cmp    $0x1,%eax
jl     1a47 <BUSView+0x907>
mov    -0x14(%rbp),%eax
add    $0x18,%eax
cmp    $0x20,%eax
jg     1a47 <BUSView+0x907>
mov    -0x14(%rbp),%eax
add    $0x18,%eax
sub    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x3d(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x3d(%rbp)
mov    %al,-0x3c(%rbp)
jmp    1a4b <BUSView+0x90b>
movb   $0xf6,-0x3c(%rbp)
mov    -0x7c(%rbp),%ecx
mov    -0x3c(%rbp),%al
mov    %al,-0x3e(%rbp)
movzbl -0x3e(%rbp),%eax
and    %eax,%ecx
lea    0x7fa(%rip),%rsi
lea    0x7f0(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0x7dc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movzbl -0x8(%rbp),%eax
mov    %eax,-0x80(%rbp)
movb   $0x0,-0x40(%rbp)
mov    -0x14(%rbp),%eax
add    $0x18,%eax
cmp    $0x1,%eax
jl     1ad3 <BUSView+0x993>
mov    -0x14(%rbp),%eax
add    $0x18,%eax
cmp    $0x20,%eax
jg     1ad3 <BUSView+0x993>
mov    -0x14(%rbp),%eax
add    $0x18,%eax
sub    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x40(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x40(%rbp)
mov    %al,-0x3f(%rbp)
jmp    1ad7 <BUSView+0x997>
movb   $0xf6,-0x3f(%rbp)
mov    -0x80(%rbp),%ecx
mov    -0x3f(%rbp),%al
mov    %al,-0x41(%rbp)
movzbl -0x41(%rbp),%eax
and    %eax,%ecx
lea    0x760(%rip),%rsi
lea    0x756(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0x739(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movzbl -0x4(%rbp),%eax
mov    %eax,-0x84(%rbp)
movb   $0x0,-0x43(%rbp)
mov    -0x14(%rbp),%eax
add    $0x18,%eax
cmp    $0x1,%eax
jl     1b62 <BUSView+0xa22>
mov    -0x14(%rbp),%eax
add    $0x18,%eax
cmp    $0x20,%eax
jg     1b62 <BUSView+0xa22>
mov    -0x14(%rbp),%eax
add    $0x18,%eax
sub    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x43(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x43(%rbp)
mov    %al,-0x42(%rbp)
jmp    1b66 <BUSView+0xa26>
movb   $0xf6,-0x42(%rbp)
mov    -0x84(%rbp),%ecx
mov    -0x42(%rbp),%al
mov    %al,-0x44(%rbp)
movzbl -0x44(%rbp),%eax
and    %eax,%ecx
lea    0x6c7(%rip),%rsi
lea    0x6bc(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0x6ea(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12e3 <BUSView+0x1a3>
lea    0x456(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0x6ca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BUSView>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
xor    %edi,%edi
mov    $0x3,%esi
xor    %eax,%eax
call   1060 <iGetPortConfig@plt>
mov    %eax,0x3c(%rsp)
mov    $0x1,%edi
mov    $0x3,%esi
xor    %eax,%eax
call   1060 <iGetPortConfig@plt>
mov    %eax,0x38(%rsp)
mov    $0x2,%edi
mov    $0x3,%esi
xor    %eax,%eax
call   1060 <iGetPortConfig@plt>
mov    %eax,0x34(%rsp)
mov    $0x3,%edi
mov    $0x3,%esi
xor    %eax,%eax
call   1060 <iGetPortConfig@plt>
mov    %eax,0x30(%rsp)
xor    %edi,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1060 <iGetPortConfig@plt>
mov    %eax,0x2c(%rsp)
mov    $0x1,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1060 <iGetPortConfig@plt>
mov    %eax,0x28(%rsp)
mov    $0x2,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1060 <iGetPortConfig@plt>
mov    %eax,0x24(%rsp)
mov    $0x3,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1060 <iGetPortConfig@plt>
mov    %eax,0x20(%rsp)
xor    %edi,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1060 <iGetPortConfig@plt>
mov    %eax,0x1c(%rsp)
mov    $0x1,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1060 <iGetPortConfig@plt>
mov    %eax,0x18(%rsp)
mov    $0x2,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1060 <iGetPortConfig@plt>
mov    %eax,0x14(%rsp)
mov    $0x3,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1060 <iGetPortConfig@plt>
mov    %eax,0x10(%rsp)
xor    %edi,%edi
xor    %eax,%eax
call   1070 <bReadPort@plt>
mov    %eax,0xc(%rsp)
mov    $0x1,%edi
xor    %eax,%eax
call   1070 <bReadPort@plt>
mov    %eax,0x8(%rsp)
mov    $0x2,%edi
xor    %eax,%eax
call   1070 <bReadPort@plt>
mov    %eax,0x4(%rsp)
mov    $0x3,%edi
xor    %eax,%eax
call   1070 <bReadPort@plt>
mov    %eax,(%rsp)
lea    0xd6c(%rip),%rdi
xor    %eax,%eax
call   1040 <system@plt>
lea    0xf58(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe33(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xd41(%rip),%rdi
mov    $0x20,%esi
mov    $0x21,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe8a(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x1(%r12),%ebx
mov    %ebx,0x40(%rsp)
mov    0x3c(%rsp),%eax
bt     %r12d,%eax
lea    0xd86(%rip),%rsi
lea    0xd83(%rip),%rbp
cmovae %rbp,%rsi
lea    0xd6c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2c(%rsp),%eax
bt     %r12d,%eax
lea    0xd66(%rip),%rsi
lea    0xd62(%rip),%r14
cmovae %r14,%rsi
lea    0xd45(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x1c(%rsp),%eax
bt     %r12d,%eax
lea    0xd4c(%rip),%rbp
mov    %rbp,%rsi
mov    %rbp,%r13
lea    0xd42(%rip),%r14
cmovae %r14,%rsi
lea    0xd2e(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
mov    %r12d,%ecx
shr    %cl,%esi
and    $0x1,%esi
lea    0xd1e(%rip),%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x9(%r12),%edx
mov    %edx,0x44(%rsp)
lea    0xd0d(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%esi
mov    %r12d,%ecx
shr    %cl,%esi
and    $0x1,%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x18(%rsp),%eax
bt     %r12d,%eax
mov    %r13,%rsi
lea    0xccf(%rip),%rax
cmovae %rax,%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x28(%rsp),%eax
bt     %r12d,%eax
lea    0xca1(%rip),%r13
mov    %r13,%rsi
lea    0xc9a(%rip),%r14
cmovae %r14,%rsi
lea    0xc7d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x38(%rsp),%eax
bt     %r12d,%eax
lea    0xc6e(%rip),%r15
mov    %r15,%rsi
lea    0xc68(%rip),%rbp
cmovae %rbp,%rsi
lea    0xc51(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc7c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x34(%rsp),%eax
bt     %r12d,%eax
cmovae %rbp,%r15
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x24(%rsp),%eax
bt     %r12d,%eax
cmovae %r14,%r13
lea    0xc0e(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x14(%rsp),%eax
bt     %r12d,%eax
lea    0xc12(%rip),%r15
mov    %r15,%rsi
lea    0xc0b(%rip),%rbx
cmovae %rbx,%rsi
lea    0xbf7(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%esi
mov    %r12d,%ecx
shr    %cl,%esi
and    $0x1,%esi
lea    0xbe7(%rip),%r13
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xbdf(%rip),%rdi
mov    0x40(%rsp),%ebp
mov    %ebp,%esi
mov    0x44(%rsp),%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rsp),%esi
mov    %r12d,%ecx
shr    %cl,%esi
and    $0x1,%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rsp),%eax
bt     %r12d,%eax
cmovae %rbx,%r15
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x20(%rsp),%eax
bt     %r12d,%eax
lea    0xb73(%rip),%rsi
lea    0xb6f(%rip),%rax
cmovae %rax,%rsi
lea    0xb52(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x30(%rsp),%eax
bt     %r12d,%eax
lea    0xb43(%rip),%rsi
lea    0xb40(%rip),%rax
cmovae %rax,%rsi
lea    0xb6d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%r12d
cmp    $0x8,%ebp
jne    1300 <BUSView+0x1b0>
lea    0xc73(%rip),%rdi
call   1030 <puts@plt>
lea    0xcf2(%rip),%rdi
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [140 x i8] c" +------+------+-----+-----+-----+-----+-----+-----+------+------+-------+------+------+-----+-----+-----+-----+-----+-----+------+------+\0A\00"
@.str.2 = [140 x i8] c" | BUS Information |\0A\00"
@.str.3 = [144 x i8] c" | BUS 1 [0x%02x] | | BUS 2 [0x%02x] |\0A\00"
@.str.4 = [140 x i8] c" | POL | PUL | DIR | VAL | PIN | VAL | DIR | PUL | POL | | POL | PUL | DIR | VAL | PIN | VAL | DIR | PUL | POL |\0A\00"
@.str.5 = [8 x i8] c" | %4s \00"
@.str.6 = [4 x i8] c"INV\00"
@.str.7 = [4 x i8] c"NOR\00"
@.str.8 = [7 x i8] c"| %4s \00"
@.str.9 = [3 x i8] c"UP\00"
@.str.10 = [5 x i8] c"DOWN\00"
@.str.11 = [6 x i8] c"| %3s\00"
@.str.12 = [3 x i8] c"IN\00"
@.str.13 = [4 x i8] c"OUT\00"
@.str.14 = [9 x i8] c" | %d \00"
@.str.15 = [14 x i8] c"| %d - %2d \00"
@.str.16 = [8 x i8] c"| \00"
@.str.17 = [10 x i8] c" | %4s |\0A\00"
@.str.18 = [30 x i8] c"\0APress 'ctrl+c' to escape...\0A\00"
define void @BUSView() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
%13 = alloca i8
%14 = alloca i8
%15 = alloca i8
%16 = alloca i8
%17 = alloca i32
%18 = alloca i8
%19 = alloca i8
%20 = alloca i8
%21 = alloca i8
%22 = alloca i8
%23 = alloca i8
%24 = alloca i8
%25 = alloca i8
%26 = alloca i8
%27 = alloca i8
%28 = alloca i8
%29 = alloca i8
%30 = alloca i8
%31 = alloca i8
%32 = alloca i8
%33 = alloca i8
%34 = alloca i8
%35 = alloca i8
%36 = alloca i8
%37 = alloca i8
%38 = alloca i8
%39 = alloca i8
%40 = alloca i8
%41 = alloca i8
%42 = alloca i8
%43 = alloca i8
%44 = alloca i8
%45 = alloca i8
%46 = alloca i8
%47 = alloca i8
%48 = alloca i8
%49 = alloca i8
%50 = alloca i8
%51 = alloca i8
%52 = alloca i8
%53 = alloca i8
%54 = alloca i8
%55 = alloca i8
%56 = alloca i8
%57 = alloca i8
%58 = alloca i8
%59 = alloca i8
%60 = alloca i8
%61 = alloca i8
%62 = alloca i8
%63 = alloca i8
%64 = alloca i8
%65 = alloca i8
%66 = call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 0, i32 3)
%67 = trunc i32 %66 to i8
store i8 %67, i8* %1
%68 = call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 1, i32 3)
%69 = trunc i32 %68 to i8
store i8 %69, i8* %2
%70 = call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 2, i32 3)
%71 = trunc i32 %70 to i8
store i8 %71, i8* %3
%72 = call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 3, i32 3)
%73 = trunc i32 %72 to i8
store i8 %73, i8* %4
%74 = call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 0, i32 2)
%75 = trunc i32 %74 to i8
store i8 %75, i8* %5
%76 = call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 1, i32 2)
%77 = trunc i32 %76 to i8
store i8 %77, i8* %6
%78 = call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 2, i32 2)
%79 = trunc i32 %78 to i8
store i8 %79, i8* %7
%80 = call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 3, i32 2)
%81 = trunc i32 %80 to i8
store i8 %81, i8* %8
%82 = call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 0, i32 1)
%83 = trunc i32 %82 to i8
store i8 %83, i8* %9
%84 = call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 1, i32 1)
%85 = trunc i32 %84 to i8
store i8 %85, i8* %10
%86 = call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 2, i32 1)
%87 = trunc i32 %86 to i8
store i8 %87, i8* %11
%88 = call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 3, i32 1)
%89 = trunc i32 %88 to i8
store i8 %89, i8* %12
%90 = call i32 (i32, ...) bitcast (i32 (...)* @bReadPort to i32 (i32, ...)*)(i32 0)
%91 = trunc i32 %90 to i8
store i8 %91, i8* %13
%92 = call i32 (i32, ...) bitcast (i32 (...)* @bReadPort to i32 (i32, ...)*)(i32 1)
%93 = trunc i32 %92 to i8
store i8 %93, i8* %14
%94 = call i32 (i32, ...) bitcast (i32 (...)* @bReadPort to i32 (i32, ...)*)(i32 2)
%95 = trunc i32 %94 to i8
store i8 %95, i8* %15
%96 = call i32 (i32, ...) bitcast (i32 (...)* @bReadPort to i32 (i32, ...)*)(i32 3)
%97 = trunc i32 %96 to i8
store i8 %97, i8* %16
%98 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0))
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0))
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0))
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.3, i64 0, i64 0), i32 32, i32 33)
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0))
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.4, i64 0, i64 0))
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %17
%106 = load i32, i32* %17
br label %107
107: ; preds = %572, %0
%108 = load i32, i32* %17
%109 = icmp sle i32 %108, 8
br i1 %109, label %110, label %575
110: ; preds = %107
%111 = load i8, i8* %1
%112 = zext i8 %111 to i32
store i8 0, i8* %19
%113 = load i32, i32* %17
%114 = icmp sge i32 %113, 1
br i1 %114, label %115, label %127
115: ; preds = %110
%116 = load i32, i32* %17
%117 = icmp sle i32 %116, 32
br i1 %117, label %118, label %127
118: ; preds = %115
%119 = load i32, i32* %17
%120 = sub nsw i32 %119, 1
%121 = srem i32 %120, 8
%122 = shl i32 1, %121
%123 = load i8, i8* %19
%124 = zext i8 %123 to i32
%125 = or i32 %124, %122
%126 = trunc i32 %125 to i8
store i8 %126, i8* %19
store i8 %126, i8* %18
br label %128
127: ; preds = %115, %110
store i8 -10, i8* %18
br label %128
128: ; preds = %127, %118
%129 = load i8, i8* %18
store i8 %129, i8* %20
%130 = load i8, i8* %20
%131 = zext i8 %130 to i32
%132 = and i32 %112, %131
%133 = icmp ne i32 %132, 0
%134 = zext i1 %133 to i64
%135 = select i1 %133, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0)
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %135)
%137 = load i8, i8* %5
%138 = zext i8 %137 to i32
store i8 0, i8* %22
%139 = load i32, i32* %17
%140 = icmp sge i32 %139, 1
br i1 %140, label %141, label %153
141: ; preds = %128
%142 = load i32, i32* %17
%143 = icmp sle i32 %142, 32
br i1 %143, label %144, label %153
144: ; preds = %141
%145 = load i32, i32* %17
%146 = sub nsw i32 %145, 1
%147 = srem i32 %146, 8
%148 = shl i32 1, %147
%149 = load i8, i8* %22
%150 = zext i8 %149 to i32
%151 = or i32 %150, %148
%152 = trunc i32 %151 to i8
store i8 %152, i8* %22
store i8 %152, i8* %21
br label %154
153: ; preds = %141, %128
store i8 -10, i8* %21
br label %154
154: ; preds = %153, %144
%155 = load i8, i8* %21
store i8 %155, i8* %23
%156 = load i8, i8* %23
%157 = zext i8 %156 to i32
%158 = and i32 %138, %157
%159 = icmp ne i32 %158, 0
%160 = zext i1 %159 to i64
%161 = select i1 %159, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0)
%162 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %161)
%163 = load i8, i8* %9
%164 = zext i8 %163 to i32
store i8 0, i8* %25
%165 = load i32, i32* %17
%166 = icmp sge i32 %165, 1
br i1 %166, label %167, label %179
167: ; preds = %154
%168 = load i32, i32* %17
%169 = icmp sle i32 %168, 32
br i1 %169, label %170, label %179
170: ; preds = %167
%171 = load i32, i32* %17
%172 = sub nsw i32 %171, 1
%173 = srem i32 %172, 8
%174 = shl i32 1, %173
%175 = load i8, i8* %25
%176 = zext i8 %175 to i32
%177 = or i32 %176, %174
%178 = trunc i32 %177 to i8
store i8 %178, i8* %25
store i8 %178, i8* %24
br label %180
179: ; preds = %167, %154
store i8 -10, i8* %24
br label %180
180: ; preds = %179, %170
%181 = load i8, i8* %24
store i8 %181, i8* %26
%182 = load i8, i8* %26
%183 = zext i8 %182 to i32
%184 = and i32 %164, %183
%185 = icmp ne i32 %184, 0
%186 = zext i1 %185 to i64
%187 = select i1 %185, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0)
%188 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i8* %187)
%189 = load i8, i8* %13
%190 = zext i8 %189 to i32
store i8 0, i8* %28
%191 = load i32, i32* %17
%192 = icmp sge i32 %191, 1
br i1 %192, label %193, label %205
193: ; preds = %180
%194 = load i32, i32* %17
%195 = icmp sle i32 %194, 32
br i1 %195, label %196, label %205
196: ; preds = %193
%197 = load i32, i32* %17
%198 = sub nsw i32 %197, 1
%199 = srem i32 %198, 8
%200 = shl i32 1, %199
%201 = load i8, i8* %28
%202 = zext i8 %201 to i32
%203 = or i32 %202, %200
%204 = trunc i32 %203 to i8
store i8 %204, i8* %28
store i8 %204, i8* %27
br label %206
205: ; preds = %193, %180
store i8 -10, i8* %27
br label %206
206: ; preds = %205, %196
%207 = load i8, i8* %27
store i8 %207, i8* %29
%208 = load i8, i8* %29
%209 = zext i8 %208 to i32
%210 = and i32 %190, %209
%211 = icmp ne i32 %210, 0
%212 = zext i1 %211 to i64
%213 = select i1 %211, i32 1, i32 0
%214 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i32 %213)
%215 = load i32, i32* %17
%216 = load i32, i32* %17
%217 = add nsw i32 %216, 8
%218 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0), i32 %215, i32 %217)
%219 = load i8, i8* %14
%220 = zext i8 %219 to i32
store i8 0, i8* %31
%221 = load i32, i32* %17
%222 = add nsw i32 %221, 8
%223 = icmp sge i32 %222, 1
br i1 %223, label %224, label %238
224: ; preds = %206
%225 = load i32, i32* %17
%226 = add nsw i32 %225, 8
%227 = icmp sle i32 %226, 32
br i1 %227, label %228, label %238
228: ; preds = %224
%229 = load i32, i32* %17
%230 = add nsw i32 %229, 8
%231 = sub nsw i32 %230, 1
%232 = srem i32 %231, 8
%233 = shl i32 1, %232
%234 = load i8, i8* %31
%235 = zext i8 %234 to i32
%236 = or i32 %235, %233
%237 = trunc i32 %236 to i8
store i8 %237, i8* %31
store i8 %237, i8* %30
br label %239
238: ; preds = %224, %206
store i8 -10, i8* %30
br label %239
239: ; preds = %238, %228
%240 = load i8, i8* %30
store i8 %240, i8* %32
%241 = load i8, i8* %32
%242 = zext i8 %241 to i32
%243 = and i32 %220, %242
%244 = icmp ne i32 %243, 0
%245 = zext i1 %244 to i64
%246 = select i1 %244, i32 1, i32 0
%247 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i32 %246)
%248 = load i8, i8* %10
%249 = zext i8 %248 to i32
store i8 0, i8* %34
%250 = load i32, i32* %17
%251 = add nsw i32 %250, 8
%252 = icmp sge i32 %251, 1
br i1 %252, label %253, label %267
253: ; preds = %239
%254 = load i32, i32* %17
%255 = add nsw i32 %254, 8
%256 = icmp sle i32 %255, 32
br i1 %256, label %257, label %267
257: ; preds = %253
%258 = load i32, i32* %17
%259 = add nsw i32 %258, 8
%260 = sub nsw i32 %259, 1
%261 = srem i32 %260, 8
%262 = shl i32 1, %261
%263 = load i8, i8* %34
%264 = zext i8 %263 to i32
%265 = or i32 %264, %262
%266 = trunc i32 %265 to i8
store i8 %266, i8* %34
store i8 %266, i8* %33
br label %268
267: ; preds = %253, %239
store i8 -10, i8* %33
br label %268
268: ; preds = %267, %257
%269 = load i8, i8* %33
store i8 %269, i8* %35
%270 = load i8, i8* %35
%271 = zext i8 %270 to i32
%272 = and i32 %249, %271
%273 = icmp ne i32 %272, 0
%274 = zext i1 %273 to i64
%275 = select i1 %273, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0)
%276 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i8* %275)
%277 = load i8, i8* %6
%278 = zext i8 %277 to i32
store i8 0, i8* %37
%279 = load i32, i32* %17
%280 = add nsw i32 %279, 8
%281 = icmp sge i32 %280, 1
br i1 %281, label %282, label %296
282: ; preds = %268
%283 = load i32, i32* %17
%284 = add nsw i32 %283, 8
%285 = icmp sle i32 %284, 32
br i1 %285, label %286, label %296
286: ; preds = %282
%287 = load i32, i32* %17
%288 = add nsw i32 %287, 8
%289 = sub nsw i32 %288, 1
%290 = srem i32 %289, 8
%291 = shl i32 1, %290
%292 = load i8, i8* %37
%293 = zext i8 %292 to i32
%294 = or i32 %293, %291
%295 = trunc i32 %294 to i8
store i8 %295, i8* %37
store i8 %295, i8* %36
br label %297
296: ; preds = %282, %268
store i8 -10, i8* %36
br label %297
297: ; preds = %296, %286
%298 = load i8, i8* %36
store i8 %298, i8* %38
%299 = load i8, i8* %38
%300 = zext i8 %299 to i32
%301 = and i32 %278, %300
%302 = icmp ne i32 %301, 0
%303 = zext i1 %302 to i64
%304 = select i1 %302, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0)
%305 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %304)
%306 = load i8, i8* %2
%307 = zext i8 %306 to i32
store i8 0, i8* %40
%308 = load i32, i32* %17
%309 = add nsw i32 %308, 8
%310 = icmp sge i32 %309, 1
br i1 %310, label %311, label %325
311: ; preds = %297
%312 = load i32, i32* %17
%313 = add nsw i32 %312, 8
%314 = icmp sle i32 %313, 32
br i1 %314, label %315, label %325
315: ; preds = %311
%316 = load i32, i32* %17
%317 = add nsw i32 %316, 8
%318 = sub nsw i32 %317, 1
%319 = srem i32 %318, 8
%320 = shl i32 1, %319
%321 = load i8, i8* %40
%322 = zext i8 %321 to i32
%323 = or i32 %322, %320
%324 = trunc i32 %323 to i8
store i8 %324, i8* %40
store i8 %324, i8* %39
br label %326
325: ; preds = %311, %297
store i8 -10, i8* %39
br label %326
326: ; preds = %325, %315
%327 = load i8, i8* %39
store i8 %327, i8* %41
%328 = load i8, i8* %41
%329 = zext i8 %328 to i32
%330 = and i32 %307, %329
%331 = icmp ne i32 %330, 0
%332 = zext i1 %331 to i64
%333 = select i1 %331, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0)
%334 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %333)
%335 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0))
%336 = load i8, i8* %3
%337 = zext i8 %336 to i32
store i8 0, i8* %43
%338 = load i32, i32* %17
%339 = add nsw i32 %338, 16
%340 = icmp sge i32 %339, 1
br i1 %340, label %341, label %355
341: ; preds = %326
%342 = load i32, i32* %17
%343 = add nsw i32 %342, 16
%344 = icmp sle i32 %343, 32
br i1 %344, label %345, label %355
345: ; preds = %341
%346 = load i32, i32* %17
%347 = add nsw i32 %346, 16
%348 = sub nsw i32 %347, 1
%349 = srem i32 %348, 8
%350 = shl i32 1, %349
%351 = load i8, i8* %43
%352 = zext i8 %351 to i32
%353 = or i32 %352, %350
%354 = trunc i32 %353 to i8
store i8 %354, i8* %43
store i8 %354, i8* %42
br label %356
355: ; preds = %341, %326
store i8 -10, i8* %42
br label %356
356: ; preds = %355, %345
%357 = load i8, i8* %42
store i8 %357, i8* %44
%358 = load i8, i8* %44
%359 = zext i8 %358 to i32
%360 = and i32 %337, %359
%361 = icmp ne i32 %360, 0
%362 = zext i1 %361 to i64
%363 = select i1 %361, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0)
%364 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %363)
%365 = load i8, i8* %7
%366 = zext i8 %365 to i32
store i8 0, i8* %46
%367 = load i32, i32* %17
%368 = add nsw i32 %367, 16
%369 = icmp sge i32 %368, 1
br i1 %369, label %370, label %384
370: ; preds = %356
%371 = load i32, i32* %17
%372 = add nsw i32 %371, 16
%373 = icmp sle i32 %372, 32
br i1 %373, label %374, label %384
374: ; preds = %370
%375 = load i32, i32* %17
%376 = add nsw i32 %375, 16
%377 = sub nsw i32 %376, 1
%378 = srem i32 %377, 8
%379 = shl i32 1, %378
%380 = load i8, i8* %46
%381 = zext i8 %380 to i32
%382 = or i32 %381, %379
%383 = trunc i32 %382 to i8
store i8 %383, i8* %46
store i8 %383, i8* %45
br label %385
384: ; preds = %370, %356
store i8 -10, i8* %45
br label %385
385: ; preds = %384, %374
%386 = load i8, i8* %45
store i8 %386, i8* %47
%387 = load i8, i8* %47
%388 = zext i8 %387 to i32
%389 = and i32 %366, %388
%390 = icmp ne i32 %389, 0
%391 = zext i1 %390 to i64
%392 = select i1 %390, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0)
%393 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %392)
%394 = load i8, i8* %11
%395 = zext i8 %394 to i32
store i8 0, i8* %49
%396 = load i32, i32* %17
%397 = add nsw i32 %396, 16
%398 = icmp sge i32 %397, 1
br i1 %398, label %399, label %413
399: ; preds = %385
%400 = load i32, i32* %17
%401 = add nsw i32 %400, 16
%402 = icmp sle i32 %401, 32
br i1 %402, label %403, label %413
403: ; preds = %399
%404 = load i32, i32* %17
%405 = add nsw i32 %404, 16
%406 = sub nsw i32 %405, 1
%407 = srem i32 %406, 8
%408 = shl i32 1, %407
%409 = load i8, i8* %49
%410 = zext i8 %409 to i32
%411 = or i32 %410, %408
%412 = trunc i32 %411 to i8
store i8 %412, i8* %49
store i8 %412, i8* %48
br label %414
413: ; preds = %399, %385
store i8 -10, i8* %48
br label %414
414: ; preds = %413, %403
%415 = load i8, i8* %48
store i8 %415, i8* %50
%416 = load i8, i8* %50
%417 = zext i8 %416 to i32
%418 = and i32 %395, %417
%419 = icmp ne i32 %418, 0
%420 = zext i1 %419 to i64
%421 = select i1 %419, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0)
%422 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i8* %421)
%423 = load i8, i8* %15
%424 = zext i8 %423 to i32
store i8 0, i8* %52
%425 = load i32, i32* %17
%426 = add nsw i32 %425, 16
%427 = icmp sge i32 %426, 1
br i1 %427, label %428, label %442
428: ; preds = %414
%429 = load i32, i32* %17
%430 = add nsw i32 %429, 16
%431 = icmp sle i32 %430, 32
br i1 %431, label %432, label %442
432: ; preds = %428
%433 = load i32, i32* %17
%434 = add nsw i32 %433, 16
%435 = sub nsw i32 %434, 1
%436 = srem i32 %435, 8
%437 = shl i32 1, %436
%438 = load i8, i8* %52
%439 = zext i8 %438 to i32
%440 = or i32 %439, %437
%441 = trunc i32 %440 to i8
store i8 %441, i8* %52
store i8 %441, i8* %51
br label %443
442: ; preds = %428, %414
store i8 -10, i8* %51
br label %443
443: ; preds = %442, %432
%444 = load i8, i8* %51
store i8 %444, i8* %53
%445 = load i8, i8* %53
%446 = zext i8 %445 to i32
%447 = and i32 %424, %446
%448 = icmp ne i32 %447, 0
%449 = zext i1 %448 to i64
%450 = select i1 %448, i32 1, i32 0
%451 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i32 %450)
%452 = load i32, i32* %17
%453 = load i32, i32* %17
%454 = add nsw i32 %453, 8
%455 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0), i32 %452, i32 %454)
%456 = load i8, i8* %16
%457 = zext i8 %456 to i32
store i8 0, i8* %55
%458 = load i32, i32* %17
%459 = add nsw i32 %458, 24
%460 = icmp sge i32 %459, 1
br i1 %460, label %461, label %475
461: ; preds = %443
%462 = load i32, i32* %17
%463 = add nsw i32 %462, 24
%464 = icmp sle i32 %463, 32
br i1 %464, label %465, label %475
465: ; preds = %461
%466 = load i32, i32* %17
%467 = add nsw i32 %466, 24
%468 = sub nsw i32 %467, 1
%469 = srem i32 %468, 8
%470 = shl i32 1, %469
%471 = load i8, i8* %55
%472 = zext i8 %471 to i32
%473 = or i32 %472, %470
%474 = trunc i32 %473 to i8
store i8 %474, i8* %55
store i8 %474, i8* %54
br label %476
475: ; preds = %461, %443
store i8 -10, i8* %54
br label %476
476: ; preds = %475, %465
%477 = load i8, i8* %54
store i8 %477, i8* %56
%478 = load i8, i8* %56
%479 = zext i8 %478 to i32
%480 = and i32 %457, %479
%481 = icmp ne i32 %480, 0
%482 = zext i1 %481 to i64
%483 = select i1 %481, i32 1, i32 0
%484 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i32 %483)
%485 = load i8, i8* %12
%486 = zext i8 %485 to i32
store i8 0, i8* %58
%487 = load i32, i32* %17
%488 = add nsw i32 %487, 24
%489 = icmp sge i32 %488, 1
br i1 %489, label %490, label %504
490: ; preds = %476
%491 = load i32, i32* %17
%492 = add nsw i32 %491, 24
%493 = icmp sle i32 %492, 32
br i1 %493, label %494, label %504
494: ; preds = %490
%495 = load i32, i32* %17
%496 = add nsw i32 %495, 24
%497 = sub nsw i32 %496, 1
%498 = srem i32 %497, 8
%499 = shl i32 1, %498
%500 = load i8, i8* %58
%501 = zext i8 %500 to i32
%502 = or i32 %501, %499
%503 = trunc i32 %502 to i8
store i8 %503, i8* %58
store i8 %503, i8* %57
br label %505
504: ; preds = %490, %476
store i8 -10, i8* %57
br label %505
505: ; preds = %504, %494
%506 = load i8, i8* %57
store i8 %506, i8* %59
%507 = load i8, i8* %59
%508 = zext i8 %507 to i32
%509 = and i32 %486, %508
%510 = icmp ne i32 %509, 0
%511 = zext i1 %510 to i64
%512 = select i1 %510, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0)
%513 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i8* %512)
%514 = load i8, i8* %8
%515 = zext i8 %514 to i32
store i8 0, i8* %61
%516 = load i32, i32* %17
%517 = add nsw i32 %516, 24
%518 = icmp sge i32 %517, 1
br i1 %518, label %519, label %533
519: ; preds = %505
%520 = load i32, i32* %17
%521 = add nsw i32 %520, 24
%522 = icmp sle i32 %521, 32
br i1 %522, label %523, label %533
523: ; preds = %519
%524 = load i32, i32* %17
%525 = add nsw i32 %524, 24
%526 = sub nsw i32 %525, 1
%527 = srem i32 %526, 8
%528 = shl i32 1, %527
%529 = load i8, i8* %61
%530 = zext i8 %529 to i32
%531 = or i32 %530, %528
%532 = trunc i32 %531 to i8
store i8 %532, i8* %61
store i8 %532, i8* %60
br label %534
533: ; preds = %519, %505
store i8 -10, i8* %60
br label %534
534: ; preds = %533, %523
%535 = load i8, i8* %60
store i8 %535, i8* %62
%536 = load i8, i8* %62
%537 = zext i8 %536 to i32
%538 = and i32 %515, %537
%539 = icmp ne i32 %538, 0
%540 = zext i1 %539 to i64
%541 = select i1 %539, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0)
%542 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %541)
%543 = load i8, i8* %4
%544 = zext i8 %543 to i32
store i8 0, i8* %64
%545 = load i32, i32* %17
%546 = add nsw i32 %545, 24
%547 = icmp sge i32 %546, 1
br i1 %547, label %548, label %562
548: ; preds = %534
%549 = load i32, i32* %17
%550 = add nsw i32 %549, 24
%551 = icmp sle i32 %550, 32
br i1 %551, label %552, label %562
552: ; preds = %548
%553 = load i32, i32* %17
%554 = add nsw i32 %553, 24
%555 = sub nsw i32 %554, 1
%556 = srem i32 %555, 8
%557 = shl i32 1, %556
%558 = load i8, i8* %64
%559 = zext i8 %558 to i32
%560 = or i32 %559, %557
%561 = trunc i32 %560 to i8
store i8 %561, i8* %64
store i8 %561, i8* %63
br label %563
562: ; preds = %548, %534
store i8 -10, i8* %63
br label %563
563: ; preds = %562, %552
%564 = load i8, i8* %63
store i8 %564, i8* %65
%565 = load i8, i8* %65
%566 = zext i8 %565 to i32
%567 = and i32 %544, %566
%568 = icmp ne i32 %567, 0
%569 = zext i1 %568 to i64
%570 = select i1 %568, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0)
%571 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.17, i64 0, i64 0), i8* %570)
br label %572
572: ; preds = %563
%573 = load i32, i32* %17
%574 = add nsw i32 %573, 1
store i32 %574, i32* %17
br label %107
575: ; preds = %107
%576 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0))
%577 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.18, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.3 = [144 x i8] c" | BUS 1 [0x%02x] | | BUS 2 [0x%02x] |\0A\00"
@.str.5 = [8 x i8] c" | %4s \00"
@.str.6 = [4 x i8] c"INV\00"
@.str.7 = [4 x i8] c"NOR\00"
@.str.8 = [7 x i8] c"| %4s \00"
@.str.9 = [3 x i8] c"UP\00"
@.str.10 = [5 x i8] c"DOWN\00"
@.str.11 = [6 x i8] c"| %3s\00"
@.str.12 = [3 x i8] c"IN\00"
@.str.13 = [4 x i8] c"OUT\00"
@.str.14 = [9 x i8] c" | %d \00"
@.str.15 = [14 x i8] c"| %d - %2d \00"
@.str.16 = [8 x i8] c"| \00"
@.str.17 = [10 x i8] c" | %4s |\0A\00"
@str.19 = [139 x i8] c" | BUS Information |\00"
@str.22 = [139 x i8] c" | POL | PUL | DIR | VAL | PIN | VAL | DIR | PUL | POL | | POL | PUL | DIR | VAL | PIN | VAL | DIR | PUL | POL |\00"
@str.24 = [139 x i8] c" +------+------+-----+-----+-----+-----+-----+-----+------+------+-------+------+------+-----+-----+-----+-----+-----+-----+------+------+\00"
@str.25 = [29 x i8] c"\0APress 'ctrl+c' to escape...\00"
define void @BUSView() {
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 0, i32 3)
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 1, i32 3)
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 2, i32 3)
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 3, i32 3)
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 0, i32 2)
%6 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 1, i32 2)
%7 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 2, i32 2)
%8 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 3, i32 2)
%9 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 0, i32 1)
%10 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 1, i32 1)
%11 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 2, i32 1)
%12 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @iGetPortConfig to i32 (i32, i32, ...)*)(i32 3, i32 1)
%13 = tail call i32 (i32, ...) bitcast (i32 (...)* @bReadPort to i32 (i32, ...)*)(i32 0)
%14 = tail call i32 (i32, ...) bitcast (i32 (...)* @bReadPort to i32 (i32, ...)*)(i32 1)
%15 = tail call i32 (i32, ...) bitcast (i32 (...)* @bReadPort to i32 (i32, ...)*)(i32 2)
%16 = tail call i32 (i32, ...) bitcast (i32 (...)* @bReadPort to i32 (i32, ...)*)(i32 3)
%17 = tail call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([139 x i8], [139 x i8]* @str.24, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([139 x i8], [139 x i8]* @str.19, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([139 x i8], [139 x i8]* @str.24, i64 0, i64 0))
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([144 x i8], [144 x i8]* @.str.3, i64 0, i64 0), i32 32, i32 33)
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([139 x i8], [139 x i8]* @str.24, i64 0, i64 0))
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([139 x i8], [139 x i8]* @str.22, i64 0, i64 0))
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([139 x i8], [139 x i8]* @str.24, i64 0, i64 0))
br label %25
25: ; preds = %0, %25
%26 = phi i32 [ 1, %0 ], [ %94, %25 ]
%27 = add nuw nsw i32 %26, 7
%28 = and i32 %27, 7
%29 = shl nuw nsw i32 1, %28
%30 = and i32 %29, %1
%31 = icmp eq i32 %30, 0
%32 = select i1 %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0)
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %32)
%34 = and i32 %29, %5
%35 = icmp eq i32 %34, 0
%36 = select i1 %35, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0)
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %36)
%38 = and i32 %29, %9
%39 = icmp eq i32 %38, 0
%40 = select i1 %39, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0)
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i8* %40)
%42 = lshr i32 %13, %28
%43 = and i32 %42, 1
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i32 %43)
%45 = add nuw nsw i32 %26, 8
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0), i32 %26, i32 %45)
%47 = lshr i32 %14, %28
%48 = and i32 %47, 1
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i32 %48)
%50 = and i32 %29, %10
%51 = icmp eq i32 %50, 0
%52 = select i1 %51, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0)
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i8* %52)
%54 = and i32 %29, %6
%55 = icmp eq i32 %54, 0
%56 = select i1 %55, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0)
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %56)
%58 = and i32 %29, %2
%59 = icmp eq i32 %58, 0
%60 = select i1 %59, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0)
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %60)
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0))
%63 = and i32 %29, %3
%64 = icmp eq i32 %63, 0
%65 = select i1 %64, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0)
%66 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %65)
%67 = and i32 %29, %7
%68 = icmp eq i32 %67, 0
%69 = select i1 %68, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0)
%70 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %69)
%71 = and i32 %29, %11
%72 = icmp eq i32 %71, 0
%73 = select i1 %72, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0)
%74 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i8* %73)
%75 = lshr i32 %15, %28
%76 = and i32 %75, 1
%77 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i32 %76)
%78 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0), i32 %26, i32 %45)
%79 = lshr i32 %16, %28
%80 = and i32 %79, 1
%81 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i32 %80)
%82 = and i32 %29, %12
%83 = icmp eq i32 %82, 0
%84 = select i1 %83, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0)
%85 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i8* %84)
%86 = and i32 %29, %8
%87 = icmp eq i32 %86, 0
%88 = select i1 %87, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0)
%89 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %88)
%90 = and i32 %29, %4
%91 = icmp eq i32 %90, 0
%92 = select i1 %91, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0)
%93 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.17, i64 0, i64 0), i8* %92)
%94 = add nuw nsw i32 %26, 1
%95 = icmp eq i32 %94, 9
br i1 %95, label %96, label %25
96: ; preds = %25
%97 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([139 x i8], [139 x i8]* @str.24, i64 0, i64 0))
%98 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.25, i64 0, i64 0))
ret void
}