#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*/ *mutt_stristr(char const *, char const *);
int pgpring_string_matches_hint(const char *s, const char *hints[],
                                int nhints) {
  int i;
  if (!hints || !nhints)
    return 1;
  for (i = 0; i < nhints; i++) {
    if (mutt_stristr(s, hints[i]) != NULL)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<pgpring_string_matches_hint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1138 <pgpring_string_matches_hint+0x28>
cmpl   $0x0,-0x1c(%rbp)
jne    1144 <pgpring_string_matches_hint+0x34>
movl   $0x1,-0x4(%rbp)
jmp    119c <pgpring_string_matches_hint+0x8c>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1195 <pgpring_string_matches_hint+0x85>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <mutt_stristr@plt>
cmp    $0x0,%rax
je     1182 <pgpring_string_matches_hint+0x72>
movl   $0x1,-0x4(%rbp)
jmp    119c <pgpring_string_matches_hint+0x8c>
jmp    1187 <pgpring_string_matches_hint+0x77>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    114b <pgpring_string_matches_hint+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pgpring_string_matches_hint>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    $0x1,%r14d
test   %rsi,%rsi
je     115d <pgpring_string_matches_hint+0x4d>
test   %edx,%edx
je     115d <pgpring_string_matches_hint+0x4d>
jle    115a <pgpring_string_matches_hint+0x4a>
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx,%rbp,8),%rsi
mov    %r15,%rdi
call   1030 <mutt_stristr@plt>
test   %rax,%rax
jne    115d <pgpring_string_matches_hint+0x4d>
add    $0x1,%rbp
cmp    %rbp,%r12
jne    1140 <pgpring_string_matches_hint+0x30>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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