#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*/ gpio_ext(int);
int /*<<< orphan*/ gpio_init();
int /*<<< orphan*/ gpio_layer(int);
int /*<<< orphan*/ gpio_le(int /*<<< orphan*/);
int /*<<< orphan*/ gpio_plane(unsigned char *);
int main() {
  static unsigned char data[8] = {
      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  };
  int i;
  gpio_init();
  gpio_le(0);
  gpio_plane(data);
  gpio_ext(1);
  for (;;) {
    for (i = 0; i < 8; i++) {
      gpio_layer(i);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <gpio_init@plt>
xor    %edi,%edi
call   1060 <gpio_le@plt>
lea    0x2ed4(%rip),%rdi
call   1050 <gpio_plane@plt>
mov    $0x1,%edi
call   1030 <gpio_ext@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    11aa <main+0x5a>
mov    -0x8(%rbp),%edi
call   1040 <gpio_layer@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    118a <main+0x3a>
jmp    1183 <main+0x33>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <gpio_init@plt>
xor    %edi,%edi
call   1060 <gpio_le@plt>
lea    0x2ee2(%rip),%rdi
call   1050 <gpio_plane@plt>
mov    $0x1,%edi
call   1030 <gpio_ext@plt>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %edi,%edi
call   1040 <gpio_layer@plt>
mov    $0x1,%edi
call   1040 <gpio_layer@plt>
mov    $0x2,%edi
call   1040 <gpio_layer@plt>
mov    $0x3,%edi
call   1040 <gpio_layer@plt>
mov    $0x4,%edi
call   1040 <gpio_layer@plt>
mov    $0x5,%edi
call   1040 <gpio_layer@plt>
mov    $0x6,%edi
call   1040 <gpio_layer@plt>
mov    $0x7,%edi
call   1040 <gpio_layer@plt>
jmp    1180 <main+0x30>

LLVM IR (-O0):
@main.data = internal global [8 x i8] c"\FF\FF\FF\FF\FF\FF\FF\FF"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @gpio_init()
%4 = call i32 @gpio_le(i32 0)
%5 = call i32 @gpio_plane(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.data, i64 0, i64 0))
%6 = call i32 @gpio_ext(i32 1)
br label %7
7: ; preds = %17, %0
store i32 0, i32* %2
br label %8
8: ; preds = %14, %7
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 8
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = load i32, i32* %2
%13 = call i32 @gpio_layer(i32 %12)
br label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %8
17: ; preds = %8
br label %7
}

LLVM IR (-O2):
@main.data = internal global [8 x i8] c"\FF\FF\FF\FF\FF\FF\FF\FF"
define i32 @main() {
%1 = tail call i32 (...) @gpio_init()
%2 = tail call i32 @gpio_le(i32 0)
%3 = tail call i32 @gpio_plane(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.data, i64 0, i64 0))
%4 = tail call i32 @gpio_ext(i32 1)
br label %5
5: ; preds = %5, %0
%6 = tail call i32 @gpio_layer(i32 0)
%7 = tail call i32 @gpio_layer(i32 1)
%8 = tail call i32 @gpio_layer(i32 2)
%9 = tail call i32 @gpio_layer(i32 3)
%10 = tail call i32 @gpio_layer(i32 4)
%11 = tail call i32 @gpio_layer(i32 5)
%12 = tail call i32 @gpio_layer(i32 6)
%13 = tail call i32 @gpio_layer(i32 7)
br label %5
}