#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*/ DES_ENCRYPT;
int /*<<< orphan*/ DES_ecb(char *, char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void main(int argc, char **argv) {
  char acOutPut[50] = {0};
  char *pcInPut = argv[1];
  if (argc < 2) {
    printf("Useage: desstamac.exe fc-64-ba-6f-04-1b\n");
    return;
  }
  DES_ecb(acOutPut, pcInPut, "12345678", DES_ENCRYPT);
  printf("BeforeEncrypt: %s\nAfterEncrypt: %s\n", pcInPut, acOutPut);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x58(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1178 <main+0x48>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ab <main+0x7b>
lea    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    0x2e59(%rip),%rax
mov    (%rax),%ecx
lea    0xe99(%rip),%rdx
call   1050 <DES_ecb@plt>
mov    -0x58(%rbp),%rsi
lea    -0x50(%rbp),%rdx
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movw   $0x0,0x30(%rsp)
cmp    $0x1,%edi
jg     1167 <main+0x37>
lea    0xed2(%rip),%rdi
add    $0x38,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>
mov    0x8(%rsi),%rbx
mov    0x2e6e(%rip),%rax
mov    (%rax),%ecx
lea    0xe85(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <DES_ecb@plt>
lea    0xe79(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Useage: desstamac.exe fc-64-ba-6f-04-1b\0A\00"
@.str.1 = [9 x i8] c"12345678\00"
@DES_ENCRYPT = global i32 0
@.str.2 = [36 x i8] c"BeforeEncrypt: %s\0AAfterEncrypt: %s\0A\00"
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [50 x i8]
%6 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = bitcast [50 x i8]* %5 to i8*
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
store i8* %10, i8** %6
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 2
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %23
15: ; preds = %2
%16 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%17 = load i8*, i8** %6
%18 = load i32, i32* @DES_ENCRYPT
%19 = call i32 @DES_ecb(i8* %16, i8* %17, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = load i8*, i8** %6
%21 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %20, i8* %21)
br label %23
23: ; preds = %15, %13
ret void
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"12345678\00"
@DES_ENCRYPT = global i32 0
@.str.2 = [36 x i8] c"BeforeEncrypt: %s\0AAfterEncrypt: %s\0A\00"
@str = [40 x i8] c"Useage: desstamac.exe fc-64-ba-6f-04-1b\00"
define void @main(i32 %0, i8** nocapture %1) {
%3 = alloca [50 x i8]
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = icmp slt i32 %0, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
br label %14
10: ; preds = %2
%11 = load i32, i32* @DES_ENCRYPT
%12 = call i32 @DES_ecb(i8* %4, i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %6, i8* %4)
br label %14
14: ; preds = %10, %8
ret void
}