#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
struct TYPE_3__ {
  scalar_t__ rem;
  int /*<<< orphan*/ quot;
};
typedef TYPE_1__ div_t;

/* Variables and functions */
TYPE_1__ div(int /*<<< orphan*/, int);
void Base85_CodificarTexto(uint32_t aux, uint8_t *coded) {
  int i;
  div_t output;
  for (i = 0; i < 5; i++) {
    output = div(aux, 85);
    aux = output.quot;
    coded[i] = (output.rem + 33);
  }
}


x86 assembly (clang, -O0):
<Base85_CodificarTexto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    117c <Base85_CodificarTexto+0x6c>
mov    -0x4(%rbp),%edi
mov    $0x55,%esi
call   1030 <div@plt>
mov    %rax,-0x38(%rbp)
mov    %edx,-0x30(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x28(%rbp),%rdx
add    $0x21,%rdx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <Base85_CodificarTexto+0x16>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Base85_CodificarTexto>:
push   %rbx
mov    %rsi,%rbx
mov    $0x55,%esi
call   1030 <div@plt>
mov    %edx,%edi
add    $0x21,%rax
mov    %rax,(%rbx)
mov    $0x55,%esi
call   1030 <div@plt>
mov    %edx,%edi
add    $0x21,%rax
mov    %rax,0x8(%rbx)
mov    $0x55,%esi
call   1030 <div@plt>
mov    %edx,%edi
add    $0x21,%rax
mov    %rax,0x10(%rbx)
mov    $0x55,%esi
call   1030 <div@plt>
mov    %edx,%edi
add    $0x21,%rax
mov    %rax,0x18(%rbx)
mov    $0x55,%esi
call   1030 <div@plt>
add    $0x21,%rax
mov    %rax,0x20(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i32 }
define void @Base85_CodificarTexto(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
%6 = alloca %struct.TYPE_3__
%7 = alloca %struct.TYPE_3__
store i32 %0, i32* %3
store i64* %1, i64** %4
store i32 0, i32* %5
br label %8
8: ; preds = %30, %2
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 5
br i1 %10, label %11, label %33
11: ; preds = %8
%12 = load i32, i32* %3
%13 = call { i64, i32 } @div(i32 %12, i32 85)
%14 = bitcast %struct.TYPE_3__* %7 to { i64, i32 }*
%15 = getelementptr inbounds { i64, i32 }, { i64, i32 }* %14, i32 0, i32 0
%16 = extractvalue { i64, i32 } %13, 0
store i64 %16, i64* %15
%17 = getelementptr inbounds { i64, i32 }, { i64, i32 }* %14, i32 0, i32 1
%18 = extractvalue { i64, i32 } %13, 1
store i32 %18, i32* %17
%19 = bitcast %struct.TYPE_3__* %6 to i8*
%20 = bitcast %struct.TYPE_3__* %7 to i8*
%21 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 1
%22 = load i32, i32* %21
store i32 %22, i32* %3
%23 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 0
%24 = load i64, i64* %23
%25 = add nsw i64 %24, 33
%26 = load i64*, i64** %4
%27 = load i32, i32* %5
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i64, i64* %26, i64 %28
store i64 %25, i64* %29
br label %30
30: ; preds = %11
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
store i32 %32, i32* %5
br label %8
33: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @Base85_CodificarTexto(i32 %0, i64* nocapture writeonly %1) {
%3 = tail call { i64, i32 } @div(i32 %0, i32 85)
%4 = extractvalue { i64, i32 } %3, 0
%5 = extractvalue { i64, i32 } %3, 1
%6 = add nsw i64 %4, 33
store i64 %6, i64* %1
%7 = tail call { i64, i32 } @div(i32 %5, i32 85)
%8 = extractvalue { i64, i32 } %7, 0
%9 = extractvalue { i64, i32 } %7, 1
%10 = add nsw i64 %8, 33
%11 = getelementptr inbounds i64, i64* %1, i64 1
store i64 %10, i64* %11
%12 = tail call { i64, i32 } @div(i32 %9, i32 85)
%13 = extractvalue { i64, i32 } %12, 0
%14 = extractvalue { i64, i32 } %12, 1
%15 = add nsw i64 %13, 33
%16 = getelementptr inbounds i64, i64* %1, i64 2
store i64 %15, i64* %16
%17 = tail call { i64, i32 } @div(i32 %14, i32 85)
%18 = extractvalue { i64, i32 } %17, 0
%19 = extractvalue { i64, i32 } %17, 1
%20 = add nsw i64 %18, 33
%21 = getelementptr inbounds i64, i64* %1, i64 3
store i64 %20, i64* %21
%22 = tail call { i64, i32 } @div(i32 %19, i32 85)
%23 = extractvalue { i64, i32 } %22, 0
%24 = add nsw i64 %23, 33
%25 = getelementptr inbounds i64, i64* %1, i64 4
store i64 %24, i64* %25
ret void
}