#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ actualizar(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                              char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ perror(char *);
main(int argc, char *argv[]) {
  FILE *pfa = NULL, *pfb = NULL;
  if (argc != 3) {
    argv[1] = "notas";
    argv[2] = "modifi";
  }
  if ((pfa = fopen(argv[1], "rb")) == NULL) {
    perror(argv[1]);
    exit(-1);
  }
  if ((pfb = fopen(argv[2], "rb")) == NULL)
    exit(-1);
  actualizar(pfa, pfb, argv[1]);
  fclose(pfa);
  fclose(pfb);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     119e <main+0x4e>
mov    -0x10(%rbp),%rax
lea    0xe75(%rip),%rcx
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rax
lea    0xe6c(%rip),%rcx
mov    %rcx,0x10(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe60(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    11d7 <main+0x87>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <perror@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe27(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1203 <main+0xb3>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
call   1040 <actualizar@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
cmp    $0x3,%edi
jne    1163 <main+0x13>
mov    0x8(%r14),%rdi
jmp    1179 <main+0x29>
lea    0xe96(%rip),%rdi
mov    %rdi,0x8(%r14)
lea    0xe91(%rip),%rax
mov    %rax,0x10(%r14)
lea    0xe8d(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     11cc <main+0x7c>
mov    %rax,%r15
mov    0x10(%r14),%rdi
lea    0xe75(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     11d5 <main+0x85>
mov    %rax,%rbx
mov    0x8(%r14),%rdx
mov    %r15,%rdi
mov    %rax,%rsi
call   1040 <actualizar@plt>
mov    %r15,%rdi
call   1030 <fclose@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    0x8(%r14),%rdi
call   1060 <perror@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"notas\00"
@.str.1 = [7 x i8] c"modifi\00"
@.str.2 = [3 x i8] c"rb\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
store i32* null, i32** %7
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 3
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %12
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %14
br label %15
15: ; preds = %10, %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32* @fopen(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %19, i32** %6
%20 = icmp eq i32* %19, null
br i1 %20, label %21, label %27
21: ; preds = %15
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32 @perror(i8* %24)
%26 = call i32 @exit(i32 -1)
unreachable
27: ; preds = %15
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 2
%30 = load i8*, i8** %29
%31 = call i32* @fopen(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %31, i32** %7
%32 = icmp eq i32* %31, null
br i1 %32, label %33, label %35
33: ; preds = %27
%34 = call i32 @exit(i32 -1)
unreachable
35: ; preds = %27
%36 = load i32*, i32** %6
%37 = load i32*, i32** %7
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 1
%40 = load i8*, i8** %39
%41 = call i32 @actualizar(i32* %36, i32* %37, i8* %40)
%42 = load i32*, i32** %6
%43 = call i32 @fclose(i32* %42)
%44 = load i32*, i32** %7
%45 = call i32 @fclose(i32* %44)
%46 = load i32, i32* %3
ret i32 %46
}

LLVM IR (-O2):
@.str = [6 x i8] c"notas\00"
@.str.1 = [7 x i8] c"modifi\00"
@.str.2 = [3 x i8] c"rb\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
%4 = getelementptr inbounds i8*, i8** %1, i64 1
br i1 %3, label %5, label %7
5: ; preds = %2
%6 = load i8*, i8** %4
br label %9
7: ; preds = %2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %4
%8 = getelementptr inbounds i8*, i8** %1, i64 2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %8
br label %9
9: ; preds = %5, %7
%10 = phi i8* [ %6, %5 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %7 ]
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = tail call i32* @fopen(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %18
14: ; preds = %9
%15 = load i8*, i8** %11
%16 = tail call i32 @perror(i8* %15)
%17 = tail call i32 @exit(i32 -1)
unreachable
18: ; preds = %9
%19 = getelementptr inbounds i8*, i8** %1, i64 2
%20 = load i8*, i8** %19
%21 = tail call i32* @fopen(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i32* %21, null
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = tail call i32 @exit(i32 -1)
unreachable
25: ; preds = %18
%26 = load i8*, i8** %11
%27 = tail call i32 @actualizar(i32* %12, i32* %21, i8* %26)
%28 = tail call i32 @fclose(i32* %12)
%29 = tail call i32 @fclose(i32* %21)
ret i32 0
}