#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 sscanf(char *, char *, ...);
scalar_t__ strcmp(char *, char *);
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
int getMol2LineStatus(char *d) {
  char Entete[25];
  int i;
  float f;
  char s[10];
  strncpy(Entete, d, 9);
  if (strncmp(Entete, "Energy ", 7) == 0) {
    return 11;
  }
  if (strncmp(Entete, "VDW ene", 7) == 0) {
    return 12;
  }
  Entete[9] = 0;
  if (strcmp(Entete, "@<TRIPOS>") == 0) {
    strncpy(Entete, d + 9, 24);
    Entete[24] = 0;
    if (strcmp(Entete, "ATOM") == 0)
      return 1;
    if (strcmp(Entete, "MOLECULE") == 0)
      return 10;
    if (strcmp(Entete, "COMMENT") == 0)
      return 20;
    if (strcmp(Entete, "BOND") == 0)
      return 30;
  }
  if (sscanf(d, "%d %s %f %f %f %s", &i, &s, &f, &f, &f, &s) == 6)
    return 2;
  if (sscanf(d, " REMARK ATOM %d", &i) == 1)
    return 21;
  if (sscanf(d, " REMARK MATCH. %c", s) == 1)
    return 22;
  if (sscanf(d, " REMARK WEIGHT. %f", &f) == 1)
    return 23;
  return 0;
}


