#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*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
char *strcat(int /*<<< orphan*/, char *);
int /*<<< orphan*/ write_en_pswd(char *, char *, char *);
int main(int argc, char *argv[]) {
  char pid[] = "1";
  char calg[] = "12345678";
  char *tes;
  if (argc != 3) {
    printf("Usage: %s [student num] [origin password]\n", argv[0]);
    exit(1);
  }
  count_cat(pid, calg, argv[2]);
  tes = strcat(calcMD5(pid), "123456781");
  write_en_pswd(argv[1], argv[2], strcat(calcMD5(pid), "123456781"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xebf(%rip),%ax
mov    %ax,-0x12(%rbp)
mov    0xe78(%rip),%rax
mov    %rax,-0x1b(%rbp)
mov    0xe76(%rip),%al
mov    %al,-0x13(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11bc <main+0x5c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe5c(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
lea    -0x12(%rbp),%rdi
lea    -0x1b(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
call   1060 <count_cat@plt>
lea    -0x12(%rbp),%rdi
call   1050 <calcMD5@plt>
mov    %eax,%edi
lea    0xe51(%rip),%rsi
call   1070 <strcat@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x30(%rbp)
lea    -0x12(%rbp),%rdi
call   1050 <calcMD5@plt>
mov    %eax,%edi
lea    0xe1e(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    %rax,%rdx
call   1030 <write_en_pswd@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
movw   $0x31,0x6(%rsp)
movabs $0x3837363534333231,%rax
36 37 38
mov    %rax,0x8(%rsp)
movb   $0x0,0x10(%rsp)
cmp    $0x3,%edi
jne    11f3 <main+0x93>
mov    0x10(%rbx),%rdx
lea    0x6(%rsp),%r14
lea    0x8(%rsp),%rsi
mov    %r14,%rdi
call   1060 <count_cat@plt>
mov    %r14,%rdi
call   1050 <calcMD5@plt>
lea    0xe81(%rip),%r15
mov    %eax,%edi
mov    %r15,%rsi
call   1070 <strcat@plt>
mov    0x8(%rbx),%r12
mov    0x10(%rbx),%rbx
mov    %r14,%rdi
call   1050 <calcMD5@plt>
mov    %eax,%edi
mov    %r15,%rsi
call   1070 <strcat@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <write_en_pswd@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
mov    (%rbx),%rsi
lea    0xe0c(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@__const.main.pid = [2 x i8] c"1\00"
@__const.main.calg = [9 x i8] c"12345678\00"
@.str = [43 x i8] c"Usage: %s [student num] [origin password]\0A\00"
@.str.1 = [10 x i8] c"123456781\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i8]
%7 = alloca [9 x i8]
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [2 x i8]* %6 to i8*
%10 = bitcast [9 x i8]* %7 to i8*
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 3
br i1 %12, label %13, label %19
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %2
%20 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%21 = getelementptr inbounds [9 x i8], [9 x i8]* %7, i64 0, i64 0
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 2
%24 = load i8*, i8** %23
%25 = call i32 @count_cat(i8* %20, i8* %21, i8* %24)
%26 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%27 = call i32 @calcMD5(i8* %26)
%28 = call i8* @strcat(i32 %27, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
store i8* %28, i8** %8
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 2
%34 = load i8*, i8** %33
%35 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%36 = call i32 @calcMD5(i8* %35)
%37 = call i8* @strcat(i32 %36, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%38 = call i32 @write_en_pswd(i8* %31, i8* %34, i8* %37)
ret i32 0
}

LLVM IR (-O2):
@__const.main.calg = [9 x i8] c"12345678\00"
@.str = [43 x i8] c"Usage: %s [student num] [origin password]\0A\00"
@.str.1 = [10 x i8] c"123456781\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i16
%4 = alloca [9 x i8]
%5 = bitcast i16* %3 to i8*
store i16 49, i16* %3
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%7 = icmp eq i32 %0, 3
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i8*, i8** %1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 2
%14 = load i8*, i8** %13
%15 = call i32 @count_cat(i8* %5, i8* %6, i8* %14)
%16 = call i32 @calcMD5(i8* %5)
%17 = call i8* @strcat(i32 %16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%18 = getelementptr inbounds i8*, i8** %1, i64 1
%19 = load i8*, i8** %18
%20 = load i8*, i8** %13
%21 = call i32 @calcMD5(i8* %5)
%22 = call i8* @strcat(i32 %21, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%23 = call i32 @write_en_pswd(i8* %19, i8* %20, i8* %22)
ret i32 0
}