char *PushString(struct Stack *Stk, char *Str) {
  if (!Stk || !Str)
    return (void *)0L;
  if (!InitString(Stk))
    return (void *)0L;
  if (!AddStr(Stk, Str))
    return (void *)0L;
  return Str;
}


x86 assembly (clang, -O0):
<PushString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <PushString+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1153 <PushString+0x33>
movq   $0x0,-0x8(%rbp)
jmp    11a1 <PushString+0x81>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <InitString@plt>
cmp    $0x0,%eax
jne    1174 <PushString+0x54>
movq   $0x0,-0x8(%rbp)
jmp    11a1 <PushString+0x81>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <AddStr@plt>
cmp    $0x0,%eax
jne    1199 <PushString+0x79>
movq   $0x0,-0x8(%rbp)
jmp    11a1 <PushString+0x81>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PushString>:
push   %r15
push   %r14
push   %rbx
xor    %r15d,%r15d
test   %rdi,%rdi
je     115c <PushString+0x3c>
mov    %rsi,%r14
test   %rsi,%rsi
je     115c <PushString+0x3c>
mov    %rdi,%rbx
xor    %r15d,%r15d
xor    %eax,%eax
call   1040 <InitString@plt>
test   %eax,%eax
je     115c <PushString+0x3c>
xor    %r15d,%r15d
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <AddStr@plt>
test   %eax,%eax
cmovne %r14,%r15
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.Stack = type opaque
define i8* @PushString(%struct.Stack* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca %struct.Stack*
%5 = alloca i8*
store %struct.Stack* %0, %struct.Stack** %4
store i8* %1, i8** %5
%6 = load %struct.Stack*, %struct.Stack** %4
%7 = icmp ne %struct.Stack* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %8, %2
store i8* null, i8** %3
br label %25
12: ; preds = %8
%13 = load %struct.Stack*, %struct.Stack** %4
%14 = call i32 (%struct.Stack*, ...) bitcast (i32 (...)* @InitString to i32 (%struct.Stack*, ...)*)(%struct.Stack* %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %12
store i8* null, i8** %3
br label %25
17: ; preds = %12
%18 = load %struct.Stack*, %struct.Stack** %4
%19 = load i8*, i8** %5
%20 = call i32 (%struct.Stack*, i8*, ...) bitcast (i32 (...)* @AddStr to i32 (%struct.Stack*, i8*, ...)*)(%struct.Stack* %18, i8* %19)
%21 = icmp ne i32 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %17
store i8* null, i8** %3
br label %25
23: ; preds = %17
%24 = load i8*, i8** %5
store i8* %24, i8** %3
br label %25
25: ; preds = %23, %22, %16, %11
%26 = load i8*, i8** %3
ret i8* %26
}

LLVM IR (-O2):
%struct.Stack = type opaque
define i8* @PushString(%struct.Stack* %0, i8* %1) {
%3 = icmp ne %struct.Stack* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = tail call i32 (%struct.Stack*, ...) bitcast (i32 (...)* @InitString to i32 (%struct.Stack*, ...)*)(%struct.Stack* %0)
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = tail call i32 (%struct.Stack*, i8*, ...) bitcast (i32 (...)* @AddStr to i32 (%struct.Stack*, i8*, ...)*)(%struct.Stack* %0, i8* %1)
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i8* null, i8* %1
br label %13
13: ; preds = %9, %6, %2
%14 = phi i8* [ null, %2 ], [ null, %6 ], [ %12, %9 ]
ret i8* %14
}