#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*/ analogWrite(int, int);
int /*<<< orphan*/ exit(int);
int init();
int /*<<< orphan*/ pi_sleep(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i;
  if (init() == -1)
    exit(1);
  while (1) {
    for (i = 0; i < 256; i++) {
      printf("%d\n", i);
      analogWrite(3, i);
      pi_sleep(10);
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <init@plt>
cmp    $0xffffffff,%eax
jne    1179 <main+0x29>
mov    $0x1,%edi
call   1070 <exit@plt>
jmp    117e <main+0x2e>
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    11c6 <main+0x76>
mov    -0x8(%rbp),%esi
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    $0x3,%edi
call   1040 <analogWrite@plt>
mov    $0xa,%edi
call   1050 <pi_sleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1185 <main+0x35>
jmp    117e <main+0x2e>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <init@plt>
cmp    $0xffffffff,%eax
je     11ad <main+0x5d>
lea    0xe9a(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    $0x3,%edi
mov    %ebp,%esi
call   1040 <analogWrite@plt>
mov    $0xa,%edi
call   1050 <pi_sleep@plt>
add    $0x1,%ebp
cmp    $0x100,%ebp
jne    1180 <main+0x30>
jmp    1170 <main+0x20>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @init()
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @exit(i32 1)
unreachable
7: ; preds = %0
br label %8
8: ; preds = %7, %21
store i32 0, i32* %2
br label %9
9: ; preds = %18, %8
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 256
br i1 %11, label %12, label %21
12: ; preds = %9
%13 = load i32, i32* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %2
%16 = call i32 @analogWrite(i32 3, i32 %15)
%17 = call i32 @pi_sleep(i32 10)
br label %18
18: ; preds = %12
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %9
21: ; preds = %9
br label %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @exit(i32 1)
unreachable
5: ; preds = %6, %0
br label %6
6: ; preds = %5, %6
%7 = phi i32 [ 0, %5 ], [ %11, %6 ]
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 @analogWrite(i32 3, i32 %7)
%10 = tail call i32 @pi_sleep(i32 10)
%11 = add nuw nsw i32 %7, 1
%12 = icmp eq i32 %11, 256
br i1 %12, label %5, label %6
}