#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 */
scalar_t__ fprintf(int /*<<< orphan*/ *, char *, double);
scalar_t__ fputc(char, int /*<<< orphan*/ *);
scalar_t__ fputs(char *, int /*<<< orphan*/ *);
int l_outCoord(FILE *outf, char *name, double *arr, int n, char *ep) {
  int j;
  if (fputs(name, outf) < 0)
    return -1;
  if (arr != NULL)
    for (j = 0; j < n; j++) {
      if ((j > 0) && (fputc(',', outf) <= 0))
        return -1;
      if (fprintf(outf, "%.1f", arr[j]) <= 0)
        return -1;
    }
  if (fputs(ep, outf) < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<l_outCoord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fputs@plt>
cmp    $0x0,%rax
jge    116e <l_outCoord+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    122f <l_outCoord+0xff>
cmpq   $0x0,-0x20(%rbp)
je     1205 <l_outCoord+0xd5>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1200 <l_outCoord+0xd0>
cmpl   $0x0,-0x34(%rbp)
jle    11ba <l_outCoord+0x8a>
mov    -0x10(%rbp),%rsi
mov    $0x2c,%edi
call   1040 <fputc@plt>
cmp    $0x0,%rax
jg     11ba <l_outCoord+0x8a>
movl   $0xffffffff,-0x4(%rbp)
jmp    122f <l_outCoord+0xff>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe2e(%rip),%rsi
call   1050 <fprintf@plt>
cmp    $0x0,%rax
jg     11ed <l_outCoord+0xbd>
movl   $0xffffffff,-0x4(%rbp)
jmp    122f <l_outCoord+0xff>
jmp    11f2 <l_outCoord+0xc2>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1180 <l_outCoord+0x50>
jmp    1205 <l_outCoord+0xd5>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fputs@plt>
cmp    $0x0,%rax
jge    1228 <l_outCoord+0xf8>
movl   $0xffffffff,-0x4(%rbp)
jmp    122f <l_outCoord+0xff>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l_outCoord>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%rbp
mov    %ecx,%r14d
mov    %rdx,%r12
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
call   1030 <fputs@plt>
mov    $0xffffffff,%r15d
test   %rax,%rax
js     11c9 <l_outCoord+0x99>
mov    %rbp,(%rsp)
test   %r12,%r12
je     11b6 <l_outCoord+0x86>
test   %r14d,%r14d
jle    11b6 <l_outCoord+0x86>
mov    %r14d,%ebp
xor    %r14d,%r14d
lea    0xe88(%rip),%r13
nopl   0x0(%rax,%rax,1)
test   %r14,%r14
je     1197 <l_outCoord+0x67>
mov    $0x2c,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
test   %rax,%rax
jle    11c9 <l_outCoord+0x99>
movsd  (%r12,%r14,8),%xmm0
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <fprintf@plt>
test   %rax,%rax
jle    11c9 <l_outCoord+0x99>
add    $0x1,%r14
cmp    %r14,%rbp
jne    1180 <l_outCoord+0x50>
mov    (%rsp),%rdi
mov    %rbx,%rsi
call   1030 <fputs@plt>
mov    %rax,%r15
sar    $0x3f,%r15
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%.1f\00"
define i32 @l_outCoord(i32* %0, i8* %1, double* %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca double*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
store i32* %0, i32** %7
store i8* %1, i8** %8
store double* %2, double** %9
store i32 %3, i32* %10
store i8* %4, i8** %11
%13 = load i8*, i8** %8
%14 = load i32*, i32** %7
%15 = call i64 @fputs(i8* %13, i32* %14)
%16 = icmp slt i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %5
store i32 -1, i32* %6
br label %56
18: ; preds = %5
%19 = load double*, double** %9
%20 = icmp ne double* %19, null
br i1 %20, label %21, label %49
21: ; preds = %18
store i32 0, i32* %12
br label %22
22: ; preds = %45, %21
%23 = load i32, i32* %12
%24 = load i32, i32* %10
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %48
26: ; preds = %22
%27 = load i32, i32* %12
%28 = icmp sgt i32 %27, 0
br i1 %28, label %29, label %34
29: ; preds = %26
%30 = load i32*, i32** %7
%31 = call i64 @fputc(i8 signext 44, i32* %30)
%32 = icmp sle i64 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %29
store i32 -1, i32* %6
br label %56
34: ; preds = %29, %26
%35 = load i32*, i32** %7
%36 = load double*, double** %9
%37 = load i32, i32* %12
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds double, double* %36, i64 %38
%40 = load double, double* %39
%41 = call i64 @fprintf(i32* %35, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %40)
%42 = icmp sle i64 %41, 0
br i1 %42, label %43, label %44
43: ; preds = %34
store i32 -1, i32* %6
br label %56
44: ; preds = %34
br label %45
45: ; preds = %44
%46 = load i32, i32* %12
%47 = add nsw i32 %46, 1
store i32 %47, i32* %12
br label %22
48: ; preds = %22
br label %49
49: ; preds = %48, %18
%50 = load i8*, i8** %11
%51 = load i32*, i32** %7
%52 = call i64 @fputs(i8* %50, i32* %51)
%53 = icmp slt i64 %52, 0
br i1 %53, label %54, label %55
54: ; preds = %49
store i32 -1, i32* %6
br label %56
55: ; preds = %49
store i32 0, i32* %6
br label %56
56: ; preds = %55, %54, %43, %33, %17
%57 = load i32, i32* %6
ret i32 %57
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.1f\00"
define i32 @l_outCoord(i32* nocapture %0, i8* nocapture %1, double* %2, i32 %3, i8* nocapture %4) {
%6 = tail call i64 @fputs(i8* %1, i32* %0)
%7 = icmp slt i64 %6, 0
br i1 %7, label %32, label %8
8: ; preds = %5
%9 = icmp ne double* %2, null
%10 = icmp sgt i32 %3, 0
%11 = and i1 %9, %10
br i1 %11, label %12, label %28
12: ; preds = %8
%13 = zext i32 %3 to i64
br label %16
14: ; preds = %22
%15 = icmp eq i64 %27, %13
br i1 %15, label %28, label %16
16: ; preds = %12, %14
%17 = phi i64 [ 0, %12 ], [ %27, %14 ]
%18 = icmp eq i64 %17, 0
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = tail call i64 @fputc(i8 signext 44, i32* %0)
%21 = icmp slt i64 %20, 1
br i1 %21, label %32, label %22
22: ; preds = %19, %16
%23 = getelementptr inbounds double, double* %2, i64 %17
%24 = load double, double* %23
%25 = tail call i64 @fprintf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %24)
%26 = icmp slt i64 %25, 1
%27 = add nuw nsw i64 %17, 1
br i1 %26, label %32, label %14
28: ; preds = %14, %8
%29 = tail call i64 @fputs(i8* %4, i32* %0)
%30 = ashr i64 %29, 63
%31 = trunc i64 %30 to i32
br label %32
32: ; preds = %22, %19, %28, %5
%33 = phi i32 [ -1, %5 ], [ %31, %28 ], [ -1, %19 ], [ -1, %22 ]
ret i32 %33
}