#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*/ puts(char *);
scalar_t__ test32();
scalar_t__ test64();
int main() {
  int result = 0;
  puts("testing 32-bit code...");
  result = test32() || result;
  puts("testing 64-bit code...");
  result = test64() || result;
  puts(result ? "OK" : "FAILED");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1050 <test32@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1175 <main+0x45>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
lea    0xe90(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <test64@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0xa(%rbp)
jne    11af <main+0x7f>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
lea    0xe6d(%rip),%rdi
lea    0xe63(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <test32@plt>
mov    %rax,%rbx
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <test64@plt>
lea    0xecd(%rip),%rcx
lea    0xec9(%rip),%rdi
or     %rbx,%rax
cmovne %rcx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"testing 32-bit code...\00"
@.str.1 = [23 x i8] c"testing 64-bit code...\00"
@.str.2 = [3 x i8] c"OK\00"
@.str.3 = [7 x i8] c"FAILED\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i64 (...) @test32()
%5 = icmp ne i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br label %9
9: ; preds = %6, %0
%10 = phi i1 [ true, %0 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
store i32 %11, i32* %2
%12 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%13 = call i64 (...) @test64()
%14 = icmp ne i64 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %9
%16 = load i32, i32* %2
%17 = icmp ne i32 %16, 0
br label %18
18: ; preds = %15, %9
%19 = phi i1 [ true, %9 ], [ %17, %15 ]
%20 = zext i1 %19 to i32
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = icmp ne i32 %21, 0
%23 = zext i1 %22 to i64
%24 = select i1 %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0)
%25 = call i32 @puts(i8* %24)
%26 = load i32, i32* %1
ret i32 %26
}

LLVM IR (-O2):
@.str = [23 x i8] c"testing 32-bit code...\00"
@.str.1 = [23 x i8] c"testing 64-bit code...\00"
@.str.2 = [3 x i8] c"OK\00"
@.str.3 = [7 x i8] c"FAILED\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 (...) @test32()
%3 = icmp ne i64 %2, 0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i64 (...) @test64()
%6 = icmp ne i64 %5, 0
%7 = select i1 %6, i1 true, i1 %3
%8 = select i1 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0)
%9 = tail call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}