#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 project_details {
  int dummy;
};
struct component_details {
  int dummy;
};
struct bca_context {
  int dummy;
};

/* Variables and functions */
scalar_t__ resolve_component_dependencies(struct bca_context *,
                                          struct component_details *);
scalar_t__
resolve_component_extra_file_dependencies(struct bca_context *,
                                          struct component_details *);
scalar_t__ resolve_component_include_directories(struct bca_context *,
                                                 struct component_details *);
scalar_t__ resolve_component_input_dependencies(struct bca_context *,
                                                struct component_details *,
                                                struct project_details *);
scalar_t__ resolve_component_source_files(struct bca_context *,
                                          struct component_details *);
scalar_t__ resolve_component_version(struct bca_context *,
                                     struct component_details *);
int component_details_resolve_all(struct bca_context *ctx,
                                  struct component_details *cd,
                                  struct project_details *pd) {
  if (resolve_component_source_files(ctx, cd))
    return 1;
  if (resolve_component_dependencies(ctx, cd))
    return 1;
  if (resolve_component_input_dependencies(ctx, cd, pd))
    return 1;
  if (resolve_component_extra_file_dependencies(ctx, cd))
    return 1;
  if (resolve_component_include_directories(ctx, cd))
    return 1;
  if (resolve_component_version(ctx, cd))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<component_details_resolve_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1070 <resolve_component_source_files@plt>
cmp    $0x0,%rax
je     1197 <component_details_resolve_all+0x37>
movl   $0x1,-0x4(%rbp)
jmp    1251 <component_details_resolve_all+0xf1>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <resolve_component_dependencies@plt>
cmp    $0x0,%rax
je     11ba <component_details_resolve_all+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1251 <component_details_resolve_all+0xf1>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1060 <resolve_component_input_dependencies@plt>
cmp    $0x0,%rax
je     11e1 <component_details_resolve_all+0x81>
movl   $0x1,-0x4(%rbp)
jmp    1251 <component_details_resolve_all+0xf1>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <resolve_component_extra_file_dependencies@plt>
cmp    $0x0,%rax
je     1204 <component_details_resolve_all+0xa4>
movl   $0x1,-0x4(%rbp)
jmp    1251 <component_details_resolve_all+0xf1>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <resolve_component_include_directories@plt>
cmp    $0x0,%rax
je     1227 <component_details_resolve_all+0xc7>
movl   $0x1,-0x4(%rbp)
jmp    1251 <component_details_resolve_all+0xf1>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1080 <resolve_component_version@plt>
cmp    $0x0,%rax
je     124a <component_details_resolve_all+0xea>
movl   $0x1,-0x4(%rbp)
jmp    1251 <component_details_resolve_all+0xf1>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<component_details_resolve_all>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1070 <resolve_component_source_files@plt>
mov    $0x1,%r14d
test   %rax,%rax
jne    11d8 <component_details_resolve_all+0x78>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1050 <resolve_component_dependencies@plt>
test   %rax,%rax
jne    11d8 <component_details_resolve_all+0x78>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1060 <resolve_component_input_dependencies@plt>
test   %rax,%rax
jne    11d8 <component_details_resolve_all+0x78>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <resolve_component_extra_file_dependencies@plt>
test   %rax,%rax
jne    11d8 <component_details_resolve_all+0x78>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1040 <resolve_component_include_directories@plt>
test   %rax,%rax
jne    11d8 <component_details_resolve_all+0x78>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1080 <resolve_component_version@plt>
xor    %r14d,%r14d
test   %rax,%rax
setne  %r14b
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.bca_context = type { i32 }
%struct.component_details = type { i32 }
%struct.project_details = type { i32 }
define i32 @component_details_resolve_all(%struct.bca_context* %0, %struct.component_details* %1, %struct.project_details* %2) {
%4 = alloca i32
%5 = alloca %struct.bca_context*
%6 = alloca %struct.component_details*
%7 = alloca %struct.project_details*
store %struct.bca_context* %0, %struct.bca_context** %5
store %struct.component_details* %1, %struct.component_details** %6
store %struct.project_details* %2, %struct.project_details** %7
%8 = load %struct.bca_context*, %struct.bca_context** %5
%9 = load %struct.component_details*, %struct.component_details** %6
%10 = call i64 @resolve_component_source_files(%struct.bca_context* %8, %struct.component_details* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %3
store i32 1, i32* %4
br label %45
13: ; preds = %3
%14 = load %struct.bca_context*, %struct.bca_context** %5
%15 = load %struct.component_details*, %struct.component_details** %6
%16 = call i64 @resolve_component_dependencies(%struct.bca_context* %14, %struct.component_details* %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 1, i32* %4
br label %45
19: ; preds = %13
%20 = load %struct.bca_context*, %struct.bca_context** %5
%21 = load %struct.component_details*, %struct.component_details** %6
%22 = load %struct.project_details*, %struct.project_details** %7
%23 = call i64 @resolve_component_input_dependencies(%struct.bca_context* %20, %struct.component_details* %21, %struct.project_details* %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %19
store i32 1, i32* %4
br label %45
26: ; preds = %19
%27 = load %struct.bca_context*, %struct.bca_context** %5
%28 = load %struct.component_details*, %struct.component_details** %6
%29 = call i64 @resolve_component_extra_file_dependencies(%struct.bca_context* %27, %struct.component_details* %28)
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %26
store i32 1, i32* %4
br label %45
32: ; preds = %26
%33 = load %struct.bca_context*, %struct.bca_context** %5
%34 = load %struct.component_details*, %struct.component_details** %6
%35 = call i64 @resolve_component_include_directories(%struct.bca_context* %33, %struct.component_details* %34)
%36 = icmp ne i64 %35, 0
br i1 %36, label %37, label %38
37: ; preds = %32
store i32 1, i32* %4
br label %45
38: ; preds = %32
%39 = load %struct.bca_context*, %struct.bca_context** %5
%40 = load %struct.component_details*, %struct.component_details** %6
%41 = call i64 @resolve_component_version(%struct.bca_context* %39, %struct.component_details* %40)
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %44
43: ; preds = %38
store i32 1, i32* %4
br label %45
44: ; preds = %38
store i32 0, i32* %4
br label %45
45: ; preds = %44, %43, %37, %31, %25, %18, %12
%46 = load i32, i32* %4
ret i32 %46
}

LLVM IR (-O2):
%struct.bca_context = type { i32 }
%struct.component_details = type { i32 }
%struct.project_details = type { i32 }
define i32 @component_details_resolve_all(%struct.bca_context* %0, %struct.component_details* %1, %struct.project_details* %2) {
%4 = tail call i64 @resolve_component_source_files(%struct.bca_context* %0, %struct.component_details* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %22
6: ; preds = %3
%7 = tail call i64 @resolve_component_dependencies(%struct.bca_context* %0, %struct.component_details* %1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %22
9: ; preds = %6
%10 = tail call i64 @resolve_component_input_dependencies(%struct.bca_context* %0, %struct.component_details* %1, %struct.project_details* %2)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %22
12: ; preds = %9
%13 = tail call i64 @resolve_component_extra_file_dependencies(%struct.bca_context* %0, %struct.component_details* %1)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = tail call i64 @resolve_component_include_directories(%struct.bca_context* %0, %struct.component_details* %1)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = tail call i64 @resolve_component_version(%struct.bca_context* %0, %struct.component_details* %1)
%20 = icmp ne i64 %19, 0
%21 = zext i1 %20 to i32
br label %22
22: ; preds = %18, %15, %12, %9, %6, %3
%23 = phi i32 [ 1, %3 ], [ 1, %6 ], [ 1, %9 ], [ 1, %12 ], [ 1, %15 ], [ %21, %18 ]
ret i32 %23
}