#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
scalar_t__ test01();
scalar_t__ test02();
scalar_t__ test03();
main() {
  printf("Three tests of round-trip conversions will be performed.\n");
  printf("Two illegal result messages are expected; one in test 02A; one in "
         "test 03A .\n\n");
  fflush(stdout);
  if (test01()) {
    printf("******** Test01 succeeded without error. ********\n\n");
  } else {
    printf("-------- Test01 failed. --------\n\n");
  }
  if (test02()) {
    printf("******** Test02 succeeded without error. ********\n\n");
  } else {
    printf("-------- Test02 failed. --------\n\n");
  }
  if (test03()) {
    printf("******** Test03 succeeded without error. ********\n\n");
  } else {
    printf("-------- Test03 failed. --------\n\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1050 <printf@plt>
lea    0xec8(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    $0x0,%al
call   1030 <test01@plt>
cmp    $0x0,%rax
je     11a7 <main+0x57>
lea    0xeec(%rip),%rdi
call   1050 <printf@plt>
jmp    11b3 <main+0x63>
lea    0xf0f(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <test02@plt>
cmp    $0x0,%rax
je     11d5 <main+0x85>
lea    0xf15(%rip),%rdi
call   1050 <printf@plt>
jmp    11e1 <main+0x91>
lea    0xf38(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <test03@plt>
cmp    $0x0,%rax
je     1203 <main+0xb3>
lea    0xf3e(%rip),%rdi
call   1050 <printf@plt>
jmp    120f <main+0xbf>
lea    0xf61(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1040 <puts@plt>
lea    0xed5(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
xor    %eax,%eax
call   1030 <test01@plt>
test   %rax,%rax
lea    0xeff(%rip),%rax
lea    0xfc4(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1070 <test02@plt>
test   %rax,%rax
lea    0xf00(%rip),%rax
lea    0xf70(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <test03@plt>
test   %rax,%rax
lea    0xf01(%rip),%rax
lea    0xf1c(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [58 x i8] c"Three tests of round-trip conversions will be performed.\0A\00"
@.str.1 = [79 x i8] c"Two illegal result messages are expected; one in test 02A; one in test 03A .\0A\0A\00"
@stdout = global i32 0
@.str.2 = [52 x i8] c"******** Test01 succeeded without error. ********\0A\0A\00"
@.str.3 = [35 x i8] c"-------- Test01 failed. --------\0A\0A\00"
@.str.4 = [52 x i8] c"******** Test02 succeeded without error. ********\0A\0A\00"
@.str.5 = [35 x i8] c"-------- Test02 failed. --------\0A\0A\00"
@.str.6 = [52 x i8] c"******** Test03 succeeded without error. ********\0A\0A\00"
@.str.7 = [35 x i8] c"-------- Test03 failed. --------\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
%6 = call i64 (...) @test01()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = call i64 (...) @test02()
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0))
br label %19
17: ; preds = %12
%18 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
br label %19
19: ; preds = %17, %15
%20 = call i64 (...) @test03()
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.6, i64 0, i64 0))
br label %26
24: ; preds = %19
%25 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0))
br label %26
26: ; preds = %24, %22
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [57 x i8] c"Three tests of round-trip conversions will be performed.\00"
@str.8 = [78 x i8] c"Two illegal result messages are expected; one in test 02A; one in test 03A .\0A\00"
@str.9 = [34 x i8] c"-------- Test01 failed. --------\0A\00"
@str.10 = [34 x i8] c"-------- Test02 failed. --------\0A\00"
@str.11 = [34 x i8] c"-------- Test03 failed. --------\0A\00"
@str.12 = [51 x i8] c"******** Test03 succeeded without error. ********\0A\00"
@str.13 = [51 x i8] c"******** Test02 succeeded without error. ********\0A\00"
@str.14 = [51 x i8] c"******** Test01 succeeded without error. ********\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.8, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i64 (...) @test01()
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @str.9, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @str.14, i64 0, i64 0)
%8 = tail call i32 @puts(i8* dereferenceable(1) %7)
%9 = tail call i64 (...) @test02()
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @str.10, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @str.13, i64 0, i64 0)
%12 = tail call i32 @puts(i8* dereferenceable(1) %11)
%13 = tail call i64 (...) @test03()
%14 = icmp eq i64 %13, 0
%15 = select i1 %14, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @str.11, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @str.12, i64 0, i64 0)
%16 = tail call i32 @puts(i8* dereferenceable(1) %15)
ret i32 0
}