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


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

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

LLVM IR (-O0):
define i8* @DecimalToCharA(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
%4 = alloca i8*
store i64* %0, i64** %2
%5 = call i8* @malloc(i32 4)
store i8* %5, i8** %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 i64*, i64** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i64, i64* %10, i64 %12
%14 = load i64, i64* %13
%15 = call signext i8 @Find_CharA(i64 %14)
%16 = load i8*, i8** %4
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 %15, i8* %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 i8*, i8** %4
ret i8* %24
}

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