#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);
scalar_t__ isNewInValid(struct Knoten *, int, char *, char *, char *,
                        int /*<<< orphan*/);
scalar_t__ isValidAutobahnKM(char *);
scalar_t__ isValidAutobahnName(char *);
scalar_t__ isValidKnotenName(char *);
int NewKreuz(struct Knoten *meineKnoten, int AnzahlKnoten, char *Kname,
             char *Aname1, char *Akm1, char *Aname2, char *Akm2) {
  int NeueAnzahlKnoten = 0;
  if (isValidKnotenName(Kname))
    return INT_MAX;
  if (isValidAutobahnName(Aname1))
    return INT_MAX;
  if (isValidAutobahnName(Aname2))
    return INT_MAX;
  if (isValidAutobahnKM(Akm1))
    return INT_MAX;
  if (isValidAutobahnKM(Akm2))
    return INT_MAX;
  if (isNewInValid(meineKnoten, AnzahlKnoten, Kname, Aname1, Akm1, 0))
    return INT_MAX;
  if (isNewInValid(meineKnoten, AnzahlKnoten, Kname, Aname2, Akm2, 0))
    return INT_MAX;
  NeueAnzahlKnoten =
      NewAusfahrt(meineKnoten, AnzahlKnoten, Kname, Aname1, Akm1, 0);
  NeueAnzahlKnoten =
      NewAusfahrt(meineKnoten, NeueAnzahlKnoten, Kname, Aname2, Akm2, 1);
  return NeueAnzahlKnoten;
}


