#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_ivector(int *, long, long, char *, char *);
void save_ivector(int *v, long nl, long nh, char *path, char *filename) {
  static char complete_filename[256];
  sprintf(complete_filename, "%s/%s", path, filename);
  write_ivector(v, nl, nh, "%4d", complete_filename);
}


x86 assembly (clang, -O0):
<save_ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0x2ef5(%rip),%rdi
lea    0xeae(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe9c(%rip),%rcx
lea    0x2ecf(%rip),%r8
call   1030 <write_ivector@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_ivector>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0x2f08(%rip),%r12
lea    0xec1(%rip),%rsi
mov    %r12,%rdi
mov    %rcx,%rdx
mov    %r8,%rcx
call   1040 <sprintf@plt>
lea    0xeb2(%rip),%rcx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %r12,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <write_ivector@plt>

LLVM IR (-O0):
@save_ivector.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_ivector(i32* %0, i64 %1, i64 %2, i8* %3, i8* %4) {
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i8*
store i32* %0, i32** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %9
%12 = load i8*, i8** %10
%13 = call i32 @sprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @save_ivector.complete_filename, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12)
%14 = load i32*, i32** %6
%15 = load i64, i64* %7
%16 = load i64, i64* %8
%17 = call i32 @write_ivector(i32* %14, i64 %15, i64 %16, 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_ivector.complete_filename, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@save_ivector.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_ivector(i32* %0, i64 %1, i64 %2, i8* %3, i8* %4) {
%6 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([256 x i8], [256 x i8]* @save_ivector.complete_filename, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%7 = tail call i32 @write_ivector(i32* %0, i64 %1, i64 %2, 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_ivector.complete_filename, i64 0, i64 0))
ret void
}