#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*/ fprintf(int /*<<< orphan*/, char *, ...);
void *hash_init(char const *);
int /*<<< orphan*/ hash_read(void *);
int /*<<< orphan*/ hash_set_path(void *, char const *);
int /*<<< orphan*/ hash_write(void *);
int /*<<< orphan*/ stderr;
void customer_c2v_backup(const char *filepath, const char *newfilepath) {
  fprintf(stderr, "Starting to generate backup c2v file %s to %s\n", filepath,
          newfilepath);
  void *ptr = hash_init(filepath);
  hash_read(ptr);
  hash_set_path(ptr, newfilepath);
  hash_write(ptr);
  fprintf(stderr, "Backup operation is done .Send backup c2v file to Vendor to "
                  "generate license key\n");
}


x86 assembly (clang, -O0):
<customer_c2v_backup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe88(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <hash_init@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <hash_read@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1070 <hash_set_path@plt>
mov    -0x18(%rbp),%rdi
call   1040 <hash_write@plt>
mov    0x2e2e(%rip),%rax
mov    (%rax),%edi
lea    0xe74(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<customer_c2v_backup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2e7e(%rip),%r15
mov    (%r15),%edi
lea    0xe94(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <hash_init@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <hash_read@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <hash_set_path@plt>
mov    %rbx,%rdi
call   1040 <hash_write@plt>
mov    (%r15),%edi
lea    0xe86(%rip),%rsi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"Starting to generate backup c2v file %s to %s\0A\00"
@.str.1 = [82 x i8] c"Backup operation is done .Send backup c2v file to Vendor to generate license key\0A\00"
define void @customer_c2v_backup(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = load i8*, i8** %3
%11 = call i8* @hash_init(i8* %10)
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = call i32 @hash_read(i8* %12)
%14 = load i8*, i8** %5
%15 = load i8*, i8** %4
%16 = call i32 @hash_set_path(i8* %14, i8* %15)
%17 = load i8*, i8** %5
%18 = call i32 @hash_write(i8* %17)
%19 = load i32, i32* @stderr
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"Starting to generate backup c2v file %s to %s\0A\00"
@.str.1 = [82 x i8] c"Backup operation is done .Send backup c2v file to Vendor to generate license key\0A\00"
define void @customer_c2v_backup(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = tail call i8* @hash_init(i8* %0)
%6 = tail call i32 @hash_read(i8* %5)
%7 = tail call i32 @hash_set_path(i8* %5, i8* %1)
%8 = tail call i32 @hash_write(i8* %5)
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.1, i64 0, i64 0))
ret void
}