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

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ readallPhys(int);
void OrangePiReadAll(void) {
  int pin;
  printf(" | BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     "
         "| wPi | BCM |\n");
  printf(" +-----+-----+----------+------+---+----++----+---+------+----------+"
         "-----+-----+\n");
  for (pin = 1; pin <= 40; pin += 2)
    readallPhys(pin);
  printf(" +-----+-----+----------+------+---+----++----+---+------+----------+"
         "-----+-----+\n");
  printf(" | BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     "
         "| wPi | BCM |\n");
}


x86 assembly (clang, -O0):
<OrangePiReadAll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <printf@plt>
lea    0xf18(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
cmpl   $0x28,-0x4(%rbp)
jg     1167 <OrangePiReadAll+0x47>
mov    -0x4(%rbp),%edi
call   1030 <readallPhys@plt>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <OrangePiReadAll+0x27>
lea    0xee5(%rip),%rdi
call   1040 <printf@plt>
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OrangePiReadAll>:
push   %r14
push   %rbx
push   %rax
lea    0xf27(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xec6(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <readallPhys@plt>
mov    $0x3,%edi
call   1040 <readallPhys@plt>
mov    $0x5,%edi
call   1040 <readallPhys@plt>
mov    $0x7,%edi
call   1040 <readallPhys@plt>
mov    $0x9,%edi
call   1040 <readallPhys@plt>
mov    $0xb,%edi
call   1040 <readallPhys@plt>
mov    $0xd,%edi
call   1040 <readallPhys@plt>
mov    $0xf,%edi
call   1040 <readallPhys@plt>
mov    $0x11,%edi
call   1040 <readallPhys@plt>
mov    $0x13,%edi
call   1040 <readallPhys@plt>
mov    $0x15,%edi
call   1040 <readallPhys@plt>
mov    $0x17,%edi
call   1040 <readallPhys@plt>
mov    $0x19,%edi
call   1040 <readallPhys@plt>
mov    $0x1b,%edi
call   1040 <readallPhys@plt>
mov    $0x1d,%edi
call   1040 <readallPhys@plt>
mov    $0x1f,%edi
call   1040 <readallPhys@plt>
mov    $0x21,%edi
call   1040 <readallPhys@plt>
mov    $0x23,%edi
call   1040 <readallPhys@plt>
mov    $0x25,%edi
call   1040 <readallPhys@plt>
mov    $0x27,%edi
call   1040 <readallPhys@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [83 x i8] c" | BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |\0A\00"
@.str.1 = [83 x i8] c" +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+\0A\00"
define void @OrangePiReadAll() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %1
%6 = icmp sle i32 %5, 40
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %1
%9 = call i32 @readallPhys(i32 %8)
br label %10
10: ; preds = %7
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 2
store i32 %12, i32* %1
br label %4
13: ; preds = %4
%14 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str.3 = [82 x i8] c" +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+\00"
@str.4 = [82 x i8] c" | BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |\00"
define void @OrangePiReadAll() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str.4, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @readallPhys(i32 1)
%4 = tail call i32 @readallPhys(i32 3)
%5 = tail call i32 @readallPhys(i32 5)
%6 = tail call i32 @readallPhys(i32 7)
%7 = tail call i32 @readallPhys(i32 9)
%8 = tail call i32 @readallPhys(i32 11)
%9 = tail call i32 @readallPhys(i32 13)
%10 = tail call i32 @readallPhys(i32 15)
%11 = tail call i32 @readallPhys(i32 17)
%12 = tail call i32 @readallPhys(i32 19)
%13 = tail call i32 @readallPhys(i32 21)
%14 = tail call i32 @readallPhys(i32 23)
%15 = tail call i32 @readallPhys(i32 25)
%16 = tail call i32 @readallPhys(i32 27)
%17 = tail call i32 @readallPhys(i32 29)
%18 = tail call i32 @readallPhys(i32 31)
%19 = tail call i32 @readallPhys(i32 33)
%20 = tail call i32 @readallPhys(i32 35)
%21 = tail call i32 @readallPhys(i32 37)
%22 = tail call i32 @readallPhys(i32 39)
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str.3, i64 0, i64 0))
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str.4, i64 0, i64 0))
ret void
}