#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 *, ...);
void displayArray(double *main_diagonal, double *below_diagonal,
                  double *above_diagonal, double *r, int N) {
  printf("[b]\t\t[d]\t\t[a]\t\t[r]\n");
  for (int i = 0; i < N - 1; i++) {
    printf("%lf\t%lf\t%lf\t%lf\n", *(below_diagonal + i), *(main_diagonal + i),
           *(above_diagonal + i), *(r + i));
  }
  printf("\t\t%lf\t\t\t%lf\n", *(main_diagonal + N - 1), *(r + N - 1));
}


x86 assembly (clang, -O0):
<displayArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11a2 <displayArray+0x92>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
lea    0xe87(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1141 <displayArray+0x31>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  -0x8(%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  -0x8(%rax,%rcx,8),%xmm1
lea    0xe60(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayArray>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8d,%ebp
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%rbx
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
mov    %rbp,(%rsp)
cmp    $0x2,%ebp
jl     118f <displayArray+0x6f>
mov    (%rsp),%rax
lea    -0x1(%rax),%r14d
xor    %ebp,%ebp
nopl   0x0(%rax)
movsd  0x0(%r13,%rbp,8),%xmm0
movsd  (%rbx,%rbp,8),%xmm1
movsd  (%r12,%rbp,8),%xmm2
movsd  (%r15,%rbp,8),%xmm3
lea    0xe81(%rip),%rdi
mov    $0x4,%al
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r14
jne    1160 <displayArray+0x40>
movslq (%rsp),%rax
movsd  -0x8(%rbx,%rax,8),%xmm0
movsd  -0x8(%r15,%rax,8),%xmm1
lea    0xe6a(%rip),%rdi
mov    $0x2,%al
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"[b]\09\09[d]\09\09[a]\09\09[r]\0A\00"
@.str.1 = [17 x i8] c"%lf\09%lf\09%lf\09%lf\0A\00"
@.str.2 = [13 x i8] c"\09\09%lf\09\09\09%lf\0A\00"
define void @displayArray(double* %0, double* %1, double* %2, double* %3, i32 %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca i32
%11 = alloca i32
store double* %0, double** %6
store double* %1, double** %7
store double* %2, double** %8
store double* %3, double** %9
store i32 %4, i32* %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %11
br label %13
13: ; preds = %40, %5
%14 = load i32, i32* %11
%15 = load i32, i32* %10
%16 = sub nsw i32 %15, 1
%17 = icmp slt i32 %14, %16
br i1 %17, label %18, label %43
18: ; preds = %13
%19 = load double*, double** %7
%20 = load i32, i32* %11
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %19, i64 %21
%23 = load double, double* %22
%24 = load double*, double** %6
%25 = load i32, i32* %11
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double, double* %24, i64 %26
%28 = load double, double* %27
%29 = load double*, double** %8
%30 = load i32, i32* %11
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds double, double* %29, i64 %31
%33 = load double, double* %32
%34 = load double*, double** %9
%35 = load i32, i32* %11
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds double, double* %34, i64 %36
%38 = load double, double* %37
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %23, double %28, double %33, double %38)
br label %40
40: ; preds = %18
%41 = load i32, i32* %11
%42 = add nsw i32 %41, 1
store i32 %42, i32* %11
br label %13
43: ; preds = %13
%44 = load double*, double** %6
%45 = load i32, i32* %10
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds double, double* %44, i64 %46
%48 = getelementptr inbounds double, double* %47, i64 -1
%49 = load double, double* %48
%50 = load double*, double** %9
%51 = load i32, i32* %10
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %50, i64 %52
%54 = getelementptr inbounds double, double* %53, i64 -1
%55 = load double, double* %54
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %49, double %55)
ret void
}

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