#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 /*<<< orphan*/ NewKreuz(struct Knoten *, int, char *, char *, char *,
                            char *, char *);
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 EditKreuz(struct Knoten *meineKnoten, int AnzahlKnoten, char *Kname,
              char *Aname1, char *Akm1, char *Aname2, char *Akm2) {
  if (isValidKnotenName(Kname))
    goto ReturnError;
  if (isValidAutobahnName(Aname1))
    goto ReturnError;
  if (isValidAutobahnKM(Akm1))
    goto ReturnError;
  if (isValidAutobahnName(Aname2))
    goto ReturnError;
  if (isValidAutobahnKM(Akm2))
    goto ReturnError;
  if (isNewInValid(meineKnoten, AnzahlKnoten, Kname, Aname1, Akm1, 1))
    goto ReturnError;
  if (isNewInValid(meineKnoten, AnzahlKnoten, Kname, Aname2, Akm2, 1))
    goto ReturnError;
  int ReturnValue = Remove(meineKnoten, AnzahlKnoten, Kname);
  if (ReturnValue != INT_MAX) {
    AnzahlKnoten = ReturnValue;
    NewKreuz(meineKnoten, AnzahlKnoten, Kname, Aname1, Akm1, Aname2, Akm2);
    goto ReturnSuccess;
  } else {
    printMenuHeaderContinous("  Kreuz Name nicht Gefunden   ");
    goto ReturnError;
  }
ReturnError:
  return INT_MAX;
ReturnSuccess:
  return AnzahlKnoten;
}


