#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 /*<<< orphan*/ free(char *);
int /*<<< orphan*/ lp_d_unit(int, double *, double *);
scalar_t__ malloc(unsigned int);
int scanf(char *, ...);
int /*<<< orphan*/ strcmp(char *, char *);
int read_lp(double **halves, int *d, int *m, double **n_vec, double **d_vec,
            int *itype) {
  int i, j;
  char type[100];
  if (scanf("dimension: %d, number of planes: %d\n", d, m) != 2)
    return (0);
  if ((i = scanf("%s", type)) != 1)
    return (0);
  *n_vec = (double *)malloc((unsigned)(*d + 1) * sizeof(double));
  *d_vec = (double *)malloc((unsigned)(*d + 1) * sizeof(double));
  *halves = (double *)malloc((unsigned)*m * (*d + 1) * sizeof(double));
  for (i = 0; i <= *d; i++) {
    (*d_vec)[i] = 0.0;
  }
  if (!strcmp(type, "projective")) {
    *itype = 1;
    for (i = 0; i < *d; i++) {
      if (scanf("%lf", (*n_vec) + i) != 1)
        goto err;
    }
    (*d_vec)[*d] = 1.0;
    (*n_vec)[*d] = 0.0;
  } else if (!strcmp(type, "real")) {
    *itype = 0;
    for (i = 0; i <= *d; i++) {
      if (scanf("%lf", (*n_vec) + i) != 1)
        goto err;
    }
  } else {
    goto err;
  }
  for (i = 0; i < *m; i++) {
    for (j = 0; j <= *d; j++) {
      if (scanf("%lf", (*halves) + i * (*d + 1) + j) != 1) {
        goto err;
      }
    }
    (void)lp_d_unit(*d, (*halves) + i * (*d + 1), (*halves) + i * (*d + 1));
  }
  return (1);
err:
  free((char *)*d_vec);
  free((char *)*n_vec);
  free((char *)*halves);
  return (0);
}


