#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*/ coverage(float **, int, float *, int *, int *);
int load_locations(char *, float **, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, int);
float mean_coverage1(char *opname, char **imsets, int nimsets) {
  int nfiles = 0, i, fno, nlocs, np, nc;
  float locs[200000][2];
  float csum = 0.0, cov;
  char fn[200];
  for (i = 0; i < nimsets; i++) {
    for (fno = 1; fno < 7; fno++) {
      sprintf(fn, "data/%s_%s%d.txt", opname, imsets[i], fno);
      nlocs = load_locations(fn, locs, 0);
      coverage(locs, nlocs, &cov, &np, &nc);
      csum += cov;
      nfiles += 1;
    }
  }
  return csum / nfiles;
}


x86 assembly (clang, -O0):
<mean_coverage1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x186b00,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x186a34(%rbp)
ff
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    121b <mean_coverage1+0xeb>
movl   $0x1,-0x20(%rbp)
cmpl   $0x7,-0x20(%rbp)
jge    1208 <mean_coverage1+0xd8>
lea    -0x186b00(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
mov    -0x20(%rbp),%r8d
lea    0xe62(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x186b00(%rbp),%rdi
lea    -0x186a30(%rbp),%rsi
xor    %edx,%edx
call   1050 <load_locations@plt>
mov    %eax,-0x24(%rbp)
lea    -0x186a30(%rbp),%rdi
mov    -0x24(%rbp),%esi
lea    -0x186a38(%rbp),%rdx
lea    -0x28(%rbp),%rcx
lea    -0x2c(%rbp),%r8
call   1030 <coverage@plt>
movss  -0x186a38(%rbp),%xmm0
ff
addss  -0x186a34(%rbp),%xmm0
ff
movss  %xmm0,-0x186a34(%rbp)
ff
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1172 <mean_coverage1+0x42>
jmp    120d <mean_coverage1+0xdd>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    115f <mean_coverage1+0x2f>
movss  -0x186a34(%rbp),%xmm0
ff
cvtsi2ssl -0x18(%rbp),%xmm1
divss  %xmm1,%xmm0
add    $0x186b00,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mean_coverage1>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x186b08,%rsp
test   %edx,%edx
jle    13a0 <mean_coverage1+0x270>
mov    %rsi,%rbx
mov    %rdx,0x18(%rsp)
mov    %edx,%eax
mov    %rax,0x20(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
xor    %r12d,%r12d
mov    %rdi,%r15
nopw   0x0(%rax,%rax,1)
mov    (%rbx,%r12,8),%rcx
lea    0x30(%rsp),%rbp
mov    %rbp,%rdi
lea    0xe81(%rip),%rsi
mov    %r15,%rdx
mov    $0x1,%r8d
call   1040 <sprintf@plt>
mov    %rbp,%rdi
lea    0x100(%rsp),%r14
mov    %r14,%rsi
xor    %edx,%edx
call   1050 <load_locations@plt>
mov    %r14,%rdi
mov    %eax,%esi
lea    0x10(%rsp),%rdx
lea    0x14(%rsp),%rcx
lea    0x2c(%rsp),%r13
mov    %r13,%r8
call   1030 <coverage@plt>
movss  0xc(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    (%rbx,%r12,8),%rcx
mov    %rbp,%rdi
lea    0xe22(%rip),%rsi
mov    %r15,%rdx
mov    $0x2,%r8d
call   1040 <sprintf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1050 <load_locations@plt>
mov    %r14,%rdi
mov    %eax,%esi
lea    0x10(%rsp),%rdx
lea    0x14(%rsp),%rcx
mov    %r13,%r8
call   1030 <coverage@plt>
movss  0xc(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    (%rbx,%r12,8),%rcx
mov    %rbp,%rdi
lea    0xdd0(%rip),%rsi
mov    %r15,%rdx
mov    $0x3,%r8d
call   1040 <sprintf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1050 <load_locations@plt>
mov    %r14,%rdi
mov    %eax,%esi
lea    0x10(%rsp),%rdx
lea    0x14(%rsp),%rcx
mov    %r13,%r8
call   1030 <coverage@plt>
movss  0xc(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    (%rbx,%r12,8),%rcx
mov    %rbp,%rdi
lea    0xd7e(%rip),%rsi
mov    %r15,%rdx
mov    $0x4,%r8d
call   1040 <sprintf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1050 <load_locations@plt>
mov    %r14,%rdi
mov    %eax,%esi
lea    0x10(%rsp),%rdx
lea    0x14(%rsp),%rcx
mov    %r13,%r8
call   1030 <coverage@plt>
movss  0xc(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    (%rbx,%r12,8),%rcx
mov    %rbp,%rdi
lea    0xd2c(%rip),%rsi
mov    %r15,%rdx
mov    $0x5,%r8d
call   1040 <sprintf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1050 <load_locations@plt>
mov    %r14,%rdi
mov    %eax,%esi
lea    0x10(%rsp),%rdx
lea    0x14(%rsp),%rcx
mov    %r13,%r8
call   1030 <coverage@plt>
movss  0xc(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    (%rbx,%r12,8),%rcx
mov    %rbp,%rdi
lea    0xcda(%rip),%rsi
mov    %r15,%rdx
mov    $0x6,%r8d
call   1040 <sprintf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1050 <load_locations@plt>
mov    %r14,%rdi
mov    %eax,%esi
lea    0x10(%rsp),%rdx
lea    0x14(%rsp),%rcx
mov    %r13,%r8
call   1030 <coverage@plt>
movss  0xc(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
add    $0x1,%r12
cmp    %r12,0x20(%rsp)
jne    1170 <mean_coverage1+0x40>
mov    0x18(%rsp),%rax
add    %eax,%eax
lea    (%rax,%rax,2),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  0xc(%rsp),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
jmp    13ae <mean_coverage1+0x27e>
movss  0xc58(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
movss  0xc(%rsp),%xmm0
add    $0x186b08,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"data/%s_%s%d.txt\00"
define float @mean_coverage1(i8* %0, i8** %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca [200000 x [2 x float]]
%14 = alloca float
%15 = alloca float
%16 = alloca [200 x i8]
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
store i32 0, i32* %7
store float 0.000000e+00, float* %14
store i32 0, i32* %8
br label %17
17: ; preds = %52, %3
%18 = load i32, i32* %8
%19 = load i32, i32* %6
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %55
21: ; preds = %17
store i32 1, i32* %9
br label %22
22: ; preds = %48, %21
%23 = load i32, i32* %9
%24 = icmp slt i32 %23, 7
br i1 %24, label %25, label %51
25: ; preds = %22
%26 = getelementptr inbounds [200 x i8], [200 x i8]* %16, i64 0, i64 0
%27 = load i8*, i8** %4
%28 = load i8**, i8*** %5
%29 = load i32, i32* %8
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8*, i8** %28, i64 %30
%32 = load i8*, i8** %31
%33 = load i32, i32* %9
%34 = call i32 @sprintf(i8* %26, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %27, i8* %32, i32 %33)
%35 = getelementptr inbounds [200 x i8], [200 x i8]* %16, i64 0, i64 0
%36 = getelementptr inbounds [200000 x [2 x float]], [200000 x [2 x float]]* %13, i64 0, i64 0
%37 = bitcast [2 x float]* %36 to float**
%38 = call i32 @load_locations(i8* %35, float** %37, i32 0)
store i32 %38, i32* %10
%39 = getelementptr inbounds [200000 x [2 x float]], [200000 x [2 x float]]* %13, i64 0, i64 0
%40 = bitcast [2 x float]* %39 to float**
%41 = load i32, i32* %10
%42 = call i32 @coverage(float** %40, i32 %41, float* %15, i32* %11, i32* %12)
%43 = load float, float* %15
%44 = load float, float* %14
%45 = fadd float %44, %43
store float %45, float* %14
%46 = load i32, i32* %7
%47 = add nsw i32 %46, 1
store i32 %47, i32* %7
br label %48
48: ; preds = %25
%49 = load i32, i32* %9
%50 = add nsw i32 %49, 1
store i32 %50, i32* %9
br label %22
51: ; preds = %22
br label %52
52: ; preds = %51
%53 = load i32, i32* %8
%54 = add nsw i32 %53, 1
store i32 %54, i32* %8
br label %17
55: ; preds = %17
%56 = load float, float* %14
%57 = load i32, i32* %7
%58 = sitofp i32 %57 to float
%59 = fdiv float %56, %58
ret float %59
}

LLVM IR (-O2):
@.str = [17 x i8] c"data/%s_%s%d.txt\00"
define float @mean_coverage1(i8* %0, i8** nocapture %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca [200000 x [2 x float]]
%7 = alloca float
%8 = alloca [200 x i8]
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = bitcast [200000 x [2 x float]]* %6 to i8*
%12 = bitcast float* %7 to i8*
%13 = getelementptr inbounds [200 x i8], [200 x i8]* %8, i64 0, i64 0
%14 = icmp sgt i32 %2, 0
br i1 %14, label %15, label %64
15: ; preds = %3
%16 = bitcast [200000 x [2 x float]]* %6 to float**
%17 = zext i32 %2 to i64
br label %18
18: ; preds = %15, %18
%19 = phi i64 [ 0, %15 ], [ %58, %18 ]
%20 = phi float [ 0.000000e+00, %15 ], [ %57, %18 ]
%21 = getelementptr inbounds i8*, i8** %1, i64 %19
%22 = load i8*, i8** %21
%23 = call i32 @sprintf(i8* %13, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %22, i32 1)
%24 = call i32 @load_locations(i8* %13, float** %16, i32 0)
%25 = call i32 @coverage(float** %16, i32 %24, float* %7, i32* %4, i32* %5)
%26 = load float, float* %7
%27 = fadd float %20, %26
%28 = load i8*, i8** %21
%29 = call i32 @sprintf(i8* %13, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %28, i32 2)
%30 = call i32 @load_locations(i8* %13, float** %16, i32 0)
%31 = call i32 @coverage(float** %16, i32 %30, float* %7, i32* %4, i32* %5)
%32 = load float, float* %7
%33 = fadd float %27, %32
%34 = load i8*, i8** %21
%35 = call i32 @sprintf(i8* %13, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %34, i32 3)
%36 = call i32 @load_locations(i8* %13, float** %16, i32 0)
%37 = call i32 @coverage(float** %16, i32 %36, float* %7, i32* %4, i32* %5)
%38 = load float, float* %7
%39 = fadd float %33, %38
%40 = load i8*, i8** %21
%41 = call i32 @sprintf(i8* %13, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %40, i32 4)
%42 = call i32 @load_locations(i8* %13, float** %16, i32 0)
%43 = call i32 @coverage(float** %16, i32 %42, float* %7, i32* %4, i32* %5)
%44 = load float, float* %7
%45 = fadd float %39, %44
%46 = load i8*, i8** %21
%47 = call i32 @sprintf(i8* %13, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %46, i32 5)
%48 = call i32 @load_locations(i8* %13, float** %16, i32 0)
%49 = call i32 @coverage(float** %16, i32 %48, float* %7, i32* %4, i32* %5)
%50 = load float, float* %7
%51 = fadd float %45, %50
%52 = load i8*, i8** %21
%53 = call i32 @sprintf(i8* %13, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %52, i32 6)
%54 = call i32 @load_locations(i8* %13, float** %16, i32 0)
%55 = call i32 @coverage(float** %16, i32 %54, float* %7, i32* %4, i32* %5)
%56 = load float, float* %7
%57 = fadd float %51, %56
%58 = add nuw nsw i64 %19, 1
%59 = icmp eq i64 %58, %17
br i1 %59, label %60, label %18
60: ; preds = %18
%61 = mul i32 %2, 6
%62 = sitofp i32 %61 to float
%63 = fdiv float %57, %62
br label %64
64: ; preds = %60, %3
%65 = phi float [ %63, %60 ], [ 0x7FF8000000000000, %3 ]
ret float %65
}