#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*/ addaline(char *, char *);
int /*<<< orphan*/ dostats(int, float, float *, float *, float *);
scalar_t__ isdigit(char);
int /*<<< orphan*/ mkdir(char *, int);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, ...);
parseline(char *theline, float themeans[], float thessds[], float thecounts[],
          char *basename) {
  int scan, readback;
  float thevalue, deltamean;
  char *hop, *hop2;
  char buf[256];
  char thedir[256];
  char thefile[256];
  char outline[256];
  hop = theline;
  while (!isdigit(*hop))
    hop++;
  sscanf(hop, "%d", &scan);
  while (isdigit(*hop))
    hop++;
  while (!isdigit(*hop))
    hop++;
  sscanf(hop, "%d", &readback);
  while (isdigit(*hop))
    hop++;
  hop++;
  hop2 = hop;
  while (*hop2 != ':')
    hop2++;
  *hop2 = (char)0;
  hop2++;
  sscanf(hop2, "%f", &thevalue);
  sprintf(thedir, "%s/%d", basename, readback);
  if (scan == 1) {
    mkdir(thedir, 0755);
    sprintf(thefile, "%s/name", thedir);
    addaline(thefile, hop);
  }
  sprintf(thefile, "%s/values", thedir);
  sprintf(outline, "%d %f", scan, thevalue);
  addaline(thefile, outline);
  dostats(readback, thevalue, themeans, thessds, thecounts);
}


