#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 */
double strtod(char *, char **);
double parse_seq_name(char *s) {
  char *p, *q;
  double n;
  p = s;
  while (*p != '*' && *p != '\0')
    p++;
  if (*p == '\0')
    return 1;
  else {
    p++;
    n = strtod(p, &q);
    if (q == p)
      return -1;
  }
  if (n > 100.0)
    return -1;
  return n;
}


x86 assembly (clang, -O0):
<parse_seq_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2a,%ecx
mov    %al,-0x29(%rbp)
je     1149 <parse_seq_name+0x39>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
test   $0x1,%al
jne    1159 <parse_seq_name+0x49>
jmp    116a <parse_seq_name+0x5a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1124 <parse_seq_name+0x14>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    118c <parse_seq_name+0x7c>
movsd  0xe8e(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1202 <parse_seq_name+0xf2>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <strtod@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    11ca <parse_seq_name+0xba>
movsd  0xe48(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1202 <parse_seq_name+0xf2>
jmp    11cf <parse_seq_name+0xbf>
movsd  -0x28(%rbp),%xmm0
movsd  0xe24(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11f8 <parse_seq_name+0xe8>
movsd  0xe1a(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1202 <parse_seq_name+0xf2>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_seq_name>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
movzbl -0x1(%rbx),%eax
test   %al,%al
je     116b <parse_seq_name+0x5b>
cmp    $0x2a,%al
jne    1120 <parse_seq_name+0x10>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <strtod@plt>
cmp    0x8(%rsp),%rbx
je     1175 <parse_seq_name+0x65>
movapd %xmm0,%xmm1
movsd  0xeb8(%rip),%xmm0
cmpltsd %xmm1,%xmm0
movsd  0xea3(%rip),%xmm2
andpd  %xmm0,%xmm2
andnpd %xmm1,%xmm0
orpd   %xmm2,%xmm0
jmp    117d <parse_seq_name+0x6d>
movsd  0xe9d(%rip),%xmm0
jmp    117d <parse_seq_name+0x6d>
movsd  0xe83(%rip),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @parse_seq_name(i8* %0) {
%2 = alloca double
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
store i8* %0, i8** %3
%7 = load i8*, i8** %3
store i8* %7, i8** %4
br label %8
8: ; preds = %20, %1
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 42
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br label %18
18: ; preds = %13, %8
%19 = phi i1 [ false, %8 ], [ %17, %13 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %4
br label %8
23: ; preds = %18
%24 = load i8*, i8** %4
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %23
store double 1.000000e+00, double* %2
br label %45
29: ; preds = %23
%30 = load i8*, i8** %4
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %4
%32 = load i8*, i8** %4
%33 = call double @strtod(i8* %32, i8** %5)
store double %33, double* %6
%34 = load i8*, i8** %5
%35 = load i8*, i8** %4
%36 = icmp eq i8* %34, %35
br i1 %36, label %37, label %38
37: ; preds = %29
store double -1.000000e+00, double* %2
br label %45
38: ; preds = %29
br label %39
39: ; preds = %38
%40 = load double, double* %6
%41 = fcmp ogt double %40, 1.000000e+02
br i1 %41, label %42, label %43
42: ; preds = %39
store double -1.000000e+00, double* %2
br label %45
43: ; preds = %39
%44 = load double, double* %6
store double %44, double* %2
br label %45
45: ; preds = %43, %42, %37, %28
%46 = load double, double* %2
ret double %46
}

LLVM IR (-O2):
define double @parse_seq_name(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
br label %4
4: ; preds = %7, %1
%5 = phi i8* [ %0, %1 ], [ %8, %7 ]
%6 = load i8, i8* %5
switch i8 %6, label %7 [
i8 0, label %17
i8 42, label %9
]
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
br label %4
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = call double @strtod(i8* %10, i8** %2)
%12 = load i8*, i8** %2
%13 = icmp eq i8* %12, %10
br i1 %13, label %17, label %14
14: ; preds = %9
%15 = fcmp ogt double %11, 1.000000e+02
%16 = select i1 %15, double -1.000000e+00, double %11
br label %17
17: ; preds = %4, %14, %9
%18 = phi double [ -1.000000e+00, %9 ], [ %16, %14 ], [ 1.000000e+00, %4 ]
ret double %18
}