#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*/ free(char *);
char *safestrdup(char const *, char *, int);
char *Set_DYN(char **v, const char *s) {
  char *t = *v;
  *v = 0;
  if (s && *s)
    *v = safestrdup(
        s,
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/AndreyPopovNew/asuswrt-merlin-rt-n/refs/"
        "heads/374.43_2-update/release/src/router/LPRng/src/common/linelist.c",
        2207);
  if (t)
    free(t);
  return (*v);
}


x86 assembly (clang, -O0):
<Set_DYN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     1180 <Set_DYN+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1180 <Set_DYN+0x60>
mov    -0x10(%rbp),%rdi
lea    0xe94(%rip),%rsi
mov    $0x89f,%edx
call   1030 <safestrdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1194 <Set_DYN+0x74>
mov    -0x18(%rbp),%rdi
call   1040 <free@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Set_DYN>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%r14
movq   $0x0,(%rdi)
test   %rsi,%rsi
je     115c <Set_DYN+0x3c>
cmpb   $0x0,(%rsi)
je     115c <Set_DYN+0x3c>
lea    0xebe(%rip),%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x89f,%edx
call   1030 <safestrdup@plt>
mov    %rax,(%rbx)
test   %r14,%r14
jne    1163 <Set_DYN+0x43>
jmp    116e <Set_DYN+0x4e>
xor    %eax,%eax
test   %r14,%r14
je     116e <Set_DYN+0x4e>
mov    %r14,%rdi
call   1040 <free@plt>
mov    (%rbx),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [199 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AndreyPopovNew/asuswrt-merlin-rt-n/refs/heads/374.43_2-update/release/src/router/LPRng/src/common/linelist.c\00"
define i8* @Set_DYN(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %3
store i8* null, i8** %8
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %20
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %11
%17 = load i8*, i8** %4
%18 = call i8* @safestrdup(i8* %17, i8* getelementptr inbounds ([199 x i8], [199 x i8]* @.str, i64 0, i64 0), i32 2207)
%19 = load i8**, i8*** %3
store i8* %18, i8** %19
br label %20
20: ; preds = %16, %11, %2
%21 = load i8*, i8** %5
%22 = icmp ne i8* %21, null
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i8*, i8** %5
%25 = call i32 @free(i8* %24)
br label %26
26: ; preds = %23, %20
%27 = load i8**, i8*** %3
%28 = load i8*, i8** %27
ret i8* %28
}

LLVM IR (-O2):
@.str = [199 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AndreyPopovNew/asuswrt-merlin-rt-n/refs/heads/374.43_2-update/release/src/router/LPRng/src/common/linelist.c\00"
define i8* @Set_DYN(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
store i8* null, i8** %0
%4 = icmp eq i8* %1, null
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = load i8, i8* %1
%7 = icmp eq i8 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i8* @safestrdup(i8* %1, i8* getelementptr inbounds ([199 x i8], [199 x i8]* @.str, i64 0, i64 0), i32 2207)
store i8* %9, i8** %0
br label %10
10: ; preds = %8, %5, %2
%11 = phi i8* [ %9, %8 ], [ null, %5 ], [ null, %2 ]
%12 = icmp eq i8* %3, null
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = tail call i32 @free(i8* %3)
%15 = load i8*, i8** %0
br label %16
16: ; preds = %13, %10
%17 = phi i8* [ %15, %13 ], [ %11, %10 ]
ret i8* %17
}