#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*/ stderr;
int strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *strstr(char const *, char const *);
int /*<<< orphan*/ zero_string(char *, int);
int alt_extract_name_value(const char *in_str, const char *start,
                           const char *stop, char *val, int maxlen) {
  int status = 0;
  char *cptr1, *cptr2, *cptr3;
  int len, in_str_len;
  if (in_str == NULL) {
    {
      {
        fprintf(stderr, "Line %3d of File %s \n", 394,
                "/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 ((start == NULL) || (*start == '\0')) {
    {
      {
        fprintf(stderr, "Line %3d of File %s \n", 395,
                "/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 ((stop == NULL) || (*stop == '\0')) {
    {
      {
        fprintf(stderr, "Line %3d of File %s \n", 396,
                "/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;
    };
  }
  cptr1 = strstr(in_str, start);
  in_str_len = strlen(in_str);
  if ((cptr1 == NULL) || (*cptr1 == '\0')) {
  } else {
    cptr2 = cptr1 + strlen(start);
    cptr3 = strstr(cptr2, stop);
    if (cptr3 == cptr2) {
    } else {
      if (cptr3 == NULL) {
        len = in_str_len - (cptr2 - in_str);
      } else {
        len = cptr3 - cptr2;
      }
      len++;
      if (len >= maxlen) {
        {
          {
            fprintf(stderr, "Line %3d of File %s \n", 417,
                    "/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;
        };
      }
      zero_string(val, maxlen);
      strncpy(val, cptr2, len - 1);
    }
  }
BYE:
  return status;
}


x86 assembly (clang, -O0):
<alt_extract_name_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    11ab <alt_extract_name_value+0x5b>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
lea    0xe72(%rip),%rsi
mov    $0x18a,%edx
lea    0xe7c(%rip),%rcx
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x28(%rbp)
jmp    135b <alt_extract_name_value+0x20b>
cmpq   $0x0,-0x10(%rbp)
je     11c6 <alt_extract_name_value+0x76>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    11f3 <alt_extract_name_value+0xa3>
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
lea    0xe2a(%rip),%rsi
mov    $0x18b,%edx
lea    0xe34(%rip),%rcx
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x28(%rbp)
jmp    135b <alt_extract_name_value+0x20b>
cmpq   $0x0,-0x18(%rbp)
je     120e <alt_extract_name_value+0xbe>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    123b <alt_extract_name_value+0xeb>
mov    0x2dcb(%rip),%rax
mov    (%rax),%edi
lea    0xde2(%rip),%rsi
mov    $0x18c,%edx
lea    0xdec(%rip),%rcx
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x28(%rbp)
jmp    135b <alt_extract_name_value+0x20b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1070 <strstr@plt>
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x48(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1273 <alt_extract_name_value+0x123>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1278 <alt_extract_name_value+0x128>
jmp    1356 <alt_extract_name_value+0x206>
mov    -0x30(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1070 <strstr@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x38(%rbp),%rax
jne    12bd <alt_extract_name_value+0x16d>
jmp    1351 <alt_extract_name_value+0x201>
cmpq   $0x0,-0x40(%rbp)
jne    12e2 <alt_extract_name_value+0x192>
movslq -0x48(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    -0x8(%rbp),%rdx
sub    %rdx,%rcx
sub    %rcx,%rax
mov    %eax,-0x44(%rbp)
jmp    12f0 <alt_extract_name_value+0x1a0>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x24(%rbp),%eax
jl     1332 <alt_extract_name_value+0x1e2>
mov    0x2cd4(%rip),%rax
mov    (%rax),%edi
lea    0xceb(%rip),%rsi
mov    $0x1a1,%edx
lea    0xcf5(%rip),%rcx
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x28(%rbp)
jmp    135b <alt_extract_name_value+0x20b>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <zero_string@plt>
mov    -0x20(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x44(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
jmp    1356 <alt_extract_name_value+0x206>
jmp    135b <alt_extract_name_value+0x20b>
mov    -0x28(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alt_extract_name_value>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %rdi,%rdi
je     1253 <alt_extract_name_value+0x103>
mov    %rsi,%r12
test   %rsi,%rsi
je     1235 <alt_extract_name_value+0xe5>
cmpb   $0x0,(%r12)
je     1235 <alt_extract_name_value+0xe5>
mov    %rdx,%r13
test   %rdx,%rdx
je     1271 <alt_extract_name_value+0x121>
cmpb   $0x0,0x0(%r13)
je     1271 <alt_extract_name_value+0x121>
mov    %r8d,%r15d
mov    %rcx,%r14
mov    %rdi,%rbp
mov    %r12,%rsi
call   1070 <strstr@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   1050 <strlen@plt>
mov    %rbx,%rcx
xor    %ebx,%ebx
test   %rcx,%rcx
je     1297 <alt_extract_name_value+0x147>
cmpb   $0x0,(%rcx)
je     1297 <alt_extract_name_value+0x147>
mov    %rax,0x10(%rsp)
mov    %rcx,0x8(%rsp)
mov    %r12,%rdi
call   1050 <strlen@plt>
cltq
add    %rax,0x8(%rsp)
mov    0x8(%rsp),%rdi
mov    %r13,%rsi
call   1070 <strstr@plt>
mov    0x8(%rsp),%r12
cmp    %r12,%rax
je     1297 <alt_extract_name_value+0x147>
mov    0x10(%rsp),%rdx
add    %ebp,%edx
test   %rax,%rax
cmovne %eax,%edx
sub    %r12d,%edx
lea    0x1(%rdx),%eax
cmp    %r15d,%eax
jge    12a8 <alt_extract_name_value+0x158>
mov    %r14,%rdi
mov    %r15d,%esi
mov    %rdx,%rbp
call   1040 <zero_string@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %ebp,%edx
call   1030 <strncpy@plt>
jmp    1297 <alt_extract_name_value+0x147>
mov    0x2da4(%rip),%rax
mov    (%rax),%edi
lea    0xdbb(%rip),%rsi
lea    0xdca(%rip),%rcx
mov    $0x18b,%edx
jmp    128d <alt_extract_name_value+0x13d>
mov    0x2d86(%rip),%rax
mov    (%rax),%edi
lea    0xd9d(%rip),%rsi
lea    0xdac(%rip),%rcx
mov    $0x18a,%edx
jmp    128d <alt_extract_name_value+0x13d>
mov    0x2d68(%rip),%rax
mov    (%rax),%edi
lea    0xd7f(%rip),%rsi
lea    0xd8e(%rip),%rcx
mov    $0x18c,%edx
call   1060 <fprintf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2d31(%rip),%rax
mov    (%rax),%edi
lea    0xd48(%rip),%rsi
lea    0xd57(%rip),%rcx
mov    $0x1a1,%edx
jmp    128d <alt_extract_name_value+0x13d>

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 @alt_extract_name_value(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
store i32 0, i32* %11
%17 = load i8*, i8** %6
%18 = icmp eq i8* %17, null
br i1 %18, label %19, label %22
19: ; preds = %5
%20 = load i32, i32* @stderr
%21 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 394, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %11
br label %111
22: ; preds = %5
%23 = load i8*, i8** %7
%24 = icmp eq i8* %23, null
br i1 %24, label %30, label %25
25: ; preds = %22
%26 = load i8*, i8** %7
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %25, %22
%31 = load i32, i32* @stderr
%32 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 395, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %11
br label %111
33: ; preds = %25
%34 = load i8*, i8** %8
%35 = icmp eq i8* %34, null
br i1 %35, label %41, label %36
36: ; preds = %33
%37 = load i8*, i8** %8
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %44
41: ; preds = %36, %33
%42 = load i32, i32* @stderr
%43 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 396, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %11
br label %111
44: ; preds = %36
%45 = load i8*, i8** %6
%46 = load i8*, i8** %7
%47 = call i8* @strstr(i8* %45, i8* %46)
store i8* %47, i8** %12
%48 = load i8*, i8** %6
%49 = call i32 @strlen(i8* %48)
store i32 %49, i32* %16
%50 = load i8*, i8** %12
%51 = icmp eq i8* %50, null
br i1 %51, label %57, label %52
52: ; preds = %44
%53 = load i8*, i8** %12
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %58
57: ; preds = %52, %44
br label %110
58: ; preds = %52
%59 = load i8*, i8** %12
%60 = load i8*, i8** %7
%61 = call i32 @strlen(i8* %60)
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i8, i8* %59, i64 %62
store i8* %63, i8** %13
%64 = load i8*, i8** %13
%65 = load i8*, i8** %8
%66 = call i8* @strstr(i8* %64, i8* %65)
store i8* %66, i8** %14
%67 = load i8*, i8** %14
%68 = load i8*, i8** %13
%69 = icmp eq i8* %67, %68
br i1 %69, label %70, label %71
70: ; preds = %58
br label %109
71: ; preds = %58
%72 = load i8*, i8** %14
%73 = icmp eq i8* %72, null
br i1 %73, label %74, label %84
74: ; preds = %71
%75 = load i32, i32* %16
%76 = sext i32 %75 to i64
%77 = load i8*, i8** %13
%78 = load i8*, i8** %6
%79 = ptrtoint i8* %77 to i64
%80 = ptrtoint i8* %78 to i64
%81 = sub i64 %79, %80
%82 = sub nsw i64 %76, %81
%83 = trunc i64 %82 to i32
store i32 %83, i32* %15
br label %91
84: ; preds = %71
%85 = load i8*, i8** %14
%86 = load i8*, i8** %13
%87 = ptrtoint i8* %85 to i64
%88 = ptrtoint i8* %86 to i64
%89 = sub i64 %87, %88
%90 = trunc i64 %89 to i32
store i32 %90, i32* %15
br label %91
91: ; preds = %84, %74
%92 = load i32, i32* %15
%93 = add nsw i32 %92, 1
store i32 %93, i32* %15
%94 = load i32, i32* %15
%95 = load i32, i32* %10
%96 = icmp sge i32 %94, %95
br i1 %96, label %97, label %100
97: ; preds = %91
%98 = load i32, i32* @stderr
%99 = call i32 @fprintf(i32 %98, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 417, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %11
br label %111
100: ; preds = %91
%101 = load i8*, i8** %9
%102 = load i32, i32* %10
%103 = call i32 @zero_string(i8* %101, i32 %102)
%104 = load i8*, i8** %9
%105 = load i8*, i8** %13
%106 = load i32, i32* %15
%107 = sub nsw i32 %106, 1
%108 = call i32 @strncpy(i8* %104, i8* %105, i32 %107)
br label %109
109: ; preds = %100, %70
br label %110
110: ; preds = %109, %57
br label %111
111: ; preds = %110, %97, %41, %30, %19
%112 = load i32, i32* %11
ret i32 %112
}

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 @alt_extract_name_value(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = icmp eq i8* %0, null
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 394, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0))
br label %57
10: ; preds = %5
%11 = icmp eq i8* %1, null
br i1 %11, label %15, label %12
12: ; preds = %10
%13 = load i8, i8* %1
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %12, %10
%16 = load i32, i32* @stderr
%17 = tail call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 395, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0))
br label %57
18: ; preds = %12
%19 = icmp eq i8* %2, null
br i1 %19, label %23, label %20
20: ; preds = %18
%21 = load i8, i8* %2
%22 = icmp eq i8 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %20, %18
%24 = load i32, i32* @stderr
%25 = tail call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 396, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0))
br label %57
26: ; preds = %20
%27 = tail call i8* @strstr(i8* %0, i8* %1)
%28 = tail call i32 @strlen(i8* %0)
%29 = icmp eq i8* %27, null
br i1 %29, label %57, label %30
30: ; preds = %26
%31 = load i8, i8* %27
%32 = icmp eq i8 %31, 0
br i1 %32, label %57, label %33
33: ; preds = %30
%34 = tail call i32 @strlen(i8* %1)
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %27, i64 %35
%37 = tail call i8* @strstr(i8* %36, i8* %2)
%38 = icmp eq i8* %37, %36
br i1 %38, label %57, label %39
39: ; preds = %33
%40 = icmp eq i8* %37, null
%41 = zext i32 %28 to i64
%42 = ptrtoint i8* %36 to i64
%43 = ptrtoint i8* %0 to i64
%44 = add i64 %41, %43
%45 = ptrtoint i8* %37 to i64
%46 = select i1 %40, i64 %44, i64 %45
%47 = sub i64 %46, %42
%48 = trunc i64 %47 to i32
%49 = add nsw i32 %48, 1
%50 = icmp slt i32 %49, %4
br i1 %50, label %54, label %51
51: ; preds = %39
%52 = load i32, i32* @stderr
%53 = tail call i32 @fprintf(i32 %52, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 417, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0))
br label %57
54: ; preds = %39
%55 = tail call i32 @zero_string(i8* %3, i32 %4)
%56 = tail call i32 @strncpy(i8* %3, i8* %36, i32 %48)
br label %57
57: ; preds = %30, %26, %33, %54, %51, %23, %15, %7
%58 = phi i32 [ -1, %7 ], [ -1, %15 ], [ -1, %23 ], [ 0, %26 ], [ 0, %30 ], [ 0, %33 ], [ -1, %51 ], [ 0, %54 ]
ret i32 %58
}