x86 assembly (clang, -O0):
<parseline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11a9 <parseline+0x49>
jmp    11ba <parseline+0x5a>
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    1187 <parseline+0x27>
mov    -0x48(%rbp),%rdi
lea    0xe3e(%rip),%rsi
lea    -0x34(%rbp),%rdx
mov    $0x0,%al
call   1070 <sscanf@plt>
mov    -0x48(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     11f7 <parseline+0x97>
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    11d0 <parseline+0x70>
jmp    11fc <parseline+0x9c>
mov    -0x48(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    121e <parseline+0xbe>
jmp    122f <parseline+0xcf>
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    11fc <parseline+0x9c>
mov    -0x48(%rbp),%rdi
lea    0xdc9(%rip),%rsi
lea    -0x38(%rbp),%rdx
mov    $0x0,%al
call   1070 <sscanf@plt>
mov    -0x48(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     126c <parseline+0x10c>
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    1245 <parseline+0xe5>
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
je     12a1 <parseline+0x141>
mov    -0x50(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x50(%rbp)
jmp    1280 <parseline+0x120>
mov    -0x50(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x50(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
lea    0xd5c(%rip),%rsi
lea    -0x3c(%rbp),%rdx
mov    $0x0,%al
call   1070 <sscanf@plt>
lea    -0x250(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%ecx
lea    0xd21(%rip),%rsi
mov    $0x0,%al
call   1080 <sprintf@plt>
cmpl   $0x1,-0x34(%rbp)
jne    132d <parseline+0x1cd>
lea    -0x250(%rbp),%rdi
mov    $0x1ed,%esi
call   1040 <mkdir@plt>
lea    -0x350(%rbp),%rdi
lea    -0x250(%rbp),%rdx
lea    0xcf0(%rip),%rsi
mov    $0x0,%al
call   1080 <sprintf@plt>
lea    -0x350(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   1060 <addaline@plt>
lea    -0x350(%rbp),%rdi
lea    -0x250(%rbp),%rdx
lea    0xccc(%rip),%rsi
mov    $0x0,%al
call   1080 <sprintf@plt>
lea    -0x450(%rbp),%rdi
mov    -0x34(%rbp),%edx
movss  -0x3c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcb5(%rip),%rsi
mov    $0x1,%al
call   1080 <sprintf@plt>
lea    -0x350(%rbp),%rdi
lea    -0x450(%rbp),%rsi
call   1060 <addaline@plt>
mov    -0x38(%rbp),%edi
movss  -0x3c(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1050 <dostats@plt>
mov    -0x4(%rbp),%eax
add    $0x450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseline>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x318,%rsp
mov    %r8,%r13
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isdigit@plt>
test   %rax,%rax
je     1190 <parseline+0x30>
lea    0xe5a(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <sscanf@plt>
add    $0xfffffffffffffffe,%rbx
nopl   0x0(%rax)
movsbl 0x2(%rbx),%edi
call   1030 <isdigit@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    11c0 <parseline+0x60>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isdigit@plt>
test   %rax,%rax
je     11e0 <parseline+0x80>
lea    0xe0a(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <sscanf@plt>
nopl   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <isdigit@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1210 <parseline+0xb0>
mov    %rbx,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x3a,(%rdi)
lea    0x1(%rdi),%rdi
jne    1230 <parseline+0xd0>
movb   $0x0,-0x1(%rdi)
lea    0xdd7(%rip),%rsi
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1070 <sscanf@plt>
mov    0x8(%rsp),%ecx
lea    0xda5(%rip),%rsi
lea    0x10(%rsp),%rdi
mov    %r13,%rdx
xor    %eax,%eax
call   1080 <sprintf@plt>
cmpl   $0x1,0xc(%rsp)
jne    12aa <parseline+0x14a>
lea    0x10(%rsp),%r13
mov    %r13,%rdi
mov    $0x1ed,%esi
call   1040 <mkdir@plt>
lea    0xd7c(%rip),%rsi
lea    0x110(%rsp),%rbp
mov    %rbp,%rdi
mov    %r13,%rdx
xor    %eax,%eax
call   1080 <sprintf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1060 <addaline@plt>
lea    0xd5d(%rip),%rsi
lea    0x110(%rsp),%rbx
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <sprintf@plt>
mov    0xc(%rsp),%edx
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd3b(%rip),%rsi
lea    0x210(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x1,%al
call   1080 <sprintf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1060 <addaline@plt>
mov    0x8(%rsp),%edi
movss  0x4(%rsp),%xmm0
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1050 <dostats@plt>
add    $0x318,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [6 x i8] c"%s/%d\00"
@.str.3 = [8 x i8] c"%s/name\00"
@.str.4 = [10 x i8] c"%s/values\00"
@.str.5 = [6 x i8] c"%d %f\00"
define i32 @parseline(i8* %0, float* %1, float* %2, float* %3, i8* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca float
%15 = alloca float
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca [256 x i8]
%19 = alloca [256 x i8]
%20 = alloca [256 x i8]
%21 = alloca [256 x i8]
store i8* %0, i8** %7
store float* %1, float** %8
store float* %2, float** %9
store float* %3, float** %10
store i8* %4, i8** %11
%22 = load i8*, i8** %7
store i8* %22, i8** %16
br label %23
23: ; preds = %29, %5
%24 = load i8*, i8** %16
%25 = load i8, i8* %24
%26 = call i64 @isdigit(i8 signext %25)
%27 = icmp ne i64 %26, 0
%28 = xor i1 %27, true
br i1 %28, label %29, label %32
29: ; preds = %23
%30 = load i8*, i8** %16
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %16
br label %23
32: ; preds = %23
%33 = load i8*, i8** %16
%34 = call i32 (i8*, i8*, ...) @sscanf(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %12)
br label %35
35: ; preds = %40, %32
%36 = load i8*, i8** %16
%37 = load i8, i8* %36
%38 = call i64 @isdigit(i8 signext %37)
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %43
40: ; preds = %35
%41 = load i8*, i8** %16
%42 = getelementptr inbounds i8, i8* %41, i32 1
store i8* %42, i8** %16
br label %35
43: ; preds = %35
br label %44
44: ; preds = %50, %43
%45 = load i8*, i8** %16
%46 = load i8, i8* %45
%47 = call i64 @isdigit(i8 signext %46)
%48 = icmp ne i64 %47, 0
%49 = xor i1 %48, true
br i1 %49, label %50, label %53
50: ; preds = %44
%51 = load i8*, i8** %16
%52 = getelementptr inbounds i8, i8* %51, i32 1
store i8* %52, i8** %16
br label %44
53: ; preds = %44
%54 = load i8*, i8** %16
%55 = call i32 (i8*, i8*, ...) @sscanf(i8* %54, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %13)
br label %56
56: ; preds = %61, %53
%57 = load i8*, i8** %16
%58 = load i8, i8* %57
%59 = call i64 @isdigit(i8 signext %58)
%60 = icmp ne i64 %59, 0
br i1 %60, label %61, label %64
61: ; preds = %56
%62 = load i8*, i8** %16
%63 = getelementptr inbounds i8, i8* %62, i32 1
store i8* %63, i8** %16
br label %56
64: ; preds = %56
%65 = load i8*, i8** %16
%66 = getelementptr inbounds i8, i8* %65, i32 1
store i8* %66, i8** %16
%67 = load i8*, i8** %16
store i8* %67, i8** %17
br label %68
68: ; preds = %73, %64
%69 = load i8*, i8** %17
%70 = load i8, i8* %69
%71 = sext i8 %70 to i32
%72 = icmp ne i32 %71, 58
br i1 %72, label %73, label %76
73: ; preds = %68
%74 = load i8*, i8** %17
%75 = getelementptr inbounds i8, i8* %74, i32 1
store i8* %75, i8** %17
br label %68
76: ; preds = %68
%77 = load i8*, i8** %17
store i8 0, i8* %77
%78 = load i8*, i8** %17
%79 = getelementptr inbounds i8, i8* %78, i32 1
store i8* %79, i8** %17
%80 = load i8*, i8** %17
%81 = call i32 (i8*, i8*, ...) @sscanf(i8* %80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %14)
%82 = getelementptr inbounds [256 x i8], [256 x i8]* %19, i64 0, i64 0
%83 = load i8*, i8** %11
%84 = load i32, i32* %13
%85 = call i32 (i8*, i8*, ...) @sprintf(i8* %82, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %83, i32 %84)
%86 = load i32, i32* %12
%87 = icmp eq i32 %86, 1
br i1 %87, label %88, label %97
88: ; preds = %76
%89 = getelementptr inbounds [256 x i8], [256 x i8]* %19, i64 0, i64 0
%90 = call i32 @mkdir(i8* %89, i32 493)
%91 = getelementptr inbounds [256 x i8], [256 x i8]* %20, i64 0, i64 0
%92 = getelementptr inbounds [256 x i8], [256 x i8]* %19, i64 0, i64 0
%93 = call i32 (i8*, i8*, ...) @sprintf(i8* %91, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %92)
%94 = getelementptr inbounds [256 x i8], [256 x i8]* %20, i64 0, i64 0
%95 = load i8*, i8** %16
%96 = call i32 @addaline(i8* %94, i8* %95)
br label %97
97: ; preds = %88, %76
%98 = getelementptr inbounds [256 x i8], [256 x i8]* %20, i64 0, i64 0
%99 = getelementptr inbounds [256 x i8], [256 x i8]* %19, i64 0, i64 0
%100 = call i32 (i8*, i8*, ...) @sprintf(i8* %98, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %99)
%101 = getelementptr inbounds [256 x i8], [256 x i8]* %21, i64 0, i64 0
%102 = load i32, i32* %12
%103 = load float, float* %14
%104 = fpext float %103 to double
%105 = call i32 (i8*, i8*, ...) @sprintf(i8* %101, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %102, double %104)
%106 = getelementptr inbounds [256 x i8], [256 x i8]* %20, i64 0, i64 0
%107 = getelementptr inbounds [256 x i8], [256 x i8]* %21, i64 0, i64 0
%108 = call i32 @addaline(i8* %106, i8* %107)
%109 = load i32, i32* %13
%110 = load float, float* %14
%111 = load float*, float** %8
%112 = load float*, float** %9
%113 = load float*, float** %10
%114 = call i32 @dostats(i32 %109, float %110, float* %111, float* %112, float* %113)
%115 = load i32, i32* %6
ret i32 %115
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [6 x i8] c"%s/%d\00"
@.str.3 = [8 x i8] c"%s/name\00"
@.str.4 = [10 x i8] c"%s/values\00"
@.str.5 = [6 x i8] c"%d %f\00"
define i32 @parseline(i8* %0, float* %1, float* %2, float* %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
%9 = alloca [256 x i8]
%10 = alloca [256 x i8]
%11 = alloca [256 x i8]
%12 = bitcast i32* %6 to i8*
%13 = bitcast i32* %7 to i8*
%14 = bitcast float* %8 to i8*
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
br label %18
18: ; preds = %18, %5
%19 = phi i8* [ %0, %5 ], [ %23, %18 ]
%20 = load i8, i8* %19
%21 = tail call i64 @isdigit(i8 signext %20)
%22 = icmp eq i64 %21, 0
%23 = getelementptr inbounds i8, i8* %19, i64 1
br i1 %22, label %18, label %24
24: ; preds = %18
%25 = call i32 (i8*, i8*, ...) @sscanf(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
br label %26
26: ; preds = %26, %24
%27 = phi i8* [ %19, %24 ], [ %31, %26 ]
%28 = load i8, i8* %27
%29 = call i64 @isdigit(i8 signext %28)
%30 = icmp eq i64 %29, 0
%31 = getelementptr inbounds i8, i8* %27, i64 1
br i1 %30, label %32, label %26
32: ; preds = %26, %32
%33 = phi i8* [ %37, %32 ], [ %27, %26 ]
%34 = load i8, i8* %33
%35 = call i64 @isdigit(i8 signext %34)
%36 = icmp eq i64 %35, 0
%37 = getelementptr inbounds i8, i8* %33, i64 1
br i1 %36, label %32, label %38
38: ; preds = %32
%39 = call i32 (i8*, i8*, ...) @sscanf(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
br label %40
40: ; preds = %40, %38
%41 = phi i8* [ %33, %38 ], [ %45, %40 ]
%42 = load i8, i8* %41
%43 = call i64 @isdigit(i8 signext %42)
%44 = icmp eq i64 %43, 0
%45 = getelementptr inbounds i8, i8* %41, i64 1
br i1 %44, label %46, label %40
46: ; preds = %40, %46
%47 = phi i8* [ %50, %46 ], [ %45, %40 ]
%48 = load i8, i8* %47
%49 = icmp eq i8 %48, 58
%50 = getelementptr inbounds i8, i8* %47, i64 1
br i1 %49, label %51, label %46
51: ; preds = %46
store i8 0, i8* %47
%52 = call i32 (i8*, i8*, ...) @sscanf(i8* %50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %8)
%53 = load i32, i32* %7
%54 = call i32 (i8*, i8*, ...) @sprintf(i8* %15, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %4, i32 %53)
%55 = load i32, i32* %6
%56 = icmp eq i32 %55, 1
br i1 %56, label %57, label %61
57: ; preds = %51
%58 = call i32 @mkdir(i8* %15, i32 493)
%59 = call i32 (i8*, i8*, ...) @sprintf(i8* %16, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %15)
%60 = call i32 @addaline(i8* %16, i8* %45)
br label %61
61: ; preds = %57, %51
%62 = call i32 (i8*, i8*, ...) @sprintf(i8* %16, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %15)
%63 = load i32, i32* %6
%64 = load float, float* %8
%65 = fpext float %64 to double
%66 = call i32 (i8*, i8*, ...) @sprintf(i8* %17, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %63, double %65)
%67 = call i32 @addaline(i8* %16, i8* %17)
%68 = load i32, i32* %7
%69 = load float, float* %8
%70 = call i32 @dostats(i32 %68, float %69, float* %1, float* %2, float* %3)
ret i32 undef
}