#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 /*<<< orphan*/ puts(char *);
void mvVecPrint(const float *v, int dim) {
  int i;
  if (dim < 1 || dim > 4) {
    puts("mvVecPrint() : invalid dimension; must be 2, 3, or 4.");
    return;
  }
  printf("<");
  for (i = 0; i < dim; i++) {
    printf(" %.2f ", v[i]);
  }
  puts(">");
}


x86 assembly (clang, -O0):
<mvVecPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jl     1143 <mvVecPrint+0x23>
cmpl   $0x4,-0xc(%rbp)
jle    1154 <mvVecPrint+0x34>
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
jmp    11ae <mvVecPrint+0x8e>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11a2 <mvVecPrint+0x82>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeab(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1169 <mvVecPrint+0x49>
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mvVecPrint>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %esi,%r14d
lea    -0x5(%r14),%eax
cmp    $0xfffffffc,%eax
jae    114e <mvVecPrint+0x1e>
lea    0xeb4(%rip),%r14
jmp    118d <mvVecPrint+0x5d>
mov    %rdi,%r12
mov    $0x3c,%edi
call   1030 <putchar@plt>
mov    %r14d,%r13d
xor    %ebx,%ebx
lea    0xecf(%rip),%r15
lea    0xecf(%rip),%r14
xchg   %ax,%ax
movss  (%r12,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1170 <mvVecPrint+0x40>
mov    %r14,%rdi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"mvVecPrint() : invalid dimension; must be 2, 3, or 4.\00"
@.str.1 = [2 x i8] c"<\00"
@.str.2 = [7 x i8] c" %.2f \00"
@.str.3 = [2 x i8] c">\00"
define void @mvVecPrint(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 1
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 4
br i1 %10, label %11, label %13
11: ; preds = %8, %2
%12 = call i32 @puts(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
br label %32
13: ; preds = %8
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %5
br label %15
15: ; preds = %27, %13
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %30
19: ; preds = %15
%20 = load float*, float** %3
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds float, float* %20, i64 %22
%24 = load float, float* %23
%25 = fpext float %24 to double
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %25)
br label %27
27: ; preds = %19
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %15
30: ; preds = %15
%31 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %32
32: ; preds = %30, %11
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"mvVecPrint() : invalid dimension; must be 2, 3, or 4.\00"
@.str.2 = [7 x i8] c" %.2f \00"
@.str.3 = [2 x i8] c">\00"
define void @mvVecPrint(float* nocapture %0, i32 %1) {
%3 = add i32 %1, -5
%4 = icmp ult i32 %3, -4
br i1 %4, label %16, label %5
5: ; preds = %2
%6 = tail call i32 @putchar(i32 60)
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %14, %8 ]
%10 = getelementptr inbounds float, float* %0, i64 %9
%11 = load float, float* %10
%12 = fpext float %11 to double
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %12)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %16, label %8
16: ; preds = %8, %2
%17 = phi i8* [ getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), %2 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), %8 ]
%18 = tail call i32 @puts(i8* dereferenceable(1) %17)
ret void
}