#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 INT_MAX;
unsigned int UINT_MAX;
scalar_t__ calloc(unsigned int const, int);
double log2(int volatile);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ update_fps();
int main(int argn, char **argv) {
  const unsigned int iLoop = 1 << 24;
  const unsigned int outLoop = 1 << 15;
  const unsigned int arrLen = 1 << 10;
  unsigned int a = UINT_MAX;
  volatile int b = INT_MAX;
  unsigned long long c = ~0;
  long long d = ~0 >> 1;
  unsigned int *arrUI = (unsigned int *)calloc(arrLen, sizeof(unsigned int));
  unsigned long long *arrULL =
      (unsigned long long *)calloc(arrLen, sizeof(unsigned long long));
  printf("unsigned int: %u %f\n", a, log2(a));
  printf("int: %i %f\n", b, log2(b));
  printf("unsigned long long: %llu %f\n", c, log2(c));
  printf("long long: %lli %f\n", d, log2(d));
  if (argn > 1 && argv[1][0] == '6') {
    printf("\nTest long long speed for array (no simple register store)\n");
    int pos = 0;
    unsigned int o = outLoop;
    while (--o) {
      unsigned int i = iLoop;
      while (--i) {
        pos = (pos + 1234567) % arrLen;
        arrULL[pos] += pos;
        ;
      }
      update_fps();
    }
  } else if (argn > 1 && argv[1][0] == '5') {
    printf("\nTest unsigned int for array (no simple register store)\n");
    int pos = 0;
    unsigned int o = outLoop;
    while (--o) {
      unsigned int i = iLoop;
      while (--i) {
        pos = (pos + 1234567) % arrLen;
        arrUI[pos] += pos;
        ;
      }
      update_fps();
    }
  } else if (argn > 1 && argv[1][0] == '4') {
    printf("\nTest long long speed\n");
    unsigned int o = outLoop;
    while (--o) {
      unsigned int i = iLoop;
      while (--i) {
        d += d;
        ;
      }
      update_fps();
    }
  } else if (argn > 1 && argv[1][0] == '3') {
    printf("\nTest unsigned long long speed\n");
    unsigned int o = outLoop;
    while (--o) {
      unsigned int i = iLoop;
      while (--i) {
        c += c;
        ;
      }
      update_fps();
    }
  } else if (argn > 1 && argv[1][0] == '2') {
    printf("\nTest long (=int) speed. Variable marked volatile\n");
    unsigned int o = outLoop;
    while (--o) {
      unsigned int i = iLoop;
      while (--i) {
        b += b;
        ;
      }
      update_fps();
    }
  } else {
    printf("\nTest unsigned long (=uint) speed\n");
    unsigned int o = outLoop;
    while (--o) {
      unsigned int i = iLoop;
      while (--i) {
        a += a;
        ;
      }
      update_fps();
    }
  }
  printf("Output to prevent optimizations. %u %i %u %i\n", a, b, c, d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1000000,-0x14(%rbp)
movl   $0x8000,-0x18(%rbp)
movl   $0x400,-0x1c(%rbp)
mov    0x2e6b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    0x2e67(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
movq   $0xffffffffffffffff,-0x30(%rbp)
ff
movq   $0xffffffffffffffff,-0x38(%rbp)
ff
mov    $0x400,%edi
mov    $0x4,%esi
call   1050 <calloc@plt>
mov    %rax,-0x40(%rbp)
mov    $0x400,%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x98(%rbp)
mov    -0x20(%rbp),%edi
call   1030 <log2@plt>
mov    -0x98(%rbp),%esi
lea    0xe26(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x94(%rbp)
mov    -0x24(%rbp),%edi
call   1030 <log2@plt>
mov    -0x94(%rbp),%esi
lea    0xe16(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x30(%rbp),%rax
mov    %eax,%edi
call   1030 <log2@plt>
mov    -0x90(%rbp),%rsi
lea    0xdf7(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x38(%rbp),%rax
mov    %eax,%edi
call   1030 <log2@plt>
mov    -0x88(%rbp),%rsi
lea    0xde9(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
jle    12fb <main+0x1bb>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x36,%eax
jne    12fb <main+0x1bb>
lea    0xdd1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4c(%rbp)
movl   $0x8000,-0x50(%rbp)
mov    -0x50(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x50(%rbp)
cmp    $0x0,%eax
je     12f6 <main+0x1b6>
movl   $0x1000000,-0x54(%rbp)
mov    -0x54(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x54(%rbp)
cmp    $0x0,%eax
je     12ea <main+0x1aa>
mov    -0x4c(%rbp),%eax
add    $0x12d687,%eax
and    $0x3ff,%eax
mov    %eax,-0x4c(%rbp)
movslq -0x4c(%rbp),%rdx
mov    -0x48(%rbp),%rax
movslq -0x4c(%rbp),%rcx
add    (%rax,%rcx,8),%rdx
mov    %rdx,(%rax,%rcx,8)
jmp    12af <main+0x16f>
mov    $0x0,%al
call   1060 <update_fps@plt>
jmp    1296 <main+0x156>
jmp    1589 <main+0x449>
cmpl   $0x1,-0x8(%rbp)
jle    1397 <main+0x257>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x35,%eax
jne    1397 <main+0x257>
lea    0xd6e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x58(%rbp)
movl   $0x8000,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x5c(%rbp)
cmp    $0x0,%eax
je     1392 <main+0x252>
movl   $0x1000000,-0x60(%rbp)
mov    -0x60(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x60(%rbp)
cmp    $0x0,%eax
je     1386 <main+0x246>
mov    -0x58(%rbp),%eax
add    $0x12d687,%eax
and    $0x3ff,%eax
mov    %eax,-0x58(%rbp)
mov    -0x58(%rbp),%edx
mov    -0x40(%rbp),%rax
movslq -0x58(%rbp),%rcx
add    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
jmp    134e <main+0x20e>
mov    $0x0,%al
call   1060 <update_fps@plt>
jmp    1335 <main+0x1f5>
jmp    1584 <main+0x444>
cmpl   $0x1,-0x8(%rbp)
jle    1417 <main+0x2d7>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x34,%eax
jne    1417 <main+0x2d7>
lea    0xd0b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x8000,-0x64(%rbp)
mov    -0x64(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x64(%rbp)
cmp    $0x0,%eax
je     1412 <main+0x2d2>
movl   $0x1000000,-0x68(%rbp)
mov    -0x68(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x68(%rbp)
cmp    $0x0,%eax
je     1406 <main+0x2c6>
mov    -0x38(%rbp),%rax
add    -0x38(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    13e3 <main+0x2a3>
mov    $0x0,%al
call   1060 <update_fps@plt>
jmp    13ca <main+0x28a>
jmp    157f <main+0x43f>
cmpl   $0x1,-0x8(%rbp)
jle    1497 <main+0x357>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x33,%eax
jne    1497 <main+0x357>
lea    0xca2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x8000,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x6c(%rbp)
cmp    $0x0,%eax
je     1492 <main+0x352>
movl   $0x1000000,-0x70(%rbp)
mov    -0x70(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x70(%rbp)
cmp    $0x0,%eax
je     1486 <main+0x346>
mov    -0x30(%rbp),%rax
add    -0x30(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1463 <main+0x323>
mov    $0x0,%al
call   1060 <update_fps@plt>
jmp    144a <main+0x30a>
jmp    157a <main+0x43a>
cmpl   $0x1,-0x8(%rbp)
jle    1516 <main+0x3d6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x32,%eax
jne    1516 <main+0x3d6>
lea    0xc42(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x8000,-0x74(%rbp)
mov    -0x74(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x74(%rbp)
cmp    $0x0,%eax
je     1511 <main+0x3d1>
movl   $0x1000000,-0x78(%rbp)
mov    -0x78(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x78(%rbp)
cmp    $0x0,%eax
je     1505 <main+0x3c5>
mov    -0x24(%rbp),%ecx
mov    -0x24(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x24(%rbp)
jmp    14e3 <main+0x3a3>
mov    $0x0,%al
call   1060 <update_fps@plt>
jmp    14ca <main+0x38a>
jmp    1575 <main+0x435>
lea    0xc14(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x8000,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x7c(%rbp)
cmp    $0x0,%eax
je     1570 <main+0x430>
movl   $0x1000000,-0x80(%rbp)
mov    -0x80(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x80(%rbp)
cmp    $0x0,%eax
je     1564 <main+0x424>
mov    -0x20(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1544 <main+0x404>
mov    $0x0,%al
call   1060 <update_fps@plt>
jmp    152b <main+0x3eb>
jmp    1575 <main+0x435>
jmp    157a <main+0x43a>
jmp    157f <main+0x43f>
jmp    1584 <main+0x444>
jmp    1589 <main+0x449>
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%r8
lea    0xbb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
mov    %edi,%r13d
mov    0x2e78(%rip),%rax
mov    (%rax),%ebx
mov    0x2e77(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    $0x400,%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,%r14
mov    $0x400,%edi
mov    $0x8,%esi
call   1060 <calloc@plt>
mov    %rax,%r15
mov    %ebx,%edi
call   1030 <log2@plt>
lea    0xe6b(%rip),%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x4(%rsp),%ebp
mov    0x4(%rsp),%edi
call   1030 <log2@plt>
lea    0xe63(%rip),%rdi
mov    %ebp,%esi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   1030 <log2@plt>
lea    0xe55(%rip),%rdi
mov    $0xffffffffffffffff,%rsi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   1030 <log2@plt>
lea    0xe53(%rip),%rdi
mov    $0xffffffffffffffff,%rsi
mov    $0x1,%al
call   1050 <printf@plt>
cmp    $0x2,%r13d
jl     129b <main+0x14b>
mov    0x8(%r12),%rax
mov    (%rax),%al
add    $0xce,%al
cmp    $0x4,%al
ja     129b <main+0x14b>
movzbl %al,%eax
lea    0xdd2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe78(%rip),%rdi
call   1040 <puts@plt>
mov    $0x7fff,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0xff000001,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x4(%rsp),%ecx
add    %ecx,0x4(%rsp)
mov    0x4(%rsp),%ecx
add    %ecx,0x4(%rsp)
mov    0x4(%rsp),%ecx
add    %ecx,0x4(%rsp)
mov    0x4(%rsp),%ecx
add    %ecx,0x4(%rsp)
mov    0x4(%rsp),%ecx
add    %ecx,0x4(%rsp)
add    $0x5,%eax
jne    1260 <main+0x110>
xor    %eax,%eax
call   1070 <update_fps@plt>
add    $0xffffffff,%ebp
jne    1250 <main+0x100>
jmp    12d9 <main+0x189>
lea    0xdf2(%rip),%rdi
call   1040 <puts@plt>
mov    $0x7fff,%ebp
nopl   0x0(%rax)
mov    $0xff000000,%eax
mov    %ebx,%ecx
nopw   0x0(%rax,%rax,1)
mov    %ecx,%ebx
shl    $0x8,%ecx
add    $0x8,%eax
jne    12c0 <main+0x170>
shl    $0x7,%ebx
xor    %eax,%eax
call   1070 <update_fps@plt>
add    $0xffffffff,%ebp
jne    12b0 <main+0x160>
mov    $0xffffffffffffffff,%r14
mov    $0xffffffffffffffff,%rbp
mov    0x4(%rsp),%edx
lea    0xd74(%rip),%rdi
mov    %ebx,%esi
mov    %rbp,%rcx
mov    %r14,%r8
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdcf(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffffffffffff,%rbp
mov    $0x7fff,%r14d
nopl   0x0(%rax,%rax,1)
mov    $0xff000000,%eax
mov    %rbp,%rcx
nopl   0x0(%rax,%rax,1)
mov    %rcx,%rbp
shl    $0x8,%rcx
add    $0x8,%eax
jne    1340 <main+0x1f0>
shl    $0x7,%rbp
xor    %eax,%eax
call   1070 <update_fps@plt>
add    $0xffffffff,%r14d
jne    1330 <main+0x1e0>
mov    $0xffffffffffffffff,%r14
jmp    12e7 <main+0x197>
lea    0xd9a(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffffffffffff,%r14
mov    $0x7fff,%ebp
xchg   %ax,%ax
mov    $0xff000000,%eax
mov    %r14,%rcx
nopl   0x0(%rax,%rax,1)
mov    %rcx,%r14
shl    $0x8,%rcx
add    $0x8,%eax
jne    1390 <main+0x240>
shl    $0x7,%r14
xor    %eax,%eax
call   1070 <update_fps@plt>
add    $0xffffffff,%ebp
jne    1380 <main+0x230>
jmp    12e0 <main+0x190>
lea    0xd65(%rip),%rdi
call   1040 <puts@plt>
mov    $0x7fff,%r15d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xff000001,%eax
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x287(%rbp),%ecx
and    $0x3ff,%ecx
add    %ecx,(%r14,%rcx,4)
lea    0x10e(%rbp),%ecx
and    $0x3ff,%ecx
add    %ecx,(%r14,%rcx,4)
add    $0x395,%ebp
and    $0x3ff,%ebp
add    %ebp,(%r14,%rbp,4)
add    $0x3,%eax
jne    13e0 <main+0x290>
xor    %eax,%eax
call   1070 <update_fps@plt>
add    $0xffffffff,%r15d
jne    13d0 <main+0x280>
jmp    12d9 <main+0x189>
lea    0xd27(%rip),%rdi
call   1040 <puts@plt>
mov    $0x7fff,%r14d
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0xff000001,%eax
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x287(%rbp),%ecx
and    $0x3ff,%ecx
add    %rcx,(%r15,%rcx,8)
lea    0x10e(%rbp),%ecx
and    $0x3ff,%ecx
add    %rcx,(%r15,%rcx,8)
add    $0x395,%ebp
and    $0x3ff,%ebp
add    %rbp,(%r15,%rbp,8)
add    $0x3,%eax
jne    1450 <main+0x300>
xor    %eax,%eax
call   1070 <update_fps@plt>
add    $0xffffffff,%r14d
jne    1440 <main+0x2f0>
jmp    12d9 <main+0x189>

LLVM IR (-O0):
@UINT_MAX = global i32 0
@INT_MAX = global i32 0
@.str = [21 x i8] c"unsigned int: %u %f\0A\00"
@.str.1 = [12 x i8] c"int: %i %f\0A\00"
@.str.2 = [29 x i8] c"unsigned long long: %llu %f\0A\00"
@.str.3 = [20 x i8] c"long long: %lli %f\0A\00"
@.str.4 = [60 x i8] c"\0ATest long long speed for array (no simple register store)\0A\00"
@.str.5 = [57 x i8] c"\0ATest unsigned int for array (no simple register store)\0A\00"
@.str.6 = [23 x i8] c"\0ATest long long speed\0A\00"
@.str.7 = [32 x i8] c"\0ATest unsigned long long speed\0A\00"
@.str.8 = [51 x i8] c"\0ATest long (=int) speed. Variable marked volatile\0A\00"
@.str.9 = [35 x i8] c"\0ATest unsigned long (=uint) speed\0A\00"
@.str.10 = [46 x i8] c"Output to prevent optimizations. %u %i %u %i\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i64
%12 = alloca i64
%13 = alloca i32*
%14 = alloca i64*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 16777216, i32* %6
store i32 32768, i32* %7
store i32 1024, i32* %8
%29 = load i32, i32* @UINT_MAX
store i32 %29, i32* %9
%30 = load i32, i32* @INT_MAX
store volatile i32 %30, i32* %10
store i64 -1, i64* %11
store i64 -1, i64* %12
%31 = call i64 @calloc(i32 1024, i32 4)
%32 = inttoptr i64 %31 to i32*
store i32* %32, i32** %13
%33 = call i64 @calloc(i32 1024, i32 8)
%34 = inttoptr i64 %33 to i64*
store i64* %34, i64** %14
%35 = load i32, i32* %9
%36 = load i32, i32* %9
%37 = call double @log2(i32 %36)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %35, double %37)
%39 = load volatile i32, i32* %10
%40 = load volatile i32, i32* %10
%41 = call double @log2(i32 %40)
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %39, double %41)
%43 = load i64, i64* %11
%44 = load i64, i64* %11
%45 = trunc i64 %44 to i32
%46 = call double @log2(i32 %45)
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i64 %43, double %46)
%48 = load i64, i64* %12
%49 = load i64, i64* %12
%50 = trunc i64 %49 to i32
%51 = call double @log2(i32 %50)
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i64 %48, double %51)
%53 = load i32, i32* %4
%54 = icmp sgt i32 %53, 1
br i1 %54, label %55, label %89
55: ; preds = %2
%56 = load i8**, i8*** %5
%57 = getelementptr inbounds i8*, i8** %56, i64 1
%58 = load i8*, i8** %57
%59 = getelementptr inbounds i8, i8* %58, i64 0
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = icmp eq i32 %61, 54
br i1 %62, label %63, label %89
63: ; preds = %55
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %15
store i32 32768, i32* %16
br label %65
65: ; preds = %86, %63
%66 = load i32, i32* %16
%67 = add i32 %66, -1
store i32 %67, i32* %16
%68 = icmp ne i32 %67, 0
br i1 %68, label %69, label %88
69: ; preds = %65
store i32 16777216, i32* %17
br label %70
70: ; preds = %74, %69
%71 = load i32, i32* %17
%72 = add i32 %71, -1
store i32 %72, i32* %17
%73 = icmp ne i32 %72, 0
br i1 %73, label %74, label %86
74: ; preds = %70
%75 = load i32, i32* %15
%76 = add nsw i32 %75, 1234567
%77 = urem i32 %76, 1024
store i32 %77, i32* %15
%78 = load i32, i32* %15
%79 = sext i32 %78 to i64
%80 = load i64*, i64** %14
%81 = load i32, i32* %15
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i64, i64* %80, i64 %82
%84 = load i64, i64* %83
%85 = add i64 %84, %79
store i64 %85, i64* %83
br label %70
86: ; preds = %70
%87 = call i32 (...) @update_fps()
br label %65
88: ; preds = %65
br label %234
89: ; preds = %55, %2
%90 = load i32, i32* %4
%91 = icmp sgt i32 %90, 1
br i1 %91, label %92, label %125
92: ; preds = %89
%93 = load i8**, i8*** %5
%94 = getelementptr inbounds i8*, i8** %93, i64 1
%95 = load i8*, i8** %94
%96 = getelementptr inbounds i8, i8* %95, i64 0
%97 = load i8, i8* %96
%98 = sext i8 %97 to i32
%99 = icmp eq i32 %98, 53
br i1 %99, label %100, label %125
100: ; preds = %92
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %18
store i32 32768, i32* %19
br label %102
102: ; preds = %122, %100
%103 = load i32, i32* %19
%104 = add i32 %103, -1
store i32 %104, i32* %19
%105 = icmp ne i32 %104, 0
br i1 %105, label %106, label %124
106: ; preds = %102
store i32 16777216, i32* %20
br label %107
107: ; preds = %111, %106
%108 = load i32, i32* %20
%109 = add i32 %108, -1
store i32 %109, i32* %20
%110 = icmp ne i32 %109, 0
br i1 %110, label %111, label %122
111: ; preds = %107
%112 = load i32, i32* %18
%113 = add nsw i32 %112, 1234567
%114 = urem i32 %113, 1024
store i32 %114, i32* %18
%115 = load i32, i32* %18
%116 = load i32*, i32** %13
%117 = load i32, i32* %18
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds i32, i32* %116, i64 %118
%120 = load i32, i32* %119
%121 = add i32 %120, %115
store i32 %121, i32* %119
br label %107
122: ; preds = %107
%123 = call i32 (...) @update_fps()
br label %102
124: ; preds = %102
br label %233
125: ; preds = %92, %89
%126 = load i32, i32* %4
%127 = icmp sgt i32 %126, 1
br i1 %127, label %128, label %154
128: ; preds = %125
%129 = load i8**, i8*** %5
%130 = getelementptr inbounds i8*, i8** %129, i64 1
%131 = load i8*, i8** %130
%132 = getelementptr inbounds i8, i8* %131, i64 0
%133 = load i8, i8* %132
%134 = sext i8 %133 to i32
%135 = icmp eq i32 %134, 52
br i1 %135, label %136, label %154
136: ; preds = %128
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
store i32 32768, i32* %21
br label %138
138: ; preds = %151, %136
%139 = load i32, i32* %21
%140 = add i32 %139, -1
store i32 %140, i32* %21
%141 = icmp ne i32 %140, 0
br i1 %141, label %142, label %153
142: ; preds = %138
store i32 16777216, i32* %22
br label %143
143: ; preds = %147, %142
%144 = load i32, i32* %22
%145 = add i32 %144, -1
store i32 %145, i32* %22
%146 = icmp ne i32 %145, 0
br i1 %146, label %147, label %151
147: ; preds = %143
%148 = load i64, i64* %12
%149 = load i64, i64* %12
%150 = add nsw i64 %149, %148
store i64 %150, i64* %12
br label %143
151: ; preds = %143
%152 = call i32 (...) @update_fps()
br label %138
153: ; preds = %138
br label %232
154: ; preds = %128, %125
%155 = load i32, i32* %4
%156 = icmp sgt i32 %155, 1
br i1 %156, label %157, label %183
157: ; preds = %154
%158 = load i8**, i8*** %5
%159 = getelementptr inbounds i8*, i8** %158, i64 1
%160 = load i8*, i8** %159
%161 = getelementptr inbounds i8, i8* %160, i64 0
%162 = load i8, i8* %161
%163 = sext i8 %162 to i32
%164 = icmp eq i32 %163, 51
br i1 %164, label %165, label %183
165: ; preds = %157
%166 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0))
store i32 32768, i32* %23
br label %167
167: ; preds = %180, %165
%168 = load i32, i32* %23
%169 = add i32 %168, -1
store i32 %169, i32* %23
%170 = icmp ne i32 %169, 0
br i1 %170, label %171, label %182
171: ; preds = %167
store i32 16777216, i32* %24
br label %172
172: ; preds = %176, %171
%173 = load i32, i32* %24
%174 = add i32 %173, -1
store i32 %174, i32* %24
%175 = icmp ne i32 %174, 0
br i1 %175, label %176, label %180
176: ; preds = %172
%177 = load i64, i64* %11
%178 = load i64, i64* %11
%179 = add i64 %178, %177
store i64 %179, i64* %11
br label %172
180: ; preds = %172
%181 = call i32 (...) @update_fps()
br label %167
182: ; preds = %167
br label %231
183: ; preds = %157, %154
%184 = load i32, i32* %4
%185 = icmp sgt i32 %184, 1
br i1 %185, label %186, label %212
186: ; preds = %183
%187 = load i8**, i8*** %5
%188 = getelementptr inbounds i8*, i8** %187, i64 1
%189 = load i8*, i8** %188
%190 = getelementptr inbounds i8, i8* %189, i64 0
%191 = load i8, i8* %190
%192 = sext i8 %191 to i32
%193 = icmp eq i32 %192, 50
br i1 %193, label %194, label %212
194: ; preds = %186
%195 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.8, i64 0, i64 0))
store i32 32768, i32* %25
br label %196
196: ; preds = %209, %194
%197 = load i32, i32* %25
%198 = add i32 %197, -1
store i32 %198, i32* %25
%199 = icmp ne i32 %198, 0
br i1 %199, label %200, label %211
200: ; preds = %196
store i32 16777216, i32* %26
br label %201
201: ; preds = %205, %200
%202 = load i32, i32* %26
%203 = add i32 %202, -1
store i32 %203, i32* %26
%204 = icmp ne i32 %203, 0
br i1 %204, label %205, label %209
205: ; preds = %201
%206 = load volatile i32, i32* %10
%207 = load volatile i32, i32* %10
%208 = add nsw i32 %207, %206
store volatile i32 %208, i32* %10
br label %201
209: ; preds = %201
%210 = call i32 (...) @update_fps()
br label %196
211: ; preds = %196
br label %230
212: ; preds = %186, %183
%213 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0))
store i32 32768, i32* %27
br label %214
214: ; preds = %227, %212
%215 = load i32, i32* %27
%216 = add i32 %215, -1
store i32 %216, i32* %27
%217 = icmp ne i32 %216, 0
br i1 %217, label %218, label %229
218: ; preds = %214
store i32 16777216, i32* %28
br label %219
219: ; preds = %223, %218
%220 = load i32, i32* %28
%221 = add i32 %220, -1
store i32 %221, i32* %28
%222 = icmp ne i32 %221, 0
br i1 %222, label %223, label %227
223: ; preds = %219
%224 = load i32, i32* %9
%225 = load i32, i32* %9
%226 = add i32 %225, %224
store i32 %226, i32* %9
br label %219
227: ; preds = %219
%228 = call i32 (...) @update_fps()
br label %214
229: ; preds = %214
br label %230
230: ; preds = %229, %211
br label %231
231: ; preds = %230, %182
br label %232
232: ; preds = %231, %153
br label %233
233: ; preds = %232, %124
br label %234
234: ; preds = %233, %88
%235 = load i32, i32* %9
%236 = load volatile i32, i32* %10
%237 = load i64, i64* %11
%238 = load i64, i64* %12
%239 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i64 0, i64 0), i32 %235, i32 %236, i64 %237, i64 %238)
ret i32 0
}

LLVM IR (-O2):
@UINT_MAX = global i32 0
@INT_MAX = global i32 0
@.str = [21 x i8] c"unsigned int: %u %f\0A\00"
@.str.1 = [12 x i8] c"int: %i %f\0A\00"
@.str.2 = [29 x i8] c"unsigned long long: %llu %f\0A\00"
@.str.3 = [20 x i8] c"long long: %lli %f\0A\00"
@.str.10 = [46 x i8] c"Output to prevent optimizations. %u %i %u %i\0A\00"
@str = [34 x i8] c"\0ATest unsigned long (=uint) speed\00"
@str.11 = [50 x i8] c"\0ATest long (=int) speed. Variable marked volatile\00"
@str.12 = [31 x i8] c"\0ATest unsigned long long speed\00"
@str.13 = [22 x i8] c"\0ATest long long speed\00"
@str.14 = [56 x i8] c"\0ATest unsigned int for array (no simple register store)\00"
@str.15 = [59 x i8] c"\0ATest long long speed for array (no simple register store)\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = load i32, i32* @UINT_MAX
%5 = bitcast i32* %3 to i8*
%6 = load i32, i32* @INT_MAX
store volatile i32 %6, i32* %3
%7 = tail call i64 @calloc(i32 1024, i32 4)
%8 = inttoptr i64 %7 to i32*
%9 = tail call i64 @calloc(i32 1024, i32 8)
%10 = inttoptr i64 %9 to i64*
%11 = tail call double @log2(i32 %4)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4, double %11)
%13 = load volatile i32, i32* %3
%14 = load volatile i32, i32* %3
%15 = tail call double @log2(i32 %14)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %13, double %15)
%17 = tail call double @log2(i32 -1)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i64 -1, double %17)
%19 = tail call double @log2(i32 -1)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i64 -1, double %19)
%21 = icmp sgt i32 %0, 1
br i1 %21, label %22, label %149
22: ; preds = %2
%23 = getelementptr inbounds i8*, i8** %1, i64 1
%24 = load i8*, i8** %23
%25 = load i8, i8* %24
switch i8 %25, label %149 [
i8 54, label %26
i8 53, label %58
i8 52, label %90
i8 51, label %106
i8 50, label %122
]
26: ; preds = %22
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.15, i64 0, i64 0))
br label %28
28: ; preds = %26, %54
%29 = phi i32 [ 32767, %26 ], [ %56, %54 ]
%30 = phi i32 [ 0, %26 ], [ %47, %54 ]
br label %31
31: ; preds = %31, %28
%32 = phi i32 [ 16777215, %28 ], [ %52, %31 ]
%33 = phi i32 [ %30, %28 ], [ %47, %31 ]
%34 = add nuw nsw i32 %33, 647
%35 = and i32 %34, 1023
%36 = zext i32 %35 to i64
%37 = getelementptr inbounds i64, i64* %10, i64 %36
%38 = load i64, i64* %37
%39 = add i64 %38, %36
store i64 %39, i64* %37
%40 = add nsw i32 %33, 270
%41 = and i32 %40, 1023
%42 = zext i32 %41 to i64
%43 = getelementptr inbounds i64, i64* %10, i64 %42
%44 = load i64, i64* %43
%45 = add i64 %44, %42
store i64 %45, i64* %43
%46 = add nsw i32 %33, 917
%47 = and i32 %46, 1023
%48 = zext i32 %47 to i64
%49 = getelementptr inbounds i64, i64* %10, i64 %48
%50 = load i64, i64* %49
%51 = add i64 %50, %48
store i64 %51, i64* %49
%52 = add nsw i32 %32, -3
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %31
54: ; preds = %31
%55 = tail call i32 (...) @update_fps()
%56 = add nsw i32 %29, -1
%57 = icmp eq i32 %56, 0
br i1 %57, label %165, label %28
58: ; preds = %22
%59 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.14, i64 0, i64 0))
br label %60
60: ; preds = %58, %86
%61 = phi i32 [ 32767, %58 ], [ %88, %86 ]
%62 = phi i32 [ 0, %58 ], [ %79, %86 ]
br label %63
63: ; preds = %63, %60
%64 = phi i32 [ 16777215, %60 ], [ %84, %63 ]
%65 = phi i32 [ %62, %60 ], [ %79, %63 ]
%66 = add nuw nsw i32 %65, 647
%67 = and i32 %66, 1023
%68 = zext i32 %67 to i64
%69 = getelementptr inbounds i32, i32* %8, i64 %68
%70 = load i32, i32* %69
%71 = add i32 %70, %67
store i32 %71, i32* %69
%72 = add nsw i32 %65, 270
%73 = and i32 %72, 1023
%74 = zext i32 %73 to i64
%75 = getelementptr inbounds i32, i32* %8, i64 %74
%76 = load i32, i32* %75
%77 = add i32 %76, %73
store i32 %77, i32* %75
%78 = add nsw i32 %65, 917
%79 = and i32 %78, 1023
%80 = zext i32 %79 to i64
%81 = getelementptr inbounds i32, i32* %8, i64 %80
%82 = load i32, i32* %81
%83 = add i32 %82, %79
store i32 %83, i32* %81
%84 = add nsw i32 %64, -3
%85 = icmp eq i32 %84, 0
br i1 %85, label %86, label %63
86: ; preds = %63
%87 = tail call i32 (...) @update_fps()
%88 = add nsw i32 %61, -1
%89 = icmp eq i32 %88, 0
br i1 %89, label %165, label %60
90: ; preds = %22
%91 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.13, i64 0, i64 0))
br label %92
92: ; preds = %90, %101
%93 = phi i32 [ 32767, %90 ], [ %104, %101 ]
%94 = phi i64 [ -1, %90 ], [ %102, %101 ]
br label %95
95: ; preds = %95, %92
%96 = phi i64 [ %94, %92 ], [ %100, %95 ]
%97 = phi i32 [ 16777216, %92 ], [ %98, %95 ]
%98 = add nsw i32 %97, -8
%99 = icmp eq i32 %98, 0
%100 = shl i64 %96, 8
br i1 %99, label %101, label %95
101: ; preds = %95
%102 = shl i64 %96, 7
%103 = tail call i32 (...) @update_fps()
%104 = add nsw i32 %93, -1
%105 = icmp eq i32 %104, 0
br i1 %105, label %165, label %92
106: ; preds = %22
%107 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.12, i64 0, i64 0))
br label %108
108: ; preds = %106, %117
%109 = phi i32 [ 32767, %106 ], [ %120, %117 ]
%110 = phi i64 [ -1, %106 ], [ %118, %117 ]
br label %111
111: ; preds = %111, %108
%112 = phi i64 [ %110, %108 ], [ %116, %111 ]
%113 = phi i32 [ 16777216, %108 ], [ %114, %111 ]
%114 = add nsw i32 %113, -8
%115 = icmp eq i32 %114, 0
%116 = shl i64 %112, 8
br i1 %115, label %117, label %111
117: ; preds = %111
%118 = shl i64 %112, 7
%119 = tail call i32 (...) @update_fps()
%120 = add nsw i32 %109, -1
%121 = icmp eq i32 %120, 0
br i1 %121, label %165, label %108
122: ; preds = %22
%123 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.11, i64 0, i64 0))
br label %124
124: ; preds = %122, %145
%125 = phi i32 [ 32767, %122 ], [ %147, %145 ]
br label %126
126: ; preds = %126, %124
%127 = phi i32 [ 16777215, %124 ], [ %143, %126 ]
%128 = load volatile i32, i32* %3
%129 = load volatile i32, i32* %3
%130 = add nsw i32 %129, %128
store volatile i32 %130, i32* %3
%131 = load volatile i32, i32* %3
%132 = load volatile i32, i32* %3
%133 = add nsw i32 %132, %131
store volatile i32 %133, i32* %3
%134 = load volatile i32, i32* %3
%135 = load volatile i32, i32* %3
%136 = add nsw i32 %135, %134
store volatile i32 %136, i32* %3
%137 = load volatile i32, i32* %3
%138 = load volatile i32, i32* %3
%139 = add nsw i32 %138, %137
store volatile i32 %139, i32* %3
%140 = load volatile i32, i32* %3
%141 = load volatile i32, i32* %3
%142 = add nsw i32 %141, %140
store volatile i32 %142, i32* %3
%143 = add nsw i32 %127, -5
%144 = icmp eq i32 %143, 0
br i1 %144, label %145, label %126
145: ; preds = %126
%146 = tail call i32 (...) @update_fps()
%147 = add nsw i32 %125, -1
%148 = icmp eq i32 %147, 0
br i1 %148, label %165, label %124
149: ; preds = %22, %2
%150 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
br label %151
151: ; preds = %149, %160
%152 = phi i32 [ 32767, %149 ], [ %163, %160 ]
%153 = phi i32 [ %4, %149 ], [ %161, %160 ]
br label %154
154: ; preds = %154, %151
%155 = phi i32 [ %153, %151 ], [ %159, %154 ]
%156 = phi i32 [ 16777216, %151 ], [ %157, %154 ]
%157 = add nsw i32 %156, -8
%158 = icmp eq i32 %157, 0
%159 = shl i32 %155, 8
br i1 %158, label %160, label %154
160: ; preds = %154
%161 = shl i32 %155, 7
%162 = tail call i32 (...) @update_fps()
%163 = add nsw i32 %152, -1
%164 = icmp eq i32 %163, 0
br i1 %164, label %165, label %151
165: ; preds = %145, %117, %101, %86, %54, %160
%166 = phi i64 [ -1, %160 ], [ -1, %54 ], [ -1, %86 ], [ %102, %101 ], [ -1, %117 ], [ -1, %145 ]
%167 = phi i64 [ -1, %160 ], [ -1, %54 ], [ -1, %86 ], [ -1, %101 ], [ %118, %117 ], [ -1, %145 ]
%168 = phi i32 [ %161, %160 ], [ %4, %54 ], [ %4, %86 ], [ %4, %101 ], [ %4, %117 ], [ %4, %145 ]
%169 = load volatile i32, i32* %3
%170 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i64 0, i64 0), i32 %168, i32 %169, i64 %167, i64 %166)
ret i32 0
}