#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 Print_vector(char *title, double y[], double m) {
  int i;
  printf("%s\n", title);
  for (i = 0; i < m; i++)
    printf("%6.3f ", y[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<Print_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    117b <Print_vector+0x6b>
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)
jmp    113e <Print_vector+0x2e>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Print_vector>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %rsi,%r15
call   1040 <puts@plt>
xorpd  %xmm0,%xmm0
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jbe    1187 <Print_vector+0x57>
xor    %ebx,%ebx
lea    0xea0(%rip),%r14
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x1,%rbx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
ja     1160 <Print_vector+0x30>
mov    $0xa,%edi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [7 x i8] c"%6.3f \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @Print_vector(i8* %0, double* %1, double %2) {
%4 = alloca i8*
%5 = alloca double*
%6 = alloca double
%7 = alloca i32
store i8* %0, i8** %4
store double* %1, double** %5
store double %2, double* %6
%8 = load i8*, i8** %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
store i32 0, i32* %7
br label %10
10: ; preds = %22, %3
%11 = load i32, i32* %7
%12 = sitofp i32 %11 to double
%13 = load double, double* %6
%14 = fcmp olt double %12, %13
br i1 %14, label %15, label %25
15: ; preds = %10
%16 = load double*, double** %5
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double, double* %16, i64 %18
%20 = load double, double* %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %20)
br label %22
22: ; preds = %15
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
store i32 %24, i32* %7
br label %10
25: ; preds = %10
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"%6.3f \00"
define void @Print_vector(i8* nocapture %0, double* nocapture %1, double %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) %0)
%5 = fcmp ogt double %2, 0.000000e+00
br i1 %5, label %6, label %15
6: ; preds = %3, %6
%7 = phi i64 [ %11, %6 ], [ 0, %3 ]
%8 = getelementptr inbounds double, double* %1, i64 %7
%9 = load double, double* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %9)
%11 = add nuw i64 %7, 1
%12 = trunc i64 %11 to i32
%13 = sitofp i32 %12 to double
%14 = fcmp olt double %13, %2
br i1 %14, label %6, label %15
15: ; preds = %6, %3
%16 = tail call i32 @putchar(i32 10)
ret void
}