#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 */
scalar_t__ EOF;
scalar_t__ calloc(int, int);
int /*<<< orphan*/ error_print(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(double *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ realloc(double *, int);
scalar_t__ scanf(char *, double *);
scalar_t__ sqrt(double);
int /*<<< orphan*/ sscanf(char *, char *, double *);
int /*<<< orphan*/ stderr;
void main(int argc, char *argv[]) {
  double *x, dum, koeff;
  int i, nn, j, ii, ii1, ii2, ii3, ubbf3();
  long ik;
  if (argc < 2 || argc > 2) {
    error_print(argv[0]);
    exit(1);
  }
  sscanf(argv[1], "%le", &koeff);
  x = (double *)calloc(1, sizeof(double));
  ik = 0;
  while ((scanf("%le", &dum)) != EOF) {
    x = (double *)realloc(x, sizeof(double) * (ik + 1));
    if (x == NULL) {
      fprintf(stderr, "unfold: Allocation error while reading, exiting\n");
      exit(1);
    }
    x[ik] = dum;
    ik++;
  }
  nn = (int)sqrt((double)ik);
  for (i = 1; i <= nn - 1; i++) {
    for (j = 1; j <= nn - 1; j++) {
      ii1 = (i - 1) * nn + j - 1;
      ii2 = (i - 1 + 1) * nn + j - 1;
      ii3 = (i - 1) * nn + j - 1 + 1;
      ii = ubbf3(&x[ii1], &x[ii2], &x[ii3]);
    }
  }
  for (i = nn; i >= 2; i--) {
    for (j = 1; j <= nn - 1; j++) {
      ii1 = (i - 1) * nn + j - 1;
      ii2 = (i - 1 - 1) * nn + j - 1;
      ii3 = (i - 1) * nn + j - 1 + 1;
      ii = ubbf3(&x[ii1], &x[ii2], &x[ii3]);
    }
  }
  for (i = 1; i <= nn - 1; i++) {
    for (j = nn; j >= 2; j--) {
      ii1 = (i - 1) * nn + j - 1;
      ii2 = (i - 1 + 1) * nn + j - 1;
      ii3 = (i - 1) * nn + j - 1 - 1;
      ii = ubbf3(&x[ii1], &x[ii2], &x[ii3]);
    }
  }
  for (i = 1; i <= nn; i++) {
    for (j = 1; j <= nn; j++) {
      ik = (i - 1) * nn + j - 1;
      printf("%e\n", x[ik] * koeff);
    }
    printf("\n");
  }
  free(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jl     11d3 <main+0x23>
cmpl   $0x2,-0x4(%rbp)
jle    11e9 <main+0x39>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1090 <error_print@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe08(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1070 <sscanf@plt>
mov    $0x1,%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x50(%rbp)
lea    0xddd(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   10b0 <scanf@plt>
mov    0x2db5(%rip),%rcx
cmp    (%rcx),%rax
je     12a4 <main+0xf4>
mov    -0x18(%rbp),%rdi
mov    -0x50(%rbp),%rax
add    $0x1,%rax
shl    $0x3,%rax
mov    %eax,%esi
call   10a0 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1281 <main+0xd1>
mov    0x2d6f(%rip),%rax
mov    (%rax),%edi
lea    0xd92(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x50(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x50(%rbp)
jmp    121c <main+0x6c>
cvtsi2sdq -0x50(%rbp),%xmm0
call   10c0 <sqrt@plt>
mov    %eax,-0x30(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1379 <main+0x1c9>
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1366 <main+0x1b6>
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
imul   -0x30(%rbp),%eax
add    -0x34(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
add    $0x1,%eax
imul   -0x30(%rbp),%eax
add    -0x34(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x40(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
imul   -0x30(%rbp),%eax
add    -0x34(%rbp),%eax
sub    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x18(%rbp),%rdi
movslq -0x3c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
movslq -0x40(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x18(%rbp),%rdx
movslq -0x44(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
mov    $0x0,%al
call   1080 <ubbf3@plt>
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12d1 <main+0x121>
jmp    136b <main+0x1bb>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    12b9 <main+0x109>
mov    -0x30(%rbp),%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x2,-0x2c(%rbp)
jl     1438 <main+0x288>
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1425 <main+0x275>
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
imul   -0x30(%rbp),%eax
add    -0x34(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
sub    $0x1,%eax
imul   -0x30(%rbp),%eax
add    -0x34(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x40(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
imul   -0x30(%rbp),%eax
add    -0x34(%rbp),%eax
sub    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x18(%rbp),%rdi
movslq -0x3c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
movslq -0x40(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x18(%rbp),%rdx
movslq -0x44(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
mov    $0x0,%al
call   1080 <ubbf3@plt>
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1390 <main+0x1e0>
jmp    142a <main+0x27a>
mov    -0x2c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x2c(%rbp)
jmp    137f <main+0x1cf>
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     14f7 <main+0x347>
mov    -0x30(%rbp),%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x2,-0x34(%rbp)
jl     14e4 <main+0x334>
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
imul   -0x30(%rbp),%eax
add    -0x34(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
add    $0x1,%eax
imul   -0x30(%rbp),%eax
add    -0x34(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x40(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
imul   -0x30(%rbp),%eax
add    -0x34(%rbp),%eax
sub    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x18(%rbp),%rdi
movslq -0x3c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
movslq -0x40(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x18(%rbp),%rdx
movslq -0x44(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
mov    $0x0,%al
call   1080 <ubbf3@plt>
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
jmp    1456 <main+0x2a6>
jmp    14e9 <main+0x339>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    143f <main+0x28f>
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jg     157d <main+0x3cd>
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x30(%rbp),%eax
jg     1561 <main+0x3b1>
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
imul   -0x30(%rbp),%eax
add    -0x34(%rbp),%eax
sub    $0x1,%eax
cltq
mov    %rax,-0x50(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x28(%rbp),%xmm0
lea    0xae9(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1511 <main+0x361>
lea    0xacf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    14fe <main+0x34e>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
cmp    $0x2,%edi
jne    1568 <main+0x3a8>
mov    0x8(%rsi),%rdi
lea    0xe1e(%rip),%rbx
lea    0x50(%rsp),%rdx
mov    %rbx,%rsi
call   1080 <sscanf@plt>
mov    $0x8,%r13d
mov    $0x1,%edi
mov    $0x8,%esi
call   1060 <calloc@plt>
mov    %rax,%r14
lea    0x48(%rsp),%rsi
mov    %rbx,%rdi
call   10c0 <scanf@plt>
mov    0x2dcd(%rip),%r12
cmp    (%r12),%rax
jne    1227 <main+0x67>
xorpd  %xmm0,%xmm0
jmp    1283 <main+0xc3>
xor    %ebp,%ebp
lea    0xdd0(%rip),%rbx
lea    0x48(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %r13d,%esi
call   10b0 <realloc@plt>
test   %rax,%rax
je     1549 <main+0x389>
mov    %rax,%r14
movsd  0x48(%rsp),%xmm0
movsd  %xmm0,(%rax,%rbp,8)
mov    %rbx,%rdi
mov    %r15,%rsi
call   10c0 <scanf@plt>
add    $0x8,%r13d
add    $0x1,%rbp
cmp    (%r12),%rax
jne    1240 <main+0x80>
xorps  %xmm0,%xmm0
cvtsi2sd %rbp,%xmm0
call   10d0 <sqrt@plt>
mov    %rax,0x8(%rsp)
cmp    $0x2,%eax
jl     14b8 <main+0x2f8>
movabs $0x100000000,%r12
mov    0x8(%rsp),%rax
mov    %eax,%ecx
mov    %rcx,%rbx
shl    $0x20,%rbx
cltq
shl    $0x3,%rax
mov    %rax,0x18(%rsp)
mov    %rcx,0x28(%rsp)
lea    -0x1(%rcx),%rax
mov    %rax,0x40(%rsp)
mov    $0x1,%eax
mov    %r14,%rdi
mov    %rbx,0x20(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,0x10(%rsp)
mov    0x40(%rsp),%r13
mov    %rdi,0x30(%rsp)
mov    %rbx,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rsi
sar    $0x1d,%rsi
add    %r14,%rsi
lea    0x8(%rdi),%rbp
mov    %rbp,%rdx
xor    %eax,%eax
call   1090 <ubbf3@plt>
add    %r12,%r15
mov    %rbp,%rdi
add    $0xffffffffffffffff,%r13
jne    1300 <main+0x140>
mov    0x10(%rsp),%rax
add    $0x1,%rax
add    0x20(%rsp),%rbx
mov    0x30(%rsp),%rdi
add    0x18(%rsp),%rdi
cmp    0x28(%rsp),%rax
jne    12e0 <main+0x120>
cmpl   $0x2,0x8(%rsp)
jl     14b8 <main+0x2f8>
mov    0x8(%rsp),%rax
mov    %rax,%rdx
shl    $0x20,%rdx
movslq %eax,%rcx
lea    -0x2(%rcx),%r15d
imul   %ecx,%r15d
shl    $0x20,%r15
lea    -0x1(%rcx),%rax
imul   %rcx,%rax
lea    (%r14,%rax,8),%rbx
mov    %rdx,0x18(%rsp)
sar    $0x1d,%rdx
neg    %rdx
mov    %rdx,0x40(%rsp)
addq   $0xffffffffffffffff,0x28(%rsp)
mov    %rcx,0x38(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rcx,0x30(%rsp)
lea    -0x1(%rcx),%rax
mov    %rax,0x20(%rsp)
mov    0x28(%rsp),%r13
mov    %rbx,%rdi
mov    %r15,0x10(%rsp)
nopl   0x0(%rax,%rax,1)
mov    %r15,%rsi
sar    $0x1d,%rsi
add    %r14,%rsi
lea    0x8(%rdi),%rbp
mov    %rbp,%rdx
xor    %eax,%eax
call   1090 <ubbf3@plt>
add    %r12,%r15
mov    %rbp,%rdi
add    $0xffffffffffffffff,%r13
jne    13c0 <main+0x200>
mov    0x10(%rsp),%r15
sub    0x18(%rsp),%r15
add    0x40(%rsp),%rbx
cmpq   $0x2,0x30(%rsp)
mov    0x20(%rsp),%rcx
jg     13a0 <main+0x1e0>
cmpl   $0x2,0x8(%rsp)
jl     14b8 <main+0x2f8>
movabs $0xffffffff00000000,%r15
ff ff ff
mov    0x8(%rsp),%eax
mov    %rax,0x28(%rsp)
mov    0x38(%rsp),%rax
lea    0x1(%rax),%rcx
mov    %rcx,0x20(%rsp)
lea    -0x10(%r14,%rax,8),%rbp
lea    0x0(,%rax,8),%rcx
mov    %rcx,0x18(%rsp)
mov    %rax,%r13
shl    $0x21,%r13
add    %r15,%r13
shl    $0x20,%rax
mov    %rax,0x38(%rsp)
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %r13,0x30(%rsp)
mov    %rbp,0x10(%rsp)
mov    0x20(%rsp),%r12
nop
lea    0x8(%rbp),%rdi
mov    %r13,%rsi
sar    $0x1d,%rsi
add    %r14,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1090 <ubbf3@plt>
add    $0xffffffffffffffff,%r12
add    $0xfffffffffffffff8,%rbp
add    %r15,%r13
cmp    $0x2,%r12
jg     1470 <main+0x2b0>
add    $0x1,%rbx
mov    0x10(%rsp),%rbp
add    0x18(%rsp),%rbp
mov    0x30(%rsp),%r13
add    0x38(%rsp),%r13
cmp    0x28(%rsp),%rbx
jne    1460 <main+0x2a0>
cmpl   $0x0,0x8(%rsp)
jle    1532 <main+0x372>
mov    0x8(%rsp),%rax
add    $0x1,%eax
add    $0xffffffffffffffff,%rax
mov    %rax,0x10(%rsp)
mov    $0x1,%r12d
xor    %r15d,%r15d
lea    0xb55(%rip),%rbp
mov    0x10(%rsp),%rbx
mov    %r15d,%r13d
nopl   0x0(%rax,%rax,1)
movslq %r13d,%r13
movsd  (%r14,%r13,8),%xmm0
mulsd  0x50(%rsp),%xmm0
mov    %rbp,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x1,%r13d
add    $0xffffffffffffffff,%rbx
jne    14f0 <main+0x330>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0x1(%r12),%eax
mov    0x8(%rsp),%rcx
add    %ecx,%r15d
cmp    %ecx,%r12d
mov    %eax,%r12d
jne    14e0 <main+0x320>
mov    %r14,%rdi
call   1030 <free@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2a88(%rip),%rax
mov    (%rax),%edi
lea    0xaab(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    (%rsi),%rdi
call   10a0 <error_print@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%le\00"
@EOF = global i64 0
@stderr = global i32 0
@.str.1 = [49 x i8] c"unfold: Allocation error while reading, exiting\0A\00"
@.str.2 = [4 x i8] c"%e\0A\00"
define void @main(i32 %0, i8** nocapture %1) {
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %3 to i8*
%6 = bitcast double* %4 to i8*
%7 = icmp eq i32 %0, 2
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i8*, i8** %1
%10 = tail call i32 @error_print(i8* %9)
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @sscanf(i8* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %4)
%16 = call i64 @calloc(i32 1, i32 8)
%17 = inttoptr i64 %16 to double*
%18 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%19 = load i64, i64* @EOF
%20 = icmp eq i64 %18, %19
br i1 %20, label %43, label %21
21: ; preds = %12, %34
%22 = phi i64 [ %24, %34 ], [ 0, %12 ]
%23 = phi double* [ %28, %34 ], [ %17, %12 ]
%24 = add nuw nsw i64 %22, 1
%25 = trunc i64 %24 to i32
%26 = shl i32 %25, 3
%27 = call i64 @realloc(double* %23, i32 %26)
%28 = inttoptr i64 %27 to double*
%29 = icmp eq i64 %27, 0
br i1 %29, label %30, label %34
30: ; preds = %21
%31 = load i32, i32* @stderr
%32 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%33 = call i32 @exit(i32 1)
unreachable
34: ; preds = %21
%35 = load double, double* %3
%36 = getelementptr inbounds double, double* %28, i64 %22
store double %35, double* %36
%37 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%38 = load i64, i64* @EOF
%39 = icmp eq i64 %37, %38
br i1 %39, label %40, label %21
40: ; preds = %34
%41 = inttoptr i64 %27 to double*
%42 = sitofp i64 %24 to double
br label %43
43: ; preds = %40, %12
%44 = phi double* [ %41, %40 ], [ %17, %12 ]
%45 = phi double [ %42, %40 ], [ 0.000000e+00, %12 ]
%46 = call i64 @sqrt(double %45)
%47 = trunc i64 %46 to i32
%48 = icmp sgt i32 %47, 1
br i1 %48, label %49, label %112
49: ; preds = %43
%50 = shl i64 %46, 32
%51 = ashr exact i64 %50, 32
%52 = and i64 %46, 4294967295
br label %53
53: ; preds = %77, %49
%54 = phi i64 [ 1, %49 ], [ %78, %77 ]
%55 = add nsw i64 %54, -1
%56 = mul nsw i64 %55, %51
%57 = mul nsw i64 %54, %51
%58 = add i64 %57, 4294967295
br label %64
59: ; preds = %77
br i1 %48, label %60, label %112
60: ; preds = %59
%61 = shl i64 %46, 32
%62 = ashr exact i64 %61, 32
%63 = and i64 %46, 4294967295
br label %80
64: ; preds = %53, %64
%65 = phi i64 [ 1, %53 ], [ %75, %64 ]
%66 = add nsw i64 %65, %56
%67 = add nsw i64 %66, -1
%68 = add i64 %58, %65
%69 = getelementptr inbounds double, double* %44, i64 %67
%70 = shl i64 %68, 32
%71 = ashr exact i64 %70, 32
%72 = getelementptr inbounds double, double* %44, i64 %71
%73 = getelementptr inbounds double, double* %44, i64 %66
%74 = call i32 (double*, double*, double*, ...) bitcast (i32 (...)* @ubbf3 to i32 (double*, double*, double*, ...)*)(double* %69, double* %72, double* %73)
%75 = add nuw nsw i64 %65, 1
%76 = icmp eq i64 %75, %52
br i1 %76, label %77, label %64
77: ; preds = %64
%78 = add nuw nsw i64 %54, 1
%79 = icmp eq i64 %78, %52
br i1 %79, label %59, label %53
80: ; preds = %105, %60
%81 = phi i64 [ %62, %60 ], [ %82, %105 ]
%82 = add nsw i64 %81, -1
%83 = mul nsw i64 %82, %62
%84 = add nsw i64 %81, -2
%85 = mul nsw i64 %84, %62
%86 = add i64 %85, 4294967295
br label %92
87: ; preds = %105
br i1 %48, label %88, label %112
88: ; preds = %87
%89 = shl i64 %46, 32
%90 = ashr exact i64 %89, 32
%91 = and i64 %46, 4294967295
br label %107
92: ; preds = %80, %92
%93 = phi i64 [ 1, %80 ], [ %103, %92 ]
%94 = add nsw i64 %93, %83
%95 = add nsw i64 %94, -1
%96 = add i64 %86, %93
%97 = getelementptr inbounds double, double* %44, i64 %95
%98 = shl i64 %96, 32
%99 = ashr exact i64 %98, 32
%100 = getelementptr inbounds double, double* %44, i64 %99
%101 = getelementptr inbounds double, double* %44, i64 %94
%102 = call i32 (double*, double*, double*, ...) bitcast (i32 (...)* @ubbf3 to i32 (double*, double*, double*, ...)*)(double* %97, double* %100, double* %101)
%103 = add nuw nsw i64 %93, 1
%104 = icmp eq i64 %103, %63
br i1 %104, label %105, label %92
105: ; preds = %92
%106 = icmp sgt i64 %81, 2
br i1 %106, label %80, label %87
107: ; preds = %131, %88
%108 = phi i64 [ 1, %88 ], [ %132, %131 ]
%109 = add nsw i64 %108, -1
%110 = mul nsw i64 %109, %90
%111 = mul nsw i64 %108, %90
br label %117
112: ; preds = %131, %43, %59, %87
%113 = icmp slt i32 %47, 1
br i1 %113, label %155, label %114
114: ; preds = %112
%115 = add i64 %46, 1
%116 = and i64 %115, 4294967295
br label %134
117: ; preds = %107, %117
%118 = phi i64 [ %90, %107 ], [ %121, %117 ]
%119 = add nsw i64 %118, %110
%120 = add nsw i64 %119, -1
%121 = add nsw i64 %118, -1
%122 = add i64 %121, %111
%123 = add nsw i64 %119, -2
%124 = getelementptr inbounds double, double* %44, i64 %120
%125 = shl i64 %122, 32
%126 = ashr exact i64 %125, 32
%127 = getelementptr inbounds double, double* %44, i64 %126
%128 = getelementptr inbounds double, double* %44, i64 %123
%129 = call i32 (double*, double*, double*, ...) bitcast (i32 (...)* @ubbf3 to i32 (double*, double*, double*, ...)*)(double* %124, double* %127, double* %128)
%130 = icmp sgt i64 %118, 2
br i1 %130, label %117, label %131
131: ; preds = %117
%132 = add nuw nsw i64 %108, 1
%133 = icmp eq i64 %132, %91
br i1 %133, label %112, label %107
134: ; preds = %151, %114
%135 = phi i32 [ 1, %114 ], [ %153, %151 ]
%136 = add nsw i32 %135, -1
%137 = mul nsw i32 %136, %47
%138 = add i32 %137, -1
br label %139
139: ; preds = %134, %139
%140 = phi i64 [ 1, %134 ], [ %149, %139 ]
%141 = trunc i64 %140 to i32
%142 = add i32 %138, %141
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds double, double* %44, i64 %143
%145 = load double, double* %144
%146 = load double, double* %4
%147 = fmul double %145, %146
%148 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %147)
%149 = add nuw nsw i64 %140, 1
%150 = icmp eq i64 %149, %116
br i1 %150, label %151, label %139
151: ; preds = %139
%152 = call i32 @putchar(i32 10)
%153 = add nuw i32 %135, 1
%154 = icmp eq i32 %135, %47
br i1 %154, label %155, label %134
155: ; preds = %151, %112
%156 = call i32 @free(double* %44)
ret void
}