#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 findeKnotenByName(struct Knoten *, int, char *, int);
int /*<<< orphan*/ findeWeg(struct Knoten *, int, int, int);
scalar_t__ isValidKnotenName(char *);
int Nav(struct Knoten *meineKnoten, int AnzahlKnoten, char *K1, char *K2) {
  if (isValidKnotenName(K2))
    return 1;
  if (isValidKnotenName(K1))
    return 1;
  int K1Nummer = findeKnotenByName(meineKnoten, AnzahlKnoten, K1, 1);
  int K2Nummer = findeKnotenByName(meineKnoten, AnzahlKnoten, K2, 1);
  if (K1Nummer != INT_MAX && K2Nummer != INT_MAX) {
    findeWeg(meineKnoten, AnzahlKnoten, K1Nummer, K2Nummer);
  } else {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<Nav>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <isValidKnotenName@plt>
cmp    $0x0,%rax
je     1166 <Nav+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1203 <Nav+0xd3>
mov    -0x20(%rbp),%rdi
call   1040 <isValidKnotenName@plt>
cmp    $0x0,%rax
je     1185 <Nav+0x55>
movl   $0x1,-0x4(%rbp)
jmp    1203 <Nav+0xd3>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    $0x1,%ecx
call   1050 <findeKnotenByName@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x28(%rbp),%rdx
mov    $0x1,%ecx
call   1050 <findeKnotenByName@plt>
mov    %eax,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
mov    0x2e29(%rip),%rcx
cmp    (%rcx),%eax
je     11f0 <Nav+0xc0>
mov    -0x30(%rbp),%eax
mov    0x2e17(%rip),%rcx
cmp    (%rcx),%eax
je     11f0 <Nav+0xc0>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x2c(%rbp),%edx
mov    -0x30(%rbp),%ecx
call   1030 <findeWeg@plt>
jmp    11fc <Nav+0xcc>
movl   $0x1,-0x4(%rbp)
jmp    1203 <Nav+0xd3>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Nav>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rcx,%rbx
mov    %rdx,%r12
mov    %esi,%r14d
mov    %rdi,%r15
mov    %rcx,%rdi
call   1040 <isValidKnotenName@plt>
mov    $0x1,%ebp
test   %rax,%rax
jne    11b5 <Nav+0x85>
mov    %r12,%rdi
call   1040 <isValidKnotenName@plt>
test   %rax,%rax
jne    11b5 <Nav+0x85>
mov    $0x1,%ebp
mov    %r15,%rdi
mov    %r14d,%esi
mov    %r12,%rdx
mov    $0x1,%ecx
call   1050 <findeKnotenByName@plt>
mov    %eax,%r12d
mov    %r15,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
mov    $0x1,%ecx
call   1050 <findeKnotenByName@plt>
mov    0x2e50(%rip),%rcx
mov    (%rcx),%ecx
cmp    %ecx,%r12d
je     11b5 <Nav+0x85>
cmp    %ecx,%eax
je     11b5 <Nav+0x85>
mov    %r15,%rdi
mov    %r14d,%esi
mov    %r12d,%edx
mov    %eax,%ecx
call   1030 <findeWeg@plt>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.Knoten = type { i32 }
@INT_MAX = global i32 0
define i32 @Nav(%struct.Knoten* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca %struct.Knoten*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
store %struct.Knoten* %0, %struct.Knoten** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
%12 = load i8*, i8** %9
%13 = call i64 @isValidKnotenName(i8* %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %4
store i32 1, i32* %5
br label %45
16: ; preds = %4
%17 = load i8*, i8** %8
%18 = call i64 @isValidKnotenName(i8* %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %5
br label %45
21: ; preds = %16
%22 = load %struct.Knoten*, %struct.Knoten** %6
%23 = load i32, i32* %7
%24 = load i8*, i8** %8
%25 = call i32 @findeKnotenByName(%struct.Knoten* %22, i32 %23, i8* %24, i32 1)
store i32 %25, i32* %10
%26 = load %struct.Knoten*, %struct.Knoten** %6
%27 = load i32, i32* %7
%28 = load i8*, i8** %9
%29 = call i32 @findeKnotenByName(%struct.Knoten* %26, i32 %27, i8* %28, i32 1)
store i32 %29, i32* %11
%30 = load i32, i32* %10
%31 = load i32, i32* @INT_MAX
%32 = icmp ne i32 %30, %31
br i1 %32, label %33, label %43
33: ; preds = %21
%34 = load i32, i32* %11
%35 = load i32, i32* @INT_MAX
%36 = icmp ne i32 %34, %35
br i1 %36, label %37, label %43
37: ; preds = %33
%38 = load %struct.Knoten*, %struct.Knoten** %6
%39 = load i32, i32* %7
%40 = load i32, i32* %10
%41 = load i32, i32* %11
%42 = call i32 @findeWeg(%struct.Knoten* %38, i32 %39, i32 %40, i32 %41)
br label %44
43: ; preds = %33, %21
store i32 1, i32* %5
br label %45
44: ; preds = %37
store i32 0, i32* %5
br label %45
45: ; preds = %44, %43, %20, %15
%46 = load i32, i32* %5
ret i32 %46
}

LLVM IR (-O2):
%struct.Knoten = type { i32 }
@INT_MAX = global i32 0
define i32 @Nav(%struct.Knoten* %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i64 @isValidKnotenName(i8* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = tail call i64 @isValidKnotenName(i8* %2)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = tail call i32 @findeKnotenByName(%struct.Knoten* %0, i32 %1, i8* %2, i32 1)
%12 = tail call i32 @findeKnotenByName(%struct.Knoten* %0, i32 %1, i8* %3, i32 1)
%13 = load i32, i32* @INT_MAX
%14 = icmp eq i32 %11, %13
%15 = icmp eq i32 %12, %13
%16 = select i1 %14, i1 true, i1 %15
br i1 %16, label %19, label %17
17: ; preds = %10
%18 = tail call i32 @findeWeg(%struct.Knoten* %0, i32 %1, i32 %11, i32 %12)
br label %19
19: ; preds = %17, %10, %7, %4
%20 = phi i32 [ 1, %4 ], [ 1, %7 ], [ 0, %17 ], [ 1, %10 ]
ret i32 %20
}