void anneal(float x[], float y[], int iorder[], int ncity) {
  int irbit1(unsigned long *iseed);
  int metrop(float de, float t);
  float ran3(long *idum);
  float revcst(float x[], float y[], int iorder[], int ncity, int n[]);
  void reverse(int iorder[], int ncity, int n[]);
  float trncst(float x[], float y[], int iorder[], int ncity, int n[]);
  void trnspt(int iorder[], int ncity, int n[]);
  int ans, nover, nlimit, i1, i2;
  int i, j, k, nsucc, nn, idec;
  static int n[7];
  long idum;
  unsigned long iseed;
  float path, de, t;
  nover = 100 * ncity;
  nlimit = 10 * ncity;
  path = 0.0;
  t = 0.5;
  for (i = 1; i < ncity; i++) {
    i1 = iorder[i];
    i2 = iorder[i + 1];
    path += sqrt(((x[i2]) - (x[i1])) * ((x[i2]) - (x[i1])) +
                 ((y[i2]) - (y[i1])) * ((y[i2]) - (y[i1])));
  }
  i1 = iorder[ncity];
  i2 = iorder[1];
  path += sqrt(((x[i2]) - (x[i1])) * ((x[i2]) - (x[i1])) +
               ((y[i2]) - (y[i1])) * ((y[i2]) - (y[i1])));
  idum = -1;
  iseed = 111;
  for (j = 1; j <= 100; j++) {
    nsucc = 0;
    for (k = 1; k <= nover; k++) {
      do {
        n[1] = 1 + (int)(ncity * ran3(&idum));
        n[2] = 1 + (int)((ncity - 1) * ran3(&idum));
        if (n[2] >= n[1])
          ++n[2];
        nn = 1 + ((n[1] - n[2] + ncity - 1) % ncity);
      } while (nn < 3);
      idec = irbit1(&iseed);
      if (idec == 0) {
        n[3] = n[2] + (int)(abs(nn - 2) * ran3(&idum)) + 1;
        n[3] = 1 + ((n[3] - 1) % ncity);
        de = trncst(x, y, iorder, ncity, n);
        ans = metrop(de, t);
        if (ans) {
          ++nsucc;
          path += de;
          trnspt(iorder, ncity, n);
        }
      } else {
        de = revcst(x, y, iorder, ncity, n);
        ans = metrop(de, t);
        if (ans) {
          ++nsucc;
          path += de;
          reverse(iorder, ncity, n);
        }
      }
      if (nsucc >= nlimit)
        break;
    }
    printf("\n %s %10.6f %s %12.6f \n", "T =", t, "	 Path Length =", path);
    printf("Successful Moves: %6d\n", nsucc);
    t *= 0.9;
    if (nsucc == 0)
      return;
  }
}


