#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
int rand();
scalar_t__ scanf(char *, ...);
int main(int argc, char **argv) {
  int n, c, d, i, j;
  int l[5], h[5];
  double epsilon, m;
  FILE *f;
  if (argc != 2) {
    printf("Usage: gen <filename>\n");
    exit(1);
  }
  printf("\nThis program generates random data points\n");
  printf("for testing the FCM algorithm.\n\n");
  do {
    printf("Enter number of data points.\n");
    printf("Value should be >= 1 and < %d: ", 10000);
    if (scanf("%d", &n) == EOF)
      continue;
  } while (n < 1 || n > 10000);
  do {
    printf("Enter number of clusters.\n");
    printf("Value should be >= 2 and < %d: ", 100);
    if (scanf("%d", &c) == EOF)
      continue;
  } while (c < 2 || c > 100);
  do {
    printf("Enter termination criterion (epsilon).\n");
    printf("Value should be >= 0.0 and <= 1.0: ");
    if (scanf("%lf", &epsilon) == EOF)
      continue;
  } while (epsilon < 0 || epsilon > 1.0);
  do {
    printf("Enter fuzzyness coefficient.\n");
    printf("Value should be > 1.0: ");
    if (scanf("%lf", &m) == EOF)
      continue;
  } while (m <= 1.0);
  do {
    printf("Enter number of dimensions.\n");
    printf("Value should be >= 1 and < %d: ", 5);
    if (scanf("%d", &d) == EOF)
      continue;
  } while (d < 1 || d > 5);
  printf("\nThe program will generate random data points by using\n");
  printf("the lowest and highest values allowed for a given dimension.\n");
  printf("The highest value should be greater than the lowest value\n");
  printf("for a given dimension.\n");
  for (i = 0; i < d; i++) {
    do {
      printf("Enter lowest value for dimension [%d]: ", i);
      if (scanf("%d", &l[i]) == EOF)
        continue;
      printf("Enter highest value for dimension [%d]: ", i);
      if (scanf("%d", &h[i]) == EOF)
        continue;
    } while (l[i] >= h[i]);
  }
  if ((f = fopen(argv[1], "w")) == NULL) {
    printf("Failed to create new data file named %s\n", argv[1]);
    exit(1);
  }
  fprintf(f, "%d %d %d\n", n, c, d);
  fprintf(f, "%lf %lf\n", m, epsilon);
  for (i = 0; i < n; i++) {
    for (j = 0; j < d; j++) {
      fprintf(f, "%d ", (rand() % (h[j] - l[j] + 1)) + l[j]);
    }
    fprintf(f, "\n");
  }
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11ab <main+0x3b>
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeae(%rip),%rdi
mov    $0x2710,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    0x2de7(%rip),%rcx
cmp    (%rcx),%rax
jne    120f <main+0x9f>
jmp    1214 <main+0xa4>
jmp    1214 <main+0xa4>
mov    $0x1,%al
cmpl   $0x1,-0x14(%rbp)
mov    %al,-0x79(%rbp)
jl     1230 <main+0xc0>
cmpl   $0x2710,-0x14(%rbp)
setg   %al
mov    %al,-0x79(%rbp)
mov    -0x79(%rbp),%al
test   $0x1,%al
jne    11c7 <main+0x57>
jmp    1240 <main+0xd0>
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe73(%rip),%rdi
mov    $0x64,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe42(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    0x2d6e(%rip),%rcx
cmp    (%rcx),%rax
jne    1288 <main+0x118>
jmp    128d <main+0x11d>
jmp    128d <main+0x11d>
mov    $0x1,%al
cmpl   $0x2,-0x18(%rbp)
mov    %al,-0x7a(%rbp)
jl     12a6 <main+0x136>
cmpl   $0x64,-0x18(%rbp)
setg   %al
mov    %al,-0x7a(%rbp)
mov    -0x7a(%rbp),%al
test   $0x1,%al
jne    1240 <main+0xd0>
jmp    12b6 <main+0x146>
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe5b(%rip),%rdi
lea    -0x68(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    0x2cfd(%rip),%rcx
cmp    (%rcx),%rax
jne    12f9 <main+0x189>
jmp    12fe <main+0x18e>
jmp    12fe <main+0x18e>
mov    $0x1,%al
xorps  %xmm0,%xmm0
ucomisd -0x68(%rbp),%xmm0
mov    %al,-0x7b(%rbp)
ja     1328 <main+0x1b8>
movsd  -0x68(%rbp),%xmm0
movsd  0xce2(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x7b(%rbp)
mov    -0x7b(%rbp),%al
test   $0x1,%al
jne    12b6 <main+0x146>
jmp    1338 <main+0x1c8>
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdd9(%rip),%rdi
lea    -0x70(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    0x2c7b(%rip),%rcx
cmp    (%rcx),%rax
jne    137b <main+0x20b>
jmp    1380 <main+0x210>
jmp    1380 <main+0x210>
movsd  0xc78(%rip),%xmm0
ucomisd -0x70(%rbp),%xmm0
jae    1338 <main+0x1c8>
jmp    1398 <main+0x228>
lea    0xdcf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xcdd(%rip),%rdi
mov    $0x5,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xcea(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    0x2c16(%rip),%rcx
cmp    (%rcx),%rax
jne    13e0 <main+0x270>
jmp    13e5 <main+0x275>
jmp    13e5 <main+0x275>
mov    $0x1,%al
cmpl   $0x1,-0x1c(%rbp)
mov    %al,-0x7c(%rbp)
jl     13fe <main+0x28e>
cmpl   $0x5,-0x1c(%rbp)
setg   %al
mov    %al,-0x7c(%rbp)
mov    -0x7c(%rbp),%al
test   $0x1,%al
jne    1398 <main+0x228>
lea    0xd7b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xda5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    150d <main+0x39d>
jmp    1459 <main+0x2e9>
mov    -0x20(%rbp),%esi
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x20(%rbp),%rax
lea    -0x40(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xc2a(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    0x2b5a(%rip),%rcx
cmp    (%rcx),%rax
jne    149c <main+0x32c>
jmp    14e4 <main+0x374>
mov    -0x20(%rbp),%esi
lea    0xdbe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x20(%rbp),%rax
lea    -0x60(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xbe7(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    0x2b17(%rip),%rcx
cmp    (%rcx),%rax
jne    14df <main+0x36f>
jmp    14e4 <main+0x374>
jmp    14e4 <main+0x374>
movslq -0x20(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
movslq -0x20(%rbp),%rcx
cmp    -0x60(%rbp,%rcx,4),%eax
jge    1459 <main+0x2e9>
jmp    14ff <main+0x38f>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1448 <main+0x2d8>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd71(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x78(%rbp)
cmp    $0x0,%rax
jne    154f <main+0x3df>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xd51(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x78(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
lea    0xd54(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x78(%rbp),%rdi
movsd  -0x70(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
lea    0xd42(%rip),%rsi
mov    $0x2,%al
call   1050 <fprintf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1620 <main+0x4b0>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1600 <main+0x490>
mov    -0x78(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
mov    -0x88(%rbp),%rdi
movslq -0x24(%rbp),%rcx
mov    -0x60(%rbp,%rcx,4),%ecx
movslq -0x24(%rbp),%rdx
sub    -0x40(%rbp,%rdx,4),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
movslq -0x24(%rbp),%rax
add    -0x40(%rbp,%rax,4),%edx
lea    0xce0(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    15a1 <main+0x431>
mov    -0x78(%rbp),%rdi
lea    0xa5f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    158e <main+0x41e>
mov    -0x78(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
cmp    $0x2,%edi
jne    151f <main+0x38f>
mov    %rsi,%r13
lea    0xf75(%rip),%rdi
call   1030 <puts@plt>
lea    0xf94(%rip),%rdi
call   1030 <puts@plt>
lea    0xfa8(%rip),%r14
lea    0xe40(%rip),%r15
lea    0xe59(%rip),%r12
lea    0x10(%rsp),%rbp
mov    $0xffffd8ef,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    $0x2710,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    0x10(%rsp),%eax
add    %ebx,%eax
cmp    $0xffffd8f0,%eax
jb     11f0 <main+0x60>
lea    0xf66(%rip),%r14
lea    0xe04(%rip),%r15
lea    0xdfa(%rip),%rbx
lea    0x14(%rsp),%rbp
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    $0x64,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    0x14(%rsp),%eax
add    $0xffffff9b,%eax
cmp    $0xffffff9d,%eax
jb     1240 <main+0xb0>
lea    0xf31(%rip),%r14
lea    0xdd5(%rip),%r15
lea    0xdf2(%rip),%rbx
lea    0x20(%rsp),%rbp
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
movsd  0x20(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
ja     1290 <main+0x100>
ucomisd 0xd39(%rip),%xmm0
ja     1290 <main+0x100>
mov    %r13,0x28(%rsp)
lea    0xefa(%rip),%r14
lea    0xd9f(%rip),%r15
lea    0xd94(%rip),%rbx
lea    0x18(%rsp),%rbp
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
movsd  0xce9(%rip),%xmm0
ucomisd 0x18(%rsp),%xmm0
jae    12f0 <main+0x160>
lea    0xec6(%rip),%r14
lea    0xce3(%rip),%r15
lea    0xcfc(%rip),%rbx
lea    0xc(%rsp),%rbp
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    0xc(%rsp),%eax
add    $0xfffffffa,%eax
cmp    $0xfffffffb,%eax
jb     1340 <main+0x1b0>
lea    0xe91(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,0xc(%rsp)
jle    1426 <main+0x296>
lea    0xce5(%rip),%r15
lea    0xc7b(%rip),%r13
mov    0x2c2c(%rip),%r12
xor    %ebx,%ebx
jmp    13ce <main+0x23e>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
cmp    %rax,%rbx
jge    1426 <main+0x296>
lea    (%rsp,%rbx,4),%rbp
add    $0x50,%rbp
lea    (%rsp,%rbx,4),%r14
add    $0x30,%r14
jmp    13e8 <main+0x258>
mov    0x0(%rbp),%eax
cmp    (%r14),%eax
jl     13c0 <main+0x230>
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
cmp    (%r12),%rax
je     13e0 <main+0x250>
lea    0xcad(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r13,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
jmp    13e0 <main+0x250>
mov    0x28(%rsp),%rbp
mov    0x8(%rbp),%rdi
lea    0xcae(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     1535 <main+0x3a5>
mov    %rax,%rbx
mov    0x10(%rsp),%edx
mov    0x14(%rsp),%ecx
mov    0xc(%rsp),%r8d
lea    0xcb4(%rip),%rsi
mov    %rax,%rdi
xor    %eax,%eax
call   1070 <fprintf@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
lea    0xca1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%al
call   1070 <fprintf@plt>
cmpl   $0x0,0x10(%rsp)
jle    1506 <main+0x376>
lea    0xc8e(%rip),%r14
xor    %r15d,%r15d
jmp    14b8 <main+0x328>
nopl   0x0(%rax)
mov    $0xa,%edi
mov    %rbx,%rsi
call   1060 <fputc@plt>
add    $0x1,%r15d
cmp    0x10(%rsp),%r15d
jge    1506 <main+0x376>
cmpl   $0x0,0xc(%rsp)
jle    14a0 <main+0x310>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   10b0 <rand@plt>
mov    0x30(%rsp,%rbp,4),%ecx
mov    0x50(%rsp,%rbp,4),%esi
sub    %esi,%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
add    %esi,%edx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
add    $0x1,%rbp
movslq 0xc(%rsp),%rax
cmp    %rax,%rbp
jl     14d0 <main+0x340>
jmp    14a0 <main+0x310>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd90(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    0x8(%rbp),%rsi
lea    0xba6(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Usage: gen <filename>\0A\00"
@.str.1 = [44 x i8] c"\0AThis program generates random data points\0A\00"
@.str.2 = [33 x i8] c"for testing the FCM algorithm.\0A\0A\00"
@.str.3 = [30 x i8] c"Enter number of data points.\0A\00"
@.str.4 = [32 x i8] c"Value should be >= 1 and < %d: \00"
@.str.5 = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.6 = [27 x i8] c"Enter number of clusters.\0A\00"
@.str.7 = [32 x i8] c"Value should be >= 2 and < %d: \00"
@.str.8 = [40 x i8] c"Enter termination criterion (epsilon).\0A\00"
@.str.9 = [36 x i8] c"Value should be >= 0.0 and <= 1.0: \00"
@.str.10 = [4 x i8] c"%lf\00"
@.str.11 = [30 x i8] c"Enter fuzzyness coefficient.\0A\00"
@.str.12 = [24 x i8] c"Value should be > 1.0: \00"
@.str.13 = [29 x i8] c"Enter number of dimensions.\0A\00"
@.str.14 = [56 x i8] c"\0AThe program will generate random data points by using\0A\00"
@.str.15 = [62 x i8] c"the lowest and highest values allowed for a given dimension.\0A\00"
@.str.16 = [59 x i8] c"The highest value should be greater than the lowest value\0A\00"
@.str.17 = [24 x i8] c"for a given dimension.\0A\00"
@.str.18 = [40 x i8] c"Enter lowest value for dimension [%d]: \00"
@.str.19 = [41 x i8] c"Enter highest value for dimension [%d]: \00"
@.str.20 = [2 x i8] c"w\00"
@.str.21 = [41 x i8] c"Failed to create new data file named %s\0A\00"
@.str.22 = [10 x i8] c"%d %d %d\0A\00"
@.str.23 = [9 x i8] c"%lf %lf\0A\00"
@.str.24 = [4 x i8] c"%d \00"
@.str.25 = [2 x i8] c"\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 [5 x i32]
%12 = alloca [5 x i32]
%13 = alloca double
%14 = alloca double
%15 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 2
br i1 %17, label %18, label %21
18: ; preds = %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %2
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
br label %24
24: ; preds = %38, %21
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 10000)
%27 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %6)
%28 = load i64, i64* @EOF
%29 = icmp eq i64 %27, %28
br i1 %29, label %30, label %31
30: ; preds = %24
br label %32
31: ; preds = %24
br label %32
32: ; preds = %31, %30
%33 = load i32, i32* %6
%34 = icmp slt i32 %33, 1
br i1 %34, label %38, label %35
35: ; preds = %32
%36 = load i32, i32* %6
%37 = icmp sgt i32 %36, 10000
br label %38
38: ; preds = %35, %32
%39 = phi i1 [ true, %32 ], [ %37, %35 ]
br i1 %39, label %24, label %40
40: ; preds = %38
br label %41
41: ; preds = %55, %40
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i32 100)
%44 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %7)
%45 = load i64, i64* @EOF
%46 = icmp eq i64 %44, %45
br i1 %46, label %47, label %48
47: ; preds = %41
br label %49
48: ; preds = %41
br label %49
49: ; preds = %48, %47
%50 = load i32, i32* %7
%51 = icmp slt i32 %50, 2
br i1 %51, label %55, label %52
52: ; preds = %49
%53 = load i32, i32* %7
%54 = icmp sgt i32 %53, 100
br label %55
55: ; preds = %52, %49
%56 = phi i1 [ true, %49 ], [ %54, %52 ]
br i1 %56, label %41, label %57
57: ; preds = %55
br label %58
58: ; preds = %72, %57
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0))
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0))
%61 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), double* %13)
%62 = load i64, i64* @EOF
%63 = icmp eq i64 %61, %62
br i1 %63, label %64, label %65
64: ; preds = %58
br label %66
65: ; preds = %58
br label %66
66: ; preds = %65, %64
%67 = load double, double* %13
%68 = fcmp olt double %67, 0.000000e+00
br i1 %68, label %72, label %69
69: ; preds = %66
%70 = load double, double* %13
%71 = fcmp ogt double %70, 1.000000e+00
br label %72
72: ; preds = %69, %66
%73 = phi i1 [ true, %66 ], [ %71, %69 ]
br i1 %73, label %58, label %74
74: ; preds = %72
br label %75
75: ; preds = %83, %74
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0))
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0))
%78 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), double* %14)
%79 = load i64, i64* @EOF
%80 = icmp eq i64 %78, %79
br i1 %80, label %81, label %82
81: ; preds = %75
br label %83
82: ; preds = %75
br label %83
83: ; preds = %82, %81
%84 = load double, double* %14
%85 = fcmp ole double %84, 1.000000e+00
br i1 %85, label %75, label %86
86: ; preds = %83
br label %87
87: ; preds = %101, %86
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.13, i64 0, i64 0))
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 5)
%90 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %8)
%91 = load i64, i64* @EOF
%92 = icmp eq i64 %90, %91
br i1 %92, label %93, label %94
93: ; preds = %87
br label %95
94: ; preds = %87
br label %95
95: ; preds = %94, %93
%96 = load i32, i32* %8
%97 = icmp slt i32 %96, 1
br i1 %97, label %101, label %98
98: ; preds = %95
%99 = load i32, i32* %8
%100 = icmp sgt i32 %99, 5
br label %101
101: ; preds = %98, %95
%102 = phi i1 [ true, %95 ], [ %100, %98 ]
br i1 %102, label %87, label %103
103: ; preds = %101
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.14, i64 0, i64 0))
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.15, i64 0, i64 0))
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.16, i64 0, i64 0))
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.17, i64 0, i64 0))
store i32 0, i32* %9
br label %108
108: ; preds = %145, %103
%109 = load i32, i32* %9
%110 = load i32, i32* %8
%111 = icmp slt i32 %109, %110
br i1 %111, label %112, label %148
112: ; preds = %108
br label %113
113: ; preds = %134, %112
%114 = load i32, i32* %9
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.18, i64 0, i64 0), i32 %114)
%116 = load i32, i32* %9
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0, i64 %117
%119 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %118)
%120 = load i64, i64* @EOF
%121 = icmp eq i64 %119, %120
br i1 %121, label %122, label %123
122: ; preds = %113
br label %134
123: ; preds = %113
%124 = load i32, i32* %9
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.19, i64 0, i64 0), i32 %124)
%126 = load i32, i32* %9
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds [5 x i32], [5 x i32]* %12, i64 0, i64 %127
%129 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %128)
%130 = load i64, i64* @EOF
%131 = icmp eq i64 %129, %130
br i1 %131, label %132, label %133
132: ; preds = %123
br label %134
133: ; preds = %123
br label %134
134: ; preds = %133, %132, %122
%135 = load i32, i32* %9
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0, i64 %136
%138 = load i32, i32* %137
%139 = load i32, i32* %9
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds [5 x i32], [5 x i32]* %12, i64 0, i64 %140
%142 = load i32, i32* %141
%143 = icmp sge i32 %138, %142
br i1 %143, label %113, label %144
144: ; preds = %134
br label %145
145: ; preds = %144
%146 = load i32, i32* %9
%147 = add nsw i32 %146, 1
store i32 %147, i32* %9
br label %108
148: ; preds = %108
%149 = load i8**, i8*** %5
%150 = getelementptr inbounds i8*, i8** %149, i64 1
%151 = load i8*, i8** %150
%152 = call i32* @fopen(i8* %151, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i64 0, i64 0))
store i32* %152, i32** %15
%153 = icmp eq i32* %152, null
br i1 %153, label %154, label %160
154: ; preds = %148
%155 = load i8**, i8*** %5
%156 = getelementptr inbounds i8*, i8** %155, i64 1
%157 = load i8*, i8** %156
%158 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.21, i64 0, i64 0), i8* %157)
%159 = call i32 @exit(i32 1)
unreachable
160: ; preds = %148
%161 = load i32*, i32** %15
%162 = load i32, i32* %6
%163 = load i32, i32* %7
%164 = load i32, i32* %8
%165 = call i32 (i32*, i8*, ...) @fprintf(i32* %161, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.22, i64 0, i64 0), i32 %162, i32 %163, i32 %164)
%166 = load i32*, i32** %15
%167 = load double, double* %14
%168 = load double, double* %13
%169 = call i32 (i32*, i8*, ...) @fprintf(i32* %166, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.23, i64 0, i64 0), double %167, double %168)
store i32 0, i32* %9
br label %170
170: ; preds = %205, %160
%171 = load i32, i32* %9
%172 = load i32, i32* %6
%173 = icmp slt i32 %171, %172
br i1 %173, label %174, label %208
174: ; preds = %170
store i32 0, i32* %10
br label %175
175: ; preds = %199, %174
%176 = load i32, i32* %10
%177 = load i32, i32* %8
%178 = icmp slt i32 %176, %177
br i1 %178, label %179, label %202
179: ; preds = %175
%180 = load i32*, i32** %15
%181 = call i32 (...) @rand()
%182 = load i32, i32* %10
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds [5 x i32], [5 x i32]* %12, i64 0, i64 %183
%185 = load i32, i32* %184
%186 = load i32, i32* %10
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0, i64 %187
%189 = load i32, i32* %188
%190 = sub nsw i32 %185, %189
%191 = add nsw i32 %190, 1
%192 = srem i32 %181, %191
%193 = load i32, i32* %10
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0, i64 %194
%196 = load i32, i32* %195
%197 = add nsw i32 %192, %196
%198 = call i32 (i32*, i8*, ...) @fprintf(i32* %180, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.24, i64 0, i64 0), i32 %197)
br label %199
199: ; preds = %179
%200 = load i32, i32* %10
%201 = add nsw i32 %200, 1
store i32 %201, i32* %10
br label %175
202: ; preds = %175
%203 = load i32*, i32** %15
%204 = call i32 (i32*, i8*, ...) @fprintf(i32* %203, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.25, i64 0, i64 0))
br label %205
205: ; preds = %202
%206 = load i32, i32* %9
%207 = add nsw i32 %206, 1
store i32 %207, i32* %9
br label %170
208: ; preds = %170
%209 = load i32*, i32** %15
%210 = call i32 @fclose(i32* %209)
ret i32 0
}

