char *xset(cp, vp)
char *cp, ***vp;
{
  register char *dp;
  if (*cp) {
    dp = savestr(cp);
    --(*vp);
    xfree(**vp);
    **vp = dp;
  }
  return (putn(expr(vp)));
}


x86 assembly (clang, -O0):
<xset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     119b <xset+0x5b>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1060 <savestr@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0xfffffffffffffff8,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1040 <xfree@plt>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <expr@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1030 <putn@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xset>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
cmpb   $0x0,(%rdi)
je     1171 <xset+0x31>
xor    %eax,%eax
call   1060 <savestr@plt>
movslq %eax,%r14
mov    (%rbx),%rax
lea    -0x8(%rax),%rcx
mov    %rcx,(%rbx)
mov    -0x8(%rax),%rdi
xor    %eax,%eax
call   1040 <xfree@plt>
mov    (%rbx),%rax
mov    %r14,(%rax)
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <expr@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1030 <putn@plt>
cltq
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xset(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
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %24
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @savestr to i32 (i8*, ...)*)(i8* %10)
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %5
%14 = load i8***, i8**** %4
%15 = load i8**, i8*** %14
%16 = getelementptr inbounds i8*, i8** %15, i32 -1
store i8** %16, i8*** %14
%17 = load i8***, i8**** %4
%18 = load i8**, i8*** %17
%19 = load i8*, i8** %18
%20 = call i32 (i8*, ...) bitcast (i32 (...)* @xfree to i32 (i8*, ...)*)(i8* %19)
%21 = load i8*, i8** %5
%22 = load i8***, i8**** %4
%23 = load i8**, i8*** %22
store i8* %21, i8** %23
br label %24
24: ; preds = %9, %2
%25 = load i8***, i8**** %4
%26 = call i32 (i8***, ...) bitcast (i32 (...)* @expr to i32 (i8***, ...)*)(i8*** %25)
%27 = call i32 (i32, ...) bitcast (i32 (...)* @putn to i32 (i32, ...)*)(i32 %26)
%28 = sext i32 %27 to i64
%29 = inttoptr i64 %28 to i8*
ret i8* %29
}

LLVM IR (-O2):
define i8* @xset(i8* %0, i8*** %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @savestr to i32 (i8*, ...)*)(i8* %0)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = load i8**, i8*** %1
%10 = getelementptr inbounds i8*, i8** %9, i64 -1
store i8** %10, i8*** %1
%11 = load i8*, i8** %10
%12 = tail call i32 (i8*, ...) bitcast (i32 (...)* @xfree to i32 (i8*, ...)*)(i8* %11)
%13 = load i8**, i8*** %1
store i8* %8, i8** %13
br label %14
14: ; preds = %5, %2
%15 = tail call i32 (i8***, ...) bitcast (i32 (...)* @expr to i32 (i8***, ...)*)(i8*** %1)
%16 = tail call i32 (i32, ...) bitcast (i32 (...)* @putn to i32 (i32, ...)*)(i32 %15)
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i8*
ret i8* %18
}