#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*/ sprintf(char *, char *, char *, char *, int, int, int, int,
                           int);
int /*<<< orphan*/ write_imatrix(int **, long, long, long, long, char *,
                                 char *);
void save_imatrix2(int **m, long nrl, long nrh, long ncl, long nch, char *path,
                   char *filename, int seuil, int nb_iter, int balayage,
                   int maj, int alpha_update) {
  static char complete_filename[256];
  sprintf(complete_filename, "%s/%s_%d_%d_%d_%d_%d.txt", path, filename, seuil,
          nb_iter, balayage, maj, alpha_update);
  write_imatrix(m, nrl, nrh, ncl, nch, "%10d", complete_filename);
}


x86 assembly (clang, -O0):
<save_imatrix2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    0x10(%rbp),%rcx
mov    0x18(%rbp),%r8d
mov    0x20(%rbp),%r9d
mov    0x28(%rbp),%r11d
mov    0x30(%rbp),%r10d
mov    0x38(%rbp),%eax
lea    0x2ecb(%rip),%rdi
lea    0xe84(%rip),%rsi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
lea    0xe70(%rip),%r9
lea    0x2e90(%rip),%rax
mov    %rax,(%rsp)
call   1030 <write_imatrix@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_imatrix2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%rax
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%rbx
mov    0x40(%rsp),%rcx
mov    0x48(%rsp),%r8d
mov    0x50(%rsp),%r9d
mov    0x60(%rsp),%r11d
mov    0x68(%rsp),%r10d
sub    $0x8,%rsp
lea    0x2edf(%rip),%rbp
lea    0xe98(%rip),%rsi
mov    %rbp,%rdi
mov    %rax,%rdx
push   %r10
push   %r11
mov    0x70(%rsp),%eax
push   %rax
call   1040 <sprintf@plt>
add    $0x18,%rsp
lea    0xe92(%rip),%r9
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14,%r8
push   %rbp
call   1030 <write_imatrix@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@save_imatrix2.complete_filename = internal global [256 x i8] zeroinitializer
@.str = [25 x i8] c"%s/%s_%d_%d_%d_%d_%d.txt\00"
@.str.1 = [5 x i8] c"%10d\00"
define void @save_imatrix2(i32** %0, i64 %1, i64 %2, i64 %3, i64 %4, i8* %5, i8* %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11) {
%13 = alloca i32**
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca i8*
%19 = alloca i8*
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
store i32** %0, i32*** %13
store i64 %1, i64* %14
store i64 %2, i64* %15
store i64 %3, i64* %16
store i64 %4, i64* %17
store i8* %5, i8** %18
store i8* %6, i8** %19
store i32 %7, i32* %20
store i32 %8, i32* %21
store i32 %9, i32* %22
store i32 %10, i32* %23
store i32 %11, i32* %24
%25 = load i8*, i8** %18
%26 = load i8*, i8** %19
%27 = load i32, i32* %20
%28 = load i32, i32* %21
%29 = load i32, i32* %22
%30 = load i32, i32* %23
%31 = load i32, i32* %24
%32 = call i32 @sprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @save_imatrix2.complete_filename, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %25, i8* %26, i32 %27, i32 %28, i32 %29, i32 %30, i32 %31)
%33 = load i32**, i32*** %13
%34 = load i64, i64* %14
%35 = load i64, i64* %15
%36 = load i64, i64* %16
%37 = load i64, i64* %17
%38 = call i32 @write_imatrix(i32** %33, i64 %34, i64 %35, i64 %36, i64 %37, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([256 x i8], [256 x i8]* @save_imatrix2.complete_filename, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@save_imatrix2.complete_filename = internal global [256 x i8] zeroinitializer
@.str = [25 x i8] c"%s/%s_%d_%d_%d_%d_%d.txt\00"
@.str.1 = [5 x i8] c"%10d\00"
define void @save_imatrix2(i32** %0, i64 %1, i64 %2, i64 %3, i64 %4, i8* %5, i8* %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11) {
%13 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([256 x i8], [256 x i8]* @save_imatrix2.complete_filename, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11)
%14 = tail call i32 @write_imatrix(i32** %0, i64 %1, i64 %2, i64 %3, i64 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([256 x i8], [256 x i8]* @save_imatrix2.complete_filename, i64 0, i64 0))
ret void
}