#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*/ calcMD5(char *);
int /*<<< orphan*/ count_cat(char *, char *, char *);
int /*<<< orphan*/ printf(char *, char *);
char *strcat(int /*<<< orphan*/, char *);
char *enc(char *pswd) {
  char pid[] = "1";
  char calg[] = "12345678";
  count_cat(pid, calg, pswd);
  printf("%s ", pid);
  printf("%s ", calg);
  printf("%s ", pswd);
  return strcat(calcMD5(pid), "123456781");
}


x86 assembly (clang, -O0):
<enc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xec2(%rip),%ax
mov    %ax,-0xa(%rbp)
mov    0xea2(%rip),%rax
mov    %rax,-0x13(%rbp)
mov    0xea0(%rip),%al
mov    %al,-0xb(%rbp)
lea    -0xa(%rbp),%rdi
lea    -0x13(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1050 <count_cat@plt>
lea    -0xa(%rbp),%rsi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
lea    -0x13(%rbp),%rsi
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
lea    -0xa(%rbp),%rdi
call   1040 <calcMD5@plt>
mov    %eax,%edi
lea    0xe4f(%rip),%rsi
call   1060 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enc>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
movw   $0x31,0x6(%rsp)
movabs $0x3837363534333231,%rax
36 37 38
mov    %rax,0x8(%rsp)
movb   $0x0,0x10(%rsp)
lea    0x6(%rsp),%r14
lea    0x8(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1050 <count_cat@plt>
lea    0xe81(%rip),%r12
mov    %r12,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %r14,%rdi
call   1040 <calcMD5@plt>
lea    0xe55(%rip),%rsi
mov    %eax,%edi
call   1060 <strcat@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.enc.pid = [2 x i8] c"1\00"
@__const.enc.calg = [9 x i8] c"12345678\00"
@.str = [4 x i8] c"%s \00"
@.str.1 = [10 x i8] c"123456781\00"
define i8* @enc(i8* %0) {
%2 = alloca i8*
%3 = alloca [2 x i8]
%4 = alloca [9 x i8]
store i8* %0, i8** %2
%5 = bitcast [2 x i8]* %3 to i8*
%6 = bitcast [9 x i8]* %4 to i8*
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%9 = load i8*, i8** %2
%10 = call i32 @count_cat(i8* %7, i8* %8, i8* %9)
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i8*, i8** %2
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%18 = call i32 @calcMD5(i8* %17)
%19 = call i8* @strcat(i32 %18, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret i8* %19
}

LLVM IR (-O2):
@__const.enc.calg = [9 x i8] c"12345678\00"
@.str = [4 x i8] c"%s \00"
@.str.1 = [10 x i8] c"123456781\00"
define i8* @enc(i8* %0) {
%2 = alloca i16
%3 = alloca [9 x i8]
%4 = bitcast i16* %2 to i8*
store i16 49, i16* %2
%5 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%6 = call i32 @count_cat(i8* %4, i8* %5, i8* %0)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%10 = call i32 @calcMD5(i8* %4)
%11 = call i8* @strcat(i32 %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret i8* %11
}