#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*/ strcat(char *, char *);
int /*<<< orphan*/ system(char *);
void *bkp_file(void *args) {
  char **file = (char **)args;
  char command[50] = "cp ";
  strcat(command, *file);
  strcat(command, " ");
  strcat(command, *file);
  strcat(command, ".bkp");
  system(command);
  return NULL;
}


x86 assembly (clang, -O0):
<bkp_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1040 <memset@plt>
movb   $0x63,-0x50(%rbp)
movb   $0x70,-0x4f(%rbp)
movb   $0x20,-0x4e(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1050 <strcat@plt>
lea    -0x50(%rbp),%rdi
lea    0xe85(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1050 <strcat@plt>
lea    -0x50(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x50(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bkp_file>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movw   $0x0,0x30(%rsp)
movw   $0x7063,(%rsp)
movb   $0x20,0x2(%rsp)
mov    (%rdi),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <strcat@plt>
lea    0xe9e(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcat@plt>
mov    (%rbx),%rsi
mov    %r14,%rdi
call   1040 <strcat@plt>
lea    0xe86(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcat@plt>
mov    %r14,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [5 x i8] c".bkp\00"
define i8* @bkp_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i8**
%4 = alloca [50 x i8]
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i8**
store i8** %6, i8*** %3
%7 = bitcast [50 x i8]* %4 to i8*
%8 = bitcast i8* %7 to [50 x i8]*
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i32 0, i32 0
store i8 99, i8* %9
%10 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i32 0, i32 1
store i8 112, i8* %10
%11 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i32 0, i32 2
store i8 32, i8* %11
%12 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%13 = load i8**, i8*** %3
%14 = load i8*, i8** %13
%15 = call i32 @strcat(i8* %12, i8* %14)
%16 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%17 = call i32 @strcat(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%18 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%19 = load i8**, i8*** %3
%20 = load i8*, i8** %19
%21 = call i32 @strcat(i8* %18, i8* %20)
%22 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%23 = call i32 @strcat(i8* %22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%24 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%25 = call i32 @system(i8* %24)
ret i8* null
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [5 x i8] c".bkp\00"
define noalias i8* @bkp_file(i8* nocapture %0) {
%2 = alloca [50 x i8]
%3 = bitcast i8* %0 to i8**
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
store i8 99, i8* %4
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 1
store i8 112, i8* %5
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 2
store i8 32, i8* %6
%7 = load i8*, i8** %3
%8 = call i32 @strcat(i8* %4, i8* %7)
%9 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = load i8*, i8** %3
%11 = call i32 @strcat(i8* %4, i8* %10)
%12 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @system(i8* %4)
ret i8* null
}