x86 assembly (clang, -O0):
<EditKreuz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x20(%rbp),%rdi
call   1080 <isValidKnotenName@plt>
cmp    $0x0,%rax
je     11ab <EditKreuz+0x3b>
jmp    12c5 <EditKreuz+0x155>
mov    -0x28(%rbp),%rdi
call   1070 <isValidAutobahnName@plt>
cmp    $0x0,%rax
je     11c3 <EditKreuz+0x53>
jmp    12c5 <EditKreuz+0x155>
mov    -0x30(%rbp),%rdi
call   1090 <isValidAutobahnKM@plt>
cmp    $0x0,%rax
je     11db <EditKreuz+0x6b>
jmp    12c5 <EditKreuz+0x155>
mov    -0x38(%rbp),%rdi
call   1070 <isValidAutobahnName@plt>
cmp    $0x0,%rax
je     11f3 <EditKreuz+0x83>
jmp    12c5 <EditKreuz+0x155>
mov    0x10(%rbp),%rdi
call   1090 <isValidAutobahnKM@plt>
cmp    $0x0,%rax
je     120b <EditKreuz+0x9b>
jmp    12c5 <EditKreuz+0x155>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    $0x1,%r9d
call   1050 <isNewInValid@plt>
cmp    $0x0,%rax
je     1238 <EditKreuz+0xc8>
jmp    12c5 <EditKreuz+0x155>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    0x10(%rbp),%r8
mov    $0x1,%r9d
call   1050 <isNewInValid@plt>
cmp    $0x0,%rax
je     1265 <EditKreuz+0xf5>
jmp    12c5 <EditKreuz+0x155>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1060 <Remove@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    0x2d66(%rip),%rcx
cmp    (%rcx),%eax
je     12b9 <EditKreuz+0x149>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <NewKreuz@plt>
jmp    12d6 <EditKreuz+0x166>
lea    0xd40(%rip),%rdi
call   1030 <printMenuHeaderContinous@plt>
mov    0x2d1c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12dc <EditKreuz+0x16c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EditKreuz>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%r13
mov    %rdx,%rdi
call   1080 <isValidKnotenName@plt>
test   %rax,%rax
jne    123f <EditKreuz+0xcf>
mov    %r12,%rdi
call   1070 <isValidAutobahnName@plt>
test   %rax,%rax
jne    123f <EditKreuz+0xcf>
mov    %r15,%rdi
call   1090 <isValidAutobahnKM@plt>
test   %rax,%rax
jne    123f <EditKreuz+0xcf>
mov    %r14,%rdi
call   1070 <isValidAutobahnName@plt>
test   %rax,%rax
jne    123f <EditKreuz+0xcf>
mov    0x40(%rsp),%rdi
call   1090 <isValidAutobahnKM@plt>
test   %rax,%rax
jne    123f <EditKreuz+0xcf>
mov    %r13,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %r12,%rcx
mov    %r15,%r8
mov    $0x1,%r9d
call   1050 <isNewInValid@plt>
test   %rax,%rax
jne    123f <EditKreuz+0xcf>
mov    %r13,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    0x40(%rsp),%r8
mov    $0x1,%r9d
call   1050 <isNewInValid@plt>
test   %rax,%rax
jne    123f <EditKreuz+0xcf>
mov    %r13,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1060 <Remove@plt>
mov    %eax,%ebp
mov    0x2db9(%rip),%rax
cmp    (%rax),%ebp
jne    1259 <EditKreuz+0xe9>
lea    0xdc6(%rip),%rdi
call   1030 <printMenuHeaderContinous@plt>
mov    0x2da2(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x40(%rsp),%rax
mov    %rax,(%rsp)
mov    %r13,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %r12,%rcx
mov    %r15,%r8
mov    %r14,%r9
call   1040 <NewKreuz@plt>
jmp    1248 <EditKreuz+0xd8>

LLVM IR (-O0):
%struct.Knoten = type { i32 }
@INT_MAX = global i32 0
@.str = [31 x i8] c" Kreuz Name nicht Gefunden \00"
define i32 @EditKreuz(%struct.Knoten* %0, i32 %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6) {
%8 = alloca i32
%9 = alloca %struct.Knoten*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i32
store %struct.Knoten* %0, %struct.Knoten** %9
store i32 %1, i32* %10
store i8* %2, i8** %11
store i8* %3, i8** %12
store i8* %4, i8** %13
store i8* %5, i8** %14
store i8* %6, i8** %15
%17 = load i8*, i8** %11
%18 = call i64 @isValidKnotenName(i8* %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %7
br label %79
21: ; preds = %7
%22 = load i8*, i8** %12
%23 = call i64 @isValidAutobahnName(i8* %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %21
br label %79
26: ; preds = %21
%27 = load i8*, i8** %13
%28 = call i64 @isValidAutobahnKM(i8* %27)
%29 = icmp ne i64 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %26
br label %79
31: ; preds = %26
%32 = load i8*, i8** %14
%33 = call i64 @isValidAutobahnName(i8* %32)
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %36
35: ; preds = %31
br label %79
36: ; preds = %31
%37 = load i8*, i8** %15
%38 = call i64 @isValidAutobahnKM(i8* %37)
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %36
br label %79
41: ; preds = %36
%42 = load %struct.Knoten*, %struct.Knoten** %9
%43 = load i32, i32* %10
%44 = load i8*, i8** %11
%45 = load i8*, i8** %12
%46 = load i8*, i8** %13
%47 = call i64 @isNewInValid(%struct.Knoten* %42, i32 %43, i8* %44, i8* %45, i8* %46, i32 1)
%48 = icmp ne i64 %47, 0
br i1 %48, label %49, label %50
49: ; preds = %41
br label %79
50: ; preds = %41
%51 = load %struct.Knoten*, %struct.Knoten** %9
%52 = load i32, i32* %10
%53 = load i8*, i8** %11
%54 = load i8*, i8** %14
%55 = load i8*, i8** %15
%56 = call i64 @isNewInValid(%struct.Knoten* %51, i32 %52, i8* %53, i8* %54, i8* %55, i32 1)
%57 = icmp ne i64 %56, 0
br i1 %57, label %58, label %59
58: ; preds = %50
br label %79
59: ; preds = %50
%60 = load %struct.Knoten*, %struct.Knoten** %9
%61 = load i32, i32* %10
%62 = load i8*, i8** %11
%63 = call i32 @Remove(%struct.Knoten* %60, i32 %61, i8* %62)
store i32 %63, i32* %16
%64 = load i32, i32* %16
%65 = load i32, i32* @INT_MAX
%66 = icmp ne i32 %64, %65
br i1 %66, label %67, label %77
67: ; preds = %59
%68 = load i32, i32* %16
store i32 %68, i32* %10
%69 = load %struct.Knoten*, %struct.Knoten** %9
%70 = load i32, i32* %10
%71 = load i8*, i8** %11
%72 = load i8*, i8** %12
%73 = load i8*, i8** %13
%74 = load i8*, i8** %14
%75 = load i8*, i8** %15
%76 = call i32 @NewKreuz(%struct.Knoten* %69, i32 %70, i8* %71, i8* %72, i8* %73, i8* %74, i8* %75)
br label %81
77: ; preds = %59
%78 = call i32 @printMenuHeaderContinous(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %79
79: ; preds = %77, %58, %49, %40, %35, %30, %25, %20
%80 = load i32, i32* @INT_MAX
store i32 %80, i32* %8
br label %83
81: ; preds = %67
%82 = load i32, i32* %10
store i32 %82, i32* %8
br label %83
83: ; preds = %81, %79
%84 = load i32, i32* %8
ret i32 %84
}

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