#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int strlen(char *);
int /*<<< orphan*/ *strstr(char *, char *);
void ifPathCorrect(char *path) {
  if (strstr(path, "//") != NULL ||
      (strlen(path) == 1 && strstr(path, "/") != NULL)) {
    printf("Error: incorrect path!\n");
    exit(0);
  }
}


x86 assembly (clang, -O0):
<ifPathCorrect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
jne    1192 <ifPathCorrect+0x52>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
jne    11a5 <ifPathCorrect+0x65>
mov    -0x8(%rbp),%rdi
lea    0xe7e(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     11a5 <ifPathCorrect+0x65>
lea    0xe6a(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ifPathCorrect>:
push   %rbx
mov    %rdi,%rbx
lea    0xea5(%rip),%rsi
call   1070 <strstr@plt>
test   %rax,%rax
jne    1186 <ifPathCorrect+0x36>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cmp    $0x1,%eax
jne    1184 <ifPathCorrect+0x34>
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1050 <strchr@plt>
test   %rax,%rax
jne    1186 <ifPathCorrect+0x36>
pop    %rbx
ret
lea    0xe76(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"//\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [24 x i8] c"Error: incorrect path!\0A\00"
define void @ifPathCorrect(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32* @strstr(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32* %4, null
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i8*, i8** %2
%12 = call i32* @strstr(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp ne i32* %12, null
br i1 %13, label %14, label %17
14: ; preds = %10, %1
%15 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @exit(i32 0)
unreachable
17: ; preds = %10, %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"//\00"
@str = [23 x i8] c"Error: incorrect path!\00"
define void @ifPathCorrect(i8* %0) {
%2 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 47)
%9 = icmp eq i8* %8, null
br i1 %9, label %13, label %10
10: ; preds = %7, %1
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @exit(i32 0)
unreachable
13: ; preds = %7, %4
ret void
}