#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 */
char *getenv(char *);
int /*<<< orphan*/ q_internal(char const *, char *, int);
int /*<<< orphan*/ s_internal(char *, char *, char *, int);
char *substitute_char(char, char, int /*<<< orphan*/);
char *_getenv(const char *name) {
  char *name_ = substitute_char(
      '_', '.',
      (q_internal(name,
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/guicho271828/roswell/refs/"
                  "heads/master/src/opt.c",
                  113)));
  char *ret = getenv(name_);
  (s_internal(name_, "name_",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/guicho271828/roswell/refs/heads/"
              "master/src/opt.c",
              115));
  return ret;
}


x86 assembly (clang, -O0):
<_getenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
mov    $0x71,%edx
call   1060 <q_internal@plt>
mov    %eax,%edx
mov    $0x5f,%edi
mov    $0x2e,%esi
call   1050 <substitute_char@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xefd(%rip),%rsi
lea    0xe6b(%rip),%rdx
mov    $0x73,%ecx
call   1040 <s_internal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_getenv>:
push   %r15
push   %r14
push   %rbx
lea    0xeb4(%rip),%r14
mov    %r14,%rsi
mov    $0x71,%edx
call   1060 <q_internal@plt>
mov    $0x5f,%edi
mov    $0x2e,%esi
mov    %eax,%edx
call   1050 <substitute_char@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <getenv@plt>
mov    %rax,%r15
lea    0xf0c(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
mov    $0x73,%ecx
call   1040 <s_internal@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/guicho271828/roswell/refs/heads/master/src/opt.c\00"
@.str.1 = [6 x i8] c"name_\00"
define i8* @_getenv(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @q_internal(i8* %5, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 113)
%7 = call i8* @substitute_char(i8 signext 95, i8 signext 46, i32 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i8* @getenv(i8* %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %3
%11 = call i32 @s_internal(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 115)
%12 = load i8*, i8** %4
ret i8* %12
}

LLVM IR (-O2):
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/guicho271828/roswell/refs/heads/master/src/opt.c\00"
@.str.1 = [6 x i8] c"name_\00"
define i8* @_getenv(i8* %0) {
%2 = tail call i32 @q_internal(i8* %0, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 113)
%3 = tail call i8* @substitute_char(i8 signext 95, i8 signext 46, i32 %2)
%4 = tail call i8* @getenv(i8* %3)
%5 = tail call i32 @s_internal(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 115)
ret i8* %4
}