x86 assembly (clang, -O0):
<NewKreuz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%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)
movl   $0x0,-0x3c(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <isValidKnotenName@plt>
cmp    $0x0,%rax
je     119e <NewKreuz+0x4e>
mov    0x2e54(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12df <NewKreuz+0x18f>
mov    -0x28(%rbp),%rdi
call   1040 <isValidAutobahnName@plt>
cmp    $0x0,%rax
je     11c2 <NewKreuz+0x72>
mov    0x2e30(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12df <NewKreuz+0x18f>
mov    -0x38(%rbp),%rdi
call   1040 <isValidAutobahnName@plt>
cmp    $0x0,%rax
je     11e6 <NewKreuz+0x96>
mov    0x2e0c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12df <NewKreuz+0x18f>
mov    -0x30(%rbp),%rdi
call   1060 <isValidAutobahnKM@plt>
cmp    $0x0,%rax
je     120a <NewKreuz+0xba>
mov    0x2de8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12df <NewKreuz+0x18f>
mov    0x10(%rbp),%rdi
call   1060 <isValidAutobahnKM@plt>
cmp    $0x0,%rax
je     122e <NewKreuz+0xde>
mov    0x2dc4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12df <NewKreuz+0x18f>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
xor    %r9d,%r9d
call   1030 <isNewInValid@plt>
cmp    $0x0,%rax
je     1264 <NewKreuz+0x114>
mov    0x2d8e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12df <NewKreuz+0x18f>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    0x10(%rbp),%r8
xor    %r9d,%r9d
call   1030 <isNewInValid@plt>
cmp    $0x0,%rax
je     129a <NewKreuz+0x14a>
mov    0x2d58(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12df <NewKreuz+0x18f>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
xor    %r9d,%r9d
call   1070 <NewAusfahrt@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x3c(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    0x10(%rbp),%r8
mov    $0x1,%r9d
call   1070 <NewAusfahrt@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NewKreuz>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,0x20(%rsp)
mov    %r8,%r15
mov    %rcx,%rbx
mov    %rdx,%r13
mov    %esi,%ebp
mov    %rdi,%r14
mov    0x60(%rsp),%r12
mov    %rdx,%rdi
call   1050 <isValidKnotenName@plt>
test   %rax,%rax
jne    1225 <NewKreuz+0xd5>
mov    %r13,0x18(%rsp)
mov    %r15,0x8(%rsp)
mov    0x20(%rsp),%r13
mov    %r12,(%rsp)
mov    %rbx,%rdi
call   1040 <isValidAutobahnName@plt>
test   %rax,%rax
jne    1225 <NewKreuz+0xd5>
mov    %r13,%rdi
call   1040 <isValidAutobahnName@plt>
test   %rax,%rax
jne    1225 <NewKreuz+0xd5>
mov    0x8(%rsp),%r12
mov    %r12,%rdi
call   1060 <isValidAutobahnKM@plt>
test   %rax,%rax
jne    1225 <NewKreuz+0xd5>
mov    (%rsp),%rdi
call   1060 <isValidAutobahnKM@plt>
test   %rax,%rax
jne    1225 <NewKreuz+0xd5>
mov    %r12,%r8
mov    %r14,%r12
mov    %r14,%rdi
mov    %rbx,%r14
mov    %ebp,%r15d
mov    %ebp,%esi
mov    0x18(%rsp),%rbx
mov    %rbx,%rdx
mov    %r14,%rcx
xor    %r9d,%r9d
call   1030 <isNewInValid@plt>
test   %rax,%rax
jne    1225 <NewKreuz+0xd5>
mov    %r14,0x10(%rsp)
mov    %r12,%rdi
mov    %r15d,%esi
mov    %rbx,%rdx
mov    %r13,%r14
mov    %r13,%rcx
mov    (%rsp),%rbp
mov    %rbp,%r8
xor    %r9d,%r9d
call   1030 <isNewInValid@plt>
test   %rax,%rax
je     123d <NewKreuz+0xed>
mov    0x2dbc(%rip),%rax
mov    (%rax),%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r12,%rdi
mov    %r15d,%esi
mov    %rbx,%rdx
mov    0x10(%rsp),%rcx
mov    0x8(%rsp),%r8
xor    %r9d,%r9d
call   1070 <NewAusfahrt@plt>
mov    %r12,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %rbp,%r8
mov    $0x1,%r9d
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <NewAusfahrt@plt>

LLVM IR (-O0):
%struct.Knoten = type { i32 }
@INT_MAX = global i32 0
define i32 @NewKreuz(%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
store i32 0, i32* %16
%17 = load i8*, i8** %11
%18 = call i64 @isValidKnotenName(i8* %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %7
%21 = load i32, i32* @INT_MAX
store i32 %21, i32* %8
br label %80
22: ; preds = %7
%23 = load i8*, i8** %12
%24 = call i64 @isValidAutobahnName(i8* %23)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = load i32, i32* @INT_MAX
store i32 %27, i32* %8
br label %80
28: ; preds = %22
%29 = load i8*, i8** %14
%30 = call i64 @isValidAutobahnName(i8* %29)
%31 = icmp ne i64 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = load i32, i32* @INT_MAX
store i32 %33, i32* %8
br label %80
34: ; preds = %28
%35 = load i8*, i8** %13
%36 = call i64 @isValidAutobahnKM(i8* %35)
%37 = icmp ne i64 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = load i32, i32* @INT_MAX
store i32 %39, i32* %8
br label %80
40: ; preds = %34
%41 = load i8*, i8** %15
%42 = call i64 @isValidAutobahnKM(i8* %41)
%43 = icmp ne i64 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %40
%45 = load i32, i32* @INT_MAX
store i32 %45, i32* %8
br label %80
46: ; preds = %40
%47 = load %struct.Knoten*, %struct.Knoten** %9
%48 = load i32, i32* %10
%49 = load i8*, i8** %11
%50 = load i8*, i8** %12
%51 = load i8*, i8** %13
%52 = call i64 @isNewInValid(%struct.Knoten* %47, i32 %48, i8* %49, i8* %50, i8* %51, i32 0)
%53 = icmp ne i64 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %46
%55 = load i32, i32* @INT_MAX
store i32 %55, i32* %8
br label %80
56: ; preds = %46
%57 = load %struct.Knoten*, %struct.Knoten** %9
%58 = load i32, i32* %10
%59 = load i8*, i8** %11
%60 = load i8*, i8** %14
%61 = load i8*, i8** %15
%62 = call i64 @isNewInValid(%struct.Knoten* %57, i32 %58, i8* %59, i8* %60, i8* %61, i32 0)
%63 = icmp ne i64 %62, 0
br i1 %63, label %64, label %66
64: ; preds = %56
%65 = load i32, i32* @INT_MAX
store i32 %65, i32* %8
br label %80
66: ; preds = %56
%67 = load %struct.Knoten*, %struct.Knoten** %9
%68 = load i32, i32* %10
%69 = load i8*, i8** %11
%70 = load i8*, i8** %12
%71 = load i8*, i8** %13
%72 = call i32 @NewAusfahrt(%struct.Knoten* %67, i32 %68, i8* %69, i8* %70, i8* %71, i32 0)
store i32 %72, i32* %16
%73 = load %struct.Knoten*, %struct.Knoten** %9
%74 = load i32, i32* %16
%75 = load i8*, i8** %11
%76 = load i8*, i8** %14
%77 = load i8*, i8** %15
%78 = call i32 @NewAusfahrt(%struct.Knoten* %73, i32 %74, i8* %75, i8* %76, i8* %77, i32 1)
store i32 %78, i32* %16
%79 = load i32, i32* %16
store i32 %79, i32* %8
br label %80
80: ; preds = %66, %64, %54, %44, %38, %32, %26, %20
%81 = load i32, i32* %8
ret i32 %81
}

LLVM IR (-O2):
%struct.Knoten = type { i32 }
@INT_MAX = global i32 0
define i32 @NewKreuz(%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 %12, label %10
10: ; preds = %7
%11 = load i32, i32* @INT_MAX
br label %45
12: ; preds = %7
%13 = tail call i64 @isValidAutobahnName(i8* %3)
%14 = icmp eq i64 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = load i32, i32* @INT_MAX
br label %45
17: ; preds = %12
%18 = tail call i64 @isValidAutobahnName(i8* %5)
%19 = icmp eq i64 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = load i32, i32* @INT_MAX
br label %45
22: ; preds = %17
%23 = tail call i64 @isValidAutobahnKM(i8* %4)
%24 = icmp eq i64 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = load i32, i32* @INT_MAX
br label %45
27: ; preds = %22
%28 = tail call i64 @isValidAutobahnKM(i8* %6)
%29 = icmp eq i64 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %27
%31 = load i32, i32* @INT_MAX
br label %45
32: ; preds = %27
%33 = tail call i64 @isNewInValid(%struct.Knoten* %0, i32 %1, i8* %2, i8* %3, i8* %4, i32 0)
%34 = icmp eq i64 %33, 0
br i1 %34, label %37, label %35
35: ; preds = %32
%36 = load i32, i32* @INT_MAX
br label %45
37: ; preds = %32
%38 = tail call i64 @isNewInValid(%struct.Knoten* %0, i32 %1, i8* %2, i8* %5, i8* %6, i32 0)
%39 = icmp eq i64 %38, 0
br i1 %39, label %42, label %40
40: ; preds = %37
%41 = load i32, i32* @INT_MAX
br label %45
42: ; preds = %37
%43 = tail call i32 @NewAusfahrt(%struct.Knoten* %0, i32 %1, i8* %2, i8* %3, i8* %4, i32 0)
%44 = tail call i32 @NewAusfahrt(%struct.Knoten* %0, i32 %43, i8* %2, i8* %5, i8* %6, i32 1)
br label %45
45: ; preds = %42, %40, %35, %30, %25, %20, %15, %10
%46 = phi i32 [ %11, %10 ], [ %16, %15 ], [ %21, %20 ], [ %26, %25 ], [ %31, %30 ], [ %36, %35 ], [ %41, %40 ], [ %44, %42 ]
ret i32 %46
}