#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*/ ReadSubKey(char *, char *, int *, char, char,
                              int /*<<< orphan*/);
int /*<<< orphan*/ StripSpaces(char *);
double asc2real(char *, int, int);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
int strpos2(char *, char *, int);
int /*<<< orphan*/ strsub(char *, char *, int, int);
void ReadParameter(char *line, char *line_smallcaps, char *s, char *data_string,
                   double *data_value, int *jj) {
  int j;
  char laux[4096];
  j = *jj;
  j = strpos2(line_smallcaps, s, 1);
  if (j) {
    ReadSubKey(laux, line, &j, '=', ' ', 0);
    StripSpaces(laux);
    if (laux[(int)strlen(laux) - 1] == '\'') {
      strsub(data_string, laux, 2, (int)strlen(laux) - 2);
      strcpy(laux, data_string);
    }
    *data_value = asc2real(laux, 1, (int)strlen(laux));
    *data_value = *data_value * 1e6;
    strcpy(data_string, laux);
  }
  *jj = j;
}


x86 assembly (clang, -O0):
<ReadParameter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1060,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1070 <strpos2@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     12ba <ReadParameter+0x14a>
lea    -0x1040(%rbp),%rdi
mov    -0x8(%rbp),%rsi
lea    -0x34(%rbp),%rdx
mov    $0x3d,%ecx
mov    $0x20,%r8d
xor    %r9d,%r9d
call   1040 <ReadSubKey@plt>
lea    -0x1040(%rbp),%rdi
call   1090 <StripSpaces@plt>
lea    -0x1040(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x1,%eax
cltq
movsbl -0x1040(%rbp,%rax,1),%eax
ff
cmp    $0x27,%eax
jne    125d <ReadParameter+0xed>
mov    -0x20(%rbp),%rax
mov    %rax,-0x1050(%rbp)
lea    -0x1040(%rbp),%rax
mov    %rax,-0x1048(%rbp)
lea    -0x1040(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x1050(%rbp),%rdi
mov    -0x1048(%rbp),%rsi
mov    %eax,%ecx
sub    $0x2,%ecx
mov    $0x2,%edx
call   1060 <strsub@plt>
lea    -0x1040(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x1040(%rbp),%rax
mov    %rax,-0x1058(%rbp)
lea    -0x1040(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x1058(%rbp),%rdi
mov    %eax,%edx
mov    $0x1,%esi
call   1080 <asc2real@plt>
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  0xd62(%rip),%xmm0
mulsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rdi
lea    -0x1040(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x34(%rbp),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
add    $0x1060,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadParameter>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1010,%rsp
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    $0x1,%edx
call   1070 <strpos2@plt>
mov    %eax,0xc(%rsp)
test   %eax,%eax
je     1247 <ReadParameter+0xd7>
lea    0x10(%rsp),%r13
lea    0xc(%rsp),%rdx
mov    %r13,%rdi
mov    %rbx,%rsi
mov    $0x3d,%ecx
mov    $0x20,%r8d
xor    %r9d,%r9d
call   1040 <ReadSubKey@plt>
mov    %r13,%rdi
call   1090 <StripSpaces@plt>
mov    %r13,%rdi
call   1050 <strlen@plt>
lea    -0x1(%rax),%ecx
movslq %ecx,%rcx
cmpb   $0x27,0x10(%rsp,%rcx,1)
jne    120d <ReadParameter+0x9d>
add    $0xfffffffe,%eax
lea    0x10(%rsp),%rbx
mov    %r12,%rdi
mov    %rbx,%rsi
mov    $0x2,%edx
mov    %eax,%ecx
call   1060 <strsub@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
call   1080 <asc2real@plt>
mulsd  0xdcf(%rip),%xmm0
movsd  %xmm0,(%r15)
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    0xc(%rsp),%eax
jmp    1249 <ReadParameter+0xd9>
xor    %eax,%eax
mov    %eax,(%r14)
add    $0x1010,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ReadParameter(i8* %0, i8* %1, i8* %2, i8* %3, double* %4, i32* %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca double*
%12 = alloca i32*
%13 = alloca i32
%14 = alloca [4096 x i8]
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store double* %4, double** %11
store i32* %5, i32** %12
%15 = load i32*, i32** %12
%16 = load i32, i32* %15
store i32 %16, i32* %13
%17 = load i8*, i8** %8
%18 = load i8*, i8** %9
%19 = call i32 @strpos2(i8* %17, i8* %18, i32 1)
store i32 %19, i32* %13
%20 = load i32, i32* %13
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %62
22: ; preds = %6
%23 = getelementptr inbounds [4096 x i8], [4096 x i8]* %14, i64 0, i64 0
%24 = load i8*, i8** %7
%25 = call i32 @ReadSubKey(i8* %23, i8* %24, i32* %13, i8 signext 61, i8 signext 32, i32 0)
%26 = getelementptr inbounds [4096 x i8], [4096 x i8]* %14, i64 0, i64 0
%27 = call i32 @StripSpaces(i8* %26)
%28 = getelementptr inbounds [4096 x i8], [4096 x i8]* %14, i64 0, i64 0
%29 = call i64 @strlen(i8* %28)
%30 = trunc i64 %29 to i32
%31 = sub nsw i32 %30, 1
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [4096 x i8], [4096 x i8]* %14, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 39
br i1 %36, label %37, label %48
37: ; preds = %22
%38 = load i8*, i8** %10
%39 = getelementptr inbounds [4096 x i8], [4096 x i8]* %14, i64 0, i64 0
%40 = getelementptr inbounds [4096 x i8], [4096 x i8]* %14, i64 0, i64 0
%41 = call i64 @strlen(i8* %40)
%42 = trunc i64 %41 to i32
%43 = sub nsw i32 %42, 2
%44 = call i32 @strsub(i8* %38, i8* %39, i32 2, i32 %43)
%45 = getelementptr inbounds [4096 x i8], [4096 x i8]* %14, i64 0, i64 0
%46 = load i8*, i8** %10
%47 = call i32 @strcpy(i8* %45, i8* %46)
br label %48
48: ; preds = %37, %22
%49 = getelementptr inbounds [4096 x i8], [4096 x i8]* %14, i64 0, i64 0
%50 = getelementptr inbounds [4096 x i8], [4096 x i8]* %14, i64 0, i64 0
%51 = call i64 @strlen(i8* %50)
%52 = trunc i64 %51 to i32
%53 = call double @asc2real(i8* %49, i32 1, i32 %52)
%54 = load double*, double** %11
store double %53, double* %54
%55 = load double*, double** %11
%56 = load double, double* %55
%57 = fmul double %56, 1.000000e+06
%58 = load double*, double** %11
store double %57, double* %58
%59 = load i8*, i8** %10
%60 = getelementptr inbounds [4096 x i8], [4096 x i8]* %14, i64 0, i64 0
%61 = call i32 @strcpy(i8* %59, i8* %60)
br label %62
62: ; preds = %48, %6
%63 = load i32, i32* %13
%64 = load i32*, i32** %12
store i32 %63, i32* %64
ret void
}

LLVM IR (-O2):
define void @ReadParameter(i8* %0, i8* %1, i8* %2, i8* %3, double* nocapture writeonly %4, i32* nocapture %5) {
%7 = alloca i32
%8 = alloca [4096 x i8]
%9 = bitcast i32* %7 to i8*
%10 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%11 = tail call i32 @strpos2(i8* %1, i8* %2, i32 1)
store i32 %11, i32* %7
%12 = icmp eq i32 %11, 0
br i1 %12, label %35, label %13
13: ; preds = %6
%14 = call i32 @ReadSubKey(i8* %10, i8* %0, i32* %7, i8 signext 61, i8 signext 32, i32 0)
%15 = call i32 @StripSpaces(i8* %10)
%16 = call i64 @strlen(i8* %10)
%17 = shl i64 %16, 32
%18 = add i64 %17, -4294967296
%19 = ashr exact i64 %18, 32
%20 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = icmp eq i8 %21, 39
br i1 %22, label %23, label %28
23: ; preds = %13
%24 = trunc i64 %16 to i32
%25 = add nsw i32 %24, -2
%26 = call i32 @strsub(i8* %3, i8* %10, i32 2, i32 %25)
%27 = call i32 @strcpy(i8* %10, i8* %3)
br label %28
28: ; preds = %23, %13
%29 = call i64 @strlen(i8* %10)
%30 = trunc i64 %29 to i32
%31 = call double @asc2real(i8* %10, i32 1, i32 %30)
%32 = fmul double %31, 1.000000e+06
store double %32, double* %4
%33 = call i32 @strcpy(i8* %3, i8* %10)
%34 = load i32, i32* %7
br label %35
35: ; preds = %28, %6
%36 = phi i32 [ %34, %28 ], [ 0, %6 ]
store i32 %36, i32* %5
ret void
}