#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 */
struct kp_file {
  int dummy;
};

/* Variables and functions */
char *cline(struct kp_file *, int);
scalar_t__ is_cfi_cmd(char *);
scalar_t__ is_cold_hot(char *);
scalar_t__ is_comment(char *);
scalar_t__ is_debug_lbl(char *);
scalar_t__ is_file_cmd(char *);
scalar_t__ is_loc_cmd(char *);
int skip_debug_section(struct kp_file *, int);
int skip_eh_frame_section(struct kp_file *, int);
int skip_gcc_except_table(struct kp_file *, int);
int skip_ltext_lbl(struct kp_file *, int, char *);
int debug_filter_skip(struct kp_file *f, int l, int options) {
  char *s = cline(f, l);
  int n;
  if (is_cold_hot(s))
    return 1;
  if (is_comment(s))
    return 1;
  if (is_loc_cmd(s))
    return 1;
  if (is_file_cmd(s))
    return 1;
  if (is_debug_lbl(s))
    return 1;
  if ((options & 1 << 2) && is_cfi_cmd(s))
    return 1;
  if ((n = skip_ltext_lbl(f, l, s)))
    return n;
  if ((n = skip_debug_section(f, l)))
    return n;
  if (options & 1 << 0)
    if ((n = skip_eh_frame_section(f, l)))
      return n;
  if (options & 1 << 1)
    if ((n = skip_gcc_except_table(f, l)))
      return n;
  return 0;
}


