#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 */
scalar_t__ toint(char);
long long PI_number(char fascn[40]) {
  int index;
  long long PI;
  PI = ((long long)toint(fascn[22]) * 1000000000);
  PI += ((long long)toint(fascn[23]) * 100000000);
  PI += ((long long)toint(fascn[24]) * 10000000);
  PI += ((long long)toint(fascn[25]) * 1000000);
  PI += ((long long)toint(fascn[26]) * 100000);
  PI += ((long long)toint(fascn[27]) * 10000);
  PI += ((long long)toint(fascn[28]) * 1000);
  PI += ((long long)toint(fascn[29]) * 100);
  PI += ((long long)toint(fascn[30]) * 10);
  PI += ((long long)toint(fascn[31]));
  return (PI);
}


x86 assembly (clang, -O0):
<PI_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x16(%rax),%edi
call   1030 <toint@plt>
imul   $0x3b9aca00,%rax,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x17(%rax),%edi
call   1030 <toint@plt>
imul   $0x5f5e100,%rax,%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x18(%rax),%edi
call   1030 <toint@plt>
imul   $0x989680,%rax,%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x19(%rax),%edi
call   1030 <toint@plt>
imul   $0xf4240,%rax,%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1a(%rax),%edi
call   1030 <toint@plt>
imul   $0x186a0,%rax,%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1b(%rax),%edi
call   1030 <toint@plt>
imul   $0x2710,%rax,%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1c(%rax),%edi
call   1030 <toint@plt>
imul   $0x3e8,%rax,%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1d(%rax),%edi
call   1030 <toint@plt>
imul   $0x64,%rax,%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1e(%rax),%edi
call   1030 <toint@plt>
imul   $0xa,%rax,%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1f(%rax),%edi
call   1030 <toint@plt>
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PI_number>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
movsbl 0x16(%rdi),%edi
call   1030 <toint@plt>
imul   $0x3b9aca00,%rax,%r14
movsbl 0x17(%r15),%edi
call   1030 <toint@plt>
imul   $0x5f5e100,%rax,%rbx
add    %r14,%rbx
movsbl 0x18(%r15),%edi
call   1030 <toint@plt>
imul   $0x989680,%rax,%r14
add    %rbx,%r14
movsbl 0x19(%r15),%edi
call   1030 <toint@plt>
imul   $0xf4240,%rax,%rbx
add    %r14,%rbx
movsbl 0x1a(%r15),%edi
call   1030 <toint@plt>
imul   $0x186a0,%rax,%r14
add    %rbx,%r14
movsbl 0x1b(%r15),%edi
call   1030 <toint@plt>
imul   $0x2710,%rax,%rbx
add    %r14,%rbx
movsbl 0x1c(%r15),%edi
call   1030 <toint@plt>
imul   $0x3e8,%rax,%r14
add    %rbx,%r14
movsbl 0x1d(%r15),%edi
call   1030 <toint@plt>
imul   $0x64,%rax,%rbx
add    %r14,%rbx
movsbl 0x1e(%r15),%edi
call   1030 <toint@plt>
lea    (%rax,%rax,4),%rax
lea    (%rbx,%rax,2),%rbx
movsbl 0x1f(%r15),%edi
call   1030 <toint@plt>
add    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @PI_number(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 22
%7 = load i8, i8* %6
%8 = call i64 @toint(i8 signext %7)
%9 = mul nsw i64 %8, 1000000000
store i64 %9, i64* %4
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 23
%12 = load i8, i8* %11
%13 = call i64 @toint(i8 signext %12)
%14 = mul nsw i64 %13, 100000000
%15 = load i64, i64* %4
%16 = add nsw i64 %15, %14
store i64 %16, i64* %4
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 24
%19 = load i8, i8* %18
%20 = call i64 @toint(i8 signext %19)
%21 = mul nsw i64 %20, 10000000
%22 = load i64, i64* %4
%23 = add nsw i64 %22, %21
store i64 %23, i64* %4
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 25
%26 = load i8, i8* %25
%27 = call i64 @toint(i8 signext %26)
%28 = mul nsw i64 %27, 1000000
%29 = load i64, i64* %4
%30 = add nsw i64 %29, %28
store i64 %30, i64* %4
%31 = load i8*, i8** %2
%32 = getelementptr inbounds i8, i8* %31, i64 26
%33 = load i8, i8* %32
%34 = call i64 @toint(i8 signext %33)
%35 = mul nsw i64 %34, 100000
%36 = load i64, i64* %4
%37 = add nsw i64 %36, %35
store i64 %37, i64* %4
%38 = load i8*, i8** %2
%39 = getelementptr inbounds i8, i8* %38, i64 27
%40 = load i8, i8* %39
%41 = call i64 @toint(i8 signext %40)
%42 = mul nsw i64 %41, 10000
%43 = load i64, i64* %4
%44 = add nsw i64 %43, %42
store i64 %44, i64* %4
%45 = load i8*, i8** %2
%46 = getelementptr inbounds i8, i8* %45, i64 28
%47 = load i8, i8* %46
%48 = call i64 @toint(i8 signext %47)
%49 = mul nsw i64 %48, 1000
%50 = load i64, i64* %4
%51 = add nsw i64 %50, %49
store i64 %51, i64* %4
%52 = load i8*, i8** %2
%53 = getelementptr inbounds i8, i8* %52, i64 29
%54 = load i8, i8* %53
%55 = call i64 @toint(i8 signext %54)
%56 = mul nsw i64 %55, 100
%57 = load i64, i64* %4
%58 = add nsw i64 %57, %56
store i64 %58, i64* %4
%59 = load i8*, i8** %2
%60 = getelementptr inbounds i8, i8* %59, i64 30
%61 = load i8, i8* %60
%62 = call i64 @toint(i8 signext %61)
%63 = mul nsw i64 %62, 10
%64 = load i64, i64* %4
%65 = add nsw i64 %64, %63
store i64 %65, i64* %4
%66 = load i8*, i8** %2
%67 = getelementptr inbounds i8, i8* %66, i64 31
%68 = load i8, i8* %67
%69 = call i64 @toint(i8 signext %68)
%70 = load i64, i64* %4
%71 = add nsw i64 %70, %69
store i64 %71, i64* %4
%72 = load i64, i64* %4
ret i64 %72
}

