#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*/ free(char *);
char *malloc(int);
int rs_mmap(char *, char **, size_t *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcat(char *, char const *);
scalar_t__ strcmp(char const *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char const *);
int get_aux_data(const char *fld, const char *str_fldtype, const char *auxtype,
                 char **ptr_aux_X, size_t *ptr_aux_nX) {
  int status = 0;
  char *aux_X = NULL;
  size_t aux_nX = 0;
  char *aux_fld = NULL;
  *ptr_aux_X = NULL;
  if (strcmp(str_fldtype, "SV") != 0) {
    return status;
  }
  if ((strcmp(auxtype, "len") != 0) && (strcmp(auxtype, "off") != 0)) {
    {
      {
        fprintf(stderr, "Line %3d of File %s \n", 97,
                "/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/dbauxil.c");
      };
      status = -1;
      goto BYE;
    };
  }
  int len = strlen(fld);
  aux_fld = malloc(len + 1 + strlen(auxtype) + 1 + 1);
  strcpy(aux_fld, ".");
  strcat(aux_fld, auxtype);
  strcat(aux_fld, ".");
  strcat(aux_fld, fld);
  status = rs_mmap(aux_fld, &aux_X, &aux_nX, 0);
  {
    if ((status) < 0) {
      {
        {
          fprintf(stderr, "Line %3d of File %s \n", 106,
                  "/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/dbauxil.c");
        };
        status = (status);
        goto BYE;
      }
    }
  };
BYE:
  *ptr_aux_X = aux_X;
  *ptr_aux_nX = aux_nX;
  {
    if ((aux_fld) != NULL) {
      free((aux_fld));
      (aux_fld) = NULL;
    }
  };
  return status;
}


x86 assembly (clang, -O0):
<get_aux_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
mov    -0x28(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
lea    0xe2f(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     11eb <get_aux_data+0x6b>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1341 <get_aux_data+0x1c1>
mov    -0x20(%rbp),%rdi
lea    0xe0d(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     124c <get_aux_data+0xcc>
mov    -0x20(%rbp),%rdi
lea    0xdf7(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     124c <get_aux_data+0xcc>
mov    0x2dba(%rip),%rax
mov    (%rax),%edi
lea    0xddc(%rip),%rsi
mov    $0x61,%edx
lea    0xde6(%rip),%rcx
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x34(%rbp)
jmp    1309 <get_aux_data+0x189>
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x58(%rbp),%edi
add    %eax,%edi
add    $0x1,%edi
add    $0x1,%edi
call   1080 <malloc@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
lea    0xe30(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x50(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   10a0 <strcat@plt>
mov    -0x50(%rbp),%rdi
lea    0xe13(%rip),%rsi
call   10a0 <strcat@plt>
mov    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   10a0 <strcat@plt>
mov    -0x50(%rbp),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x48(%rbp),%rdx
xor    %ecx,%ecx
call   1090 <rs_mmap@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jge    1304 <get_aux_data+0x184>
mov    0x2d01(%rip),%rax
mov    (%rax),%edi
lea    0xd23(%rip),%rsi
mov    $0x6a,%edx
lea    0xd2d(%rip),%rcx
call   1070 <fprintf@plt>
mov    -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    1309 <get_aux_data+0x189>
jmp    1309 <get_aux_data+0x189>
mov    -0x40(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x48(%rbp),%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x50(%rbp)
je     133b <get_aux_data+0x1bb>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x50(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_aux_data>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8,%r14
mov    %rcx,%r12
mov    %rdx,%rbx
mov    %rsi,%rax
mov    %rdi,%r15
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,(%rcx)
lea    0xe43(%rip),%rsi
mov    %rax,%rdi
call   1060 <strcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     11dd <get_aux_data+0x5d>
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe1f(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     123c <get_aux_data+0xbc>
lea    0xe0f(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     123c <get_aux_data+0xbc>
mov    0x2dd4(%rip),%rax
mov    (%rax),%edi
lea    0xdf6(%rip),%rsi
lea    0xe05(%rip),%rcx
mov    $0x61,%edx
call   1070 <fprintf@plt>
movq   $0x0,(%r12)
movq   $0x0,(%r14)
mov    $0xffffffff,%ebp
jmp    11cc <get_aux_data+0x4c>
mov    %r15,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    (%rax,%rbp,1),%edi
add    $0x3,%edi
call   1080 <malloc@plt>
mov    %rax,%r13
lea    0xe56(%rip),%rbp
mov    %rax,%rdi
mov    %rbp,%rsi
call   1040 <strcpy@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   10a0 <strcat@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
call   10a0 <strcat@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   10a0 <strcat@plt>
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %r13,%rdi
xor    %ecx,%ecx
call   1090 <rs_mmap@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    12ca <get_aux_data+0x14a>
mov    0x2d30(%rip),%rax
mov    (%rax),%edi
lea    0xd52(%rip),%rsi
lea    0xd61(%rip),%rcx
mov    $0x6a,%edx
call   1070 <fprintf@plt>
mov    0x10(%rsp),%rax
mov    %rax,(%r12)
mov    0x8(%rsp),%rax
mov    %rax,(%r14)
test   %r13,%r13
je     11cc <get_aux_data+0x4c>
mov    %r13,%rdi
call   1030 <free@plt>
jmp    11cc <get_aux_data+0x4c>

LLVM IR (-O0):
@.str = [3 x i8] c"SV\00"
@.str.1 = [4 x i8] c"len\00"
@.str.2 = [4 x i8] c"off\00"
@stderr = global i32 0
@.str.3 = [22 x i8] c"Line %3d of File %s \0A\00"
@.str.4 = [152 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/dbauxil.c\00"
@.str.5 = [2 x i8] c".\00"
define i32 @get_aux_data(i8* %0, i8* %1, i8* %2, i8** %3, i64* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8**
%11 = alloca i64*
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i64
%15 = alloca i8*
%16 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8** %3, i8*** %10
store i64* %4, i64** %11
store i32 0, i32* %12
store i8* null, i8** %13
store i64 0, i64* %14
store i8* null, i8** %15
%17 = load i8**, i8*** %10
store i8* null, i8** %17
%18 = load i8*, i8** %8
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %5
%22 = load i32, i32* %12
store i32 %22, i32* %6
br label %76
23: ; preds = %5
%24 = load i8*, i8** %9
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %34
27: ; preds = %23
%28 = load i8*, i8** %9
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %27
%32 = load i32, i32* @stderr
%33 = call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 97, i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %12
br label %64
34: ; preds = %27, %23
%35 = load i8*, i8** %7
%36 = call i32 @strlen(i8* %35)
store i32 %36, i32* %16
%37 = load i32, i32* %16
%38 = add nsw i32 %37, 1
%39 = load i8*, i8** %9
%40 = call i32 @strlen(i8* %39)
%41 = add nsw i32 %38, %40
%42 = add nsw i32 %41, 1
%43 = add nsw i32 %42, 1
%44 = call i8* @malloc(i32 %43)
store i8* %44, i8** %15
%45 = load i8*, i8** %15
%46 = call i32 @strcpy(i8* %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%47 = load i8*, i8** %15
%48 = load i8*, i8** %9
%49 = call i32 @strcat(i8* %47, i8* %48)
%50 = load i8*, i8** %15
%51 = call i32 @strcat(i8* %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%52 = load i8*, i8** %15
%53 = load i8*, i8** %7
%54 = call i32 @strcat(i8* %52, i8* %53)
%55 = load i8*, i8** %15
%56 = call i32 @rs_mmap(i8* %55, i8** %13, i64* %14, i32 0)
store i32 %56, i32* %12
%57 = load i32, i32* %12
%58 = icmp slt i32 %57, 0
br i1 %58, label %59, label %63
59: ; preds = %34
%60 = load i32, i32* @stderr
%61 = call i32 @fprintf(i32 %60, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 106, i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str.4, i64 0, i64 0))
%62 = load i32, i32* %12
store i32 %62, i32* %12
br label %64
63: ; preds = %34
br label %64
64: ; preds = %63, %59, %31
%65 = load i8*, i8** %13
%66 = load i8**, i8*** %10
store i8* %65, i8** %66
%67 = load i64, i64* %14
%68 = load i64*, i64** %11
store i64 %67, i64* %68
%69 = load i8*, i8** %15
%70 = icmp ne i8* %69, null
br i1 %70, label %71, label %74
71: ; preds = %64
%72 = load i8*, i8** %15
%73 = call i32 @free(i8* %72)
store i8* null, i8** %15
br label %74
74: ; preds = %71, %64
%75 = load i32, i32* %12
store i32 %75, i32* %6
br label %76
76: ; preds = %74, %21
%77 = load i32, i32* %6
ret i32 %77
}

LLVM IR (-O2):
@.str = [3 x i8] c"SV\00"
@.str.1 = [4 x i8] c"len\00"
@.str.2 = [4 x i8] c"off\00"
@stderr = global i32 0
@.str.3 = [22 x i8] c"Line %3d of File %s \0A\00"
@.str.4 = [152 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/dbauxil.c\00"
@.str.5 = [2 x i8] c".\00"
define i32 @get_aux_data(i8* %0, i8* %1, i8* %2, i8** nocapture writeonly %3, i64* nocapture writeonly %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = bitcast i8** %6 to i8*
store i8* null, i8** %6
%9 = bitcast i64* %7 to i8*
store i64 0, i64* %7
store i8* null, i8** %3
%10 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %42
12: ; preds = %5
%13 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %21, label %15
15: ; preds = %12
%16 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = load i32, i32* @stderr
%20 = tail call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 97, i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str.4, i64 0, i64 0))
store i8* null, i8** %3
store i64 0, i64* %4
br label %42
21: ; preds = %15, %12
%22 = tail call i32 @strlen(i8* %0)
%23 = tail call i32 @strlen(i8* %2)
%24 = add i32 %22, 3
%25 = add i32 %24, %23
%26 = tail call i8* @malloc(i32 %25)
%27 = tail call i32 @strcpy(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%28 = tail call i32 @strcat(i8* %26, i8* %2)
%29 = tail call i32 @strcat(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%30 = tail call i32 @strcat(i8* %26, i8* %0)
%31 = call i32 @rs_mmap(i8* %26, i8** %6, i64* %7, i32 0)
%32 = icmp slt i32 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %21
%34 = load i32, i32* @stderr
%35 = call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 106, i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str.4, i64 0, i64 0))
br label %36
36: ; preds = %21, %33
%37 = load i8*, i8** %6
store i8* %37, i8** %3
%38 = load i64, i64* %7
store i64 %38, i64* %4
%39 = icmp eq i8* %26, null
br i1 %39, label %42, label %40
40: ; preds = %36
%41 = call i32 @free(i8* %26)
br label %42
42: ; preds = %18, %36, %40, %5
%43 = phi i32 [ 0, %5 ], [ %31, %40 ], [ %31, %36 ], [ -1, %18 ]
ret i32 %43
}