#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 */

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc_or_die(scalar_t__);
int /*<<< orphan*/ print_name_and_dvalue(char *, double);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
scalar_t__ strlen(char *);
void print_name3_and_dvalue(char *a, char *b, char *c, double value) {
  char *name = malloc_or_die(strlen(a) + strlen(b) + strlen(c) + 3);
  sprintf(name, "%s_%s_%s", a, b, c);
  print_name_and_dvalue(name, value);
  free(name);
}


x86 assembly (clang, -O0):
<print_name3_and_dvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rdi
add    %rax,%rdi
add    $0x3,%rdi
call   1060 <malloc_or_die@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xe3f(%rip),%rsi
call   1070 <sprintf@plt>
mov    -0x28(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
call   1050 <print_name_and_dvalue@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_name3_and_dvalue>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r13
call   1040 <strlen@plt>
mov    %rax,%r12
mov    %r15,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
add    %r12,%rbx
lea    (%rax,%rbx,1),%rdi
add    $0x3,%rdi
call   1060 <malloc_or_die@plt>
mov    %rax,%rbx
lea    0xe5f(%rip),%rsi
mov    %rax,%rdi
mov    %r13,%rdx
mov    %r15,%rcx
mov    %r14,%r8
call   1070 <sprintf@plt>
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
call   1050 <print_name_and_dvalue@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%s_%s_%s\00"
define void @print_name3_and_dvalue(i8* %0, i8* %1, i8* %2, double %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca double
%9 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store double %3, double* %8
%10 = load i8*, i8** %5
%11 = call i64 @strlen(i8* %10)
%12 = load i8*, i8** %6
%13 = call i64 @strlen(i8* %12)
%14 = add nsw i64 %11, %13
%15 = load i8*, i8** %7
%16 = call i64 @strlen(i8* %15)
%17 = add nsw i64 %14, %16
%18 = add nsw i64 %17, 3
%19 = call i8* @malloc_or_die(i64 %18)
store i8* %19, i8** %9
%20 = load i8*, i8** %9
%21 = load i8*, i8** %5
%22 = load i8*, i8** %6
%23 = load i8*, i8** %7
%24 = call i32 @sprintf(i8* %20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %21, i8* %22, i8* %23)
%25 = load i8*, i8** %9
%26 = load double, double* %8
%27 = call i32 @print_name_and_dvalue(i8* %25, double %26)
%28 = load i8*, i8** %9
%29 = call i32 @free(i8* %28)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s_%s_%s\00"
define void @print_name3_and_dvalue(i8* %0, i8* %1, i8* %2, double %3) {
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%7 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%8 = add i64 %5, 3
%9 = add i64 %8, %6
%10 = add i64 %9, %7
%11 = tail call i8* @malloc_or_die(i64 %10)
%12 = tail call i32 @sprintf(i8* dereferenceable(1) %11, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
%13 = tail call i32 @print_name_and_dvalue(i8* %11, double %3)
%14 = tail call i32 @free(i8* %11)
ret void
}