#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int bReadPin(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ system(char *);
void IOInfo() {
  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(" | VAL |    PIN    | VAL |   +   | VAL |    PIN    | VAL |\n");
  printf(" +-----+-----+-----+-----+-------+-----+-----+-----+-----+\n");
  int pin = 1;
  for (pin; pin <= 8; pin++) {
    printf(" |  %d  ", bReadPin(pin));
    ;
    printf("|  %d  - %2d ", pin, (pin + 8));
    ;
    printf(" |  %d  ", bReadPin(pin + (8 * 1)));
    ;
    printf("|      ");
    ;
    printf(" |  %d  ", bReadPin(pin + (8 * 2)));
    ;
    printf("|  %d  - %2d ", pin, (pin + 8));
    ;
    printf(" |  %d  |\n", bReadPin(pin + (8 * 3)));
    ;
  }
  printf(" +-----+-----+-----+-----+-------+-----+-----+-----+-----+\n");
  printf("\nPress 'ctrl+c' to escape...\n");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<IOInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <system@plt>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xef9(%rip),%rdi
mov    $0x20,%esi
mov    $0x21,%edx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf13(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jg     1284 <IOInfo+0x144>
mov    -0x4(%rbp),%edi
call   1050 <bReadPin@plt>
mov    %eax,%esi
lea    0xf18(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
add    $0x8,%edx
lea    0xf0a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
add    $0x8,%edi
call   1050 <bReadPin@plt>
mov    %eax,%esi
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeef(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
add    $0x10,%edi
call   1050 <bReadPin@plt>
mov    %eax,%esi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
add    $0x8,%edx
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
add    $0x18,%edi
call   1050 <bReadPin@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11c7 <IOInfo+0x87>
lea    0xd7b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2d39(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IOInfo>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe9e(%rip),%rdi
call   1040 <system@plt>
lea    0xf78(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe75(%rip),%rdi
mov    $0x20,%esi
mov    $0x21,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
lea    0xe7c(%rip),%r14
lea    0xe7e(%rip),%r15
lea    0xe85(%rip),%r12
lea    0xe86(%rip),%r13
nop
mov    %ebx,%edi
call   1060 <bReadPin@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x8(%rbx),%ebp
mov    %r15,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%edi
call   1060 <bReadPin@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x10(%rbx),%edi
call   1060 <bReadPin@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x18(%rbx),%edi
call   1060 <bReadPin@plt>
mov    %r13,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebx
cmp    $0x9,%ebx
jne    11e0 <IOInfo+0x90>
lea    0xe80(%rip),%rdi
call   1030 <puts@plt>
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
mov    0x2d62(%rip),%rax
mov    (%rax),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <fflush@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [60 x i8] c" +-----+-----+-----+-----+-------+-----+-----+-----+-----+\0A\00"
@.str.2 = [60 x i8] c" | BUS Information |\0A\00"
@.str.3 = [64 x i8] c" | BUS 1 [0x%02x] | | BUS 2 [0x%02x] |\0A\00"
@.str.4 = [60 x i8] c" | VAL | PIN | VAL | + | VAL | PIN | VAL |\0A\00"
@.str.5 = [9 x i8] c" | %d \00"
@.str.6 = [14 x i8] c"| %d - %2d \00"
@.str.7 = [8 x i8] c"| \00"
@.str.8 = [11 x i8] c" | %d |\0A\00"
@.str.9 = [30 x i8] c"\0APress 'ctrl+c' to escape...\0A\00"
@stdout = global i32 0
define void @IOInfo() {
%1 = alloca i32
%2 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0), i32 32, i32 33)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
%10 = load i32, i32* %1
br label %11
11: ; preds = %39, %0
%12 = load i32, i32* %1
%13 = icmp sle i32 %12, 8
br i1 %13, label %14, label %42
14: ; preds = %11
%15 = load i32, i32* %1
%16 = call i32 @bReadPin(i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %1
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 8
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %18, i32 %20)
%22 = load i32, i32* %1
%23 = add nsw i32 %22, 8
%24 = call i32 @bReadPin(i32 %23)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %24)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%27 = load i32, i32* %1
%28 = add nsw i32 %27, 16
%29 = call i32 @bReadPin(i32 %28)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %1
%32 = load i32, i32* %1
%33 = add nsw i32 %32, 8
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %31, i32 %33)
%35 = load i32, i32* %1
%36 = add nsw i32 %35, 24
%37 = call i32 @bReadPin(i32 %36)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 %37)
br label %39
39: ; preds = %14
%40 = load i32, i32* %1
%41 = add nsw i32 %40, 1
store i32 %41, i32* %1
br label %11
42: ; preds = %11
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0))
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0))
%45 = load i32, i32* @stdout
%46 = call i32 @fflush(i32 %45)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.3 = [64 x i8] c" | BUS 1 [0x%02x] | | BUS 2 [0x%02x] |\0A\00"
@.str.5 = [9 x i8] c" | %d \00"
@.str.6 = [14 x i8] c"| %d - %2d \00"
@.str.7 = [8 x i8] c"| \00"
@.str.8 = [11 x i8] c" | %d |\0A\00"
@stdout = global i32 0
@str.10 = [59 x i8] c" | BUS Information |\00"
@str.13 = [59 x i8] c" | VAL | PIN | VAL | + | VAL | PIN | VAL |\00"
@str.15 = [59 x i8] c" +-----+-----+-----+-----+-------+-----+-----+-----+-----+\00"
@str.16 = [29 x i8] c"\0APress 'ctrl+c' to escape...\00"
define void @IOInfo() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.15, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.10, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.15, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0), i32 32, i32 33)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.15, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.13, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.15, i64 0, i64 0))
br label %9
9: ; preds = %0, %9
%10 = phi i32 [ 1, %0 ], [ %25, %9 ]
%11 = tail call i32 @bReadPin(i32 %10)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i32 %10, 8
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %10, i32 %13)
%15 = tail call i32 @bReadPin(i32 %13)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %15)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%18 = add nuw nsw i32 %10, 16
%19 = tail call i32 @bReadPin(i32 %18)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %19)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %10, i32 %13)
%22 = add nuw nsw i32 %10, 24
%23 = tail call i32 @bReadPin(i32 %22)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 %23)
%25 = add nuw nsw i32 %10, 1
%26 = icmp eq i32 %25, 9
br i1 %26, label %27, label %9
27: ; preds = %9
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.15, i64 0, i64 0))
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.16, i64 0, i64 0))
%30 = load i32, i32* @stdout
%31 = tail call i32 @fflush(i32 %30)
ret void
}