#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 show_input_planes(int n, int mdim, double *cff) {
  int i, j;
  int cnt = 0;
  for (i = 0; i < n; i++) {
    printf("input plane %d :\n", i);
    for (j = 0; j < mdim; j++) {
      printf("  %.17e", cff[cnt]);
      cnt = cnt + 1;
      if (cnt % 2 == 0)
        printf("\n");
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<show_input_planes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11d5 <show_input_planes+0xc5>
mov    -0x14(%rbp),%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11b9 <show_input_planes+0xa9>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe9e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11a6 <show_input_planes+0x96>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ab <show_input_planes+0x9b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1154 <show_input_planes+0x44>
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1130 <show_input_planes+0x20>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_input_planes>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %esi,0xc(%rsp)
mov    %edi,0x10(%rsp)
test   %edi,%edi
jle    11e0 <show_input_planes+0xc0>
mov    %rdx,%rbx
mov    0xc(%rsp),%r14d
neg    %r14d
lea    0xec2(%rip),%rbp
xor    %r15d,%r15d
xor    %r13d,%r13d
jmp    117f <show_input_planes+0x5f>
nopl   0x0(%rax,%rax,1)
mov    0x14(%rsp),%eax
sub    %r15d,%eax
mov    %eax,%r15d
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r13d
cmp    0x10(%rsp),%r13d
je     11e0 <show_input_planes+0xc0>
lea    0xe7a(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,0xc(%rsp)
jle    116a <show_input_planes+0x4a>
mov    %r15d,0x14(%rsp)
movslq %r15d,%r12
add    $0x1,%r12
xor    %r15d,%r15d
jmp    11bd <show_input_planes+0x9d>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r12
add    $0xffffffff,%r15d
cmp    %r15d,%r14d
je     1160 <show_input_planes+0x40>
movsd  -0x8(%rbx,%r12,8),%xmm0
mov    %rbp,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
test   $0x1,%r12b
jne    11b0 <show_input_planes+0x90>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11b0 <show_input_planes+0x90>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"input plane %d :\0A\00"
@.str.1 = [8 x i8] c" %.17e\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @show_input_planes(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store double* %2, double** %6
store i32 0, i32* %9
store i32 0, i32* %7
br label %10
10: ; preds = %41, %3
%11 = load i32, i32* %7
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %44
14: ; preds = %10
%15 = load i32, i32* %7
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %15)
store i32 0, i32* %8
br label %17
17: ; preds = %36, %14
%18 = load i32, i32* %8
%19 = load i32, i32* %5
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %39
21: ; preds = %17
%22 = load double*, double** %6
%23 = load i32, i32* %9
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %22, i64 %24
%26 = load double, double* %25
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %26)
%28 = load i32, i32* %9
%29 = add nsw i32 %28, 1
store i32 %29, i32* %9
%30 = load i32, i32* %9
%31 = srem i32 %30, 2
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %21
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %35
35: ; preds = %33, %21
br label %36
36: ; preds = %35
%37 = load i32, i32* %8
%38 = add nsw i32 %37, 1
store i32 %38, i32* %8
br label %17
39: ; preds = %17
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %41
41: ; preds = %39
%42 = load i32, i32* %7
%43 = add nsw i32 %42, 1
store i32 %43, i32* %7
br label %10
44: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"input plane %d :\0A\00"
@.str.1 = [8 x i8] c" %.17e\00"
define i32 @show_input_planes(i32 %0, i32 %1, double* nocapture %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %34
5: ; preds = %3
%6 = icmp sgt i32 %1, 0
br label %7
7: ; preds = %5, %29
%8 = phi i32 [ 0, %5 ], [ %30, %29 ]
%9 = phi i32 [ 0, %5 ], [ %32, %29 ]
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %9)
br i1 %6, label %11, label %29
11: ; preds = %7
%12 = sext i32 %8 to i64
br label %13
13: ; preds = %11, %24
%14 = phi i64 [ %12, %11 ], [ %19, %24 ]
%15 = phi i32 [ 0, %11 ], [ %25, %24 ]
%16 = getelementptr inbounds double, double* %2, i64 %14
%17 = load double, double* %16
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %17)
%19 = add nsw i64 %14, 1
%20 = and i64 %19, 1
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %13
%23 = tail call i32 @putchar(i32 10)
br label %24
24: ; preds = %13, %22
%25 = add nuw nsw i32 %15, 1
%26 = icmp eq i32 %25, %1
br i1 %26, label %27, label %13
27: ; preds = %24
%28 = trunc i64 %19 to i32
br label %29
29: ; preds = %27, %7
%30 = phi i32 [ %8, %7 ], [ %28, %27 ]
%31 = tail call i32 @putchar(i32 10)
%32 = add nuw nsw i32 %9, 1
%33 = icmp eq i32 %32, %0
br i1 %33, label %34, label %7
34: ; preds = %29, %3
ret i32 0
}