#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*/ cirp(int, int, int);
int /*<<< orphan*/ delay_ms(int);
void flash_2() {
  int i;
  for (i = 129; i > 0; i--) {
    cirp(i - 2, 0, 1);
    delay_ms(40);
    cirp(i - 1, 0, 0);
  }
  delay_ms(40);
  for (i = 0; i < 136; i++) {
    cirp(i, 1, 1);
    delay_ms(40);
    cirp(i - 8, 1, 0);
  }
  delay_ms(40);
  for (i = 129; i > 0; i--) {
    cirp(i - 2, 0, 1);
    delay_ms(40);
  }
  delay_ms(40);
  for (i = 0; i < 128; i++) {
    cirp(i - 8, 1, 0);
    delay_ms(40);
  }
  delay_ms(300);
}


x86 assembly (clang, -O0):
<flash_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x81,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1172 <flash_2+0x52>
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <cirp@plt>
mov    $0x28,%edi
call   1030 <delay_ms@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <cirp@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <flash_2+0xf>
mov    $0x28,%edi
call   1030 <delay_ms@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x88,-0x4(%rbp)
jge    11c9 <flash_2+0xa9>
mov    -0x4(%rbp),%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1040 <cirp@plt>
mov    $0x28,%edi
call   1030 <delay_ms@plt>
mov    -0x4(%rbp),%edi
sub    $0x8,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <cirp@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1183 <flash_2+0x63>
mov    $0x28,%edi
call   1030 <delay_ms@plt>
movl   $0x81,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    120e <flash_2+0xee>
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <cirp@plt>
mov    $0x28,%edi
call   1030 <delay_ms@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    11da <flash_2+0xba>
mov    $0x28,%edi
call   1030 <delay_ms@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x80,-0x4(%rbp)
jge    1256 <flash_2+0x136>
mov    -0x4(%rbp),%edi
sub    $0x8,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <cirp@plt>
mov    $0x28,%edi
call   1030 <delay_ms@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    121f <flash_2+0xff>
mov    $0x12c,%edi
call   1030 <delay_ms@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_2>:
push   %rbx
mov    $0x82,%ebx
cs nopw 0x0(%rax,%rax,1)
lea    -0x3(%rbx),%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <cirp@plt>
mov    $0x28,%edi
call   1030 <delay_ms@plt>
lea    -0x2(%rbx),%edi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <cirp@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <flash_2+0x10>
mov    $0x28,%edi
call   1030 <delay_ms@plt>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %ebx,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1040 <cirp@plt>
mov    $0x28,%edi
call   1030 <delay_ms@plt>
lea    -0x8(%rbx),%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <cirp@plt>
add    $0x1,%ebx
cmp    $0x88,%ebx
jne    1170 <flash_2+0x50>
mov    $0x28,%edi
call   1030 <delay_ms@plt>
mov    $0x82,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <cirp@plt>
mov    $0x28,%edi
call   1030 <delay_ms@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     11c0 <flash_2+0xa0>
mov    $0x28,%edi
call   1030 <delay_ms@plt>
mov    $0xfffffff8,%ebx
mov    %ebx,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <cirp@plt>
mov    $0x28,%edi
call   1030 <delay_ms@plt>
add    $0x1,%ebx
cmp    $0x78,%ebx
jne    11f0 <flash_2+0xd0>
mov    $0x12c,%edi
pop    %rbx
jmp    1030 <delay_ms@plt>

