#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*/ printf(char *);
int test_short_input();
int test_sign_similarity();
int test_simple_sign();
int main() {
  int res = 0;
  res |= test_simple_sign();
  res |= test_short_input();
  res |= test_sign_similarity();
  if (0 == res) {
    printf("\n===========================\n");
    printf("All tests passed successfuly!\n");
    printf("===========================\n");
  } else {
    printf("\n@@@@@@@@@@@@@@@@@@@@@@@@\n");
    printf("Some tests have failed!\n");
    printf("@@@@@@@@@@@@@@@@@@@@@@@@\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <test_simple_sign@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <test_short_input@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <test_sign_similarity@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jne    11b1 <main+0x71>
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
jmp    11e1 <main+0xa1>
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11e8 <main+0xa8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <test_simple_sign@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <test_short_input@plt>
mov    %eax,%ebp
or     %ebx,%ebp
xor    %eax,%eax
call   1050 <test_sign_similarity@plt>
xor    %ebx,%ebx
or     %ebp,%eax
setne  %bl
lea    0xec5(%rip),%rax
lea    0xe8c(%rip),%rdi
cmove  %rax,%rdi
lea    0xed0(%rip),%rax
lea    0xe94(%rip),%rbp
cmove  %rax,%rbp
lea    0xea2(%rip),%rax
lea    0xe69(%rip),%r14
cmove  %rax,%r14
neg    %ebx
call   1030 <puts@plt>
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"\0A===========================\0A\00"
@.str.1 = [31 x i8] c"All tests passed successfuly!\0A\00"
@.str.2 = [29 x i8] c"===========================\0A\00"
@.str.3 = [27 x i8] c"\0A@@@@@@@@@@@@@@@@@@@@@@@@\0A\00"
@.str.4 = [25 x i8] c"Some tests have failed!\0A\00"
@.str.5 = [26 x i8] c"@@@@@@@@@@@@@@@@@@@@@@@@\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (...) @test_simple_sign()
%4 = load i32, i32* %2
%5 = or i32 %4, %3
store i32 %5, i32* %2
%6 = call i32 (...) @test_short_input()
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = call i32 (...) @test_sign_similarity()
%10 = load i32, i32* %2
%11 = or i32 %10, %9
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = icmp eq i32 0, %12
br i1 %13, label %14, label %18
14: ; preds = %0
%15 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %22
18: ; preds = %0
%19 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%21 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
store i32 -1, i32* %1
br label %23
22: ; preds = %14
store i32 0, i32* %1
br label %23
23: ; preds = %22, %18
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
@str = [26 x i8] c"\0A@@@@@@@@@@@@@@@@@@@@@@@@\00"
@str.6 = [24 x i8] c"Some tests have failed!\00"
@str.7 = [25 x i8] c"@@@@@@@@@@@@@@@@@@@@@@@@\00"
@str.8 = [29 x i8] c"\0A===========================\00"
@str.9 = [30 x i8] c"All tests passed successfuly!\00"
@str.10 = [28 x i8] c"===========================\00"
define i32 @main() {
%1 = tail call i32 (...) @test_simple_sign()
%2 = tail call i32 (...) @test_short_input()
%3 = or i32 %2, %1
%4 = tail call i32 (...) @test_sign_similarity()
%5 = or i32 %3, %4
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @str.8, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0)
%8 = select i1 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @str.9, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str.6, i64 0, i64 0)
%9 = select i1 %6, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @str.10, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @str.7, i64 0, i64 0)
%10 = xor i1 %6, true
%11 = sext i1 %10 to i32
%12 = tail call i32 @puts(i8* dereferenceable(1) %7)
%13 = tail call i32 @puts(i8* dereferenceable(1) %8)
%14 = tail call i32 @puts(i8* dereferenceable(1) %9)
ret i32 %11
}