#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*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ sscanf(char *, char *, int *, char *, float *, float *,
                          float *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strstr(char *, char *);
void getMol2AtomTail(char *line, char *tail) {
  char buff[30];
  char anom[5];
  char snom[5];
  float f;
  int i;
  char *pC;
  sscanf(line, "%d %29s %f %f %f %5s", &i, buff, &f, &f, &f, anom);
  anom[5] = '\0';
  sprintf(snom, " %s ", anom);
  pC = strstr(line + 20, snom);
  if (pC != NULL)
    strcpy(tail, pC);
}


x86 assembly (clang, -O0):
<getMol2AtomTail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rcx
lea    -0x35(%rbp),%rax
lea    0xe9d(%rip),%rsi
lea    -0x44(%rbp),%rdx
lea    -0x40(%rbp),%r10
mov    %r10,%r8
mov    %r10,%r9
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1040 <sscanf@plt>
movb   $0x0,-0x30(%rbp)
lea    -0x3a(%rbp),%rdi
lea    -0x35(%rbp),%rdx
lea    0xe83(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x8(%rbp),%rdi
add    $0x14,%rdi
lea    -0x3a(%rbp),%rsi
call   1060 <strstr@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
je     11c4 <getMol2AtomTail+0x84>
mov    -0x10(%rbp),%rdi
mov    -0x50(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMol2AtomTail>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xb(%rsp),%r15
lea    0x14(%rsp),%r8
lea    0xe9e(%rip),%rsi
lea    0x10(%rsp),%rdx
lea    0x20(%rsp),%rcx
mov    %r8,%r9
push   %r15
push   %r8
call   1040 <sscanf@plt>
add    $0x10,%rsp
movb   $0x0,0x10(%rsp)
lea    0xe8d(%rip),%rsi
lea    0x1b(%rsp),%r12
mov    %r12,%rdi
mov    %r15,%rdx
call   1050 <sprintf@plt>
add    $0x14,%rbx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <strstr@plt>
test   %rax,%rax
je     11b7 <getMol2AtomTail+0x77>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%d %29s %f %f %f %5s\00"
@.str.1 = [5 x i8] c" %s \00"
define void @getMol2AtomTail(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [30 x i8]
%6 = alloca [5 x i8]
%7 = alloca [5 x i8]
%8 = alloca float
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%11 = load i8*, i8** %3
%12 = getelementptr inbounds [30 x i8], [30 x i8]* %5, i64 0, i64 0
%13 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%14 = call i32 @sscanf(i8* %11, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32* %9, i8* %12, float* %8, float* %8, float* %8, i8* %13)
%15 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 5
store i8 0, i8* %15
%16 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%17 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%18 = call i32 @sprintf(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 20
%21 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%22 = call i8* @strstr(i8* %20, i8* %21)
store i8* %22, i8** %10
%23 = load i8*, i8** %10
%24 = icmp ne i8* %23, null
br i1 %24, label %25, label %29
25: ; preds = %2
%26 = load i8*, i8** %4
%27 = load i8*, i8** %10
%28 = call i32 @strcpy(i8* %26, i8* %27)
br label %29
29: ; preds = %25, %2
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"%d %29s %f %f %f %5s\00"
@.str.1 = [5 x i8] c" %s \00"
define void @getMol2AtomTail(i8* %0, i8* %1) {
%3 = alloca [30 x i8]
%4 = alloca [5 x i8]
%5 = alloca [5 x i8]
%6 = alloca float
%7 = alloca i32
%8 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%11 = bitcast float* %6 to i8*
%12 = bitcast i32* %7 to i8*
%13 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32* %7, i8* %8, float* %6, float* %6, float* %6, i8* %9)
%14 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 5
store i8 0, i8* %14
%15 = call i32 @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%16 = getelementptr inbounds i8, i8* %0, i64 20
%17 = call i8* @strstr(i8* %16, i8* %10)
%18 = icmp eq i8* %17, null
br i1 %18, label %21, label %19
19: ; preds = %2
%20 = call i32 @strcpy(i8* %1, i8* %17)
br label %21
21: ; preds = %19, %2
ret void
}