#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*/ entferne_Zwischenzeichen_aus_Fingerprint(char *, char *,
                                                            int);
int fingerprint_aus_Datei_auslesen(char *);
int /*<<< orphan*/ ldap_name_aus_Datei_auslesen(char *);
int /*<<< orphan*/ loesche_eindimensionale_Arrays(char *, char *, char *,
                                                  char *, char *);
int modifiziere_und_vergleiche_Namen(char *, char *, char *);
int /*<<< orphan*/ name_aus_Datei_auslesen(char *);
int /*<<< orphan*/ name_loggen(char *);
int /*<<< orphan*/ pgp_Befehle_aufrufen(char *);
int /*<<< orphan*/ signing_sh_anlegen(char *);
int /*<<< orphan*/ speichert_ldap_name_in_Datei(char *);
int testn_der_Dateien();
int vergleiche_fingerprint(char *, char *, int);
int main(int argc, char *argv[]) {
  char fingerprint[100], eigener_fingerprint[100];
  char name_unmodifiziert[100], gesamtname[100], ldap_name[100];
  int laenge = 0;
  char *id = argv[1];
  char *uid = argv[3];
  char *argv_fingerprint = argv[2];
  loesche_eindimensionale_Arrays(name_unmodifiziert, fingerprint,
                                 eigener_fingerprint, gesamtname, ldap_name);
  if (testn_der_Dateien() == 1)
    return 1;
  pgp_Befehle_aufrufen(id);
  speichert_ldap_name_in_Datei(uid);
  laenge = fingerprint_aus_Datei_auslesen(fingerprint);
  name_aus_Datei_auslesen(name_unmodifiziert);
  ldap_name_aus_Datei_auslesen(ldap_name);
  entferne_Zwischenzeichen_aus_Fingerprint(argv_fingerprint,
                                           eigener_fingerprint, laenge);
  if (vergleiche_fingerprint(fingerprint, eigener_fingerprint, laenge) == 3)
    return 3;
  if (modifiziere_und_vergleiche_Namen(ldap_name, gesamtname,
                                       name_unmodifiziert) < 2)
    return 2;
  signing_sh_anlegen(id);
  name_loggen(gesamtname);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x260,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x244(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x250(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x258(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x260(%rbp)
lea    -0x160(%rbp),%rdi
lea    -0x80(%rbp),%rsi
lea    -0xf0(%rbp),%rdx
lea    -0x1d0(%rbp),%rcx
lea    -0x240(%rbp),%r8
call   1060 <loesche_eindimensionale_Arrays@plt>
mov    $0x0,%al
call   10b0 <testn_der_Dateien@plt>
cmp    $0x1,%eax
jne    1251 <main+0x91>
movl   $0x1,-0x4(%rbp)
jmp    1322 <main+0x162>
mov    -0x250(%rbp),%rdi
call   10c0 <pgp_Befehle_aufrufen@plt>
mov    -0x258(%rbp),%rdi
call   10e0 <speichert_ldap_name_in_Datei@plt>
lea    -0x80(%rbp),%rdi
call   1050 <fingerprint_aus_Datei_auslesen@plt>
mov    %eax,-0x244(%rbp)
lea    -0x160(%rbp),%rdi
call   1080 <name_aus_Datei_auslesen@plt>
lea    -0x240(%rbp),%rdi
call   1030 <ldap_name_aus_Datei_auslesen@plt>
mov    -0x260(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
mov    -0x244(%rbp),%edx
call   1040 <entferne_Zwischenzeichen_aus_Fingerprint@plt>
lea    -0x80(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
mov    -0x244(%rbp),%edx
call   10d0 <vergleiche_fingerprint@plt>
cmp    $0x3,%eax
jne    12d4 <main+0x114>
movl   $0x3,-0x4(%rbp)
jmp    1322 <main+0x162>
lea    -0x240(%rbp),%rdi
lea    -0x1d0(%rbp),%rsi
lea    -0x160(%rbp),%rdx
call   1070 <modifiziere_und_vergleiche_Namen@plt>
cmp    $0x2,%eax
jge    1303 <main+0x143>
movl   $0x2,-0x4(%rbp)
jmp    1322 <main+0x162>
mov    -0x250(%rbp),%rdi
call   1090 <signing_sh_anlegen@plt>
lea    -0x1d0(%rbp),%rdi
call   10a0 <name_loggen@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x260,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x230,%rsp
mov    0x8(%rsi),%r14
mov    0x10(%rsi),%r15
mov    0x18(%rsi),%rbx
lea    0xe0(%rsp),%rdi
lea    0x1c0(%rsp),%rsi
lea    0x150(%rsp),%rdx
lea    0x70(%rsp),%rcx
mov    %rsp,%r8
call   1060 <loesche_eindimensionale_Arrays@plt>
xor    %eax,%eax
call   10b0 <testn_der_Dateien@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x1,%ecx
je     12b1 <main+0xf1>
mov    %r14,%rdi
call   10c0 <pgp_Befehle_aufrufen@plt>
mov    %rbx,%rdi
call   10e0 <speichert_ldap_name_in_Datei@plt>
lea    0x1c0(%rsp),%r12
mov    %r12,%rdi
call   1050 <fingerprint_aus_Datei_auslesen@plt>
mov    %eax,%ebp
lea    0xe0(%rsp),%rdi
call   1080 <name_aus_Datei_auslesen@plt>
mov    %rsp,%rdi
call   1030 <ldap_name_aus_Datei_auslesen@plt>
lea    0x150(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <entferne_Zwischenzeichen_aus_Fingerprint@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   10d0 <vergleiche_fingerprint@plt>
mov    %eax,%ecx
mov    $0x3,%eax
cmp    $0x3,%ecx
je     12b1 <main+0xf1>
mov    %rsp,%rdi
lea    0x70(%rsp),%rsi
lea    0xe0(%rsp),%rdx
call   1070 <modifiziere_und_vergleiche_Namen@plt>
mov    %eax,%ecx
mov    $0x2,%eax
cmp    $0x2,%ecx
jl     12b1 <main+0xf1>
mov    %r14,%rdi
call   1090 <signing_sh_anlegen@plt>
lea    0x70(%rsp),%rdi
call   10a0 <name_loggen@plt>
xor    %eax,%eax
add    $0x230,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
%7 = alloca [100 x i8]
%8 = alloca [100 x i8]
%9 = alloca [100 x i8]
%10 = alloca [100 x i8]
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %11
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
store i8* %17, i8** %12
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 3
%20 = load i8*, i8** %19
store i8* %20, i8** %13
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 2
%23 = load i8*, i8** %22
store i8* %23, i8** %14
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%29 = call i32 @loesche_eindimensionale_Arrays(i8* %24, i8* %25, i8* %26, i8* %27, i8* %28)
%30 = call i32 (...) @testn_der_Dateien()
%31 = icmp eq i32 %30, 1
br i1 %31, label %32, label %33
32: ; preds = %2
store i32 1, i32* %3
br label %66
33: ; preds = %2
%34 = load i8*, i8** %12
%35 = call i32 @pgp_Befehle_aufrufen(i8* %34)
%36 = load i8*, i8** %13
%37 = call i32 @speichert_ldap_name_in_Datei(i8* %36)
%38 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%39 = call i32 @fingerprint_aus_Datei_auslesen(i8* %38)
store i32 %39, i32* %11
%40 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%41 = call i32 @name_aus_Datei_auslesen(i8* %40)
%42 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%43 = call i32 @ldap_name_aus_Datei_auslesen(i8* %42)
%44 = load i8*, i8** %14
%45 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%46 = load i32, i32* %11
%47 = call i32 @entferne_Zwischenzeichen_aus_Fingerprint(i8* %44, i8* %45, i32 %46)
%48 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%49 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%50 = load i32, i32* %11
%51 = call i32 @vergleiche_fingerprint(i8* %48, i8* %49, i32 %50)
%52 = icmp eq i32 %51, 3
br i1 %52, label %53, label %54
53: ; preds = %33
store i32 3, i32* %3
br label %66
54: ; preds = %33
%55 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%56 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%57 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%58 = call i32 @modifiziere_und_vergleiche_Namen(i8* %55, i8* %56, i8* %57)
%59 = icmp slt i32 %58, 2
br i1 %59, label %60, label %61
60: ; preds = %54
store i32 2, i32* %3
br label %66
61: ; preds = %54
%62 = load i8*, i8** %12
%63 = call i32 @signing_sh_anlegen(i8* %62)
%64 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%65 = call i32 @name_loggen(i8* %64)
store i32 0, i32* %3
br label %66
66: ; preds = %61, %60, %53, %32
%67 = load i32, i32* %3
ret i32 %67
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = alloca [100 x i8]
%6 = alloca [100 x i8]
%7 = alloca [100 x i8]
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = getelementptr inbounds i8*, i8** %1, i64 3
%16 = load i8*, i8** %15
%17 = getelementptr inbounds i8*, i8** %1, i64 2
%18 = load i8*, i8** %17
%19 = call i32 @loesche_eindimensionale_Arrays(i8* %10, i8* %8, i8* %9, i8* %11, i8* %12)
%20 = call i32 (...) @testn_der_Dateien()
%21 = icmp eq i32 %20, 1
br i1 %21, label %37, label %22
22: ; preds = %2
%23 = call i32 @pgp_Befehle_aufrufen(i8* %14)
%24 = call i32 @speichert_ldap_name_in_Datei(i8* %16)
%25 = call i32 @fingerprint_aus_Datei_auslesen(i8* %8)
%26 = call i32 @name_aus_Datei_auslesen(i8* %10)
%27 = call i32 @ldap_name_aus_Datei_auslesen(i8* %12)
%28 = call i32 @entferne_Zwischenzeichen_aus_Fingerprint(i8* %18, i8* %9, i32 %25)
%29 = call i32 @vergleiche_fingerprint(i8* %8, i8* %9, i32 %25)
%30 = icmp eq i32 %29, 3
br i1 %30, label %37, label %31
31: ; preds = %22
%32 = call i32 @modifiziere_und_vergleiche_Namen(i8* %12, i8* %11, i8* %10)
%33 = icmp slt i32 %32, 2
br i1 %33, label %37, label %34
34: ; preds = %31
%35 = call i32 @signing_sh_anlegen(i8* %14)
%36 = call i32 @name_loggen(i8* %11)
br label %37
37: ; preds = %31, %22, %2, %34
%38 = phi i32 [ 0, %34 ], [ 1, %2 ], [ 3, %22 ], [ 2, %31 ]
ret i32 %38
}