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


x86 assembly (clang, -O0):
<mean_coverage4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x186d90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x186a54(%rbp)
ff
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    12e8 <mean_coverage4+0x1b8>
movl   $0x1,-0x38(%rbp)
cmpl   $0x7,-0x38(%rbp)
jge    12d5 <mean_coverage4+0x1a5>
lea    -0x186b20(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
mov    -0x38(%rbp),%r8d
lea    0xe55(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x186b20(%rbp),%rdi
lea    -0x186a50(%rbp),%rsi
xor    %edx,%edx
call   1050 <load_locations@plt>
mov    %eax,-0x3c(%rbp)
lea    -0x186bf0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
mov    -0x38(%rbp),%r8d
lea    0xe16(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x186bf0(%rbp),%rdi
lea    -0x186a50(%rbp),%rsi
mov    -0x3c(%rbp),%edx
call   1050 <load_locations@plt>
mov    %eax,-0x3c(%rbp)
lea    -0x186cc0(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
mov    -0x38(%rbp),%r8d
lea    0xdd6(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x186cc0(%rbp),%rdi
lea    -0x186a50(%rbp),%rsi
mov    -0x3c(%rbp),%edx
call   1050 <load_locations@plt>
mov    %eax,-0x3c(%rbp)
lea    -0x186d90(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
mov    -0x38(%rbp),%r8d
lea    0xd96(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x186d90(%rbp),%rdi
lea    -0x186a50(%rbp),%rsi
mov    -0x3c(%rbp),%edx
call   1050 <load_locations@plt>
mov    %eax,-0x3c(%rbp)
lea    -0x186a50(%rbp),%rdi
mov    -0x3c(%rbp),%esi
lea    -0x186a58(%rbp),%rdx
lea    -0x40(%rbp),%rcx
lea    -0x44(%rbp),%r8
call   1030 <coverage@plt>
movss  -0x186a58(%rbp),%xmm0
ff
addss  -0x186a54(%rbp),%xmm0
ff
movss  %xmm0,-0x186a54(%rbp)
ff
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    117f <mean_coverage4+0x4f>
jmp    12da <mean_coverage4+0x1aa>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    116c <mean_coverage4+0x3c>
movss  -0x186a54(%rbp),%xmm0
ff
cvtsi2ssl -0x30(%rbp),%xmm1
divss  %xmm1,%xmm0
add    $0x186d90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mean_coverage4>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x186d98,%rsp
test   %r9d,%r9d
jle    12c0 <mean_coverage4+0x190>
mov    %rdi,%rax
mov    %r8,0x20(%rsp)
mov    %rsi,0x30(%rsp)
mov    %rdx,0x38(%rsp)
mov    %rcx,0x40(%rsp)
mov    %r9,0x10(%rsp)
mov    %r9d,%ecx
mov    %rcx,0x18(%rsp)
xorps  %xmm0,%xmm0
xor    %r15d,%r15d
lea    0xe89(%rip),%r12
lea    0x120(%rsp),%rbp
lea    0x390(%rsp),%rbx
mov    %rdi,0x28(%rsp)
mov    $0x1,%r13d
cs nopw 0x0(%rax,%rax,1)
movss  %xmm0,0x8(%rsp)
mov    0x20(%rsp),%r14
mov    (%r14,%r15,8),%rcx
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %rax,%rdx
mov    %r13d,%r8d
call   1040 <sprintf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
call   1050 <load_locations@plt>
mov    %eax,0x4(%rsp)
mov    (%r14,%r15,8),%rcx
mov    %r15,%rbp
lea    0x2c0(%rsp),%r15
mov    %r15,%rdi
mov    %r12,%rsi
mov    0x30(%rsp),%rdx
mov    %r13d,%r8d
call   1040 <sprintf@plt>
mov    %r15,%rdi
mov    %rbp,%r15
mov    %rbx,%rsi
mov    0x4(%rsp),%edx
call   1050 <load_locations@plt>
mov    %eax,%ebp
mov    (%r14,%r15,8),%rcx
lea    0x50(%rsp),%rdi
mov    %r12,%rsi
mov    0x38(%rsp),%rdx
mov    %r13d,%r8d
call   1040 <sprintf@plt>
lea    0x50(%rsp),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1050 <load_locations@plt>
mov    %eax,%ebp
mov    (%r14,%r15,8),%rcx
lea    0x1f0(%rsp),%r14
mov    %r14,%rdi
mov    %r12,%rsi
mov    0x40(%rsp),%rdx
mov    %r13d,%r8d
call   1040 <sprintf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
lea    0x120(%rsp),%rbp
call   1050 <load_locations@plt>
mov    %rbx,%rdi
mov    %eax,%esi
lea    0xc(%rsp),%rdx
lea    0x4c(%rsp),%rcx
lea    0x48(%rsp),%r8
call   1030 <coverage@plt>
mov    0x28(%rsp),%rax
movss  0x8(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
add    $0x1,%r13d
cmp    $0x7,%r13d
jne    11a0 <mean_coverage4+0x70>
add    $0x1,%r15
cmp    0x18(%rsp),%r15
jne    1190 <mean_coverage4+0x60>
mov    0x10(%rsp),%rax
add    %eax,%eax
lea    (%rax,%rax,2),%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
jmp    12c8 <mean_coverage4+0x198>
movss  0xd38(%rip),%xmm0
add    $0x186d98,%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_coverage4(i8* %0, i8* %1, i8* %2, i8* %3, i8** %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8**
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca [200000 x [2 x float]]
%20 = alloca float
%21 = alloca float
%22 = alloca [200 x i8]
%23 = alloca [200 x i8]
%24 = alloca [200 x i8]
%25 = alloca [200 x i8]
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8** %4, i8*** %11
store i32 %5, i32* %12
store i32 0, i32* %13
store float 0.000000e+00, float* %20
store i32 0, i32* %14
br label %26
26: ; preds = %103, %6
%27 = load i32, i32* %14
%28 = load i32, i32* %12
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %106
30: ; preds = %26
store i32 1, i32* %15
br label %31
31: ; preds = %99, %30
%32 = load i32, i32* %15
%33 = icmp slt i32 %32, 7
br i1 %33, label %34, label %102
34: ; preds = %31
%35 = getelementptr inbounds [200 x i8], [200 x i8]* %22, i64 0, i64 0
%36 = load i8*, i8** %7
%37 = load i8**, i8*** %11
%38 = load i32, i32* %14
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8*, i8** %37, i64 %39
%41 = load i8*, i8** %40
%42 = load i32, i32* %15
%43 = call i32 @sprintf(i8* %35, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %36, i8* %41, i32 %42)
%44 = getelementptr inbounds [200 x i8], [200 x i8]* %22, i64 0, i64 0
%45 = getelementptr inbounds [200000 x [2 x float]], [200000 x [2 x float]]* %19, i64 0, i64 0
%46 = bitcast [2 x float]* %45 to float**
%47 = call i32 @load_locations(i8* %44, float** %46, i32 0)
store i32 %47, i32* %16
%48 = getelementptr inbounds [200 x i8], [200 x i8]* %23, i64 0, i64 0
%49 = load i8*, i8** %8
%50 = load i8**, i8*** %11
%51 = load i32, i32* %14
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8*, i8** %50, i64 %52
%54 = load i8*, i8** %53
%55 = load i32, i32* %15
%56 = call i32 @sprintf(i8* %48, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %49, i8* %54, i32 %55)
%57 = getelementptr inbounds [200 x i8], [200 x i8]* %23, i64 0, i64 0
%58 = getelementptr inbounds [200000 x [2 x float]], [200000 x [2 x float]]* %19, i64 0, i64 0
%59 = bitcast [2 x float]* %58 to float**
%60 = load i32, i32* %16
%61 = call i32 @load_locations(i8* %57, float** %59, i32 %60)
store i32 %61, i32* %16
%62 = getelementptr inbounds [200 x i8], [200 x i8]* %24, i64 0, i64 0
%63 = load i8*, i8** %9
%64 = load i8**, i8*** %11
%65 = load i32, i32* %14
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i8*, i8** %64, i64 %66
%68 = load i8*, i8** %67
%69 = load i32, i32* %15
%70 = call i32 @sprintf(i8* %62, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %63, i8* %68, i32 %69)
%71 = getelementptr inbounds [200 x i8], [200 x i8]* %24, i64 0, i64 0
%72 = getelementptr inbounds [200000 x [2 x float]], [200000 x [2 x float]]* %19, i64 0, i64 0
%73 = bitcast [2 x float]* %72 to float**
%74 = load i32, i32* %16
%75 = call i32 @load_locations(i8* %71, float** %73, i32 %74)
store i32 %75, i32* %16
%76 = getelementptr inbounds [200 x i8], [200 x i8]* %25, i64 0, i64 0
%77 = load i8*, i8** %10
%78 = load i8**, i8*** %11
%79 = load i32, i32* %14
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds i8*, i8** %78, i64 %80
%82 = load i8*, i8** %81
%83 = load i32, i32* %15
%84 = call i32 @sprintf(i8* %76, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %77, i8* %82, i32 %83)
%85 = getelementptr inbounds [200 x i8], [200 x i8]* %25, i64 0, i64 0
%86 = getelementptr inbounds [200000 x [2 x float]], [200000 x [2 x float]]* %19, i64 0, i64 0
%87 = bitcast [2 x float]* %86 to float**
%88 = load i32, i32* %16
%89 = call i32 @load_locations(i8* %85, float** %87, i32 %88)
store i32 %89, i32* %16
%90 = getelementptr inbounds [200000 x [2 x float]], [200000 x [2 x float]]* %19, i64 0, i64 0
%91 = bitcast [2 x float]* %90 to float**
%92 = load i32, i32* %16
%93 = call i32 @coverage(float** %91, i32 %92, float* %21, i32* %17, i32* %18)
%94 = load float, float* %21
%95 = load float, float* %20
%96 = fadd float %95, %94
store float %96, float* %20
%97 = load i32, i32* %13
%98 = add nsw i32 %97, 1
store i32 %98, i32* %13
br label %99
99: ; preds = %34
%100 = load i32, i32* %15
%101 = add nsw i32 %100, 1
store i32 %101, i32* %15
br label %31
102: ; preds = %31
br label %103
103: ; preds = %102
%104 = load i32, i32* %14
%105 = add nsw i32 %104, 1
store i32 %105, i32* %14
br label %26
106: ; preds = %26
%107 = load float, float* %20
%108 = load i32, i32* %13
%109 = sitofp i32 %108 to float
%110 = fdiv float %107, %109
ret float %110
}

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