#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*/ aesbase64encrypt(unsigned char *, unsigned char *,
                                    unsigned char **);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, unsigned char *);
int main() {
  unsigned char *ddata = "{Type:\"1\",ToUserId:\"04f69a0e-e468 - 464e-8c0e - "
                         "a30fc00b37d7\",Amount:\"10\",Number:\"1\",Desc:"
                         "\"¹§Ï²·¢²Æ£¡\",PayPwd:\"123456\"}";
  unsigned char *out = NULL;
  unsigned char *key = "A0B5C2D4E7F90301";
  int n;
  aesbase64encrypt(ddata, key, &out);
  printf("out: %s\n", out);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    0xf29(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <aesbase64encrypt@plt>
mov    -0x18(%rbp),%rsi
lea    0xf1a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
lea    0xec0(%rip),%rdi
lea    0xf3b(%rip),%rsi
mov    %rsp,%rdx
call   1050 <aesbase64encrypt@plt>
mov    (%rsp),%rsi
lea    0xf39(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [130 x i8] c"{Type:\221\22,ToUserId:\2204f69a0e-e468 - 464e-8c0e - a30fc00b37d7\22,Amount:\2210\22,Number:\221\22,Desc:\22\C2\B9\C2\A7\C3\8F\C2\B2\C2\B7\C2\A2\C2\B2\C3\86\C2\A3\C2\A1\22,PayPwd:\22123456\22}\00"
@.str.1 = [17 x i8] c"A0B5C2D4E7F90301\00"
@.str.2 = [9 x i8] c"out: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* null, i8** %3
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8** %4
%6 = load i8*, i8** %2
%7 = load i8*, i8** %4
%8 = call i32 @aesbase64encrypt(i8* %6, i8* %7, i8** %3)
%9 = load i8*, i8** %3
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%11 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [130 x i8] c"{Type:\221\22,ToUserId:\2204f69a0e-e468 - 464e-8c0e - a30fc00b37d7\22,Amount:\2210\22,Number:\221\22,Desc:\22\C2\B9\C2\A7\C3\8F\C2\B2\C2\B7\C2\A2\C2\B2\C3\86\C2\A3\C2\A1\22,PayPwd:\22123456\22}\00"
@.str.1 = [17 x i8] c"A0B5C2D4E7F90301\00"
@.str.2 = [9 x i8] c"out: %s\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%3 = call i32 @aesbase64encrypt(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8** %1)
%4 = load i8*, i8** %1
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @getchar()
ret i32 0
}