#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*/ *gets(char *);
scalar_t__ isdigit(char);
int /*<<< orphan*/ mkdir(char *, int);
int /*<<< orphan*/ parseline(char *, float *, float *, float *, char *);
int /*<<< orphan*/ printstats(float *, float *, float *, char *);
int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
main(int argc, char *argv[]) {
  float themeans[200];
  float thessds[200];
  float thecounts[200];
  int x;
  char theline[512];
  for (x = 0; x < 200; x++)
    themeans[x] = thessds[x] = thecounts[x] = 0.0;
  mkdir(argv[1], 0755);
  while (gets(theline) != NULL) {
    if ((strncmp(theline, "_SCAN", 5) == 0) &&
        (isdigit(theline[strlen(theline) - 2]))) {
      parseline(theline, themeans, thessds, thecounts, argv[1]);
    }
  }
  printstats(themeans, thessds, thecounts, argv[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x974(%rbp)
cmpl   $0xc8,-0x974(%rbp)
jge    11f0 <main+0x80>
movslq -0x974(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,-0x970(%rbp,%rax,4)
ff ff
movslq -0x974(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,-0x650(%rbp,%rax,4)
ff ff
movslq -0x974(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,-0x330(%rbp,%rax,4)
ff ff
mov    -0x974(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x974(%rbp)
jmp    1193 <main+0x23>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x1ed,%esi
call   1050 <mkdir@plt>
lea    -0xb80(%rbp),%rdi
call   1080 <gets@plt>
cmp    $0x0,%rax
je     1290 <main+0x120>
lea    -0xb80(%rbp),%rdi
lea    0xdda(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    128b <main+0x11b>
lea    -0xb80(%rbp),%rdi
call   1060 <strlen@plt>
sub    $0x2,%eax
cltq
movsbl -0xb80(%rbp,%rax,1),%edi
ff
call   1040 <isdigit@plt>
cmp    $0x0,%rax
je     128b <main+0x11b>
lea    -0xb80(%rbp),%rdi
lea    -0x330(%rbp),%rsi
lea    -0x650(%rbp),%rdx
lea    -0x970(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%r8
call   1070 <parseline@plt>
jmp    1202 <main+0x92>
lea    -0x330(%rbp),%rdi
lea    -0x650(%rbp),%rsi
lea    -0x970(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
call   1090 <printstats@plt>
mov    -0x4(%rbp),%eax
add    $0xb80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb68,%rsp
mov    %rsi,%r14
mov    %rsp,%rdi
mov    $0x320,%edx
xor    %esi,%esi
call   1080 <memset@plt>
lea    0x320(%rsp),%rdi
mov    $0x320,%edx
xor    %esi,%esi
call   1080 <memset@plt>
lea    0x640(%rsp),%rdi
mov    $0x320,%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    0x8(%r14),%rdi
mov    $0x1ed,%esi
call   1050 <mkdir@plt>
lea    0x960(%rsp),%rbx
mov    %rbx,%rdi
call   1090 <gets@plt>
test   %rax,%rax
je     1262 <main+0xe2>
lea    0xe0b(%rip),%r15
lea    0x640(%rsp),%r12
lea    0x320(%rsp),%r13
mov    %rsp,%rbp
jmp    121d <main+0x9d>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1090 <gets@plt>
test   %rax,%rax
je     1262 <main+0xe2>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1210 <main+0x90>
mov    %rbx,%rdi
call   1060 <strlen@plt>
cltq
movsbl -0x2(%rax,%rbx,1),%edi
call   1040 <isdigit@plt>
test   %rax,%rax
je     1210 <main+0x90>
mov    0x8(%r14),%r8
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %rbp,%rcx
call   1070 <parseline@plt>
jmp    1210 <main+0x90>
mov    0x8(%r14),%rcx
lea    0x640(%rsp),%rdi
lea    0x320(%rsp),%rsi
mov    %rsp,%rdx
call   10a0 <printstats@plt>
xor    %eax,%eax
add    $0xb68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"_SCAN\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [200 x float]
%7 = alloca [200 x float]
%8 = alloca [200 x float]
%9 = alloca i32
%10 = alloca [512 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %9
br label %11
11: ; preds = %24, %2
%12 = load i32, i32* %9
%13 = icmp slt i32 %12, 200
br i1 %13, label %14, label %27
14: ; preds = %11
%15 = load i32, i32* %9
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [200 x float], [200 x float]* %8, i64 0, i64 %16
store float 0.000000e+00, float* %17
%18 = load i32, i32* %9
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [200 x float], [200 x float]* %7, i64 0, i64 %19
store float 0.000000e+00, float* %20
%21 = load i32, i32* %9
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [200 x float], [200 x float]* %6, i64 0, i64 %22
store float 0.000000e+00, float* %23
br label %24
24: ; preds = %14
%25 = load i32, i32* %9
%26 = add nsw i32 %25, 1
store i32 %26, i32* %9
br label %11
27: ; preds = %11
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i32 @mkdir(i8* %30, i32 493)
br label %32
32: ; preds = %58, %27
%33 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%34 = call i32* @gets(i8* %33)
%35 = icmp ne i32* %34, null
br i1 %35, label %36, label %59
36: ; preds = %32
%37 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%38 = call i64 @strncmp(i8* %37, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %58
40: ; preds = %36
%41 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%42 = call i32 @strlen(i8* %41)
%43 = sub nsw i32 %42, 2
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 %44
%46 = load i8, i8* %45
%47 = call i64 @isdigit(i8 signext %46)
%48 = icmp ne i64 %47, 0
br i1 %48, label %49, label %58
49: ; preds = %40
%50 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%51 = getelementptr inbounds [200 x float], [200 x float]* %6, i64 0, i64 0
%52 = getelementptr inbounds [200 x float], [200 x float]* %7, i64 0, i64 0
%53 = getelementptr inbounds [200 x float], [200 x float]* %8, i64 0, i64 0
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 1
%56 = load i8*, i8** %55
%57 = call i32 @parseline(i8* %50, float* %51, float* %52, float* %53, i8* %56)
br label %58
58: ; preds = %49, %40, %36
br label %32
59: ; preds = %32
%60 = getelementptr inbounds [200 x float], [200 x float]* %6, i64 0, i64 0
%61 = getelementptr inbounds [200 x float], [200 x float]* %7, i64 0, i64 0
%62 = getelementptr inbounds [200 x float], [200 x float]* %8, i64 0, i64 0
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i64 1
%65 = load i8*, i8** %64
%66 = call i32 @printstats(float* %60, float* %61, float* %62, i8* %65)
%67 = load i32, i32* %3
ret i32 %67
}

LLVM IR (-O2):
@.str = [6 x i8] c"_SCAN\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [200 x float]
%4 = bitcast [200 x float]* %3 to i8*
%5 = alloca [200 x float]
%6 = bitcast [200 x float]* %5 to i8*
%7 = alloca [200 x float]
%8 = bitcast [200 x float]* %7 to i8*
%9 = alloca [512 x i8]
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @mkdir(i8* %12, i32 493)
%14 = call i32* @gets(i8* %10)
%15 = icmp eq i32* %14, null
br i1 %15, label %37, label %16
16: ; preds = %2
%17 = getelementptr inbounds [200 x float], [200 x float]* %3, i64 0, i64 0
%18 = getelementptr inbounds [200 x float], [200 x float]* %5, i64 0, i64 0
%19 = getelementptr inbounds [200 x float], [200 x float]* %7, i64 0, i64 0
br label %20
20: ; preds = %16, %34
%21 = call i64 @strncmp(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %34
23: ; preds = %20
%24 = call i32 @strlen(i8* %10)
%25 = add nsw i32 %24, -2
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 %26
%28 = load i8, i8* %27
%29 = call i64 @isdigit(i8 signext %28)
%30 = icmp eq i64 %29, 0
br i1 %30, label %34, label %31
31: ; preds = %23
%32 = load i8*, i8** %11
%33 = call i32 @parseline(i8* %10, float* %17, float* %18, float* %19, i8* %32)
br label %34
34: ; preds = %31, %23, %20
%35 = call i32* @gets(i8* %10)
%36 = icmp eq i32* %35, null
br i1 %36, label %37, label %20
37: ; preds = %34, %2
%38 = getelementptr inbounds [200 x float], [200 x float]* %3, i64 0, i64 0
%39 = getelementptr inbounds [200 x float], [200 x float]* %5, i64 0, i64 0
%40 = getelementptr inbounds [200 x float], [200 x float]* %7, i64 0, i64 0
%41 = load i8*, i8** %11
%42 = call i32 @printstats(float* %38, float* %39, float* %40, i8* %41)
ret i32 0
}