#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*/ tmp;

/* Variables and functions */
int /*<<< orphan*/ base64_md5(char *);
int /*<<< orphan*/ printf(char *, char *, char const *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char const *, char *);
void gen_acs(const char serial[]) {
  char tmp[64];
  printf("\n\n  ACS Username : %s-%s", "001349", serial);
  snprintf(tmp, sizeof(tmp), "%s-%s%s", "001349", serial, "0Z1y2X");
  base64_md5(tmp);
}


x86 assembly (clang, -O0):
<gen_acs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xeb9(%rip),%rdi
lea    0xecb(%rip),%rsi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%r8
mov    $0x40,%esi
lea    0xeb9(%rip),%rdx
lea    0xeab(%rip),%rcx
lea    0xeb3(%rip),%r9
call   1040 <snprintf@plt>
lea    -0x50(%rbp),%rdi
call   1050 <base64_md5@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_acs>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rbx
lea    0xebd(%rip),%rdi
lea    0xecf(%rip),%r14
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
lea    0xec4(%rip),%rdx
lea    0xec5(%rip),%r9
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x40,%esi
mov    %r14,%rcx
mov    %rbx,%r8
call   1040 <snprintf@plt>
mov    %r15,%rdi
call   1050 <base64_md5@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\0A\0A ACS Username : %s-%s\00"
@.str.1 = [7 x i8] c"001349\00"
@.str.2 = [8 x i8] c"%s-%s%s\00"
@.str.3 = [7 x i8] c"0Z1y2X\00"
define void @gen_acs(i8* %0) {
%2 = alloca i8*
%3 = alloca [64 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @snprintf(i8* %6, i32 64, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%10 = call i32 @base64_md5(i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"\0A\0A ACS Username : %s-%s\00"
@.str.1 = [7 x i8] c"001349\00"
@.str.2 = [8 x i8] c"%s-%s%s\00"
@.str.3 = [7 x i8] c"0Z1y2X\00"
define void @gen_acs(i8* %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = call i32 @snprintf(i8* %3, i32 64, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @base64_md5(i8* %3)
ret void
}