#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*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
void stampa(FILE *VoliPtr, FILE *VoliAggiornatiPtr) {
  char *msgErrore = "COD. 666";
  char buffer[100];
  rewind(VoliPtr);
  rewind(VoliAggiornatiPtr);
  if (VoliPtr != NULL) {
    if (VoliAggiornatiPtr != NULL) {
      while (!feof(VoliPtr)) {
        fgets(buffer, 100, VoliPtr);
        fgets(buffer, 100, VoliAggiornatiPtr);
      }
      fclose(VoliPtr);
      fclose(VoliAggiornatiPtr);
    } else {
      puts(msgErrore);
    }
  } else {
    puts(msgErrore);
  }
  return;
}


x86 assembly (clang, -O0):
<stampa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe96(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <rewind@plt>
mov    -0x10(%rbp),%rdi
call   1050 <rewind@plt>
cmpq   $0x0,-0x8(%rbp)
je     1207 <stampa+0xb7>
cmpq   $0x0,-0x10(%rbp)
je     11f9 <stampa+0xa9>
jmp    119b <stampa+0x4b>
mov    -0x8(%rbp),%rdi
call   1070 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11b9 <stampa+0x69>
jmp    11e2 <stampa+0x92>
lea    -0x80(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x64,%esi
call   1060 <fgets@plt>
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x64,%esi
call   1060 <fgets@plt>
jmp    119b <stampa+0x4b>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
jmp    1202 <stampa+0xb2>
mov    -0x18(%rbp),%rdi
call   1030 <puts@plt>
jmp    1210 <stampa+0xc0>
mov    -0x18(%rbp),%rdi
call   1030 <puts@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stampa>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <rewind@plt>
mov    %r14,%rdi
call   1050 <rewind@plt>
test   %rbx,%rbx
je     11d6 <stampa+0x86>
test   %r14,%r14
je     11d6 <stampa+0x86>
mov    %rbx,%rdi
call   1070 <feof@plt>
test   %eax,%eax
jne    11bc <stampa+0x6c>
mov    %rsp,%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rdi
mov    $0x64,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
mov    %r15,%rdi
mov    $0x64,%esi
mov    %r14,%rdx
call   1060 <fgets@plt>
mov    %rbx,%rdi
call   1070 <feof@plt>
test   %eax,%eax
je     1190 <stampa+0x40>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe23(%rip),%rdi
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"COD. 666\00"
define void @stampa(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca [100 x i8]
store i32* %0, i32** %3
store i32* %1, i32** %4
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %5
%7 = load i32*, i32** %3
%8 = call i32 @rewind(i32* %7)
%9 = load i32*, i32** %4
%10 = call i32 @rewind(i32* %9)
%11 = load i32*, i32** %3
%12 = icmp ne i32* %11, null
br i1 %12, label %13, label %38
13: ; preds = %2
%14 = load i32*, i32** %4
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %34
16: ; preds = %13
br label %17
17: ; preds = %22, %16
%18 = load i32*, i32** %3
%19 = call i32 @feof(i32* %18)
%20 = icmp ne i32 %19, 0
%21 = xor i1 %20, true
br i1 %21, label %22, label %29
22: ; preds = %17
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%24 = load i32*, i32** %3
%25 = call i32 @fgets(i8* %23, i32 100, i32* %24)
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%27 = load i32*, i32** %4
%28 = call i32 @fgets(i8* %26, i32 100, i32* %27)
br label %17
29: ; preds = %17
%30 = load i32*, i32** %3
%31 = call i32 @fclose(i32* %30)
%32 = load i32*, i32** %4
%33 = call i32 @fclose(i32* %32)
br label %37
34: ; preds = %13
%35 = load i8*, i8** %5
%36 = call i32 @puts(i8* %35)
br label %37
37: ; preds = %34, %29
br label %41
38: ; preds = %2
%39 = load i8*, i8** %5
%40 = call i32 @puts(i8* %39)
br label %41
41: ; preds = %38, %37
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"COD. 666\00"
define void @stampa(i32* %0, i32* %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @rewind(i32* %0)
%6 = tail call i32 @rewind(i32* %1)
%7 = icmp eq i32* %0, null
br i1 %7, label %23, label %8
8: ; preds = %2
%9 = icmp eq i32* %1, null
br i1 %9, label %21, label %10
10: ; preds = %8
%11 = call i32 @feof(i32* %0)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %10, %13
%14 = call i32 @fgets(i8* %4, i32 100, i32* %0)
%15 = call i32 @fgets(i8* %4, i32 100, i32* %1)
%16 = call i32 @feof(i32* %0)
%17 = icmp eq i32 %16, 0
br i1 %17, label %13, label %18
18: ; preds = %13, %10
%19 = call i32 @fclose(i32* %0)
%20 = call i32 @fclose(i32* %1)
br label %25
21: ; preds = %8
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %25
23: ; preds = %2
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %25
25: ; preds = %18, %21, %23
ret void
}