#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__ checkProgression(float *, int);
void *malloc(int);
int printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main(void) {
  int sizeX, sizeY;
  float **array;
  int i, j;
  int done = 0;
  while (!done) {
    printf("Enter size (x y): ");
    scanf("%i%i", &sizeX, &sizeY);
    (sizeX > 1 && sizeY > 0)
        ? done = 1
        : printf("Error! Y must be positive and X must be > 1\n");
  }
  array = malloc(sizeY * sizeof(float *));
  for (i = 0; i < sizeY; i++) {
    array[i] = malloc(sizeX * sizeof(float));
    for (j = 0; j < sizeX; j++) {
      scanf("%f", &array[i][j]);
      if (array[i][j] == 0) {
        printf("Error. Member of geometry progression can't be null. "
               "Exiting...\n");
        return 0;
      }
    }
  }
  for (i = 0; i < sizeY; i++)
    if (checkProgression(array[i], sizeX))
      printf("Progression in %i line\n", i + 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    116c <main+0x2c>
jmp    11c3 <main+0x83>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe92(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1060 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jle    11b0 <main+0x70>
cmpl   $0x0,-0xc(%rbp)
jle    11b0 <main+0x70>
movl   $0x1,-0x24(%rbp)
jmp    11be <main+0x7e>
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1156 <main+0x16>
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12a6 <main+0x166>
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1293 <main+0x153>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
movslq -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1280 <main+0x140>
jp     1280 <main+0x140>
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1305 <main+0x1c5>
jmp    1285 <main+0x145>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    120e <main+0xce>
jmp    1298 <main+0x158>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11dd <main+0x9d>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12fe <main+0x1be>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x8(%rbp),%esi
call   1050 <checkProgression@plt>
cmp    $0x0,%rax
je     12eb <main+0x1ab>
mov    -0x1c(%rbp),%esi
add    $0x1,%esi
lea    0xda5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12f0 <main+0x1b0>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    12ad <main+0x16d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xe9f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea4(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1070 <scanf@plt>
cmpl   $0x2,0xc(%rsp)
jl     1192 <main+0x42>
cmpl   $0x0,0x8(%rsp)
jg     11f0 <main+0xa0>
lea    0xede(%rip),%r14
lea    0xe64(%rip),%r15
lea    0xe70(%rip),%r12
lea    0xc(%rsp),%r13
lea    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1070 <scanf@plt>
cmpl   $0x2,0xc(%rsp)
jl     11c0 <main+0x70>
cmpl   $0x0,0x8(%rsp)
jle    11c0 <main+0x70>
mov    0x8(%rsp),%r13d
lea    0x0(,%r13,8),%edi
call   1050 <malloc@plt>
test   %r13d,%r13d
jle    12a6 <main+0x156>
mov    %rax,%rbp
mov    0xc(%rsp),%r14d
lea    0xe02(%rip),%r15
xor    %r12d,%r12d
mov    %rax,0x10(%rsp)
jmp    123c <main+0xec>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%r12
movslq %r13d,%rax
cmp    %rax,%r12
jge    12b7 <main+0x167>
lea    0x0(,%r14,4),%edi
call   1050 <malloc@plt>
mov    %rax,0x0(%rbp,%r12,8)
test   %r14d,%r14d
jle    1230 <main+0xe0>
mov    %rax,%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
movss  (%rbx),%xmm0
ucomiss 0xd88(%rip),%xmm0
jne    127c <main+0x12c>
jnp    129a <main+0x14a>
add    $0x1,%rbp
movslq 0xc(%rsp),%r14
add    $0x4,%rbx
cmp    %r14,%rbp
jl     1260 <main+0x110>
mov    0x8(%rsp),%r13d
mov    0x10(%rsp),%rbp
jmp    1230 <main+0xe0>
lea    0xd96(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
test   %r13d,%r13d
jle    12a6 <main+0x156>
lea    0xd5c(%rip),%r15
xor    %ebx,%ebx
jmp    12e2 <main+0x192>
nopw   0x0(%rax,%rax,1)
movslq 0x8(%rsp),%rax
mov    %rbp,%rbx
cmp    %rax,%rbp
mov    0x10(%rsp),%rbp
jge    12a6 <main+0x156>
mov    0x0(%rbp,%rbx,8),%rdi
mov    0xc(%rsp),%esi
call   1060 <checkProgression@plt>
lea    0x1(%rbx),%rbp
test   %rax,%rax
je     12d0 <main+0x180>
add    $0x1,%ebx
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    12d0 <main+0x180>

LLVM IR (-O0):
@.str = [19 x i8] c"Enter size (x y): \00"
@.str.1 = [5 x i8] c"%i%i\00"
@.str.2 = [45 x i8] c"Error! Y must be positive and X must be > 1\0A\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [65 x i8] c"Error. Member of geometry progression can't be null. Exiting...\0A\00"
@.str.5 = [24 x i8] c"Progression in %i line\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %7
br label %8
8: ; preds = %23, %0
%9 = load i32, i32* %7
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br i1 %11, label %12, label %25
12: ; preds = %8
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%15 = load i32, i32* %2
%16 = icmp sgt i32 %15, 1
br i1 %16, label %17, label %21
17: ; preds = %12
%18 = load i32, i32* %3
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 1, i32* %7
br label %23
21: ; preds = %17, %12
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
br label %23
23: ; preds = %21, %20
%24 = phi i32 [ 1, %20 ], [ %22, %21 ]
br label %8
25: ; preds = %8
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = mul i64 %27, 8
%29 = trunc i64 %28 to i32
%30 = call i8* @malloc(i32 %29)
%31 = bitcast i8* %30 to float**
store float** %31, float*** %4
store i32 0, i32* %5
br label %32
32: ; preds = %78, %25
%33 = load i32, i32* %5
%34 = load i32, i32* %3
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %81
36: ; preds = %32
%37 = load i32, i32* %2
%38 = sext i32 %37 to i64
%39 = mul i64 %38, 4
%40 = trunc i64 %39 to i32
%41 = call i8* @malloc(i32 %40)
%42 = bitcast i8* %41 to float*
%43 = load float**, float*** %4
%44 = load i32, i32* %5
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds float*, float** %43, i64 %45
store float* %42, float** %46
store i32 0, i32* %6
br label %47
47: ; preds = %74, %36
%48 = load i32, i32* %6
%49 = load i32, i32* %2
%50 = icmp slt i32 %48, %49
br i1 %50, label %51, label %77
51: ; preds = %47
%52 = load float**, float*** %4
%53 = load i32, i32* %5
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds float*, float** %52, i64 %54
%56 = load float*, float** %55
%57 = load i32, i32* %6
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds float, float* %56, i64 %58
%60 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %59)
%61 = load float**, float*** %4
%62 = load i32, i32* %5
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds float*, float** %61, i64 %63
%65 = load float*, float** %64
%66 = load i32, i32* %6
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds float, float* %65, i64 %67
%69 = load float, float* %68
%70 = fcmp oeq float %69, 0.000000e+00
br i1 %70, label %71, label %73
71: ; preds = %51
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %1
br label %104
73: ; preds = %51
br label %74
74: ; preds = %73
%75 = load i32, i32* %6
%76 = add nsw i32 %75, 1
store i32 %76, i32* %6
br label %47
77: ; preds = %47
br label %78
78: ; preds = %77
%79 = load i32, i32* %5
%80 = add nsw i32 %79, 1
store i32 %80, i32* %5
br label %32
81: ; preds = %32
store i32 0, i32* %5
br label %82
82: ; preds = %100, %81
%83 = load i32, i32* %5
%84 = load i32, i32* %3
%85 = icmp slt i32 %83, %84
br i1 %85, label %86, label %103
86: ; preds = %82
%87 = load float**, float*** %4
%88 = load i32, i32* %5
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds float*, float** %87, i64 %89
%91 = load float*, float** %90
%92 = load i32, i32* %2
%93 = call i64 @checkProgression(float* %91, i32 %92)
%94 = icmp ne i64 %93, 0
br i1 %94, label %95, label %99
95: ; preds = %86
%96 = load i32, i32* %5
%97 = add nsw i32 %96, 1
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i32 %97)
br label %99
99: ; preds = %95, %86
br label %100
100: ; preds = %99
%101 = load i32, i32* %5
%102 = add nsw i32 %101, 1
store i32 %102, i32* %5
br label %82
103: ; preds = %82
store i32 0, i32* %1
br label %104
104: ; preds = %103, %71
%105 = load i32, i32* %1
ret i32 %105
}

LLVM IR (-O2):
@.str = [19 x i8] c"Enter size (x y): \00"
@.str.1 = [5 x i8] c"%i%i\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.5 = [24 x i8] c"Progression in %i line\0A\00"
@str = [64 x i8] c"Error. Member of geometry progression can't be null. Exiting...\00"
@str.6 = [44 x i8] c"Error! Y must be positive and X must be > 1\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = icmp sgt i32 %7, 1
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 0
%11 = select i1 %8, i1 %10, i1 false
br i1 %11, label %21, label %12
12: ; preds = %0, %12
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.6, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%16 = load i32, i32* %1
%17 = icmp sgt i32 %16, 1
%18 = load i32, i32* %2
%19 = icmp sgt i32 %18, 0
%20 = select i1 %17, i1 %19, i1 false
br i1 %20, label %21, label %12
21: ; preds = %12, %0
%22 = load i32, i32* %2
%23 = shl i32 %22, 3
%24 = call i8* @malloc(i32 %23)
%25 = bitcast i8* %24 to float**
%26 = icmp sgt i32 %22, 0
br i1 %26, label %27, label %77
27: ; preds = %21
%28 = load i32, i32* %1
br label %31
29: ; preds = %56
%30 = icmp sgt i32 %57, 0
br i1 %30, label %62, label %77
31: ; preds = %27, %56
%32 = phi i32 [ %22, %27 ], [ %57, %56 ]
%33 = phi i32 [ %28, %27 ], [ %58, %56 ]
%34 = phi i64 [ 0, %27 ], [ %59, %56 ]
%35 = shl i32 %33, 2
%36 = call i8* @malloc(i32 %35)
%37 = getelementptr inbounds float*, float** %25, i64 %34
%38 = bitcast float** %37 to i8**
store i8* %36, i8** %38
%39 = icmp sgt i32 %33, 0
%40 = bitcast i8* %36 to float*
br i1 %39, label %45, label %56
41: ; preds = %45
%42 = load i32, i32* %1
%43 = sext i32 %42 to i64
%44 = icmp slt i64 %51, %43
br i1 %44, label %45, label %54
45: ; preds = %31, %41
%46 = phi i64 [ %51, %41 ], [ 0, %31 ]
%47 = getelementptr inbounds float, float* %40, i64 %46
%48 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %47)
%49 = load float, float* %47
%50 = fcmp oeq float %49, 0.000000e+00
%51 = add nuw nsw i64 %46, 1
br i1 %50, label %52, label %41
52: ; preds = %45
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
br label %77
54: ; preds = %41
%55 = load i32, i32* %2
br label %56
56: ; preds = %54, %31
%57 = phi i32 [ %55, %54 ], [ %32, %31 ]
%58 = phi i32 [ %42, %54 ], [ %33, %31 ]
%59 = add nuw nsw i64 %34, 1
%60 = sext i32 %57 to i64
%61 = icmp slt i64 %59, %60
br i1 %61, label %31, label %29
62: ; preds = %29, %73
%63 = phi i64 [ %69, %73 ], [ 0, %29 ]
%64 = getelementptr inbounds float*, float** %25, i64 %63
%65 = load float*, float** %64
%66 = load i32, i32* %1
%67 = call i64 @checkProgression(float* %65, i32 %66)
%68 = icmp eq i64 %67, 0
%69 = add nuw nsw i64 %63, 1
br i1 %68, label %73, label %70
70: ; preds = %62
%71 = trunc i64 %69 to i32
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i32 %71)
br label %73
73: ; preds = %62, %70
%74 = load i32, i32* %2
%75 = sext i32 %74 to i64
%76 = icmp slt i64 %69, %75
br i1 %76, label %62, label %77
77: ; preds = %73, %21, %29, %52
ret i32 0
}