#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 /*<<< orphan*/ write_smatrix(short **, long, long, long, long, char *,
                                 char *);
void save_smatrix(short **m, long nrl, long nrh, long ncl, long nch, char *path,
                  char *filename) {
  static char complete_filename[256];
  sprintf(complete_filename, "%s/%s", path, filename);
  write_smatrix(m, nrl, nrh, ncl, nch, "%4d", complete_filename);
}


x86 assembly (clang, -O0):
<save_smatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
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
lea    0x2eed(%rip),%rdi
lea    0xea6(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
lea    0xe8c(%rip),%r9
lea    0x2ebf(%rip),%rax
mov    %rax,(%rsp)
call   1040 <write_smatrix@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_smatrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%rbx
mov    0x40(%rsp),%rcx
lea    0x2efa(%rip),%rbp
lea    0xeb3(%rip),%rsi
mov    %rbp,%rdi
mov    %r9,%rdx
call   1030 <sprintf@plt>
mov    %rbp,(%rsp)
lea    0xea3(%rip),%r9
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14,%r8
call   1040 <write_smatrix@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@save_smatrix.complete_filename = internal global [256 x i8] zeroinitializer
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [4 x i8] c"%4d\00"
define void @save_smatrix(i16** %0, i64 %1, i64 %2, i64 %3, i64 %4, i8* %5, i8* %6) {
%8 = alloca i16**
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i8*
%14 = alloca i8*
store i16** %0, i16*** %8
store i64 %1, i64* %9
store i64 %2, i64* %10
store i64 %3, i64* %11
store i64 %4, i64* %12
store i8* %5, i8** %13
store i8* %6, i8** %14
%15 = load i8*, i8** %13
%16 = load i8*, i8** %14
%17 = call i32 @sprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @save_smatrix.complete_filename, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %16)
%18 = load i16**, i16*** %8
%19 = load i64, i64* %9
%20 = load i64, i64* %10
%21 = load i64, i64* %11
%22 = load i64, i64* %12
%23 = call i32 @write_smatrix(i16** %18, i64 %19, i64 %20, i64 %21, i64 %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([256 x i8], [256 x i8]* @save_smatrix.complete_filename, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@save_smatrix.complete_filename = internal global [256 x i8] zeroinitializer
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [4 x i8] c"%4d\00"
define void @save_smatrix(i16** %0, i64 %1, i64 %2, i64 %3, i64 %4, i8* %5, i8* %6) {
%8 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([256 x i8], [256 x i8]* @save_smatrix.complete_filename, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%9 = tail call i32 @write_smatrix(i16** %0, i64 %1, i64 %2, i64 %3, i64 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([256 x i8], [256 x i8]* @save_smatrix.complete_filename, i64 0, i64 0))
ret void
}