#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 *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int getMol2LineStatus(char *d) {
  char Entete[25];
  int i;
  float f;
  char s[10];
  strncpy(Entete, d, 9);
  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>
movb   $0x0,-0x27(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1223 <getMol2LineStatus+0xf3>
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    0xe79(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11ac <getMol2LineStatus+0x7c>
movl   $0x1,-0x4(%rbp)
jmp    12f0 <getMol2LineStatus+0x1c0>
lea    -0x30(%rbp),%rdi
lea    0xe58(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11d2 <getMol2LineStatus+0xa2>
movl   $0xa,-0x4(%rbp)
jmp    12f0 <getMol2LineStatus+0x1c0>
lea    -0x30(%rbp),%rdi
lea    0xe3b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11f8 <getMol2LineStatus+0xc8>
movl   $0x14,-0x4(%rbp)
jmp    12f0 <getMol2LineStatus+0x1c0>
lea    -0x30(%rbp),%rdi
lea    0xe1d(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    121e <getMol2LineStatus+0xee>
movl   $0x1e,-0x4(%rbp)
jmp    12f0 <getMol2LineStatus+0x1c0>
jmp    1223 <getMol2LineStatus+0xf3>
mov    -0x10(%rbp),%rdi
lea    0xdf7(%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   1050 <sscanf@plt>
cmp    $0x6,%eax
jne    1268 <getMol2LineStatus+0x138>
movl   $0x2,-0x4(%rbp)
jmp    12f0 <getMol2LineStatus+0x1c0>
mov    -0x10(%rbp),%rdi
lea    0xdc4(%rip),%rsi
lea    -0x34(%rbp),%rdx
mov    $0x0,%al
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    1293 <getMol2LineStatus+0x163>
movl   $0x15,-0x4(%rbp)
jmp    12f0 <getMol2LineStatus+0x1c0>
mov    -0x10(%rbp),%rdi
lea    -0x42(%rbp),%rdx
lea    0xda5(%rip),%rsi
mov    $0x0,%al
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    12be <getMol2LineStatus+0x18e>
movl   $0x16,-0x4(%rbp)
jmp    12f0 <getMol2LineStatus+0x1c0>
mov    -0x10(%rbp),%rdi
lea    0xd90(%rip),%rsi
lea    -0x38(%rbp),%rdx
mov    $0x0,%al
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    12e9 <getMol2LineStatus+0x1b9>
movl   $0x17,-0x4(%rbp)
jmp    12f0 <getMol2LineStatus+0x1c0>
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>
movb   $0x0,0x19(%rsp)
lea    0xea5(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     121a <getMol2LineStatus+0xea>
lea    0x2e(%rsp),%rcx
lea    0x8(%rsp),%r8
lea    0xea8(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %r14,%rdi
mov    %r8,%r9
xor    %eax,%eax
push   %rcx
push   %r8
call   1050 <sscanf@plt>
add    $0x10,%rsp
mov    %eax,%ecx
mov    $0x2,%eax
cmp    $0x6,%ecx
je     12a9 <getMol2LineStatus+0x179>
lea    0xe8a(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <sscanf@plt>
mov    %eax,%ecx
mov    $0x15,%eax
cmp    $0x1,%ecx
je     12a9 <getMol2LineStatus+0x179>
lea    0xe74(%rip),%rsi
xor    %ebx,%ebx
lea    0x2e(%rsp),%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <sscanf@plt>
mov    %eax,%ecx
mov    $0x16,%eax
cmp    $0x1,%ecx
je     12a9 <getMol2LineStatus+0x179>
lea    0xe5e(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <sscanf@plt>
cmp    $0x1,%eax
mov    $0x17,%eax
cmovne %ebx,%eax
jmp    12a9 <getMol2LineStatus+0x179>
lea    0x9(%r14),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x18,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x28(%rsp)
lea    0xdce(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1296 <getMol2LineStatus+0x166>
lea    0xdbf(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     129d <getMol2LineStatus+0x16d>
lea    0xdb2(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12a4 <getMol2LineStatus+0x174>
lea    0xda4(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    116c <getMol2LineStatus+0x3c>
mov    $0x1e,%eax
jmp    12a9 <getMol2LineStatus+0x179>
mov    $0x1,%eax
jmp    12a9 <getMol2LineStatus+0x179>
mov    $0xa,%eax
jmp    12a9 <getMol2LineStatus+0x179>
mov    $0x14,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

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

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