#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 COLOR(int, int, int);
int /*<<< orphan*/ bar(int, int, int, int);
int /*<<< orphan*/ cleardevice();
int /*<<< orphan*/ closegraph();
int /*<<< orphan*/ fillellipse(int, int, int, int);
int getmaxx();
int getmaxy();
int /*<<< orphan*/ getmouseclick(int, int *, int *);
int /*<<< orphan*/ initgraph(int *, int *, char *);
int /*<<< orphan*/ ismouseclick(int);
int /*<<< orphan*/ kbhit();
int mouseclick();
int mousex();
int mousey();
int /*<<< orphan*/ outtextxy(int, int, char *);
int rand();
int /*<<< orphan*/ rectangle(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ setbkcolor(int /*<<< orphan*/);
int /*<<< orphan*/ setcolor(int);
int /*<<< orphan*/ setfillstyle(int, int);
int /*<<< orphan*/ setlinestyle(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ settextjustify(int, int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
int main(void) {
  int gd, gm, c, p, x, y;
  char s[20];
  gd = 11;
  gm = 7;
  initgraph(&gd, &gm, "");
  setbkcolor(0);
  setcolor(4);
  cleardevice();
  settextjustify(1, 1);
  outtextxy(getmaxx() / 2, getmaxy() / 2, "Click the RIGHT button to begin");
  while (!ismouseclick(3))
    ;
  getmouseclick(3, &x, &y);
  cleardevice();
  sprintf(s, "Click on: %4d %4d", x, y);
  outtextxy(getmaxx() / 2, getmaxy() / 2, s);
  sleep(2);
  cleardevice();
  rectangle(0, 0, 200, 20);
  settextjustify(0, 2);
  outtextxy(12, 4, "Click around (or here to exit)");
  setlinestyle(0, 0, 3);
  while (!kbhit()) {
    if (p = mouseclick())
      if ((mousex() < 200) && (mousey() < 20))
        break;
      else {
        setfillstyle(
            1 + (rand() % (12 - 1)),
            COLOR((rand() % (255)), (rand() % (255)), (rand() % (255))));
        setcolor(COLOR((rand() % (255)), (rand() % (255)), (rand() % (255))));
        if (0 == (rand() % (2)))
          fillellipse(mousex(), mousey(), 5 + p * (rand() % (15)),
                      5 + p * (rand() % (15)));
        else
          bar(mousex() - p * 10, mousey() - p * 10, mousex() + p * 10,
              mousey() + p * 10);
      }
  }
  closegraph();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xb,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    0xda4(%rip),%rdx
call   1060 <initgraph@plt>
xor    %edi,%edi
call   10a0 <setbkcolor@plt>
mov    $0x4,%edi
call   1180 <setcolor@plt>
mov    $0x0,%al
call   1080 <cleardevice@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1040 <settextjustify@plt>
mov    $0x0,%al
call   1160 <getmaxx@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x34(%rbp)
mov    $0x0,%al
call   10e0 <getmaxy@plt>
mov    -0x34(%rbp),%edi
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xcfe(%rip),%rdx
call   10d0 <outtextxy@plt>
mov    $0x3,%edi
call   1030 <ismouseclick@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1326 <main+0xa6>
jmp    132b <main+0xab>
jmp    1307 <main+0x87>
mov    $0x3,%edi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1120 <getmouseclick@plt>
mov    $0x0,%al
call   1080 <cleardevice@plt>
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xccb(%rip),%rsi
call   1170 <sprintf@plt>
mov    $0x0,%al
call   1160 <getmaxx@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x38(%rbp)
mov    $0x0,%al
call   10e0 <getmaxy@plt>
mov    -0x38(%rbp),%edi
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    -0x30(%rbp),%rdx
call   10d0 <outtextxy@plt>
mov    $0x2,%edi
call   1190 <sleep@plt>
mov    $0x0,%al
call   1080 <cleardevice@plt>
xor    %esi,%esi
mov    $0xc8,%edx
mov    $0x14,%ecx
mov    %esi,%edi
call   1090 <rectangle@plt>
xor    %edi,%edi
mov    $0x2,%esi
call   1040 <settextjustify@plt>
mov    $0xc,%edi
mov    $0x4,%esi
lea    0xc68(%rip),%rdx
call   10d0 <outtextxy@plt>
xor    %esi,%esi
mov    $0x3,%edx
mov    %esi,%edi
call   1130 <setlinestyle@plt>
mov    $0x0,%al
call   1110 <kbhit@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    13f9 <main+0x179>
jmp    15b4 <main+0x334>
mov    $0x0,%al
call   1050 <mouseclick@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     15af <main+0x32f>
mov    $0x0,%al
call   1070 <mousex@plt>
cmp    $0xc8,%eax
jge    1433 <main+0x1b3>
mov    $0x0,%al
call   10b0 <mousey@plt>
cmp    $0x14,%eax
jge    1433 <main+0x1b3>
jmp    15b4 <main+0x334>
mov    $0x0,%al
call   11a0 <rand@plt>
mov    $0xb,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x44(%rbp)
mov    $0x0,%al
call   11a0 <rand@plt>
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4c(%rbp)
mov    $0x0,%al
call   11a0 <rand@plt>
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %edx,-0x48(%rbp)
mov    $0x0,%al
call   11a0 <rand@plt>
mov    -0x4c(%rbp),%edi
mov    -0x48(%rbp),%esi
mov    $0xff,%ecx
cltd
idiv   %ecx
call   1100 <COLOR@plt>
mov    -0x44(%rbp),%edi
mov    %eax,%esi
call   10f0 <setfillstyle@plt>
mov    $0x0,%al
call   11a0 <rand@plt>
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %edx,-0x40(%rbp)
mov    $0x0,%al
call   11a0 <rand@plt>
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %edx,-0x3c(%rbp)
mov    $0x0,%al
call   11a0 <rand@plt>
mov    -0x40(%rbp),%edi
mov    -0x3c(%rbp),%esi
mov    $0xff,%ecx
cltd
idiv   %ecx
call   1100 <COLOR@plt>
mov    %eax,%edi
call   1180 <setcolor@plt>
mov    $0x0,%al
call   11a0 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    %edx,%eax
jne    1558 <main+0x2d8>
mov    $0x0,%al
call   1070 <mousex@plt>
mov    %eax,-0x58(%rbp)
mov    $0x0,%al
call   10b0 <mousey@plt>
mov    %eax,-0x54(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    $0x0,%al
call   11a0 <rand@plt>
mov    $0xf,%ecx
cltd
idiv   %ecx
mov    -0x60(%rbp),%eax
imul   %edx,%eax
add    $0x5,%eax
mov    %eax,-0x50(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    $0x0,%al
call   11a0 <rand@plt>
mov    -0x5c(%rbp),%ecx
mov    -0x58(%rbp),%edi
mov    -0x54(%rbp),%esi
mov    $0xf,%r8d
cltd
idiv   %r8d
mov    %edx,%eax
mov    -0x50(%rbp),%edx
imul   %eax,%ecx
add    $0x5,%ecx
call   1150 <fillellipse@plt>
jmp    15a5 <main+0x325>
mov    $0x0,%al
call   1070 <mousex@plt>
imul   $0xa,-0x14(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x6c(%rbp)
mov    $0x0,%al
call   10b0 <mousey@plt>
imul   $0xa,-0x14(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x68(%rbp)
mov    $0x0,%al
call   1070 <mousex@plt>
imul   $0xa,-0x14(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x64(%rbp)
mov    $0x0,%al
call   10b0 <mousey@plt>
mov    -0x6c(%rbp),%edi
mov    -0x68(%rbp),%esi
mov    -0x64(%rbp),%edx
mov    %eax,%ecx
imul   $0xa,-0x14(%rbp),%eax
add    %eax,%ecx
call   10c0 <bar@plt>
jmp    15aa <main+0x32a>
jmp    15af <main+0x32f>
jmp    13dd <main+0x15d>
mov    $0x0,%al
call   1140 <closegraph@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x30,%rsp
movl   $0xb,0xc(%rsp)
movl   $0x7,0x8(%rsp)
lea    0xdad(%rip),%rdx
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1060 <initgraph@plt>
xor    %edi,%edi
call   10a0 <setbkcolor@plt>
mov    $0x4,%edi
call   1180 <setcolor@plt>
xor    %eax,%eax
call   1080 <cleardevice@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <settextjustify@plt>
xor    %eax,%eax
call   1160 <getmaxx@plt>
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
xor    %eax,%eax
call   10e0 <getmaxy@plt>
mov    %eax,%esi
shr    $0x1f,%esi
add    %eax,%esi
sar    %esi
lea    0xd00(%rip),%rdx
mov    %ebx,%edi
call   10d0 <outtextxy@plt>
nopw   0x0(%rax,%rax,1)
mov    $0x3,%edi
call   1030 <ismouseclick@plt>
test   %eax,%eax
je     1310 <main+0x90>
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x3,%edi
call   1120 <getmouseclick@plt>
xor    %eax,%eax
call   1080 <cleardevice@plt>
mov    0x4(%rsp),%edx
mov    (%rsp),%ecx
lea    0xcdb(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1170 <sprintf@plt>
xor    %eax,%eax
call   1160 <getmaxx@plt>
mov    %eax,%ebp
shr    $0x1f,%ebp
add    %eax,%ebp
sar    %ebp
xor    %eax,%eax
call   10e0 <getmaxy@plt>
mov    %eax,%esi
shr    $0x1f,%esi
add    %eax,%esi
sar    %esi
mov    %ebp,%edi
mov    %rbx,%rdx
call   10d0 <outtextxy@plt>
mov    $0x2,%edi
call   1190 <sleep@plt>
xor    %eax,%eax
call   1080 <cleardevice@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0xc8,%edx
mov    $0x14,%ecx
call   1090 <rectangle@plt>
xor    %edi,%edi
mov    $0x2,%esi
call   1040 <settextjustify@plt>
lea    0xc7f(%rip),%rdx
mov    $0xc,%edi
mov    $0x4,%esi
call   10d0 <outtextxy@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0x3,%edx
call   1130 <setlinestyle@plt>
jmp    1418 <main+0x198>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    %r14d,%r14d
lea    (%r14,%r14,4),%ebx
sub    %ebx,%r12d
xor    %eax,%eax
call   10b0 <mousey@plt>
mov    %eax,%ebp
sub    %ebx,%ebp
xor    %eax,%eax
call   1070 <mousex@plt>
lea    (%rax,%rbx,1),%r14d
xor    %eax,%eax
call   10b0 <mousey@plt>
add    %eax,%ebx
mov    %r12d,%edi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
call   10c0 <bar@plt>
xor    %eax,%eax
call   1110 <kbhit@plt>
test   %eax,%eax
jne    1633 <main+0x3b3>
xor    %eax,%eax
call   1050 <mouseclick@plt>
test   %eax,%eax
je     1418 <main+0x198>
mov    %eax,%r14d
xor    %eax,%eax
call   1070 <mousex@plt>
cmp    $0xc7,%eax
jg     1453 <main+0x1d3>
xor    %eax,%eax
call   10b0 <mousey@plt>
cmp    $0x14,%eax
jl     1633 <main+0x3b3>
xor    %eax,%eax
call   11a0 <rand@plt>
cltq
imul   $0x2e8ba2e9,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    %ecx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rcx,%rdx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%r15d
add    $0x1,%r15d
xor    %eax,%eax
call   11a0 <rand@plt>
cltq
imul   $0xffffffff80808081,%rax,%rbx
shr    $0x20,%rbx
add    %eax,%ebx
mov    %ebx,%ecx
shr    $0x1f,%ecx
sar    $0x7,%ebx
add    %ecx,%ebx
mov    %ebx,%ecx
shl    $0x8,%ecx
sub    %ecx,%ebx
add    %eax,%ebx
xor    %eax,%eax
call   11a0 <rand@plt>
cltq
imul   $0xffffffff80808081,%rax,%rbp
shr    $0x20,%rbp
add    %eax,%ebp
mov    %ebp,%ecx
shr    $0x1f,%ecx
sar    $0x7,%ebp
add    %ecx,%ebp
mov    %ebp,%ecx
shl    $0x8,%ecx
sub    %ecx,%ebp
add    %eax,%ebp
xor    %eax,%eax
call   11a0 <rand@plt>
cltq
imul   $0xffffffff80808081,%rax,%rdx
shr    $0x20,%rdx
add    %eax,%edx
mov    %edx,%ecx
shr    $0x1f,%ecx
sar    $0x7,%edx
add    %ecx,%edx
mov    %edx,%ecx
shl    $0x8,%ecx
sub    %ecx,%edx
add    %eax,%edx
mov    %ebx,%edi
mov    %ebp,%esi
call   1100 <COLOR@plt>
mov    %r15d,%edi
mov    %eax,%esi
call   10f0 <setfillstyle@plt>
xor    %eax,%eax
call   11a0 <rand@plt>
cltq
imul   $0xffffffff80808081,%rax,%rbx
shr    $0x20,%rbx
add    %eax,%ebx
mov    %ebx,%ecx
shr    $0x1f,%ecx
sar    $0x7,%ebx
add    %ecx,%ebx
mov    %ebx,%ecx
shl    $0x8,%ecx
sub    %ecx,%ebx
add    %eax,%ebx
xor    %eax,%eax
call   11a0 <rand@plt>
cltq
imul   $0xffffffff80808081,%rax,%rbp
shr    $0x20,%rbp
add    %eax,%ebp
mov    %ebp,%ecx
shr    $0x1f,%ecx
sar    $0x7,%ebp
add    %ecx,%ebp
mov    %ebp,%ecx
shl    $0x8,%ecx
sub    %ecx,%ebp
add    %eax,%ebp
xor    %eax,%eax
call   11a0 <rand@plt>
cltq
imul   $0xffffffff80808081,%rax,%rdx
shr    $0x20,%rdx
add    %eax,%edx
mov    %edx,%ecx
shr    $0x1f,%ecx
sar    $0x7,%edx
add    %ecx,%edx
mov    %edx,%ecx
shl    $0x8,%ecx
sub    %ecx,%edx
add    %eax,%edx
mov    %ebx,%edi
mov    %ebp,%esi
call   1100 <COLOR@plt>
mov    %eax,%edi
call   1180 <setcolor@plt>
xor    %eax,%eax
call   11a0 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1070 <mousex@plt>
mov    %eax,%r12d
test   $0x1,%bl
jne    13e0 <main+0x160>
xor    %eax,%eax
call   10b0 <mousey@plt>
mov    %eax,%r15d
xor    %eax,%eax
call   11a0 <rand@plt>
movslq %eax,%rbx
imul   $0xffffffff88888889,%rbx,%rax
shr    $0x20,%rax
add    %ebx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x3,%eax
add    %ecx,%eax
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%ebx
imul   %r14d,%ebx
add    $0x5,%ebx
xor    %eax,%eax
call   11a0 <rand@plt>
movslq %eax,%rcx
imul   $0xffffffff88888889,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x3,%eax
add    %edx,%eax
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%ecx
imul   %r14d,%ecx
add    $0x5,%ecx
mov    %r12d,%edi
mov    %r15d,%esi
mov    %ebx,%edx
call   1150 <fillellipse@plt>
jmp    1418 <main+0x198>
xor    %eax,%eax
call   1140 <closegraph@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [32 x i8] c"Click the RIGHT button to begin\00"
@.str.2 = [18 x i8] c"Click on: %4d %4d\00"
@.str.3 = [31 x i8] c"Click around (or here 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
%8 = alloca [20 x i8]
store i32 0, i32* %1
store i32 11, i32* %2
store i32 7, i32* %3
%9 = call i32 @initgraph(i32* %2, i32* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @setbkcolor(i32 0)
%11 = call i32 @setcolor(i32 4)
%12 = call i32 (...) @cleardevice()
%13 = call i32 @settextjustify(i32 1, i32 1)
%14 = call i32 (...) @getmaxx()
%15 = sdiv i32 %14, 2
%16 = call i32 (...) @getmaxy()
%17 = sdiv i32 %16, 2
%18 = call i32 @outtextxy(i32 %15, i32 %17, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %23, %0
%20 = call i32 @ismouseclick(i32 3)
%21 = icmp ne i32 %20, 0
%22 = xor i1 %21, true
br i1 %22, label %23, label %24
23: ; preds = %19
br label %19
24: ; preds = %19
%25 = call i32 @getmouseclick(i32 3, i32* %6, i32* %7)
%26 = call i32 (...) @cleardevice()
%27 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%28 = load i32, i32* %6
%29 = load i32, i32* %7
%30 = call i32 @sprintf(i8* %27, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %28, i32 %29)
%31 = call i32 (...) @getmaxx()
%32 = sdiv i32 %31, 2
%33 = call i32 (...) @getmaxy()
%34 = sdiv i32 %33, 2
%35 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%36 = call i32 @outtextxy(i32 %32, i32 %34, i8* %35)
%37 = call i32 @sleep(i32 2)
%38 = call i32 (...) @cleardevice()
%39 = call i32 @rectangle(i32 0, i32 0, i32 200, i32 20)
%40 = call i32 @settextjustify(i32 0, i32 2)
%41 = call i32 @outtextxy(i32 12, i32 4, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%42 = call i32 @setlinestyle(i32 0, i32 0, i32 3)
br label %43
43: ; preds = %114, %24
%44 = call i32 (...) @kbhit()
%45 = icmp ne i32 %44, 0
%46 = xor i1 %45, true
br i1 %46, label %47, label %115
47: ; preds = %43
%48 = call i32 (...) @mouseclick()
store i32 %48, i32* %5
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %114
50: ; preds = %47
%51 = call i32 (...) @mousex()
%52 = icmp slt i32 %51, 200
br i1 %52, label %53, label %57
53: ; preds = %50
%54 = call i32 (...) @mousey()
%55 = icmp slt i32 %54, 20
br i1 %55, label %56, label %57
56: ; preds = %53
br label %115
57: ; preds = %53, %50
%58 = call i32 (...) @rand()
%59 = srem i32 %58, 11
%60 = add nsw i32 1, %59
%61 = call i32 (...) @rand()
%62 = srem i32 %61, 255
%63 = call i32 (...) @rand()
%64 = srem i32 %63, 255
%65 = call i32 (...) @rand()
%66 = srem i32 %65, 255
%67 = call i32 @COLOR(i32 %62, i32 %64, i32 %66)
%68 = call i32 @setfillstyle(i32 %60, i32 %67)
%69 = call i32 (...) @rand()
%70 = srem i32 %69, 255
%71 = call i32 (...) @rand()
%72 = srem i32 %71, 255
%73 = call i32 (...) @rand()
%74 = srem i32 %73, 255
%75 = call i32 @COLOR(i32 %70, i32 %72, i32 %74)
%76 = call i32 @setcolor(i32 %75)
%77 = call i32 (...) @rand()
%78 = srem i32 %77, 2
%79 = icmp eq i32 0, %78
br i1 %79, label %80, label %94
80: ; preds = %57
%81 = call i32 (...) @mousex()
%82 = call i32 (...) @mousey()
%83 = load i32, i32* %5
%84 = call i32 (...) @rand()
%85 = srem i32 %84, 15
%86 = mul nsw i32 %83, %85
%87 = add nsw i32 5, %86
%88 = load i32, i32* %5
%89 = call i32 (...) @rand()
%90 = srem i32 %89, 15
%91 = mul nsw i32 %88, %90
%92 = add nsw i32 5, %91
%93 = call i32 @fillellipse(i32 %81, i32 %82, i32 %87, i32 %92)
br label %112
94: ; preds = %57
%95 = call i32 (...) @mousex()
%96 = load i32, i32* %5
%97 = mul nsw i32 %96, 10
%98 = sub nsw i32 %95, %97
%99 = call i32 (...) @mousey()
%100 = load i32, i32* %5
%101 = mul nsw i32 %100, 10
%102 = sub nsw i32 %99, %101
%103 = call i32 (...) @mousex()
%104 = load i32, i32* %5
%105 = mul nsw i32 %104, 10
%106 = add nsw i32 %103, %105
%107 = call i32 (...) @mousey()
%108 = load i32, i32* %5
%109 = mul nsw i32 %108, 10
%110 = add nsw i32 %107, %109
%111 = call i32 @bar(i32 %98, i32 %102, i32 %106, i32 %110)
br label %112
112: ; preds = %94, %80
br label %113
113: ; preds = %112
br label %114
114: ; preds = %113, %47
br label %43
115: ; preds = %56, %43
%116 = call i32 (...) @closegraph()
ret i32 0
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [32 x i8] c"Click the RIGHT button to begin\00"
@.str.2 = [18 x i8] c"Click on: %4d %4d\00"
@.str.3 = [31 x i8] c"Click around (or here to exit)\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [20 x i8]
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
store i32 11, i32* %1
store i32 7, i32* %2
%11 = call i32 @initgraph(i32* %1, i32* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @setbkcolor(i32 0)
%13 = call i32 @setcolor(i32 4)
%14 = call i32 (...) @cleardevice()
%15 = call i32 @settextjustify(i32 1, i32 1)
%16 = call i32 (...) @getmaxx()
%17 = sdiv i32 %16, 2
%18 = call i32 (...) @getmaxy()
%19 = sdiv i32 %18, 2
%20 = call i32 @outtextxy(i32 %17, i32 %19, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %21, %0
%22 = call i32 @ismouseclick(i32 3)
%23 = icmp eq i32 %22, 0
br i1 %23, label %21, label %24
24: ; preds = %21
%25 = call i32 @getmouseclick(i32 3, i32* %3, i32* %4)
%26 = call i32 (...) @cleardevice()
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = call i32 @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %27, i32 %28)
%30 = call i32 (...) @getmaxx()
%31 = sdiv i32 %30, 2
%32 = call i32 (...) @getmaxy()
%33 = sdiv i32 %32, 2
%34 = call i32 @outtextxy(i32 %31, i32 %33, i8* %10)
%35 = call i32 @sleep(i32 2)
%36 = call i32 (...) @cleardevice()
%37 = call i32 @rectangle(i32 0, i32 0, i32 200, i32 20)
%38 = call i32 @settextjustify(i32 0, i32 2)
%39 = call i32 @outtextxy(i32 12, i32 4, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%40 = call i32 @setlinestyle(i32 0, i32 0, i32 3)
%41 = call i32 (...) @kbhit()
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %100
43: ; preds = %24, %97
%44 = call i32 (...) @mouseclick()
%45 = icmp eq i32 %44, 0
br i1 %45, label %97, label %46
46: ; preds = %43
%47 = call i32 (...) @mousex()
%48 = icmp slt i32 %47, 200
br i1 %48, label %49, label %52
49: ; preds = %46
%50 = call i32 (...) @mousey()
%51 = icmp slt i32 %50, 20
br i1 %51, label %100, label %52
52: ; preds = %49, %46
%53 = call i32 (...) @rand()
%54 = srem i32 %53, 11
%55 = add nsw i32 %54, 1
%56 = call i32 (...) @rand()
%57 = srem i32 %56, 255
%58 = call i32 (...) @rand()
%59 = srem i32 %58, 255
%60 = call i32 (...) @rand()
%61 = srem i32 %60, 255
%62 = call i32 @COLOR(i32 %57, i32 %59, i32 %61)
%63 = call i32 @setfillstyle(i32 %55, i32 %62)
%64 = call i32 (...) @rand()
%65 = srem i32 %64, 255
%66 = call i32 (...) @rand()
%67 = srem i32 %66, 255
%68 = call i32 (...) @rand()
%69 = srem i32 %68, 255
%70 = call i32 @COLOR(i32 %65, i32 %67, i32 %69)
%71 = call i32 @setcolor(i32 %70)
%72 = call i32 (...) @rand()
%73 = and i32 %72, 1
%74 = icmp eq i32 %73, 0
%75 = call i32 (...) @mousex()
br i1 %74, label %76, label %87
76: ; preds = %52
%77 = call i32 (...) @mousey()
%78 = call i32 (...) @rand()
%79 = srem i32 %78, 15
%80 = mul nsw i32 %79, %44
%81 = add nsw i32 %80, 5
%82 = call i32 (...) @rand()
%83 = srem i32 %82, 15
%84 = mul nsw i32 %83, %44
%85 = add nsw i32 %84, 5
%86 = call i32 @fillellipse(i32 %75, i32 %77, i32 %81, i32 %85)
br label %97
87: ; preds = %52
%88 = mul nsw i32 %44, 10
%89 = sub nsw i32 %75, %88
%90 = call i32 (...) @mousey()
%91 = sub nsw i32 %90, %88
%92 = call i32 (...) @mousex()
%93 = add nsw i32 %92, %88
%94 = call i32 (...) @mousey()
%95 = add nsw i32 %94, %88
%96 = call i32 @bar(i32 %89, i32 %91, i32 %93, i32 %95)
br label %97
97: ; preds = %87, %76, %43
%98 = call i32 (...) @kbhit()
%99 = icmp eq i32 %98, 0
br i1 %99, label %43, label %100
100: ; preds = %97, %49, %24
%101 = call i32 (...) @closegraph()
ret i32 0
}