#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 */
struct Knoten {
  int dummy;
};

/* Variables and functions */
int INT_MAX;
int NewAusfahrt(struct Knoten *, int, char *, char *, char *,
                int /*<<< orphan*/);
int Remove(struct Knoten *, int, char *);
scalar_t__ isNewInValid(struct Knoten *, int, char *, char *, char *, int);
scalar_t__ isValidAutobahnKM(char *);
scalar_t__ isValidAutobahnName(char *);
scalar_t__ isValidKnotenName(char *);
int /*<<< orphan*/ printMenuHeaderContinous(char *);
int EditAusfahrt(struct Knoten *meineKnoten, int AnzahlKnoten, char *Kname,
                 char *Aname, char *Akm) {
  int NeueAnzahlKnoten = AnzahlKnoten;
  if (isValidKnotenName(Kname))
    goto ReturnError;
  if (isValidAutobahnName(Aname))
    goto ReturnError;
  if (isValidAutobahnKM(Akm))
    goto ReturnError;
  if (isNewInValid(meineKnoten, AnzahlKnoten, Kname, Aname, Akm, 1))
    goto ReturnError;
  int ReturnValue = Remove(meineKnoten, AnzahlKnoten, Kname);
  if (ReturnValue != INT_MAX) {
    NeueAnzahlKnoten = ReturnValue;
    NeueAnzahlKnoten =
        NewAusfahrt(meineKnoten, NeueAnzahlKnoten, Kname, Aname, Akm, 0);
    goto ReturnSuccess;
  } else {
    printMenuHeaderContinous("      Ausfahrt nicht Gefunden      ");
    goto ReturnError;
  }
ReturnError:
  return INT_MAX;
ReturnSuccess:
  return NeueAnzahlKnoten;
}