x86 assembly (clang, -O0):
<getMol2LineStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x9,%edx
call   1030 <strncpy@plt>
lea    -0x30(%rbp),%rdi
lea    0xe97(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1189 <getMol2LineStatus+0x49>
movl   $0xb,-0x4(%rbp)
jmp    1356 <getMol2LineStatus+0x216>
lea    -0x30(%rbp),%rdi
lea    0xe74(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    11b4 <getMol2LineStatus+0x74>
movl   $0xc,-0x4(%rbp)
jmp    1356 <getMol2LineStatus+0x216>
movb   $0x0,-0x27(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe4d(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1289 <getMol2LineStatus+0x149>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x9,%rsi
mov    $0x18,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe23(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1212 <getMol2LineStatus+0xd2>
movl   $0x1,-0x4(%rbp)
jmp    1356 <getMol2LineStatus+0x216>
lea    -0x30(%rbp),%rdi
lea    0xe02(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1238 <getMol2LineStatus+0xf8>
movl   $0xa,-0x4(%rbp)
jmp    1356 <getMol2LineStatus+0x216>
lea    -0x30(%rbp),%rdi
lea    0xde5(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    125e <getMol2LineStatus+0x11e>
movl   $0x14,-0x4(%rbp)
jmp    1356 <getMol2LineStatus+0x216>
lea    -0x30(%rbp),%rdi
lea    0xdc7(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1284 <getMol2LineStatus+0x144>
movl   $0x1e,-0x4(%rbp)
jmp    1356 <getMol2LineStatus+0x216>
jmp    1289 <getMol2LineStatus+0x149>
mov    -0x10(%rbp),%rdi
lea    0xda1(%rip),%rsi
lea    -0x34(%rbp),%rdx
lea    -0x42(%rbp),%rax
lea    -0x38(%rbp),%r10
mov    %rax,%rcx
mov    %r10,%r8
mov    %r10,%r9
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1060 <sscanf@plt>
cmp    $0x6,%eax
jne    12ce <getMol2LineStatus+0x18e>
movl   $0x2,-0x4(%rbp)
jmp    1356 <getMol2LineStatus+0x216>
mov    -0x10(%rbp),%rdi
lea    0xd6e(%rip),%rsi
lea    -0x34(%rbp),%rdx
mov    $0x0,%al
call   1060 <sscanf@plt>
cmp    $0x1,%eax
jne    12f9 <getMol2LineStatus+0x1b9>
movl   $0x15,-0x4(%rbp)
jmp    1356 <getMol2LineStatus+0x216>
mov    -0x10(%rbp),%rdi
lea    -0x42(%rbp),%rdx
lea    0xd4f(%rip),%rsi
mov    $0x0,%al
call   1060 <sscanf@plt>
cmp    $0x1,%eax
jne    1324 <getMol2LineStatus+0x1e4>
movl   $0x16,-0x4(%rbp)
jmp    1356 <getMol2LineStatus+0x216>
mov    -0x10(%rbp),%rdi
lea    0xd3a(%rip),%rsi
lea    -0x38(%rbp),%rdx
mov    $0x0,%al
call   1060 <sscanf@plt>
cmp    $0x1,%eax
jne    134f <getMol2LineStatus+0x20f>
movl   $0x17,-0x4(%rbp)
jmp    1356 <getMol2LineStatus+0x216>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMol2LineStatus>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rdi,%r14
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x9,%edx
call   1030 <strncpy@plt>
lea    0xe9a(%rip),%rsi
mov    %rbx,%rdi
mov    $0x7,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1259 <getMol2LineStatus+0x119>
lea    0xe85(%rip),%rsi
lea    0x10(%rsp),%rdi
mov    $0x7,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1260 <getMol2LineStatus+0x120>
movb   $0x0,0x19(%rsp)
lea    0xe69(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     126d <getMol2LineStatus+0x12d>
lea    0x2e(%rsp),%rcx
lea    0x8(%rsp),%r8
lea    0xe6a(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %r14,%rdi
mov    %r8,%r9
xor    %eax,%eax
push   %rcx
push   %r8
call   1060 <sscanf@plt>
add    $0x10,%rsp
mov    %eax,%ecx
mov    $0x2,%eax
cmp    $0x6,%ecx
je     1265 <getMol2LineStatus+0x125>
lea    0xe50(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <sscanf@plt>
mov    %eax,%ecx
mov    $0x15,%eax
cmp    $0x1,%ecx
je     1265 <getMol2LineStatus+0x125>
lea    0xe3e(%rip),%rsi
xor    %ebx,%ebx
lea    0x2e(%rsp),%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <sscanf@plt>
mov    %eax,%ecx
mov    $0x16,%eax
cmp    $0x1,%ecx
je     1265 <getMol2LineStatus+0x125>
lea    0xe2c(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <sscanf@plt>
cmp    $0x1,%eax
mov    $0x17,%eax
cmovne %ebx,%eax
jmp    1265 <getMol2LineStatus+0x125>
mov    $0xb,%eax
jmp    1265 <getMol2LineStatus+0x125>
mov    $0xc,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret
lea    0x9(%r14),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x18,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x28(%rsp)
lea    0xd8b(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     12ec <getMol2LineStatus+0x1ac>
lea    0xd7c(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     12f6 <getMol2LineStatus+0x1b6>
lea    0xd6f(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1300 <getMol2LineStatus+0x1c0>
lea    0xd61(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    11ba <getMol2LineStatus+0x7a>
mov    $0x1e,%eax
jmp    1265 <getMol2LineStatus+0x125>
mov    $0x1,%eax
jmp    1265 <getMol2LineStatus+0x125>
mov    $0xa,%eax
jmp    1265 <getMol2LineStatus+0x125>
mov    $0x14,%eax
jmp    1265 <getMol2LineStatus+0x125>

LLVM IR (-O0):
@.str = [8 x i8] c"Energy \00"
@.str.1 = [8 x i8] c"VDW ene\00"
@.str.2 = [10 x i8] c"@<TRIPOS>\00"
@.str.3 = [5 x i8] c"ATOM\00"
@.str.4 = [9 x i8] c"MOLECULE\00"
@.str.5 = [8 x i8] c"COMMENT\00"
@.str.6 = [5 x i8] c"BOND\00"
@.str.7 = [18 x i8] c"%d %s %f %f %f %s\00"
@.str.8 = [16 x i8] c" REMARK ATOM %d\00"
@.str.9 = [18 x i8] c" REMARK MATCH. %c\00"
@.str.10 = [19 x i8] c" REMARK WEIGHT. %f\00"
define i32 @getMol2LineStatus(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [25 x i8]
%5 = alloca i32
%6 = alloca float
%7 = alloca [10 x i8]
store i8* %0, i8** %3
%8 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 0
%9 = load i8*, i8** %3
%10 = call i32 @strncpy(i8* %8, i8* %9, i32 9)
%11 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 0
%12 = call i64 @strncmp(i8* %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %1
store i32 11, i32* %2
br label %73
15: ; preds = %1
%16 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 0
%17 = call i64 @strncmp(i8* %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 7)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %15
store i32 12, i32* %2
br label %73
20: ; preds = %15
%21 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 9
store i8 0, i8* %21
%22 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 0
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %51
25: ; preds = %20
%26 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 0
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i64 9
%29 = call i32 @strncpy(i8* %26, i8* %28, i32 24)
%30 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 24
store i8 0, i8* %30
%31 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 0
%32 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %25
store i32 1, i32* %2
br label %73
35: ; preds = %25
%36 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 0
%37 = call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %35
store i32 10, i32* %2
br label %73
40: ; preds = %35
%41 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 0
%42 = call i64 @strcmp(i8* %41, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %45
44: ; preds = %40
store i32 20, i32* %2
br label %73
45: ; preds = %40
%46 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 0
%47 = call i64 @strcmp(i8* %46, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %50
49: ; preds = %45
store i32 30, i32* %2
br label %73
50: ; preds = %45
br label %51
51: ; preds = %50, %20
%52 = load i8*, i8** %3
%53 = call i32 (i8*, i8*, ...) @sscanf(i8* %52, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i32* %5, [10 x i8]* %7, float* %6, float* %6, float* %6, [10 x i8]* %7)
%54 = icmp eq i32 %53, 6
br i1 %54, label %55, label %56
55: ; preds = %51
store i32 2, i32* %2
br label %73
56: ; preds = %51
%57 = load i8*, i8** %3
%58 = call i32 (i8*, i8*, ...) @sscanf(i8* %57, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i32* %5)
%59 = icmp eq i32 %58, 1
br i1 %59, label %60, label %61
60: ; preds = %56
store i32 21, i32* %2
br label %73
61: ; preds = %56
%62 = load i8*, i8** %3
%63 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%64 = call i32 (i8*, i8*, ...) @sscanf(i8* %62, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i8* %63)
%65 = icmp eq i32 %64, 1
br i1 %65, label %66, label %67
66: ; preds = %61
store i32 22, i32* %2
br label %73
67: ; preds = %61
%68 = load i8*, i8** %3
%69 = call i32 (i8*, i8*, ...) @sscanf(i8* %68, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), float* %6)
%70 = icmp eq i32 %69, 1
br i1 %70, label %71, label %72
71: ; preds = %67
store i32 23, i32* %2
br label %73
72: ; preds = %67
store i32 0, i32* %2
br label %73
73: ; preds = %72, %71, %66, %60, %55, %49, %44, %39, %34, %19, %14
%74 = load i32, i32* %2
ret i32 %74
}

LLVM IR (-O2):
@.str = [8 x i8] c"Energy \00"
@.str.1 = [8 x i8] c"VDW ene\00"
@.str.2 = [10 x i8] c"@<TRIPOS>\00"
@.str.3 = [5 x i8] c"ATOM\00"
@.str.4 = [9 x i8] c"MOLECULE\00"
@.str.5 = [8 x i8] c"COMMENT\00"
@.str.6 = [5 x i8] c"BOND\00"
@.str.7 = [18 x i8] c"%d %s %f %f %f %s\00"
@.str.8 = [16 x i8] c" REMARK ATOM %d\00"
@.str.9 = [18 x i8] c" REMARK MATCH. %c\00"
@.str.10 = [19 x i8] c" REMARK WEIGHT. %f\00"
define i32 @getMol2LineStatus(i8* %0) {
%2 = alloca [25 x i8]
%3 = alloca i32
%4 = alloca float
%5 = alloca [10 x i8]
%6 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%7 = bitcast i32* %3 to i8*
%8 = bitcast float* %4 to i8*
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%10 = call i32 @strncpy(i8* %6, i8* %0, i32 9)
%11 = call i64 @strncmp(i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%12 = icmp eq i64 %11, 0
br i1 %12, label %48, label %13
13: ; preds = %1
%14 = call i64 @strncmp(i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 7)
%15 = icmp eq i64 %14, 0
br i1 %15, label %48, label %16
16: ; preds = %13
%17 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 9
store i8 0, i8* %17
%18 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %35
20: ; preds = %16
%21 = getelementptr inbounds i8, i8* %0, i64 9
%22 = call i32 @strncpy(i8* %6, i8* %21, i32 24)
%23 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 24
store i8 0, i8* %23
%24 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %48, label %26
26: ; preds = %20
%27 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %48, label %29
29: ; preds = %26
%30 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %48, label %32
32: ; preds = %29
%33 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %48, label %35
35: ; preds = %32, %16
%36 = call i32 (i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i32* %3, [10 x i8]* %5, float* %4, float* %4, float* %4, [10 x i8]* %5)
%37 = icmp eq i32 %36, 6
br i1 %37, label %48, label %38
38: ; preds = %35
%39 = call i32 (i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i32* %3)
%40 = icmp eq i32 %39, 1
br i1 %40, label %48, label %41
41: ; preds = %38
%42 = call i32 (i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i8* %9)
%43 = icmp eq i32 %42, 1
br i1 %43, label %48, label %44
44: ; preds = %41
%45 = call i32 (i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), float* %4)
%46 = icmp eq i32 %45, 1
%47 = select i1 %46, i32 23, i32 0
br label %48
48: ; preds = %44, %41, %38, %35, %32, %29, %26, %20, %13, %1
%49 = phi i32 [ 11, %1 ], [ 12, %13 ], [ 1, %20 ], [ 10, %26 ], [ 20, %29 ], [ 30, %32 ], [ 2, %35 ], [ 21, %38 ], [ 22, %41 ], [ %47, %44 ]
ret i32 %49
}