LLVM IR (-O2):
@.str.4 = [32 x i8] c"Value should be >= 1 and < %d: \00"
@.str.5 = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.7 = [32 x i8] c"Value should be >= 2 and < %d: \00"
@.str.9 = [36 x i8] c"Value should be >= 0.0 and <= 1.0: \00"
@.str.10 = [4 x i8] c"%lf\00"
@.str.12 = [24 x i8] c"Value should be > 1.0: \00"
@.str.18 = [40 x i8] c"Enter lowest value for dimension [%d]: \00"
@.str.19 = [41 x i8] c"Enter highest value for dimension [%d]: \00"
@.str.20 = [2 x i8] c"w\00"
@.str.21 = [41 x i8] c"Failed to create new data file named %s\0A\00"
@.str.22 = [10 x i8] c"%d %d %d\0A\00"
@.str.23 = [9 x i8] c"%lf %lf\0A\00"
@.str.24 = [4 x i8] c"%d \00"
@str = [43 x i8] c"\0AThis program generates random data points\00"
@str.26 = [32 x i8] c"for testing the FCM algorithm.\0A\00"
@str.27 = [29 x i8] c"Enter number of data points.\00"
@str.28 = [26 x i8] c"Enter number of clusters.\00"
@str.29 = [39 x i8] c"Enter termination criterion (epsilon).\00"
@str.30 = [29 x i8] c"Enter fuzzyness coefficient.\00"
@str.31 = [28 x i8] c"Enter number of dimensions.\00"
@str.32 = [55 x i8] c"\0AThe program will generate random data points by using\00"
@str.33 = [61 x i8] c"the lowest and highest values allowed for a given dimension.\00"
@str.34 = [58 x i8] c"The highest value should be greater than the lowest value\00"
@str.35 = [23 x i8] c"for a given dimension.\00"
@str.36 = [22 x i8] c"Usage: gen <filename>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [5 x i32]
%7 = alloca [5 x i32]
%8 = alloca double
%9 = alloca double
%10 = bitcast i32* %3 to i8*
%11 = bitcast i32* %4 to i8*
%12 = bitcast i32* %5 to i8*
%13 = bitcast [5 x i32]* %6 to i8*
%14 = bitcast [5 x i32]* %7 to i8*
%15 = bitcast double* %8 to i8*
%16 = bitcast double* %9 to i8*
%17 = icmp eq i32 %0, 2
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.36, i64 0, i64 0))
%20 = tail call i32 @exit(i32 1)
unreachable
21: ; preds = %2
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.26, i64 0, i64 0))
br label %24
24: ; preds = %24, %21
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.27, i64 0, i64 0))
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 10000)
%27 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%28 = load i32, i32* %3
%29 = add i32 %28, -10001
%30 = icmp ult i32 %29, -10000
br i1 %30, label %24, label %31
31: ; preds = %24, %31
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.28, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i32 100)
%34 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %4)
%35 = load i32, i32* %4
%36 = add i32 %35, -101
%37 = icmp ult i32 %36, -99
br i1 %37, label %31, label %38
38: ; preds = %31, %38
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.29, i64 0, i64 0))
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0))
%41 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), double* %8)
%42 = load double, double* %8
%43 = fcmp olt double %42, 0.000000e+00
%44 = fcmp ogt double %42, 1.000000e+00
%45 = or i1 %43, %44
br i1 %45, label %38, label %46
46: ; preds = %38, %46
%47 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.30, i64 0, i64 0))
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0))
%49 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), double* %9)
%50 = load double, double* %9
%51 = fcmp ugt double %50, 1.000000e+00
br i1 %51, label %52, label %46
52: ; preds = %46, %52
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.31, i64 0, i64 0))
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 5)
%55 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %5)
%56 = load i32, i32* %5
%57 = add i32 %56, -6
%58 = icmp ult i32 %57, -5
br i1 %58, label %52, label %59
59: ; preds = %52
%60 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.32, i64 0, i64 0))
%61 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.33, i64 0, i64 0))
%62 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.34, i64 0, i64 0))
%63 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.35, i64 0, i64 0))
%64 = load i32, i32* %5
%65 = icmp sgt i32 %64, 0
br i1 %65, label %66, label %88
66: ; preds = %59, %83
%67 = phi i64 [ %84, %83 ], [ 0, %59 ]
%68 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 %67
%69 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 %67
%70 = trunc i64 %67 to i32
br label %71
71: ; preds = %66, %79
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.18, i64 0, i64 0), i32 %70)
%73 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %68)
%74 = load i64, i64* @EOF
%75 = icmp eq i64 %73, %74
br i1 %75, label %79, label %76
76: ; preds = %71
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.19, i64 0, i64 0), i32 %70)
%78 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %69)
br label %79
79: ; preds = %76, %71
%80 = load i32, i32* %68
%81 = load i32, i32* %69
%82 = icmp slt i32 %80, %81
br i1 %82, label %83, label %71
83: ; preds = %79
%84 = add nuw nsw i64 %67, 1
%85 = load i32, i32* %5
%86 = sext i32 %85 to i64
%87 = icmp slt i64 %84, %86
br i1 %87, label %66, label %88
88: ; preds = %83, %59
%89 = getelementptr inbounds i8*, i8** %1, i64 1
%90 = load i8*, i8** %89
%91 = call i32* @fopen(i8* %90, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i64 0, i64 0))
%92 = icmp eq i32* %91, null
br i1 %92, label %93, label %97
93: ; preds = %88
%94 = load i8*, i8** %89
%95 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.21, i64 0, i64 0), i8* %94)
%96 = call i32 @exit(i32 1)
unreachable
97: ; preds = %88
%98 = load i32, i32* %3
%99 = load i32, i32* %4
%100 = load i32, i32* %5
%101 = call i32 (i32*, i8*, ...) @fprintf(i32* %91, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.22, i64 0, i64 0), i32 %98, i32 %99, i32 %100)
%102 = load double, double* %9
%103 = load double, double* %8
%104 = call i32 (i32*, i8*, ...) @fprintf(i32* %91, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.23, i64 0, i64 0), double %102, double %103)
%105 = load i32, i32* %3
%106 = icmp sgt i32 %105, 0
br i1 %106, label %107, label %132
107: ; preds = %97, %127
%108 = phi i32 [ %129, %127 ], [ 0, %97 ]
%109 = load i32, i32* %5
%110 = icmp sgt i32 %109, 0
br i1 %110, label %111, label %127
111: ; preds = %107, %111
%112 = phi i64 [ %123, %111 ], [ 0, %107 ]
%113 = call i32 (...) @rand()
%114 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 %112
%115 = load i32, i32* %114
%116 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 %112
%117 = load i32, i32* %116
%118 = add i32 %115, 1
%119 = sub i32 %118, %117
%120 = srem i32 %113, %119
%121 = add nsw i32 %120, %117
%122 = call i32 (i32*, i8*, ...) @fprintf(i32* %91, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.24, i64 0, i64 0), i32 %121)
%123 = add nuw nsw i64 %112, 1
%124 = load i32, i32* %5
%125 = sext i32 %124 to i64
%126 = icmp slt i64 %123, %125
br i1 %126, label %111, label %127
127: ; preds = %111, %107
%128 = call i32 @fputc(i32 10, i32* %91)
%129 = add nuw nsw i32 %108, 1
%130 = load i32, i32* %3
%131 = icmp slt i32 %129, %130
br i1 %131, label %107, label %132
132: ; preds = %127, %97
%133 = call i32 @fclose(i32* %91)
ret i32 0
}