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


x86 assembly (clang, -O0):
<show_vector>:
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     11ad <show_vector+0x9d>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1156 <show_vector+0x46>
jp     1156 <show_vector+0x46>
jmp    1183 <show_vector+0x73>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe89(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
jmp    119a <show_vector+0x8a>
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
lea    0xe74(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    119f <show_vector+0x8f>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <show_vector+0x16>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
lea    0xe56(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_vector>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1187 <show_vector+0x77>
mov    %esi,%r13d
mov    %rdi,%r14
add    $0x1,%r13d
mov    $0x1,%ebx
mov    0x2eab(%rip),%rbp
lea    0xec8(%rip),%r15
lea    0xec8(%rip),%r12
jmp    1163 <show_vector+0x53>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
je     1187 <show_vector+0x77>
movss  (%r14,%rbx,4),%xmm0
ucomiss 0xe90(%rip),%xmm0
mov    0x0(%rbp),%edi
jne    1177 <show_vector+0x67>
jnp    1150 <show_vector+0x40>
cvtss2sd %xmm0,%xmm0
mov    %r15,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
jmp    115a <show_vector+0x4a>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
lea    0xe80(%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_vector(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca i32
store float* %0, float** %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 float*, float** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds float, float* %11, i64 %13
%15 = load float, float* %14
%16 = fcmp une float %15, 0.000000e+00
br i1 %16, label %17, label %26
17: ; preds = %10
%18 = load i32, i32* @stdout
%19 = load float*, float** %3
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds float, float* %19, i64 %21
%23 = load float, float* %22
%24 = fpext float %23 to double
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %18, 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, %17
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_vector(float* 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 float, float* %0, i64 %8
%10 = load float, float* %9
%11 = fcmp une float %10, 0.000000e+00
%12 = load i32, i32* @stdout
br i1 %11, label %13, label %16
13: ; preds = %7
%14 = fpext float %10 to double
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %14)
br label %18
16: ; preds = %7
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %13, %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
}