#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 */
typedef int /*<<< orphan*/ piBuff;

/* Variables and functions */
int /*<<< orphan*/ Code_MIME(unsigned char *, int, unsigned char *, int *);
int /*<<< orphan*/ DCode_MIME(unsigned char *, int, unsigned char *, int *);
int /*<<< orphan*/ printf(char *, unsigned char *, unsigned char *,
                          unsigned char *);
int main(int argc, char *argv[]) {
  unsigned char pBuff[1024] = {0};
  unsigned char pUBuff[1024] = {0};
  int Len = 0x0;
  unsigned char piBuff[] = "";
  Code_MIME(piBuff, sizeof(piBuff), pBuff, &Len);
  DCode_MIME(pBuff, Len, pUBuff, &Len);
  printf("B C s = %s\r\nA C s = %s\r\nA D s = %s\r\n", piBuff, pBuff, pUBuff);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1050 <memset@plt>
lea    -0x810(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1050 <memset@plt>
movl   $0x0,-0x814(%rbp)
lea    -0x815(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1050 <memset@plt>
lea    -0x815(%rbp),%rdi
lea    -0x410(%rbp),%rdx
mov    $0x1,%esi
lea    -0x814(%rbp),%rcx
call   1060 <Code_MIME@plt>
lea    -0x410(%rbp),%rdi
mov    -0x814(%rbp),%esi
lea    -0x810(%rbp),%rdx
lea    -0x814(%rbp),%rcx
call   1030 <DCode_MIME@plt>
lea    -0x815(%rbp),%rsi
lea    -0x410(%rbp),%rdx
lea    -0x810(%rbp),%rcx
lea    0xe09(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x818,%rsp
lea    0x410(%rsp),%r12
mov    $0x400,%edx
mov    %r12,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
lea    0x10(%rsp),%r14
mov    $0x400,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
movl   $0x0,0xc(%rsp)
movb   $0x0,0xb(%rsp)
lea    0xb(%rsp),%r15
lea    0xc(%rsp),%rbx
mov    %r15,%rdi
mov    $0x1,%esi
mov    %r12,%rdx
mov    %rbx,%rcx
call   1060 <Code_MIME@plt>
mov    0xc(%rsp),%esi
mov    %r12,%rdi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1030 <DCode_MIME@plt>
lea    0xe44(%rip),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x818,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [37 x i8] c"B C s = %s\0D\0AA C s = %s\0D\0AA D s = %s\0D\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1024 x i8]
%7 = alloca [1024 x i8]
%8 = alloca i32
%9 = alloca [1 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = bitcast [1024 x i8]* %6 to i8*
%11 = bitcast [1024 x i8]* %7 to i8*
store i32 0, i32* %8
%12 = bitcast [1 x i8]* %9 to i8*
%13 = getelementptr inbounds [1 x i8], [1 x i8]* %9, i64 0, i64 0
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%15 = call i32 @Code_MIME(i8* %13, i32 1, i8* %14, i32* %8)
%16 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%17 = load i32, i32* %8
%18 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%19 = call i32 @DCode_MIME(i8* %16, i32 %17, i8* %18, i32* %8)
%20 = getelementptr inbounds [1 x i8], [1 x i8]* %9, i64 0, i64 0
%21 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%22 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%23 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %20, i8* %21, i8* %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"B C s = %s\0D\0AA C s = %s\0D\0AA D s = %s\0D\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1024 x i8]
%4 = alloca [1024 x i8]
%5 = alloca i32
%6 = alloca [1 x i8]
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%9 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%10 = getelementptr inbounds [1 x i8], [1 x i8]* %6, i64 0, i64 0
store i8 0, i8* %10
%11 = call i32 @Code_MIME(i8* %10, i32 1, i8* %7, i32* %5)
%12 = load i32, i32* %5
%13 = call i32 @DCode_MIME(i8* %7, i32 %12, i8* %8, i32* %5)
%14 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %7, i8* %8)
ret i32 0
}