#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*/ OverlayLoad(int);
int bar(int);
int baz(int);
int foo(int);
int grbx(int);
int main() {
  int a, b, c, d, e;
  OverlayLoad(0);
  OverlayLoad(4);
  a = foo(1);
  OverlayLoad(1);
  OverlayLoad(5);
  b = bar(1);
  OverlayLoad(2);
  OverlayLoad(6);
  c = baz(1);
  OverlayLoad(3);
  OverlayLoad(7);
  d = grbx(1);
  e = a + b + c + d;
  return (e != ('f' + 'o' + 'o' + 'b' + 'a' + 'r' + 'b' + 'a' + 'z' + 'g' +
                'r' + 'b' + 'x'));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1070 <OverlayLoad@plt>
mov    $0x4,%edi
call   1070 <OverlayLoad@plt>
mov    $0x1,%edi
call   1060 <foo@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   1070 <OverlayLoad@plt>
mov    $0x5,%edi
call   1070 <OverlayLoad@plt>
mov    $0x1,%edi
call   1040 <bar@plt>
mov    %eax,-0xc(%rbp)
mov    $0x2,%edi
call   1070 <OverlayLoad@plt>
mov    $0x6,%edi
call   1070 <OverlayLoad@plt>
mov    $0x1,%edi
call   1030 <baz@plt>
mov    %eax,-0x10(%rbp)
mov    $0x3,%edi
call   1070 <OverlayLoad@plt>
mov    $0x7,%edi
call   1070 <OverlayLoad@plt>
mov    $0x1,%edi
call   1050 <grbx@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x569,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %edi,%edi
call   1070 <OverlayLoad@plt>
mov    $0x4,%edi
call   1070 <OverlayLoad@plt>
mov    $0x1,%edi
call   1060 <foo@plt>
mov    %eax,%r14d
mov    $0x1,%edi
call   1070 <OverlayLoad@plt>
mov    $0x5,%edi
call   1070 <OverlayLoad@plt>
mov    $0x1,%edi
call   1040 <bar@plt>
mov    %eax,%ebp
mov    $0x2,%edi
call   1070 <OverlayLoad@plt>
mov    $0x6,%edi
call   1070 <OverlayLoad@plt>
mov    $0x1,%edi
call   1030 <baz@plt>
mov    %eax,%ebx
mov    $0x3,%edi
call   1070 <OverlayLoad@plt>
mov    $0x7,%edi
call   1070 <OverlayLoad@plt>
mov    $0x1,%edi
call   1050 <grbx@plt>
add    %r14d,%ebp
add    %ebx,%ebp
add    %eax,%ebp
xor    %eax,%eax
cmp    $0x569,%ebp
setne  %al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 @OverlayLoad(i32 0)
%8 = call i32 @OverlayLoad(i32 4)
%9 = call i32 @foo(i32 1)
store i32 %9, i32* %2
%10 = call i32 @OverlayLoad(i32 1)
%11 = call i32 @OverlayLoad(i32 5)
%12 = call i32 @bar(i32 1)
store i32 %12, i32* %3
%13 = call i32 @OverlayLoad(i32 2)
%14 = call i32 @OverlayLoad(i32 6)
%15 = call i32 @baz(i32 1)
store i32 %15, i32* %4
%16 = call i32 @OverlayLoad(i32 3)
%17 = call i32 @OverlayLoad(i32 7)
%18 = call i32 @grbx(i32 1)
store i32 %18, i32* %5
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = add nsw i32 %19, %20
%22 = load i32, i32* %4
%23 = add nsw i32 %21, %22
%24 = load i32, i32* %5
%25 = add nsw i32 %23, %24
store i32 %25, i32* %6
%26 = load i32, i32* %6
%27 = icmp ne i32 %26, 1385
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @OverlayLoad(i32 0)
%2 = tail call i32 @OverlayLoad(i32 4)
%3 = tail call i32 @foo(i32 1)
%4 = tail call i32 @OverlayLoad(i32 1)
%5 = tail call i32 @OverlayLoad(i32 5)
%6 = tail call i32 @bar(i32 1)
%7 = tail call i32 @OverlayLoad(i32 2)
%8 = tail call i32 @OverlayLoad(i32 6)
%9 = tail call i32 @baz(i32 1)
%10 = tail call i32 @OverlayLoad(i32 3)
%11 = tail call i32 @OverlayLoad(i32 7)
%12 = tail call i32 @grbx(i32 1)
%13 = add nsw i32 %6, %3
%14 = add nsw i32 %13, %9
%15 = add nsw i32 %14, %12
%16 = icmp ne i32 %15, 1385
%17 = zext i1 %16 to i32
ret i32 %17
}