#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  char sed[1024];
  if (argc < 3) {
    fprintf(stderr, "\nError en el numero de argumentos.");
    exit(1);
  }
  sprintf(sed, "sed 's/%s/%s/g'< mrtg.cfg > mrtg.cf", argv[1], argv[2]);
  system(sed);
  sprintf(sed, "sed 's/%s/remote/g'< mrtg.cf > mrtg.cfg", argv[3]);
  system(sed);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1182 <main+0x42>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
lea    0xe8d(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    0xe83(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1030 <system@plt>
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
lea    0xe7e(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x408,%rsp
cmp    $0x2,%edi
jle    11a0 <main+0x60>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdx
mov    0x10(%rsi),%rcx
lea    0xec2(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %r14,%rdi
call   1030 <system@plt>
mov    0x18(%rbx),%rdx
lea    0xec6(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %r14,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
lea    0xe50(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"\0AError en el numero de argumentos.\00"
@.str.1 = [36 x i8] c"sed 's/%s/%s/g'< mrtg.cfg > mrtg.cf\00"
@.str.2 = [40 x i8] c"sed 's/%s/remote/g'< mrtg.cf > mrtg.cfg\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1024 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
%21 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %14, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %17, i8* %20)
%22 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%23 = call i32 @system(i8* %22)
%24 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 3
%27 = load i8*, i8** %26
%28 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %24, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* %27)
%29 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%30 = call i32 @system(i8* %29)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"\0AError en el numero de argumentos.\00"
@.str.1 = [36 x i8] c"sed 's/%s/%s/g'< mrtg.cfg > mrtg.cf\00"
@.str.2 = [40 x i8] c"sed 's/%s/remote/g'< mrtg.cf > mrtg.cfg\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = icmp slt i32 %0, 3
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8*, i8** %1, i64 2
%14 = load i8*, i8** %13
%15 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %12, i8* %14)
%16 = call i32 @system(i8* %4)
%17 = getelementptr inbounds i8*, i8** %1, i64 3
%18 = load i8*, i8** %17
%19 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* %18)
%20 = call i32 @system(i8* %4)
ret i32 0
}