#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 */
typedef int /*<<< orphan*/ command;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, char *);
int system(char *);
int libamg_comcerto_reset_config(void) {
  char command[128];
  memset(command, 0, sizeof(command));
  snprintf(command, sizeof(command), "cp %s%s %s", "/etc.ro/asterisk/",
           "comcerto.conf", "/etc/asterisk/");
  return system(command);
}


x86 assembly (clang, -O0):
<libamg_comcerto_reset_config>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
lea    -0x80(%rbp),%rdi
mov    $0x80,%esi
lea    0xea5(%rip),%rdx
lea    0xea9(%rip),%rcx
lea    0xeb4(%rip),%r8
lea    0xebb(%rip),%r9
call   1040 <snprintf@plt>
lea    -0x80(%rbp),%rdi
call   1030 <system@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libamg_comcerto_reset_config>:
push   %rbx
sub    $0x80,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
lea    0xeaf(%rip),%rdx
lea    0xeb3(%rip),%rcx
lea    0xebe(%rip),%r8
lea    0xec5(%rip),%r9
mov    %rbx,%rdi
mov    $0x80,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"cp %s%s %s\00"
@.str.1 = [18 x i8] c"/etc.ro/asterisk/\00"
@.str.2 = [14 x i8] c"comcerto.conf\00"
@.str.3 = [15 x i8] c"/etc/asterisk/\00"
define i32 @libamg_comcerto_reset_config() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 128)
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 128, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%7 = call i32 @system(i8* %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [11 x i8] c"cp %s%s %s\00"
@.str.1 = [18 x i8] c"/etc.ro/asterisk/\00"
@.str.2 = [14 x i8] c"comcerto.conf\00"
@.str.3 = [15 x i8] c"/etc/asterisk/\00"
define i32 @libamg_comcerto_reset_config() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 128)
%4 = call i32 @snprintf(i8* %2, i32 128, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @system(i8* %2)
ret i32 %5
}