#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char const *, double const);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ *stdout;
int cd_mat_vec_fprintf(FILE *stream, const char *prefix, const double *a, int n,
                       const char *start, const char *dblfmt, const char *sep,
                       const char *end, const char *suffix) {
  int j;
  FILE *x_stream = stream ? stream : stdout;
  const char *x_prefix = prefix ? prefix : "";
  const char *x_start = start ? start : "< ";
  const char *x_dblfmt = dblfmt ? dblfmt : "%8.4f";
  const char *x_sep = sep ? sep : ", ";
  const char *x_end = end ? end : " >";
  const char *x_suffix = suffix ? suffix : "\n";
  fputs(x_prefix, x_stream);
  fputs(x_start, x_stream);
  for (j = 0; j < n; j++) {
    if (j > 0)
      fputs(x_sep, x_stream);
    fprintf(x_stream, x_dblfmt, a[j]);
  }
  fputs(x_end, x_stream);
  fputs(x_suffix, x_stream);
  return 0;
}


x86 assembly (clang, -O0):
<cd_mat_vec_fprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1166 <cd_mat_vec_fprintf+0x46>
mov    -0x8(%rbp),%rax
mov    %rax,-0x78(%rbp)
jmp    1174 <cd_mat_vec_fprintf+0x54>
mov    0x2e73(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1194 <cd_mat_vec_fprintf+0x74>
mov    -0x10(%rbp),%rax
mov    %rax,-0x80(%rbp)
jmp    11a4 <cd_mat_vec_fprintf+0x84>
lea    0xe75(%rip),%rax
mov    %rax,-0x80(%rbp)
jmp    11a4 <cd_mat_vec_fprintf+0x84>
mov    -0x80(%rbp),%rax
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     11c7 <cd_mat_vec_fprintf+0xa7>
mov    -0x28(%rbp),%rax
mov    %rax,-0x88(%rbp)
jmp    11da <cd_mat_vec_fprintf+0xba>
lea    0xe32(%rip),%rax
mov    %rax,-0x88(%rbp)
jmp    11da <cd_mat_vec_fprintf+0xba>
mov    -0x88(%rbp),%rax
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1200 <cd_mat_vec_fprintf+0xe0>
mov    -0x30(%rbp),%rax
mov    %rax,-0x90(%rbp)
jmp    1213 <cd_mat_vec_fprintf+0xf3>
lea    0xdfc(%rip),%rax
mov    %rax,-0x90(%rbp)
jmp    1213 <cd_mat_vec_fprintf+0xf3>
mov    -0x90(%rbp),%rax
mov    %rax,-0x58(%rbp)
cmpq   $0x0,0x10(%rbp)
je     1239 <cd_mat_vec_fprintf+0x119>
mov    0x10(%rbp),%rax
mov    %rax,-0x98(%rbp)
jmp    124c <cd_mat_vec_fprintf+0x12c>
lea    0xdc9(%rip),%rax
mov    %rax,-0x98(%rbp)
jmp    124c <cd_mat_vec_fprintf+0x12c>
mov    -0x98(%rbp),%rax
mov    %rax,-0x60(%rbp)
cmpq   $0x0,0x18(%rbp)
je     1272 <cd_mat_vec_fprintf+0x152>
mov    0x18(%rbp),%rax
mov    %rax,-0xa0(%rbp)
jmp    1285 <cd_mat_vec_fprintf+0x165>
lea    0xd93(%rip),%rax
mov    %rax,-0xa0(%rbp)
jmp    1285 <cd_mat_vec_fprintf+0x165>
mov    -0xa0(%rbp),%rax
mov    %rax,-0x68(%rbp)
cmpq   $0x0,0x20(%rbp)
je     12ab <cd_mat_vec_fprintf+0x18b>
mov    0x20(%rbp),%rax
mov    %rax,-0xa8(%rbp)
jmp    12be <cd_mat_vec_fprintf+0x19e>
lea    0xd5d(%rip),%rax
mov    %rax,-0xa8(%rbp)
jmp    12be <cd_mat_vec_fprintf+0x19e>
mov    -0xa8(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1030 <fputs@plt>
mov    -0x50(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1030 <fputs@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1335 <cd_mat_vec_fprintf+0x215>
cmpl   $0x0,-0x34(%rbp)
jle    130d <cd_mat_vec_fprintf+0x1ed>
mov    -0x60(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1030 <fputs@plt>
mov    -0x40(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1040 <fprintf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12ea <cd_mat_vec_fprintf+0x1ca>
mov    -0x68(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1030 <fputs@plt>
mov    -0x70(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1030 <fputs@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cd_mat_vec_fprintf>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%r14
mov    %rdi,%rbx
mov    0x40(%rsp),%rax
test   %rdi,%rdi
jne    1147 <cd_mat_vec_fprintf+0x27>
mov    0x2e9c(%rip),%rcx
mov    (%rcx),%rbx
test   %rsi,%rsi
lea    0xebf(%rip),%rdi
cmovne %rsi,%rdi
test   %r8,%r8
lea    0xea1(%rip),%r13
cmovne %r8,%r13
test   %r9,%r9
lea    0xe96(%rip),%r12
cmovne %r9,%r12
test   %rax,%rax
lea    0xe8e(%rip),%r15
cmovne %rax,%r15
mov    %rbx,%rsi
call   1030 <fputs@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1030 <fputs@plt>
test   %ebp,%ebp
jle    11e5 <cd_mat_vec_fprintf+0xc5>
movsd  (%r14),%xmm0
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <fprintf@plt>
cmp    $0x1,%ebp
je     11e5 <cd_mat_vec_fprintf+0xc5>
mov    %ebp,%r13d
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <fputs@plt>
movsd  (%r14,%rbp,8),%xmm0
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <fprintf@plt>
add    $0x1,%rbp
cmp    %rbp,%r13
jne    11c0 <cd_mat_vec_fprintf+0xa0>
mov    0x50(%rsp),%rax
test   %rax,%rax
lea    0xe1b(%rip),%rbp
cmovne %rax,%rbp
mov    0x48(%rsp),%rax
test   %rax,%rax
lea    0xe05(%rip),%rdi
cmovne %rax,%rdi
mov    %rbx,%rsi
call   1030 <fputs@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <fputs@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdout = global i32* null
@.str = [1 x i8] zeroinitializer
@.str.1 = [3 x i8] c"< \00"
@.str.2 = [6 x i8] c"%8.4f\00"
@.str.3 = [3 x i8] c", \00"
@.str.4 = [3 x i8] c" >\00"
@.str.5 = [2 x i8] c"\0A\00"
define i32 @cd_mat_vec_fprintf(i32* %0, i8* %1, double* %2, i32 %3, i8* %4, i8* %5, i8* %6, i8* %7, i8* %8) {
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca double*
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i32
%20 = alloca i32*
%21 = alloca i8*
%22 = alloca i8*
%23 = alloca i8*
%24 = alloca i8*
%25 = alloca i8*
%26 = alloca i8*
store i32* %0, i32** %10
store i8* %1, i8** %11
store double* %2, double** %12
store i32 %3, i32* %13
store i8* %4, i8** %14
store i8* %5, i8** %15
store i8* %6, i8** %16
store i8* %7, i8** %17
store i8* %8, i8** %18
%27 = load i32*, i32** %10
%28 = icmp ne i32* %27, null
br i1 %28, label %29, label %31
29: ; preds = %9
%30 = load i32*, i32** %10
br label %33
31: ; preds = %9
%32 = load i32*, i32** @stdout
br label %33
33: ; preds = %31, %29
%34 = phi i32* [ %30, %29 ], [ %32, %31 ]
store i32* %34, i32** %20
%35 = load i8*, i8** %11
%36 = icmp ne i8* %35, null
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = load i8*, i8** %11
br label %40
39: ; preds = %33
br label %40
40: ; preds = %39, %37
%41 = phi i8* [ %38, %37 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %39 ]
store i8* %41, i8** %21
%42 = load i8*, i8** %14
%43 = icmp ne i8* %42, null
br i1 %43, label %44, label %46
44: ; preds = %40
%45 = load i8*, i8** %14
br label %47
46: ; preds = %40
br label %47
47: ; preds = %46, %44
%48 = phi i8* [ %45, %44 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %46 ]
store i8* %48, i8** %22
%49 = load i8*, i8** %15
%50 = icmp ne i8* %49, null
br i1 %50, label %51, label %53
51: ; preds = %47
%52 = load i8*, i8** %15
br label %54
53: ; preds = %47
br label %54
54: ; preds = %53, %51
%55 = phi i8* [ %52, %51 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %53 ]
store i8* %55, i8** %23
%56 = load i8*, i8** %16
%57 = icmp ne i8* %56, null
br i1 %57, label %58, label %60
58: ; preds = %54
%59 = load i8*, i8** %16
br label %61
60: ; preds = %54
br label %61
61: ; preds = %60, %58
%62 = phi i8* [ %59, %58 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), %60 ]
store i8* %62, i8** %24
%63 = load i8*, i8** %17
%64 = icmp ne i8* %63, null
br i1 %64, label %65, label %67
65: ; preds = %61
%66 = load i8*, i8** %17
br label %68
67: ; preds = %61
br label %68
68: ; preds = %67, %65
%69 = phi i8* [ %66, %65 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), %67 ]
store i8* %69, i8** %25
%70 = load i8*, i8** %18
%71 = icmp ne i8* %70, null
br i1 %71, label %72, label %74
72: ; preds = %68
%73 = load i8*, i8** %18
br label %75
74: ; preds = %68
br label %75
75: ; preds = %74, %72
%76 = phi i8* [ %73, %72 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), %74 ]
store i8* %76, i8** %26
%77 = load i8*, i8** %21
%78 = load i32*, i32** %20
%79 = call i32 @fputs(i8* %77, i32* %78)
%80 = load i8*, i8** %22
%81 = load i32*, i32** %20
%82 = call i32 @fputs(i8* %80, i32* %81)
store i32 0, i32* %19
br label %83
83: ; preds = %103, %75
%84 = load i32, i32* %19
%85 = load i32, i32* %13
%86 = icmp slt i32 %84, %85
br i1 %86, label %87, label %106
87: ; preds = %83
%88 = load i32, i32* %19
%89 = icmp sgt i32 %88, 0
br i1 %89, label %90, label %94
90: ; preds = %87
%91 = load i8*, i8** %24
%92 = load i32*, i32** %20
%93 = call i32 @fputs(i8* %91, i32* %92)
br label %94
94: ; preds = %90, %87
%95 = load i32*, i32** %20
%96 = load i8*, i8** %23
%97 = load double*, double** %12
%98 = load i32, i32* %19
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds double, double* %97, i64 %99
%101 = load double, double* %100
%102 = call i32 @fprintf(i32* %95, i8* %96, double %101)
br label %103
103: ; preds = %94
%104 = load i32, i32* %19
%105 = add nsw i32 %104, 1
store i32 %105, i32* %19
br label %83
106: ; preds = %83
%107 = load i8*, i8** %25
%108 = load i32*, i32** %20
%109 = call i32 @fputs(i8* %107, i32* %108)
%110 = load i8*, i8** %26
%111 = load i32*, i32** %20
%112 = call i32 @fputs(i8* %110, i32* %111)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32* null
@.str = [1 x i8] zeroinitializer
@.str.1 = [3 x i8] c"< \00"
@.str.2 = [6 x i8] c"%8.4f\00"
@.str.3 = [3 x i8] c", \00"
@.str.4 = [3 x i8] c" >\00"
@.str.5 = [2 x i8] c"\0A\00"
define i32 @cd_mat_vec_fprintf(i32* %0, i8* %1, double* nocapture %2, i32 %3, i8* %4, i8* %5, i8* %6, i8* %7, i8* %8) {
%10 = icmp eq i32* %0, null
%11 = load i32*, i32** @stdout
%12 = select i1 %10, i32* %11, i32* %0
%13 = icmp eq i8* %1, null
%14 = select i1 %13, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %1
%15 = icmp eq i8* %4, null
%16 = select i1 %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4
%17 = icmp eq i8* %5, null
%18 = select i1 %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %5
%19 = icmp eq i8* %6, null
%20 = select i1 %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %6
%21 = tail call i32 @fputs(i8* %14, i32* %12)
%22 = tail call i32 @fputs(i8* %16, i32* %12)
%23 = icmp sgt i32 %3, 0
br i1 %23, label %24, label %37
24: ; preds = %9
%25 = zext i32 %3 to i64
%26 = load double, double* %2
%27 = tail call i32 @fprintf(i32* %12, i8* %18, double %26)
%28 = icmp eq i32 %3, 1
br i1 %28, label %37, label %29
29: ; preds = %24, %29
%30 = phi i64 [ %35, %29 ], [ 1, %24 ]
%31 = tail call i32 @fputs(i8* %20, i32* %12)
%32 = getelementptr inbounds double, double* %2, i64 %30
%33 = load double, double* %32
%34 = tail call i32 @fprintf(i32* %12, i8* %18, double %33)
%35 = add nuw nsw i64 %30, 1
%36 = icmp eq i64 %35, %25
br i1 %36, label %37, label %29
37: ; preds = %29, %24, %9
%38 = icmp eq i8* %8, null
%39 = select i1 %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* %8
%40 = icmp eq i8* %7, null
%41 = select i1 %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %7
%42 = tail call i32 @fputs(i8* %41, i32* %12)
%43 = tail call i32 @fputs(i8* %39, i32* %12)
ret i32 0
}