#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*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ lksmith_get_ignored_frame_patterns(char ***, int *);
int /*<<< orphan*/ stderr;
int strcmp(char *, char *);
int check_ignored_frame_patterns(void) {
  char **ignored = 0;
  int num_ignored = 0;
  do {
    if ((0) != (lksmith_get_ignored_frame_patterns(&ignored, &num_ignored))) {
      fprintf(stderr, "failed on line %d: %s\n", 52, "0");
      return 1;
    }
  } while (0);
  ;
  do {
    if ((3) != (num_ignored)) {
      fprintf(stderr, "failed on line %d: %s\n", 53, "3");
      return 1;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = strcmp("*ignore1*", ignored[0]);
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 54,
              "strcmp(\"*ignore1*\", ignored[0])");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = strcmp("*ignore2*", ignored[1]);
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 55,
              "strcmp(\"*ignore2*\", ignored[1])");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = strcmp("*ignore3*", ignored[2]);
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 56,
              "strcmp(\"*ignore3*\", ignored[2])");
      return __my_ret__;
    }
  } while (0);
  ;
  return 0;
}


x86 assembly (clang, -O0):
<check_ignored_frame_patterns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <lksmith_get_ignored_frame_patterns@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     118d <check_ignored_frame_patterns+0x5d>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
mov    $0x34,%edx
lea    0xe9b(%rip),%rcx
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12e2 <check_ignored_frame_patterns+0x1b2>
jmp    1192 <check_ignored_frame_patterns+0x62>
jmp    1197 <check_ignored_frame_patterns+0x67>
mov    $0x3,%eax
cmp    -0x14(%rbp),%eax
je     11d2 <check_ignored_frame_patterns+0xa2>
mov    0x2e34(%rip),%rax
mov    (%rax),%edi
lea    0xe4b(%rip),%rsi
mov    $0x35,%edx
lea    0xe58(%rip),%rcx
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12e2 <check_ignored_frame_patterns+0x1b2>
jmp    11d7 <check_ignored_frame_patterns+0xa7>
jmp    11dc <check_ignored_frame_patterns+0xac>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe31(%rip),%rdi
call   1030 <strcmp@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1228 <check_ignored_frame_patterns+0xf8>
mov    0x2ddd(%rip),%rax
mov    (%rax),%edi
lea    0xdf4(%rip),%rsi
mov    $0x36,%edx
lea    0xe0d(%rip),%rcx
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    12e2 <check_ignored_frame_patterns+0x1b2>
jmp    122d <check_ignored_frame_patterns+0xfd>
jmp    1232 <check_ignored_frame_patterns+0x102>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe04(%rip),%rdi
call   1030 <strcmp@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     127f <check_ignored_frame_patterns+0x14f>
mov    0x2d86(%rip),%rax
mov    (%rax),%edi
lea    0xd9d(%rip),%rsi
mov    $0x37,%edx
lea    0xde0(%rip),%rcx
call   1040 <fprintf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    12e2 <check_ignored_frame_patterns+0x1b2>
jmp    1284 <check_ignored_frame_patterns+0x154>
jmp    1289 <check_ignored_frame_patterns+0x159>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xdd7(%rip),%rdi
call   1030 <strcmp@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     12d6 <check_ignored_frame_patterns+0x1a6>
mov    0x2d2f(%rip),%rax
mov    (%rax),%edi
lea    0xd46(%rip),%rsi
mov    $0x38,%edx
lea    0xdb3(%rip),%rcx
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    12e2 <check_ignored_frame_patterns+0x1b2>
jmp    12db <check_ignored_frame_patterns+0x1ab>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_ignored_frame_patterns>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1050 <lksmith_get_ignored_frame_patterns@plt>
test   %eax,%eax
je     1179 <check_ignored_frame_patterns+0x49>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    0xe95(%rip),%rsi
lea    0xea5(%rip),%rcx
mov    $0x34,%edx
jmp    11d7 <check_ignored_frame_patterns+0xa7>
cmpl   $0x3,0xc(%rsp)
jne    11bb <check_ignored_frame_patterns+0x8b>
mov    0x10(%rsp),%r14
mov    (%r14),%rsi
lea    0xe8c(%rip),%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11eb <check_ignored_frame_patterns+0xbb>
mov    %eax,%ebx
mov    0x2e3f(%rip),%rax
mov    (%rax),%edi
lea    0xe56(%rip),%rsi
lea    0xe74(%rip),%rcx
mov    $0x36,%edx
jmp    1251 <check_ignored_frame_patterns+0x121>
mov    0x2e1e(%rip),%rax
mov    (%rax),%edi
lea    0xe35(%rip),%rsi
lea    0xe47(%rip),%rcx
mov    $0x35,%edx
call   1040 <fprintf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret
mov    0x8(%r14),%rsi
lea    0xe4f(%rip),%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     121f <check_ignored_frame_patterns+0xef>
mov    %eax,%ebx
mov    0x2dd8(%rip),%rax
mov    (%rax),%edi
lea    0xdef(%rip),%rsi
lea    0xe37(%rip),%rcx
mov    $0x37,%edx
jmp    1251 <check_ignored_frame_patterns+0x121>
mov    0x10(%r14),%rsi
lea    0xe45(%rip),%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1258 <check_ignored_frame_patterns+0x128>
mov    %eax,%ebx
mov    0x2da4(%rip),%rax
mov    (%rax),%edi
lea    0xdbb(%rip),%rsi
lea    0xe2d(%rip),%rcx
mov    $0x38,%edx
call   1040 <fprintf@plt>
jmp    11e1 <check_ignored_frame_patterns+0xb1>
xor    %ebx,%ebx
jmp    11e1 <check_ignored_frame_patterns+0xb1>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"failed on line %d: %s\0A\00"
@.str.1 = [2 x i8] c"0\00"
@.str.2 = [2 x i8] c"3\00"
@.str.3 = [10 x i8] c"*ignore1*\00"
@.str.4 = [32 x i8] c"strcmp(\22*ignore1*\22, ignored[0])\00"
@.str.5 = [10 x i8] c"*ignore2*\00"
@.str.6 = [32 x i8] c"strcmp(\22*ignore2*\22, ignored[1])\00"
@.str.7 = [10 x i8] c"*ignore3*\00"
@.str.8 = [32 x i8] c"strcmp(\22*ignore3*\22, ignored[2])\00"
define i32 @check_ignored_frame_patterns() {
%1 = alloca i32
%2 = alloca i8**
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8** null, i8*** %2
store i32 0, i32* %3
br label %7
7: ; preds = %0
%8 = call i32 @lksmith_get_ignored_frame_patterns(i8*** %2, i32* %3)
%9 = icmp ne i32 0, %8
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 52, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %62
13: ; preds = %7
br label %14
14: ; preds = %13
br label %15
15: ; preds = %14
%16 = load i32, i32* %3
%17 = icmp ne i32 3, %16
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32, i32* @stderr
%20 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 53, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %1
br label %62
21: ; preds = %15
br label %22
22: ; preds = %21
br label %23
23: ; preds = %22
%24 = load i8**, i8*** %2
%25 = getelementptr inbounds i8*, i8** %24, i64 0
%26 = load i8*, i8** %25
%27 = call i32 @strcmp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %26)
store i32 %27, i32* %4
%28 = load i32, i32* %4
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %34
30: ; preds = %23
%31 = load i32, i32* @stderr
%32 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 54, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
%33 = load i32, i32* %4
store i32 %33, i32* %1
br label %62
34: ; preds = %23
br label %35
35: ; preds = %34
br label %36
36: ; preds = %35
%37 = load i8**, i8*** %2
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = call i32 @strcmp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* %39)
store i32 %40, i32* %5
%41 = load i32, i32* %5
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %47
43: ; preds = %36
%44 = load i32, i32* @stderr
%45 = call i32 @fprintf(i32 %44, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 55, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0))
%46 = load i32, i32* %5
store i32 %46, i32* %1
br label %62
47: ; preds = %36
br label %48
48: ; preds = %47
br label %49
49: ; preds = %48
%50 = load i8**, i8*** %2
%51 = getelementptr inbounds i8*, i8** %50, i64 2
%52 = load i8*, i8** %51
%53 = call i32 @strcmp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* %52)
store i32 %53, i32* %6
%54 = load i32, i32* %6
%55 = icmp ne i32 %54, 0
br i1 %55, label %56, label %60
56: ; preds = %49
%57 = load i32, i32* @stderr
%58 = call i32 @fprintf(i32 %57, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 56, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0))
%59 = load i32, i32* %6
store i32 %59, i32* %1
br label %62
60: ; preds = %49
br label %61
61: ; preds = %60
store i32 0, i32* %1
br label %62
62: ; preds = %61, %56, %43, %30, %18, %10
%63 = load i32, i32* %1
ret i32 %63
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"failed on line %d: %s\0A\00"
@.str.1 = [2 x i8] c"0\00"
@.str.2 = [2 x i8] c"3\00"
@.str.3 = [10 x i8] c"*ignore1*\00"
@.str.4 = [32 x i8] c"strcmp(\22*ignore1*\22, ignored[0])\00"
@.str.5 = [10 x i8] c"*ignore2*\00"
@.str.6 = [32 x i8] c"strcmp(\22*ignore2*\22, ignored[1])\00"
@.str.7 = [10 x i8] c"*ignore3*\00"
@.str.8 = [32 x i8] c"strcmp(\22*ignore3*\22, ignored[2])\00"
define i32 @check_ignored_frame_patterns() {
%1 = alloca i8**
%2 = alloca i32
%3 = bitcast i8*** %1 to i8*
store i8** null, i8*** %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @lksmith_get_ignored_frame_patterns(i8*** %1, i32* %2)
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %0
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 52, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %40
10: ; preds = %0
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 3
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 53, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %40
16: ; preds = %10
%17 = load i8**, i8*** %1
%18 = load i8*, i8** %17
%19 = call i32 @strcmp(i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* dereferenceable(1) %18)
%20 = icmp eq i32 %19, 0
br i1 %20, label %24, label %21
21: ; preds = %16
%22 = load i32, i32* @stderr
%23 = call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 54, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
br label %40
24: ; preds = %16
%25 = getelementptr inbounds i8*, i8** %17, i64 1
%26 = load i8*, i8** %25
%27 = call i32 @strcmp(i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* dereferenceable(1) %26)
%28 = icmp eq i32 %27, 0
br i1 %28, label %32, label %29
29: ; preds = %24
%30 = load i32, i32* @stderr
%31 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 55, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0))
br label %40
32: ; preds = %24
%33 = getelementptr inbounds i8*, i8** %17, i64 2
%34 = load i8*, i8** %33
%35 = call i32 @strcmp(i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* dereferenceable(1) %34)
%36 = icmp eq i32 %35, 0
br i1 %36, label %40, label %37
37: ; preds = %32
%38 = load i32, i32* @stderr
%39 = call i32 @fprintf(i32 %38, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 56, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0))
br label %40
40: ; preds = %37, %32, %29, %21, %13, %7
%41 = phi i32 [ 1, %7 ], [ 1, %13 ], [ %27, %29 ], [ %19, %21 ], [ 0, %32 ], [ %35, %37 ]
ret i32 %41
}