#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 object {
  int dummy;
};
struct expr {
  int dummy;
};
struct cond_expr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cond_expr_class_get();
int /*<<< orphan*/ cond_expr_init(struct cond_expr *, struct expr *,
                                  struct expr *, struct expr *);
struct object *object_new(int /*<<< orphan*/);
struct expr *cond_expr_new(struct expr *cond, struct expr *left,
                           struct expr *right) {
  struct object *expr = object_new(cond_expr_class_get());
  cond_expr_init(((struct cond_expr *)(expr)), cond, left, right);
  return ((struct expr *)(expr));
}


x86 assembly (clang, -O0):
<cond_expr_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <cond_expr_class_get@plt>
mov    %eax,%edi
call   1050 <object_new@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <cond_expr_init@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cond_expr_new>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
xor    %eax,%eax
call   1040 <cond_expr_class_get@plt>
mov    %eax,%edi
call   1050 <object_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <cond_expr_init@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.expr = type { i32 }
%struct.object = type { i32 }
%struct.cond_expr = type { i32 }
define %struct.expr* @cond_expr_new(%struct.expr* %0, %struct.expr* %1, %struct.expr* %2) {
%4 = alloca %struct.expr*
%5 = alloca %struct.expr*
%6 = alloca %struct.expr*
%7 = alloca %struct.object*
store %struct.expr* %0, %struct.expr** %4
store %struct.expr* %1, %struct.expr** %5
store %struct.expr* %2, %struct.expr** %6
%8 = call i32 (...) @cond_expr_class_get()
%9 = call %struct.object* @object_new(i32 %8)
store %struct.object* %9, %struct.object** %7
%10 = load %struct.object*, %struct.object** %7
%11 = bitcast %struct.object* %10 to %struct.cond_expr*
%12 = load %struct.expr*, %struct.expr** %4
%13 = load %struct.expr*, %struct.expr** %5
%14 = load %struct.expr*, %struct.expr** %6
%15 = call i32 @cond_expr_init(%struct.cond_expr* %11, %struct.expr* %12, %struct.expr* %13, %struct.expr* %14)
%16 = load %struct.object*, %struct.object** %7
%17 = bitcast %struct.object* %16 to %struct.expr*
ret %struct.expr* %17
}

LLVM IR (-O2):
%struct.expr = type { i32 }
%struct.object = type { i32 }
%struct.cond_expr = type { i32 }
define %struct.expr* @cond_expr_new(%struct.expr* %0, %struct.expr* %1, %struct.expr* %2) {
%4 = tail call i32 (...) @cond_expr_class_get()
%5 = tail call %struct.object* @object_new(i32 %4)
%6 = bitcast %struct.object* %5 to %struct.cond_expr*
%7 = tail call i32 @cond_expr_init(%struct.cond_expr* %6, %struct.expr* %0, %struct.expr* %1, %struct.expr* %2)
%8 = bitcast %struct.object* %5 to %struct.expr*
ret %struct.expr* %8
}