#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double floor(double);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ pop(double **, int *);
int /*<<< orphan*/ print_array(double **, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ push(double **, double, int /*<<< orphan*/);
int /*<<< orphan*/ read_array(double **, int *);
int main() {
  double *v, *mm;
  int n, nr_max = 1, nr_min = 1;
  read_array(&v, &n);
  print_array(&v, n);
  double max = v[0] - floor(v[0]);
  for (int i = 0; i < n; i++) {
    if ((v[i] - floor(v[i])) > max) {
      max = v[i] - floor(v[i]);
      nr_max = 1;
    } else if (v[i] - floor(v[i]) == max)
      nr_max++;
  }
  double min = max;
  for (int i = 0; i < n; i++) {
    if (v[i] - floor(v[i]) < min) {
      min = v[i] - floor(v[i]);
      nr_min = 1;
    } else if (v[i] - floor(v[i]) == min)
      nr_min++;
  }
  printf("\n\n Min: %.2f(%d)", min, nr_min);
  printf("\n Max: %.2f(%d)\n", max, nr_max);
  int n2 = nr_min + nr_max;
  mm = (double *)malloc(n2 * sizeof(int));
  int k = 0;
  for (int i = 0; i < n; i++) {
    if (min == v[i] - floor(v[i])) {
      push(&mm, v[i], k++);
    }
  }
  for (int i = 0; i < n; i++) {
    if (max == v[i] - floor(v[i])) {
      push(&mm, v[i], k++);
    }
  }
  free(v);
  printf("\nQueue is: ");
  for (int i = 0; i < k; i++)
    printf("- %.2f ", mm[i]);
  pop(&mm, &k);
  printf("\nQueue after pop(): ");
  for (int i = 0; i < k; i++)
    printf("- %.2f ", mm[i]);
  printf("\n");
  free(mm);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1090 <read_array@plt>
mov    -0x1c(%rbp),%esi
lea    -0x10(%rbp),%rdi
call   1040 <print_array@plt>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   10a0 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    12d5 <main+0x155>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   10a0 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
subsd  %xmm1,%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    1273 <main+0xf3>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   10a0 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x1,-0x20(%rbp)
jmp    12c2 <main+0x142>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   10a0 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
subsd  %xmm1,%xmm0
ucomisd -0x30(%rbp),%xmm0
jne    12bd <main+0x13d>
jp     12bd <main+0x13d>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12c2 <main+0x142>
jmp    12c7 <main+0x147>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11eb <main+0x6b>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13e3 <main+0x263>
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   10a0 <floor@plt>
movsd  -0x88(%rbp),%xmm1
ff
subsd  %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    137b <main+0x1fb>
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   10a0 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x90(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x1,-0x24(%rbp)
jmp    13d0 <main+0x250>
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   10a0 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x98(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
ucomisd -0x40(%rbp),%xmm0
jne    13cb <main+0x24b>
jp     13cb <main+0x24b>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    13d0 <main+0x250>
jmp    13d5 <main+0x255>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    12e6 <main+0x166>
movsd  -0x40(%rbp),%xmm0
mov    -0x24(%rbp),%esi
lea    0xc0e(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  -0x30(%rbp),%xmm0
mov    -0x20(%rbp),%esi
lea    0xc09(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x24(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x48(%rbp)
movslq -0x48(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    14d4 <main+0x354>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x10(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x10(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   10a0 <floor@plt>
movsd  -0xa8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xa0(%rbp),%xmm0
ff
subsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jne    14c1 <main+0x341>
jp     14c1 <main+0x341>
mov    -0x10(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x4c(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
lea    -0x18(%rbp),%rdi
call   1080 <push@plt>
jmp    14c6 <main+0x346>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1439 <main+0x2b9>
movl   $0x0,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1576 <main+0x3f6>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
mov    -0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
mov    -0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   10a0 <floor@plt>
movsd  -0xb8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xb0(%rbp),%xmm0
ff
subsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jne    1563 <main+0x3e3>
jp     1563 <main+0x3e3>
mov    -0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x4c(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
lea    -0x18(%rbp),%rdi
call   1080 <push@plt>
jmp    1568 <main+0x3e8>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    14db <main+0x35b>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
lea    0xa9c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jge    15c9 <main+0x449>
mov    -0x18(%rbp),%rax
movslq -0x58(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xa7a(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    1594 <main+0x414>
lea    -0x18(%rbp),%rdi
lea    -0x4c(%rbp),%rsi
call   1060 <pop@plt>
lea    0xa59(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jge    1620 <main+0x4a0>
mov    -0x18(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xa23(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    15eb <main+0x46b>
lea    0x9f9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0x30(%rsp),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   10a0 <read_array@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
call   1050 <print_array@plt>
mov    0x30(%rsp),%r15
movsd  (%r15),%xmm0
movsd  %xmm0,0x28(%rsp)
call   10b0 <floor@plt>
movsd  0x28(%rsp),%xmm2
movapd %xmm2,%xmm1
subsd  %xmm0,%xmm1
mov    0x4(%rsp),%r12d
test   %r12d,%r12d
movsd  %xmm1,0x8(%rsp)
jle    12f5 <main+0x165>
mov    $0x1,%ebx
mov    $0x1,%ebp
nopl   (%rax)
movsd  %xmm2,0x20(%rsp)
movapd %xmm2,%xmm0
call   10b0 <floor@plt>
movsd  0x20(%rsp),%xmm2
subsd  %xmm0,%xmm2
movsd  0x8(%rsp),%xmm1
ucomisd %xmm1,%xmm2
movapd %xmm2,%xmm0
mov    $0x1,%r13d
ja     123d <main+0xad>
jne    1236 <main+0xa6>
jp     1236 <main+0xa6>
add    $0x1,%ebx
movapd %xmm1,%xmm0
mov    %ebx,%r13d
cmp    %rbp,%r12
je     1257 <main+0xc7>
movsd  (%r15,%rbp,8),%xmm2
add    $0x1,%rbp
mov    %r13d,%ebx
movsd  %xmm0,0x8(%rsp)
jmp    1200 <main+0x70>
test   %r12d,%r12d
movsd  0x28(%rsp),%xmm1
mov    $0x1,%r14d
jle    1307 <main+0x177>
mov    $0x1,%ebp
movsd  %xmm0,0x18(%rsp)
movsd  %xmm0,0x8(%rsp)
nopl   (%rax)
movsd  %xmm1,0x28(%rsp)
movapd %xmm1,%xmm0
call   10b0 <floor@plt>
movsd  0x28(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm2
ucomisd %xmm1,%xmm2
jbe    12c0 <main+0x130>
mov    $0x1,%r14d
movapd %xmm1,%xmm2
jmp    12cc <main+0x13c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
ucomisd %xmm2,%xmm1
jne    12cc <main+0x13c>
jp     12cc <main+0x13c>
add    $0x1,%r14d
movsd  0x18(%rsp),%xmm0
cmp    %rbp,%r12
je     12e9 <main+0x159>
movsd  %xmm2,0x8(%rsp)
movsd  (%r15,%rbp,8),%xmm1
add    $0x1,%rbp
jmp    1280 <main+0xf0>
movsd  %xmm0,0x8(%rsp)
movapd %xmm2,%xmm0
jmp    130d <main+0x17d>
mov    $0x1,%r13d
mov    $0x1,%r14d
movapd %xmm1,%xmm0
jmp    130d <main+0x17d>
movsd  %xmm0,0x8(%rsp)
lea    0xcec(%rip),%rdi
movsd  %xmm0,0x18(%rsp)
mov    %r14d,%esi
mov    $0x1,%al
call   1060 <printf@plt>
lea    0xce6(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    %r13d,%esi
mov    $0x1,%al
call   1060 <printf@plt>
add    %r13d,%r14d
shl    $0x2,%r14d
mov    %r14d,%edi
call   1080 <malloc@plt>
mov    %rax,0x10(%rsp)
movl   $0x0,(%rsp)
mov    0x4(%rsp),%r15d
test   %r15d,%r15d
jle    143e <main+0x2ae>
xor    %r12d,%r12d
lea    0x10(%rsp),%r14
xor    %ebp,%ebp
jmp    137c <main+0x1ec>
add    $0x1,%rbp
movslq %r15d,%rax
cmp    %rax,%rbp
jge    13ce <main+0x23e>
mov    0x30(%rsp),%rax
movsd  (%rax,%rbp,8),%xmm0
movsd  %xmm0,0x20(%rsp)
call   10b0 <floor@plt>
movsd  0x20(%rsp),%xmm2
movapd %xmm2,%xmm1
subsd  %xmm0,%xmm1
movsd  0x18(%rsp),%xmm0
ucomisd %xmm1,%xmm0
jne    1370 <main+0x1e0>
jp     1370 <main+0x1e0>
lea    0x1(%r12),%ebx
mov    %ebx,(%rsp)
mov    %r14,%rdi
movapd %xmm2,%xmm0
mov    %r12d,%esi
call   1090 <push@plt>
mov    0x4(%rsp),%r15d
mov    %ebx,%r12d
jmp    1370 <main+0x1e0>
test   %r15d,%r15d
jle    143e <main+0x2ae>
xor    %ebp,%ebp
lea    0x10(%rsp),%r14
jmp    13ec <main+0x25c>
nopl   0x0(%rax)
add    $0x1,%rbp
movslq %r15d,%rax
cmp    %rax,%rbp
jge    143e <main+0x2ae>
mov    0x30(%rsp),%rax
movsd  (%rax,%rbp,8),%xmm0
movsd  %xmm0,0x20(%rsp)
call   10b0 <floor@plt>
movsd  0x20(%rsp),%xmm2
movapd %xmm2,%xmm1
subsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
ucomisd %xmm1,%xmm0
jne    13e0 <main+0x250>
jp     13e0 <main+0x250>
lea    0x1(%r12),%ebx
mov    %ebx,(%rsp)
mov    %r14,%rdi
movapd %xmm2,%xmm0
mov    %r12d,%esi
call   1090 <push@plt>
mov    0x4(%rsp),%r15d
mov    %ebx,%r12d
jmp    13e0 <main+0x250>
mov    0x30(%rsp),%rdi
call   1030 <free@plt>
lea    0xbd3(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movslq (%rsp),%rbp
test   %rbp,%rbp
jle    148d <main+0x2fd>
xor    %ebx,%ebx
lea    0xbc6(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp),%rax
movsd  (%rax,%rbx,8),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
add    $0x1,%rbx
cmp    %rbp,%rbx
jl     1470 <main+0x2e0>
lea    0x10(%rsp),%rdi
mov    %rsp,%rsi
call   1070 <pop@plt>
lea    0xb95(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
cmpl   $0x0,(%rsp)
jle    14e1 <main+0x351>
xor    %ebp,%ebp
lea    0xb77(%rip),%rbx
nopw   0x0(%rax,%rax,1)
mov    0x10(%rsp),%rax
movsd  (%rax,%rbp,8),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
add    $0x1,%rbp
movslq (%rsp),%rax
cmp    %rax,%rbp
jl     14c0 <main+0x330>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"\0A\0A Min: %.2f(%d)\00"
@.str.1 = [17 x i8] c"\0A Max: %.2f(%d)\0A\00"
@.str.2 = [12 x i8] c"\0AQueue is: \00"
@.str.3 = [8 x i8] c"- %.2f \00"
@.str.4 = [21 x i8] c"\0AQueue after pop(): \00"
@.str.5 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double*
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca i32
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %5
store i32 1, i32* %6
%17 = call i32 @read_array(double** %2, i32* %4)
%18 = load i32, i32* %4
%19 = call i32 @print_array(double** %2, i32 %18)
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 0
%22 = load double, double* %21
%23 = load double*, double** %2
%24 = getelementptr inbounds double, double* %23, i64 0
%25 = load double, double* %24
%26 = call double @llvm.floor.f64(double %25)
%27 = fsub double %22, %26
store double %27, double* %7
store i32 0, i32* %8
br label %28
28: ; preds = %80, %0
%29 = load i32, i32* %8
%30 = load i32, i32* %4
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %83
32: ; preds = %28
%33 = load double*, double** %2
%34 = load i32, i32* %8
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double, double* %33, i64 %35
%37 = load double, double* %36
%38 = load double*, double** %2
%39 = load i32, i32* %8
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds double, double* %38, i64 %40
%42 = load double, double* %41
%43 = call double @llvm.floor.f64(double %42)
%44 = fsub double %37, %43
%45 = load double, double* %7
%46 = fcmp ogt double %44, %45
br i1 %46, label %47, label %60
47: ; preds = %32
%48 = load double*, double** %2
%49 = load i32, i32* %8
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds double, double* %48, i64 %50
%52 = load double, double* %51
%53 = load double*, double** %2
%54 = load i32, i32* %8
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds double, double* %53, i64 %55
%57 = load double, double* %56
%58 = call double @llvm.floor.f64(double %57)
%59 = fsub double %52, %58
store double %59, double* %7
store i32 1, i32* %5
br label %79
60: ; preds = %32
%61 = load double*, double** %2
%62 = load i32, i32* %8
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds double, double* %61, i64 %63
%65 = load double, double* %64
%66 = load double*, double** %2
%67 = load i32, i32* %8
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %66, i64 %68
%70 = load double, double* %69
%71 = call double @llvm.floor.f64(double %70)
%72 = fsub double %65, %71
%73 = load double, double* %7
%74 = fcmp oeq double %72, %73
br i1 %74, label %75, label %78
75: ; preds = %60
%76 = load i32, i32* %5
%77 = add nsw i32 %76, 1
store i32 %77, i32* %5
br label %78
78: ; preds = %75, %60
br label %79
79: ; preds = %78, %47
br label %80
80: ; preds = %79
%81 = load i32, i32* %8
%82 = add nsw i32 %81, 1
store i32 %82, i32* %8
br label %28
83: ; preds = %28
%84 = load double, double* %7
store double %84, double* %9
store i32 0, i32* %10
br label %85
85: ; preds = %137, %83
%86 = load i32, i32* %10
%87 = load i32, i32* %4
%88 = icmp slt i32 %86, %87
br i1 %88, label %89, label %140
89: ; preds = %85
%90 = load double*, double** %2
%91 = load i32, i32* %10
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds double, double* %90, i64 %92
%94 = load double, double* %93
%95 = load double*, double** %2
%96 = load i32, i32* %10
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds double, double* %95, i64 %97
%99 = load double, double* %98
%100 = call double @llvm.floor.f64(double %99)
%101 = fsub double %94, %100
%102 = load double, double* %9
%103 = fcmp olt double %101, %102
br i1 %103, label %104, label %117
104: ; preds = %89
%105 = load double*, double** %2
%106 = load i32, i32* %10
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds double, double* %105, i64 %107
%109 = load double, double* %108
%110 = load double*, double** %2
%111 = load i32, i32* %10
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds double, double* %110, i64 %112
%114 = load double, double* %113
%115 = call double @llvm.floor.f64(double %114)
%116 = fsub double %109, %115
store double %116, double* %9
store i32 1, i32* %6
br label %136
117: ; preds = %89
%118 = load double*, double** %2
%119 = load i32, i32* %10
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds double, double* %118, i64 %120
%122 = load double, double* %121
%123 = load double*, double** %2
%124 = load i32, i32* %10
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds double, double* %123, i64 %125
%127 = load double, double* %126
%128 = call double @llvm.floor.f64(double %127)
%129 = fsub double %122, %128
%130 = load double, double* %9
%131 = fcmp oeq double %129, %130
br i1 %131, label %132, label %135
132: ; preds = %117
%133 = load i32, i32* %6
%134 = add nsw i32 %133, 1
store i32 %134, i32* %6
br label %135
135: ; preds = %132, %117
br label %136
136: ; preds = %135, %104
br label %137
137: ; preds = %136
%138 = load i32, i32* %10
%139 = add nsw i32 %138, 1
store i32 %139, i32* %10
br label %85
140: ; preds = %85
%141 = load double, double* %9
%142 = load i32, i32* %6
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %141, i32 %142)
%144 = load double, double* %7
%145 = load i32, i32* %5
%146 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %144, i32 %145)
%147 = load i32, i32* %6
%148 = load i32, i32* %5
%149 = add nsw i32 %147, %148
store i32 %149, i32* %11
%150 = load i32, i32* %11
%151 = sext i32 %150 to i64
%152 = mul i64 %151, 4
%153 = trunc i64 %152 to i32
%154 = call i64 @malloc(i32 %153)
%155 = inttoptr i64 %154 to double*
store double* %155, double** %3
store i32 0, i32* %12
store i32 0, i32* %13
br label %156
156: ; preds = %185, %140
%157 = load i32, i32* %13
%158 = load i32, i32* %4
%159 = icmp slt i32 %157, %158
br i1 %159, label %160, label %188
160: ; preds = %156
%161 = load double, double* %9
%162 = load double*, double** %2
%163 = load i32, i32* %13
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds double, double* %162, i64 %164
%166 = load double, double* %165
%167 = load double*, double** %2
%168 = load i32, i32* %13
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds double, double* %167, i64 %169
%171 = load double, double* %170
%172 = call double @llvm.floor.f64(double %171)
%173 = fsub double %166, %172
%174 = fcmp oeq double %161, %173
br i1 %174, label %175, label %184
175: ; preds = %160
%176 = load double*, double** %2
%177 = load i32, i32* %13
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds double, double* %176, i64 %178
%180 = load double, double* %179
%181 = load i32, i32* %12
%182 = add nsw i32 %181, 1
store i32 %182, i32* %12
%183 = call i32 @push(double** %3, double %180, i32 %181)
br label %184
184: ; preds = %175, %160
br label %185
185: ; preds = %184
%186 = load i32, i32* %13
%187 = add nsw i32 %186, 1
store i32 %187, i32* %13
br label %156
188: ; preds = %156
store i32 0, i32* %14
br label %189
189: ; preds = %218, %188
%190 = load i32, i32* %14
%191 = load i32, i32* %4
%192 = icmp slt i32 %190, %191
br i1 %192, label %193, label %221
193: ; preds = %189
%194 = load double, double* %7
%195 = load double*, double** %2
%196 = load i32, i32* %14
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds double, double* %195, i64 %197
%199 = load double, double* %198
%200 = load double*, double** %2
%201 = load i32, i32* %14
%202 = sext i32 %201 to i64
%203 = getelementptr inbounds double, double* %200, i64 %202
%204 = load double, double* %203
%205 = call double @llvm.floor.f64(double %204)
%206 = fsub double %199, %205
%207 = fcmp oeq double %194, %206
br i1 %207, label %208, label %217
208: ; preds = %193
%209 = load double*, double** %2
%210 = load i32, i32* %14
%211 = sext i32 %210 to i64
%212 = getelementptr inbounds double, double* %209, i64 %211
%213 = load double, double* %212
%214 = load i32, i32* %12
%215 = add nsw i32 %214, 1
store i32 %215, i32* %12
%216 = call i32 @push(double** %3, double %213, i32 %214)
br label %217
217: ; preds = %208, %193
br label %218
218: ; preds = %217
%219 = load i32, i32* %14
%220 = add nsw i32 %219, 1
store i32 %220, i32* %14
br label %189
221: ; preds = %189
%222 = load double*, double** %2
%223 = call i32 @free(double* %222)
%224 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %15
br label %225
225: ; preds = %236, %221
%226 = load i32, i32* %15
%227 = load i32, i32* %12
%228 = icmp slt i32 %226, %227
br i1 %228, label %229, label %239
229: ; preds = %225
%230 = load double*, double** %3
%231 = load i32, i32* %15
%232 = sext i32 %231 to i64
%233 = getelementptr inbounds double, double* %230, i64 %232
%234 = load double, double* %233
%235 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double %234)
br label %236
236: ; preds = %229
%237 = load i32, i32* %15
%238 = add nsw i32 %237, 1
store i32 %238, i32* %15
br label %225
239: ; preds = %225
%240 = call i32 @pop(double** %3, i32* %12)
%241 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %16
br label %242
242: ; preds = %253, %239
%243 = load i32, i32* %16
%244 = load i32, i32* %12
%245 = icmp slt i32 %243, %244
br i1 %245, label %246, label %256
246: ; preds = %242
%247 = load double*, double** %3
%248 = load i32, i32* %16
%249 = sext i32 %248 to i64
%250 = getelementptr inbounds double, double* %247, i64 %249
%251 = load double, double* %250
%252 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double %251)
br label %253
253: ; preds = %246
%254 = load i32, i32* %16
%255 = add nsw i32 %254, 1
store i32 %255, i32* %16
br label %242
256: ; preds = %242
%257 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%258 = load double*, double** %3
%259 = call i32 @free(double* %258)
%260 = load i32, i32* %1
ret i32 %260
}

LLVM IR (-O2):
@.str = [17 x i8] c"\0A\0A Min: %.2f(%d)\00"
@.str.1 = [17 x i8] c"\0A Max: %.2f(%d)\0A\00"
@.str.2 = [12 x i8] c"\0AQueue is: \00"
@.str.3 = [8 x i8] c"- %.2f \00"
@.str.4 = [21 x i8] c"\0AQueue after pop(): \00"
define i32 @main() {
%1 = alloca double*
%2 = alloca double*
%3 = alloca i32
%4 = alloca i32
%5 = bitcast double** %1 to i8*
%6 = bitcast double** %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = call i32 @read_array(double** %1, i32* %3)
%9 = load i32, i32* %3
%10 = call i32 @print_array(double** %1, i32 %9)
%11 = load double*, double** %1
%12 = load double, double* %11
%13 = call double @llvm.floor.f64(double %12)
%14 = fsub double %12, %13
%15 = load i32, i32* %3
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %42
17: ; preds = %0
%18 = zext i32 %15 to i64
br label %22
19: ; preds = %34
br i1 %16, label %20, label %42
20: ; preds = %19
%21 = zext i32 %15 to i64
br label %56
22: ; preds = %39, %17
%23 = phi double [ %12, %17 ], [ %41, %39 ]
%24 = phi i64 [ 0, %17 ], [ %37, %39 ]
%25 = phi i32 [ 1, %17 ], [ %36, %39 ]
%26 = phi double [ %14, %17 ], [ %35, %39 ]
%27 = call double @llvm.floor.f64(double %23)
%28 = fsub double %23, %27
%29 = fcmp ogt double %28, %26
br i1 %29, label %34, label %30
30: ; preds = %22
%31 = fcmp oeq double %28, %26
br i1 %31, label %32, label %34
32: ; preds = %30
%33 = add nsw i32 %25, 1
br label %34
34: ; preds = %22, %32, %30
%35 = phi double [ %26, %32 ], [ %26, %30 ], [ %28, %22 ]
%36 = phi i32 [ %33, %32 ], [ %25, %30 ], [ 1, %22 ]
%37 = add nuw nsw i64 %24, 1
%38 = icmp eq i64 %37, %18
br i1 %38, label %19, label %39
39: ; preds = %34
%40 = getelementptr inbounds double, double* %11, i64 %37
%41 = load double, double* %40
br label %22
42: ; preds = %68, %0, %19
%43 = phi i32 [ %36, %19 ], [ 1, %0 ], [ %36, %68 ]
%44 = phi double [ %35, %19 ], [ %14, %0 ], [ %35, %68 ]
%45 = phi i32 [ 1, %19 ], [ 1, %0 ], [ %69, %68 ]
%46 = phi double [ %35, %19 ], [ %14, %0 ], [ %70, %68 ]
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %46, i32 %45)
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %44, i32 %43)
%49 = add nsw i32 %45, %43
%50 = shl i32 %49, 2
%51 = call i64 @malloc(i32 %50)
%52 = inttoptr i64 %51 to double*
store double* %52, double** %2
%53 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%54 = load i32, i32* %3
%55 = icmp sgt i32 %54, 0
br i1 %55, label %78, label %98
56: ; preds = %73, %20
%57 = phi double [ %12, %20 ], [ %75, %73 ]
%58 = phi i64 [ 0, %20 ], [ %71, %73 ]
%59 = phi double [ %35, %20 ], [ %70, %73 ]
%60 = phi i32 [ 1, %20 ], [ %69, %73 ]
%61 = call double @llvm.floor.f64(double %57)
%62 = fsub double %57, %61
%63 = fcmp olt double %62, %59
br i1 %63, label %68, label %64
64: ; preds = %56
%65 = fcmp oeq double %62, %59
br i1 %65, label %66, label %68
66: ; preds = %64
%67 = add nsw i32 %60, 1
br label %68
68: ; preds = %56, %66, %64
%69 = phi i32 [ %67, %66 ], [ %60, %64 ], [ 1, %56 ]
%70 = phi double [ %59, %66 ], [ %59, %64 ], [ %62, %56 ]
%71 = add nuw nsw i64 %58, 1
%72 = icmp eq i64 %71, %21
br i1 %72, label %42, label %73
73: ; preds = %68
%74 = getelementptr inbounds double, double* %11, i64 %71
%75 = load double, double* %74
br label %56
76: ; preds = %92
%77 = icmp sgt i32 %93, 0
br i1 %77, label %106, label %98
78: ; preds = %42, %92
%79 = phi i32 [ %93, %92 ], [ %54, %42 ]
%80 = phi i32 [ %94, %92 ], [ 0, %42 ]
%81 = phi i64 [ %95, %92 ], [ 0, %42 ]
%82 = load double*, double** %1
%83 = getelementptr inbounds double, double* %82, i64 %81
%84 = load double, double* %83
%85 = call double @llvm.floor.f64(double %84)
%86 = fsub double %84, %85
%87 = fcmp oeq double %46, %86
br i1 %87, label %88, label %92
88: ; preds = %78
%89 = add nsw i32 %80, 1
store i32 %89, i32* %4
%90 = call i32 @push(double** %2, double %84, i32 %80)
%91 = load i32, i32* %3
br label %92
92: ; preds = %78, %88
%93 = phi i32 [ %79, %78 ], [ %91, %88 ]
%94 = phi i32 [ %80, %78 ], [ %89, %88 ]
%95 = add nuw nsw i64 %81, 1
%96 = sext i32 %93 to i64
%97 = icmp slt i64 %95, %96
br i1 %97, label %78, label %76
98: ; preds = %120, %42, %76
%99 = load double*, double** %1
%100 = call i32 @free(double* %99)
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%102 = load i32, i32* %4
%103 = icmp sgt i32 %102, 0
br i1 %103, label %104, label %126
104: ; preds = %98
%105 = sext i32 %102 to i64
br label %131
106: ; preds = %76, %120
%107 = phi i32 [ %121, %120 ], [ %93, %76 ]
%108 = phi i32 [ %122, %120 ], [ %94, %76 ]
%109 = phi i64 [ %123, %120 ], [ 0, %76 ]
%110 = load double*, double** %1
%111 = getelementptr inbounds double, double* %110, i64 %109
%112 = load double, double* %111
%113 = call double @llvm.floor.f64(double %112)
%114 = fsub double %112, %113
%115 = fcmp oeq double %44, %114
br i1 %115, label %116, label %120
116: ; preds = %106
%117 = add nsw i32 %108, 1
store i32 %117, i32* %4
%118 = call i32 @push(double** %2, double %112, i32 %108)
%119 = load i32, i32* %3
br label %120
120: ; preds = %106, %116
%121 = phi i32 [ %107, %106 ], [ %119, %116 ]
%122 = phi i32 [ %108, %106 ], [ %117, %116 ]
%123 = add nuw nsw i64 %109, 1
%124 = sext i32 %121 to i64
%125 = icmp slt i64 %123, %124
br i1 %125, label %106, label %98
126: ; preds = %131, %98
%127 = call i32 @pop(double** %2, i32* %4)
%128 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
%129 = load i32, i32* %4
%130 = icmp sgt i32 %129, 0
br i1 %130, label %143, label %139
131: ; preds = %104, %131
%132 = phi i64 [ 0, %104 ], [ %137, %131 ]
%133 = load double*, double** %2
%134 = getelementptr inbounds double, double* %133, i64 %132
%135 = load double, double* %134
%136 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double %135)
%137 = add nuw nsw i64 %132, 1
%138 = icmp slt i64 %137, %105
br i1 %138, label %131, label %126
139: ; preds = %143, %126
%140 = call i32 @putchar(i32 10)
%141 = load double*, double** %2
%142 = call i32 @free(double* %141)
ret i32 0
143: ; preds = %126, %143
%144 = phi i64 [ %149, %143 ], [ 0, %126 ]
%145 = load double*, double** %2
%146 = getelementptr inbounds double, double* %145, i64 %144
%147 = load double, double* %146
%148 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double %147)
%149 = add nuw nsw i64 %144, 1
%150 = load i32, i32* %4
%151 = sext i32 %150 to i64
%152 = icmp slt i64 %149, %151
br i1 %152, label %143, label %139
}