#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 */
scalar_t__ strcmp(char *, char *);
scalar_t__ strlen(char *);
int is_path_excluded(char *path, char **excluded_paths) {
  int i = 0;
  while (strlen(excluded_paths[i]) > 0) {
    if (strcmp(path, excluded_paths[i]) == 0)
      return 1;
    i++;
  }
  return !1;
}


x86 assembly (clang, -O0):
<is_path_excluded>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jle    118b <is_path_excluded+0x6b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    117d <is_path_excluded+0x5d>
movl   $0x1,-0x4(%rbp)
jmp    1192 <is_path_excluded+0x72>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1137 <is_path_excluded+0x17>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_path_excluded>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r15
mov    (%rsi),%rbp
mov    %rbp,%rdi
call   1030 <strlen@plt>
xor    %r14d,%r14d
test   %rax,%rax
jle    117c <is_path_excluded+0x5c>
add    $0x8,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15,%rdi
mov    %rbp,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1176 <is_path_excluded+0x56>
mov    (%rbx),%rbp
mov    %rbp,%rdi
call   1030 <strlen@plt>
add    $0x8,%rbx
test   %rax,%rax
jg     1150 <is_path_excluded+0x30>
jmp    117c <is_path_excluded+0x5c>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_path_excluded(i8* %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %25, %2
%8 = load i8**, i8*** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %8, i64 %10
%12 = load i8*, i8** %11
%13 = call i64 @strlen(i8* %12)
%14 = icmp sgt i64 %13, 0
br i1 %14, label %15, label %28
15: ; preds = %7
%16 = load i8*, i8** %4
%17 = load i8**, i8*** %5
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8*, i8** %17, i64 %19
%21 = load i8*, i8** %20
%22 = call i64 @strcmp(i8* %16, i8* %21)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %15
store i32 1, i32* %3
br label %29
25: ; preds = %15
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %7
28: ; preds = %7
store i32 0, i32* %3
br label %29
29: ; preds = %28, %24
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @is_path_excluded(i8* %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %11, label %17
6: ; preds = %11
%7 = getelementptr inbounds i8*, i8** %1, i64 %16
%8 = load i8*, i8** %7
%9 = tail call i64 @strlen(i8* dereferenceable(1) %8)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %2, %6
%12 = phi i64 [ %16, %6 ], [ 0, %2 ]
%13 = phi i8* [ %8, %6 ], [ %3, %2 ]
%14 = tail call i64 @strcmp(i8* %0, i8* %13)
%15 = icmp eq i64 %14, 0
%16 = add nuw i64 %12, 1
br i1 %15, label %17, label %6
17: ; preds = %11, %6, %2
%18 = phi i32 [ 0, %2 ], [ 0, %6 ], [ 1, %11 ]
ret i32 %18
}