#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*/ delaysec(int);
int /*<<< orphan*/ gpio_init();
int /*<<< orphan*/ gpio_setout(int);
int /*<<< orphan*/ gpio_write(int, int);
int /*<<< orphan*/ puts(char *);
int main(void) {
  int i;
  gpio_init();
  gpio_setout(22);
  gpio_setout(27);
  for (i = 0; i < 10; i++) {
    puts("GPIO A");
    gpio_write(22, 1);
    delaysec(1);
    gpio_write(22, 0);
    delaysec(1);
    puts("GPIO B");
    gpio_write(27, 1);
    delaysec(1);
    gpio_write(27, 0);
    delaysec(1);
  }
  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>
mov    $0x16,%edi
call   1050 <gpio_setout@plt>
mov    $0x1b,%edi
call   1050 <gpio_setout@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    120f <main+0xbf>
lea    0xe6e(%rip),%rdi
call   1040 <puts@plt>
mov    $0x16,%edi
mov    $0x1,%esi
call   1060 <gpio_write@plt>
mov    $0x1,%edi
call   1030 <delaysec@plt>
mov    $0x16,%edi
xor    %esi,%esi
call   1060 <gpio_write@plt>
mov    $0x1,%edi
call   1030 <delaysec@plt>
lea    0xe3a(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1b,%edi
mov    $0x1,%esi
call   1060 <gpio_write@plt>
mov    $0x1,%edi
call   1030 <delaysec@plt>
mov    $0x1b,%edi
xor    %esi,%esi
call   1060 <gpio_write@plt>
mov    $0x1,%edi
call   1030 <delaysec@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1181 <main+0x31>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1070 <gpio_init@plt>
mov    $0x16,%edi
call   1050 <gpio_setout@plt>
mov    $0x1b,%edi
call   1050 <gpio_setout@plt>
mov    $0xa,%ebp
lea    0xe85(%rip),%r14
lea    0xe85(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1040 <puts@plt>
mov    $0x16,%edi
mov    $0x1,%esi
call   1060 <gpio_write@plt>
mov    $0x1,%edi
call   1030 <delaysec@plt>
mov    $0x16,%edi
xor    %esi,%esi
call   1060 <gpio_write@plt>
mov    $0x1,%edi
call   1030 <delaysec@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    $0x1b,%edi
mov    $0x1,%esi
call   1060 <gpio_write@plt>
mov    $0x1,%edi
call   1030 <delaysec@plt>
mov    $0x1b,%edi
xor    %esi,%esi
call   1060 <gpio_write@plt>
mov    $0x1,%edi
call   1030 <delaysec@plt>
add    $0xffffffff,%ebp
jne    1190 <main+0x40>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"GPIO A\00"
@.str.1 = [7 x i8] c"GPIO B\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @gpio_init()
%4 = call i32 @gpio_setout(i32 22)
%5 = call i32 @gpio_setout(i32 27)
store i32 0, i32* %2
br label %6
6: ; preds = %20, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @gpio_write(i32 22, i32 1)
%12 = call i32 @delaysec(i32 1)
%13 = call i32 @gpio_write(i32 22, i32 0)
%14 = call i32 @delaysec(i32 1)
%15 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @gpio_write(i32 27, i32 1)
%17 = call i32 @delaysec(i32 1)
%18 = call i32 @gpio_write(i32 27, i32 0)
%19 = call i32 @delaysec(i32 1)
br label %20
20: ; preds = %9
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %6
23: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"GPIO A\00"
@.str.1 = [7 x i8] c"GPIO B\00"
define i32 @main() {
%1 = tail call i32 (...) @gpio_init()
%2 = tail call i32 @gpio_setout(i32 22)
%3 = tail call i32 @gpio_setout(i32 27)
br label %4
4: ; preds = %0, %4
%5 = phi i32 [ 0, %0 ], [ %16, %4 ]
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @gpio_write(i32 22, i32 1)
%8 = tail call i32 @delaysec(i32 1)
%9 = tail call i32 @gpio_write(i32 22, i32 0)
%10 = tail call i32 @delaysec(i32 1)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%12 = tail call i32 @gpio_write(i32 27, i32 1)
%13 = tail call i32 @delaysec(i32 1)
%14 = tail call i32 @gpio_write(i32 27, i32 0)
%15 = tail call i32 @delaysec(i32 1)
%16 = add nuw nsw i32 %5, 1
%17 = icmp eq i32 %16, 10
br i1 %17, label %18, label %4
18: ; preds = %4
ret i32 0
}