#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 read(int, ...);
int leggiDimensioniEMaschera(int pfd, unsigned int *r, unsigned int *c,
                             char *maschera) {
  return (read(pfd, r, sizeof(unsigned int)) != -1 &&
          read(pfd, c, sizeof(unsigned int)) != -1 &&
          read(pfd, maschera, sizeof(char)) != -1);
}


x86 assembly (clang, -O0):
<leggiDimensioniEMaschera>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <read@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0x21(%rbp)
je     1189 <leggiDimensioniEMaschera+0x79>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <read@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0x21(%rbp)
je     1189 <leggiDimensioniEMaschera+0x79>
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <read@plt>
cmp    $0xffffffff,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leggiDimensioniEMaschera>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %edi,%ebp
xor    %ebx,%ebx
mov    $0x4,%edx
xor    %eax,%eax
call   1030 <read@plt>
cmp    $0xffffffff,%eax
je     1163 <leggiDimensioniEMaschera+0x53>
xor    %ebx,%ebx
mov    $0x4,%edx
mov    %ebp,%edi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <read@plt>
cmp    $0xffffffff,%eax
je     1163 <leggiDimensioniEMaschera+0x53>
mov    $0x1,%edx
mov    %ebp,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <read@plt>
xor    %ebx,%ebx
cmp    $0xffffffff,%eax
setne  %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @leggiDimensioniEMaschera(i32 %0, i32* %1, i32* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load i32*, i32** %6
%11 = call i32 (i32, ...) @read(i32 %9, i32* %10, i64 4)
%12 = icmp ne i32 %11, -1
br i1 %12, label %13, label %23
13: ; preds = %4
%14 = load i32, i32* %5
%15 = load i32*, i32** %7
%16 = call i32 (i32, ...) @read(i32 %14, i32* %15, i64 4)
%17 = icmp ne i32 %16, -1
br i1 %17, label %18, label %23
18: ; preds = %13
%19 = load i32, i32* %5
%20 = load i8*, i8** %8
%21 = call i32 (i32, ...) @read(i32 %19, i8* %20, i64 1)
%22 = icmp ne i32 %21, -1
br label %23
23: ; preds = %18, %13, %4
%24 = phi i1 [ false, %13 ], [ false, %4 ], [ %22, %18 ]
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @leggiDimensioniEMaschera(i32 %0, i32* %1, i32* %2, i8* %3) {
%5 = tail call i32 (i32, ...) @read(i32 %0, i32* %1, i64 4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %14, label %7
7: ; preds = %4
%8 = tail call i32 (i32, ...) @read(i32 %0, i32* %2, i64 4)
%9 = icmp eq i32 %8, -1
br i1 %9, label %14, label %10
10: ; preds = %7
%11 = tail call i32 (i32, ...) @read(i32 %0, i8* %3, i64 1)
%12 = icmp ne i32 %11, -1
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %10, %7, %4
%15 = phi i32 [ 0, %7 ], [ 0, %4 ], [ %13, %10 ]
ret i32 %15
}