#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 */
long Find_DecimalA(char);
long *malloc(int);
long *CharToDecimalA(char *M) {
  int i;
  long *m = malloc(4 * sizeof(long));
  for (i = 0; i < 4; ++i) {
    m[i] = Find_DecimalA(M[i]);
  }
  return m;
}


x86 assembly (clang, -O0):
<CharToDecimalA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x20,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1179 <CharToDecimalA+0x59>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <Find_DecimalA@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1141 <CharToDecimalA+0x21>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CharToDecimalA>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x20,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
movsbl (%r14),%edi
call   1040 <Find_DecimalA@plt>
mov    %rax,(%rbx)
movsbl 0x1(%r14),%edi
call   1040 <Find_DecimalA@plt>
mov    %rax,0x8(%rbx)
movsbl 0x2(%r14),%edi
call   1040 <Find_DecimalA@plt>
mov    %rax,0x10(%rbx)
movsbl 0x3(%r14),%edi
call   1040 <Find_DecimalA@plt>
mov    %rax,0x18(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64* @CharToDecimalA(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64*
store i8* %0, i8** %2
%5 = call i64* @malloc(i32 32)
store i64* %5, i64** %4
store i32 0, i32* %3
br label %6
6: ; preds = %20, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = call i64 @Find_DecimalA(i8 signext %14)
%16 = load i64*, i64** %4
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i64, i64* %16, i64 %18
store i64 %15, i64* %19
br label %20
20: ; preds = %9
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %6
23: ; preds = %6
%24 = load i64*, i64** %4
ret i64* %24
}

LLVM IR (-O2):
define noalias i64* @CharToDecimalA(i8* nocapture %0) {
%2 = tail call i64* @malloc(i32 32)
%3 = load i8, i8* %0
%4 = tail call i64 @Find_DecimalA(i8 signext %3)
store i64 %4, i64* %2
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = tail call i64 @Find_DecimalA(i8 signext %6)
%8 = getelementptr inbounds i64, i64* %2, i64 1
store i64 %7, i64* %8
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = tail call i64 @Find_DecimalA(i8 signext %10)
%12 = getelementptr inbounds i64, i64* %2, i64 2
store i64 %11, i64* %12
%13 = getelementptr inbounds i8, i8* %0, i64 3
%14 = load i8, i8* %13
%15 = tail call i64 @Find_DecimalA(i8 signext %14)
%16 = getelementptr inbounds i64, i64* %2, i64 3
store i64 %15, i64* %16
ret i64* %2
}