#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 */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ A_NORMAL;
int COLS;
int LINES;
int abs(int);
int /*<<< orphan*/ attrset(int /*<<< orphan*/);
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ erase();
int /*<<< orphan*/ explode(int, int);
scalar_t__ has_colors();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ mvprintw(int, int, char *);
int rand();
int /*<<< orphan*/ showit(int);
int /*<<< orphan*/ srand(unsigned int);
int /*<<< orphan*/ start_color();
unsigned int time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  int start, end, row, diff, flag = 0, direction;
  unsigned seed;
  initscr();
  if (has_colors())
    start_color();
  seed = time((time_t *)0);
  srand(seed);
  cbreak();
  for (;;) {
    do {
      start = rand() % (COLS - 3);
      end = rand() % (COLS - 3);
      start = (start < 2) ? 2 : start;
      end = (end < 2) ? 2 : end;
      direction = (start > end) ? -1 : 1;
      diff = abs(start - end);
    } while (diff < 2 || diff >= LINES - 2);
    attrset(A_NORMAL);
    for (row = 1; row < diff; row++) {
      mvprintw(LINES - row, start + (row * direction),
               (direction < 0) ? "\\" : "/");
      if (flag++) {
        showit(120);
        erase();
        flag = 0;
      }
    }
    if (flag++) {
      showit(120);
      flag = 0;
    }
    seed = time((time_t *)0);
    srand(seed);
    explode(LINES - row, start + (diff * direction));
    erase();
    showit(120);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
mov    $0x0,%al
call   1060 <initscr@plt>
mov    $0x0,%al
call   1030 <has_colors@plt>
cmp    $0x0,%rax
je     120c <main+0x3c>
mov    $0x0,%al
call   1080 <start_color@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10b0 <time@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
call   10a0 <srand@plt>
mov    $0x0,%al
call   1050 <cbreak@plt>
jmp    122c <main+0x5c>
mov    $0x0,%al
call   10f0 <rand@plt>
mov    0x2d9e(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   10f0 <rand@plt>
mov    0x2d85(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1275 <main+0xa5>
mov    $0x2,%eax
mov    %eax,-0x30(%rbp)
jmp    127b <main+0xab>
mov    -0x14(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x18(%rbp)
jge    1298 <main+0xc8>
mov    $0x2,%eax
mov    %eax,-0x34(%rbp)
jmp    129e <main+0xce>
mov    -0x18(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
sub    -0x18(%rbp),%edi
call   1040 <abs@plt>
mov    %eax,-0x20(%rbp)
mov    $0x1,%al
cmpl   $0x2,-0x20(%rbp)
mov    %al,-0x35(%rbp)
jl     12f0 <main+0x120>
mov    -0x20(%rbp),%eax
mov    0x2cfd(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
setge  %al
mov    %al,-0x35(%rbp)
mov    -0x35(%rbp),%al
test   $0x1,%al
jne    122c <main+0x5c>
mov    0x2ce6(%rip),%rax
mov    (%rax),%edi
call   10c0 <attrset@plt>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1390 <main+0x1c0>
mov    0x2cbd(%rip),%rax
mov    (%rax),%edi
sub    -0x1c(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x1c(%rbp),%eax
imul   -0x28(%rbp),%eax
add    %eax,%esi
mov    -0x28(%rbp),%ecx
lea    0xcc4(%rip),%rdx
lea    0xcbb(%rip),%rax
cmp    $0x0,%ecx
cmovl  %rax,%rdx
call   10e0 <mvprintw@plt>
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x24(%rbp)
cmp    $0x0,%eax
je     137d <main+0x1ad>
mov    $0x78,%edi
call   10d0 <showit@plt>
mov    $0x0,%al
call   1070 <erase@plt>
movl   $0x0,-0x24(%rbp)
jmp    1382 <main+0x1b2>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1310 <main+0x140>
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x24(%rbp)
cmp    $0x0,%eax
je     13b5 <main+0x1e5>
mov    $0x78,%edi
call   10d0 <showit@plt>
movl   $0x0,-0x24(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   10b0 <time@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
call   10a0 <srand@plt>
mov    0x2c10(%rip),%rax
mov    (%rax),%edi
sub    -0x1c(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%eax
imul   -0x28(%rbp),%eax
add    %eax,%esi
call   1090 <explode@plt>
mov    $0x0,%al
call   1070 <erase@plt>
mov    $0x78,%edi
call   10d0 <showit@plt>
jmp    1227 <main+0x57>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <initscr@plt>
xor    %eax,%eax
call   1030 <has_colors@plt>
test   %rax,%rax
je     11e5 <main+0x25>
xor    %eax,%eax
call   1070 <start_color@plt>
xor    %edi,%edi
call   10a0 <time@plt>
mov    %eax,%edi
call   1090 <srand@plt>
xor    %eax,%eax
call   1040 <cbreak@plt>
mov    0x2dd7(%rip),%r14
xor    %r13d,%r13d
jmp    1250 <main+0x90>
mov    $0x1,%r13d
xor    %edi,%edi
call   10a0 <time@plt>
mov    %eax,%edi
call   1090 <srand@plt>
mov    0x2dbf(%rip),%rax
mov    (%rax),%edi
sub    %r12d,%edi
imul   %r12d,%r14d
add    %ebx,%r14d
mov    %r14d,%esi
call   1080 <explode@plt>
xor    %eax,%eax
call   1060 <erase@plt>
mov    $0x78,%edi
call   10c0 <showit@plt>
mov    0x2d8b(%rip),%r14
nopl   (%rax)
xor    %eax,%eax
call   10e0 <rand@plt>
mov    (%r14),%ecx
add    $0xfffffffd,%ecx
cltd
idiv   %ecx
mov    %edx,%ebx
xor    %eax,%eax
call   10e0 <rand@plt>
mov    (%r14),%ecx
add    $0xfffffffd,%ecx
cltd
idiv   %ecx
mov    %edx,%ebp
cmp    $0x3,%ebx
jge    127e <main+0xbe>
mov    $0x2,%ebx
cmp    $0x3,%ebp
jge    1288 <main+0xc8>
mov    $0x2,%ebp
mov    %ebx,%eax
sub    %ebp,%eax
mov    %eax,%r12d
neg    %r12d
cmovs  %eax,%r12d
cmp    $0x2,%r12d
jb     1250 <main+0x90>
mov    0x2d3d(%rip),%rax
mov    (%rax),%eax
add    $0xfffffffe,%eax
cmp    %eax,%r12d
jge    1250 <main+0x90>
mov    0x2d34(%rip),%rax
mov    (%rax),%edi
call   10b0 <attrset@plt>
xor    %eax,%eax
cmp    %ebp,%ebx
setbe  %al
lea    -0x1(%rax,%rax,1),%r14d
lea    0xd34(%rip),%rbp
lea    0xd2b(%rip),%rax
cmova  %rax,%rbp
mov    $0x1,%r15d
jmp    1311 <main+0x151>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x78,%edi
call   10c0 <showit@plt>
xor    %r13d,%r13d
xor    %eax,%eax
call   1060 <erase@plt>
add    $0x1,%r15d
cmp    %r12d,%r15d
je     1206 <main+0x46>
mov    0x2cc8(%rip),%rax
mov    (%rax),%edi
sub    %r15d,%edi
mov    %r15d,%esi
imul   %r14d,%esi
add    %ebx,%esi
mov    %rbp,%rdx
call   10d0 <mvprintw@plt>
test   %r13d,%r13d
jne    12f0 <main+0x130>
add    $0x1,%r15d
mov    $0x1,%r13d
cmp    %r12d,%r15d
jne    1311 <main+0x151>
mov    $0x78,%edi
call   10c0 <showit@plt>
xor    %r13d,%r13d
jmp    120c <main+0x4c>

LLVM IR (-O0):
@COLS = global i32 0
@LINES = global i32 0
@A_NORMAL = global i32 0
@.str = [2 x i8] c"\\\00"
@.str.1 = [2 x i8] c"/\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %10
%13 = call i32 (...) @initscr()
%14 = call i64 (...) @has_colors()
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = call i32 (...) @start_color()
br label %18
18: ; preds = %16, %2
%19 = call i32 @time(i32* null)
store i32 %19, i32* %12
%20 = load i32, i32* %12
%21 = call i32 @srand(i32 %20)
%22 = call i32 (...) @cbreak()
br label %23
23: ; preds = %103, %18
br label %24
24: ; preds = %64, %23
%25 = call i32 (...) @rand()
%26 = load i32, i32* @COLS
%27 = sub nsw i32 %26, 3
%28 = srem i32 %25, %27
store i32 %28, i32* %6
%29 = call i32 (...) @rand()
%30 = load i32, i32* @COLS
%31 = sub nsw i32 %30, 3
%32 = srem i32 %29, %31
store i32 %32, i32* %7
%33 = load i32, i32* %6
%34 = icmp slt i32 %33, 2
br i1 %34, label %35, label %36
35: ; preds = %24
br label %38
36: ; preds = %24
%37 = load i32, i32* %6
br label %38
38: ; preds = %36, %35
%39 = phi i32 [ 2, %35 ], [ %37, %36 ]
store i32 %39, i32* %6
%40 = load i32, i32* %7
%41 = icmp slt i32 %40, 2
br i1 %41, label %42, label %43
42: ; preds = %38
br label %45
43: ; preds = %38
%44 = load i32, i32* %7
br label %45
45: ; preds = %43, %42
%46 = phi i32 [ 2, %42 ], [ %44, %43 ]
store i32 %46, i32* %7
%47 = load i32, i32* %6
%48 = load i32, i32* %7
%49 = icmp sgt i32 %47, %48
%50 = zext i1 %49 to i64
%51 = select i1 %49, i32 -1, i32 1
store i32 %51, i32* %11
%52 = load i32, i32* %6
%53 = load i32, i32* %7
%54 = sub nsw i32 %52, %53
%55 = call i32 @abs(i32 %54)
store i32 %55, i32* %9
br label %56
56: ; preds = %45
%57 = load i32, i32* %9
%58 = icmp slt i32 %57, 2
br i1 %58, label %64, label %59
59: ; preds = %56
%60 = load i32, i32* %9
%61 = load i32, i32* @LINES
%62 = sub nsw i32 %61, 2
%63 = icmp sge i32 %60, %62
br label %64
64: ; preds = %59, %56
%65 = phi i1 [ true, %56 ], [ %63, %59 ]
br i1 %65, label %24, label %66
66: ; preds = %64
%67 = load i32, i32* @A_NORMAL
%68 = call i32 @attrset(i32 %67)
store i32 1, i32* %8
br label %69
69: ; preds = %94, %66
%70 = load i32, i32* %8
%71 = load i32, i32* %9
%72 = icmp slt i32 %70, %71
br i1 %72, label %73, label %97
73: ; preds = %69
%74 = load i32, i32* @LINES
%75 = load i32, i32* %8
%76 = sub nsw i32 %74, %75
%77 = load i32, i32* %6
%78 = load i32, i32* %8
%79 = load i32, i32* %11
%80 = mul nsw i32 %78, %79
%81 = add nsw i32 %77, %80
%82 = load i32, i32* %11
%83 = icmp slt i32 %82, 0
%84 = zext i1 %83 to i64
%85 = select i1 %83, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%86 = call i32 @mvprintw(i32 %76, i32 %81, i8* %85)
%87 = load i32, i32* %10
%88 = add nsw i32 %87, 1
store i32 %88, i32* %10
%89 = icmp ne i32 %87, 0
br i1 %89, label %90, label %93
90: ; preds = %73
%91 = call i32 @showit(i32 120)
%92 = call i32 (...) @erase()
store i32 0, i32* %10
br label %93
93: ; preds = %90, %73
br label %94
94: ; preds = %93
%95 = load i32, i32* %8
%96 = add nsw i32 %95, 1
store i32 %96, i32* %8
br label %69
97: ; preds = %69
%98 = load i32, i32* %10
%99 = add nsw i32 %98, 1
store i32 %99, i32* %10
%100 = icmp ne i32 %98, 0
br i1 %100, label %101, label %103
101: ; preds = %97
%102 = call i32 @showit(i32 120)
store i32 0, i32* %10
br label %103
103: ; preds = %101, %97
%104 = call i32 @time(i32* null)
store i32 %104, i32* %12
%105 = load i32, i32* %12
%106 = call i32 @srand(i32 %105)
%107 = load i32, i32* @LINES
%108 = load i32, i32* %8
%109 = sub nsw i32 %107, %108
%110 = load i32, i32* %6
%111 = load i32, i32* %9
%112 = load i32, i32* %11
%113 = mul nsw i32 %111, %112
%114 = add nsw i32 %110, %113
%115 = call i32 @explode(i32 %109, i32 %114)
%116 = call i32 (...) @erase()
%117 = call i32 @showit(i32 120)
br label %23
}

LLVM IR (-O2):
@COLS = global i32 0
@LINES = global i32 0
@A_NORMAL = global i32 0
@.str = [2 x i8] c"\\\00"
@.str.1 = [2 x i8] c"/\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @initscr()
%4 = tail call i64 (...) @has_colors()
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @start_color()
br label %8
8: ; preds = %6, %2
%9 = tail call i32 @time(i32* null)
%10 = tail call i32 @srand(i32 %9)
%11 = tail call i32 (...) @cbreak()
br label %12
12: ; preds = %62, %8
%13 = phi i32 [ 0, %8 ], [ %63, %62 ]
br label %14
14: ; preds = %14, %12
%15 = tail call i32 (...) @rand()
%16 = load i32, i32* @COLS
%17 = add nsw i32 %16, -3
%18 = srem i32 %15, %17
%19 = tail call i32 (...) @rand()
%20 = load i32, i32* @COLS
%21 = add nsw i32 %20, -3
%22 = srem i32 %19, %21
%23 = icmp sgt i32 %18, 2
%24 = select i1 %23, i32 %18, i32 2
%25 = icmp sgt i32 %22, 2
%26 = select i1 %25, i32 %22, i32 2
%27 = sub nsw i32 %24, %26
%28 = tail call i32 @llvm.abs.i32(i32 %27, i1 true)
%29 = icmp ult i32 %28, 2
%30 = load i32, i32* @LINES
%31 = add nsw i32 %30, -2
%32 = icmp sge i32 %28, %31
%33 = select i1 %29, i1 true, i1 %32
br i1 %33, label %14, label %34
34: ; preds = %14
%35 = icmp ugt i32 %24, %26
%36 = select i1 %35, i32 -1, i32 1
%37 = load i32, i32* @A_NORMAL
%38 = tail call i32 @attrset(i32 %37)
%39 = select i1 %35, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
br label %40
40: ; preds = %54, %34
%41 = phi i32 [ %13, %34 ], [ %55, %54 ]
%42 = phi i32 [ 1, %34 ], [ %56, %54 ]
%43 = load i32, i32* @LINES
%44 = sub nsw i32 %43, %42
%45 = mul nsw i32 %42, %36
%46 = add nsw i32 %45, %24
%47 = tail call i32 @mvprintw(i32 %44, i32 %46, i8* %39)
%48 = icmp eq i32 %41, 0
br i1 %48, label %57, label %49
49: ; preds = %40
%50 = tail call i32 @showit(i32 120)
%51 = tail call i32 (...) @erase()
%52 = add nuw nsw i32 %42, 1
%53 = icmp eq i32 %52, %28
br i1 %53, label %62, label %54
54: ; preds = %49, %57
%55 = phi i32 [ 0, %49 ], [ 1, %57 ]
%56 = phi i32 [ %52, %49 ], [ %58, %57 ]
br label %40
57: ; preds = %40
%58 = add nuw nsw i32 %42, 1
%59 = icmp eq i32 %58, %28
br i1 %59, label %60, label %54
60: ; preds = %57
%61 = tail call i32 @showit(i32 120)
br label %62
62: ; preds = %49, %60
%63 = phi i32 [ 0, %60 ], [ 1, %49 ]
%64 = tail call i32 @time(i32* null)
%65 = tail call i32 @srand(i32 %64)
%66 = load i32, i32* @LINES
%67 = sub nsw i32 %66, %28
%68 = mul nsw i32 %28, %36
%69 = add nsw i32 %68, %24
%70 = tail call i32 @explode(i32 %67, i32 %69)
%71 = tail call i32 (...) @erase()
%72 = tail call i32 @showit(i32 120)
br label %12
}