#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_extensions_reset_config(void) {
  char command[256];
  memset(command, 0, sizeof(command));
  snprintf(command, sizeof(command), "cp %s%s %s", "/etc.ro/asterisk/",
           "extensions.conf", "/etc/asterisk/");
  return system(command);
}


x86 assembly (clang, -O0):
<libamg_extensions_reset_config>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1050 <memset@plt>
lea    -0x100(%rbp),%rdi
mov    $0x100,%esi
lea    0xe9f(%rip),%rdx
lea    0xea3(%rip),%rcx
lea    0xeae(%rip),%r8
lea    0xeb7(%rip),%r9
call   1040 <snprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libamg_extensions_reset_config>:
push   %rbx
sub    $0x100,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1050 <memset@plt>
lea    0xeaf(%rip),%rdx
lea    0xeb3(%rip),%rcx
lea    0xebe(%rip),%r8
lea    0xec7(%rip),%r9
mov    %rbx,%rdi
mov    $0x100,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x100,%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 = [16 x i8] c"extensions.conf\00"
@.str.3 = [15 x i8] c"/etc/asterisk/\00"
define i32 @libamg_extensions_reset_config() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 256)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 256, 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 ([16 x i8], [16 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 [256 x i8], [256 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 = [16 x i8] c"extensions.conf\00"
@.str.3 = [15 x i8] c"/etc/asterisk/\00"
define i32 @libamg_extensions_reset_config() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 256)
%4 = call i32 @snprintf(i8* %2, i32 256, 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 ([16 x i8], [16 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
}