#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*/ cov_serialize(long double, unsigned char *, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
unsigned char *malloc(int);
void cov_arr_log_(long double **lds_pointer, int *size_pointer) {
  int ld_size, i, j;
  unsigned char *buf;
  FILE *file;
  file = fopen("spec.cov", "a");
  ld_size = 10;
  buf = malloc(ld_size);
  fprintf(file, "#result\n");
  long double *lds = *lds_pointer;
  int size = *size_pointer;
  for (i = 0; i < size; i++) {
    long double ld = lds[i];
    cov_serialize(ld, buf, ld_size);
    if (i > 0)
      fprintf(file, " ");
    for (j = 0; j < ld_size; j++) {
      fprintf(file, "%02X", buf[j]);
    }
  }
  fprintf(file, "\n");
  fclose(file);
}


x86 assembly (clang, -O0):
<cov_arr_log_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe99(%rip),%rdi
lea    0xe9b(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x30(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xe76(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    1257 <cov_arr_log_+0x107>
mov    -0x38(%rbp),%rax
movslq -0x18(%rbp),%rcx
shl    $0x4,%rcx
fldt   (%rax,%rcx,1)
fstpt  -0x50(%rbp)
fldt   -0x50(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    %rsp,%rax
fstpt  (%rax)
call   1070 <cov_serialize@plt>
cmpl   $0x0,-0x18(%rbp)
jle    1205 <cov_arr_log_+0xb5>
mov    -0x30(%rbp),%rdi
lea    0xe16(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1244 <cov_arr_log_+0xf4>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
lea    0xde7(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    120c <cov_arr_log_+0xbc>
jmp    1249 <cov_arr_log_+0xf9>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11b7 <cov_arr_log_+0x67>
mov    -0x30(%rbp),%rdi
lea    0xdb0(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cov_arr_log_>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r12
mov    %rdi,%r15
lea    0xe76(%rip),%rdi
lea    0xe78(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%r14
mov    $0xa,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xe5e(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
mov    (%r12),%r12d
test   %r12d,%r12d
jle    1388 <cov_arr_log_+0x218>
mov    (%r15),%r13
fldt   0x0(%r13)
fstpt  (%rsp)
mov    %rbx,%rdi
mov    $0xa,%esi
call   1090 <cov_serialize@plt>
movzbl (%rbx),%edx
lea    0xe27(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
movzbl 0x1(%rbx),%edx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
movzbl 0x2(%rbx),%edx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
movzbl 0x3(%rbx),%edx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
movzbl 0x4(%rbx),%edx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
movzbl 0x5(%rbx),%edx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
movzbl 0x6(%rbx),%edx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
movzbl 0x7(%rbx),%edx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
movzbl 0x8(%rbx),%edx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
movzbl 0x9(%rbx),%edx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
cmp    $0x1,%r12d
je     1388 <cov_arr_log_+0x218>
add    $0x10,%r13
add    $0xffffffffffffffff,%r12
lea    0xd68(%rip),%r15
nopl   0x0(%rax)
fldt   0x0(%r13)
fstpt  (%rsp)
mov    %rbx,%rdi
mov    $0xa,%esi
call   1090 <cov_serialize@plt>
mov    $0x20,%edi
mov    %r14,%rsi
call   1040 <fputc@plt>
movzbl (%rbx),%edx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
movzbl 0x1(%rbx),%edx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
movzbl 0x2(%rbx),%edx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
movzbl 0x3(%rbx),%edx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
movzbl 0x4(%rbx),%edx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
movzbl 0x5(%rbx),%edx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
movzbl 0x6(%rbx),%edx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
movzbl 0x7(%rbx),%edx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
movzbl 0x8(%rbx),%edx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
movzbl 0x9(%rbx),%edx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
add    $0x10,%r13
add    $0xffffffffffffffff,%r12
jne    12b0 <cov_arr_log_+0x140>
mov    $0xa,%edi
mov    %r14,%rsi
call   1040 <fputc@plt>
mov    %r14,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"spec.cov\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [9 x i8] c"#result\0A\00"
@.str.3 = [2 x i8] c" \00"
@.str.4 = [5 x i8] c"%02X\00"
@.str.5 = [2 x i8] c"\0A\00"
define void @cov_arr_log_(x86_fp80** %0, i32* %1) {
%3 = alloca x86_fp80**
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca x86_fp80*
%11 = alloca i32
%12 = alloca x86_fp80
store x86_fp80** %0, x86_fp80*** %3
store i32* %1, i32** %4
%13 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %13, i32** %9
store i32 10, i32* %5
%14 = load i32, i32* %5
%15 = call i8* @malloc(i32 %14)
store i8* %15, i8** %8
%16 = load i32*, i32** %9
%17 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%18 = load x86_fp80**, x86_fp80*** %3
%19 = load x86_fp80*, x86_fp80** %18
store x86_fp80* %19, x86_fp80** %10
%20 = load i32*, i32** %4
%21 = load i32, i32* %20
store i32 %21, i32* %11
store i32 0, i32* %6
br label %22
22: ; preds = %59, %2
%23 = load i32, i32* %6
%24 = load i32, i32* %11
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %62
26: ; preds = %22
%27 = load x86_fp80*, x86_fp80** %10
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds x86_fp80, x86_fp80* %27, i64 %29
%31 = load x86_fp80, x86_fp80* %30
store x86_fp80 %31, x86_fp80* %12
%32 = load x86_fp80, x86_fp80* %12
%33 = load i8*, i8** %8
%34 = load i32, i32* %5
%35 = call i32 @cov_serialize(x86_fp80 %32, i8* %33, i32 %34)
%36 = load i32, i32* %6
%37 = icmp sgt i32 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %26
%39 = load i32*, i32** %9
%40 = call i32 (i32*, i8*, ...) @fprintf(i32* %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %41
41: ; preds = %38, %26
store i32 0, i32* %7
br label %42
42: ; preds = %55, %41
%43 = load i32, i32* %7
%44 = load i32, i32* %5
%45 = icmp slt i32 %43, %44
br i1 %45, label %46, label %58
46: ; preds = %42
%47 = load i32*, i32** %9
%48 = load i8*, i8** %8
%49 = load i32, i32* %7
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8, i8* %48, i64 %50
%52 = load i8, i8* %51
%53 = zext i8 %52 to i32
%54 = call i32 (i32*, i8*, ...) @fprintf(i32* %47, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %53)
br label %55
55: ; preds = %46
%56 = load i32, i32* %7
%57 = add nsw i32 %56, 1
store i32 %57, i32* %7
br label %42
58: ; preds = %42
br label %59
59: ; preds = %58
%60 = load i32, i32* %6
%61 = add nsw i32 %60, 1
store i32 %61, i32* %6
br label %22
62: ; preds = %22
%63 = load i32*, i32** %9
%64 = call i32 (i32*, i8*, ...) @fprintf(i32* %63, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%65 = load i32*, i32** %9
%66 = call i32 @fclose(i32* %65)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"spec.cov\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [9 x i8] c"#result\0A\00"
@.str.4 = [5 x i8] c"%02X\00"
define void @cov_arr_log_(x86_fp80** nocapture %0, i32* nocapture %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i64 8, i64 1, i32* %3)
%6 = load x86_fp80*, x86_fp80** %0
%7 = load i32, i32* %1
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %91
9: ; preds = %2
%10 = zext i32 %7 to i64
%11 = load x86_fp80, x86_fp80* %6
%12 = tail call i32 @cov_serialize(x86_fp80 %11, i8* %4, i32 10)
%13 = load i8, i8* %4
%14 = zext i8 %13 to i32
%15 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %14)
%16 = getelementptr inbounds i8, i8* %4, i64 1
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %18)
%20 = getelementptr inbounds i8, i8* %4, i64 2
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %22)
%24 = getelementptr inbounds i8, i8* %4, i64 3
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds i8, i8* %4, i64 4
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %30)
%32 = getelementptr inbounds i8, i8* %4, i64 5
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %34)
%36 = getelementptr inbounds i8, i8* %4, i64 6
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %38)
%40 = getelementptr inbounds i8, i8* %4, i64 7
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %42)
%44 = getelementptr inbounds i8, i8* %4, i64 8
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %46)
%48 = getelementptr inbounds i8, i8* %4, i64 9
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %50)
%52 = icmp eq i32 %7, 1
br i1 %52, label %91, label %53
53: ; preds = %9, %53
%54 = phi i64 [ %89, %53 ], [ 1, %9 ]
%55 = getelementptr inbounds x86_fp80, x86_fp80* %6, i64 %54
%56 = load x86_fp80, x86_fp80* %55
%57 = tail call i32 @cov_serialize(x86_fp80 %56, i8* %4, i32 10)
%58 = tail call i32 @fputc(i32 32, i32* %3)
%59 = load i8, i8* %4
%60 = zext i8 %59 to i32
%61 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %60)
%62 = load i8, i8* %16
%63 = zext i8 %62 to i32
%64 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %63)
%65 = load i8, i8* %20
%66 = zext i8 %65 to i32
%67 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %66)
%68 = load i8, i8* %24
%69 = zext i8 %68 to i32
%70 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %69)
%71 = load i8, i8* %28
%72 = zext i8 %71 to i32
%73 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %72)
%74 = load i8, i8* %32
%75 = zext i8 %74 to i32
%76 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %75)
%77 = load i8, i8* %36
%78 = zext i8 %77 to i32
%79 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %78)
%80 = load i8, i8* %40
%81 = zext i8 %80 to i32
%82 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %81)
%83 = load i8, i8* %44
%84 = zext i8 %83 to i32
%85 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %84)
%86 = load i8, i8* %48
%87 = zext i8 %86 to i32
%88 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %87)
%89 = add nuw nsw i64 %54, 1
%90 = icmp eq i64 %89, %10
br i1 %90, label %91, label %53
91: ; preds = %53, %9, %2
%92 = tail call i32 @fputc(i32 10, i32* %3)
%93 = tail call i32 @fclose(i32* %3)
ret void
}