x86 assembly (clang, -O0):
<debug_filter_skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <cline@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   10b0 <is_cold_hot@plt>
cmp    $0x0,%rax
je     11f1 <debug_filter_skip+0x41>
movl   $0x1,-0x4(%rbp)
jmp    135a <debug_filter_skip+0x1aa>
mov    -0x20(%rbp),%rdi
call   1090 <is_comment@plt>
cmp    $0x0,%rax
je     1210 <debug_filter_skip+0x60>
movl   $0x1,-0x4(%rbp)
jmp    135a <debug_filter_skip+0x1aa>
mov    -0x20(%rbp),%rdi
call   10a0 <is_loc_cmd@plt>
cmp    $0x0,%rax
je     122f <debug_filter_skip+0x7f>
movl   $0x1,-0x4(%rbp)
jmp    135a <debug_filter_skip+0x1aa>
mov    -0x20(%rbp),%rdi
call   1080 <is_file_cmd@plt>
cmp    $0x0,%rax
je     124e <debug_filter_skip+0x9e>
movl   $0x1,-0x4(%rbp)
jmp    135a <debug_filter_skip+0x1aa>
mov    -0x20(%rbp),%rdi
call   1050 <is_debug_lbl@plt>
cmp    $0x0,%rax
je     126d <debug_filter_skip+0xbd>
movl   $0x1,-0x4(%rbp)
jmp    135a <debug_filter_skip+0x1aa>
mov    -0x18(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     129b <debug_filter_skip+0xeb>
mov    -0x20(%rbp),%rdi
call   10d0 <is_cfi_cmd@plt>
cmp    $0x0,%rax
je     129b <debug_filter_skip+0xeb>
movl   $0x1,-0x4(%rbp)
jmp    135a <debug_filter_skip+0x1aa>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   10c0 <skip_ltext_lbl@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
je     12c2 <debug_filter_skip+0x112>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    135a <debug_filter_skip+0x1aa>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <skip_debug_section@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
je     12e5 <debug_filter_skip+0x135>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    135a <debug_filter_skip+0x1aa>
mov    -0x18(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     131c <debug_filter_skip+0x16c>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1070 <skip_eh_frame_section@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
je     1317 <debug_filter_skip+0x167>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    135a <debug_filter_skip+0x1aa>
jmp    131c <debug_filter_skip+0x16c>
mov    -0x18(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1353 <debug_filter_skip+0x1a3>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <skip_gcc_except_table@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
je     134e <debug_filter_skip+0x19e>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    135a <debug_filter_skip+0x1aa>
jmp    1353 <debug_filter_skip+0x1a3>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_filter_skip>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%r12
call   1030 <cline@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   10b0 <is_cold_hot@plt>
mov    $0x1,%ebp
test   %rax,%rax
jne    1283 <debug_filter_skip+0xd3>
mov    %rbx,%rdi
call   1090 <is_comment@plt>
test   %rax,%rax
jne    1283 <debug_filter_skip+0xd3>
mov    %rbx,%rdi
call   10a0 <is_loc_cmd@plt>
test   %rax,%rax
jne    1283 <debug_filter_skip+0xd3>
mov    %rbx,%rdi
call   1080 <is_file_cmd@plt>
test   %rax,%rax
jne    1283 <debug_filter_skip+0xd3>
mov    %rbx,%rdi
call   1050 <is_debug_lbl@plt>
test   %rax,%rax
jne    1283 <debug_filter_skip+0xd3>
test   $0x4,%r14b
je     122e <debug_filter_skip+0x7e>
mov    %rbx,%rdi
call   10d0 <is_cfi_cmd@plt>
test   %rax,%rax
jne    1283 <debug_filter_skip+0xd3>
mov    %r12,%rdi
mov    %r15d,%esi
mov    %rbx,%rdx
call   10c0 <skip_ltext_lbl@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1283 <debug_filter_skip+0xd3>
mov    %r12,%rdi
mov    %r15d,%esi
call   1060 <skip_debug_section@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1283 <debug_filter_skip+0xd3>
test   $0x1,%r14b
je     126a <debug_filter_skip+0xba>
mov    %r12,%rdi
mov    %r15d,%esi
call   1070 <skip_eh_frame_section@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1283 <debug_filter_skip+0xd3>
test   $0x2,%r14b
je     1281 <debug_filter_skip+0xd1>
mov    %r12,%rdi
mov    %r15d,%esi
call   1040 <skip_gcc_except_table@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1283 <debug_filter_skip+0xd3>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.kp_file = type { i32 }
define i32 @debug_filter_skip(%struct.kp_file* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.kp_file*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store %struct.kp_file* %0, %struct.kp_file** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%10 = load %struct.kp_file*, %struct.kp_file** %5
%11 = load i32, i32* %6
%12 = call i8* @cline(%struct.kp_file* %10, i32 %11)
store i8* %12, i8** %8
%13 = load i8*, i8** %8
%14 = call i64 @is_cold_hot(i8* %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %3
store i32 1, i32* %4
br label %86
17: ; preds = %3
%18 = load i8*, i8** %8
%19 = call i64 @is_comment(i8* %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 1, i32* %4
br label %86
22: ; preds = %17
%23 = load i8*, i8** %8
%24 = call i64 @is_loc_cmd(i8* %23)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %22
store i32 1, i32* %4
br label %86
27: ; preds = %22
%28 = load i8*, i8** %8
%29 = call i64 @is_file_cmd(i8* %28)
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %27
store i32 1, i32* %4
br label %86
32: ; preds = %27
%33 = load i8*, i8** %8
%34 = call i64 @is_debug_lbl(i8* %33)
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %32
store i32 1, i32* %4
br label %86
37: ; preds = %32
%38 = load i32, i32* %7
%39 = and i32 %38, 4
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %46
41: ; preds = %37
%42 = load i8*, i8** %8
%43 = call i64 @is_cfi_cmd(i8* %42)
%44 = icmp ne i64 %43, 0
br i1 %44, label %45, label %46
45: ; preds = %41
store i32 1, i32* %4
br label %86
46: ; preds = %41, %37
%47 = load %struct.kp_file*, %struct.kp_file** %5
%48 = load i32, i32* %6
%49 = load i8*, i8** %8
%50 = call i32 @skip_ltext_lbl(%struct.kp_file* %47, i32 %48, i8* %49)
store i32 %50, i32* %9
%51 = icmp ne i32 %50, 0
br i1 %51, label %52, label %54
52: ; preds = %46
%53 = load i32, i32* %9
store i32 %53, i32* %4
br label %86
54: ; preds = %46
%55 = load %struct.kp_file*, %struct.kp_file** %5
%56 = load i32, i32* %6
%57 = call i32 @skip_debug_section(%struct.kp_file* %55, i32 %56)
store i32 %57, i32* %9
%58 = icmp ne i32 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %54
%60 = load i32, i32* %9
store i32 %60, i32* %4
br label %86
61: ; preds = %54
%62 = load i32, i32* %7
%63 = and i32 %62, 1
%64 = icmp ne i32 %63, 0
br i1 %64, label %65, label %73
65: ; preds = %61
%66 = load %struct.kp_file*, %struct.kp_file** %5
%67 = load i32, i32* %6
%68 = call i32 @skip_eh_frame_section(%struct.kp_file* %66, i32 %67)
store i32 %68, i32* %9
%69 = icmp ne i32 %68, 0
br i1 %69, label %70, label %72
70: ; preds = %65
%71 = load i32, i32* %9
store i32 %71, i32* %4
br label %86
72: ; preds = %65
br label %73
73: ; preds = %72, %61
%74 = load i32, i32* %7
%75 = and i32 %74, 2
%76 = icmp ne i32 %75, 0
br i1 %76, label %77, label %85
77: ; preds = %73
%78 = load %struct.kp_file*, %struct.kp_file** %5
%79 = load i32, i32* %6
%80 = call i32 @skip_gcc_except_table(%struct.kp_file* %78, i32 %79)
store i32 %80, i32* %9
%81 = icmp ne i32 %80, 0
br i1 %81, label %82, label %84
82: ; preds = %77
%83 = load i32, i32* %9
store i32 %83, i32* %4
br label %86
84: ; preds = %77
br label %85
85: ; preds = %84, %73
store i32 0, i32* %4
br label %86
86: ; preds = %85, %82, %70, %59, %52, %45, %36, %31, %26, %21, %16
%87 = load i32, i32* %4
ret i32 %87
}

LLVM IR (-O2):
%struct.kp_file = type { i32 }
define i32 @debug_filter_skip(%struct.kp_file* %0, i32 %1, i32 %2) {
%4 = tail call i8* @cline(%struct.kp_file* %0, i32 %1)
%5 = tail call i64 @is_cold_hot(i8* %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %44
7: ; preds = %3
%8 = tail call i64 @is_comment(i8* %4)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %44
10: ; preds = %7
%11 = tail call i64 @is_loc_cmd(i8* %4)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %44
13: ; preds = %10
%14 = tail call i64 @is_file_cmd(i8* %4)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %44
16: ; preds = %13
%17 = tail call i64 @is_debug_lbl(i8* %4)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %44
19: ; preds = %16
%20 = and i32 %2, 4
%21 = icmp eq i32 %20, 0
br i1 %21, label %25, label %22
22: ; preds = %19
%23 = tail call i64 @is_cfi_cmd(i8* %4)
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %44
25: ; preds = %22, %19
%26 = tail call i32 @skip_ltext_lbl(%struct.kp_file* %0, i32 %1, i8* %4)
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %44
28: ; preds = %25
%29 = tail call i32 @skip_debug_section(%struct.kp_file* %0, i32 %1)
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %44
31: ; preds = %28
%32 = and i32 %2, 1
%33 = icmp eq i32 %32, 0
br i1 %33, label %37, label %34
34: ; preds = %31
%35 = tail call i32 @skip_eh_frame_section(%struct.kp_file* %0, i32 %1)
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %44
37: ; preds = %34, %31
%38 = and i32 %2, 2
%39 = icmp eq i32 %38, 0
br i1 %39, label %43, label %40
40: ; preds = %37
%41 = tail call i32 @skip_gcc_except_table(%struct.kp_file* %0, i32 %1)
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %44
43: ; preds = %40, %37
br label %44
44: ; preds = %40, %34, %28, %25, %22, %16, %13, %10, %7, %3, %43
%45 = phi i32 [ 0, %43 ], [ 1, %3 ], [ 1, %7 ], [ 1, %10 ], [ 1, %13 ], [ 1, %16 ], [ 1, %22 ], [ %26, %25 ], [ %29, %28 ], [ %35, %34 ], [ %41, %40 ]
ret i32 %45
}