#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 trace_type_definition {
  int dummy;
};
struct trace_param_descriptor {
  int dummy;
};
struct trace_log_descriptor {
  int dummy;
};
struct trace_enum_value {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ copy_log_descriptors_to_allocated_buffer(
    unsigned int, struct trace_log_descriptor *,
    struct trace_param_descriptor *, char **);
int /*<<< orphan*/
copy_type_definitions_to_allocated_buffer(struct trace_type_definition *,
                                          struct trace_enum_value *, char **);
void copy_metadata_to_allocated_buffer(
    unsigned int log_descriptor_count, struct trace_log_descriptor *log_desc,
    struct trace_param_descriptor *params,
    struct trace_type_definition *type_definition,
    struct trace_enum_value *enum_values, char **string_table) {
  copy_log_descriptors_to_allocated_buffer(log_descriptor_count, log_desc,
                                           params, string_table);
  copy_type_definitions_to_allocated_buffer(type_definition, enum_values,
                                            string_table);
}


x86 assembly (clang, -O0):
<copy_metadata_to_allocated_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x30(%rbp),%rcx
call   1030 <copy_log_descriptors_to_allocated_buffer@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1040 <copy_type_definitions_to_allocated_buffer@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_metadata_to_allocated_buffer>:
push   %r15
push   %r14
push   %rbx
mov    %r9,%rbx
mov    %r8,%r14
mov    %rcx,%r15
mov    %r9,%rcx
call   1030 <copy_log_descriptors_to_allocated_buffer@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <copy_type_definitions_to_allocated_buffer@plt>

LLVM IR (-O0):
%struct.trace_log_descriptor = type { i32 }
%struct.trace_param_descriptor = type { i32 }
%struct.trace_type_definition = type { i32 }
%struct.trace_enum_value = type { i32 }
define void @copy_metadata_to_allocated_buffer(i32 %0, %struct.trace_log_descriptor* %1, %struct.trace_param_descriptor* %2, %struct.trace_type_definition* %3, %struct.trace_enum_value* %4, i8** %5) {
%7 = alloca i32
%8 = alloca %struct.trace_log_descriptor*
%9 = alloca %struct.trace_param_descriptor*
%10 = alloca %struct.trace_type_definition*
%11 = alloca %struct.trace_enum_value*
%12 = alloca i8**
store i32 %0, i32* %7
store %struct.trace_log_descriptor* %1, %struct.trace_log_descriptor** %8
store %struct.trace_param_descriptor* %2, %struct.trace_param_descriptor** %9
store %struct.trace_type_definition* %3, %struct.trace_type_definition** %10
store %struct.trace_enum_value* %4, %struct.trace_enum_value** %11
store i8** %5, i8*** %12
%13 = load i32, i32* %7
%14 = load %struct.trace_log_descriptor*, %struct.trace_log_descriptor** %8
%15 = load %struct.trace_param_descriptor*, %struct.trace_param_descriptor** %9
%16 = load i8**, i8*** %12
%17 = call i32 @copy_log_descriptors_to_allocated_buffer(i32 %13, %struct.trace_log_descriptor* %14, %struct.trace_param_descriptor* %15, i8** %16)
%18 = load %struct.trace_type_definition*, %struct.trace_type_definition** %10
%19 = load %struct.trace_enum_value*, %struct.trace_enum_value** %11
%20 = load i8**, i8*** %12
%21 = call i32 @copy_type_definitions_to_allocated_buffer(%struct.trace_type_definition* %18, %struct.trace_enum_value* %19, i8** %20)
ret void
}

LLVM IR (-O2):
%struct.trace_log_descriptor = type { i32 }
%struct.trace_param_descriptor = type { i32 }
%struct.trace_type_definition = type { i32 }
%struct.trace_enum_value = type { i32 }
define void @copy_metadata_to_allocated_buffer(i32 %0, %struct.trace_log_descriptor* %1, %struct.trace_param_descriptor* %2, %struct.trace_type_definition* %3, %struct.trace_enum_value* %4, i8** %5) {
%7 = tail call i32 @copy_log_descriptors_to_allocated_buffer(i32 %0, %struct.trace_log_descriptor* %1, %struct.trace_param_descriptor* %2, i8** %5)
%8 = tail call i32 @copy_type_definitions_to_allocated_buffer(%struct.trace_type_definition* %3, %struct.trace_enum_value* %4, i8** %5)
ret void
}