#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 */
double fabs(double);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
void show_dvector(double *A, int n) {
  int j;
  for (j = 1; j <= n; j++) {
    if (fabs(A[j]) >= 1.e-99)
      fprintf(stdout, "%14.6e", A[j]);
    else
      fprintf(stdout, "   0       ");
  }
  fprintf(stdout, " ]';\n\n");
  return;
}


x86 assembly (clang, -O0):
<show_dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11af <show_dvector+0x9f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xeca(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xeae(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1185 <show_dvector+0x75>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xea7(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
jmp    119c <show_dvector+0x8c>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
lea    0xe92(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11a1 <show_dvector+0x91>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <show_dvector+0x16>
mov    0x2e2a(%rip),%rax
mov    (%rax),%edi
lea    0xe74(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_dvector>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    118e <show_dvector+0x7e>
mov    %esi,%r13d
mov    %rdi,%r14
add    $0x1,%r13d
mov    $0x1,%ebx
mov    0x2eab(%rip),%rbp
lea    0xee3(%rip),%r15
lea    0xed5(%rip),%r12
jmp    1163 <show_dvector+0x53>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
je     118e <show_dvector+0x7e>
movsd  (%r14,%rbx,8),%xmm0
movapd %xmm0,%xmm1
andpd  0xe8b(%rip),%xmm1
ucomisd 0xe93(%rip),%xmm1
mov    0x0(%rbp),%edi
jb     1150 <show_dvector+0x40>
mov    %r12,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
jmp    115a <show_dvector+0x4a>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
lea    0xe8d(%rip),%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [7 x i8] c"%14.6e\00"
@.str.1 = [12 x i8] c" 0 \00"
@.str.2 = [7 x i8] c" ]';\0A\0A\00"
define void @show_dvector(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 1, i32* %5
br label %6
6: ; preds = %30, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %33
10: ; preds = %6
%11 = load double*, double** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
%15 = load double, double* %14
%16 = call double @llvm.fabs.f64(double %15)
%17 = fcmp oge double %16, 1.000000e-99
br i1 %17, label %18, label %26
18: ; preds = %10
%19 = load i32, i32* @stdout
%20 = load double*, double** %3
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds double, double* %20, i64 %22
%24 = load double, double* %23
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %24)
br label %29
26: ; preds = %10
%27 = load i32, i32* @stdout
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %29
29: ; preds = %26, %18
br label %30
30: ; preds = %29
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
store i32 %32, i32* %5
br label %6
33: ; preds = %6
%34 = load i32, i32* @stdout
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [7 x i8] c"%14.6e\00"
@.str.1 = [12 x i8] c" 0 \00"
@.str.2 = [7 x i8] c" ]';\0A\0A\00"
define void @show_dvector(double* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %21, label %4
4: ; preds = %2
%5 = add nuw i32 %1, 1
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %4, %18
%8 = phi i64 [ 1, %4 ], [ %19, %18 ]
%9 = getelementptr inbounds double, double* %0, i64 %8
%10 = load double, double* %9
%11 = tail call double @llvm.fabs.f64(double %10)
%12 = fcmp ult double %11, 1.000000e-99
%13 = load i32, i32* @stdout
br i1 %12, label %16, label %14
14: ; preds = %7
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %10)
br label %18
16: ; preds = %7
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %14, %16
%19 = add nuw nsw i64 %8, 1
%20 = icmp eq i64 %19, %6
br i1 %20, label %21, label %7
21: ; preds = %18, %2
%22 = load i32, i32* @stdout
%23 = tail call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret void
}