#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 */
double NAN;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stderr;
double lru(size_t n_frame, size_t *pages, size_t n_page) {
  size_t p, f, l, lru, hit, frames[20];
  for (f = 0; f < n_frame; ++f)
    frames[f] = 0;
  puts("Page Replacement Algorithm");
  puts("Least Recently Used (LRU)");
  hit = 0;
  do {
    size_t f;
    putchar('\n');
    putchar('+');
    printf("---------+");
    for (f = 0; f < n_frame; ++f)
      printf("----------+");
    putchar('\n');
  } while (0);
  printf("| Request |");
  for (f = 1; f <= n_frame; ++f)
    printf(" Frame %2zu |", f);
  for (p = 0; p < n_page; ++p) {
    do {
      size_t f;
      putchar('\n');
      putchar('+');
      printf("---------+");
      for (f = 0; f < n_frame; ++f)
        printf("----------+");
      putchar('\n');
    } while (0);
    if (!pages[p]) {
      fprintf(stderr, "lru: Segmentation Fault! Page zero requested.\n");
      return NAN;
    }
    printf("| Page %2zu |", pages[p]);
    for (f = 0; f < n_frame && frames[f] != pages[p] && frames[f]; ++f)
      ;
    if (f != n_frame) {
      if (frames[f] == pages[p])
        ++hit;
      goto print_frames;
    }
    for (f = 0, lru = p - 1; f < n_frame; ++f) {
      for (l = p - 1; pages[l] != frames[f]; --l)
        ;
      if (l < lru)
        lru = l;
    }
    for (f = 0; f < n_frame; ++f)
      if (frames[f] == pages[lru])
        break;
  print_frames:
    frames[f] = pages[p];
    for (f = 0; f < n_frame; ++f)
      frames[f] ? printf(" %8zu |", frames[f]) : printf(" %8c |", ' ');
  }
  do {
    size_t f;
    putchar('\n');
    putchar('+');
    printf("---------+");
    for (f = 0; f < n_frame; ++f)
      printf("----------+");
    putchar('\n');
  } while (0);
  printf("Cache Hits = %zu\nHit Ratio  = %.2lf%%\n", hit, 100.0 * hit / n_page);
  return 100.0 * hit / n_page;
}


