#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*/ check();
int /*<<< orphan*/ circle(int, int, int);
int /*<<< orphan*/ cleardevice();
int /*<<< orphan*/ closegraph();
int /*<<< orphan*/ delay(int);
int getmaxx();
int getmaxy();
int /*<<< orphan*/ initgraph(int *, int *, char *);
scalar_t__ kbhit();
int /*<<< orphan*/ line(int, int, int, int);
int /*<<< orphan*/ outtextxy(int /*<<< orphan*/, int /*<<< orphan*/, char *);
int /*<<< orphan*/ putpixel(int, int, int);
int rand();
int /*<<< orphan*/ setbkcolor(int /*<<< orphan*/);
int /*<<< orphan*/ setcolor(int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ srand(int);
int main(void) {
  int i, col, gd, gm, x, y;
  gd = 11;
  gm = 7;
  initgraph(&gd, &gm, "");
  setbkcolor(0);
  cleardevice();
  x = getmaxx();
  y = getmaxy();
  while (!kbhit()) {
    setcolor(14);
    outtextxy(0, 0, "Press a key to continue");
    for (i = 0; i < 500; i++) {
      setcolor(1 + (rand() % (15)));
      circle((rand() % (x)), (rand() % (y)), (rand() % (100)));
    }
    sleep(1);
    cleardevice();
  }
  check();
  while (!kbhit()) {
    setcolor(14);
    outtextxy(0, 0, "Press a key to continue");
    for (i = 0; i < 500; i++) {
      setcolor(1 + (rand() % (15)));
      line((rand() % (x)), (rand() % (y)), (rand() % (x)), (rand() % (y)));
    }
    sleep(1);
    cleardevice();
  }
  check();
  while (!kbhit()) {
    setcolor(14);
    outtextxy(0, 0, "Press a key to exit");
    srand(2012);
    for (i = 0; i < 1000; i++) {
      col = 1 + (rand() % (15));
      putpixel((rand() % (x)), (rand() % (y)), col);
      if (kbhit())
        break;
      delay(1);
    }
    sleep(1);
    srand(2012);
    for (i = 0; i < 1000; i++) {
      col = 1 + (rand() % (15));
      putpixel((rand() % (x)), (rand() % (y)), 0);
      if (kbhit())
        break;
      delay(1);
    }
    sleep(1);
    cleardevice();
  }
  closegraph();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xb,-0x10(%rbp)
movl   $0x7,-0x14(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    0xddb(%rip),%rdx
call   1030 <initgraph@plt>
xor    %edi,%edi
call   1050 <setbkcolor@plt>
mov    $0x0,%al
call   1040 <cleardevice@plt>
mov    $0x0,%al
call   10e0 <getmaxx@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1070 <getmaxy@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1090 <kbhit@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1280 <main+0x70>
jmp    1321 <main+0x111>
mov    $0xe,%edi
call   1110 <setcolor@plt>
xor    %esi,%esi
lea    0xd6d(%rip),%rdx
mov    %esi,%edi
call   1060 <outtextxy@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x1f4,-0x8(%rbp)
jge    130b <main+0xfb>
mov    $0x0,%al
call   1130 <rand@plt>
mov    $0xf,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x1,%edi
call   1110 <setcolor@plt>
mov    $0x0,%al
call   1130 <rand@plt>
cltd
idivl  -0x18(%rbp)
mov    %edx,-0x24(%rbp)
mov    $0x0,%al
call   1130 <rand@plt>
cltd
idivl  -0x1c(%rbp)
mov    %edx,-0x20(%rbp)
mov    $0x0,%al
call   1130 <rand@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    $0x64,%ecx
cltd
idiv   %ecx
call   10d0 <circle@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12a1 <main+0x91>
mov    $0x1,%edi
call   1120 <sleep@plt>
mov    $0x0,%al
call   1040 <cleardevice@plt>
jmp    1263 <main+0x53>
mov    $0x0,%al
call   1100 <check@plt>
mov    $0x0,%al
call   1090 <kbhit@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1345 <main+0x135>
jmp    13f5 <main+0x1e5>
mov    $0xe,%edi
call   1110 <setcolor@plt>
xor    %esi,%esi
lea    0xca8(%rip),%rdx
mov    %esi,%edi
call   1060 <outtextxy@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x1f4,-0x8(%rbp)
jge    13df <main+0x1cf>
mov    $0x0,%al
call   1130 <rand@plt>
mov    $0xf,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x1,%edi
call   1110 <setcolor@plt>
mov    $0x0,%al
call   1130 <rand@plt>
cltd
idivl  -0x18(%rbp)
mov    %edx,-0x30(%rbp)
mov    $0x0,%al
call   1130 <rand@plt>
cltd
idivl  -0x1c(%rbp)
mov    %edx,-0x2c(%rbp)
mov    $0x0,%al
call   1130 <rand@plt>
cltd
idivl  -0x18(%rbp)
mov    %edx,-0x28(%rbp)
mov    $0x0,%al
call   1130 <rand@plt>
mov    -0x30(%rbp),%edi
mov    -0x2c(%rbp),%esi
cltd
idivl  -0x1c(%rbp)
mov    %edx,%ecx
mov    -0x28(%rbp),%edx
call   10f0 <line@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1366 <main+0x156>
mov    $0x1,%edi
call   1120 <sleep@plt>
mov    $0x0,%al
call   1040 <cleardevice@plt>
jmp    1328 <main+0x118>
mov    $0x0,%al
call   1100 <check@plt>
mov    $0x0,%al
call   1090 <kbhit@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1419 <main+0x209>
jmp    1560 <main+0x350>
mov    $0xe,%edi
call   1110 <setcolor@plt>
xor    %esi,%esi
lea    0xbec(%rip),%rdx
mov    %esi,%edi
call   1060 <outtextxy@plt>
mov    $0x7dc,%edi
call   10b0 <srand@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    14ba <main+0x2aa>
mov    $0x0,%al
call   1130 <rand@plt>
mov    $0xf,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1130 <rand@plt>
cltd
idivl  -0x18(%rbp)
mov    %edx,-0x34(%rbp)
mov    $0x0,%al
call   1130 <rand@plt>
mov    -0x34(%rbp),%edi
cltd
idivl  -0x1c(%rbp)
mov    %edx,%esi
mov    -0xc(%rbp),%edx
call   1080 <putpixel@plt>
mov    $0x0,%al
call   1090 <kbhit@plt>
cmp    $0x0,%rax
je     14a2 <main+0x292>
jmp    14ba <main+0x2aa>
mov    $0x1,%edi
call   10a0 <delay@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1444 <main+0x234>
mov    $0x1,%edi
call   1120 <sleep@plt>
mov    $0x7dc,%edi
call   10b0 <srand@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    154a <main+0x33a>
mov    $0x0,%al
call   1130 <rand@plt>
mov    $0xf,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1130 <rand@plt>
cltd
idivl  -0x18(%rbp)
mov    %edx,-0x38(%rbp)
mov    $0x0,%al
call   1130 <rand@plt>
mov    -0x38(%rbp),%edi
cltd
idivl  -0x1c(%rbp)
mov    %edx,%esi
xor    %edx,%edx
call   1080 <putpixel@plt>
mov    $0x0,%al
call   1090 <kbhit@plt>
cmp    $0x0,%rax
je     1532 <main+0x322>
jmp    154a <main+0x33a>
mov    $0x1,%edi
call   10a0 <delay@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    14d5 <main+0x2c5>
mov    $0x1,%edi
call   1120 <sleep@plt>
mov    $0x0,%al
call   1040 <cleardevice@plt>
jmp    13fc <main+0x1ec>
mov    $0x0,%al
call   10c0 <closegraph@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0xb,0x4(%rsp)
movl   $0x7,(%rsp)
lea    0xde6(%rip),%rdx
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <initgraph@plt>
xor    %edi,%edi
call   1050 <setbkcolor@plt>
xor    %eax,%eax
call   1040 <cleardevice@plt>
xor    %eax,%eax
call   10e0 <getmaxx@plt>
mov    %eax,%r15d
xor    %eax,%eax
call   1070 <getmaxy@plt>
mov    %eax,%r12d
xor    %eax,%eax
call   1090 <kbhit@plt>
test   %rax,%rax
jne    1341 <main+0x131>
lea    0xd89(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    $0xe,%edi
call   1110 <setcolor@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %r14,%rdx
call   1060 <outtextxy@plt>
mov    $0x1f4,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1130 <rand@plt>
cltq
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x3,%ecx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x1,%edi
call   1110 <setcolor@plt>
xor    %eax,%eax
call   1130 <rand@plt>
cltd
idiv   %r15d
mov    %edx,%r13d
xor    %eax,%eax
call   1130 <rand@plt>
cltd
idiv   %r12d
mov    %edx,%ebp
xor    %eax,%eax
call   1130 <rand@plt>
movslq %eax,%rdx
imul   $0x51eb851f,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%edx
mov    %r13d,%edi
mov    %ebp,%esi
call   10d0 <circle@plt>
add    $0xffffffff,%ebx
jne    12a0 <main+0x90>
mov    $0x1,%edi
call   1120 <sleep@plt>
xor    %eax,%eax
call   1040 <cleardevice@plt>
xor    %eax,%eax
call   1090 <kbhit@plt>
test   %rax,%rax
je     1280 <main+0x70>
xor    %eax,%eax
call   1100 <check@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1090 <kbhit@plt>
test   %rax,%rax
jne    1410 <main+0x200>
mov    $0xe,%edi
call   1110 <setcolor@plt>
xor    %edi,%edi
xor    %esi,%esi
lea    0xc8b(%rip),%rdx
call   1060 <outtextxy@plt>
mov    $0x1f4,%r14d
xor    %eax,%eax
call   1130 <rand@plt>
cltq
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x3,%ecx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x1,%edi
call   1110 <setcolor@plt>
xor    %eax,%eax
call   1130 <rand@plt>
cltd
idiv   %r15d
mov    %edx,%r13d
xor    %eax,%eax
call   1130 <rand@plt>
cltd
idiv   %r12d
mov    %edx,%ebp
xor    %eax,%eax
call   1130 <rand@plt>
cltd
idiv   %r15d
mov    %edx,%ebx
xor    %eax,%eax
call   1130 <rand@plt>
cltd
idiv   %r12d
mov    %edx,%ecx
mov    %r13d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
call   10f0 <line@plt>
add    $0xffffffff,%r14d
jne    1380 <main+0x170>
mov    $0x1,%edi
call   1120 <sleep@plt>
xor    %eax,%eax
call   1040 <cleardevice@plt>
jmp    1350 <main+0x140>
xor    %eax,%eax
call   1100 <check@plt>
xor    %eax,%eax
call   1090 <kbhit@plt>
test   %rax,%rax
je     143b <main+0x22b>
xor    %eax,%eax
call   10c0 <closegraph@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xbd6(%rip),%r14
jmp    146d <main+0x25d>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x1,%edi
call   1120 <sleep@plt>
xor    %eax,%eax
call   1040 <cleardevice@plt>
xor    %eax,%eax
call   1090 <kbhit@plt>
test   %rax,%rax
jne    1423 <main+0x213>
mov    $0xe,%edi
call   1110 <setcolor@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %r14,%rdx
call   1060 <outtextxy@plt>
mov    $0x7dc,%edi
call   10b0 <srand@plt>
mov    $0x3e8,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1130 <rand@plt>
cltq
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x3,%ecx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%r13d
add    $0x1,%r13d
xor    %eax,%eax
call   1130 <rand@plt>
cltd
idiv   %r15d
mov    %edx,%ebp
xor    %eax,%eax
call   1130 <rand@plt>
cltd
idiv   %r12d
mov    %ebp,%edi
mov    %edx,%esi
mov    %r13d,%edx
call   1080 <putpixel@plt>
xor    %eax,%eax
call   1090 <kbhit@plt>
test   %rax,%rax
jne    150f <main+0x2ff>
mov    $0x1,%edi
call   10a0 <delay@plt>
add    $0xffffffff,%ebx
jne    14a0 <main+0x290>
mov    $0x1,%edi
call   1120 <sleep@plt>
mov    $0x7dc,%edi
call   10b0 <srand@plt>
mov    $0x3e8,%ebp
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1130 <rand@plt>
xor    %eax,%eax
call   1130 <rand@plt>
cltd
idiv   %r15d
mov    %edx,%ebx
xor    %eax,%eax
call   1130 <rand@plt>
cltd
idiv   %r12d
mov    %ebx,%edi
mov    %edx,%esi
xor    %edx,%edx
call   1080 <putpixel@plt>
xor    %eax,%eax
call   1090 <kbhit@plt>
test   %rax,%rax
jne    1450 <main+0x240>
mov    $0x1,%edi
call   10a0 <delay@plt>
add    $0xffffffff,%ebp
jne    1530 <main+0x320>
jmp    1450 <main+0x240>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [24 x i8] c"Press a key to continue\00"
@.str.2 = [20 x i8] c"Press a key to exit\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 11, i32* %4
store i32 7, i32* %5
%8 = call i32 @initgraph(i32* %4, i32* %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @setbkcolor(i32 0)
%10 = call i32 (...) @cleardevice()
%11 = call i32 (...) @getmaxx()
store i32 %11, i32* %6
%12 = call i32 (...) @getmaxy()
store i32 %12, i32* %7
br label %13
13: ; preds = %40, %0
%14 = call i64 (...) @kbhit()
%15 = icmp ne i64 %14, 0
%16 = xor i1 %15, true
br i1 %16, label %17, label %43
17: ; preds = %13
%18 = call i32 @setcolor(i32 14)
%19 = call i32 @outtextxy(i32 0, i32 0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
br label %20
20: ; preds = %37, %17
%21 = load i32, i32* %2
%22 = icmp slt i32 %21, 500
br i1 %22, label %23, label %40
23: ; preds = %20
%24 = call i32 (...) @rand()
%25 = srem i32 %24, 15
%26 = add nsw i32 1, %25
%27 = call i32 @setcolor(i32 %26)
%28 = call i32 (...) @rand()
%29 = load i32, i32* %6
%30 = srem i32 %28, %29
%31 = call i32 (...) @rand()
%32 = load i32, i32* %7
%33 = srem i32 %31, %32
%34 = call i32 (...) @rand()
%35 = srem i32 %34, 100
%36 = call i32 @circle(i32 %30, i32 %33, i32 %35)
br label %37
37: ; preds = %23
%38 = load i32, i32* %2
%39 = add nsw i32 %38, 1
store i32 %39, i32* %2
br label %20
40: ; preds = %20
%41 = call i32 @sleep(i32 1)
%42 = call i32 (...) @cleardevice()
br label %13
43: ; preds = %13
%44 = call i32 (...) @check()
br label %45
45: ; preds = %76, %43
%46 = call i64 (...) @kbhit()
%47 = icmp ne i64 %46, 0
%48 = xor i1 %47, true
br i1 %48, label %49, label %79
49: ; preds = %45
%50 = call i32 @setcolor(i32 14)
%51 = call i32 @outtextxy(i32 0, i32 0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
br label %52
52: ; preds = %73, %49
%53 = load i32, i32* %2
%54 = icmp slt i32 %53, 500
br i1 %54, label %55, label %76
55: ; preds = %52
%56 = call i32 (...) @rand()
%57 = srem i32 %56, 15
%58 = add nsw i32 1, %57
%59 = call i32 @setcolor(i32 %58)
%60 = call i32 (...) @rand()
%61 = load i32, i32* %6
%62 = srem i32 %60, %61
%63 = call i32 (...) @rand()
%64 = load i32, i32* %7
%65 = srem i32 %63, %64
%66 = call i32 (...) @rand()
%67 = load i32, i32* %6
%68 = srem i32 %66, %67
%69 = call i32 (...) @rand()
%70 = load i32, i32* %7
%71 = srem i32 %69, %70
%72 = call i32 @line(i32 %62, i32 %65, i32 %68, i32 %71)
br label %73
73: ; preds = %55
%74 = load i32, i32* %2
%75 = add nsw i32 %74, 1
store i32 %75, i32* %2
br label %52
76: ; preds = %52
%77 = call i32 @sleep(i32 1)
%78 = call i32 (...) @cleardevice()
br label %45
79: ; preds = %45
%80 = call i32 (...) @check()
br label %81
81: ; preds = %137, %79
%82 = call i64 (...) @kbhit()
%83 = icmp ne i64 %82, 0
%84 = xor i1 %83, true
br i1 %84, label %85, label %140
85: ; preds = %81
%86 = call i32 @setcolor(i32 14)
%87 = call i32 @outtextxy(i32 0, i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%88 = call i32 @srand(i32 2012)
store i32 0, i32* %2
br label %89
89: ; preds = %109, %85
%90 = load i32, i32* %2
%91 = icmp slt i32 %90, 1000
br i1 %91, label %92, label %112
92: ; preds = %89
%93 = call i32 (...) @rand()
%94 = srem i32 %93, 15
%95 = add nsw i32 1, %94
store i32 %95, i32* %3
%96 = call i32 (...) @rand()
%97 = load i32, i32* %6
%98 = srem i32 %96, %97
%99 = call i32 (...) @rand()
%100 = load i32, i32* %7
%101 = srem i32 %99, %100
%102 = load i32, i32* %3
%103 = call i32 @putpixel(i32 %98, i32 %101, i32 %102)
%104 = call i64 (...) @kbhit()
%105 = icmp ne i64 %104, 0
br i1 %105, label %106, label %107
106: ; preds = %92
br label %112
107: ; preds = %92
%108 = call i32 @delay(i32 1)
br label %109
109: ; preds = %107
%110 = load i32, i32* %2
%111 = add nsw i32 %110, 1
store i32 %111, i32* %2
br label %89
112: ; preds = %106, %89
%113 = call i32 @sleep(i32 1)
%114 = call i32 @srand(i32 2012)
store i32 0, i32* %2
br label %115
115: ; preds = %134, %112
%116 = load i32, i32* %2
%117 = icmp slt i32 %116, 1000
br i1 %117, label %118, label %137
118: ; preds = %115
%119 = call i32 (...) @rand()
%120 = srem i32 %119, 15
%121 = add nsw i32 1, %120
store i32 %121, i32* %3
%122 = call i32 (...) @rand()
%123 = load i32, i32* %6
%124 = srem i32 %122, %123
%125 = call i32 (...) @rand()
%126 = load i32, i32* %7
%127 = srem i32 %125, %126
%128 = call i32 @putpixel(i32 %124, i32 %127, i32 0)
%129 = call i64 (...) @kbhit()
%130 = icmp ne i64 %129, 0
br i1 %130, label %131, label %132
131: ; preds = %118
br label %137
132: ; preds = %118
%133 = call i32 @delay(i32 1)
br label %134
134: ; preds = %132
%135 = load i32, i32* %2
%136 = add nsw i32 %135, 1
store i32 %136, i32* %2
br label %115
137: ; preds = %131, %115
%138 = call i32 @sleep(i32 1)
%139 = call i32 (...) @cleardevice()
br label %81
140: ; preds = %81
%141 = call i32 (...) @closegraph()
ret i32 0
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [24 x i8] c"Press a key to continue\00"
@.str.2 = [20 x i8] c"Press a key to exit\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 11, i32* %1
store i32 7, i32* %2
%5 = call i32 @initgraph(i32* %1, i32* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @setbkcolor(i32 0)
%7 = call i32 (...) @cleardevice()
%8 = call i32 (...) @getmaxx()
%9 = call i32 (...) @getmaxy()
%10 = call i64 (...) @kbhit()
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %35
12: ; preds = %0, %30
%13 = call i32 @setcolor(i32 14)
%14 = call i32 @outtextxy(i32 0, i32 0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %12, %15
%16 = phi i32 [ 0, %12 ], [ %28, %15 ]
%17 = call i32 (...) @rand()
%18 = srem i32 %17, 15
%19 = add nsw i32 %18, 1
%20 = call i32 @setcolor(i32 %19)
%21 = call i32 (...) @rand()
%22 = srem i32 %21, %8
%23 = call i32 (...) @rand()
%24 = srem i32 %23, %9
%25 = call i32 (...) @rand()
%26 = srem i32 %25, 100
%27 = call i32 @circle(i32 %22, i32 %24, i32 %26)
%28 = add nuw nsw i32 %16, 1
%29 = icmp eq i32 %28, 500
br i1 %29, label %30, label %15
30: ; preds = %15
%31 = call i32 @sleep(i32 1)
%32 = call i32 (...) @cleardevice()
%33 = call i64 (...) @kbhit()
%34 = icmp eq i64 %33, 0
br i1 %34, label %12, label %35
35: ; preds = %30, %0
%36 = call i32 (...) @check()
%37 = call i64 (...) @kbhit()
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %64
39: ; preds = %35, %59
%40 = call i32 @setcolor(i32 14)
%41 = call i32 @outtextxy(i32 0, i32 0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %42
42: ; preds = %39, %42
%43 = phi i32 [ 0, %39 ], [ %57, %42 ]
%44 = call i32 (...) @rand()
%45 = srem i32 %44, 15
%46 = add nsw i32 %45, 1
%47 = call i32 @setcolor(i32 %46)
%48 = call i32 (...) @rand()
%49 = srem i32 %48, %8
%50 = call i32 (...) @rand()
%51 = srem i32 %50, %9
%52 = call i32 (...) @rand()
%53 = srem i32 %52, %8
%54 = call i32 (...) @rand()
%55 = srem i32 %54, %9
%56 = call i32 @line(i32 %49, i32 %51, i32 %53, i32 %55)
%57 = add nuw nsw i32 %43, 1
%58 = icmp eq i32 %57, 500
br i1 %58, label %59, label %42
59: ; preds = %42
%60 = call i32 @sleep(i32 1)
%61 = call i32 (...) @cleardevice()
%62 = call i64 (...) @kbhit()
%63 = icmp eq i64 %62, 0
br i1 %63, label %39, label %64
64: ; preds = %59, %35
%65 = call i32 (...) @check()
%66 = call i64 (...) @kbhit()
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %110
68: ; preds = %64, %105
%69 = call i32 @setcolor(i32 14)
%70 = call i32 @outtextxy(i32 0, i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%71 = call i32 @srand(i32 2012)
br label %72
72: ; preds = %68, %84
%73 = phi i32 [ 0, %68 ], [ %86, %84 ]
%74 = call i32 (...) @rand()
%75 = srem i32 %74, 15
%76 = add nsw i32 %75, 1
%77 = call i32 (...) @rand()
%78 = srem i32 %77, %8
%79 = call i32 (...) @rand()
%80 = srem i32 %79, %9
%81 = call i32 @putpixel(i32 %78, i32 %80, i32 %76)
%82 = call i64 (...) @kbhit()
%83 = icmp eq i64 %82, 0
br i1 %83, label %84, label %88
84: ; preds = %72
%85 = call i32 @delay(i32 1)
%86 = add nuw nsw i32 %73, 1
%87 = icmp eq i32 %86, 1000
br i1 %87, label %88, label %72
88: ; preds = %72, %84
%89 = call i32 @sleep(i32 1)
%90 = call i32 @srand(i32 2012)
br label %91
91: ; preds = %88, %101
%92 = phi i32 [ 0, %88 ], [ %103, %101 ]
%93 = call i32 (...) @rand()
%94 = call i32 (...) @rand()
%95 = srem i32 %94, %8
%96 = call i32 (...) @rand()
%97 = srem i32 %96, %9
%98 = call i32 @putpixel(i32 %95, i32 %97, i32 0)
%99 = call i64 (...) @kbhit()
%100 = icmp eq i64 %99, 0
br i1 %100, label %101, label %105
101: ; preds = %91
%102 = call i32 @delay(i32 1)
%103 = add nuw nsw i32 %92, 1
%104 = icmp eq i32 %103, 1000
br i1 %104, label %105, label %91
105: ; preds = %91, %101
%106 = call i32 @sleep(i32 1)
%107 = call i32 (...) @cleardevice()
%108 = call i64 (...) @kbhit()
%109 = icmp eq i64 %108, 0
br i1 %109, label %68, label %110
110: ; preds = %105, %64
%111 = call i32 (...) @closegraph()
ret i32 0
}