#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*/ sscanf(char *, char *, int *, char **, float *, float *,
                          float *, char **, int *);
void getMol2ResChainIde(char *line, char *chn) {
  int i, id = 0;
  char c[30];
  float f;
  sscanf(line, "%d %s %f %f %f %s %d", &i, &c, &f, &f, &f, &c, &id);
  *chn = '0' + (id % 10);
}


x86 assembly (clang, -O0):
<getMol2ResChainIde>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rcx
lea    -0x40(%rbp),%r10
lea    0xec6(%rip),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x44(%rbp),%r11
lea    -0x18(%rbp),%rax
mov    %r11,%r8
mov    %r11,%r9
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <sscanf@plt>
mov    -0x18(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMol2ResChainIde>:
push   %rbx
sub    $0x30,%rsp
mov    %rsi,%rbx
movl   $0x0,0x4(%rsp)
sub    $0x8,%rsp
lea    0xc(%rsp),%rax
lea    0x18(%rsp),%rcx
lea    0x10(%rsp),%r8
lea    0xec6(%rip),%rsi
lea    0x14(%rsp),%rdx
mov    %r8,%r9
push   %rax
push   %rcx
push   %r8
call   1030 <sscanf@plt>
add    $0x20,%rsp
movslq 0x4(%rsp),%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
add    $0x30,%al
mov    %al,(%rbx)
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%d %s %f %f %f %s %d\00"
define void @getMol2ResChainIde(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca [30 x i8]
%8 = alloca float
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %6
%9 = load i8*, i8** %3
%10 = bitcast [30 x i8]* %7 to i8**
%11 = bitcast [30 x i8]* %7 to i8**
%12 = call i32 @sscanf(i8* %9, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32* %5, i8** %10, float* %8, float* %8, float* %8, i8** %11, i32* %6)
%13 = load i32, i32* %6
%14 = srem i32 %13, 10
%15 = add nsw i32 48, %14
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %4
store i8 %16, i8* %17
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"%d %s %f %f %f %s %d\00"
define void @getMol2ResChainIde(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [30 x i8]
%6 = alloca float
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%9 = getelementptr inbounds [30 x i8], [30 x i8]* %5, i64 0, i64 0
%10 = bitcast float* %6 to i8*
%11 = bitcast [30 x i8]* %5 to i8**
%12 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32* %3, i8** %11, float* %6, float* %6, float* %6, i8** %11, i32* %4)
%13 = load i32, i32* %4
%14 = srem i32 %13, 10
%15 = trunc i32 %14 to i8
%16 = add nsw i8 %15, 48
store i8 %16, i8* %1
ret void
}