#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*/ Rfree(char *, char *);
char *Rstrdup(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void Test2(void) {
  char *str =
      Rstrdup(("0"), "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                     "outputs/2022-01-22/02-19-57/repos/Tathar/roclick/refs/"
                     "heads/master/src/rmalloc/rtest.c"
                     ":"
                     "161");
  strcpy(str, "012long");
  Rfree((str), "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/Tathar/roclick/refs/heads/"
               "master/src/rmalloc/rtest.c"
               ":"
               "163");
}


x86 assembly (clang, -O0):
<Test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1050 <Rstrdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xf3b(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
lea    0xf33(%rip),%rsi
call   1040 <Rfree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Test2>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xec3(%rip),%rsi
call   1050 <Rstrdup@plt>
mov    %rax,%rbx
lea    0xf47(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
lea    0xf40(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <Rfree@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
@.str.1 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Tathar/roclick/refs/heads/master/src/rmalloc/rtest.c:161\00"
@.str.2 = [8 x i8] c"012long\00"
@.str.3 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Tathar/roclick/refs/heads/master/src/rmalloc/rtest.c:163\00"
define void @Test2() {
%1 = alloca i8*
%2 = call i8* @Rstrdup(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%5 = load i8*, i8** %1
%6 = call i32 @Rfree(i8* %5, i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
@.str.1 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Tathar/roclick/refs/heads/master/src/rmalloc/rtest.c:161\00"
@.str.2 = [8 x i8] c"012long\00"
@.str.3 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Tathar/roclick/refs/heads/master/src/rmalloc/rtest.c:163\00"
define void @Test2() {
%1 = tail call i8* @Rstrdup(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @Rfree(i8* %1, i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.3, i64 0, i64 0))
ret void
}