x86 assembly (clang, -O0):
<lru>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    118e <lru+0x4e>
mov    -0x30(%rbp),%rax
movq   $0x0,-0xf0(%rbp,%rax,8)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    115f <lru+0x1f>
lea    0xe93(%rip),%rdi
call   1040 <puts@plt>
lea    0xea2(%rip),%rdi
call   1040 <puts@plt>
movq   $0x0,-0x48(%rbp)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movq   $0x0,-0xf8(%rbp)
mov    -0xf8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1211 <lru+0xd1>
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xf8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xf8(%rbp)
jmp    11db <lru+0x9b>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movq   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x10(%rbp),%rax
ja     1262 <lru+0x122>
mov    -0x30(%rbp),%rsi
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1231 <lru+0xf1>
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    157d <lru+0x43d>
jmp    127d <lru+0x13d>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
lea    0xdc6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movq   $0x0,-0x100(%rbp)
mov    -0x100(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    12e0 <lru+0x1a0>
lea    0xd9b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x100(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x100(%rbp)
jmp    12aa <lru+0x16a>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
jne    1327 <lru+0x1e7>
mov    0x2cd4(%rip),%rax
mov    (%rax),%edi
lea    0xd76(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2cdf(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    16b9 <lru+0x579>
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xd78(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x109(%rbp)
jae    139b <lru+0x25b>
mov    -0x30(%rbp),%rax
mov    -0xf0(%rbp,%rax,8),%rcx
ff
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rsi
xor    %eax,%eax
cmp    (%rdx,%rsi,8),%rcx
mov    %al,-0x109(%rbp)
je     139b <lru+0x25b>
mov    -0x30(%rbp),%rax
cmpq   $0x0,-0xf0(%rbp,%rax,8)
setne  %al
mov    %al,-0x109(%rbp)
mov    -0x109(%rbp),%al
test   $0x1,%al
jne    13ae <lru+0x26e>
jmp    13c4 <lru+0x284>
jmp    13b3 <lru+0x273>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1349 <lru+0x209>
mov    -0x30(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1401 <lru+0x2c1>
mov    -0x30(%rbp),%rax
mov    -0xf0(%rbp,%rax,8),%rax
ff
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%rdx
cmp    (%rcx,%rdx,8),%rax
jne    13fc <lru+0x2bc>
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    14e3 <lru+0x3a3>
movq   $0x0,-0x30(%rbp)
mov    -0x28(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    148f <lru+0x34f>
mov    -0x28(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x30(%rbp),%rcx
cmp    -0xf0(%rbp,%rcx,8),%rax
ff
je     1463 <lru+0x323>
jmp    1452 <lru+0x312>
mov    -0x38(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x38(%rbp)
jmp    142f <lru+0x2ef>
mov    -0x38(%rbp),%rax
cmp    -0x40(%rbp),%rax
jae    1479 <lru+0x339>
mov    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    147e <lru+0x33e>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1415 <lru+0x2d5>
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    14de <lru+0x39e>
mov    -0x30(%rbp),%rax
mov    -0xf0(%rbp,%rax,8),%rax
ff
mov    -0x18(%rbp),%rcx
mov    -0x40(%rbp),%rdx
cmp    (%rcx,%rdx,8),%rax
jne    14c8 <lru+0x388>
jmp    14de <lru+0x39e>
jmp    14cd <lru+0x38d>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1497 <lru+0x357>
jmp    14e3 <lru+0x3a3>
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,-0xf0(%rbp,%rax,8)
ff
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1567 <lru+0x427>
mov    -0x30(%rbp),%rax
cmpq   $0x0,-0xf0(%rbp,%rax,8)
je     1543 <lru+0x403>
mov    -0x30(%rbp),%rax
mov    -0xf0(%rbp,%rax,8),%rsi
ff
lea    0xb89(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1556 <lru+0x416>
lea    0xb7e(%rip),%rdi
mov    $0x20,%esi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1503 <lru+0x3c3>
jmp    156c <lru+0x42c>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    126a <lru+0x12a>
jmp    1582 <lru+0x442>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
lea    0xac1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movq   $0x0,-0x108(%rbp)
mov    -0x108(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    15e5 <lru+0x4a5>
lea    0xa96(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x108(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x108(%rbp)
jmp    15af <lru+0x46f>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x48(%rbp),%rsi
movq   %rsi,%xmm0
movaps 0xa01(%rip),%xmm3
movaps %xmm3,-0x130(%rbp)
punpckldq %xmm3,%xmm0
movapd 0x9fe(%rip),%xmm2
movaps %xmm2,-0x120(%rbp)
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0x9f0(%rip),%xmm1
movsd  %xmm1,-0x138(%rbp)
ff
mulsd  %xmm1,%xmm0
movq   -0x20(%rbp),%xmm1
punpckldq %xmm3,%xmm1
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
lea    0xa70(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  -0x138(%rbp),%xmm1
ff
movaps -0x130(%rbp),%xmm3
movaps -0x120(%rbp),%xmm2
movq   -0x48(%rbp),%xmm0
punpckldq %xmm3,%xmm0
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm4
unpckhpd %xmm0,%xmm0
addsd  %xmm4,%xmm0
mulsd  %xmm1,%xmm0
movq   -0x20(%rbp),%xmm1
punpckldq %xmm3,%xmm1
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lru>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %rdx,(%rsp)
mov    %rsi,%rbx
mov    %rdi,%r15
test   %rdi,%rdi
je     11e2 <lru+0x92>
lea    0x0(,%r15,8),%rdx
lea    0x20(%rsp),%rdi
xor    %esi,%esi
call   1060 <memset@plt>
lea    0xe9d(%rip),%rdi
call   1040 <puts@plt>
lea    0xeac(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
lea    0xea7(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe98(%rip),%r14
mov    %r15,%rbp
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0xffffffffffffffff,%rbp
jne    11d0 <lru+0x80>
jmp    121c <lru+0xcc>
lea    0xe3f(%rip),%rdi
call   1040 <puts@plt>
lea    0xe4e(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
lea    0xe49(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe3c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r15,%r15
je     1266 <lru+0x116>
mov    $0x1,%ebp
lea    0xe30(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r12,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    %r15,%rbp
jbe    1250 <lru+0x100>
mov    (%rsp),%rax
test   %rax,%rax
je     14aa <lru+0x35a>
mov    %r15,%rbp
and    $0xfffffffffffffffe,%rbp
lea    0xddc(%rip),%r12
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %r14d,%r14d
jmp    12aa <lru+0x15a>
nopl   (%rax)
mov    (%rbx,%r14,8),%rax
mov    %rax,0x20(%rsp)
mov    (%rsp),%rax
add    $0x1,%r14
cmp    %rax,%r14
je     14b1 <lru+0x361>
mov    %rbp,%r13
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
lea    0xd96(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r15,%r15
je     12f0 <lru+0x1a0>
mov    %r15,%rbp
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0xffffffffffffffff,%rbp
jne    12e0 <lru+0x190>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%rbx,%r14,8),%rsi
test   %rsi,%rsi
je     156a <lru+0x41a>
lea    0xda4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r15,%r15
je     1350 <lru+0x200>
mov    (%rbx,%r14,8),%rcx
xor    %eax,%eax
mov    %r13,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x20(%rsp,%rax,8),%rdx
test   %rdx,%rdx
je     1355 <lru+0x205>
cmp    %rcx,%rdx
je     1355 <lru+0x205>
add    $0x1,%rax
cmp    %rax,%r15
jne    1330 <lru+0x1e0>
jmp    135e <lru+0x20e>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
mov    %r13,%rbp
cmp    %r15,%rax
jne    1440 <lru+0x2f0>
test   %r15,%r15
je     1290 <lru+0x140>
lea    -0x1(%r14),%rax
xor    %ecx,%ecx
cmp    $0x1,%r15
je     13de <lru+0x28e>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x20(%rsp,%rcx,8),%rsi
mov    %r14,%rdx
nopl   0x0(%rax,%rax,1)
mov    %rdx,%rdi
add    $0xffffffffffffffff,%rdx
cmp    %rsi,-0x8(%rbx,%rdi,8)
jne    1390 <lru+0x240>
cmp    %rax,%rdx
cmovb  %rdx,%rax
lea    0x0(,%rcx,8),%rdx
or     $0x8,%rdx
mov    0x20(%rsp,%rdx,1),%rsi
mov    %r14,%rdx
nopl   0x0(%rax)
mov    %rdx,%rdi
add    $0xffffffffffffffff,%rdx
cmp    %rsi,-0x8(%rbx,%rdi,8)
jne    13c0 <lru+0x270>
cmp    %rax,%rdx
cmovb  %rdx,%rax
add    $0x2,%rcx
cmp    %rbp,%rcx
jne    1380 <lru+0x230>
test   $0x1,%r15b
je     1405 <lru+0x2b5>
mov    0x20(%rsp,%rcx,8),%rdx
mov    %r14,%rcx
nopl   0x0(%rax)
mov    %rcx,%rsi
add    $0xffffffffffffffff,%rcx
cmp    %rdx,-0x8(%rbx,%rsi,8)
jne    13f0 <lru+0x2a0>
cmp    %rax,%rcx
cmovb  %rcx,%rax
test   %r15,%r15
je     1290 <lru+0x140>
mov    (%rbx,%rax,8),%rcx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    %rcx,0x20(%rsp,%rax,8)
je     1453 <lru+0x303>
add    $0x1,%rax
cmp    %rax,%r15
jne    1420 <lru+0x2d0>
mov    %r15,%rax
jmp    1453 <lru+0x303>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x20(%rsp,%rax,8),%rcx
xor    %edx,%edx
cmp    (%rbx,%r14,8),%rcx
sete   %dl
add    %rdx,0x18(%rsp)
mov    (%rbx,%r14,8),%rcx
mov    %rcx,0x20(%rsp,%rax,8)
test   %r15,%r15
je     1299 <lru+0x149>
xor    %r13d,%r13d
jmp    1490 <lru+0x340>
nopw   0x0(%rax,%rax,1)
lea    0xc51(%rip),%rdi
mov    $0x20,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r13
cmp    %r13,%r15
je     1299 <lru+0x149>
mov    0x20(%rsp,%r13,8),%rsi
test   %rsi,%rsi
je     1470 <lru+0x320>
lea    0xc1f(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1483 <lru+0x333>
xor    %eax,%eax
mov    %rax,0x18(%rsp)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
lea    0xb92(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r15,%r15
je     14f0 <lru+0x3a0>
lea    0xb7e(%rip),%rbx
nop
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0xffffffffffffffff,%r15
jne    14e0 <lru+0x390>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x18(%rsp),%rsi
movq   %rsi,%xmm0
movdqa 0xaf4(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0xaf8(%rip),%xmm2
subpd  %xmm2,%xmm0
movapd %xmm0,%xmm3
unpckhpd %xmm0,%xmm3
addsd  %xmm0,%xmm3
mulsd  0xaf0(%rip),%xmm3
movq   (%rsp),%xmm0
punpckldq %xmm1,%xmm0
subpd  %xmm2,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm3
movapd %xmm3,(%rsp)
lea    0xb76(%rip),%rdi
movapd %xmm3,%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
movaps (%rsp),%xmm0
jmp    158a <lru+0x43a>
mov    0x2a67(%rip),%rax
mov    (%rax),%edi
lea    0xb09(%rip),%rsi
call   1070 <fprintf@plt>
mov    0x2a72(%rip),%rax
movsd  (%rax),%xmm0
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Page Replacement Algorithm\00"
@.str.1 = [26 x i8] c"Least Recently Used (LRU)\00"
@.str.2 = [11 x i8] c"---------+\00"
@.str.3 = [12 x i8] c"----------+\00"
@.str.4 = [12 x i8] c"| Request |\00"
@.str.5 = [14 x i8] c" Frame %2zu |\00"
@stderr = global i32 0
@.str.6 = [47 x i8] c"lru: Segmentation Fault! Page zero requested.\0A\00"
@NAN = global double 0.000000e+00
@.str.7 = [14 x i8] c"| Page %2zu |\00"
@.str.8 = [8 x i8] c" %8zu |\00"
@.str.9 = [7 x i8] c" %8c |\00"
@.str.10 = [39 x i8] c"Cache Hits = %zu\0AHit Ratio = %.2lf%%\0A\00"
define double @lru(i64 %0, i64* %1, i64 %2) {
%4 = alloca double
%5 = alloca i64
%6 = alloca i64*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca [20 x i64]
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
store i64 %0, i64* %5
store i64* %1, i64** %6
store i64 %2, i64* %7
store i64 0, i64* %9
br label %17
17: ; preds = %24, %3
%18 = load i64, i64* %9
%19 = load i64, i64* %5
%20 = icmp ult i64 %18, %19
br i1 %20, label %21, label %27
21: ; preds = %17
%22 = load i64, i64* %9
%23 = getelementptr inbounds [20 x i64], [20 x i64]* %13, i64 0, i64 %22
store i64 0, i64* %23
br label %24
24: ; preds = %21
%25 = load i64, i64* %9
%26 = add i64 %25, 1
store i64 %26, i64* %9
br label %17
27: ; preds = %17
%28 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%29 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
store i64 0, i64* %12
br label %30
30: ; preds = %27
%31 = call i32 @putchar(i8 signext 10)
%32 = call i32 @putchar(i8 signext 43)
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
store i64 0, i64* %14
br label %34
34: ; preds = %40, %30
%35 = load i64, i64* %14
%36 = load i64, i64* %5
%37 = icmp ult i64 %35, %36
br i1 %37, label %38, label %43
38: ; preds = %34
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %40
40: ; preds = %38
%41 = load i64, i64* %14
%42 = add i64 %41, 1
store i64 %42, i64* %14
br label %34
43: ; preds = %34
%44 = call i32 @putchar(i8 signext 10)
br label %45
45: ; preds = %43
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
store i64 1, i64* %9
br label %47
47: ; preds = %54, %45
%48 = load i64, i64* %9
%49 = load i64, i64* %5
%50 = icmp ule i64 %48, %49
br i1 %50, label %51, label %57
51: ; preds = %47
%52 = load i64, i64* %9
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i64 %52)
br label %54
54: ; preds = %51
%55 = load i64, i64* %9
%56 = add i64 %55, 1
store i64 %56, i64* %9
br label %47
57: ; preds = %47
store i64 0, i64* %8
br label %58
58: ; preds = %217, %57
%59 = load i64, i64* %8
%60 = load i64, i64* %7
%61 = icmp ult i64 %59, %60
br i1 %61, label %62, label %220
62: ; preds = %58
br label %63
63: ; preds = %62
%64 = call i32 @putchar(i8 signext 10)
%65 = call i32 @putchar(i8 signext 43)
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
store i64 0, i64* %15
br label %67
67: ; preds = %73, %63
%68 = load i64, i64* %15
%69 = load i64, i64* %5
%70 = icmp ult i64 %68, %69
br i1 %70, label %71, label %76
71: ; preds = %67
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %73
73: ; preds = %71
%74 = load i64, i64* %15
%75 = add i64 %74, 1
store i64 %75, i64* %15
br label %67
76: ; preds = %67
%77 = call i32 @putchar(i8 signext 10)
br label %78
78: ; preds = %76
%79 = load i64*, i64** %6
%80 = load i64, i64* %8
%81 = getelementptr inbounds i64, i64* %79, i64 %80
%82 = load i64, i64* %81
%83 = icmp ne i64 %82, 0
br i1 %83, label %88, label %84
84: ; preds = %78
%85 = load i32, i32* @stderr
%86 = call i32 @fprintf(i32 %85, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0))
%87 = load double, double* @NAN
store double %87, double* %4
br label %251
88: ; preds = %78
%89 = load i64*, i64** %6
%90 = load i64, i64* %8
%91 = getelementptr inbounds i64, i64* %89, i64 %90
%92 = load i64, i64* %91
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i64 %92)
store i64 0, i64* %9
br label %94
94: ; preds = %115, %88
%95 = load i64, i64* %9
%96 = load i64, i64* %5
%97 = icmp ult i64 %95, %96
br i1 %97, label %98, label %112
98: ; preds = %94
%99 = load i64, i64* %9
%100 = getelementptr inbounds [20 x i64], [20 x i64]* %13, i64 0, i64 %99
%101 = load i64, i64* %100
%102 = load i64*, i64** %6
%103 = load i64, i64* %8
%104 = getelementptr inbounds i64, i64* %102, i64 %103
%105 = load i64, i64* %104
%106 = icmp ne i64 %101, %105
br i1 %106, label %107, label %112
107: ; preds = %98
%108 = load i64, i64* %9
%109 = getelementptr inbounds [20 x i64], [20 x i64]* %13, i64 0, i64 %108
%110 = load i64, i64* %109
%111 = icmp ne i64 %110, 0
br label %112
112: ; preds = %107, %98, %94
%113 = phi i1 [ false, %98 ], [ false, %94 ], [ %111, %107 ]
br i1 %113, label %114, label %118
114: ; preds = %112
br label %115
115: ; preds = %114
%116 = load i64, i64* %9
%117 = add i64 %116, 1
store i64 %117, i64* %9
br label %94
118: ; preds = %112
%119 = load i64, i64* %9
%120 = load i64, i64* %5
%121 = icmp ne i64 %119, %120
br i1 %121, label %122, label %135
122: ; preds = %118
%123 = load i64, i64* %9
%124 = getelementptr inbounds [20 x i64], [20 x i64]* %13, i64 0, i64 %123
%125 = load i64, i64* %124
%126 = load i64*, i64** %6
%127 = load i64, i64* %8
%128 = getelementptr inbounds i64, i64* %126, i64 %127
%129 = load i64, i64* %128
%130 = icmp eq i64 %125, %129
br i1 %130, label %131, label %134
131: ; preds = %122
%132 = load i64, i64* %12
%133 = add i64 %132, 1
store i64 %133, i64* %12
br label %134
134: ; preds = %131, %122
br label %188
135: ; preds = %118
store i64 0, i64* %9
%136 = load i64, i64* %8
%137 = sub i64 %136, 1
store i64 %137, i64* %11
br label %138
138: ; preds = %165, %135
%139 = load i64, i64* %9
%140 = load i64, i64* %5
%141 = icmp ult i64 %139, %140
br i1 %141, label %142, label %168
142: ; preds = %138
%143 = load i64, i64* %8
%144 = sub i64 %143, 1
store i64 %144, i64* %10
br label %145
145: ; preds = %155, %142
%146 = load i64*, i64** %6
%147 = load i64, i64* %10
%148 = getelementptr inbounds i64, i64* %146, i64 %147
%149 = load i64, i64* %148
%150 = load i64, i64* %9
%151 = getelementptr inbounds [20 x i64], [20 x i64]* %13, i64 0, i64 %150
%152 = load i64, i64* %151
%153 = icmp ne i64 %149, %152
br i1 %153, label %154, label %158
154: ; preds = %145
br label %155
155: ; preds = %154
%156 = load i64, i64* %10
%157 = add i64 %156, -1
store i64 %157, i64* %10
br label %145
158: ; preds = %145
%159 = load i64, i64* %10
%160 = load i64, i64* %11
%161 = icmp ult i64 %159, %160
br i1 %161, label %162, label %164
162: ; preds = %158
%163 = load i64, i64* %10
store i64 %163, i64* %11
br label %164
164: ; preds = %162, %158
br label %165
165: ; preds = %164
%166 = load i64, i64* %9
%167 = add i64 %166, 1
store i64 %167, i64* %9
br label %138
168: ; preds = %138
store i64 0, i64* %9
br label %169
169: ; preds = %184, %168
%170 = load i64, i64* %9
%171 = load i64, i64* %5
%172 = icmp ult i64 %170, %171
br i1 %172, label %173, label %187
173: ; preds = %169
%174 = load i64, i64* %9
%175 = getelementptr inbounds [20 x i64], [20 x i64]* %13, i64 0, i64 %174
%176 = load i64, i64* %175
%177 = load i64*, i64** %6
%178 = load i64, i64* %11
%179 = getelementptr inbounds i64, i64* %177, i64 %178
%180 = load i64, i64* %179
%181 = icmp eq i64 %176, %180
br i1 %181, label %182, label %183
182: ; preds = %173
br label %187
183: ; preds = %173
br label %184
184: ; preds = %183
%185 = load i64, i64* %9
%186 = add i64 %185, 1
store i64 %186, i64* %9
br label %169
187: ; preds = %182, %169
br label %188
188: ; preds = %187, %134
%189 = load i64*, i64** %6
%190 = load i64, i64* %8
%191 = getelementptr inbounds i64, i64* %189, i64 %190
%192 = load i64, i64* %191
%193 = load i64, i64* %9
%194 = getelementptr inbounds [20 x i64], [20 x i64]* %13, i64 0, i64 %193
store i64 %192, i64* %194
store i64 0, i64* %9
br label %195
195: ; preds = %213, %188
%196 = load i64, i64* %9
%197 = load i64, i64* %5
%198 = icmp ult i64 %196, %197
br i1 %198, label %199, label %216
199: ; preds = %195
%200 = load i64, i64* %9
%201 = getelementptr inbounds [20 x i64], [20 x i64]* %13, i64 0, i64 %200
%202 = load i64, i64* %201
%203 = icmp ne i64 %202, 0
br i1 %203, label %204, label %209
204: ; preds = %199
%205 = load i64, i64* %9
%206 = getelementptr inbounds [20 x i64], [20 x i64]* %13, i64 0, i64 %205
%207 = load i64, i64* %206
%208 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i64 %207)
br label %211
209: ; preds = %199
%210 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 32)
br label %211
211: ; preds = %209, %204
%212 = phi i32 [ %208, %204 ], [ %210, %209 ]
br label %213
213: ; preds = %211
%214 = load i64, i64* %9
%215 = add i64 %214, 1
store i64 %215, i64* %9
br label %195
216: ; preds = %195
br label %217
217: ; preds = %216
%218 = load i64, i64* %8
%219 = add i64 %218, 1
store i64 %219, i64* %8
br label %58
220: ; preds = %58
br label %221
221: ; preds = %220
%222 = call i32 @putchar(i8 signext 10)
%223 = call i32 @putchar(i8 signext 43)
%224 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
store i64 0, i64* %16
br label %225
225: ; preds = %231, %221
%226 = load i64, i64* %16
%227 = load i64, i64* %5
%228 = icmp ult i64 %226, %227
br i1 %228, label %229, label %234
229: ; preds = %225
%230 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %231
231: ; preds = %229
%232 = load i64, i64* %16
%233 = add i64 %232, 1
store i64 %233, i64* %16
br label %225
234: ; preds = %225
%235 = call i32 @putchar(i8 signext 10)
br label %236
236: ; preds = %234
%237 = load i64, i64* %12
%238 = load i64, i64* %12
%239 = uitofp i64 %238 to double
%240 = fmul double 1.000000e+02, %239
%241 = load i64, i64* %7
%242 = uitofp i64 %241 to double
%243 = fdiv double %240, %242
%244 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.10, i64 0, i64 0), i64 %237, double %243)
%245 = load i64, i64* %12
%246 = uitofp i64 %245 to double
%247 = fmul double 1.000000e+02, %246
%248 = load i64, i64* %7
%249 = uitofp i64 %248 to double
%250 = fdiv double %247, %249
store double %250, double* %4
br label %251
251: ; preds = %236, %84
%252 = load double, double* %4
ret double %252
}

LLVM IR (-O2):
@.str = [27 x i8] c"Page Replacement Algorithm\00"
@.str.1 = [26 x i8] c"Least Recently Used (LRU)\00"
@.str.2 = [11 x i8] c"---------+\00"
@.str.3 = [12 x i8] c"----------+\00"
@.str.4 = [12 x i8] c"| Request |\00"
@.str.5 = [14 x i8] c" Frame %2zu |\00"
@stderr = global i32 0
@.str.6 = [47 x i8] c"lru: Segmentation Fault! Page zero requested.\0A\00"
@NAN = global double 0.000000e+00
@.str.7 = [14 x i8] c"| Page %2zu |\00"
@.str.8 = [8 x i8] c" %8zu |\00"
@.str.9 = [7 x i8] c" %8c |\00"
@.str.10 = [39 x i8] c"Cache Hits = %zu\0AHit Ratio = %.2lf%%\0A\00"
define double @lru(i64 %0, i64* nocapture %1, i64 %2) {
%4 = alloca [20 x i64]
%5 = bitcast [20 x i64]* %4 to i8*
%6 = icmp eq i64 %0, 0
br i1 %6, label %19, label %7
7: ; preds = %3
%8 = shl nuw i64 %0, 3
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i32 @putchar(i8 signext 10)
%12 = tail call i32 @putchar(i8 signext 43)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %7, %14
%15 = phi i64 [ %17, %14 ], [ 0, %7 ]
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%17 = add nuw i64 %15, 1
%18 = icmp eq i64 %17, %0
br i1 %18, label %25, label %14
19: ; preds = %3
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%22 = tail call i32 @putchar(i8 signext 10)
%23 = tail call i32 @putchar(i8 signext 43)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %25
25: ; preds = %14, %19
%26 = tail call i32 @putchar(i8 signext 10)
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
br i1 %6, label %28, label %36
28: ; preds = %36, %25
%29 = icmp eq i64 %2, 0
br i1 %29, label %170, label %30
30: ; preds = %28
%31 = getelementptr inbounds [20 x i64], [20 x i64]* %4, i64 0, i64 0
%32 = and i64 %0, 1
%33 = icmp eq i64 %0, 1
%34 = and i64 %0, -2
%35 = icmp eq i64 %32, 0
br label %41
36: ; preds = %25, %36
%37 = phi i64 [ %39, %36 ], [ 1, %25 ]
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i64 %37)
%39 = add i64 %37, 1
%40 = icmp ugt i64 %39, %0
br i1 %40, label %28, label %36
41: ; preds = %30, %166
%42 = phi i64 [ 0, %30 ], [ %167, %166 ]
%43 = phi i64 [ 0, %30 ], [ %168, %166 ]
%44 = tail call i32 @putchar(i8 signext 10)
%45 = tail call i32 @putchar(i8 signext 43)
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br i1 %6, label %52, label %47
47: ; preds = %41, %47
%48 = phi i64 [ %50, %47 ], [ 0, %41 ]
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%50 = add nuw i64 %48, 1
%51 = icmp eq i64 %50, %0
br i1 %51, label %52, label %47
52: ; preds = %47, %41
%53 = tail call i32 @putchar(i8 signext 10)
%54 = getelementptr inbounds i64, i64* %1, i64 %43
%55 = load i64, i64* %54
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %61
57: ; preds = %52
%58 = load i32, i32* @stderr
%59 = tail call i32 @fprintf(i32 %58, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0))
%60 = load double, double* @NAN
br label %187
61: ; preds = %52
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i64 %55)
br i1 %6, label %75, label %63
63: ; preds = %61
%64 = load i64, i64* %54
br label %65
65: ; preds = %63, %72
%66 = phi i64 [ 0, %63 ], [ %73, %72 ]
%67 = getelementptr inbounds [20 x i64], [20 x i64]* %4, i64 0, i64 %66
%68 = load i64, i64* %67
%69 = icmp eq i64 %68, %64
%70 = icmp eq i64 %68, 0
%71 = or i1 %70, %69
br i1 %71, label %75, label %72
72: ; preds = %65
%73 = add nuw i64 %66, 1
%74 = icmp eq i64 %73, %0
br i1 %74, label %85, label %65
75: ; preds = %65, %61
%76 = phi i64 [ 0, %61 ], [ %66, %65 ]
%77 = icmp eq i64 %76, %0
br i1 %77, label %85, label %78
78: ; preds = %75
%79 = getelementptr inbounds [20 x i64], [20 x i64]* %4, i64 0, i64 %76
%80 = load i64, i64* %79
%81 = load i64, i64* %54
%82 = icmp eq i64 %80, %81
%83 = zext i1 %82 to i64
%84 = add i64 %42, %83
br label %149
85: ; preds = %72, %75
%86 = add i64 %43, -1
br i1 %6, label %147, label %87
87: ; preds = %85
br i1 %33, label %88, label %109
88: ; preds = %133, %87
%89 = phi i64 [ undef, %87 ], [ %135, %133 ]
%90 = phi i64 [ %86, %87 ], [ %135, %133 ]
%91 = phi i64 [ 0, %87 ], [ %136, %133 ]
br i1 %35, label %104, label %92
92: ; preds = %88
%93 = getelementptr inbounds [20 x i64], [20 x i64]* %4, i64 0, i64 %91
%94 = load i64, i64* %93
br label %95
95: ; preds = %95, %92
%96 = phi i64 [ %100, %95 ], [ %86, %92 ]
%97 = getelementptr inbounds i64, i64* %1, i64 %96
%98 = load i64, i64* %97
%99 = icmp eq i64 %98, %94
%100 = add i64 %96, -1
br i1 %99, label %101, label %95
101: ; preds = %95
%102 = icmp ult i64 %96, %90
%103 = select i1 %102, i64 %96, i64 %90
br label %104
104: ; preds = %88, %101
%105 = phi i64 [ %89, %88 ], [ %103, %101 ]
br i1 %6, label %147, label %106
106: ; preds = %104
%107 = getelementptr inbounds i64, i64* %1, i64 %105
%108 = load i64, i64* %107
br label %139
109: ; preds = %87, %133
%110 = phi i64 [ %135, %133 ], [ %86, %87 ]
%111 = phi i64 [ %136, %133 ], [ 0, %87 ]
%112 = phi i64 [ %137, %133 ], [ 0, %87 ]
%113 = getelementptr inbounds [20 x i64], [20 x i64]* %4, i64 0, i64 %111
%114 = load i64, i64* %113
br label %115
115: ; preds = %115, %109
%116 = phi i64 [ %120, %115 ], [ %86, %109 ]
%117 = getelementptr inbounds i64, i64* %1, i64 %116
%118 = load i64, i64* %117
%119 = icmp eq i64 %118, %114
%120 = add i64 %116, -1
br i1 %119, label %121, label %115
121: ; preds = %115
%122 = icmp ult i64 %116, %110
%123 = select i1 %122, i64 %116, i64 %110
%124 = or i64 %111, 1
%125 = getelementptr inbounds [20 x i64], [20 x i64]* %4, i64 0, i64 %124
%126 = load i64, i64* %125
br label %127
127: ; preds = %127, %121
%128 = phi i64 [ %132, %127 ], [ %86, %121 ]
%129 = getelementptr inbounds i64, i64* %1, i64 %128
%130 = load i64, i64* %129
%131 = icmp eq i64 %130, %126
%132 = add i64 %128, -1
br i1 %131, label %133, label %127
133: ; preds = %127
%134 = icmp ult i64 %128, %123
%135 = select i1 %134, i64 %128, i64 %123
%136 = add nuw i64 %111, 2
%137 = add i64 %112, 2
%138 = icmp eq i64 %137, %34
br i1 %138, label %88, label %109
139: ; preds = %106, %144
%140 = phi i64 [ 0, %106 ], [ %145, %144 ]
%141 = getelementptr inbounds [20 x i64], [20 x i64]* %4, i64 0, i64 %140
%142 = load i64, i64* %141
%143 = icmp eq i64 %142, %108
br i1 %143, label %149, label %144
144: ; preds = %139
%145 = add nuw i64 %140, 1
%146 = icmp eq i64 %145, %0
br i1 %146, label %149, label %139
147: ; preds = %104, %85
%148 = load i64, i64* %54
store i64 %148, i64* %31
br label %166
149: ; preds = %139, %144, %78
%150 = phi i64 [ %76, %78 ], [ %140, %139 ], [ %0, %144 ]
%151 = phi i64 [ %84, %78 ], [ %42, %144 ], [ %42, %139 ]
%152 = load i64, i64* %54
%153 = getelementptr inbounds [20 x i64], [20 x i64]* %4, i64 0, i64 %150
store i64 %152, i64* %153
br i1 %6, label %166, label %154
154: ; preds = %149, %163
%155 = phi i64 [ %164, %163 ], [ 0, %149 ]
%156 = getelementptr inbounds [20 x i64], [20 x i64]* %4, i64 0, i64 %155
%157 = load i64, i64* %156
%158 = icmp eq i64 %157, 0
br i1 %158, label %161, label %159
159: ; preds = %154
%160 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i64 %157)
br label %163
161: ; preds = %154
%162 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 32)
br label %163
163: ; preds = %159, %161
%164 = add nuw i64 %155, 1
%165 = icmp eq i64 %164, %0
br i1 %165, label %166, label %154
166: ; preds = %163, %147, %149
%167 = phi i64 [ %42, %147 ], [ %151, %149 ], [ %151, %163 ]
%168 = add nuw i64 %43, 1
%169 = icmp eq i64 %168, %2
br i1 %169, label %170, label %41
170: ; preds = %166, %28
%171 = phi i64 [ 0, %28 ], [ %167, %166 ]
%172 = tail call i32 @putchar(i8 signext 10)
%173 = tail call i32 @putchar(i8 signext 43)
%174 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br i1 %6, label %180, label %175
175: ; preds = %170, %175
%176 = phi i64 [ %178, %175 ], [ 0, %170 ]
%177 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%178 = add nuw i64 %176, 1
%179 = icmp eq i64 %178, %0
br i1 %179, label %180, label %175
180: ; preds = %175, %170
%181 = tail call i32 @putchar(i8 signext 10)
%182 = uitofp i64 %171 to double
%183 = fmul double %182, 1.000000e+02
%184 = uitofp i64 %2 to double
%185 = fdiv double %183, %184
%186 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.10, i64 0, i64 0), i64 %171, double %185)
br label %187
187: ; preds = %180, %57
%188 = phi double [ %60, %57 ], [ %185, %180 ]
ret double %188
}