#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 type {
  int dummy;
};
struct triple {
  int dummy;
};
struct compile_state {
  int dummy;
};

/* Variables and functions */
struct triple *read_expr(struct compile_state *, struct triple *);
struct triple *triple(struct compile_state *, int, struct type *,
                      struct triple *, int /*<<< orphan*/);
struct triple *mk_cast_expr(struct compile_state *state, struct type *type,
                            struct triple *expr) {
  struct triple *def;
  def = read_expr(state, expr);
  def = triple(state, 63, type, def, 0);
  return def;
}


x86 assembly (clang, -O0):
<mk_cast_expr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <read_expr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x3f,%esi
xor    %r8d,%r8d
call   1040 <triple@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk_cast_expr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdx,%rsi
call   1030 <read_expr@plt>
mov    %rbx,%rdi
mov    $0x3f,%esi
mov    %r14,%rdx
mov    %rax,%rcx
xor    %r8d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <triple@plt>

LLVM IR (-O0):
%struct.compile_state = type { i32 }
%struct.type = type { i32 }
%struct.triple = type { i32 }
define %struct.triple* @mk_cast_expr(%struct.compile_state* %0, %struct.type* %1, %struct.triple* %2) {
%4 = alloca %struct.compile_state*
%5 = alloca %struct.type*
%6 = alloca %struct.triple*
%7 = alloca %struct.triple*
store %struct.compile_state* %0, %struct.compile_state** %4
store %struct.type* %1, %struct.type** %5
store %struct.triple* %2, %struct.triple** %6
%8 = load %struct.compile_state*, %struct.compile_state** %4
%9 = load %struct.triple*, %struct.triple** %6
%10 = call %struct.triple* @read_expr(%struct.compile_state* %8, %struct.triple* %9)
store %struct.triple* %10, %struct.triple** %7
%11 = load %struct.compile_state*, %struct.compile_state** %4
%12 = load %struct.type*, %struct.type** %5
%13 = load %struct.triple*, %struct.triple** %7
%14 = call %struct.triple* @triple(%struct.compile_state* %11, i32 63, %struct.type* %12, %struct.triple* %13, i32 0)
store %struct.triple* %14, %struct.triple** %7
%15 = load %struct.triple*, %struct.triple** %7
ret %struct.triple* %15
}

LLVM IR (-O2):
%struct.compile_state = type { i32 }
%struct.type = type { i32 }
%struct.triple = type { i32 }
define %struct.triple* @mk_cast_expr(%struct.compile_state* %0, %struct.type* %1, %struct.triple* %2) {
%4 = tail call %struct.triple* @read_expr(%struct.compile_state* %0, %struct.triple* %2)
%5 = tail call %struct.triple* @triple(%struct.compile_state* %0, i32 63, %struct.type* %1, %struct.triple* %4, i32 0)
ret %struct.triple* %5
}