#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*/ sleep(int);
int /*<<< orphan*/ tq2440_led_init();
int /*<<< orphan*/ tq2440_led_off(int);
int /*<<< orphan*/ tq2440_led_on(int);
int main(int argc, char *argv[]) {
  tq2440_led_init();
  for (;;) {
    for (int i = 1; i <= 4; ++i) {
      tq2440_led_on(i);
      sleep(1);
      tq2440_led_off(i);
      sleep(1);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <tq2440_led_init@plt>
movl   $0x1,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jg     11a0 <main+0x60>
mov    -0x14(%rbp),%edi
call   1050 <tq2440_led_on@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    -0x14(%rbp),%edi
call   1040 <tq2440_led_off@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1164 <main+0x24>
jmp    115d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <tq2440_led_init@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1050 <tq2440_led_on@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x1,%edi
call   1040 <tq2440_led_off@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x2,%edi
call   1050 <tq2440_led_on@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x2,%edi
call   1040 <tq2440_led_off@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x3,%edi
call   1050 <tq2440_led_on@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x3,%edi
call   1040 <tq2440_led_off@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x4,%edi
call   1050 <tq2440_led_on@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x4,%edi
call   1040 <tq2440_led_off@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
jmp    1150 <main+0x10>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @tq2440_led_init()
br label %8
8: ; preds = %22, %2
store i32 1, i32* %6
br label %9
9: ; preds = %19, %8
%10 = load i32, i32* %6
%11 = icmp sle i32 %10, 4
br i1 %11, label %12, label %22
12: ; preds = %9
%13 = load i32, i32* %6
%14 = call i32 @tq2440_led_on(i32 %13)
%15 = call i32 @sleep(i32 1)
%16 = load i32, i32* %6
%17 = call i32 @tq2440_led_off(i32 %16)
%18 = call i32 @sleep(i32 1)
br label %19
19: ; preds = %12
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %9
22: ; preds = %9
br label %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @tq2440_led_init()
br label %4
4: ; preds = %4, %2
%5 = tail call i32 @tq2440_led_on(i32 1)
%6 = tail call i32 @sleep(i32 1)
%7 = tail call i32 @tq2440_led_off(i32 1)
%8 = tail call i32 @sleep(i32 1)
%9 = tail call i32 @tq2440_led_on(i32 2)
%10 = tail call i32 @sleep(i32 1)
%11 = tail call i32 @tq2440_led_off(i32 2)
%12 = tail call i32 @sleep(i32 1)
%13 = tail call i32 @tq2440_led_on(i32 3)
%14 = tail call i32 @sleep(i32 1)
%15 = tail call i32 @tq2440_led_off(i32 3)
%16 = tail call i32 @sleep(i32 1)
%17 = tail call i32 @tq2440_led_on(i32 4)
%18 = tail call i32 @sleep(i32 1)
%19 = tail call i32 @tq2440_led_off(i32 4)
%20 = tail call i32 @sleep(i32 1)
br label %4
}