LLVM IR (-O2):
define i64 @PI_number(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 22
%3 = load i8, i8* %2
%4 = tail call i64 @toint(i8 signext %3)
%5 = mul nsw i64 %4, 1000000000
%6 = getelementptr inbounds i8, i8* %0, i64 23
%7 = load i8, i8* %6
%8 = tail call i64 @toint(i8 signext %7)
%9 = mul nsw i64 %8, 100000000
%10 = add nsw i64 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 24
%12 = load i8, i8* %11
%13 = tail call i64 @toint(i8 signext %12)
%14 = mul nsw i64 %13, 10000000
%15 = add nsw i64 %10, %14
%16 = getelementptr inbounds i8, i8* %0, i64 25
%17 = load i8, i8* %16
%18 = tail call i64 @toint(i8 signext %17)
%19 = mul nsw i64 %18, 1000000
%20 = add nsw i64 %15, %19
%21 = getelementptr inbounds i8, i8* %0, i64 26
%22 = load i8, i8* %21
%23 = tail call i64 @toint(i8 signext %22)
%24 = mul nsw i64 %23, 100000
%25 = add nsw i64 %20, %24
%26 = getelementptr inbounds i8, i8* %0, i64 27
%27 = load i8, i8* %26
%28 = tail call i64 @toint(i8 signext %27)
%29 = mul nsw i64 %28, 10000
%30 = add nsw i64 %25, %29
%31 = getelementptr inbounds i8, i8* %0, i64 28
%32 = load i8, i8* %31
%33 = tail call i64 @toint(i8 signext %32)
%34 = mul nsw i64 %33, 1000
%35 = add nsw i64 %30, %34
%36 = getelementptr inbounds i8, i8* %0, i64 29
%37 = load i8, i8* %36
%38 = tail call i64 @toint(i8 signext %37)
%39 = mul nsw i64 %38, 100
%40 = add nsw i64 %35, %39
%41 = getelementptr inbounds i8, i8* %0, i64 30
%42 = load i8, i8* %41
%43 = tail call i64 @toint(i8 signext %42)
%44 = mul nsw i64 %43, 10
%45 = add nsw i64 %40, %44
%46 = getelementptr inbounds i8, i8* %0, i64 31
%47 = load i8, i8* %46
%48 = tail call i64 @toint(i8 signext %47)
%49 = add nsw i64 %45, %48
ret i64 %49
}