int esl_config_get_cas_bits(char *strvalue, unsigned char *outbits) {
  char cas_bits[5];
  unsigned char bit = 0x8;
  char *double_colon = strchr(strvalue, ':');
  int x = 0;
  if (!double_colon) {
    esl_log("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/nkazzaz/collectd-freeswitch/refs/heads/"
            "master/src/libesl/esl_config.c",
            (const char *)__func__, 220, 3,
            "No CAS bits specified: %s, :xxxx definition expected, where x is "
            "1 or 0\n",
            double_colon);
    return -1;
  }
  double_colon++;
  *outbits = 0;
  cas_bits[4] = 0;
  if (sscanf(double_colon, "%c%c%c%c", &cas_bits[0], &cas_bits[1], &cas_bits[2],
             &cas_bits[3]) != 4) {
    esl_log("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/nkazzaz/collectd-freeswitch/refs/heads/"
            "master/src/libesl/esl_config.c",
            (const char *)__func__, 229, 3,
            "Invalid CAS bits specified: %s, :xxxx definition expected, where "
            "x is 1 or 0\n",
            double_colon);
    return -1;
  }
  esl_log("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/nkazzaz/collectd-freeswitch/refs/heads/"
          "master/src/libesl/esl_config.c",
          (const char *)__func__, 233, 7, "CAS bits specification found: %s\n",
          cas_bits);
  for (; cas_bits[x]; x++) {
    if ('1' == cas_bits[x]) {
      *outbits |= bit;
    } else if ('0' != cas_bits[x]) {
      esl_log("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/nkazzaz/collectd-freeswitch/refs/"
              "heads/master/src/libesl/esl_config.c",
              (const char *)__func__, 239, 3,
              "Invalid CAS pattern specified: %s, just 0 or 1 allowed for each "
              "bit\n");
      return -1;
    }
    bit >>= 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<esl_config_get_cas_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movb   $0x8,-0x1e(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    119e <esl_config_get_cas_bits+0x6e>
mov    -0x28(%rbp),%r9
lea    0xe8d(%rip),%rdi
lea    0xf26(%rip),%rsi
mov    $0xdc,%edx
mov    $0x3,%ecx
lea    0xf2d(%rip),%r8
mov    $0x0,%al
call   1040 <esl_log@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    12f1 <esl_config_get_cas_bits+0x1c1>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
movb   $0x0,-0x19(%rbp)
mov    -0x28(%rbp),%rdi
lea    -0x1d(%rbp),%rdx
lea    -0x1d(%rbp),%rcx
add    $0x1,%rcx
lea    -0x1d(%rbp),%r8
add    $0x2,%r8
lea    -0x1d(%rbp),%r9
add    $0x3,%r9
lea    0xf25(%rip),%rsi
mov    $0x0,%al
call   1050 <sscanf@plt>
cmp    $0x4,%eax
je     1222 <esl_config_get_cas_bits+0xf2>
mov    -0x28(%rbp),%r9
lea    0xe09(%rip),%rdi
lea    0xea2(%rip),%rsi
mov    $0xe5,%edx
mov    $0x3,%ecx
lea    0xefb(%rip),%r8
mov    $0x0,%al
call   1040 <esl_log@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    12f1 <esl_config_get_cas_bits+0x1c1>
lea    -0x1d(%rbp),%r9
lea    0xdd3(%rip),%rdi
lea    0xe6c(%rip),%rsi
mov    $0xe9,%edx
mov    $0x7,%ecx
lea    0xf13(%rip),%r8
mov    $0x0,%al
call   1040 <esl_log@plt>
movslq -0x2c(%rbp),%rax
cmpb   $0x0,-0x1d(%rbp,%rax,1)
je     12ea <esl_config_get_cas_bits+0x1ba>
movslq -0x2c(%rbp),%rax
movsbl -0x1d(%rbp,%rax,1),%ecx
mov    $0x31,%eax
cmp    %ecx,%eax
jne    1285 <esl_config_get_cas_bits+0x155>
movzbl -0x1e(%rbp),%edx
mov    -0x18(%rbp),%rax
movzbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
jmp    12d2 <esl_config_get_cas_bits+0x1a2>
movslq -0x2c(%rbp),%rax
movsbl -0x1d(%rbp,%rax,1),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
je     12cd <esl_config_get_cas_bits+0x19d>
lea    0xd5e(%rip),%rdi
lea    0xdf7(%rip),%rsi
mov    $0xef,%edx
mov    $0x3,%ecx
lea    0xec0(%rip),%r8
mov    $0x0,%al
call   1040 <esl_log@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    12f1 <esl_config_get_cas_bits+0x1c1>
jmp    12d2 <esl_config_get_cas_bits+0x1a2>
movzbl -0x1e(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x1e(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    124c <esl_config_get_cas_bits+0x11c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<esl_config_get_cas_bits>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    $0x3a,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     11d8 <esl_config_get_cas_bits+0xa8>
mov    %rax,%r15
add    $0x1,%r15
movb   $0x0,(%r14)
movb   $0x0,0xf(%rsp)
lea    0xc(%rsp),%rcx
lea    0xd(%rsp),%r8
lea    0xe(%rsp),%r9
lea    0xf8c(%rip),%rsi
lea    0xb(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <sscanf@plt>
lea    0xe72(%rip),%rdi
lea    0xf0b(%rip),%rsi
cmp    $0x4,%eax
jne    11fc <esl_config_get_cas_bits+0xcc>
lea    0xfb7(%rip),%r8
mov    $0xe9,%edx
mov    $0x7,%ecx
mov    %rbx,%r9
xor    %eax,%eax
call   1040 <esl_log@plt>
mov    $0x8,%al
jmp    11c6 <esl_config_get_cas_bits+0x96>
nopl   0x0(%rax)
shr    %al
add    $0x1,%rbx
movzbl (%rbx),%ecx
cmp    $0x30,%cl
je     11c0 <esl_config_get_cas_bits+0x90>
cmp    $0x31,%cl
jne    1226 <esl_config_get_cas_bits+0xf6>
or     %al,(%r14)
jmp    11c0 <esl_config_get_cas_bits+0x90>
lea    0xe21(%rip),%rdi
lea    0xeba(%rip),%rsi
lea    0xecb(%rip),%r8
mov    $0xdc,%edx
mov    $0x3,%ecx
xor    %r9d,%r9d
jmp    1210 <esl_config_get_cas_bits+0xe0>
lea    0xf07(%rip),%r8
mov    $0xe5,%edx
mov    $0x3,%ecx
mov    %r15,%r9
xor    %eax,%eax
call   1040 <esl_log@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
test   %cl,%cl
jne    122e <esl_config_get_cas_bits+0xfe>
xor    %eax,%eax
jmp    121c <esl_config_get_cas_bits+0xec>
lea    0xdcb(%rip),%rdi
lea    0xe64(%rip),%rsi
lea    0xf37(%rip),%r8
mov    $0xef,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1040 <esl_log@plt>
jmp    1217 <esl_config_get_cas_bits+0xe7>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/nkazzaz/collectd-freeswitch/refs/heads/master/src/libesl/esl_config.c\00"
@__func__.esl_config_get_cas_bits = [24 x i8] c"esl_config_get_cas_bits\00"
@.str.1 = [73 x i8] c"No CAS bits specified: %s, :xxxx definition expected, where x is 1 or 0\0A\00"
@.str.2 = [9 x i8] c"%c%c%c%c\00"
@.str.3 = [78 x i8] c"Invalid CAS bits specified: %s, :xxxx definition expected, where x is 1 or 0\0A\00"
@.str.4 = [34 x i8] c"CAS bits specification found: %s\0A\00"
@.str.5 = [69 x i8] c"Invalid CAS pattern specified: %s, just 0 or 1 allowed for each bit\0A\00"
define i32 @esl_config_get_cas_bits(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [5 x i8]
%7 = alloca i8
%8 = alloca i8*
%9 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8 8, i8* %7
%10 = load i8*, i8** %4
%11 = call i8* @strchr(i8* %10, i32 58)
store i8* %11, i8** %8
store i32 0, i32* %9
%12 = load i8*, i8** %8
%13 = icmp ne i8* %12, null
br i1 %13, label %17, label %14
14: ; preds = %2
%15 = load i8*, i8** %8
%16 = call i32 (i8*, i8*, i32, i32, i8*, i8*, ...) bitcast (i32 (...)* @esl_log to i32 (i8*, i8*, i32, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__func__.esl_config_get_cas_bits, i64 0, i64 0), i32 220, i32 3, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i8* %15)
store i32 -1, i32* %3
br label %75
17: ; preds = %2
%18 = load i8*, i8** %8
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %8
%20 = load i8*, i8** %5
store i8 0, i8* %20
%21 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 4
store i8 0, i8* %21
%22 = load i8*, i8** %8
%23 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%24 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 1
%25 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 2
%26 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 3
%27 = call i32 (i8*, i8*, ...) @sscanf(i8* %22, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %23, i8* %24, i8* %25, i8* %26)
%28 = icmp ne i32 %27, 4
br i1 %28, label %29, label %32
29: ; preds = %17
%30 = load i8*, i8** %8
%31 = call i32 (i8*, i8*, i32, i32, i8*, i8*, ...) bitcast (i32 (...)* @esl_log to i32 (i8*, i8*, i32, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__func__.esl_config_get_cas_bits, i64 0, i64 0), i32 229, i32 3, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.3, i64 0, i64 0), i8* %30)
store i32 -1, i32* %3
br label %75
32: ; preds = %17
%33 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%34 = call i32 (i8*, i8*, i32, i32, i8*, i8*, ...) bitcast (i32 (...)* @esl_log to i32 (i8*, i8*, i32, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__func__.esl_config_get_cas_bits, i64 0, i64 0), i32 233, i32 7, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i8* %33)
br label %35
35: ; preds = %71, %32
%36 = load i32, i32* %9
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = icmp ne i8 %39, 0
br i1 %40, label %41, label %74
41: ; preds = %35
%42 = load i32, i32* %9
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 %43
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp eq i32 49, %46
br i1 %47, label %48, label %56
48: ; preds = %41
%49 = load i8, i8* %7
%50 = zext i8 %49 to i32
%51 = load i8*, i8** %5
%52 = load i8, i8* %51
%53 = zext i8 %52 to i32
%54 = or i32 %53, %50
%55 = trunc i32 %54 to i8
store i8 %55, i8* %51
br label %66
56: ; preds = %41
%57 = load i32, i32* %9
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 %58
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = icmp ne i32 48, %61
br i1 %62, label %63, label %65
63: ; preds = %56
%64 = call i32 (i8*, i8*, i32, i32, i8*, ...) bitcast (i32 (...)* @esl_log to i32 (i8*, i8*, i32, i32, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__func__.esl_config_get_cas_bits, i64 0, i64 0), i32 239, i32 3, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.5, i64 0, i64 0))
store i32 -1, i32* %3
br label %75
65: ; preds = %56
br label %66
66: ; preds = %65, %48
%67 = load i8, i8* %7
%68 = zext i8 %67 to i32
%69 = ashr i32 %68, 1
%70 = trunc i32 %69 to i8
store i8 %70, i8* %7
br label %71
71: ; preds = %66
%72 = load i32, i32* %9
%73 = add nsw i32 %72, 1
store i32 %73, i32* %9
br label %35
74: ; preds = %35
store i32 0, i32* %3
br label %75
75: ; preds = %74, %63, %29, %14
%76 = load i32, i32* %3
ret i32 %76
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/nkazzaz/collectd-freeswitch/refs/heads/master/src/libesl/esl_config.c\00"
@__func__.esl_config_get_cas_bits = [24 x i8] c"esl_config_get_cas_bits\00"
@.str.1 = [73 x i8] c"No CAS bits specified: %s, :xxxx definition expected, where x is 1 or 0\0A\00"
@.str.2 = [9 x i8] c"%c%c%c%c\00"
@.str.3 = [78 x i8] c"Invalid CAS bits specified: %s, :xxxx definition expected, where x is 1 or 0\0A\00"
@.str.4 = [34 x i8] c"CAS bits specification found: %s\0A\00"
@.str.5 = [69 x i8] c"Invalid CAS pattern specified: %s, just 0 or 1 allowed for each bit\0A\00"
define i32 @esl_config_get_cas_bits(i8* %0, i8* nocapture %1) {
%3 = alloca [5 x i8]
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%5 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 58)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (i8*, i8*, i32, i32, i8*, i8*, ...) bitcast (i32 (...)* @esl_log to i32 (i8*, i8*, i32, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__func__.esl_config_get_cas_bits, i64 0, i64 0), i32 220, i32 3, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i8* null)
br label %34
9: ; preds = %2
%10 = getelementptr inbounds i8, i8* %5, i64 1
store i8 0, i8* %1
%11 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 4
store i8 0, i8* %11
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 1
%13 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 2
%14 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 3
%15 = call i32 (i8*, i8*, ...) @sscanf(i8* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %4, i8* %12, i8* %13, i8* %14)
%16 = icmp eq i32 %15, 4
br i1 %16, label %19, label %17
17: ; preds = %9
%18 = call i32 (i8*, i8*, i32, i32, i8*, i8*, ...) bitcast (i32 (...)* @esl_log to i32 (i8*, i8*, i32, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__func__.esl_config_get_cas_bits, i64 0, i64 0), i32 229, i32 3, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.3, i64 0, i64 0), i8* %10)
br label %34
19: ; preds = %9
%20 = call i32 (i8*, i8*, i32, i32, i8*, i8*, ...) bitcast (i32 (...)* @esl_log to i32 (i8*, i8*, i32, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__func__.esl_config_get_cas_bits, i64 0, i64 0), i32 233, i32 7, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i8* %4)
br label %21
21: ; preds = %31, %19
%22 = phi i64 [ %33, %31 ], [ 0, %19 ]
%23 = phi i8 [ %32, %31 ], [ 8, %19 ]
%24 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 %22
%25 = load i8, i8* %24
switch i8 %25, label %29 [
i8 0, label %34
i8 49, label %26
i8 48, label %31
]
26: ; preds = %21
%27 = load i8, i8* %1
%28 = or i8 %27, %23
store i8 %28, i8* %1
br label %31
29: ; preds = %21
%30 = call i32 (i8*, i8*, i32, i32, i8*, ...) bitcast (i32 (...)* @esl_log to i32 (i8*, i8*, i32, i32, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__func__.esl_config_get_cas_bits, i64 0, i64 0), i32 239, i32 3, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.5, i64 0, i64 0))
br label %34
31: ; preds = %21, %26
%32 = lshr i8 %23, 1
%33 = add nuw i64 %22, 1
br label %21
34: ; preds = %21, %29, %17, %7
%35 = phi i32 [ -1, %17 ], [ -1, %29 ], [ -1, %7 ], [ 0, %21 ]
ret i32 %35
}