#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*/ delay_ms(int);
int /*<<< orphan*/ fill(int);
void blinky2() {
  int i, r;
  fill(0x00);
  for (r = 0; r < 5; r++) {
    i = 750;
    while (i > 0) {
      fill(0x00);
      delay_ms(i);
      fill(0xff);
      delay_ms(100);
      i = i - (15 + (1000 / (i / 10)));
    }
    delay_ms(1000);
    i = 750;
    while (i > 0) {
      fill(0x00);
      delay_ms(751 - i);
      fill(0xff);
      delay_ms(100);
      i = i - (15 + (1000 / (i / 10)));
    }
  }
}


x86 assembly (clang, -O0):
<blinky2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <fill@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1224 <blinky2+0x104>
movl   $0x2ee,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    11a1 <blinky2+0x81>
xor    %edi,%edi
call   1030 <fill@plt>
mov    -0x4(%rbp),%edi
call   1040 <delay_ms@plt>
mov    $0xff,%edi
call   1030 <fill@plt>
mov    $0x64,%edi
call   1040 <delay_ms@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    $0x3e8,%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    $0xf,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <blinky2+0x27>
mov    $0x3e8,%edi
call   1040 <delay_ms@plt>
movl   $0x2ee,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1211 <blinky2+0xf1>
xor    %edi,%edi
call   1030 <fill@plt>
mov    $0x2ef,%edi
sub    -0x4(%rbp),%edi
call   1040 <delay_ms@plt>
mov    $0xff,%edi
call   1030 <fill@plt>
mov    $0x64,%edi
call   1040 <delay_ms@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    $0x3e8,%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    $0xf,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    11b2 <blinky2+0x92>
jmp    1216 <blinky2+0xf6>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <blinky2+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blinky2>:
push   %rbp
push   %r14
push   %rbx
xor    %r14d,%r14d
xor    %edi,%edi
call   1030 <fill@plt>
mov    $0xcccccccd,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x2ee,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %edi,%edi
call   1030 <fill@plt>
mov    %ebx,%edi
call   1040 <delay_ms@plt>
mov    $0xff,%edi
call   1030 <fill@plt>
mov    $0x64,%edi
call   1040 <delay_ms@plt>
mov    %ebx,%ecx
imul   %rbp,%rcx
shr    $0x23,%rcx
mov    $0x3e8,%eax
xor    %edx,%edx
div    %ecx
neg    %eax
add    %eax,%ebx
add    $0xfffffff1,%ebx
test   %ebx,%ebx
jg     1150 <blinky2+0x30>
mov    $0x3e8,%edi
call   1040 <delay_ms@plt>
mov    $0x2ee,%ebx
nop
xor    %edi,%edi
call   1030 <fill@plt>
mov    $0x2ef,%edi
sub    %ebx,%edi
call   1040 <delay_ms@plt>
mov    $0xff,%edi
call   1030 <fill@plt>
mov    $0x64,%edi
call   1040 <delay_ms@plt>
mov    %ebx,%ecx
imul   %rbp,%rcx
shr    $0x23,%rcx
mov    $0x3e8,%eax
xor    %edx,%edx
div    %ecx
neg    %eax
add    %eax,%ebx
add    $0xfffffff1,%ebx
test   %ebx,%ebx
jg     11a0 <blinky2+0x80>
add    $0x1,%r14d
cmp    $0x5,%r14d
jne    1140 <blinky2+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @blinky2() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @fill(i32 0)
store i32 0, i32* %2
br label %4
4: ; preds = %42, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %45
7: ; preds = %4
store i32 750, i32* %1
br label %8
8: ; preds = %11, %7
%9 = load i32, i32* %1
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %23
11: ; preds = %8
%12 = call i32 @fill(i32 0)
%13 = load i32, i32* %1
%14 = call i32 @delay_ms(i32 %13)
%15 = call i32 @fill(i32 255)
%16 = call i32 @delay_ms(i32 100)
%17 = load i32, i32* %1
%18 = load i32, i32* %1
%19 = sdiv i32 %18, 10
%20 = sdiv i32 1000, %19
%21 = add nsw i32 15, %20
%22 = sub nsw i32 %17, %21
store i32 %22, i32* %1
br label %8
23: ; preds = %8
%24 = call i32 @delay_ms(i32 1000)
store i32 750, i32* %1
br label %25
25: ; preds = %28, %23
%26 = load i32, i32* %1
%27 = icmp sgt i32 %26, 0
br i1 %27, label %28, label %41
28: ; preds = %25
%29 = call i32 @fill(i32 0)
%30 = load i32, i32* %1
%31 = sub nsw i32 751, %30
%32 = call i32 @delay_ms(i32 %31)
%33 = call i32 @fill(i32 255)
%34 = call i32 @delay_ms(i32 100)
%35 = load i32, i32* %1
%36 = load i32, i32* %1
%37 = sdiv i32 %36, 10
%38 = sdiv i32 1000, %37
%39 = add nsw i32 15, %38
%40 = sub nsw i32 %35, %39
store i32 %40, i32* %1
br label %25
41: ; preds = %25
br label %42
42: ; preds = %41
%43 = load i32, i32* %2
%44 = add nsw i32 %43, 1
store i32 %44, i32* %2
br label %4
45: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @blinky2() {
%1 = tail call i32 @fill(i32 0)
br label %2
2: ; preds = %0, %29
%3 = phi i32 [ 0, %0 ], [ %30, %29 ]
br label %4
4: ; preds = %2, %4
%5 = phi i32 [ 750, %2 ], [ %13, %4 ]
%6 = tail call i32 @fill(i32 0)
%7 = tail call i32 @delay_ms(i32 %5)
%8 = tail call i32 @fill(i32 255)
%9 = tail call i32 @delay_ms(i32 100)
%10 = udiv i32 %5, 10
%11 = udiv i32 1000, %10
%12 = add nsw i32 %5, -15
%13 = sub nsw i32 %12, %11
%14 = icmp sgt i32 %13, 0
br i1 %14, label %4, label %15
15: ; preds = %4
%16 = tail call i32 @delay_ms(i32 1000)
br label %17
17: ; preds = %15, %17
%18 = phi i32 [ 750, %15 ], [ %27, %17 ]
%19 = tail call i32 @fill(i32 0)
%20 = sub nsw i32 751, %18
%21 = tail call i32 @delay_ms(i32 %20)
%22 = tail call i32 @fill(i32 255)
%23 = tail call i32 @delay_ms(i32 100)
%24 = udiv i32 %18, 10
%25 = udiv i32 1000, %24
%26 = add nsw i32 %18, -15
%27 = sub nsw i32 %26, %25
%28 = icmp sgt i32 %27, 0
br i1 %28, label %17, label %29
29: ; preds = %17
%30 = add nuw nsw i32 %3, 1
%31 = icmp eq i32 %30, 5
br i1 %31, label %32, label %2
32: ; preds = %29
ret void
}