#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 count_char(char *, char, int *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ stderr;
int chk_is_ctbl(char *tbl, bool *ptr_is_ctbl) {
  int status = 0;
  int n;
  if (tbl == NULL) {
    {
      {
        fprintf(stderr, "Line %3d of File %s \n", 1027,
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/"
                "master/DEPRECATED_Q2/AUX/auxil.c");
      };
      status = -1;
      goto BYE;
    };
  }
  if (*tbl == '\0') {
    {
      {
        fprintf(stderr, "Line %3d of File %s \n", 1028,
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/"
                "master/DEPRECATED_Q2/AUX/auxil.c");
      };
      status = -1;
      goto BYE;
    };
  }
  status = count_char(tbl, '|', &n);
  switch (n) {
  case 0:
    *ptr_is_ctbl = false;
    break;
  case 1:
    *ptr_is_ctbl = true;
    break;
  default: {
    {
      fprintf(stderr, "Line %3d of File %s \n", 1033,
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/master/"
              "DEPRECATED_Q2/AUX/auxil.c");
    };
    status = -1;
    goto BYE;
  }; break;
  }
BYE:
  return status;
}


x86 assembly (clang, -O0):
<chk_is_ctbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    116f <chk_is_ctbl+0x4f>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
mov    $0x403,%edx
lea    0xeb8(%rip),%rcx
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x14(%rbp)
jmp    1235 <chk_is_ctbl+0x115>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    11ac <chk_is_ctbl+0x8c>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
lea    0xe71(%rip),%rsi
mov    $0x404,%edx
lea    0xe7b(%rip),%rcx
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x14(%rbp)
jmp    1235 <chk_is_ctbl+0x115>
mov    -0x8(%rbp),%rdi
mov    $0x7c,%esi
lea    -0x18(%rbp),%rdx
call   1030 <count_char@plt>
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
test   %eax,%eax
je     11e5 <chk_is_ctbl+0xc5>
jmp    11d4 <chk_is_ctbl+0xb4>
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
je     11f4 <chk_is_ctbl+0xd4>
jmp    1203 <chk_is_ctbl+0xe3>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
jmp    1230 <chk_is_ctbl+0x110>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
jmp    1230 <chk_is_ctbl+0x110>
mov    0x2dd6(%rip),%rax
mov    (%rax),%edi
lea    0xded(%rip),%rsi
mov    $0x409,%edx
lea    0xdf7(%rip),%rcx
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x14(%rbp)
jmp    1235 <chk_is_ctbl+0x115>
jmp    1235 <chk_is_ctbl+0x115>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chk_is_ctbl>:
push   %rbx
sub    $0x10,%rsp
test   %rdi,%rdi
je     1156 <chk_is_ctbl+0x36>
cmpb   $0x0,(%rdi)
je     1174 <chk_is_ctbl+0x54>
mov    %rsi,%rbx
lea    0xc(%rsp),%rdx
mov    $0x7c,%esi
call   1030 <count_char@plt>
mov    0xc(%rsp),%ecx
cmp    $0x1,%ecx
je     1192 <chk_is_ctbl+0x72>
test   %ecx,%ecx
jne    119a <chk_is_ctbl+0x7a>
movl   $0x0,(%rbx)
jmp    11c0 <chk_is_ctbl+0xa0>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
lea    0xea9(%rip),%rcx
mov    $0x403,%edx
jmp    11b6 <chk_is_ctbl+0x96>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
lea    0xe7c(%rip),%rsi
lea    0xe8b(%rip),%rcx
mov    $0x404,%edx
jmp    11b6 <chk_is_ctbl+0x96>
movl   $0x1,(%rbx)
jmp    11c0 <chk_is_ctbl+0xa0>
mov    0x2e3f(%rip),%rax
mov    (%rax),%edi
lea    0xe56(%rip),%rsi
lea    0xe65(%rip),%rcx
mov    $0x409,%edx
call   1040 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Line %3d of File %s \0A\00"
@.str.1 = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/master/DEPRECATED_Q2/AUX/auxil.c\00"
define i32 @chk_is_ctbl(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
store i32 0, i32* %5
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1027, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %5
br label %32
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = load i32, i32* @stderr
%19 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1028, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %5
br label %32
20: ; preds = %12
%21 = load i8*, i8** %3
%22 = call i32 @count_char(i8* %21, i8 signext 124, i32* %6)
store i32 %22, i32* %5
%23 = load i32, i32* %6
switch i32 %23, label %28 [
i32 0, label %24
i32 1, label %26
]
24: ; preds = %20
%25 = load i32*, i32** %4
store i32 0, i32* %25
br label %31
26: ; preds = %20
%27 = load i32*, i32** %4
store i32 1, i32* %27
br label %31
28: ; preds = %20
%29 = load i32, i32* @stderr
%30 = call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1033, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %5
br label %32
31: ; preds = %26, %24
br label %32
32: ; preds = %31, %28, %17, %9
%33 = load i32, i32* %5
ret i32 %33
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Line %3d of File %s \0A\00"
@.str.1 = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/master/DEPRECATED_Q2/AUX/auxil.c\00"
define i32 @chk_is_ctbl(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp eq i8* %0, null
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1027, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0))
br label %23
9: ; preds = %2
%10 = load i8, i8* %0
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* @stderr
%14 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1028, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0))
br label %23
15: ; preds = %9
%16 = call i32 @count_char(i8* %0, i8 signext 124, i32* %3)
%17 = load i32, i32* %3
switch i32 %17, label %20 [
i32 0, label %18
i32 1, label %19
]
18: ; preds = %15
store i32 0, i32* %1
br label %23
19: ; preds = %15
store i32 1, i32* %1
br label %23
20: ; preds = %15
%21 = load i32, i32* @stderr
%22 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1033, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %18, %19, %20, %12, %6
%24 = phi i32 [ -1, %6 ], [ -1, %12 ], [ -1, %20 ], [ %16, %19 ], [ %16, %18 ]
ret i32 %24
}