#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 */
struct plainstring {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ plainstring_add_plainstring(struct plainstring *,
                                               struct plainstring const *);
struct plainstring *plainstring_new_plainstring(struct plainstring *);
struct plainstring *plainstring_sum(struct plainstring *this_string,
                                    const struct plainstring *other) {
  struct plainstring *str = plainstring_new_plainstring(this_string);
  if ((str) && (other))
    plainstring_add_plainstring(str, other);
  return str;
}


x86 assembly (clang, -O0):
<plainstring_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <plainstring_new_plainstring@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1160 <plainstring_sum+0x40>
cmpq   $0x0,-0x10(%rbp)
je     1160 <plainstring_sum+0x40>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <plainstring_add_plainstring@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plainstring_sum>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <plainstring_new_plainstring@plt>
mov    %rax,%rbx
test   %r14,%r14
je     1144 <plainstring_sum+0x24>
test   %rbx,%rbx
je     1144 <plainstring_sum+0x24>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <plainstring_add_plainstring@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.plainstring = type { i32 }
define %struct.plainstring* @plainstring_sum(%struct.plainstring* %0, %struct.plainstring* %1) {
%3 = alloca %struct.plainstring*
%4 = alloca %struct.plainstring*
%5 = alloca %struct.plainstring*
store %struct.plainstring* %0, %struct.plainstring** %3
store %struct.plainstring* %1, %struct.plainstring** %4
%6 = load %struct.plainstring*, %struct.plainstring** %3
%7 = call %struct.plainstring* @plainstring_new_plainstring(%struct.plainstring* %6)
store %struct.plainstring* %7, %struct.plainstring** %5
%8 = load %struct.plainstring*, %struct.plainstring** %5
%9 = icmp ne %struct.plainstring* %8, null
br i1 %9, label %10, label %17
10: ; preds = %2
%11 = load %struct.plainstring*, %struct.plainstring** %4
%12 = icmp ne %struct.plainstring* %11, null
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load %struct.plainstring*, %struct.plainstring** %5
%15 = load %struct.plainstring*, %struct.plainstring** %4
%16 = call i32 @plainstring_add_plainstring(%struct.plainstring* %14, %struct.plainstring* %15)
br label %17
17: ; preds = %13, %10, %2
%18 = load %struct.plainstring*, %struct.plainstring** %5
ret %struct.plainstring* %18
}

LLVM IR (-O2):
%struct.plainstring = type { i32 }
define %struct.plainstring* @plainstring_sum(%struct.plainstring* %0, %struct.plainstring* %1) {
%3 = tail call %struct.plainstring* @plainstring_new_plainstring(%struct.plainstring* %0)
%4 = icmp ne %struct.plainstring* %3, null
%5 = icmp ne %struct.plainstring* %1, null
%6 = and i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @plainstring_add_plainstring(%struct.plainstring* %3, %struct.plainstring* %1)
br label %9
9: ; preds = %7, %2
ret %struct.plainstring* %3
}