#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 */
double DBL_DIG;
scalar_t__ malloc(size_t);
int /*<<< orphan*/ sprintf(char *, char *, char const *, char const *, int, int,
                           unsigned int, double, double const);
int strlen(char const *);
char *format_file_full_path(const char *path, const char *prefix, int rows,
                            int columns, unsigned int seed,
                            const double other) {
  size_t file_full_path_length;
  char *file_full_path;
  file_full_path_length = strlen(path) + strlen(prefix) + 160;
  file_full_path = (char *)malloc(file_full_path_length * sizeof(char));
  sprintf(file_full_path, "%s/%s_%dx%d_%u_%.*e.csv", path, prefix, rows,
          columns, seed, DBL_DIG - 1, other);
  return file_full_path;
}


x86 assembly (clang, -O0):
<format_file_full_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
add    %ecx,%eax
add    $0xa0,%eax
cltq
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
shl    $0x0,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x1c(%rbp),%eax
mov    0x2e43(%rip),%rsi
movsd  (%rsi),%xmm0
movsd  0xe4f(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
lea    0xe47(%rip),%rsi
mov    %eax,(%rsp)
call   1050 <sprintf@plt>
mov    -0x38(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_file_full_path>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
mov    %r8d,%r12d
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,%r13
mov    %rdi,%rbp
call   1030 <strlen@plt>
mov    %eax,%ebx
mov    %r13,%rdi
call   1030 <strlen@plt>
add    %ebx,%eax
add    $0xa0,%eax
movslq %eax,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    0x2e6d(%rip),%rax
movsd  (%rax),%xmm0
addsd  0xe79(%rip),%xmm0
mov    %r12d,(%rsp)
lea    0xe76(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
mov    %r13,%rcx
mov    %r15d,%r8d
mov    %r14d,%r9d
movsd  0x10(%rsp),%xmm1
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"%s/%s_%dx%d_%u_%.*e.csv\00"
@DBL_DIG = global double 0.000000e+00
define i8* @format_file_full_path(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, double %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca double
%13 = alloca i64
%14 = alloca i8*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store double %5, double* %12
%15 = load i8*, i8** %7
%16 = call i32 @strlen(i8* %15)
%17 = load i8*, i8** %8
%18 = call i32 @strlen(i8* %17)
%19 = add nsw i32 %16, %18
%20 = add nsw i32 %19, 160
%21 = sext i32 %20 to i64
store i64 %21, i64* %13
%22 = load i64, i64* %13
%23 = mul i64 %22, 1
%24 = call i64 @malloc(i64 %23)
%25 = inttoptr i64 %24 to i8*
store i8* %25, i8** %14
%26 = load i8*, i8** %14
%27 = load i8*, i8** %7
%28 = load i8*, i8** %8
%29 = load i32, i32* %9
%30 = load i32, i32* %10
%31 = load i32, i32* %11
%32 = load double, double* @DBL_DIG
%33 = fsub double %32, 1.000000e+00
%34 = load double, double* %12
%35 = call i32 @sprintf(i8* %26, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %27, i8* %28, i32 %29, i32 %30, i32 %31, double %33, double %34)
%36 = load i8*, i8** %14
ret i8* %36
}

LLVM IR (-O2):
@.str = [24 x i8] c"%s/%s_%dx%d_%u_%.*e.csv\00"
@DBL_DIG = global double 0.000000e+00
define i8* @format_file_full_path(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, double %5) {
%7 = tail call i32 @strlen(i8* %0)
%8 = tail call i32 @strlen(i8* %1)
%9 = add i32 %7, 160
%10 = add i32 %9, %8
%11 = sext i32 %10 to i64
%12 = tail call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i8*
%14 = load double, double* @DBL_DIG
%15 = fadd double %14, -1.000000e+00
%16 = tail call i32 @sprintf(i8* dereferenceable(1) %13, i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, double %15, double %5)
ret i8* %13
}