#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 */
struct my_struct {
  int dummy;
};
struct json_obj_any {
  int dummy;
};
struct jslex {
  int dummy;
};

/* Variables and functions */
scalar_t__ my_any_bool(struct json_obj_any *, struct jslex *);
scalar_t__ my_any_integer(struct json_obj_any *, struct jslex *);
scalar_t__ my_any_real(struct json_obj_any *, struct jslex *);
scalar_t__ my_any_string(struct json_obj_any *, struct jslex *);
int my_any_value(struct my_struct *dest, struct json_obj_any *any,
                 struct jslex *lexer) {
  return my_any_integer(any, lexer) || my_any_real(any, lexer) ||
         my_any_string(any, lexer) || my_any_bool(any, lexer);
}


x86 assembly (clang, -O0):
<my_any_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <my_any_integer@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
jne    11c8 <my_any_value+0x88>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <my_any_real@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
jne    11c8 <my_any_value+0x88>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <my_any_string@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
jne    11c8 <my_any_value+0x88>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <my_any_bool@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_any_value>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rbp
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <my_any_integer@plt>
mov    $0x1,%r14d
test   %rax,%rax
jne    1195 <my_any_value+0x55>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1040 <my_any_real@plt>
test   %rax,%rax
jne    1195 <my_any_value+0x55>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1050 <my_any_string@plt>
test   %rax,%rax
jne    1195 <my_any_value+0x55>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1060 <my_any_bool@plt>
xor    %r14d,%r14d
test   %rax,%rax
setne  %r14b
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.my_struct = type { i32 }
%struct.json_obj_any = type { i32 }
%struct.jslex = type { i32 }
define i32 @my_any_value(%struct.my_struct* %0, %struct.json_obj_any* %1, %struct.jslex* %2) {
%4 = alloca %struct.my_struct*
%5 = alloca %struct.json_obj_any*
%6 = alloca %struct.jslex*
store %struct.my_struct* %0, %struct.my_struct** %4
store %struct.json_obj_any* %1, %struct.json_obj_any** %5
store %struct.jslex* %2, %struct.jslex** %6
%7 = load %struct.json_obj_any*, %struct.json_obj_any** %5
%8 = load %struct.jslex*, %struct.jslex** %6
%9 = call i64 @my_any_integer(%struct.json_obj_any* %7, %struct.jslex* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %26, label %11
11: ; preds = %3
%12 = load %struct.json_obj_any*, %struct.json_obj_any** %5
%13 = load %struct.jslex*, %struct.jslex** %6
%14 = call i64 @my_any_real(%struct.json_obj_any* %12, %struct.jslex* %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %26, label %16
16: ; preds = %11
%17 = load %struct.json_obj_any*, %struct.json_obj_any** %5
%18 = load %struct.jslex*, %struct.jslex** %6
%19 = call i64 @my_any_string(%struct.json_obj_any* %17, %struct.jslex* %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %26, label %21
21: ; preds = %16
%22 = load %struct.json_obj_any*, %struct.json_obj_any** %5
%23 = load %struct.jslex*, %struct.jslex** %6
%24 = call i64 @my_any_bool(%struct.json_obj_any* %22, %struct.jslex* %23)
%25 = icmp ne i64 %24, 0
br label %26
26: ; preds = %21, %16, %11, %3
%27 = phi i1 [ true, %16 ], [ true, %11 ], [ true, %3 ], [ %25, %21 ]
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
%struct.my_struct = type { i32 }
%struct.json_obj_any = type { i32 }
%struct.jslex = type { i32 }
define i32 @my_any_value(%struct.my_struct* nocapture readnone %0, %struct.json_obj_any* %1, %struct.jslex* %2) {
%4 = tail call i64 @my_any_integer(%struct.json_obj_any* %1, %struct.jslex* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = tail call i64 @my_any_real(%struct.json_obj_any* %1, %struct.jslex* %2)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = tail call i64 @my_any_string(%struct.json_obj_any* %1, %struct.jslex* %2)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = tail call i64 @my_any_bool(%struct.json_obj_any* %1, %struct.jslex* %2)
%14 = icmp ne i64 %13, 0
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %12, %9, %6, %3
%17 = phi i32 [ 1, %9 ], [ 1, %6 ], [ 1, %3 ], [ %15, %12 ]
ret i32 %17
}