x86 assembly (clang, -O0):
<anneal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
imul   $0x64,-0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
imul   $0xa,-0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x5c(%rbp)
movss  0xe28(%rip),%xmm0
movss  %xmm0,-0x64(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    12b5 <anneal+0x115>
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x30(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
subss  (%rax,%rcx,4),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x30(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm2
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
subss  (%rax,%rcx,4),%xmm2
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
subss  (%rax,%rcx,4),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm3
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
subss  (%rax,%rcx,4),%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
call   10c0 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0x5c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x5c(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11e4 <anneal+0x44>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x30(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
subss  (%rax,%rcx,4),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x30(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm2
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
subss  (%rax,%rcx,4),%xmm2
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
subss  (%rax,%rcx,4),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm3
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
subss  (%rax,%rcx,4),%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
call   10c0 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0x5c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x5c(%rbp)
movq   $0xffffffffffffffff,-0x50(%rbp)
ff
movq   $0x6f,-0x58(%rbp)
movl   $0x1,-0x38(%rbp)
cmpl   $0x64,-0x38(%rbp)
jg     1632 <anneal+0x492>
movl   $0x0,-0x40(%rbp)
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jg     15b3 <anneal+0x413>
jmp    13a3 <anneal+0x203>
cvtsi2ssl -0x1c(%rbp),%xmm0
movss  %xmm0,-0x6c(%rbp)
lea    -0x50(%rbp),%rdi
call   10b0 <ran3@plt>
movaps %xmm0,%xmm1
movss  -0x6c(%rbp),%xmm0
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
add    $0x1,%eax
mov    %eax,0x2cb5(%rip)
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x68(%rbp)
lea    -0x50(%rbp),%rdi
call   10b0 <ran3@plt>
movaps %xmm0,%xmm1
movss  -0x68(%rbp),%xmm0
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
add    $0x1,%eax
mov    %eax,0x2c88(%rip)
mov    0x2c82(%rip),%eax
cmp    0x2c78(%rip),%eax
jl     1421 <anneal+0x281>
mov    0x2c70(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2c67(%rip)
mov    0x2c5d(%rip),%eax
sub    0x2c5b(%rip),%eax
add    -0x1c(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x1c(%rbp)
add    $0x1,%edx
mov    %edx,-0x44(%rbp)
cmpl   $0x3,-0x44(%rbp)
jl     13a3 <anneal+0x203>
lea    -0x58(%rbp),%rdi
call   1070 <irbit1@plt>
mov    %eax,-0x48(%rbp)
cmpl   $0x0,-0x48(%rbp)
jne    1523 <anneal+0x383>
mov    0x2c25(%rip),%eax
mov    %eax,-0x74(%rbp)
mov    -0x44(%rbp),%edi
sub    $0x2,%edi
call   1040 <abs@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x70(%rbp)
lea    -0x50(%rbp),%rdi
call   10b0 <ran3@plt>
mov    -0x74(%rbp),%eax
movaps %xmm0,%xmm1
movss  -0x70(%rbp),%xmm0
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%ecx
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,0x2beb(%rip)
mov    0x2be5(%rip),%eax
sub    $0x1,%eax
cltd
idivl  -0x1c(%rbp)
add    $0x1,%edx
mov    %edx,0x2bd5(%rip)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0x2bb3(%rip),%r8
call   1090 <trncst@plt>
movss  %xmm0,-0x60(%rbp)
movss  -0x60(%rbp),%xmm0
movss  -0x64(%rbp),%xmm1
call   1060 <metrop@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     151e <anneal+0x37e>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
movss  -0x60(%rbp),%xmm0
addss  -0x5c(%rbp),%xmm0
movss  %xmm0,-0x5c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
lea    0x2b67(%rip),%rdx
call   1080 <trnspt@plt>
jmp    158f <anneal+0x3ef>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0x2b47(%rip),%r8
call   10a0 <revcst@plt>
movss  %xmm0,-0x60(%rbp)
movss  -0x60(%rbp),%xmm0
movss  -0x64(%rbp),%xmm1
call   1060 <metrop@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     158a <anneal+0x3ea>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
movss  -0x60(%rbp),%xmm0
addss  -0x5c(%rbp),%xmm0
movss  %xmm0,-0x5c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
lea    0x2afb(%rip),%rdx
call   1030 <reverse@plt>
jmp    158f <anneal+0x3ef>
mov    -0x40(%rbp),%eax
cmp    -0x28(%rbp),%eax
jl     15a0 <anneal+0x400>
jmp    15b3 <anneal+0x413>
jmp    15a5 <anneal+0x405>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1392 <anneal+0x1f2>
movss  -0x64(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x5c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xa44(%rip),%rdi
lea    0xa55(%rip),%rsi
lea    0xa52(%rip),%rdx
mov    $0x2,%al
call   1050 <printf@plt>
mov    -0x40(%rbp),%esi
lea    0xa51(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movss  -0x64(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xa05(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x64(%rbp)
cmpl   $0x0,-0x40(%rbp)
jne    161f <anneal+0x47f>
jmp    1632 <anneal+0x492>
jmp    1624 <anneal+0x484>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    137a <anneal+0x1da>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<anneal>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %ecx,%ebx
mov    %rdx,0x40(%rsp)
mov    %rsi,0x38(%rsp)
mov    %rdi,0x30(%rsp)
lea    (%rbx,%rbx,1),%r14d
xorpd  %xmm2,%xmm2
cmp    $0x2,%ecx
jl     1258 <anneal+0xc8>
mov    %ebx,%r15d
xorpd  %xmm3,%xmm3
mov    $0x1,%ebp
xorpd  %xmm2,%xmm2
jmp    120c <anneal+0x7c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  %xmm2,0x20(%rsp)
call   10b0 <sqrt@plt>
xorpd  %xmm3,%xmm3
movsd  0x20(%rsp),%xmm2
addsd  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
xorps  %xmm2,%xmm2
cvtss2sd %xmm0,%xmm2
cmp    %rbp,%r15
je     1258 <anneal+0xc8>
mov    0x40(%rsp),%rcx
movslq (%rcx,%rbp,4),%rax
movslq 0x4(%rcx,%rbp,4),%rcx
add    $0x1,%rbp
mov    0x30(%rsp),%rdx
movss  (%rdx,%rcx,4),%xmm0
subss  (%rdx,%rax,4),%xmm0
mov    0x38(%rsp),%rdx
movss  (%rdx,%rcx,4),%xmm1
subss  (%rdx,%rax,4),%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
ucomisd %xmm3,%xmm0
jb     11e0 <anneal+0x50>
sqrtsd %xmm0,%xmm0
jmp    11f5 <anneal+0x65>
movslq %ebx,%rax
mov    0x40(%rsp),%r15
movslq (%r15,%rax,4),%rax
movslq 0x4(%r15),%rcx
mov    0x30(%rsp),%rdx
movss  (%rdx,%rcx,4),%xmm0
subss  (%rdx,%rax,4),%xmm0
mov    0x38(%rsp),%rdx
movss  (%rdx,%rcx,4),%xmm1
subss  (%rdx,%rax,4),%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
ucomisd 0xd72(%rip),%xmm0
jb     12a6 <anneal+0x116>
sqrtsd %xmm0,%xmm0
jmp    12b7 <anneal+0x127>
movsd  %xmm2,0x20(%rsp)
call   10b0 <sqrt@plt>
movsd  0x20(%rsp),%xmm2
addsd  %xmm0,%xmm2
imul   $0x64,%ebx,%eax
mov    %eax,0x4c(%rsp)
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
movss  %xmm0,0x10(%rsp)
lea    (%r14,%r14,4),%eax
mov    %eax,0x50(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
movss  %xmm0,0x20(%rsp)
lea    -0x1(%rbx),%ebp
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
movss  %xmm0,0x54(%rsp)
movq   $0xffffffffffffffff,0x60(%rsp)
ff ff
movq   $0x6f,0x58(%rsp)
movl   $0x1,0x2c(%rsp)
movss  0xcea(%rip),%xmm0
movss  %xmm0,0x14(%rsp)
lea    0x60(%rsp),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   %ebx,%ebx
jle    1520 <anneal+0x390>
mov    $0x1,%r14d
xor    %r12d,%r12d
jmp    1372 <anneal+0x1e2>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x18(%rsp),%r12d
cmp    0x50(%rsp),%r12d
jge    1523 <anneal+0x393>
lea    0x1(%r14),%eax
cmp    0x4c(%rsp),%r14d
mov    %eax,%r14d
jge    1523 <anneal+0x393>
mov    %r12d,0x18(%rsp)
jmp    138c <anneal+0x1fc>
nopl   0x0(%rax)
add    %ebp,%eax
sub    %edx,%eax
cltd
idiv   %ebx
cmp    $0x2,%edx
jge    13e0 <anneal+0x250>
mov    %r13,%rdi
call   10a0 <ran3@plt>
mulss  0x20(%rsp),%xmm0
cvttss2si %xmm0,%eax
add    $0x1,%eax
mov    %eax,0x2cdd(%rip)
mov    %r13,%rdi
call   10a0 <ran3@plt>
mulss  0x54(%rsp),%xmm0
cvttss2si %xmm0,%ecx
lea    0x1(%rcx),%edx
mov    %edx,0x2cc6(%rip)
mov    0x2cbc(%rip),%eax
cmp    %eax,%edx
jl     1380 <anneal+0x1f0>
add    $0x2,%ecx
mov    %ecx,0x2cb3(%rip)
mov    %ecx,%edx
jmp    1380 <anneal+0x1f0>
nopl   0x0(%rax)
mov    %edx,%r12d
lea    0x58(%rsp),%rdi
call   1060 <irbit1@plt>
test   %eax,%eax
je     1470 <anneal+0x2e0>
mov    0x30(%rsp),%rdi
mov    0x38(%rsp),%rsi
mov    %r15,%rdx
mov    %ebx,%ecx
lea    0x2c79(%rip),%r12
mov    %r12,%r8
call   1090 <revcst@plt>
movss  %xmm0,0xc(%rsp)
movss  0x14(%rsp),%xmm1
call   1050 <metrop@plt>
test   %eax,%eax
je     1350 <anneal+0x1c0>
mov    0x18(%rsp),%eax
add    $0x1,%eax
movss  0x10(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
movss  %xmm0,0x10(%rsp)
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r12,%rdx
mov    %eax,%r12d
call   1030 <reverse@plt>
cmp    0x50(%rsp),%r12d
jl     1360 <anneal+0x1d0>
jmp    1523 <anneal+0x393>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x2c11(%rip),%r15d
add    $0xffffffff,%r12d
xorps  %xmm0,%xmm0
cvtsi2ss %r12d,%xmm0
movss  %xmm0,0xc(%rsp)
mov    %r13,%rdi
call   10a0 <ran3@plt>
mulss  0xc(%rsp),%xmm0
cvttss2si %xmm0,%eax
add    %r15d,%eax
mov    0x40(%rsp),%r15
cltd
idiv   %ebx
add    $0x1,%edx
mov    %edx,0x2bdd(%rip)
mov    0x30(%rsp),%rdi
mov    0x38(%rsp),%rsi
mov    %r15,%rdx
mov    %ebx,%ecx
lea    0x2bbb(%rip),%r12
mov    %r12,%r8
call   1080 <trncst@plt>
movss  %xmm0,0xc(%rsp)
movss  0x14(%rsp),%xmm1
call   1050 <metrop@plt>
test   %eax,%eax
je     1350 <anneal+0x1c0>
mov    0x18(%rsp),%eax
add    $0x1,%eax
movss  0x10(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
movss  %xmm0,0x10(%rsp)
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r12,%rdx
mov    %eax,%r12d
call   1070 <trnspt@plt>
cmp    0x50(%rsp),%r12d
jl     1360 <anneal+0x1d0>
jmp    1523 <anneal+0x393>
nopl   0x0(%rax)
xor    %r12d,%r12d
movss  0x14(%rsp),%xmm0
xorps  %xmm2,%xmm2
cvtss2sd %xmm0,%xmm2
movss  0x10(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
lea    0xad4(%rip),%rdi
lea    0xae5(%rip),%rsi
movsd  %xmm2,0x18(%rsp)
movaps %xmm2,%xmm0
lea    0xad9(%rip),%rdx
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xadb(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r12d,%r12d
je     15a4 <anneal+0x414>
movsd  0x18(%rsp),%xmm0
mulsd  0xa82(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x14(%rsp)
mov    0x2c(%rsp),%eax
add    $0x1,%eax
mov    %eax,0x2c(%rsp)
cmp    $0x65,%eax
jne    1330 <anneal+0x1a0>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@anneal.n = internal global [7 x i32] zeroinitializer
@.str = [24 x i8] c"\0A %s %10.6f %s %12.6f \0A\00"
@.str.1 = [4 x i8] c"T =\00"
@.str.2 = [16 x i8] c"\09 Path Length =\00"
@.str.3 = [23 x i8] c"Successful Moves: %6d\0A\00"
define void @anneal(float* %0, float* %1, i32* %2, i32 %3) {
%5 = alloca float*
%6 = alloca float*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i64
%21 = alloca i64
%22 = alloca float
%23 = alloca float
%24 = alloca float
store float* %0, float** %5
store float* %1, float** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%25 = load i32, i32* %8
%26 = mul nsw i32 100, %25
store i32 %26, i32* %10
%27 = load i32, i32* %8
%28 = mul nsw i32 10, %27
store i32 %28, i32* %11
store float 0.000000e+00, float* %22
store float 5.000000e-01, float* %24
store i32 1, i32* %14
br label %29
29: ; preds = %97, %4
%30 = load i32, i32* %14
%31 = load i32, i32* %8
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %100
33: ; preds = %29
%34 = load i32*, i32** %7
%35 = load i32, i32* %14
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i32, i32* %34, i64 %36
%38 = load i32, i32* %37
store i32 %38, i32* %12
%39 = load i32*, i32** %7
%40 = load i32, i32* %14
%41 = add nsw i32 %40, 1
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i32, i32* %39, i64 %42
%44 = load i32, i32* %43
store i32 %44, i32* %13
%45 = load float*, float** %5
%46 = load i32, i32* %13
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds float, float* %45, i64 %47
%49 = load float, float* %48
%50 = load float*, float** %5
%51 = load i32, i32* %12
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds float, float* %50, i64 %52
%54 = load float, float* %53
%55 = fsub float %49, %54
%56 = load float*, float** %5
%57 = load i32, i32* %13
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds float, float* %56, i64 %58
%60 = load float, float* %59
%61 = load float*, float** %5
%62 = load i32, i32* %12
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds float, float* %61, i64 %63
%65 = load float, float* %64
%66 = fsub float %60, %65
%67 = load float*, float** %6
%68 = load i32, i32* %13
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds float, float* %67, i64 %69
%71 = load float, float* %70
%72 = load float*, float** %6
%73 = load i32, i32* %12
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds float, float* %72, i64 %74
%76 = load float, float* %75
%77 = fsub float %71, %76
%78 = load float*, float** %6
%79 = load i32, i32* %13
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds float, float* %78, i64 %80
%82 = load float, float* %81
%83 = load float*, float** %6
%84 = load i32, i32* %12
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds float, float* %83, i64 %85
%87 = load float, float* %86
%88 = fsub float %82, %87
%89 = fmul float %77, %88
%90 = call float @llvm.fmuladd.f32(float %55, float %66, float %89)
%91 = fpext float %90 to double
%92 = call double @sqrt(double %91)
%93 = load float, float* %22
%94 = fpext float %93 to double
%95 = fadd double %94, %92
%96 = fptrunc double %95 to float
store float %96, float* %22
br label %97
97: ; preds = %33
%98 = load i32, i32* %14
%99 = add nsw i32 %98, 1
store i32 %99, i32* %14
br label %29
100: ; preds = %29
%101 = load i32*, i32** %7
%102 = load i32, i32* %8
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i32, i32* %101, i64 %103
%105 = load i32, i32* %104
store i32 %105, i32* %12
%106 = load i32*, i32** %7
%107 = getelementptr inbounds i32, i32* %106, i64 1
%108 = load i32, i32* %107
store i32 %108, i32* %13
%109 = load float*, float** %5
%110 = load i32, i32* %13
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds float, float* %109, i64 %111
%113 = load float, float* %112
%114 = load float*, float** %5
%115 = load i32, i32* %12
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds float, float* %114, i64 %116
%118 = load float, float* %117
%119 = fsub float %113, %118
%120 = load float*, float** %5
%121 = load i32, i32* %13
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds float, float* %120, i64 %122
%124 = load float, float* %123
%125 = load float*, float** %5
%126 = load i32, i32* %12
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds float, float* %125, i64 %127
%129 = load float, float* %128
%130 = fsub float %124, %129
%131 = load float*, float** %6
%132 = load i32, i32* %13
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds float, float* %131, i64 %133
%135 = load float, float* %134
%136 = load float*, float** %6
%137 = load i32, i32* %12
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds float, float* %136, i64 %138
%140 = load float, float* %139
%141 = fsub float %135, %140
%142 = load float*, float** %6
%143 = load i32, i32* %13
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds float, float* %142, i64 %144
%146 = load float, float* %145
%147 = load float*, float** %6
%148 = load i32, i32* %12
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds float, float* %147, i64 %149
%151 = load float, float* %150
%152 = fsub float %146, %151
%153 = fmul float %141, %152
%154 = call float @llvm.fmuladd.f32(float %119, float %130, float %153)
%155 = fpext float %154 to double
%156 = call double @sqrt(double %155)
%157 = load float, float* %22
%158 = fpext float %157 to double
%159 = fadd double %158, %156
%160 = fptrunc double %159 to float
store float %160, float* %22
store i64 -1, i64* %20
store i64 111, i64* %21
store i32 1, i32* %15
br label %161
161: ; preds = %287, %100
%162 = load i32, i32* %15
%163 = icmp sle i32 %162, 100
br i1 %163, label %164, label %290
164: ; preds = %161
store i32 0, i32* %17
store i32 1, i32* %16
br label %165
165: ; preds = %268, %164
%166 = load i32, i32* %16
%167 = load i32, i32* %10
%168 = icmp sle i32 %166, %167
br i1 %168, label %169, label %271
169: ; preds = %165
br label %170
170: ; preds = %200, %169
%171 = load i32, i32* %8
%172 = sitofp i32 %171 to float
%173 = call float @ran3(i64* %20)
%174 = fmul float %172, %173
%175 = fptosi float %174 to i32
%176 = add nsw i32 1, %175
store i32 %176, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @anneal.n, i64 0, i64 1)
%177 = load i32, i32* %8
%178 = sub nsw i32 %177, 1
%179 = sitofp i32 %178 to float
%180 = call float @ran3(i64* %20)
%181 = fmul float %179, %180
%182 = fptosi float %181 to i32
%183 = add nsw i32 1, %182
store i32 %183, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @anneal.n, i64 0, i64 2)
%184 = load i32, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @anneal.n, i64 0, i64 2)
%185 = load i32, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @anneal.n, i64 0, i64 1)
%186 = icmp sge i32 %184, %185
br i1 %186, label %187, label %190
187: ; preds = %170
%188 = load i32, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @anneal.n, i64 0, i64 2)
%189 = add nsw i32 %188, 1
store i32 %189, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @anneal.n, i64 0, i64 2)
br label %190
190: ; preds = %187, %170
%191 = load i32, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @anneal.n, i64 0, i64 1)
%192 = load i32, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @anneal.n, i64 0, i64 2)
%193 = sub nsw i32 %191, %192
%194 = load i32, i32* %8
%195 = add nsw i32 %193, %194
%196 = sub nsw i32 %195, 1
%197 = load i32, i32* %8
%198 = srem i32 %196, %197
%199 = add nsw i32 1, %198
store i32 %199, i32* %18
br label %200
200: ; preds = %190
%201 = load i32, i32* %18
%202 = icmp slt i32 %201, 3
br i1 %202, label %170, label %203
203: ; preds = %200
%204 = call i32 @irbit1(i64* %21)
store i32 %204, i32* %19
%205 = load i32, i32* %19
%206 = icmp eq i32 %205, 0
br i1 %206, label %207, label %242
207: ; preds = %203
%208 = load i32, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @anneal.n, i64 0, i64 2)
%209 = load i32, i32* %18
%210 = sub nsw i32 %209, 2
%211 = call i32 @abs(i32 %210)
%212 = sitofp i32 %211 to float
%213 = call float @ran3(i64* %20)
%214 = fmul float %212, %213
%215 = fptosi float %214 to i32
%216 = add nsw i32 %208, %215
%217 = add nsw i32 %216, 1
store i32 %217, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @anneal.n, i64 0, i64 3)
%218 = load i32, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @anneal.n, i64 0, i64 3)
%219 = sub nsw i32 %218, 1
%220 = load i32, i32* %8
%221 = srem i32 %219, %220
%222 = add nsw i32 1, %221
store i32 %222, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @anneal.n, i64 0, i64 3)
%223 = load float*, float** %5
%224 = load float*, float** %6
%225 = load i32*, i32** %7
%226 = load i32, i32* %8
%227 = call float @trncst(float* %223, float* %224, i32* %225, i32 %226, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @anneal.n, i64 0, i64 0))
store float %227, float* %23
%228 = load float, float* %23
%229 = load float, float* %24
%230 = call i32 @metrop(float %228, float %229)
store i32 %230, i32* %9
%231 = load i32, i32* %9
%232 = icmp ne i32 %231, 0
br i1 %232, label %233, label %241
233: ; preds = %207
%234 = load i32, i32* %17
%235 = add nsw i32 %234, 1
store i32 %235, i32* %17
%236 = load float, float* %23
%237 = load float, float* %22
%238 = fadd float %237, %236
store float %238, float* %22
%239 = load i32*, i32** %7
%240 = load i32, i32* %8
br label %241
241: ; preds = %233, %207
br label %262
242: ; preds = %203
%243 = load float*, float** %5
%244 = load float*, float** %6
%245 = load i32*, i32** %7
%246 = load i32, i32* %8
%247 = call float @revcst(float* %243, float* %244, i32* %245, i32 %246, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @anneal.n, i64 0, i64 0))
store float %247, float* %23
%248 = load float, float* %23
%249 = load float, float* %24
%250 = call i32 @metrop(float %248, float %249)
store i32 %250, i32* %9
%251 = load i32, i32* %9
%252 = icmp ne i32 %251, 0
br i1 %252, label %253, label %261
253: ; preds = %242
%254 = load i32, i32* %17
%255 = add nsw i32 %254, 1
store i32 %255, i32* %17
%256 = load float, float* %23
%257 = load float, float* %22
%258 = fadd float %257, %256
store float %258, float* %22
%259 = load i32*, i32** %7
%260 = load i32, i32* %8
br label %261
261: ; preds = %253, %242
br label %262
262: ; preds = %261, %241
%263 = load i32, i32* %17
%264 = load i32, i32* %11
%265 = icmp sge i32 %263, %264
br i1 %265, label %266, label %267
266: ; preds = %262
br label %271
267: ; preds = %262
br label %268
268: ; preds = %267
%269 = load i32, i32* %16
%270 = add nsw i32 %269, 1
store i32 %270, i32* %16
br label %165
271: ; preds = %266, %165
%272 = load float, float* %24
%273 = fpext float %272 to double
%274 = load float, float* %22
%275 = fpext float %274 to double
%276 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %273, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %275)
%277 = load i32, i32* %17
%278 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %277)
%279 = load float, float* %24
%280 = fpext float %279 to double
%281 = fmul double %280, 9.000000e-01
%282 = fptrunc double %281 to float
store float %282, float* %24
%283 = load i32, i32* %17
%284 = icmp eq i32 %283, 0
br i1 %284, label %285, label %286
285: ; preds = %271
br label %290
286: ; preds = %271
br label %287
287: ; preds = %286
%288 = load i32, i32* %15
%289 = add nsw i32 %288, 1
store i32 %289, i32* %15
br label %161
290: ; preds = %285, %161
ret void
}

LLVM IR (-O2):
@anneal.n = internal global [7 x i32] zeroinitializer
@.str = [24 x i8] c"\0A %s %10.6f %s %12.6f \0A\00"
@.str.1 = [4 x i8] c"T =\00"
@.str.2 = [16 x i8] c"\09 Path Length =\00"
@.str.3 = [23 x i8] c"Successful Moves: %6d\0A\00"
define void @anneal(float* %0, float* %1, i32* %2, i32 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = bitcast i64* %5 to i8*
%8 = bitcast i64* %6 to i8*
%9 = mul nsw i32 %3, 100
%10 = mul nsw i32 %3, 10
%11 = icmp sgt i32 %3, 1
br i1 %11, label %12, label %42
12: ; preds = %4
%13 = zext i32 %3 to i64
br label %14
14: ; preds = %12, %14
%15 = phi i64 [ 1, %12 ], [ %19, %14 ]
%16 = phi double [ 0.000000e+00, %12 ], [ %40, %14 ]
%17 = getelementptr inbounds i32, i32* %2, i64 %15
%18 = load i32, i32* %17
%19 = add nuw nsw i64 %15, 1
%20 = getelementptr inbounds i32, i32* %2, i64 %19
%21 = load i32, i32* %20
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds float, float* %0, i64 %22
%24 = load float, float* %23
%25 = sext i32 %18 to i64
%26 = getelementptr inbounds float, float* %0, i64 %25
%27 = load float, float* %26
%28 = fsub float %24, %27
%29 = getelementptr inbounds float, float* %1, i64 %22
%30 = load float, float* %29
%31 = getelementptr inbounds float, float* %1, i64 %25
%32 = load float, float* %31
%33 = fsub float %30, %32
%34 = fmul float %33, %33
%35 = tail call float @llvm.fmuladd.f32(float %28, float %28, float %34)
%36 = fpext float %35 to double
%37 = tail call double @sqrt(double %36)
%38 = fadd double %16, %37
%39 = fptrunc double %38 to float
%40 = fpext float %39 to double
%41 = icmp eq i64 %19, %13
br i1 %41, label %42, label %14
42: ; preds = %14, %4
%43 = phi double [ 0.000000e+00, %4 ], [ %40, %14 ]
%44 = sext i32 %3 to i64
%45 = getelementptr inbounds i32, i32* %2, i64 %44
%46 = load i32, i32* %45
%47 = getelementptr inbounds i32, i32* %2, i64 1
%48 = load i32, i32* %47
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds float, float* %0, i64 %49
%51 = load float, float* %50
%52 = sext i32 %46 to i64
%53 = getelementptr inbounds float, float* %0, i64 %52
%54 = load float, float* %53
%55 = fsub float %51, %54
%56 = getelementptr inbounds float, float* %1, i64 %49
%57 = load float, float* %56
%58 = getelementptr inbounds float, float* %1, i64 %52
%59 = load float, float* %58
%60 = fsub float %57, %59
%61 = fmul float %60, %60
%62 = tail call float @llvm.fmuladd.f32(float %55, float %55, float %61)
%63 = fpext float %62 to double
%64 = tail call double @sqrt(double %63)
%65 = fadd double %43, %64
%66 = fptrunc double %65 to float
store i64 -1, i64* %5
store i64 111, i64* %6
%67 = icmp slt i32 %3, 1
%68 = sitofp i32 %3 to float
%69 = add i32 %3, -1
%70 = sitofp i32 %69 to float
br label %71
71: ; preds = %42, %139
%72 = phi float [ 5.000000e-01, %42 ], [ %141, %139 ]
%73 = phi float [ %66, %42 ], [ %133, %139 ]
%74 = phi i32 [ 1, %42 ], [ %142, %139 ]
br i1 %67, label %131, label %75
75: ; preds = %71, %124
%76 = phi float [ %126, %124 ], [ %73, %71 ]
%77 = phi i32 [ %125, %124 ], [ 0, %71 ]
%78 = phi i32 [ %128, %124 ], [ 1, %71 ]
br label %79
79: ; preds = %75, %92
%80 = call float @ran3(i64* %5)
%81 = fmul float %80, %68
%82 = fptosi float %81 to i32
%83 = add nsw i32 %82, 1
store i32 %83, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @anneal.n, i64 0, i64 1)
%84 = call float @ran3(i64* %5)
%85 = fmul float %84, %70
%86 = fptosi float %85 to i32
%87 = add nsw i32 %86, 1
store i32 %87, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @anneal.n, i64 0, i64 2)
%88 = load i32, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @anneal.n, i64 0, i64 1)
%89 = icmp slt i32 %87, %88
br i1 %89, label %92, label %90
90: ; preds = %79
%91 = add nsw i32 %86, 2
store i32 %91, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @anneal.n, i64 0, i64 2)
br label %92
92: ; preds = %90, %79
%93 = phi i32 [ %91, %90 ], [ %87, %79 ]
%94 = add i32 %69, %88
%95 = sub i32 %94, %93
%96 = srem i32 %95, %3
%97 = icmp slt i32 %96, 2
br i1 %97, label %79, label %98
98: ; preds = %92
%99 = call i32 @irbit1(i64* %6)
%100 = icmp eq i32 %99, 0
br i1 %100, label %101, label %117
101: ; preds = %98
%102 = load i32, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @anneal.n, i64 0, i64 2)
%103 = add nsw i32 %96, -1
%104 = sitofp i32 %103 to float
%105 = call float @ran3(i64* %5)
%106 = fmul float %105, %104
%107 = fptosi float %106 to i32
%108 = add nsw i32 %102, %107
%109 = srem i32 %108, %3
%110 = add nsw i32 %109, 1
store i32 %110, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @anneal.n, i64 0, i64 3)
%111 = call float @trncst(float* %0, float* %1, i32* %2, i32 %3, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @anneal.n, i64 0, i64 0))
%112 = call i32 @metrop(float %111, float %72)
%113 = icmp eq i32 %112, 0
br i1 %113, label %124, label %114
114: ; preds = %101
%115 = add nsw i32 %77, 1
%116 = fadd float %76, %111
br label %124
117: ; preds = %98
%118 = call float @revcst(float* %0, float* %1, i32* %2, i32 %3, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @anneal.n, i64 0, i64 0))
%119 = call i32 @metrop(float %118, float %72)
%120 = icmp eq i32 %119, 0
br i1 %120, label %124, label %121
121: ; preds = %117
%122 = add nsw i32 %77, 1
%123 = fadd float %76, %118
br label %124
124: ; preds = %117, %121, %101, %114
%125 = phi i32 [ %115, %114 ], [ %77, %101 ], [ %122, %121 ], [ %77, %117 ]
%126 = phi float [ %116, %114 ], [ %76, %101 ], [ %123, %121 ], [ %76, %117 ]
%127 = icmp sge i32 %125, %10
%128 = add nuw nsw i32 %78, 1
%129 = icmp sge i32 %78, %9
%130 = select i1 %127, i1 true, i1 %129
br i1 %130, label %131, label %75
131: ; preds = %124, %71
%132 = phi i32 [ 0, %71 ], [ %125, %124 ]
%133 = phi float [ %73, %71 ], [ %126, %124 ]
%134 = fpext float %72 to double
%135 = fpext float %133 to double
%136 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %134, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %135)
%137 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %132)
%138 = icmp eq i32 %132, 0
br i1 %138, label %144, label %139
139: ; preds = %131
%140 = fmul double %134, 9.000000e-01
%141 = fptrunc double %140 to float
%142 = add nuw nsw i32 %74, 1
%143 = icmp eq i32 %142, 101
br i1 %143, label %144, label %71
144: ; preds = %139, %131
ret void
}