#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 EXIT_FAILURE;
int EXIT_SUCCESS;
double abs(double);
int /*<<< orphan*/ dblabs(double);
scalar_t__ feof(int /*<<< orphan*/);
int /*<<< orphan*/ free(double **);
scalar_t__ malloc(int);
scalar_t__ pow(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ realloc(double **, int);
int scanf(char *, char *, double *, char *, double *, char *);
double sqrt(scalar_t__);
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  double **letadla = (double **)malloc(3 * sizeof(double *));
  int len, res;
  char ch1, ch2, ch3;
  len = 0;
  printf("Zadejte souradnice:\n");
  while (1) {
    letadla = (double **)realloc(letadla, (len + 1) * sizeof(double *));
    letadla[len] = (double *)malloc(2 * sizeof(double));
    ch1 = ' ';
    ch2 = ' ';
    ch3 = ' ';
    res = scanf(" %c %lf %c %lf %c", &ch1, &letadla[len][0], &ch2,
                &letadla[len][1], &ch3);
    if (ch1 == '[' && (ch2 != ',' || ch3 != ']')) {
      free(letadla);
      printf("Nespravny vstup.\n");
      return (EXIT_FAILURE);
    }
    if (feof(stdin))
      break;
    len++;
    if (res != 5 || ch1 != '[' || ch2 != ',' || ch3 != ']') {
      free(letadla);
      printf("Nespravny vstup.\n");
      return (EXIT_FAILURE);
    }
  }
  if (len < 2) {
    free(letadla);
    printf("Nespravny vstup.\n");
    return (EXIT_FAILURE);
  }
  double minval;
  int count;
  minval = sqrt(pow(dblabs(letadla[1][0] - letadla[0][0]), 2) +
                pow(dblabs(letadla[1][1] - letadla[0][1]), 2));
  count = 0;
  int i, y;
  double temp;
  for (i = 0; i < len - 1; i++)
    for (y = i + 1; y < len; y++) {
      temp = sqrt(pow(dblabs(letadla[i][0] - letadla[y][0]), 2) +
                  pow(dblabs(letadla[i][1] - letadla[y][1]), 2));
      if (temp < minval && (abs(temp - minval) > 0.000000000001)) {
        minval = temp;
        count = 1;
      } else if (abs(temp - minval) < 0.000000000001)
        count++;
    }
  free(letadla);
  printf("Vzdalenost nejblizsich letadel: %g\n", minval);
  printf("Nalezenych dvojic: %d\n", count);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x18,%edi
call   1080 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%esi
call   1090 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x10,%edi
call   1080 <malloc@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movb   $0x20,-0x21(%rbp)
movb   $0x20,-0x22(%rbp)
movb   $0x20,-0x23(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%r8
add    $0x8,%r8
lea    0xde1(%rip),%rdi
lea    -0x21(%rbp),%rsi
lea    -0x22(%rbp),%rcx
lea    -0x23(%rbp),%r9
call   10a0 <scanf@plt>
mov    %eax,-0x20(%rbp)
movsbl -0x21(%rbp),%eax
cmp    $0x5b,%eax
jne    129f <main+0xff>
movsbl -0x22(%rbp),%eax
cmp    $0x2c,%eax
jne    1277 <main+0xd7>
movsbl -0x23(%rbp),%eax
cmp    $0x5d,%eax
je     129f <main+0xff>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
lea    0xda8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2d43(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1545 <main+0x3a5>
mov    0x2d42(%rip),%rax
mov    (%rax),%edi
call   1070 <feof@plt>
cmp    $0x0,%rax
je     12bc <main+0x11c>
jmp    1323 <main+0x183>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x5,-0x20(%rbp)
jne    12f6 <main+0x156>
movsbl -0x21(%rbp),%eax
cmp    $0x5b,%eax
jne    12f6 <main+0x156>
movsbl -0x22(%rbp),%eax
cmp    $0x2c,%eax
jne    12f6 <main+0x156>
movsbl -0x23(%rbp),%eax
cmp    $0x5d,%eax
je     131e <main+0x17e>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
lea    0xd29(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2cc4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1545 <main+0x3a5>
jmp    11d9 <main+0x39>
cmpl   $0x2,-0x1c(%rbp)
jge    1355 <main+0x1b5>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
lea    0xcf2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2c8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1545 <main+0x3a5>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
subsd  (%rax),%xmm0
call   1040 <dblabs@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   10b0 <pow@plt>
mov    %rax,-0x50(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
subsd  0x8(%rax),%xmm0
call   1040 <dblabs@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   10b0 <pow@plt>
mov    -0x50(%rbp),%rdi
add    %rax,%rdi
call   10c0 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    150c <main+0x36c>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    14f9 <main+0x359>
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
subsd  (%rax),%xmm0
call   1040 <dblabs@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   10b0 <pow@plt>
mov    %rax,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
subsd  0x8(%rax),%xmm0
call   1040 <dblabs@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   10b0 <pow@plt>
mov    -0x58(%rbp),%rdi
add    %rax,%rdi
call   10c0 <sqrt@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    14b4 <main+0x314>
movsd  -0x48(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
call   1050 <abs@plt>
movsd  0xb6c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    14b4 <main+0x314>
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x1,-0x34(%rbp)
jmp    14e6 <main+0x346>
movsd  -0x48(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
call   1050 <abs@plt>
movaps %xmm0,%xmm1
movsd  0xb32(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    14e1 <main+0x341>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    14e6 <main+0x346>
jmp    14eb <main+0x34b>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    13e4 <main+0x244>
jmp    14fe <main+0x35e>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    13ca <main+0x22a>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xb20(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    -0x34(%rbp),%esi
lea    0xb33(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2a90(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    $0x18,%edi
call   1090 <malloc@plt>
mov    %rax,%r13
lea    0xe83(%rip),%rdi
call   1050 <puts@plt>
mov    $0x8,%ebp
xor    %r15d,%r15d
lea    0x2(%rsp),%r12
lea    0x1(%rsp),%rbx
nopl   0x0(%rax)
mov    %r13,%rdi
mov    %ebp,%esi
call   10a0 <realloc@plt>
mov    %rax,%r13
mov    $0x10,%edi
call   1090 <malloc@plt>
mov    %rax,0x0(%r13,%r15,8)
movb   $0x20,0x3(%rsp)
movb   $0x20,0x2(%rsp)
movb   $0x20,0x1(%rsp)
lea    0x8(%rax),%r8
lea    0xde2(%rip),%rdi
lea    0x3(%rsp),%rsi
mov    %rax,%rdx
mov    %r12,%rcx
mov    %rbx,%r9
call   10b0 <scanf@plt>
mov    %eax,%r14d
cmpb   $0x5b,0x3(%rsp)
jne    1251 <main+0xa1>
cmpb   $0x2c,0x2(%rsp)
jne    1292 <main+0xe2>
cmpb   $0x5d,0x1(%rsp)
jne    1292 <main+0xe2>
mov    0x2d90(%rip),%rax
mov    (%rax),%edi
call   1080 <feof@plt>
test   %rax,%rax
jne    128c <main+0xdc>
cmp    $0x5,%r14d
jne    1292 <main+0xe2>
cmpb   $0x5b,0x3(%rsp)
jne    1292 <main+0xe2>
cmpb   $0x2c,0x2(%rsp)
jne    1292 <main+0xe2>
add    $0x8,%ebp
add    $0x1,%r15
cmpb   $0x5d,0x1(%rsp)
je     11f0 <main+0x40>
jmp    1292 <main+0xe2>
cmp    $0x1,%r15d
ja     12be <main+0x10e>
mov    %r13,%rdi
call   1030 <free@plt>
lea    0xdc8(%rip),%rdi
call   1050 <puts@plt>
mov    0x2d2b(%rip),%rax
mov    (%rax),%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x0(%r13),%rax
mov    0x8(%r13),%rcx
movsd  (%rcx),%xmm0
subsd  (%rax),%xmm0
call   1040 <dblabs@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   10c0 <pow@plt>
mov    %rax,%rbp
mov    0x0(%r13),%rax
mov    0x8(%r13),%rcx
movsd  0x8(%rcx),%xmm0
subsd  0x8(%rax),%xmm0
call   1040 <dblabs@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   10c0 <pow@plt>
add    %rax,%rbp
mov    %rbp,%rdi
call   10d0 <sqrt@plt>
mov    %r15d,%ebx
add    $0xffffffff,%r15d
cmp    $0x2,%r15d
mov    $0x1,%eax
cmovge %r15d,%eax
mov    %rax,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %r15d,%r15d
mov    %rbx,0x18(%rsp)
mov    %r13,%r12
movl   $0x0,0x4(%rsp)
jmp    1368 <main+0x1b8>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x8,%r12
add    $0xffffffffffffffff,%rbx
mov    0x20(%rsp),%r15
cmp    0x10(%rsp),%r15
je     1457 <main+0x2a7>
lea    0x1(%r15),%rax
cmp    0x18(%rsp),%rax
mov    %rax,0x20(%rsp)
jae    1350 <main+0x1a0>
mov    $0x1,%r14d
jmp    1397 <main+0x1e7>
movl   $0x1,0x4(%rsp)
movsd  %xmm1,0x8(%rsp)
add    $0x1,%r14
cmp    %r14,%rbx
je     1350 <main+0x1a0>
mov    0x0(%r13,%r15,8),%rax
movsd  (%rax),%xmm0
mov    (%r12,%r14,8),%rax
subsd  (%rax),%xmm0
call   1040 <dblabs@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   10c0 <pow@plt>
mov    %rax,%rbp
mov    0x0(%r13,%r15,8),%rax
movsd  0x8(%rax),%xmm0
mov    (%r12,%r14,8),%rax
subsd  0x8(%rax),%xmm0
call   1040 <dblabs@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   10c0 <pow@plt>
add    %rax,%rbp
mov    %rbp,%rdi
call   10d0 <sqrt@plt>
movapd %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
ucomisd %xmm1,%xmm0
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
jbe    1432 <main+0x282>
movapd %xmm2,%xmm0
movsd  %xmm1,0x30(%rsp)
movsd  %xmm2,0x28(%rsp)
call   1060 <abs@plt>
movsd  0x28(%rsp),%xmm2
movsd  0x30(%rsp),%xmm1
ucomisd 0xbd4(%rip),%xmm0
ja     1380 <main+0x1d0>
movapd %xmm2,%xmm0
call   1060 <abs@plt>
movsd  0xbbd(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    138e <main+0x1de>
addl   $0x1,0x4(%rsp)
jmp    138e <main+0x1de>
mov    %r13,%rdi
call   1030 <free@plt>
lea    0xbb4(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1070 <printf@plt>
lea    0xbc4(%rip),%rdi
mov    0x4(%rsp),%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x2b44(%rip),%rax
jmp    12ad <main+0xfd>

LLVM IR (-O0):
@.str = [21 x i8] c"Zadejte souradnice:\0A\00"
@.str.1 = [18 x i8] c" %c %lf %c %lf %c\00"
@.str.2 = [18 x i8] c"Nespravny vstup.\0A\00"
@EXIT_FAILURE = global i32 0
@stdin = global i32 0
@.str.3 = [36 x i8] c"Vzdalenost nejblizsich letadel: %g\0A\00"
@.str.4 = [23 x i8] c"Nalezenych dvojic: %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
%12 = alloca double
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%17 = call i64 @malloc(i32 24)
%18 = inttoptr i64 %17 to double**
store double** %18, double*** %6
store i32 0, i32* %7
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %2, %91
%21 = load double**, double*** %6
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
%24 = sext i32 %23 to i64
%25 = mul i64 %24, 8
%26 = trunc i64 %25 to i32
%27 = call i64 @realloc(double** %21, i32 %26)
%28 = inttoptr i64 %27 to double**
store double** %28, double*** %6
%29 = call i64 @malloc(i32 16)
%30 = inttoptr i64 %29 to double*
%31 = load double**, double*** %6
%32 = load i32, i32* %7
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double*, double** %31, i64 %33
store double* %30, double** %34
store i8 32, i8* %9
store i8 32, i8* %10
store i8 32, i8* %11
%35 = load double**, double*** %6
%36 = load i32, i32* %7
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double*, double** %35, i64 %37
%39 = load double*, double** %38
%40 = getelementptr inbounds double, double* %39, i64 0
%41 = load double**, double*** %6
%42 = load i32, i32* %7
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double*, double** %41, i64 %43
%45 = load double*, double** %44
%46 = getelementptr inbounds double, double* %45, i64 1
%47 = call i32 @scanf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %9, double* %40, i8* %10, double* %46, i8* %11)
store i32 %47, i32* %8
%48 = load i8, i8* %9
%49 = sext i8 %48 to i32
%50 = icmp eq i32 %49, 91
br i1 %50, label %51, label %64
51: ; preds = %20
%52 = load i8, i8* %10
%53 = sext i8 %52 to i32
%54 = icmp ne i32 %53, 44
br i1 %54, label %59, label %55
55: ; preds = %51
%56 = load i8, i8* %11
%57 = sext i8 %56 to i32
%58 = icmp ne i32 %57, 93
br i1 %58, label %59, label %64
59: ; preds = %55, %51
%60 = load double**, double*** %6
%61 = call i32 @free(double** %60)
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%63 = load i32, i32* @EXIT_FAILURE
store i32 %63, i32* %3
br label %215
64: ; preds = %55, %20
%65 = load i32, i32* @stdin
%66 = call i64 @feof(i32 %65)
%67 = icmp ne i64 %66, 0
br i1 %67, label %68, label %69
68: ; preds = %64
br label %92
69: ; preds = %64
%70 = load i32, i32* %7
%71 = add nsw i32 %70, 1
store i32 %71, i32* %7
%72 = load i32, i32* %8
%73 = icmp ne i32 %72, 5
br i1 %73, label %86, label %74
74: ; preds = %69
%75 = load i8, i8* %9
%76 = sext i8 %75 to i32
%77 = icmp ne i32 %76, 91
br i1 %77, label %86, label %78
78: ; preds = %74
%79 = load i8, i8* %10
%80 = sext i8 %79 to i32
%81 = icmp ne i32 %80, 44
br i1 %81, label %86, label %82
82: ; preds = %78
%83 = load i8, i8* %11
%84 = sext i8 %83 to i32
%85 = icmp ne i32 %84, 93
br i1 %85, label %86, label %91
86: ; preds = %82, %78, %74, %69
%87 = load double**, double*** %6
%88 = call i32 @free(double** %87)
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%90 = load i32, i32* @EXIT_FAILURE
store i32 %90, i32* %3
br label %215
91: ; preds = %82
br label %20
92: ; preds = %68
%93 = load i32, i32* %7
%94 = icmp slt i32 %93, 2
br i1 %94, label %95, label %100
95: ; preds = %92
%96 = load double**, double*** %6
%97 = call i32 @free(double** %96)
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%99 = load i32, i32* @EXIT_FAILURE
store i32 %99, i32* %3
br label %215
100: ; preds = %92
%101 = load double**, double*** %6
%102 = getelementptr inbounds double*, double** %101, i64 1
%103 = load double*, double** %102
%104 = getelementptr inbounds double, double* %103, i64 0
%105 = load double, double* %104
%106 = load double**, double*** %6
%107 = getelementptr inbounds double*, double** %106, i64 0
%108 = load double*, double** %107
%109 = getelementptr inbounds double, double* %108, i64 0
%110 = load double, double* %109
%111 = fsub double %105, %110
%112 = call i32 @dblabs(double %111)
%113 = call i64 @pow(i32 %112, i32 2)
%114 = load double**, double*** %6
%115 = getelementptr inbounds double*, double** %114, i64 1
%116 = load double*, double** %115
%117 = getelementptr inbounds double, double* %116, i64 1
%118 = load double, double* %117
%119 = load double**, double*** %6
%120 = getelementptr inbounds double*, double** %119, i64 0
%121 = load double*, double** %120
%122 = getelementptr inbounds double, double* %121, i64 1
%123 = load double, double* %122
%124 = fsub double %118, %123
%125 = call i32 @dblabs(double %124)
%126 = call i64 @pow(i32 %125, i32 2)
%127 = add nsw i64 %113, %126
%128 = call double @sqrt(i64 %127)
store double %128, double* %12
store i32 0, i32* %13
store i32 0, i32* %14
br label %129
129: ; preds = %204, %100
%130 = load i32, i32* %14
%131 = load i32, i32* %7
%132 = sub nsw i32 %131, 1
%133 = icmp slt i32 %130, %132
br i1 %133, label %134, label %207
134: ; preds = %129
%135 = load i32, i32* %14
%136 = add nsw i32 %135, 1
store i32 %136, i32* %15
br label %137
137: ; preds = %200, %134
%138 = load i32, i32* %15
%139 = load i32, i32* %7
%140 = icmp slt i32 %138, %139
br i1 %140, label %141, label %203
141: ; preds = %137
%142 = load double**, double*** %6
%143 = load i32, i32* %14
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds double*, double** %142, i64 %144
%146 = load double*, double** %145
%147 = getelementptr inbounds double, double* %146, i64 0
%148 = load double, double* %147
%149 = load double**, double*** %6
%150 = load i32, i32* %15
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds double*, double** %149, i64 %151
%153 = load double*, double** %152
%154 = getelementptr inbounds double, double* %153, i64 0
%155 = load double, double* %154
%156 = fsub double %148, %155
%157 = call i32 @dblabs(double %156)
%158 = call i64 @pow(i32 %157, i32 2)
%159 = load double**, double*** %6
%160 = load i32, i32* %14
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds double*, double** %159, i64 %161
%163 = load double*, double** %162
%164 = getelementptr inbounds double, double* %163, i64 1
%165 = load double, double* %164
%166 = load double**, double*** %6
%167 = load i32, i32* %15
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds double*, double** %166, i64 %168
%170 = load double*, double** %169
%171 = getelementptr inbounds double, double* %170, i64 1
%172 = load double, double* %171
%173 = fsub double %165, %172
%174 = call i32 @dblabs(double %173)
%175 = call i64 @pow(i32 %174, i32 2)
%176 = add nsw i64 %158, %175
%177 = call double @sqrt(i64 %176)
store double %177, double* %16
%178 = load double, double* %16
%179 = load double, double* %12
%180 = fcmp olt double %178, %179
br i1 %180, label %181, label %189
181: ; preds = %141
%182 = load double, double* %16
%183 = load double, double* %12
%184 = fsub double %182, %183
%185 = call double @abs(double %184)
%186 = fcmp ogt double %185, 0x3D719799812DEA11
br i1 %186, label %187, label %189
187: ; preds = %181
%188 = load double, double* %16
store double %188, double* %12
store i32 1, i32* %13
br label %199
189: ; preds = %181, %141
%190 = load double, double* %16
%191 = load double, double* %12
%192 = fsub double %190, %191
%193 = call double @abs(double %192)
%194 = fcmp olt double %193, 0x3D719799812DEA11
br i1 %194, label %195, label %198
195: ; preds = %189
%196 = load i32, i32* %13
%197 = add nsw i32 %196, 1
store i32 %197, i32* %13
br label %198
198: ; preds = %195, %189
br label %199
199: ; preds = %198, %187
br label %200
200: ; preds = %199
%201 = load i32, i32* %15
%202 = add nsw i32 %201, 1
store i32 %202, i32* %15
br label %137
203: ; preds = %137
br label %204
204: ; preds = %203
%205 = load i32, i32* %14
%206 = add nsw i32 %205, 1
store i32 %206, i32* %14
br label %129
207: ; preds = %129
%208 = load double**, double*** %6
%209 = call i32 @free(double** %208)
%210 = load double, double* %12
%211 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), double %210)
%212 = load i32, i32* %13
%213 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %212)
%214 = load i32, i32* @EXIT_SUCCESS
store i32 %214, i32* %3
br label %215
215: ; preds = %207, %95, %86, %59
%216 = load i32, i32* %3
ret i32 %216
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c" %c %lf %c %lf %c\00"
@EXIT_FAILURE = global i32 0
@stdin = global i32 0
@.str.3 = [36 x i8] c"Vzdalenost nejblizsich letadel: %g\0A\00"
@.str.4 = [23 x i8] c"Nalezenych dvojic: %d\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [20 x i8] c"Zadejte souradnice:\00"
@str.7 = [17 x i8] c"Nespravny vstup.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = tail call i64 @malloc(i32 24)
%7 = inttoptr i64 %6 to double**
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %38, %2
%10 = phi i64 [ %12, %38 ], [ 0, %2 ]
%11 = phi double** [ %16, %38 ], [ %7, %2 ]
%12 = add nuw i64 %10, 1
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 3
%15 = call i64 @realloc(double** %11, i32 %14)
%16 = inttoptr i64 %15 to double**
%17 = call i64 @malloc(i32 16)
%18 = inttoptr i64 %17 to double*
%19 = getelementptr inbounds double*, double** %16, i64 %10
store double* %18, double** %19
store i8 32, i8* %3
store i8 32, i8* %4
store i8 32, i8* %5
%20 = getelementptr inbounds double, double* %18, i64 1
%21 = call i32 @scanf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %3, double* %18, i8* %4, double* %20, i8* %5)
%22 = load i8, i8* %3
%23 = icmp eq i8 %22, 91
br i1 %23, label %24, label %34
24: ; preds = %9
%25 = load i8, i8* %4
%26 = icmp ne i8 %25, 44
%27 = load i8, i8* %5
%28 = icmp ne i8 %27, 93
%29 = select i1 %26, i1 true, i1 %28
br i1 %29, label %30, label %34
30: ; preds = %24
%31 = inttoptr i64 %15 to double**
%32 = call i32 @free(double** %31)
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.7, i64 0, i64 0))
br label %140
34: ; preds = %24, %9
%35 = load i32, i32* @stdin
%36 = call i64 @feof(i32 %35)
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %53
38: ; preds = %34
%39 = icmp ne i32 %21, 5
%40 = load i8, i8* %3
%41 = icmp ne i8 %40, 91
%42 = select i1 %39, i1 true, i1 %41
%43 = load i8, i8* %4
%44 = icmp ne i8 %43, 44
%45 = select i1 %42, i1 true, i1 %44
%46 = load i8, i8* %5
%47 = icmp ne i8 %46, 93
%48 = select i1 %45, i1 true, i1 %47
br i1 %48, label %49, label %9
49: ; preds = %38
%50 = inttoptr i64 %15 to double**
%51 = call i32 @free(double** %50)
%52 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.7, i64 0, i64 0))
br label %140
53: ; preds = %34
%54 = inttoptr i64 %15 to double**
%55 = trunc i64 %10 to i32
%56 = icmp ult i32 %55, 2
br i1 %56, label %57, label %60
57: ; preds = %53
%58 = call i32 @free(double** %54)
%59 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.7, i64 0, i64 0))
br label %140
60: ; preds = %53
%61 = getelementptr inbounds double*, double** %54, i64 1
%62 = load double*, double** %61
%63 = load double, double* %62
%64 = load double*, double** %54
%65 = load double, double* %64
%66 = fsub double %63, %65
%67 = call i32 @dblabs(double %66)
%68 = call i64 @pow(i32 %67, i32 2)
%69 = load double*, double** %61
%70 = getelementptr inbounds double, double* %69, i64 1
%71 = load double, double* %70
%72 = load double*, double** %54
%73 = getelementptr inbounds double, double* %72, i64 1
%74 = load double, double* %73
%75 = fsub double %71, %74
%76 = call i32 @dblabs(double %75)
%77 = call i64 @pow(i32 %76, i32 2)
%78 = add nsw i64 %77, %68
%79 = call double @sqrt(i64 %78)
%80 = add i32 %55, -1
%81 = and i64 %10, 4294967295
%82 = call i32 @llvm.smax.i32(i32 %80, i32 1)
%83 = zext i32 %82 to i64
br label %89
84: ; preds = %131, %89
%85 = phi double [ %93, %89 ], [ %132, %131 ]
%86 = phi i32 [ %92, %89 ], [ %133, %131 ]
%87 = add nuw nsw i64 %91, 1
%88 = icmp eq i64 %94, %83
br i1 %88, label %136, label %89
89: ; preds = %60, %84
%90 = phi i64 [ 0, %60 ], [ %94, %84 ]
%91 = phi i64 [ 1, %60 ], [ %87, %84 ]
%92 = phi i32 [ 0, %60 ], [ %86, %84 ]
%93 = phi double [ %79, %60 ], [ %85, %84 ]
%94 = add nuw nsw i64 %90, 1
%95 = icmp ult i64 %94, %81
br i1 %95, label %96, label %84
96: ; preds = %89
%97 = getelementptr inbounds double*, double** %54, i64 %90
br label %98
98: ; preds = %96, %131
%99 = phi i64 [ %91, %96 ], [ %134, %131 ]
%100 = phi i32 [ %92, %96 ], [ %133, %131 ]
%101 = phi double [ %93, %96 ], [ %132, %131 ]
%102 = load double*, double** %97
%103 = load double, double* %102
%104 = getelementptr inbounds double*, double** %54, i64 %99
%105 = load double*, double** %104
%106 = load double, double* %105
%107 = fsub double %103, %106
%108 = call i32 @dblabs(double %107)
%109 = call i64 @pow(i32 %108, i32 2)
%110 = load double*, double** %97
%111 = getelementptr inbounds double, double* %110, i64 1
%112 = load double, double* %111
%113 = load double*, double** %104
%114 = getelementptr inbounds double, double* %113, i64 1
%115 = load double, double* %114
%116 = fsub double %112, %115
%117 = call i32 @dblabs(double %116)
%118 = call i64 @pow(i32 %117, i32 2)
%119 = add nsw i64 %118, %109
%120 = call double @sqrt(i64 %119)
%121 = fcmp olt double %120, %101
%122 = fsub double %120, %101
br i1 %121, label %123, label %126
123: ; preds = %98
%124 = call double @abs(double %122)
%125 = fcmp ogt double %124, 0x3D719799812DEA11
br i1 %125, label %131, label %126
126: ; preds = %98, %123
%127 = call double @abs(double %122)
%128 = fcmp olt double %127, 0x3D719799812DEA11
br i1 %128, label %129, label %131
129: ; preds = %126
%130 = add nsw i32 %100, 1
br label %131
131: ; preds = %123, %129, %126
%132 = phi double [ %101, %129 ], [ %101, %126 ], [ %120, %123 ]
%133 = phi i32 [ %130, %129 ], [ %100, %126 ], [ 1, %123 ]
%134 = add nuw nsw i64 %99, 1
%135 = icmp eq i64 %134, %81
br i1 %135, label %84, label %98
136: ; preds = %84
%137 = call i32 @free(double** %54)
%138 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), double %85)
%139 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %86)
br label %140
140: ; preds = %136, %57, %49, %30
%141 = phi i32* [ @EXIT_FAILURE, %30 ], [ @EXIT_FAILURE, %57 ], [ @EXIT_SUCCESS, %136 ], [ @EXIT_FAILURE, %49 ]
%142 = load i32, i32* %141
ret i32 %142
}