void plot_particle(x, n, c, time) double x[(10000)][(3)];
int n;
int c[(10000)];
double time;
{
  int xmax, ymax;
  int cx, cy;
  char ts[100];
  int izindex[(10000)];
  double valuez[(10000)];
  int i;
  int ii, irad = 10;
  irad = 10 * pow(n / 100.0, -1.0 / 3.0);
  xmax = getmaxx();
  ymax = getmaxy();
  for (i = 0; i < n; i++)
    izindex[i] = i;
  for (i = 0; i < n; i++)
    valuez[i] = x[i][2];
  sort_particles(0, n - 1, valuez, izindex);
  cleardevice();
  for (i = 0; i < n; i++) {
    ii = izindex[n - 1 - i];
    cx = xmax * x[ii][0];
    cy = ymax * x[ii][1];
    if (c[0] == 15)
      setcolor(15);
    if (c[ii] == 0)
      setcolor(14);
    if (c[ii] == 1)
      setcolor(12);
    fillellipse(cx, cy, irad, irad);
  }
  gcvt(time, 7, ts);
  setcolor(15);
  circle(xmax / 2, ymax / 2, xmax / 2);
  outtextxy(xmax - 50, ymax - 50, ts);
  xflush();
}


x86 assembly (clang, -O0):
<plot_particle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1d570,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movl   $0xa,-0x1d56c(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xe2e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe1a(%rip),%xmm1
call   10c0 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe02(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x1d56c(%rbp)
mov    $0x0,%al
call   1090 <getmaxx@plt>
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   1050 <getmaxy@plt>
mov    %eax,-0x28(%rbp)
movl   $0x0,-0x1d564(%rbp)
mov    -0x1d564(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1261 <plot_particle+0xb1>
mov    -0x1d564(%rbp),%ecx
movslq -0x1d564(%rbp),%rax
mov    %ecx,-0x9ce0(%rbp,%rax,4)
mov    -0x1d564(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1d564(%rbp)
jmp    122a <plot_particle+0x7a>
movl   $0x0,-0x1d564(%rbp)
mov    -0x1d564(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12b5 <plot_particle+0x105>
mov    -0x8(%rbp),%rax
movslq -0x1d564(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0x10(%rax),%xmm0
movslq -0x1d564(%rbp),%rax
movsd  %xmm0,-0x1d560(%rbp,%rax,8)
fe ff
mov    -0x1d564(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1d564(%rbp)
jmp    126b <plot_particle+0xbb>
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
lea    -0x1d560(%rbp),%rdx
lea    -0x9ce0(%rbp),%rcx
xor    %edi,%edi
mov    $0x0,%al
call   10a0 <sort_particles@plt>
mov    $0x0,%al
call   1030 <cleardevice@plt>
movl   $0x0,-0x1d564(%rbp)
mov    -0x1d564(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    13da <plot_particle+0x22a>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
sub    -0x1d564(%rbp),%eax
cltq
mov    -0x9ce0(%rbp,%rax,4),%eax
mov    %eax,-0x1d568(%rbp)
cvtsi2sdl -0x24(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1d568(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mulsd  (%rax),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x2c(%rbp)
cvtsi2sdl -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1d568(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mulsd  0x8(%rax),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0xf,(%rax)
jne    136b <plot_particle+0x1bb>
mov    $0xf,%edi
mov    $0x0,%al
call   10d0 <setcolor@plt>
mov    -0x18(%rbp),%rax
movslq -0x1d568(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    138c <plot_particle+0x1dc>
mov    $0xe,%edi
mov    $0x0,%al
call   10d0 <setcolor@plt>
mov    -0x18(%rbp),%rax
movslq -0x1d568(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    13ad <plot_particle+0x1fd>
mov    $0xc,%edi
mov    $0x0,%al
call   10d0 <setcolor@plt>
mov    -0x2c(%rbp),%edi
mov    -0x30(%rbp),%esi
mov    -0x1d56c(%rbp),%edx
mov    -0x1d56c(%rbp),%ecx
mov    $0x0,%al
call   1070 <fillellipse@plt>
mov    -0x1d564(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1d564(%rbp)
jmp    12e3 <plot_particle+0x133>
movsd  -0x20(%rbp),%xmm0
lea    -0xa0(%rbp),%rsi
mov    $0x7,%edi
mov    $0x1,%al
call   10b0 <gcvt@plt>
mov    $0xf,%edi
mov    $0x0,%al
call   10d0 <setcolor@plt>
mov    -0x24(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x28(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x24(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    $0x0,%al
call   1080 <circle@plt>
mov    -0x24(%rbp),%edi
sub    $0x32,%edi
mov    -0x28(%rbp),%esi
sub    $0x32,%esi
lea    -0xa0(%rbp),%rdx
mov    $0x0,%al
call   1040 <outtextxy@plt>
mov    $0x0,%al
call   1060 <xflush@plt>
add    $0x1d570,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plot_particle>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1d578,%rsp
movsd  %xmm0,0x20(%rsp)
mov    %rdx,%r12
mov    %esi,%ebx
mov    %rdi,0x10(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
divsd  0xe20(%rip),%xmm0
movq   0xe20(%rip),%xmm1
call   10c0 <pow@plt>
movsd  %xmm0,0x18(%rsp)
xor    %eax,%eax
call   1090 <getmaxx@plt>
mov    %eax,0xc(%rsp)
xor    %eax,%eax
call   1050 <getmaxy@plt>
mov    %eax,0x8(%rsp)
mov    %ebx,%r15d
test   %ebx,%ebx
jle    143a <plot_particle+0x28a>
cmp    $0x8,%ebx
jae    1220 <plot_particle+0x70>
xor    %eax,%eax
jmp    1390 <plot_particle+0x1e0>
mov    %r15d,%eax
and    $0xfffffff8,%eax
lea    -0x8(%rax),%rsi
mov    %rsi,%rdx
shr    $0x3,%rdx
add    $0x1,%rdx
mov    %edx,%ecx
and    $0x3,%ecx
cmp    $0x18,%rsi
jae    124f <plot_particle+0x9f>
movdqa 0xdd8(%rip),%xmm0
xor    %esi,%esi
jmp    1335 <plot_particle+0x185>
and    $0xfffffffffffffffc,%rdx
movdqa 0xdc5(%rip),%xmm0
xor    %esi,%esi
movdqa 0xdca(%rip),%xmm8
movdqa 0xdd1(%rip),%xmm9
movdqa 0xdd8(%rip),%xmm10
movdqa 0xde0(%rip),%xmm4
movdqa 0xde8(%rip),%xmm5
movdqa 0xdf0(%rip),%xmm6
movdqa 0xdf8(%rip),%xmm7
movdqa 0xe00(%rip),%xmm1
movdqa %xmm0,%xmm2
paddd  %xmm8,%xmm2
movdqa %xmm0,0xb0(%rsp,%rsi,4)
movdqa %xmm2,0xc0(%rsp,%rsi,4)
movdqa %xmm0,%xmm2
paddd  %xmm9,%xmm2
movdqa %xmm0,%xmm3
paddd  %xmm10,%xmm3
movdqa %xmm2,0xd0(%rsp,%rsi,4)
movdqa %xmm3,0xe0(%rsp,%rsi,4)
movdqa %xmm0,%xmm2
paddd  %xmm4,%xmm2
movdqa %xmm0,%xmm3
paddd  %xmm5,%xmm3
movdqa %xmm2,0xf0(%rsp,%rsi,4)
movdqa %xmm3,0x100(%rsp,%rsi,4)
movdqa %xmm0,%xmm2
paddd  %xmm6,%xmm2
movdqa %xmm0,%xmm3
paddd  %xmm7,%xmm3
movdqa %xmm2,0x110(%rsp,%rsi,4)
movdqa %xmm3,0x120(%rsp,%rsi,4)
add    $0x20,%rsi
paddd  %xmm1,%xmm0
add    $0xfffffffffffffffc,%rdx
jne    12a0 <plot_particle+0xf0>
test   %rcx,%rcx
je     1380 <plot_particle+0x1d0>
lea    (%rsp,%rsi,4),%rdx
add    $0xc0,%rdx
shl    $0x5,%rcx
xor    %esi,%esi
movdqa 0xcdd(%rip),%xmm1
movdqa 0xce5(%rip),%xmm2
nopl   0x0(%rax,%rax,1)
movdqa %xmm0,%xmm3
paddd  %xmm1,%xmm3
movdqa %xmm0,-0x10(%rdx,%rsi,1)
movdqa %xmm3,(%rdx,%rsi,1)
paddd  %xmm2,%xmm0
add    $0x20,%rsi
cmp    %rsi,%rcx
jne    1360 <plot_particle+0x1b0>
cmp    %r15,%rax
je     13a0 <plot_particle+0x1f0>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %eax,0xb0(%rsp,%rax,4)
add    $0x1,%rax
cmp    %rax,%r15
jne    1390 <plot_particle+0x1e0>
test   %ebx,%ebx
jle    143a <plot_particle+0x28a>
cmp    $0x4,%ebx
ja     13b1 <plot_particle+0x201>
xor    %eax,%eax
jmp    140e <plot_particle+0x25e>
mov    %r15d,%eax
and    $0x3,%eax
test   %rax,%rax
mov    $0x4,%ecx
cmovne %rax,%rcx
mov    %r15,%rax
sub    %rcx,%rax
mov    0x10(%rsp),%rcx
add    $0x58,%rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  -0x48(%rcx),%xmm0
movhps -0x30(%rcx),%xmm0
movsd  -0x18(%rcx),%xmm1
movhps (%rcx),%xmm1
movaps %xmm0,0x9cf0(%rsp,%rdx,8)
movaps %xmm1,0x9d00(%rsp,%rdx,8)
add    $0x4,%rdx
add    $0x60,%rcx
cmp    %rdx,%rax
jne    13e0 <plot_particle+0x230>
lea    (%rax,%rax,2),%rcx
mov    0x10(%rsp),%rdx
lea    (%rdx,%rcx,8),%rcx
add    $0x10,%rcx
nop
movq   (%rcx),%xmm0
movq   %xmm0,0x9cf0(%rsp,%rax,8)
add    $0x1,%rax
add    $0x18,%rcx
cmp    %rax,%r15
jne    1420 <plot_particle+0x270>
lea    -0x1(%rbx),%r14d
lea    0x9cf0(%rsp),%rdx
lea    0xb0(%rsp),%rcx
xor    %edi,%edi
mov    %r14d,%esi
xor    %eax,%eax
call   10a0 <sort_particles@plt>
xor    %eax,%eax
call   1030 <cleardevice@plt>
test   %ebx,%ebx
jle    155a <plot_particle+0x3aa>
movsd  0x18(%rsp),%xmm0
mulsd  0xb99(%rip),%xmm0
cvttsd2si %xmm0,%ebp
xorps  %xmm0,%xmm0
cvtsi2sdl 0xc(%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sdl 0x8(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
mov    %r14d,%eax
lea    (%rsp,%rax,4),%r14
add    $0xb0,%r14
neg    %r15
xor    %ebx,%ebx
jmp    14d4 <plot_particle+0x324>
xchg   %ax,%ax
cvttsd2si 0x18(%rsp),%edi
cvttsd2si 0x38(%rsp),%esi
mov    %ebp,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1070 <fillellipse@plt>
add    $0xffffffffffffffff,%rbx
cmp    %rbx,%r15
je     155a <plot_particle+0x3aa>
movslq (%r14,%rbx,4),%r13
lea    0x0(,%r13,2),%rax
add    %r13,%rax
mov    0x10(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm0
mulsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rcx,%rax,8),%xmm0
mulsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x38(%rsp)
cmpl   $0xf,(%r12)
jne    151e <plot_particle+0x36e>
mov    $0xf,%edi
xor    %eax,%eax
call   10d0 <setcolor@plt>
mov    (%r12,%r13,4),%eax
test   %eax,%eax
je     1530 <plot_particle+0x380>
cmp    $0x1,%eax
jne    14b0 <plot_particle+0x300>
jmp    1549 <plot_particle+0x399>
nopl   (%rax)
mov    $0xe,%edi
xor    %eax,%eax
call   10d0 <setcolor@plt>
mov    (%r12,%r13,4),%eax
cmp    $0x1,%eax
jne    14b0 <plot_particle+0x300>
mov    $0xc,%edi
xor    %eax,%eax
call   10d0 <setcolor@plt>
jmp    14b0 <plot_particle+0x300>
lea    0x40(%rsp),%r14
movsd  0x20(%rsp),%xmm0
mov    $0x7,%edi
mov    %r14,%rsi
mov    $0x1,%al
call   10b0 <gcvt@plt>
mov    $0xf,%edi
xor    %eax,%eax
call   10d0 <setcolor@plt>
mov    0xc(%rsp),%ebp
mov    %ebp,%edi
shr    $0x1f,%edi
add    %ebp,%edi
sar    %edi
mov    0x8(%rsp),%ebx
mov    %ebx,%esi
shr    $0x1f,%esi
add    %ebx,%esi
sar    %esi
mov    %edi,%edx
xor    %eax,%eax
call   1080 <circle@plt>
add    $0xffffffce,%ebp
add    $0xffffffce,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <outtextxy@plt>
xor    %eax,%eax
call   1060 <xflush@plt>
add    $0x1d578,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @plot_particle([3 x double]* %0, i32 %1, i32* %2, double %3) {
%5 = alloca [3 x double]*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca [100 x i8]
%14 = alloca [10000 x i32]
%15 = alloca [10000 x double]
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store [3 x double]* %0, [3 x double]** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store double %3, double* %8
store i32 10, i32* %18
%19 = load i32, i32* %6
%20 = sitofp i32 %19 to double
%21 = fdiv double %20, 1.000000e+02
%22 = call double @pow(double %21, double 0xBFD5555555555555)
%23 = fmul double 1.000000e+01, %22
%24 = fptosi double %23 to i32
store i32 %24, i32* %18
%25 = call i32 (...) @getmaxx()
store i32 %25, i32* %9
%26 = call i32 (...) @getmaxy()
store i32 %26, i32* %10
store i32 0, i32* %16
br label %27
27: ; preds = %36, %4
%28 = load i32, i32* %16
%29 = load i32, i32* %6
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %39
31: ; preds = %27
%32 = load i32, i32* %16
%33 = load i32, i32* %16
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [10000 x i32], [10000 x i32]* %14, i64 0, i64 %34
store i32 %32, i32* %35
br label %36
36: ; preds = %31
%37 = load i32, i32* %16
%38 = add nsw i32 %37, 1
store i32 %38, i32* %16
br label %27
39: ; preds = %27
store i32 0, i32* %16
br label %40
40: ; preds = %54, %39
%41 = load i32, i32* %16
%42 = load i32, i32* %6
%43 = icmp slt i32 %41, %42
br i1 %43, label %44, label %57
44: ; preds = %40
%45 = load [3 x double]*, [3 x double]** %5
%46 = load i32, i32* %16
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [3 x double], [3 x double]* %45, i64 %47
%49 = getelementptr inbounds [3 x double], [3 x double]* %48, i64 0, i64 2
%50 = load double, double* %49
%51 = load i32, i32* %16
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [10000 x double], [10000 x double]* %15, i64 0, i64 %52
store double %50, double* %53
br label %54
54: ; preds = %44
%55 = load i32, i32* %16
%56 = add nsw i32 %55, 1
store i32 %56, i32* %16
br label %40
57: ; preds = %40
%58 = load i32, i32* %6
%59 = sub nsw i32 %58, 1
%60 = getelementptr inbounds [10000 x double], [10000 x double]* %15, i64 0, i64 0
%61 = getelementptr inbounds [10000 x i32], [10000 x i32]* %14, i64 0, i64 0
%62 = call i32 (i32, i32, double*, i32*, ...) bitcast (i32 (...)* @sort_particles to i32 (i32, i32, double*, i32*, ...)*)(i32 0, i32 %59, double* %60, i32* %61)
%63 = call i32 (...) @cleardevice()
store i32 0, i32* %16
br label %64
64: ; preds = %126, %57
%65 = load i32, i32* %16
%66 = load i32, i32* %6
%67 = icmp slt i32 %65, %66
br i1 %67, label %68, label %129
68: ; preds = %64
%69 = load i32, i32* %6
%70 = sub nsw i32 %69, 1
%71 = load i32, i32* %16
%72 = sub nsw i32 %70, %71
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [10000 x i32], [10000 x i32]* %14, i64 0, i64 %73
%75 = load i32, i32* %74
store i32 %75, i32* %17
%76 = load i32, i32* %9
%77 = sitofp i32 %76 to double
%78 = load [3 x double]*, [3 x double]** %5
%79 = load i32, i32* %17
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [3 x double], [3 x double]* %78, i64 %80
%82 = getelementptr inbounds [3 x double], [3 x double]* %81, i64 0, i64 0
%83 = load double, double* %82
%84 = fmul double %77, %83
%85 = fptosi double %84 to i32
store i32 %85, i32* %11
%86 = load i32, i32* %10
%87 = sitofp i32 %86 to double
%88 = load [3 x double]*, [3 x double]** %5
%89 = load i32, i32* %17
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [3 x double], [3 x double]* %88, i64 %90
%92 = getelementptr inbounds [3 x double], [3 x double]* %91, i64 0, i64 1
%93 = load double, double* %92
%94 = fmul double %87, %93
%95 = fptosi double %94 to i32
store i32 %95, i32* %12
%96 = load i32*, i32** %7
%97 = getelementptr inbounds i32, i32* %96, i64 0
%98 = load i32, i32* %97
%99 = icmp eq i32 %98, 15
br i1 %99, label %100, label %102
100: ; preds = %68
%101 = call i32 (i32, ...) bitcast (i32 (...)* @setcolor to i32 (i32, ...)*)(i32 15)
br label %102
102: ; preds = %100, %68
%103 = load i32*, i32** %7
%104 = load i32, i32* %17
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i32, i32* %103, i64 %105
%107 = load i32, i32* %106
%108 = icmp eq i32 %107, 0
br i1 %108, label %109, label %111
109: ; preds = %102
%110 = call i32 (i32, ...) bitcast (i32 (...)* @setcolor to i32 (i32, ...)*)(i32 14)
br label %111
111: ; preds = %109, %102
%112 = load i32*, i32** %7
%113 = load i32, i32* %17
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds i32, i32* %112, i64 %114
%116 = load i32, i32* %115
%117 = icmp eq i32 %116, 1
br i1 %117, label %118, label %120
118: ; preds = %111
%119 = call i32 (i32, ...) bitcast (i32 (...)* @setcolor to i32 (i32, ...)*)(i32 12)
br label %120
120: ; preds = %118, %111
%121 = load i32, i32* %11
%122 = load i32, i32* %12
%123 = load i32, i32* %18
%124 = load i32, i32* %18
%125 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @fillellipse to i32 (i32, i32, i32, i32, ...)*)(i32 %121, i32 %122, i32 %123, i32 %124)
br label %126
126: ; preds = %120
%127 = load i32, i32* %16
%128 = add nsw i32 %127, 1
store i32 %128, i32* %16
br label %64
129: ; preds = %64
%130 = load double, double* %8
%131 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%132 = call i32 (double, i32, i8*, ...) bitcast (i32 (...)* @gcvt to i32 (double, i32, i8*, ...)*)(double %130, i32 7, i8* %131)
%133 = call i32 (i32, ...) bitcast (i32 (...)* @setcolor to i32 (i32, ...)*)(i32 15)
%134 = load i32, i32* %9
%135 = sdiv i32 %134, 2
%136 = load i32, i32* %10
%137 = sdiv i32 %136, 2
%138 = load i32, i32* %9
%139 = sdiv i32 %138, 2
%140 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @circle to i32 (i32, i32, i32, ...)*)(i32 %135, i32 %137, i32 %139)
%141 = load i32, i32* %9
%142 = sub nsw i32 %141, 50
%143 = load i32, i32* %10
%144 = sub nsw i32 %143, 50
%145 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%146 = call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @outtextxy to i32 (i32, i32, i8*, ...)*)(i32 %142, i32 %144, i8* %145)
%147 = call i32 (...) @xflush()
ret void
}

LLVM IR (-O2):
define void @plot_particle([3 x double]* nocapture %0, i32 %1, i32* nocapture %2, double %3) {
%5 = alloca [100 x i8]
%6 = alloca [10000 x i32]
%7 = alloca [10000 x double]
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%9 = bitcast [10000 x i32]* %6 to i8*
%10 = bitcast [10000 x double]* %7 to i8*
%11 = sitofp i32 %1 to double
%12 = fdiv double %11, 1.000000e+02
%13 = tail call double @pow(double %12, double 0xBFD5555555555555)
%14 = fmul double %13, 1.000000e+01
%15 = fptosi double %14 to i32
%16 = tail call i32 (...) @getmaxx()
%17 = tail call i32 (...) @getmaxy()
%18 = icmp sgt i32 %1, 0
br i1 %18, label %19, label %133
19: ; preds = %4
%20 = zext i32 %1 to i64
%21 = icmp ult i32 %1, 8
br i1 %21, label %84, label %22
22: ; preds = %19
%23 = and i64 %20, 4294967288
%24 = add nsw i64 %23, -8
%25 = lshr exact i64 %24, 3
%26 = add nuw nsw i64 %25, 1
%27 = and i64 %26, 3
%28 = icmp ult i64 %24, 24
br i1 %28, label %65, label %29
29: ; preds = %22
%30 = and i64 %26, 4611686018427387900
br label %31
31: ; preds = %31, %29
%32 = phi i64 [ 0, %29 ], [ %61, %31 ]
%33 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %29 ], [ %62, %31 ]
%34 = phi i64 [ 0, %29 ], [ %63, %31 ]
%35 = add <4 x i32> %33, <i32 4, i32 4, i32 4, i32 4>
%36 = getelementptr inbounds [10000 x i32], [10000 x i32]* %6, i64 0, i64 %32
%37 = bitcast i32* %36 to <4 x i32>*
store <4 x i32> %33, <4 x i32>* %37
%38 = getelementptr inbounds i32, i32* %36, i64 4
%39 = bitcast i32* %38 to <4 x i32>*
store <4 x i32> %35, <4 x i32>* %39
%40 = or i64 %32, 8
%41 = add <4 x i32> %33, <i32 8, i32 8, i32 8, i32 8>
%42 = add <4 x i32> %33, <i32 12, i32 12, i32 12, i32 12>
%43 = getelementptr inbounds [10000 x i32], [10000 x i32]* %6, i64 0, i64 %40
%44 = bitcast i32* %43 to <4 x i32>*
store <4 x i32> %41, <4 x i32>* %44
%45 = getelementptr inbounds i32, i32* %43, i64 4
%46 = bitcast i32* %45 to <4 x i32>*
store <4 x i32> %42, <4 x i32>* %46
%47 = or i64 %32, 16
%48 = add <4 x i32> %33, <i32 16, i32 16, i32 16, i32 16>
%49 = add <4 x i32> %33, <i32 20, i32 20, i32 20, i32 20>
%50 = getelementptr inbounds [10000 x i32], [10000 x i32]* %6, i64 0, i64 %47
%51 = bitcast i32* %50 to <4 x i32>*
store <4 x i32> %48, <4 x i32>* %51
%52 = getelementptr inbounds i32, i32* %50, i64 4
%53 = bitcast i32* %52 to <4 x i32>*
store <4 x i32> %49, <4 x i32>* %53
%54 = or i64 %32, 24
%55 = add <4 x i32> %33, <i32 24, i32 24, i32 24, i32 24>
%56 = add <4 x i32> %33, <i32 28, i32 28, i32 28, i32 28>
%57 = getelementptr inbounds [10000 x i32], [10000 x i32]* %6, i64 0, i64 %54
%58 = bitcast i32* %57 to <4 x i32>*
store <4 x i32> %55, <4 x i32>* %58
%59 = getelementptr inbounds i32, i32* %57, i64 4
%60 = bitcast i32* %59 to <4 x i32>*
store <4 x i32> %56, <4 x i32>* %60
%61 = add nuw i64 %32, 32
%62 = add <4 x i32> %33, <i32 32, i32 32, i32 32, i32 32>
%63 = add i64 %34, 4
%64 = icmp eq i64 %63, %30
br i1 %64, label %65, label %31
65: ; preds = %31, %22
%66 = phi i64 [ 0, %22 ], [ %61, %31 ]
%67 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %22 ], [ %62, %31 ]
%68 = icmp eq i64 %27, 0
br i1 %68, label %82, label %69
69: ; preds = %65, %69
%70 = phi i64 [ %78, %69 ], [ %66, %65 ]
%71 = phi <4 x i32> [ %79, %69 ], [ %67, %65 ]
%72 = phi i64 [ %80, %69 ], [ 0, %65 ]
%73 = add <4 x i32> %71, <i32 4, i32 4, i32 4, i32 4>
%74 = getelementptr inbounds [10000 x i32], [10000 x i32]* %6, i64 0, i64 %70
%75 = bitcast i32* %74 to <4 x i32>*
store <4 x i32> %71, <4 x i32>* %75
%76 = getelementptr inbounds i32, i32* %74, i64 4
%77 = bitcast i32* %76 to <4 x i32>*
store <4 x i32> %73, <4 x i32>* %77
%78 = add nuw i64 %70, 8
%79 = add <4 x i32> %71, <i32 8, i32 8, i32 8, i32 8>
%80 = add i64 %72, 1
%81 = icmp eq i64 %80, %27
br i1 %81, label %82, label %69
82: ; preds = %69, %65
%83 = icmp eq i64 %23, %20
br i1 %83, label %86, label %84
84: ; preds = %19, %82
%85 = phi i64 [ 0, %19 ], [ %23, %82 ]
br label %120
86: ; preds = %120, %82
br i1 %18, label %87, label %133
87: ; preds = %86
%88 = zext i32 %1 to i64
%89 = icmp ult i32 %1, 5
br i1 %89, label %90, label %92
90: ; preds = %97, %87
%91 = phi i64 [ 0, %87 ], [ %96, %97 ]
br label %126
92: ; preds = %87
%93 = and i64 %20, 3
%94 = icmp eq i64 %93, 0
%95 = select i1 %94, i64 4, i64 %93
%96 = sub nsw i64 %20, %95
br label %97
97: ; preds = %97, %92
%98 = phi i64 [ 0, %92 ], [ %118, %97 ]
%99 = or i64 %98, 1
%100 = or i64 %98, 2
%101 = or i64 %98, 3
%102 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 %98, i64 2
%103 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 %99, i64 2
%104 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 %100, i64 2
%105 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 %101, i64 2
%106 = load double, double* %102
%107 = load double, double* %103
%108 = insertelement <2 x double> poison, double %106, i64 0
%109 = insertelement <2 x double> %108, double %107, i64 1
%110 = load double, double* %104
%111 = load double, double* %105
%112 = insertelement <2 x double> poison, double %110, i64 0
%113 = insertelement <2 x double> %112, double %111, i64 1
%114 = getelementptr inbounds [10000 x double], [10000 x double]* %7, i64 0, i64 %98
%115 = bitcast double* %114 to <2 x double>*
store <2 x double> %109, <2 x double>* %115
%116 = getelementptr inbounds double, double* %114, i64 2
%117 = bitcast double* %116 to <2 x double>*
store <2 x double> %113, <2 x double>* %117
%118 = add nuw i64 %98, 4
%119 = icmp eq i64 %118, %96
br i1 %119, label %90, label %97
120: ; preds = %84, %120
%121 = phi i64 [ %124, %120 ], [ %85, %84 ]
%122 = getelementptr inbounds [10000 x i32], [10000 x i32]* %6, i64 0, i64 %121
%123 = trunc i64 %121 to i32
store i32 %123, i32* %122
%124 = add nuw nsw i64 %121, 1
%125 = icmp eq i64 %124, %20
br i1 %125, label %86, label %120
126: ; preds = %90, %126
%127 = phi i64 [ %131, %126 ], [ %91, %90 ]
%128 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 %127, i64 2
%129 = load double, double* %128
%130 = getelementptr inbounds [10000 x double], [10000 x double]* %7, i64 0, i64 %127
store double %129, double* %130
%131 = add nuw nsw i64 %127, 1
%132 = icmp eq i64 %131, %88
br i1 %132, label %133, label %126
133: ; preds = %126, %4, %86
%134 = add nsw i32 %1, -1
%135 = getelementptr inbounds [10000 x double], [10000 x double]* %7, i64 0, i64 0
%136 = getelementptr inbounds [10000 x i32], [10000 x i32]* %6, i64 0, i64 0
%137 = call i32 (i32, i32, double*, i32*, ...) bitcast (i32 (...)* @sort_particles to i32 (i32, i32, double*, i32*, ...)*)(i32 0, i32 %134, double* %135, i32* %136)
%138 = call i32 (...) @cleardevice()
br i1 %18, label %139, label %178
139: ; preds = %133
%140 = sitofp i32 %16 to double
%141 = sitofp i32 %17 to double
%142 = zext i32 %134 to i64
%143 = zext i32 %1 to i64
br label %144
144: ; preds = %139, %174
%145 = phi i64 [ 0, %139 ], [ %176, %174 ]
%146 = sub nsw i64 %142, %145
%147 = getelementptr inbounds [10000 x i32], [10000 x i32]* %6, i64 0, i64 %146
%148 = load i32, i32* %147
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 %149, i64 0
%151 = load double, double* %150
%152 = fmul double %151, %140
%153 = fptosi double %152 to i32
%154 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 %149, i64 1
%155 = load double, double* %154
%156 = fmul double %155, %141
%157 = fptosi double %156 to i32
%158 = load i32, i32* %2
%159 = icmp eq i32 %158, 15
br i1 %159, label %160, label %162
160: ; preds = %144
%161 = call i32 (i32, ...) bitcast (i32 (...)* @setcolor to i32 (i32, ...)*)(i32 15)
br label %162
162: ; preds = %160, %144
%163 = getelementptr inbounds i32, i32* %2, i64 %149
%164 = load i32, i32* %163
%165 = icmp eq i32 %164, 0
br i1 %165, label %166, label %169
166: ; preds = %162
%167 = call i32 (i32, ...) bitcast (i32 (...)* @setcolor to i32 (i32, ...)*)(i32 14)
%168 = load i32, i32* %163
br label %169
169: ; preds = %166, %162
%170 = phi i32 [ %168, %166 ], [ %164, %162 ]
%171 = icmp eq i32 %170, 1
br i1 %171, label %172, label %174
172: ; preds = %169
%173 = call i32 (i32, ...) bitcast (i32 (...)* @setcolor to i32 (i32, ...)*)(i32 12)
br label %174
174: ; preds = %172, %169
%175 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @fillellipse to i32 (i32, i32, i32, i32, ...)*)(i32 %153, i32 %157, i32 %15, i32 %15)
%176 = add nuw nsw i64 %145, 1
%177 = icmp eq i64 %176, %143
br i1 %177, label %178, label %144
178: ; preds = %174, %133
%179 = call i32 (double, i32, i8*, ...) bitcast (i32 (...)* @gcvt to i32 (double, i32, i8*, ...)*)(double %3, i32 7, i8* %8)
%180 = call i32 (i32, ...) bitcast (i32 (...)* @setcolor to i32 (i32, ...)*)(i32 15)
%181 = sdiv i32 %16, 2
%182 = sdiv i32 %17, 2
%183 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @circle to i32 (i32, i32, i32, ...)*)(i32 %181, i32 %182, i32 %181)
%184 = add nsw i32 %16, -50
%185 = add nsw i32 %17, -50
%186 = call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @outtextxy to i32 (i32, i32, i8*, ...)*)(i32 %184, i32 %185, i8* %8)
%187 = call i32 (...) @xflush()
ret void
}