#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*/ printf(char *, ...);
int read2darr(double **, int);
int /*<<< orphan*/ showres(double **, int);
int main(void) {
  double ar[3][5];
  printf(
      "Please enter %d sets of numbers, each of which contains %d numbers.\n",
      3, 5);
  while (read2darr(ar, 3) != 3 * 5)
    printf("Input Error! Try again please.\n");
  showres(ar, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x3,%esi
mov    $0x5,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x80(%rbp),%rdi
mov    $0x3,%esi
call   1040 <read2darr@plt>
cmp    $0xf,%eax
je     1184 <main+0x54>
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115a <main+0x2a>
lea    -0x80(%rbp),%rdi
mov    $0x3,%esi
call   1050 <showres@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x78,%rsp
lea    0xeb2(%rip),%rdi
mov    $0x3,%esi
mov    $0x5,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rdi
mov    $0x3,%esi
call   1050 <read2darr@plt>
cmp    $0xf,%eax
je     119a <main+0x5a>
lea    0xecd(%rip),%r14
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1050 <read2darr@plt>
cmp    $0xf,%eax
jne    1180 <main+0x40>
mov    %rsp,%rdi
mov    $0x3,%esi
call   1060 <showres@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [69 x i8] c"Please enter %d sets of numbers, each of which contains %d numbers.\0A\00"
@.str.1 = [32 x i8] c"Input Error! Try again please.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x [5 x double]]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i32 3, i32 5)
br label %4
4: ; preds = %9, %0
%5 = getelementptr inbounds [3 x [5 x double]], [3 x [5 x double]]* %2, i64 0, i64 0
%6 = bitcast [5 x double]* %5 to double**
%7 = call i32 @read2darr(double** %6, i32 3)
%8 = icmp ne i32 %7, 15
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
br label %4
11: ; preds = %4
%12 = getelementptr inbounds [3 x [5 x double]], [3 x [5 x double]]* %2, i64 0, i64 0
%13 = bitcast [5 x double]* %12 to double**
%14 = call i32 @showres(double** %13, i32 3)
ret i32 0
}

LLVM IR (-O2):
@.str = [69 x i8] c"Please enter %d sets of numbers, each of which contains %d numbers.\0A\00"
@str = [31 x i8] c"Input Error! Try again please.\00"
define i32 @main() {
%1 = alloca [3 x [5 x double]]
%2 = bitcast [3 x [5 x double]]* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i32 3, i32 5)
%4 = bitcast [3 x [5 x double]]* %1 to double**
%5 = call i32 @read2darr(double** %4, i32 3)
%6 = icmp eq i32 %5, 15
br i1 %6, label %11, label %7
7: ; preds = %0, %7
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%9 = call i32 @read2darr(double** %4, i32 3)
%10 = icmp eq i32 %9, 15
br i1 %10, label %11, label %7
11: ; preds = %7, %0
%12 = call i32 @showres(double** %4, i32 3)
ret i32 0
}