#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*/ ConvRespTrace(int /*<<< orphan*/, int);
int /*<<< orphan*/ GetResponses(int /*<<< orphan*/ *);
int /*<<< orphan*/ filterTrc(int, int /*<<< orphan*/, int, float, float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, char *, ...);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
void parseScriptCmd(char *line, int itrc) {
  char cmd[1000];
  sscanf(line, "%s", cmd);
  if (*cmd == '#')
    return;
  if (!strcmp(cmd, "match")) {
    sscanf(line, "%*s %s", cmd);
    if (!strncmp(cmd, "resp", 4)) {
      printf(": match response (trc #%d)\n", itrc);
      GetResponses(NULL);
    }
  } else if (!strncmp(cmd, "deconv", 6)) {
    printf(": deconvolve (trc #%d)\n", itrc);
    ConvRespTrace(0, itrc);
  } else if (!strcmp(cmd, "filter")) {
    char name[100];
    float flo, fhi;
    int which;
    sscanf(line, "%*s %s %f %f", name, &flo, &fhi);
    printf(": filter %s %f - %f Hz (trc #%d)\n", name, flo, fhi, itrc);
    if (!strncmp(name, "band", 4)) {
      which = 1;
    } else if (!strncmp(name, "low", 3)) {
      which = 3;
    } else if (!strncmp(name, "hi", 2)) {
      which = 5;
    }
    filterTrc(which, 0, itrc, flo, fhi);
  } else {
    printf("Unrecognize line: %s\n", line);
  }
}


