#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 */
scalar_t__ decide_if_publishable_server();
int /*<<< orphan*/ get_options();
int router_rebuild_descriptor(int /*<<< orphan*/);
int /*<<< orphan*/ router_upload_dir_desc_to_dirservers(int);
int /*<<< orphan*/ server_mode(int /*<<< orphan*/);
int /*<<< orphan*/ set_server_advertised(int);
void consider_publishable_server(int force) {
  int rebuilt;
  if (!server_mode(get_options()))
    return;
  rebuilt = router_rebuild_descriptor(0);
  if (decide_if_publishable_server()) {
    set_server_advertised(1);
    if (rebuilt == 0)
      router_upload_dir_desc_to_dirservers(force);
  } else {
    set_server_advertised(0);
  }
}


x86 assembly (clang, -O0):
<consider_publishable_server>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1070 <get_options@plt>
mov    %eax,%edi
call   1030 <server_mode@plt>
cmp    $0x0,%eax
jne    1187 <consider_publishable_server+0x27>
jmp    11ca <consider_publishable_server+0x6a>
xor    %edi,%edi
call   1080 <router_rebuild_descriptor@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <decide_if_publishable_server@plt>
cmp    $0x0,%rax
je     11c3 <consider_publishable_server+0x63>
mov    $0x1,%edi
call   1040 <set_server_advertised@plt>
cmpl   $0x0,-0x8(%rbp)
jne    11be <consider_publishable_server+0x5e>
mov    -0x4(%rbp),%edi
call   1060 <router_upload_dir_desc_to_dirservers@plt>
jmp    11ca <consider_publishable_server+0x6a>
xor    %edi,%edi
call   1040 <set_server_advertised@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<consider_publishable_server>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1070 <get_options@plt>
mov    %eax,%edi
call   1030 <server_mode@plt>
test   %eax,%eax
je     119a <consider_publishable_server+0x3a>
xor    %edi,%edi
call   1080 <router_rebuild_descriptor@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <decide_if_publishable_server@plt>
test   %rax,%rax
je     11a1 <consider_publishable_server+0x41>
mov    $0x1,%edi
call   1040 <set_server_advertised@plt>
test   %ebp,%ebp
je     11ae <consider_publishable_server+0x4e>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %edi,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <set_server_advertised@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <router_upload_dir_desc_to_dirservers@plt>

LLVM IR (-O0):
define void @consider_publishable_server(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @get_options()
%5 = call i32 @server_mode(i32 %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
br label %22
8: ; preds = %1
%9 = call i32 @router_rebuild_descriptor(i32 0)
store i32 %9, i32* %3
%10 = call i64 (...) @decide_if_publishable_server()
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = call i32 @set_server_advertised(i32 1)
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i32, i32* %2
%18 = call i32 @router_upload_dir_desc_to_dirservers(i32 %17)
br label %19
19: ; preds = %16, %12
br label %22
20: ; preds = %8
%21 = call i32 @set_server_advertised(i32 0)
br label %22
22: ; preds = %7, %20, %19
ret void
}

LLVM IR (-O2):
define void @consider_publishable_server(i32 %0) {
%2 = tail call i32 (...) @get_options()
%3 = tail call i32 @server_mode(i32 %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %1
%6 = tail call i32 @router_rebuild_descriptor(i32 0)
%7 = tail call i64 (...) @decide_if_publishable_server()
%8 = icmp eq i64 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = tail call i32 @set_server_advertised(i32 1)
%11 = icmp eq i32 %6, 0
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = tail call i32 @router_upload_dir_desc_to_dirservers(i32 %0)
br label %16
14: ; preds = %5
%15 = tail call i32 @set_server_advertised(i32 0)
br label %16
16: ; preds = %14, %12, %9, %1
ret void
}