#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 ffun(int);
scalar_t__ fun(int);
scalar_t__ hwfun(int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int n;
  for (n = 3; n < 1000; n += 2) {
    if (fun(n) && fun(ffun(n))) {
      printf("%5d", n);
    }
    if (fun(n) && hwfun(n)) {
      printf("%5d", n);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x4(%rbp)
cmpl   $0x3e8,-0x4(%rbp)
jge    11dc <main+0x9c>
mov    -0x4(%rbp),%edi
call   1030 <fun@plt>
cmp    $0x0,%rax
je     1196 <main+0x56>
mov    -0x4(%rbp),%edi
call   1050 <ffun@plt>
mov    %eax,%edi
call   1030 <fun@plt>
cmp    $0x0,%rax
je     1196 <main+0x56>
mov    -0x4(%rbp),%esi
lea    0xe6f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <fun@plt>
cmp    $0x0,%rax
je     11c9 <main+0x89>
mov    -0x4(%rbp),%edi
call   1060 <hwfun@plt>
cmp    $0x0,%rax
je     11c9 <main+0x89>
mov    -0x4(%rbp),%esi
lea    0xe3c(%rip),%rdi
call   1040 <printf@plt>
jmp    11ce <main+0x8e>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    114f <main+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xeb0(%rip),%r14
jmp    1168 <main+0x28>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0x3e6,%ebx
jae    11b8 <main+0x78>
add    $0x2,%ebx
mov    %ebx,%edi
call   1030 <fun@plt>
test   %rax,%rax
je     1194 <main+0x54>
mov    %ebx,%edi
call   1050 <ffun@plt>
mov    %eax,%edi
call   1030 <fun@plt>
test   %rax,%rax
je     1194 <main+0x54>
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    %ebx,%edi
call   1030 <fun@plt>
test   %rax,%rax
je     1160 <main+0x20>
mov    %ebx,%edi
call   1060 <hwfun@plt>
test   %rax,%rax
je     1160 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
jmp    1160 <main+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%5d\00"
define void @main() {
%1 = alloca i32
store i32 3, i32* %1
br label %2
2: ; preds = %29, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 1000
br i1 %4, label %5, label %32
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i64 @fun(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %5
%10 = load i32, i32* %1
%11 = call i32 @ffun(i32 %10)
%12 = call i64 @fun(i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = load i32, i32* %1
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %14, %9, %5
%18 = load i32, i32* %1
%19 = call i64 @fun(i32 %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %28
21: ; preds = %17
%22 = load i32, i32* %1
%23 = call i64 @hwfun(i32 %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = load i32, i32* %1
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %26)
br label %28
28: ; preds = %25, %21, %17
br label %29
29: ; preds = %28
%30 = load i32, i32* %1
%31 = add nsw i32 %30, 2
store i32 %31, i32* %1
br label %2
32: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%5d\00"
define void @main() {
br label %1
1: ; preds = %0, %19
%2 = phi i32 [ 3, %0 ], [ %20, %19 ]
%3 = tail call i64 @fun(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = tail call i32 @ffun(i32 %2)
%7 = tail call i64 @fun(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %11
11: ; preds = %9, %5, %1
%12 = tail call i64 @fun(i32 %2)
%13 = icmp eq i64 %12, 0
br i1 %13, label %19, label %14
14: ; preds = %11
%15 = tail call i64 @hwfun(i32 %2)
%16 = icmp eq i64 %15, 0
br i1 %16, label %19, label %17
17: ; preds = %14
%18 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %19
19: ; preds = %11, %14, %17
%20 = add nuw nsw i32 %2, 2
%21 = icmp ult i32 %2, 998
br i1 %21, label %1, label %22
22: ; preds = %19
ret void
}