x86 assembly (clang, -O0):
<parseScriptCmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x480,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x400(%rbp),%rdx
lea    0xe76(%rip),%rsi
mov    $0x0,%al
call   1060 <sscanf@plt>
movsbl -0x400(%rbp),%eax
cmp    $0x23,%eax
jne    11b0 <parseScriptCmd+0x40>
jmp    13af <parseScriptCmd+0x23f>
lea    -0x400(%rbp),%rdi
lea    0xe42(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1225 <parseScriptCmd+0xb5>
mov    -0x8(%rbp),%rdi
lea    -0x400(%rbp),%rdx
lea    0xe28(%rip),%rsi
mov    $0x0,%al
call   1060 <sscanf@plt>
lea    -0x400(%rbp),%rdi
lea    0xe1a(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1220 <parseScriptCmd+0xb0>
mov    -0xc(%rbp),%esi
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1080 <GetResponses@plt>
jmp    13af <parseScriptCmd+0x23f>
lea    -0x400(%rbp),%rdi
lea    0xdfb(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1266 <parseScriptCmd+0xf6>
mov    -0xc(%rbp),%esi
lea    0xde5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%esi
xor    %edi,%edi
call   1070 <ConvRespTrace@plt>
jmp    13aa <parseScriptCmd+0x23a>
lea    -0x400(%rbp),%rdi
lea    0xdd9(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1393 <parseScriptCmd+0x223>
mov    -0x8(%rbp),%rdi
lea    -0x470(%rbp),%rdx
lea    0xdc0(%rip),%rsi
lea    -0x474(%rbp),%rcx
lea    -0x478(%rbp),%r8
mov    $0x0,%al
call   1060 <sscanf@plt>
lea    -0x470(%rbp),%rsi
movss  -0x474(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movss  -0x478(%rbp),%xmm1
ff
cvtss2sd %xmm1,%xmm1
mov    -0xc(%rbp),%edx
lea    0xd8f(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
lea    -0x470(%rbp),%rdi
lea    0xd9c(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1309 <parseScriptCmd+0x199>
movl   $0x1,-0x47c(%rbp)
jmp    136e <parseScriptCmd+0x1fe>
lea    -0x470(%rbp),%rdi
lea    0xd71(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1339 <parseScriptCmd+0x1c9>
movl   $0x3,-0x47c(%rbp)
jmp    1369 <parseScriptCmd+0x1f9>
lea    -0x470(%rbp),%rdi
lea    0xd45(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1364 <parseScriptCmd+0x1f4>
movl   $0x5,-0x47c(%rbp)
jmp    1369 <parseScriptCmd+0x1f9>
jmp    136e <parseScriptCmd+0x1fe>
mov    -0x47c(%rbp),%edi
mov    -0xc(%rbp),%edx
movss  -0x474(%rbp),%xmm0
ff
movss  -0x478(%rbp),%xmm1
ff
xor    %esi,%esi
call   1090 <filterTrc@plt>
jmp    13a5 <parseScriptCmd+0x235>
mov    -0x8(%rbp),%rsi
lea    0xcf1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13aa <parseScriptCmd+0x23a>
jmp    13af <parseScriptCmd+0x23f>
add    $0x480,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseScriptCmd>:
push   %rbp
push   %r14
push   %rbx
sub    $0x470,%rsp
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xe92(%rip),%rsi
lea    0x80(%rsp),%rdx
xor    %eax,%eax
call   1050 <sscanf@plt>
cmpb   $0x23,0x80(%rsp)
23
jne    119d <parseScriptCmd+0x3d>
add    $0x470,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    $0x6374616d,%eax
xor    0x80(%rsp),%eax
movzwl 0x84(%rsp),%ecx
xor    $0x68,%ecx
or     %eax,%ecx
je     120c <parseScriptCmd+0xac>
lea    0xe6f(%rip),%rsi
lea    0x80(%rsp),%rdi
mov    $0x6,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1261 <parseScriptCmd+0x101>
mov    $0x746c6966,%eax
xor    0x80(%rsp),%eax
mov    $0x726574,%ecx
xor    0x83(%rsp),%ecx
or     %eax,%ecx
je     1281 <parseScriptCmd+0x121>
lea    0xe8f(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1191 <parseScriptCmd+0x31>
lea    0xdf3(%rip),%rsi
lea    0x80(%rsp),%rbp
mov    %rbx,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1050 <sscanf@plt>
lea    0xdde(%rip),%rsi
mov    %rbp,%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    1191 <parseScriptCmd+0x31>
lea    0xdc7(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %edi,%edi
call   1070 <GetResponses@plt>
jmp    1191 <parseScriptCmd+0x31>
lea    0xdcd(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %edi,%edi
mov    %r14d,%esi
call   1060 <ConvRespTrace@plt>
jmp    1191 <parseScriptCmd+0x31>
lea    0xdcc(%rip),%rsi
lea    0x10(%rsp),%rbp
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    %rbx,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1050 <sscanf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x8(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xda2(%rip),%rdi
mov    %rbp,%rsi
mov    %r14d,%edx
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xdb0(%rip),%rsi
mov    %rbp,%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1320 <parseScriptCmd+0x1c0>
lea    0xd9d(%rip),%rsi
lea    0x10(%rsp),%rdi
mov    $0x3,%ebx
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1325 <parseScriptCmd+0x1c5>
lea    0xd82(%rip),%rsi
lea    0x10(%rsp),%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
mov    $0x5,%ebx
jmp    1325 <parseScriptCmd+0x1c5>
mov    $0x1,%ebx
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
mov    %ebx,%edi
xor    %esi,%esi
mov    %r14d,%edx
call   1080 <filterTrc@plt>
jmp    1191 <parseScriptCmd+0x31>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"match\00"
@.str.2 = [7 x i8] c"%*s %s\00"
@.str.3 = [5 x i8] c"resp\00"
@.str.4 = [28 x i8] c": match response (trc #%d)\0A\00"
@.str.5 = [7 x i8] c"deconv\00"
@.str.6 = [24 x i8] c": deconvolve (trc #%d)\0A\00"
@.str.7 = [7 x i8] c"filter\00"
@.str.8 = [13 x i8] c"%*s %s %f %f\00"
@.str.9 = [34 x i8] c": filter %s %f - %f Hz (trc #%d)\0A\00"
@.str.10 = [5 x i8] c"band\00"
@.str.11 = [4 x i8] c"low\00"
@.str.12 = [3 x i8] c"hi\00"
@.str.13 = [22 x i8] c"Unrecognize line: %s\0A\00"
define void @parseScriptCmd(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [1000 x i8]
%6 = alloca [100 x i8]
%7 = alloca float
%8 = alloca float
%9 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%10 = load i8*, i8** %3
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%12 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 35
br i1 %16, label %17, label %18
17: ; preds = %2
br label %85
18: ; preds = %2
%19 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%20 = call i32 @strcmp(i8* %19, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp ne i32 %20, 0
br i1 %21, label %34, label %22
22: ; preds = %18
%23 = load i8*, i8** %3
%24 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%25 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %23, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %24)
%26 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%27 = call i32 @strncmp(i8* %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 4)
%28 = icmp ne i32 %27, 0
br i1 %28, label %33, label %29
29: ; preds = %22
%30 = load i32, i32* %4
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i32 %30)
%32 = call i32 @GetResponses(i32* null)
br label %33
33: ; preds = %29, %22
br label %85
34: ; preds = %18
%35 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%36 = call i32 @strncmp(i8* %35, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 6)
%37 = icmp ne i32 %36, 0
br i1 %37, label %43, label %38
38: ; preds = %34
%39 = load i32, i32* %4
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i32 %39)
%41 = load i32, i32* %4
%42 = call i32 @ConvRespTrace(i32 0, i32 %41)
br label %84
43: ; preds = %34
%44 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%45 = call i32 @strcmp(i8* %44, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%46 = icmp ne i32 %45, 0
br i1 %46, label %80, label %47
47: ; preds = %43
%48 = load i8*, i8** %3
%49 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%50 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %48, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %49, float* %7, float* %8)
%51 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%52 = load float, float* %7
%53 = fpext float %52 to double
%54 = load float, float* %8
%55 = fpext float %54 to double
%56 = load i32, i32* %4
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.9, i64 0, i64 0), i8* %51, double %53, double %55, i32 %56)
%58 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%59 = call i32 @strncmp(i8* %58, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 4)
%60 = icmp ne i32 %59, 0
br i1 %60, label %62, label %61
61: ; preds = %47
store i32 1, i32* %9
br label %74
62: ; preds = %47
%63 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%64 = call i32 @strncmp(i8* %63, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i32 3)
%65 = icmp ne i32 %64, 0
br i1 %65, label %67, label %66
66: ; preds = %62
store i32 3, i32* %9
br label %73
67: ; preds = %62
%68 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%69 = call i32 @strncmp(i8* %68, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i32 2)
%70 = icmp ne i32 %69, 0
br i1 %70, label %72, label %71
71: ; preds = %67
store i32 5, i32* %9
br label %72
72: ; preds = %71, %67
br label %73
73: ; preds = %72, %66
br label %74
74: ; preds = %73, %61
%75 = load i32, i32* %9
%76 = load i32, i32* %4
%77 = load float, float* %7
%78 = load float, float* %8
%79 = call i32 @filterTrc(i32 %75, i32 0, i32 %76, float %77, float %78)
br label %83
80: ; preds = %43
%81 = load i8*, i8** %3
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.13, i64 0, i64 0), i8* %81)
br label %83
83: ; preds = %80, %74
br label %84
84: ; preds = %83, %38
br label %85
85: ; preds = %17, %84, %33
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"match\00"
@.str.2 = [7 x i8] c"%*s %s\00"
@.str.3 = [5 x i8] c"resp\00"
@.str.4 = [28 x i8] c": match response (trc #%d)\0A\00"
@.str.5 = [7 x i8] c"deconv\00"
@.str.6 = [24 x i8] c": deconvolve (trc #%d)\0A\00"
@.str.7 = [7 x i8] c"filter\00"
@.str.8 = [13 x i8] c"%*s %s %f %f\00"
@.str.9 = [34 x i8] c": filter %s %f - %f Hz (trc #%d)\0A\00"
@.str.10 = [5 x i8] c"band\00"
@.str.11 = [4 x i8] c"low\00"
@.str.12 = [3 x i8] c"hi\00"
@.str.13 = [22 x i8] c"Unrecognize line: %s\0A\00"
define void @parseScriptCmd(i8* %0, i32 %1) {
%3 = alloca [1000 x i8]
%4 = alloca [100 x i8]
%5 = alloca float
%6 = alloca float
%7 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%8 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 35
br i1 %10, label %54, label %11
11: ; preds = %2
%12 = call i32 @bcmp(i8* dereferenceable(6) %7, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 6)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%16 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 4)
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %54
18: ; preds = %14
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i32 %1)
%20 = call i32 @GetResponses(i32* null)
br label %54
21: ; preds = %11
%22 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 6)
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i32 %1)
%26 = call i32 @ConvRespTrace(i32 0, i32 %1)
br label %54
27: ; preds = %21
%28 = call i32 @bcmp(i8* dereferenceable(7) %7, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i64 7)
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %52
30: ; preds = %27
%31 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%32 = bitcast float* %5 to i8*
%33 = bitcast float* %6 to i8*
%34 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %31, float* %5, float* %6)
%35 = load float, float* %5
%36 = fpext float %35 to double
%37 = load float, float* %6
%38 = fpext float %37 to double
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.9, i64 0, i64 0), i8* %31, double %36, double %38, i32 %1)
%40 = call i32 @strncmp(i8* %31, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 4)
%41 = icmp eq i32 %40, 0
br i1 %41, label %47, label %42
42: ; preds = %30
%43 = call i32 @strncmp(i8* %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i32 3)
%44 = icmp eq i32 %43, 0
br i1 %44, label %47, label %45
45: ; preds = %42
%46 = call i32 @strncmp(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i32 2)
br label %47
47: ; preds = %45, %42, %30
%48 = phi i32 [ 1, %30 ], [ 3, %42 ], [ 5, %45 ]
%49 = load float, float* %5
%50 = load float, float* %6
%51 = call i32 @filterTrc(i32 %48, i32 0, i32 %1, float %49, float %50)
br label %54
52: ; preds = %27
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.13, i64 0, i64 0), i8* %0)
br label %54
54: ; preds = %18, %14, %47, %52, %24, %2
ret void
}