#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__ memcmp(char const *, char const *, size_t);
int find_full_match(const char *s, size_t l, const char **list) {
  while (*list) {
    if (memcmp(s, *list, l) == 0)
      return 1;
    list++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<find_full_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
je     116d <find_full_match+0x5d>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
jne    115c <find_full_match+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1174 <find_full_match+0x64>
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
jmp    1124 <find_full_match+0x14>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_full_match>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r15
mov    (%rdx),%rsi
xor    %r14d,%r14d
test   %rsi,%rsi
je     1154 <find_full_match+0x44>
mov    %rdx,%rbx
mov    %rdi,%rbp
add    $0x8,%rbx
nop
mov    %rbp,%rdi
mov    %r15,%rdx
call   1030 <memcmp@plt>
test   %rax,%rax
je     114e <find_full_match+0x3e>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1130 <find_full_match+0x20>
jmp    1154 <find_full_match+0x44>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @find_full_match(i8* %0, i64 %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8**
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8** %2, i8*** %7
br label %8
8: ; preds = %20, %3
%9 = load i8**, i8*** %7
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load i8*, i8** %5
%14 = load i8**, i8*** %7
%15 = load i8*, i8** %14
%16 = load i64, i64* %6
%17 = call i64 @memcmp(i8* %13, i8* %15, i64 %16)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %12
store i32 1, i32* %4
br label %24
20: ; preds = %12
%21 = load i8**, i8*** %7
%22 = getelementptr inbounds i8*, i8** %21, i32 1
store i8** %22, i8*** %7
br label %8
23: ; preds = %8
store i32 0, i32* %4
br label %24
24: ; preds = %23, %19
%25 = load i32, i32* %4
ret i32 %25
}

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