x86 assembly (clang, -O0):
<EditAusfahrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x20(%rbp),%rdi
call   1070 <isValidKnotenName@plt>
cmp    $0x0,%rax
je     11a9 <EditAusfahrt+0x39>
jmp    1260 <EditAusfahrt+0xf0>
mov    -0x28(%rbp),%rdi
call   1060 <isValidAutobahnName@plt>
cmp    $0x0,%rax
je     11c1 <EditAusfahrt+0x51>
jmp    1260 <EditAusfahrt+0xf0>
mov    -0x30(%rbp),%rdi
call   1080 <isValidAutobahnKM@plt>
cmp    $0x0,%rax
je     11d9 <EditAusfahrt+0x69>
jmp    1260 <EditAusfahrt+0xf0>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    $0x1,%r9d
call   1040 <isNewInValid@plt>
cmp    $0x0,%rax
je     1206 <EditAusfahrt+0x96>
jmp    1260 <EditAusfahrt+0xf0>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1050 <Remove@plt>
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    0x2dc5(%rip),%rcx
cmp    (%rcx),%eax
je     1254 <EditAusfahrt+0xe4>
mov    -0x38(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
xor    %r9d,%r9d
call   1090 <NewAusfahrt@plt>
mov    %eax,-0x34(%rbp)
jmp    1271 <EditAusfahrt+0x101>
lea    0xda5(%rip),%rdi
call   1030 <printMenuHeaderContinous@plt>
mov    0x2d81(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1277 <EditAusfahrt+0x107>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EditAusfahrt>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%r12
mov    %rdx,%rdi
call   1070 <isValidKnotenName@plt>
test   %rax,%rax
jne    11ef <EditAusfahrt+0x7f>
mov    %r15,%rdi
call   1060 <isValidAutobahnName@plt>
test   %rax,%rax
jne    11ef <EditAusfahrt+0x7f>
mov    %r14,%rdi
call   1080 <isValidAutobahnKM@plt>
test   %rax,%rax
jne    11ef <EditAusfahrt+0x7f>
mov    %r12,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %r15,%rcx
mov    %r14,%r8
mov    $0x1,%r9d
call   1040 <isNewInValid@plt>
test   %rax,%rax
jne    11ef <EditAusfahrt+0x7f>
mov    %r12,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1050 <Remove@plt>
mov    0x2e09(%rip),%rcx
cmp    (%rcx),%eax
jne    1201 <EditAusfahrt+0x91>
lea    0xe16(%rip),%rdi
call   1030 <printMenuHeaderContinous@plt>
mov    0x2df2(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r12,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
mov    %r15,%rcx
mov    %r14,%r8
xor    %r9d,%r9d
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1090 <NewAusfahrt@plt>

LLVM IR (-O0):
%struct.Knoten = type { i32 }
@INT_MAX = global i32 0
@.str = [36 x i8] c" Ausfahrt nicht Gefunden \00"
define i32 @EditAusfahrt(%struct.Knoten* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i32
%7 = alloca %struct.Knoten*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
store %struct.Knoten* %0, %struct.Knoten** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
%14 = load i32, i32* %8
store i32 %14, i32* %12
%15 = load i8*, i8** %9
%16 = call i64 @isValidKnotenName(i8* %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %5
br label %56
19: ; preds = %5
%20 = load i8*, i8** %10
%21 = call i64 @isValidAutobahnName(i8* %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %19
br label %56
24: ; preds = %19
%25 = load i8*, i8** %11
%26 = call i64 @isValidAutobahnKM(i8* %25)
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %24
br label %56
29: ; preds = %24
%30 = load %struct.Knoten*, %struct.Knoten** %7
%31 = load i32, i32* %8
%32 = load i8*, i8** %9
%33 = load i8*, i8** %10
%34 = load i8*, i8** %11
%35 = call i64 @isNewInValid(%struct.Knoten* %30, i32 %31, i8* %32, i8* %33, i8* %34, i32 1)
%36 = icmp ne i64 %35, 0
br i1 %36, label %37, label %38
37: ; preds = %29
br label %56
38: ; preds = %29
%39 = load %struct.Knoten*, %struct.Knoten** %7
%40 = load i32, i32* %8
%41 = load i8*, i8** %9
%42 = call i32 @Remove(%struct.Knoten* %39, i32 %40, i8* %41)
store i32 %42, i32* %13
%43 = load i32, i32* %13
%44 = load i32, i32* @INT_MAX
%45 = icmp ne i32 %43, %44
br i1 %45, label %46, label %54
46: ; preds = %38
%47 = load i32, i32* %13
store i32 %47, i32* %12
%48 = load %struct.Knoten*, %struct.Knoten** %7
%49 = load i32, i32* %12
%50 = load i8*, i8** %9
%51 = load i8*, i8** %10
%52 = load i8*, i8** %11
%53 = call i32 @NewAusfahrt(%struct.Knoten* %48, i32 %49, i8* %50, i8* %51, i8* %52, i32 0)
store i32 %53, i32* %12
br label %58
54: ; preds = %38
%55 = call i32 @printMenuHeaderContinous(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %56
56: ; preds = %54, %37, %28, %23, %18
%57 = load i32, i32* @INT_MAX
store i32 %57, i32* %6
br label %60
58: ; preds = %46
%59 = load i32, i32* %12
store i32 %59, i32* %6
br label %60
60: ; preds = %58, %56
%61 = load i32, i32* %6
ret i32 %61
}

LLVM IR (-O2):
%struct.Knoten = type { i32 }
@INT_MAX = global i32 0
@.str = [36 x i8] c" Ausfahrt nicht Gefunden \00"
define i32 @EditAusfahrt(%struct.Knoten* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = tail call i64 @isValidKnotenName(i8* %2)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %25
8: ; preds = %5
%9 = tail call i64 @isValidAutobahnName(i8* %3)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %25
11: ; preds = %8
%12 = tail call i64 @isValidAutobahnKM(i8* %4)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %25
14: ; preds = %11
%15 = tail call i64 @isNewInValid(%struct.Knoten* %0, i32 %1, i8* %2, i8* %3, i8* %4, i32 1)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %25
17: ; preds = %14
%18 = tail call i32 @Remove(%struct.Knoten* %0, i32 %1, i8* %2)
%19 = load i32, i32* @INT_MAX
%20 = icmp eq i32 %18, %19
br i1 %20, label %23, label %21
21: ; preds = %17
%22 = tail call i32 @NewAusfahrt(%struct.Knoten* %0, i32 %18, i8* %2, i8* %3, i8* %4, i32 0)
br label %27
23: ; preds = %17
%24 = tail call i32 @printMenuHeaderContinous(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %25
25: ; preds = %14, %11, %8, %5, %23
%26 = load i32, i32* @INT_MAX
br label %27
27: ; preds = %21, %25
%28 = phi i32 [ %26, %25 ], [ %22, %21 ]
ret i32 %28
}