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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(float *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int imprimeresultado(char *nombre3, FILE *resultado) {
  float valor;
  register int i, j;
  resultado = fopen(nombre3, "r");
  if (resultado == NULL) {
    perror("Fichero resultado no es accesible");
    exit(-1);
  }
  printf("matriz resultado \n");
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      fread(&valor, sizeof(valor), 1, resultado);
      printf("%.4f ", valor);
    }
    printf("\n");
  }
  fclose(resultado);
}


x86 assembly (clang, -O0):
<imprimeresultado>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe85(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11a5 <imprimeresultado+0x45>
lea    0xe6c(%rip),%rdi
call   1070 <perror@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    122d <imprimeresultado+0xcd>
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    1211 <imprimeresultado+0xb1>
mov    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe3b(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11cb <imprimeresultado+0x6b>
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11ba <imprimeresultado+0x5a>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimeresultado>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xe70(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     1359 <imprimeresultado+0x1d9>
mov    %rax,%rbx
lea    0xe82(%rip),%rdi
call   1040 <puts@plt>
lea    0xc(%rsp),%r14
mov    %r14,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe4c(%rip),%r15
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    %r14,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    %r14,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    %r14,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    %r14,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    %r14,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    %r14,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <fclose@plt>
lea    0xca2(%rip),%rdi
call   1090 <perror@plt>
mov    $0xffffffff,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [34 x i8] c"Fichero resultado no es accesible\00"
@.str.2 = [19 x i8] c"matriz resultado \0A\00"
@.str.3 = [6 x i8] c"%.4f \00"
@.str.4 = [2 x i8] c"\0A\00"
define i32 @imprimeresultado(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca float
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i32* %1, i32** %5
%9 = load i8*, i8** %4
%10 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %10, i32** %5
%11 = load i32*, i32** %5
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = call i32 @perror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 @exit(i32 -1)
unreachable
16: ; preds = %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %7
br label %18
18: ; preds = %36, %16
%19 = load i32, i32* %7
%20 = icmp slt i32 %19, 3
br i1 %20, label %21, label %39
21: ; preds = %18
store i32 0, i32* %8
br label %22
22: ; preds = %31, %21
%23 = load i32, i32* %8
%24 = icmp slt i32 %23, 3
br i1 %24, label %25, label %34
25: ; preds = %22
%26 = load i32*, i32** %5
%27 = call i32 @fread(float* %6, i32 4, i32 1, i32* %26)
%28 = load float, float* %6
%29 = fpext float %28 to double
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %29)
br label %31
31: ; preds = %25
%32 = load i32, i32* %8
%33 = add nsw i32 %32, 1
store i32 %33, i32* %8
br label %22
34: ; preds = %22
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %36
36: ; preds = %34
%37 = load i32, i32* %7
%38 = add nsw i32 %37, 1
store i32 %38, i32* %7
br label %18
39: ; preds = %18
%40 = load i32*, i32** %5
%41 = call i32 @fclose(i32* %40)
%42 = load i32, i32* %3
ret i32 %42
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [34 x i8] c"Fichero resultado no es accesible\00"
@.str.3 = [6 x i8] c"%.4f \00"
@str = [18 x i8] c"matriz resultado \00"
define i32 @imprimeresultado(i8* nocapture %0, i32* nocapture readnone %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
%5 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = tail call i32 @perror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @exit(i32 -1)
unreachable
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%12 = call i32 @fread(float* %3, i32 4, i32 1, i32* %5)
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %14)
%16 = call i32 @fread(float* %3, i32 4, i32 1, i32* %5)
%17 = load float, float* %3
%18 = fpext float %17 to double
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %18)
%20 = call i32 @fread(float* %3, i32 4, i32 1, i32* %5)
%21 = load float, float* %3
%22 = fpext float %21 to double
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %22)
%24 = tail call i32 @putchar(i32 10)
%25 = call i32 @fread(float* %3, i32 4, i32 1, i32* %5)
%26 = load float, float* %3
%27 = fpext float %26 to double
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %27)
%29 = call i32 @fread(float* %3, i32 4, i32 1, i32* %5)
%30 = load float, float* %3
%31 = fpext float %30 to double
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %31)
%33 = call i32 @fread(float* %3, i32 4, i32 1, i32* %5)
%34 = load float, float* %3
%35 = fpext float %34 to double
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %35)
%37 = tail call i32 @putchar(i32 10)
%38 = call i32 @fread(float* %3, i32 4, i32 1, i32* %5)
%39 = load float, float* %3
%40 = fpext float %39 to double
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %40)
%42 = call i32 @fread(float* %3, i32 4, i32 1, i32* %5)
%43 = load float, float* %3
%44 = fpext float %43 to double
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %44)
%46 = call i32 @fread(float* %3, i32 4, i32 1, i32* %5)
%47 = load float, float* %3
%48 = fpext float %47 to double
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %48)
%50 = tail call i32 @putchar(i32 10)
%51 = tail call i32 @fclose(i32* %5)
ret i32 undef
}