#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*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int log10(double);
int open(char *, int /*<<< orphan*/);
int read(int, char *, int);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  char b1[2], b2[2];
  int fd1, fd2, code;
  double d1, d2, tmp, num = 0, den = 0;
  if (argc != 3) {
    fprintf(stderr, "uso: test01 <original> <nuevo>\n");
    exit(1);
  }
  if ((fd1 = open(argv[1], O_RDONLY)) == -1) {
    fprintf(stderr, "test01: No puedo abrir %s para leer.\n", argv[1]);
    exit(1);
  }
  if ((fd2 = open(argv[2], O_RDONLY)) == -1) {
    fprintf(stderr, "test01: No puedo abrir %s para leer.\n", argv[2]);
    exit(1);
  }
  while ((code = read(fd1, b1, 2)) == 2) {
    code = read(fd2, b2, 2);
    if (code == -1) {
      fprintf(stderr, "test01: Problemas de lectura en %s.\n", argv[2]);
      exit(1);
    } else if (code == 0) {
      fprintf(stderr, "test01: %s es mas largo.\n", argv[1]);
      exit(1);
    } else if (code != 2) {
      fprintf(stderr, "test01: Fichero %s truncado.\n", argv[2]);
      exit(1);
    }
    d1 = (double)(*(short *)b1);
    d2 = (double)(*(short *)b2);
    tmp = d2 - d1;
    num += tmp * tmp;
    den += d1 * d1;
  }
  if (code == -1) {
    fprintf(stderr, "test01: Problemas de lectura en %s.\n", argv[1]);
    exit(1);
  } else if (code == 1) {
    fprintf(stderr, "test01: Fichero %s truncado.\n", argv[1]);
    exit(1);
  }
  if (read(fd2, b2, 2) != 0) {
    fprintf(stderr, "test01: %s es mas largo.\n", argv[2]);
    exit(1);
  }
  tmp = num / den;
  if (tmp == 0.0)
    fprintf(stderr, "test01: Ficheros iguales.\n");
  else
    fprintf(stderr, "S/R=%.2f dB\n", 10 * log10(tmp));
  close(fd2);
  close(fd1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11b1 <main+0x51>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
lea    0xe60(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2e28(%rip),%rax
mov    (%rax),%esi
call   1060 <open@plt>
mov    %eax,-0x18(%rbp)
cmp    $0xffffffff,%eax
jne    11fc <main+0x9c>
mov    0x2dfe(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe35(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    0x2ddd(%rip),%rax
mov    (%rax),%esi
call   1060 <open@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
jne    1247 <main+0xe7>
mov    0x2db3(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xdea(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
jmp    124c <main+0xec>
mov    -0x18(%rbp),%edi
lea    -0x12(%rbp),%rsi
mov    $0x2,%edx
call   1040 <read@plt>
mov    %eax,-0x20(%rbp)
cmp    $0x2,%eax
jne    1386 <main+0x226>
mov    -0x1c(%rbp),%edi
lea    -0x14(%rbp),%rsi
mov    $0x2,%edx
call   1040 <read@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
jne    12b0 <main+0x150>
mov    0x2d4a(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xda7(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
cmpl   $0x0,-0x20(%rbp)
jne    12e3 <main+0x183>
mov    0x2d17(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd99(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
cmpl   $0x2,-0x20(%rbp)
je     1316 <main+0x1b6>
mov    0x2ce4(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xd80(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
jmp    131b <main+0x1bb>
jmp    1320 <main+0x1c0>
movswl -0x12(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movswl -0x14(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    124c <main+0xec>
cmpl   $0xffffffff,-0x20(%rbp)
jne    13b9 <main+0x259>
mov    0x2c41(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xc9e(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
cmpl   $0x1,-0x20(%rbp)
jne    13ec <main+0x28c>
mov    0x2c0e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xcaa(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
jmp    13f1 <main+0x291>
mov    -0x1c(%rbp),%edi
lea    -0x14(%rbp),%rsi
mov    $0x2,%edx
call   1040 <read@plt>
cmp    $0x0,%eax
je     1434 <main+0x2d4>
mov    0x2bc6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xc48(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
movsd  -0x40(%rbp),%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1477 <main+0x317>
jp     1477 <main+0x317>
mov    0x2b76(%rip),%rax
mov    (%rax),%edi
lea    0xc38(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    14a1 <main+0x341>
mov    0x2b5a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1070 <log10@plt>
mov    -0x4c(%rbp),%edi
imul   $0xa,%eax,%edx
lea    0xc24(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x1c(%rbp),%edi
call   1030 <close@plt>
mov    -0x18(%rbp),%edi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
cmp    $0x3,%edi
jne    133e <main+0x1de>
mov    %rsi,%r14
mov    0x8(%rsi),%rdi
mov    0x2e65(%rip),%rbx
mov    (%rbx),%esi
call   1060 <open@plt>
cmp    $0xffffffff,%eax
je     135f <main+0x1ff>
mov    %eax,%r15d
mov    0x10(%r14),%rdi
mov    (%rbx),%esi
call   1060 <open@plt>
cmp    $0xffffffff,%eax
je     136e <main+0x20e>
mov    %eax,%ebp
xorpd  %xmm0,%xmm0
movapd %xmm0,0x10(%rsp)
lea    0xe(%rsp),%rbx
lea    0xc(%rsp),%r12
mov    %r15d,%edi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1040 <read@plt>
cmp    $0x2,%eax
jne    1223 <main+0xc3>
mov    %ebp,%edi
mov    %r12,%rsi
mov    $0x2,%edx
call   1040 <read@plt>
cmp    $0x2,%eax
jne    12bf <main+0x15f>
movswl 0xe(%rsp),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movswl 0xc(%rsp),%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
subsd  %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
mulpd  %xmm1,%xmm1
movapd 0x10(%rsp),%xmm0
addpd  %xmm1,%xmm0
movapd %xmm0,0x10(%rsp)
jmp    11c0 <main+0x60>
cmp    $0xffffffff,%eax
je     1303 <main+0x1a3>
cmp    $0x1,%eax
je     1319 <main+0x1b9>
lea    0xc(%rsp),%rsi
mov    %ebp,%edi
mov    $0x2,%edx
call   1040 <read@plt>
test   %eax,%eax
jne    1384 <main+0x224>
movapd 0x10(%rsp),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
divsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    0x2d69(%rip),%rax
mov    (%rax),%ebx
jne    1287 <main+0x127>
jp     1287 <main+0x127>
lea    0xe27(%rip),%rsi
mov    %ebx,%edi
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    12a1 <main+0x141>
call   1070 <log10@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%edx
lea    0xe26(%rip),%rsi
mov    %ebx,%edi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %ebp,%edi
call   1030 <close@plt>
mov    %r15d,%edi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
test   %eax,%eax
je     12de <main+0x17e>
cmp    $0xffffffff,%eax
jne    12f4 <main+0x194>
mov    0x2d09(%rip),%rax
mov    (%rax),%edi
mov    0x10(%r14),%rdx
lea    0xd6a(%rip),%rsi
jmp    132d <main+0x1cd>
mov    0x2cf3(%rip),%rax
mov    (%rax),%edi
mov    0x8(%r14),%rdx
lea    0xd79(%rip),%rsi
jmp    132d <main+0x1cd>
mov    0x2cdd(%rip),%rax
mov    (%rax),%edi
mov    0x10(%r14),%rdx
jmp    1326 <main+0x1c6>
mov    0x2cce(%rip),%rax
mov    (%rax),%edi
mov    0x8(%r14),%rdx
lea    0xd2f(%rip),%rsi
jmp    132d <main+0x1cd>
mov    0x2cb8(%rip),%rax
mov    (%rax),%edi
mov    0x8(%r14),%rdx
lea    0xd58(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    0x2c93(%rip),%rax
mov    (%rax),%edi
lea    0xcb2(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    0x2c72(%rip),%rax
mov    (%rax),%edi
mov    0x8(%r14),%rdx
jmp    137b <main+0x21b>
mov    0x2c63(%rip),%rax
mov    (%rax),%edi
mov    0x10(%r14),%rdx
lea    0xc9e(%rip),%rsi
jmp    132d <main+0x1cd>
mov    0x2c4d(%rip),%rax
mov    (%rax),%edi
mov    0x10(%r14),%rdx
lea    0xcd3(%rip),%rsi
jmp    132d <main+0x1cd>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"uso: test01 <original> <nuevo>\0A\00"
@O_RDONLY = global i32 0
@.str.1 = [38 x i8] c"test01: No puedo abrir %s para leer.\0A\00"
@.str.2 = [37 x i8] c"test01: Problemas de lectura en %s.\0A\00"
@.str.3 = [26 x i8] c"test01: %s es mas largo.\0A\00"
@.str.4 = [30 x i8] c"test01: Fichero %s truncado.\0A\00"
@.str.5 = [27 x i8] c"test01: Ficheros iguales.\0A\00"
@.str.6 = [13 x i8] c"S/R=%.2f dB\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i8]
%7 = alloca [2 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 0.000000e+00, double* %14
store double 0.000000e+00, double* %15
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 3
br i1 %17, label %18, label %22
18: ; preds = %2
%19 = load i32, i32* @stderr
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = load i32, i32* @O_RDONLY
%27 = call i32 @open(i8* %25, i32 %26)
store i32 %27, i32* %8
%28 = icmp eq i32 %27, -1
br i1 %28, label %29, label %36
29: ; preds = %22
%30 = load i32, i32* @stderr
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %33)
%35 = call i32 @exit(i32 1)
unreachable
36: ; preds = %22
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 2
%39 = load i8*, i8** %38
%40 = load i32, i32* @O_RDONLY
%41 = call i32 @open(i8* %39, i32 %40)
store i32 %41, i32* %9
%42 = icmp eq i32 %41, -1
br i1 %42, label %43, label %50
43: ; preds = %36
%44 = load i32, i32* @stderr
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 2
%47 = load i8*, i8** %46
%48 = call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %47)
%49 = call i32 @exit(i32 1)
unreachable
50: ; preds = %36
br label %51
51: ; preds = %91, %50
%52 = load i32, i32* %8
%53 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%54 = call i32 @read(i32 %52, i8* %53, i32 2)
store i32 %54, i32* %10
%55 = icmp eq i32 %54, 2
br i1 %55, label %56, label %111
56: ; preds = %51
%57 = load i32, i32* %9
%58 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%59 = call i32 @read(i32 %57, i8* %58, i32 2)
store i32 %59, i32* %10
%60 = load i32, i32* %10
%61 = icmp eq i32 %60, -1
br i1 %61, label %62, label %69
62: ; preds = %56
%63 = load i32, i32* @stderr
%64 = load i8**, i8*** %5
%65 = getelementptr inbounds i8*, i8** %64, i64 2
%66 = load i8*, i8** %65
%67 = call i32 (i32, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8* %66)
%68 = call i32 @exit(i32 1)
unreachable
69: ; preds = %56
%70 = load i32, i32* %10
%71 = icmp eq i32 %70, 0
br i1 %71, label %72, label %79
72: ; preds = %69
%73 = load i32, i32* @stderr
%74 = load i8**, i8*** %5
%75 = getelementptr inbounds i8*, i8** %74, i64 1
%76 = load i8*, i8** %75
%77 = call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %76)
%78 = call i32 @exit(i32 1)
unreachable
79: ; preds = %69
%80 = load i32, i32* %10
%81 = icmp ne i32 %80, 2
br i1 %81, label %82, label %89
82: ; preds = %79
%83 = load i32, i32* @stderr
%84 = load i8**, i8*** %5
%85 = getelementptr inbounds i8*, i8** %84, i64 2
%86 = load i8*, i8** %85
%87 = call i32 (i32, i8*, ...) @fprintf(i32 %83, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* %86)
%88 = call i32 @exit(i32 1)
unreachable
89: ; preds = %79
br label %90
90: ; preds = %89
br label %91
91: ; preds = %90
%92 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%93 = bitcast i8* %92 to i16*
%94 = load i16, i16* %93
%95 = sitofp i16 %94 to double
store double %95, double* %11
%96 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%97 = bitcast i8* %96 to i16*
%98 = load i16, i16* %97
%99 = sitofp i16 %98 to double
store double %99, double* %12
%100 = load double, double* %12
%101 = load double, double* %11
%102 = fsub double %100, %101
store double %102, double* %13
%103 = load double, double* %13
%104 = load double, double* %13
%105 = load double, double* %14
%106 = call double @llvm.fmuladd.f64(double %103, double %104, double %105)
store double %106, double* %14
%107 = load double, double* %11
%108 = load double, double* %11
%109 = load double, double* %15
%110 = call double @llvm.fmuladd.f64(double %107, double %108, double %109)
store double %110, double* %15
br label %51
111: ; preds = %51
%112 = load i32, i32* %10
%113 = icmp eq i32 %112, -1
br i1 %113, label %114, label %121
114: ; preds = %111
%115 = load i32, i32* @stderr
%116 = load i8**, i8*** %5
%117 = getelementptr inbounds i8*, i8** %116, i64 1
%118 = load i8*, i8** %117
%119 = call i32 (i32, i8*, ...) @fprintf(i32 %115, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8* %118)
%120 = call i32 @exit(i32 1)
unreachable
121: ; preds = %111
%122 = load i32, i32* %10
%123 = icmp eq i32 %122, 1
br i1 %123, label %124, label %131
124: ; preds = %121
%125 = load i32, i32* @stderr
%126 = load i8**, i8*** %5
%127 = getelementptr inbounds i8*, i8** %126, i64 1
%128 = load i8*, i8** %127
%129 = call i32 (i32, i8*, ...) @fprintf(i32 %125, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* %128)
%130 = call i32 @exit(i32 1)
unreachable
131: ; preds = %121
br label %132
132: ; preds = %131
%133 = load i32, i32* %9
%134 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%135 = call i32 @read(i32 %133, i8* %134, i32 2)
%136 = icmp ne i32 %135, 0
br i1 %136, label %137, label %144
137: ; preds = %132
%138 = load i32, i32* @stderr
%139 = load i8**, i8*** %5
%140 = getelementptr inbounds i8*, i8** %139, i64 2
%141 = load i8*, i8** %140
%142 = call i32 (i32, i8*, ...) @fprintf(i32 %138, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %141)
%143 = call i32 @exit(i32 1)
unreachable
144: ; preds = %132
%145 = load double, double* %14
%146 = load double, double* %15
%147 = fdiv double %145, %146
store double %147, double* %13
%148 = load double, double* %13
%149 = fcmp oeq double %148, 0.000000e+00
br i1 %149, label %150, label %153
150: ; preds = %144
%151 = load i32, i32* @stderr
%152 = call i32 (i32, i8*, ...) @fprintf(i32 %151, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
br label %159
153: ; preds = %144
%154 = load i32, i32* @stderr
%155 = load double, double* %13
%156 = call i32 @log10(double %155)
%157 = mul nsw i32 10, %156
%158 = call i32 (i32, i8*, ...) @fprintf(i32 %154, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 %157)
br label %159
159: ; preds = %153, %150
%160 = load i32, i32* %9
%161 = call i32 @close(i32 %160)
%162 = load i32, i32* %8
%163 = call i32 @close(i32 %162)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"uso: test01 <original> <nuevo>\0A\00"
@O_RDONLY = global i32 0
@.str.1 = [38 x i8] c"test01: No puedo abrir %s para leer.\0A\00"
@.str.2 = [37 x i8] c"test01: Problemas de lectura en %s.\0A\00"
@.str.3 = [26 x i8] c"test01: %s es mas largo.\0A\00"
@.str.4 = [30 x i8] c"test01: Fichero %s truncado.\0A\00"
@.str.5 = [27 x i8] c"test01: Ficheros iguales.\0A\00"
@.str.6 = [13 x i8] c"S/R=%.2f dB\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i16
%4 = alloca i16
%5 = bitcast i16* %3 to i8*
%6 = bitcast i16* %4 to i8*
%7 = icmp eq i32 %0, 3
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = load i32, i32* @O_RDONLY
%16 = tail call i32 @open(i8* %14, i32 %15)
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %23
18: ; preds = %12
%19 = load i32, i32* @stderr
%20 = load i8*, i8** %13
%21 = tail call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %20)
%22 = tail call i32 @exit(i32 1)
unreachable
23: ; preds = %12
%24 = getelementptr inbounds i8*, i8** %1, i64 2
%25 = load i8*, i8** %24
%26 = load i32, i32* @O_RDONLY
%27 = tail call i32 @open(i8* %25, i32 %26)
%28 = icmp eq i32 %27, -1
br i1 %28, label %29, label %34
29: ; preds = %23
%30 = load i32, i32* @stderr
%31 = load i8*, i8** %24
%32 = tail call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %31)
%33 = tail call i32 @exit(i32 1)
unreachable
34: ; preds = %23, %54
%35 = phi <2 x double> [ %62, %54 ], [ zeroinitializer, %23 ]
%36 = call i32 @read(i32 %16, i8* %5, i32 2)
switch i32 %36, label %73 [
i32 2, label %37
i32 -1, label %63
i32 1, label %68
]
37: ; preds = %34
%38 = call i32 @read(i32 %27, i8* %6, i32 2)
switch i32 %38, label %49 [
i32 -1, label %39
i32 0, label %44
i32 2, label %54
]
39: ; preds = %37
%40 = load i32, i32* @stderr
%41 = load i8*, i8** %24
%42 = tail call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8* %41)
%43 = tail call i32 @exit(i32 1)
unreachable
44: ; preds = %37
%45 = load i32, i32* @stderr
%46 = load i8*, i8** %13
%47 = tail call i32 (i32, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %46)
%48 = tail call i32 @exit(i32 1)
unreachable
49: ; preds = %37
%50 = load i32, i32* @stderr
%51 = load i8*, i8** %24
%52 = tail call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* %51)
%53 = tail call i32 @exit(i32 1)
unreachable
54: ; preds = %37
%55 = load i16, i16* %3
%56 = sitofp i16 %55 to double
%57 = load i16, i16* %4
%58 = sitofp i16 %57 to double
%59 = fsub double %58, %56
%60 = insertelement <2 x double> poison, double %59, i64 0
%61 = insertelement <2 x double> %60, double %56, i64 1
%62 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %61, <2 x double> %61, <2 x double> %35)
br label %34
63: ; preds = %34
%64 = load i32, i32* @stderr
%65 = load i8*, i8** %13
%66 = tail call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8* %65)
%67 = tail call i32 @exit(i32 1)
unreachable
68: ; preds = %34
%69 = load i32, i32* @stderr
%70 = load i8*, i8** %13
%71 = tail call i32 (i32, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* %70)
%72 = tail call i32 @exit(i32 1)
unreachable
73: ; preds = %34
%74 = call i32 @read(i32 %27, i8* %6, i32 2)
%75 = icmp eq i32 %74, 0
br i1 %75, label %81, label %76
76: ; preds = %73
%77 = load i32, i32* @stderr
%78 = load i8*, i8** %24
%79 = tail call i32 (i32, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %78)
%80 = tail call i32 @exit(i32 1)
unreachable
81: ; preds = %73
%82 = extractelement <2 x double> %35, i64 0
%83 = extractelement <2 x double> %35, i64 1
%84 = fdiv double %82, %83
%85 = fcmp oeq double %84, 0.000000e+00
%86 = load i32, i32* @stderr
br i1 %85, label %87, label %89
87: ; preds = %81
%88 = tail call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
br label %93
89: ; preds = %81
%90 = tail call i32 @log10(double %84)
%91 = mul nsw i32 %90, 10
%92 = tail call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 %91)
br label %93
93: ; preds = %89, %87
%94 = tail call i32 @close(i32 %27)
%95 = tail call i32 @close(i32 %16)
ret i32 0
}