#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 */
scalar_t__ COMP0();
scalar_t__ FUNCTION();
scalar_t__ cte();
scalar_t__ id();
int setPos();
int /*<<< orphan*/ voltaPos(int);
int VAL() {
  int marcaPos = setPos();
  if (FUNCTION()) {
    return 1;
  }
  voltaPos(marcaPos);
  if (COMP0()) {
    return 1;
  }
  voltaPos(marcaPos);
  if (id()) {
    return 1;
  }
  voltaPos(marcaPos);
  if (cte()) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<VAL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <setPos@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <FUNCTION@plt>
cmp    $0x0,%rax
je     118f <VAL+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1205 <VAL+0xa5>
mov    -0x8(%rbp),%edi
call   1040 <voltaPos@plt>
mov    $0x0,%al
call   1070 <COMP0@plt>
cmp    $0x0,%rax
je     11b4 <VAL+0x54>
movl   $0x1,-0x4(%rbp)
jmp    1205 <VAL+0xa5>
mov    -0x8(%rbp),%edi
call   1040 <voltaPos@plt>
mov    $0x0,%al
call   1080 <id@plt>
cmp    $0x0,%rax
je     11d9 <VAL+0x79>
movl   $0x1,-0x4(%rbp)
jmp    1205 <VAL+0xa5>
mov    -0x8(%rbp),%edi
call   1040 <voltaPos@plt>
mov    $0x0,%al
call   1030 <cte@plt>
cmp    $0x0,%rax
je     11fe <VAL+0x9e>
movl   $0x1,-0x4(%rbp)
jmp    1205 <VAL+0xa5>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VAL>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <setPos@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <FUNCTION@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    11b9 <VAL+0x59>
mov    %ebp,%edi
call   1040 <voltaPos@plt>
xor    %eax,%eax
call   1070 <COMP0@plt>
test   %rax,%rax
jne    11b9 <VAL+0x59>
mov    %ebp,%edi
call   1040 <voltaPos@plt>
xor    %eax,%eax
call   1080 <id@plt>
test   %rax,%rax
jne    11b9 <VAL+0x59>
mov    %ebp,%edi
call   1040 <voltaPos@plt>
xor    %eax,%eax
call   1030 <cte@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @VAL() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @setPos()
store i32 %3, i32* %2
%4 = call i64 (...) @FUNCTION()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %1
br label %26
7: ; preds = %0
%8 = load i32, i32* %2
%9 = call i32 @voltaPos(i32 %8)
%10 = call i64 (...) @COMP0()
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %7
store i32 1, i32* %1
br label %26
13: ; preds = %7
%14 = load i32, i32* %2
%15 = call i32 @voltaPos(i32 %14)
%16 = call i64 (...) @id()
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 1, i32* %1
br label %26
19: ; preds = %13
%20 = load i32, i32* %2
%21 = call i32 @voltaPos(i32 %20)
%22 = call i64 (...) @cte()
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %19
store i32 1, i32* %1
br label %26
25: ; preds = %19
store i32 0, i32* %1
br label %26
26: ; preds = %25, %24, %18, %12, %6
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
define i32 @VAL() {
%1 = tail call i32 (...) @setPos()
%2 = tail call i64 (...) @FUNCTION()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %17
4: ; preds = %0
%5 = tail call i32 @voltaPos(i32 %1)
%6 = tail call i64 (...) @COMP0()
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = tail call i32 @voltaPos(i32 %1)
%10 = tail call i64 (...) @id()
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = tail call i32 @voltaPos(i32 %1)
%14 = tail call i64 (...) @cte()
%15 = icmp ne i64 %14, 0
%16 = zext i1 %15 to i32
br label %17
17: ; preds = %12, %8, %4, %0
%18 = phi i32 [ 1, %0 ], [ 1, %4 ], [ 1, %8 ], [ %16, %12 ]
ret i32 %18
}