LLVM IR (-O0):
define void @flash_2() {
%1 = alloca i32
store i32 129, i32* %1
br label %2
2: ; preds = %13, %0
%3 = load i32, i32* %1
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %16
5: ; preds = %2
%6 = load i32, i32* %1
%7 = sub nsw i32 %6, 2
%8 = call i32 @cirp(i32 %7, i32 0, i32 1)
%9 = call i32 @delay_ms(i32 40)
%10 = load i32, i32* %1
%11 = sub nsw i32 %10, 1
%12 = call i32 @cirp(i32 %11, i32 0, i32 0)
br label %13
13: ; preds = %5
%14 = load i32, i32* %1
%15 = add nsw i32 %14, -1
store i32 %15, i32* %1
br label %2
16: ; preds = %2
%17 = call i32 @delay_ms(i32 40)
store i32 0, i32* %1
br label %18
18: ; preds = %28, %16
%19 = load i32, i32* %1
%20 = icmp slt i32 %19, 136
br i1 %20, label %21, label %31
21: ; preds = %18
%22 = load i32, i32* %1
%23 = call i32 @cirp(i32 %22, i32 1, i32 1)
%24 = call i32 @delay_ms(i32 40)
%25 = load i32, i32* %1
%26 = sub nsw i32 %25, 8
%27 = call i32 @cirp(i32 %26, i32 1, i32 0)
br label %28
28: ; preds = %21
%29 = load i32, i32* %1
%30 = add nsw i32 %29, 1
store i32 %30, i32* %1
br label %18
31: ; preds = %18
%32 = call i32 @delay_ms(i32 40)
store i32 129, i32* %1
br label %33
33: ; preds = %41, %31
%34 = load i32, i32* %1
%35 = icmp sgt i32 %34, 0
br i1 %35, label %36, label %44
36: ; preds = %33
%37 = load i32, i32* %1
%38 = sub nsw i32 %37, 2
%39 = call i32 @cirp(i32 %38, i32 0, i32 1)
%40 = call i32 @delay_ms(i32 40)
br label %41
41: ; preds = %36
%42 = load i32, i32* %1
%43 = add nsw i32 %42, -1
store i32 %43, i32* %1
br label %33
44: ; preds = %33
%45 = call i32 @delay_ms(i32 40)
store i32 0, i32* %1
br label %46
46: ; preds = %54, %44
%47 = load i32, i32* %1
%48 = icmp slt i32 %47, 128
br i1 %48, label %49, label %57
49: ; preds = %46
%50 = load i32, i32* %1
%51 = sub nsw i32 %50, 8
%52 = call i32 @cirp(i32 %51, i32 1, i32 0)
%53 = call i32 @delay_ms(i32 40)
br label %54
54: ; preds = %49
%55 = load i32, i32* %1
%56 = add nsw i32 %55, 1
store i32 %56, i32* %1
br label %46
57: ; preds = %46
%58 = call i32 @delay_ms(i32 300)
ret void
}

LLVM IR (-O2):
define void @flash_2() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 129, %0 ], [ %6, %1 ]
%3 = add nsw i32 %2, -2
%4 = tail call i32 @cirp(i32 %3, i32 0, i32 1)
%5 = tail call i32 @delay_ms(i32 40)
%6 = add nsw i32 %2, -1
%7 = tail call i32 @cirp(i32 %6, i32 0, i32 0)
%8 = icmp ugt i32 %2, 1
br i1 %8, label %1, label %9
9: ; preds = %1
%10 = tail call i32 @delay_ms(i32 40)
br label %11
11: ; preds = %9, %11
%12 = phi i32 [ 0, %9 ], [ %17, %11 ]
%13 = tail call i32 @cirp(i32 %12, i32 1, i32 1)
%14 = tail call i32 @delay_ms(i32 40)
%15 = add nsw i32 %12, -8
%16 = tail call i32 @cirp(i32 %15, i32 1, i32 0)
%17 = add nuw nsw i32 %12, 1
%18 = icmp eq i32 %17, 136
br i1 %18, label %19, label %11
19: ; preds = %11
%20 = tail call i32 @delay_ms(i32 40)
br label %21
21: ; preds = %19, %21
%22 = phi i32 [ 129, %19 ], [ %26, %21 ]
%23 = add nsw i32 %22, -2
%24 = tail call i32 @cirp(i32 %23, i32 0, i32 1)
%25 = tail call i32 @delay_ms(i32 40)
%26 = add nsw i32 %22, -1
%27 = icmp ugt i32 %22, 1
br i1 %27, label %21, label %28
28: ; preds = %21
%29 = tail call i32 @delay_ms(i32 40)
br label %30
30: ; preds = %28, %30
%31 = phi i32 [ 0, %28 ], [ %35, %30 ]
%32 = add nsw i32 %31, -8
%33 = tail call i32 @cirp(i32 %32, i32 1, i32 0)
%34 = tail call i32 @delay_ms(i32 40)
%35 = add nuw nsw i32 %31, 1
%36 = icmp eq i32 %35, 128
br i1 %36, label %37, label %30
37: ; preds = %30
%38 = tail call i32 @delay_ms(i32 300)
ret void
}