x86 assembly (clang, -O0):
<read_lp>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
cmp    $0x2,%eax
je     119e <read_lp+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    14bd <read_lp+0x36d>
lea    -0xb0(%rbp),%rsi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    %eax,-0x3c(%rbp)
cmp    $0x1,%eax
je     11cb <read_lp+0x7b>
movl   $0x0,-0x4(%rbp)
jmp    14bd <read_lp+0x36d>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    %eax,%eax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    %eax,%eax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    %eax,%eax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jg     126b <read_lp+0x11b>
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
movslq -0x3c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    123b <read_lp+0xeb>
lea    -0xb0(%rbp),%rdi
lea    0xdb7(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    131e <read_lp+0x1ce>
mov    -0x38(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    12e8 <read_lp+0x198>
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
movslq -0x3c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
lea    0xd7b(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
cmp    $0x1,%eax
je     12d5 <read_lp+0x185>
jmp    1492 <read_lp+0x342>
jmp    12da <read_lp+0x18a>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1298 <read_lp+0x148>
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
movsd  0xd02(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    13aa <read_lp+0x25a>
lea    -0xb0(%rbp),%rdi
lea    0xd13(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    13a0 <read_lp+0x250>
mov    -0x38(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jg     139b <read_lp+0x24b>
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
movslq -0x3c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
lea    0xcc8(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
cmp    $0x1,%eax
je     1388 <read_lp+0x238>
jmp    1492 <read_lp+0x342>
jmp    138d <read_lp+0x23d>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    134b <read_lp+0x1fb>
jmp    13a5 <read_lp+0x255>
jmp    1492 <read_lp+0x342>
jmp    13aa <read_lp+0x25a>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
jge    1486 <read_lp+0x336>
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jg     142f <read_lp+0x2df>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x3c(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
movslq -0x40(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
lea    0xc34(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
cmp    $0x1,%eax
je     141c <read_lp+0x2cc>
jmp    1492 <read_lp+0x342>
jmp    1421 <read_lp+0x2d1>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    13c7 <read_lp+0x277>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x3c(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x3c(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
call   1070 <lp_d_unit@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    13b1 <read_lp+0x261>
movl   $0x1,-0x4(%rbp)
jmp    14bd <read_lp+0x36d>
mov    -0x30(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_lp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %r9,0x28(%rsp)
mov    %r8,%rbp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%r13
lea    0xe84(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <scanf@plt>
cmp    $0x2,%eax
jne    1287 <read_lp+0x137>
mov    %r15,0x10(%rsp)
lea    0xe8b(%rip),%rdi
xor    %ebx,%ebx
lea    0x30(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    1287 <read_lp+0x137>
mov    %r12,%rbx
mov    (%r12),%eax
lea    0x8(,%rax,8),%edi
call   1050 <malloc@plt>
mov    %rax,(%r14)
mov    (%r12),%eax
lea    0x8(,%rax,8),%edi
call   1050 <malloc@plt>
mov    %rax,0x0(%rbp)
mov    (%r12),%edi
add    $0x1,%edi
mov    0x10(%rsp),%rax
imul   (%rax),%edi
shl    $0x3,%edi
call   1050 <malloc@plt>
mov    %rax,0x0(%r13)
mov    (%r12),%eax
test   %eax,%eax
js     1211 <read_lp+0xc1>
mov    0x0(%rbp),%rdi
lea    0x8(,%rax,8),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    %r13,0x18(%rsp)
movabs $0x697463656a6f7270,%rax
63 74 69
xor    0x30(%rsp),%rax
movabs $0x6576697463656a,%rcx
xor    0x33(%rsp),%rcx
or     %rax,%rcx
mov    %r14,0x8(%rsp)
mov    %rbp,0x20(%rsp)
je     129b <read_lp+0x14b>
mov    $0x6c616572,%eax
xor    0x30(%rsp),%eax
movzbl 0x34(%rsp),%ecx
or     %eax,%ecx
mov    0x28(%rsp),%rax
je     1312 <read_lp+0x1c2>
mov    0x20(%rsp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x28(%rsp),%rax
movl   $0x1,(%rax)
mov    %r12,%r13
mov    (%r12),%edi
test   %edi,%edi
jle    12f0 <read_lp+0x1a0>
lea    0xd7b(%rip),%r15
xor    %ebx,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    (%r14),%rsi
add    %rbx,%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    125e <read_lp+0x10e>
add    $0x1,%rbp
movslq 0x0(%r13),%rdi
add    $0x8,%rbx
cmp    %rdi,%rbp
mov    0x8(%rsp),%r14
jl     12c0 <read_lp+0x170>
mov    0x20(%rsp),%rbp
movslq %edi,%rax
mov    0x0(%rbp),%rcx
movabs $0x3ff0000000000000,%rdx
mov    %rdx,(%rcx,%rax,8)
mov    (%r14),%rcx
movq   $0x0,(%rcx,%rax,8)
jmp    136f <read_lp+0x21f>
mov    %r12,%r13
movl   $0x0,(%rax)
mov    (%r12),%edi
test   %edi,%edi
mov    0x8(%rsp),%rax
js     136f <read_lp+0x21f>
mov    $0xffffffffffffffff,%rbx
lea    0xcfd(%rip),%r15
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    (%rax),%rsi
add    %rbp,%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    125e <read_lp+0x10e>
movslq 0x0(%r13),%rdi
add    $0x1,%rbx
add    $0x8,%rbp
cmp    %rdi,%rbx
mov    0x8(%rsp),%rax
jl     1340 <read_lp+0x1f0>
mov    0x10(%rsp),%rax
cmpl   $0x0,(%rax)
jle    140e <read_lp+0x2be>
lea    0xcaf(%rip),%rbp
xor    %r14d,%r14d
mov    0x18(%rsp),%rbx
test   %edi,%edi
js     13dd <read_lp+0x28d>
mov    $0xffffffffffffffff,%r12
xor    %r15d,%r15d
nopw   0x0(%rax,%rax,1)
add    $0x1,%edi
imul   %r14d,%edi
movslq %edi,%rsi
shl    $0x3,%rsi
add    (%rbx),%rsi
add    %r15,%rsi
mov    %rbp,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    125e <read_lp+0x10e>
movslq 0x0(%r13),%rdi
add    $0x1,%r12
add    $0x8,%r15
cmp    %rdi,%r12
mov    0x18(%rsp),%rbx
jl     13a0 <read_lp+0x250>
lea    0x1(%rdi),%eax
imul   %r14d,%eax
movslq %eax,%rdx
shl    $0x3,%rdx
add    (%rbx),%rdx
mov    %rdx,%rsi
call   1070 <lp_d_unit@plt>
add    $0x1,%r14d
mov    0x10(%rsp),%rax
cmp    (%rax),%r14d
jge    140e <read_lp+0x2be>
mov    0x0(%r13),%edi
test   %edi,%edi
jns    1390 <read_lp+0x240>
jmp    13dd <read_lp+0x28d>
mov    $0x1,%ebx
jmp    1287 <read_lp+0x137>

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

LLVM IR (-O2):
@.str = [37 x i8] c"dimension: %d, number of planes: %d\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [11 x i8] c"projective\00"
@.str.3 = [4 x i8] c"%lf\00"
@.str.4 = [5 x i8] c"real\00"
define i32 @read_lp(double** nocapture %0, i32* %1, i32* %2, double** nocapture %3, double** nocapture %4, i32* nocapture writeonly %5) {
%7 = alloca [100 x i8]
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%9 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%10 = icmp eq i32 %9, 2
br i1 %10, label %11, label %128
11: ; preds = %6
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %128
14: ; preds = %11
%15 = load i32, i32* %1
%16 = shl i32 %15, 3
%17 = add i32 %16, 8
%18 = call i64 @malloc(i32 %17)
%19 = inttoptr i64 %18 to double*
store double* %19, double** %3
%20 = load i32, i32* %1
%21 = shl i32 %20, 3
%22 = add i32 %21, 8
%23 = call i64 @malloc(i32 %22)
%24 = inttoptr i64 %23 to double*
store double* %24, double** %4
%25 = load i32, i32* %2
%26 = load i32, i32* %1
%27 = add nsw i32 %26, 1
%28 = shl i32 %25, 3
%29 = mul i32 %28, %27
%30 = call i64 @malloc(i32 %29)
%31 = inttoptr i64 %30 to double*
store double* %31, double** %0
%32 = load i32, i32* %1
%33 = icmp slt i32 %32, 0
br i1 %33, label %40, label %34
34: ; preds = %14
%35 = bitcast double** %4 to i8**
%36 = load i8*, i8** %35
%37 = zext i32 %32 to i64
%38 = shl nuw nsw i64 %37, 3
%39 = add nuw nsw i64 %38, 8
br label %40
40: ; preds = %34, %14
%41 = call i32 @bcmp(i8* dereferenceable(11) %8, i8* dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i64 11)
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %64
43: ; preds = %40
store i32 1, i32* %5
%44 = load i32, i32* %1
%45 = icmp sgt i32 %44, 0
br i1 %45, label %50, label %57
46: ; preds = %50
%47 = load i32, i32* %1
%48 = sext i32 %47 to i64
%49 = icmp slt i64 %56, %48
br i1 %49, label %50, label %57
50: ; preds = %43, %46
%51 = phi i64 [ %56, %46 ], [ 0, %43 ]
%52 = load double*, double** %3
%53 = getelementptr inbounds double, double* %52, i64 %51
%54 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %53)
%55 = icmp eq i32 %54, 1
%56 = add nuw nsw i64 %51, 1
br i1 %55, label %46, label %118
57: ; preds = %46, %43
%58 = phi i32 [ %44, %43 ], [ %47, %46 ]
%59 = sext i32 %58 to i64
%60 = load double*, double** %4
%61 = getelementptr inbounds double, double* %60, i64 %59
store double 1.000000e+00, double* %61
%62 = load double*, double** %3
%63 = getelementptr inbounds double, double* %62, i64 %59
store double 0.000000e+00, double* %63
br label %81
64: ; preds = %40
%65 = call i32 @bcmp(i8* dereferenceable(5) %8, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i64 5)
%66 = icmp eq i32 %65, 0
br i1 %66, label %67, label %118
67: ; preds = %64
store i32 0, i32* %5
%68 = load i32, i32* %1
%69 = icmp slt i32 %68, 0
br i1 %69, label %81, label %75
70: ; preds = %75
%71 = add nuw nsw i64 %76, 1
%72 = load i32, i32* %1
%73 = sext i32 %72 to i64
%74 = icmp slt i64 %76, %73
br i1 %74, label %75, label %81
75: ; preds = %67, %70
%76 = phi i64 [ %71, %70 ], [ 0, %67 ]
%77 = load double*, double** %3
%78 = getelementptr inbounds double, double* %77, i64 %76
%79 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %78)
%80 = icmp eq i32 %79, 1
br i1 %80, label %70, label %118
81: ; preds = %70, %67, %57
%82 = phi i32 [ %68, %67 ], [ %58, %57 ], [ %72, %70 ]
%83 = load i32, i32* %2
%84 = icmp sgt i32 %83, 0
br i1 %84, label %85, label %128
85: ; preds = %81, %116
%86 = phi i32 [ %117, %116 ], [ %82, %81 ]
%87 = phi i32 [ %113, %116 ], [ 0, %81 ]
%88 = icmp slt i32 %86, 0
br i1 %88, label %105, label %94
89: ; preds = %94
%90 = add nuw nsw i64 %95, 1
%91 = load i32, i32* %1
%92 = sext i32 %91 to i64
%93 = icmp slt i64 %95, %92
br i1 %93, label %94, label %105
94: ; preds = %85, %89
%95 = phi i64 [ %90, %89 ], [ 0, %85 ]
%96 = phi i32 [ %91, %89 ], [ %86, %85 ]
%97 = load double*, double** %0
%98 = add nsw i32 %96, 1
%99 = mul nsw i32 %98, %87
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds double, double* %97, i64 %100
%102 = getelementptr inbounds double, double* %101, i64 %95
%103 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %102)
%104 = icmp eq i32 %103, 1
br i1 %104, label %89, label %118
105: ; preds = %89, %85
%106 = phi i32 [ %86, %85 ], [ %91, %89 ]
%107 = load double*, double** %0
%108 = add nsw i32 %106, 1
%109 = mul nsw i32 %108, %87
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds double, double* %107, i64 %110
%112 = call i32 @lp_d_unit(i32 %106, double* %111, double* %111)
%113 = add nuw nsw i32 %87, 1
%114 = load i32, i32* %2
%115 = icmp slt i32 %113, %114
br i1 %115, label %116, label %128
116: ; preds = %105
%117 = load i32, i32* %1
br label %85
118: ; preds = %75, %50, %94, %64
%119 = bitcast double** %4 to i8**
%120 = load i8*, i8** %119
%121 = call i32 @free(i8* %120)
%122 = bitcast double** %3 to i8**
%123 = load i8*, i8** %122
%124 = call i32 @free(i8* %123)
%125 = bitcast double** %0 to i8**
%126 = load i8*, i8** %125
%127 = call i32 @free(i8* %126)
br label %128
128: ; preds = %105, %81, %11, %6, %118
%129 = phi i32 [ 0, %118 ], [ 0, %6 ], [ 0, %11 ], [ 1, %81 ], [ 1, %105 ]
ret i32 %129
}