#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 *);
int gui_buffer_property_in_list(char *properties[], char *property) {
  int i;
  if (!properties || !property)
    return 0;
  for (i = 0; properties[i]; i++) {
    if (strcmp(properties[i], property) == 0)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<gui_buffer_property_in_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <gui_buffer_property_in_list+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <gui_buffer_property_in_list+0x32>
movl   $0x0,-0x4(%rbp)
jmp    11a1 <gui_buffer_property_in_list+0x91>
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     119a <gui_buffer_property_in_list+0x8a>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1187 <gui_buffer_property_in_list+0x77>
movl   $0x1,-0x4(%rbp)
jmp    11a1 <gui_buffer_property_in_list+0x91>
jmp    118c <gui_buffer_property_in_list+0x7c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1149 <gui_buffer_property_in_list+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_buffer_property_in_list>:
push   %rbp
push   %r14
push   %rbx
xor    %r14d,%r14d
test   %rdi,%rdi
je     1162 <gui_buffer_property_in_list+0x52>
mov    %rsi,%rbx
test   %rsi,%rsi
je     1162 <gui_buffer_property_in_list+0x52>
mov    %rdi,%rbp
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1162 <gui_buffer_property_in_list+0x52>
add    $0x8,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     115c <gui_buffer_property_in_list+0x4c>
mov    0x0(%rbp),%rdi
add    $0x8,%rbp
test   %rdi,%rdi
jne    1140 <gui_buffer_property_in_list+0x30>
jmp    1162 <gui_buffer_property_in_list+0x52>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @gui_buffer_property_in_list(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
%7 = load i8**, i8*** %4
%8 = icmp ne i8** %7, null
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %13, label %12
12: ; preds = %9, %2
store i32 0, i32* %3
br label %36
13: ; preds = %9
store i32 0, i32* %6
br label %14
14: ; preds = %32, %13
%15 = load i8**, i8*** %4
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
%19 = load i8*, i8** %18
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %35
21: ; preds = %14
%22 = load i8**, i8*** %4
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %22, i64 %24
%26 = load i8*, i8** %25
%27 = load i8*, i8** %5
%28 = call i64 @strcmp(i8* %26, i8* %27)
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %21
store i32 1, i32* %3
br label %36
31: ; preds = %21
br label %32
32: ; preds = %31
%33 = load i32, i32* %6
%34 = add nsw i32 %33, 1
store i32 %34, i32* %6
br label %14
35: ; preds = %14
store i32 0, i32* %3
br label %36
36: ; preds = %35, %30, %12
%37 = load i32, i32* %3
ret i32 %37
}

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