#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*/ fprintf(int /*<<< orphan*/, char *, char);
int /*<<< orphan*/ stdout;
void asciiAlgorithm(char *buffer, char *bufferAscii) {
  unsigned long int N = 0x00000000;
  for (int i = 0; i < 4; i++) {
    N = N << 8;
    N = buffer[i] | N;
  }
  for (int j = 4; j >= 0; j--) {
    bufferAscii[j] = N % 85;
    bufferAscii[j] += 33;
    N = N / 85;
  }
  for (int i = 0; i < 5; i++) {
    fprintf(stdout, "%c", bufferAscii[i]);
  }
}


x86 assembly (clang, -O0):
<asciiAlgorithm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    1168 <asciiAlgorithm+0x58>
mov    -0x18(%rbp),%rax
shl    $0x8,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbq (%rax,%rcx,1),%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112f <asciiAlgorithm+0x1f>
movl   $0x4,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jl     11c4 <asciiAlgorithm+0xb4>
mov    -0x18(%rbp),%rax
mov    $0x55,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
add    $0x21,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    $0x55,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
jmp    116f <asciiAlgorithm+0x5f>
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    1204 <asciiAlgorithm+0xf4>
mov    0x2e04(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
lea    0xe13(%rip),%rsi
movsbl (%rax,%rcx,1),%edx
call   1030 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11cb <asciiAlgorithm+0xbb>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asciiAlgorithm>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
movsbq (%rdi),%rax
movsbq 0x1(%rdi),%rdx
shl    $0x10,%rax
shl    $0x8,%rdx
or     %rax,%rdx
movsbq 0x2(%rdi),%rcx
or     %rdx,%rcx
shl    $0x8,%rcx
movsbl 0x3(%rdi),%eax
movslq %eax,%rbx
or     %rbx,%rcx
movabs $0xc0c0c0c0c0c0c0c1,%r8
c0 c0 c0
mov    %rcx,%rax
mul    %r8
mov    %rdx,%rdi
mov    %rsi,%r12
shr    $0x6,%rdi
imul   $0x55,%edi,%eax
sub    %eax,%ebx
add    $0x21,%bl
mov    %bl,0x4(%rsi)
mov    %rdi,%rax
mul    %r8
shr    $0x6,%edx
imul   $0x55,%edx,%eax
sub    %eax,%edi
add    $0x21,%dil
mov    %dil,0x3(%rsi)
movabs $0x22436485a6c7e90b,%rdx
64 43 22
mov    %rcx,%rax
mul    %rdx
mov    %rcx,%rsi
sub    %rdx,%rsi
shr    %rsi
add    %rdx,%rsi
shr    $0xc,%rsi
mov    %rsi,%rax
mul    %r8
shr    $0x6,%edx
imul   $0x55,%edx,%eax
sub    %eax,%esi
movabs $0xda8d187cb9cfbe87,%rdx
18 8d da
mov    %rcx,%rax
mul    %rdx
mov    %rdx,%rdi
add    $0x21,%sil
shr    $0x13,%rdi
mov    %rdi,%rax
mul    %r8
mov    %sil,0x2(%r12)
shr    $0x6,%edx
imul   $0x55,%edx,%eax
sub    %eax,%edi
add    $0x21,%dil
movabs $0xa48e60be49a57459,%rdx
60 8e a4
mov    %rcx,%rax
mul    %rdx
mov    %rdx,%rcx
mov    %dil,0x1(%r12)
shr    $0x19,%rcx
mov    %rcx,%rax
mul    %r8
shr    $0x6,%edx
imul   $0x55,%edx,%eax
sub    %eax,%ecx
add    $0x21,%cl
mov    %cl,(%r12)
mov    0x2dcb(%rip),%r15
mov    (%r15),%edi
movsbl %cl,%edx
lea    0xdde(%rip),%r14
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
movsbl 0x1(%r12),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
movsbl 0x2(%r12),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
movsbl 0x3(%r12),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
movsbl 0x4(%r12),%edx
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [3 x i8] c"%c\00"
define void @asciiAlgorithm(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i64 0, i64* %5
store i32 0, i32* %6
br label %9
9: ; preds = %23, %2
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 4
br i1 %11, label %12, label %26
12: ; preds = %9
%13 = load i64, i64* %5
%14 = shl i64 %13, 8
store i64 %14, i64* %5
%15 = load i8*, i8** %3
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i64
%21 = load i64, i64* %5
%22 = or i64 %20, %21
store i64 %22, i64* %5
br label %23
23: ; preds = %12
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %9
26: ; preds = %9
store i32 4, i32* %7
br label %27
27: ; preds = %48, %26
%28 = load i32, i32* %7
%29 = icmp sge i32 %28, 0
br i1 %29, label %30, label %51
30: ; preds = %27
%31 = load i64, i64* %5
%32 = urem i64 %31, 85
%33 = trunc i64 %32 to i8
%34 = load i8*, i8** %4
%35 = load i32, i32* %7
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %34, i64 %36
store i8 %33, i8* %37
%38 = load i8*, i8** %4
%39 = load i32, i32* %7
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8, i8* %38, i64 %40
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = add nsw i32 %43, 33
%45 = trunc i32 %44 to i8
store i8 %45, i8* %41
%46 = load i64, i64* %5
%47 = udiv i64 %46, 85
store i64 %47, i64* %5
br label %48
48: ; preds = %30
%49 = load i32, i32* %7
%50 = add nsw i32 %49, -1
store i32 %50, i32* %7
br label %27
51: ; preds = %27
store i32 0, i32* %8
br label %52
52: ; preds = %63, %51
%53 = load i32, i32* %8
%54 = icmp slt i32 %53, 5
br i1 %54, label %55, label %66
55: ; preds = %52
%56 = load i32, i32* @stdout
%57 = load i8*, i8** %4
%58 = load i32, i32* %8
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i8, i8* %57, i64 %59
%61 = load i8, i8* %60
%62 = call i32 @fprintf(i32 %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %61)
br label %63
63: ; preds = %55
%64 = load i32, i32* %8
%65 = add nsw i32 %64, 1
store i32 %65, i32* %8
br label %52
66: ; preds = %52
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"%c\00"
define void @asciiAlgorithm(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i64
%8 = shl nsw i64 %4, 16
%9 = shl nsw i64 %7, 8
%10 = or i64 %8, %9
%11 = getelementptr inbounds i8, i8* %0, i64 2
%12 = load i8, i8* %11
%13 = sext i8 %12 to i64
%14 = or i64 %10, %13
%15 = shl nsw i64 %14, 8
%16 = getelementptr inbounds i8, i8* %0, i64 3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i64
%19 = or i64 %15, %18
%20 = urem i64 %19, 85
%21 = trunc i64 %20 to i8
%22 = getelementptr inbounds i8, i8* %1, i64 4
%23 = add nuw nsw i8 %21, 33
store i8 %23, i8* %22
%24 = udiv i64 %19, 85
%25 = urem i64 %24, 85
%26 = trunc i64 %25 to i8
%27 = getelementptr inbounds i8, i8* %1, i64 3
%28 = add nuw nsw i8 %26, 33
store i8 %28, i8* %27
%29 = udiv i64 %19, 7225
%30 = urem i64 %29, 85
%31 = trunc i64 %30 to i8
%32 = getelementptr inbounds i8, i8* %1, i64 2
%33 = add nuw nsw i8 %31, 33
store i8 %33, i8* %32
%34 = udiv i64 %19, 614125
%35 = urem i64 %34, 85
%36 = trunc i64 %35 to i8
%37 = getelementptr inbounds i8, i8* %1, i64 1
%38 = add nuw nsw i8 %36, 33
store i8 %38, i8* %37
%39 = udiv i64 %19, 52200625
%40 = urem i64 %39, 85
%41 = trunc i64 %40 to i8
%42 = add nuw nsw i8 %41, 33
store i8 %42, i8* %1
%43 = load i32, i32* @stdout
%44 = tail call i32 @fprintf(i32 %43, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %42)
%45 = load i32, i32* @stdout
%46 = load i8, i8* %37
%47 = tail call i32 @fprintf(i32 %45, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %46)
%48 = load i32, i32* @stdout
%49 = load i8, i8* %32
%50 = tail call i32 @fprintf(i32 %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %49)
%51 = load i32, i32* @stdout
%52 = load i8, i8* %27
%53 = tail call i32 @fprintf(i32 %51, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %52)
%54 = load i32, i32* @stdout
%55 = load i8, i8* %22
%56 = tail call i32 @fprintf(i32 %54, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %55)
ret void
}