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

/* Variables and functions */
struct triple *alloc_triple(struct compile_state *, int, struct type *, int,
                            int, struct occurance *);
struct occurance *new_occurance(struct compile_state *);
struct triple *new_triple(struct compile_state *state, int op,
                          struct type *type, int lhs, int rhs) {
  struct triple *ret;
  struct occurance *occurance;
  occurance = new_occurance(state);
  ret = alloc_triple(state, op, type, lhs, rhs, occurance);
  return ret;
}


x86 assembly (clang, -O0):
<new_triple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <new_occurance@plt>
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x30(%rbp),%r9
call   1030 <alloc_triple@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_triple>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %rdx,%r12
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <new_occurance@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r12,%rdx
mov    %r15d,%ecx
mov    %r14d,%r8d
mov    %rax,%r9
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <alloc_triple@plt>

LLVM IR (-O0):
%struct.triple = type { i32 }
%struct.compile_state = type { i32 }
%struct.type = type { i32 }
%struct.occurance = type { i32 }
define %struct.triple* @new_triple(%struct.compile_state* %0, i32 %1, %struct.type* %2, i32 %3, i32 %4) {
%6 = alloca %struct.compile_state*
%7 = alloca i32
%8 = alloca %struct.type*
%9 = alloca i32
%10 = alloca i32
%11 = alloca %struct.triple*
%12 = alloca %struct.occurance*
store %struct.compile_state* %0, %struct.compile_state** %6
store i32 %1, i32* %7
store %struct.type* %2, %struct.type** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%13 = load %struct.compile_state*, %struct.compile_state** %6
%14 = call %struct.occurance* @new_occurance(%struct.compile_state* %13)
store %struct.occurance* %14, %struct.occurance** %12
%15 = load %struct.compile_state*, %struct.compile_state** %6
%16 = load i32, i32* %7
%17 = load %struct.type*, %struct.type** %8
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = load %struct.occurance*, %struct.occurance** %12
%21 = call %struct.triple* @alloc_triple(%struct.compile_state* %15, i32 %16, %struct.type* %17, i32 %18, i32 %19, %struct.occurance* %20)
store %struct.triple* %21, %struct.triple** %11
%22 = load %struct.triple*, %struct.triple** %11
ret %struct.triple* %22
}

LLVM IR (-O2):
%struct.triple = type { i32 }
%struct.compile_state = type { i32 }
%struct.type = type { i32 }
%struct.occurance = type { i32 }
define %struct.triple* @new_triple(%struct.compile_state* %0, i32 %1, %struct.type* %2, i32 %3, i32 %4) {
%6 = tail call %struct.occurance* @new_occurance(%struct.compile_state* %0)
%7 = tail call %struct.triple* @alloc_triple(%struct.compile_state* %0, i32 %1, %struct.type* %2, i32 %3, i32 %4, %struct.occurance* %6)
ret %struct.triple* %7
}