#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 condexp(int, int);
int inc(int);
int callbool(int y) {
  y = condexp(inc(y) || inc(inc(y * 2)), 3);
  return condexp(y > 3, y == 4 || y == 10);
}


x86 assembly (clang, -O0):
<callbool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <inc@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    115e <callbool+0x3e>
mov    -0x4(%rbp),%edi
shl    $0x1,%edi
call   1040 <inc@plt>
mov    %eax,%edi
call   1040 <inc@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x3,%esi
call   1030 <condexp@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x4,-0x4(%rbp)
mov    %al,-0x6(%rbp)
je     119b <callbool+0x7b>
cmpl   $0xa,-0x4(%rbp)
sete   %al
mov    %al,-0x6(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x6(%rbp),%al
and    $0x1,%al
movzbl %al,%esi
call   1030 <condexp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callbool>:
push   %rbx
mov    %edi,%ebx
call   1040 <inc@plt>
mov    $0x1,%edi
test   %eax,%eax
jne    1149 <callbool+0x29>
add    %ebx,%ebx
mov    %ebx,%edi
call   1040 <inc@plt>
mov    %eax,%edi
call   1040 <inc@plt>
xor    %edi,%edi
test   %eax,%eax
setne  %dil
mov    $0x3,%esi
call   1030 <condexp@plt>
xor    %edi,%edi
cmp    $0x4,%eax
setge  %dil
sete   %cl
cmp    $0xa,%eax
sete   %al
or     %cl,%al
movzbl %al,%esi
pop    %rbx
jmp    1030 <condexp@plt>

LLVM IR (-O0):
define i32 @callbool(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @inc(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = mul nsw i32 %7, 2
%9 = call i32 @inc(i32 %8)
%10 = call i32 @inc(i32 %9)
%11 = icmp ne i32 %10, 0
br label %12
12: ; preds = %6, %1
%13 = phi i1 [ true, %1 ], [ %11, %6 ]
%14 = zext i1 %13 to i32
%15 = call i32 @condexp(i32 %14, i32 3)
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = icmp sgt i32 %16, 3
%18 = zext i1 %17 to i32
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 4
br i1 %20, label %24, label %21
21: ; preds = %12
%22 = load i32, i32* %2
%23 = icmp eq i32 %22, 10
br label %24
24: ; preds = %21, %12
%25 = phi i1 [ true, %12 ], [ %23, %21 ]
%26 = zext i1 %25 to i32
%27 = call i32 @condexp(i32 %18, i32 %26)
ret i32 %27
}

LLVM IR (-O2):
define i32 @callbool(i32 %0) {
%2 = tail call i32 @inc(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = shl nsw i32 %0, 1
%6 = tail call i32 @inc(i32 %5)
%7 = tail call i32 @inc(i32 %6)
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %1
%11 = phi i32 [ 1, %1 ], [ %9, %4 ]
%12 = tail call i32 @condexp(i32 %11, i32 3)
%13 = icmp sgt i32 %12, 3
%14 = zext i1 %13 to i32
%15 = icmp eq i32 %12, 4
%16 = icmp eq i32 %12, 10
%17 = or i1 %15, %16
%18 = zext i1 %17 to i32
%19 = tail call i32 @condexp(i32 %14, i32 %18)
ret i32 %19
}