#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 ftp_module_init(char const *);
int http_module_init(char const *);
int preprocessor_init(const char *cnfs_path) {
  int ret = http_module_init(cnfs_path);
  if (ret == 0) {
    return 3;
  } else if (ret == 2) {
    return 5;
  }
  ret = ftp_module_init(cnfs_path);
  if (ret == 0) {
    return 3;
  } else if (ret == 2) {
    return 5;
  }
  return 4;
}


x86 assembly (clang, -O0):
<preprocessor_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <http_module_init@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    114e <preprocessor_init+0x2e>
movl   $0x3,-0x4(%rbp)
jmp    11ad <preprocessor_init+0x8d>
cmpl   $0x2,-0x14(%rbp)
jne    1164 <preprocessor_init+0x44>
movl   $0x5,-0x4(%rbp)
jmp    11ad <preprocessor_init+0x8d>
jmp    1169 <preprocessor_init+0x49>
mov    -0x10(%rbp),%rdi
call   1040 <ftp_module_init@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    118b <preprocessor_init+0x6b>
movl   $0x3,-0x4(%rbp)
jmp    11ad <preprocessor_init+0x8d>
cmpl   $0x2,-0x14(%rbp)
jne    11a1 <preprocessor_init+0x81>
movl   $0x5,-0x4(%rbp)
jmp    11ad <preprocessor_init+0x8d>
jmp    11a6 <preprocessor_init+0x86>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<preprocessor_init>:
push   %rbx
mov    %rdi,%rbx
call   1030 <http_module_init@plt>
test   %eax,%eax
je     1139 <preprocessor_init+0x19>
cmp    $0x2,%eax
jne    1140 <preprocessor_init+0x20>
mov    $0x5,%eax
pop    %rbx
ret
mov    $0x3,%eax
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <ftp_module_init@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
sete   %cl
or     $0x4,%ecx
test   %eax,%eax
mov    $0x3,%eax
cmovne %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @preprocessor_init(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @http_module_init(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 3, i32* %2
br label %27
10: ; preds = %1
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 5, i32* %2
br label %27
14: ; preds = %10
br label %15
15: ; preds = %14
%16 = load i8*, i8** %3
%17 = call i32 @ftp_module_init(i8* %16)
store i32 %17, i32* %4
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %15
store i32 3, i32* %2
br label %27
21: ; preds = %15
%22 = load i32, i32* %4
%23 = icmp eq i32 %22, 2
br i1 %23, label %24, label %25
24: ; preds = %21
store i32 5, i32* %2
br label %27
25: ; preds = %21
br label %26
26: ; preds = %25
store i32 4, i32* %2
br label %27
27: ; preds = %26, %24, %20, %13, %9
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
define i32 @preprocessor_init(i8* %0) {
%2 = tail call i32 @http_module_init(i8* %0)
switch i32 %2, label %4 [
i32 0, label %10
i32 2, label %3
]
3: ; preds = %1
br label %10
4: ; preds = %1
%5 = tail call i32 @ftp_module_init(i8* %0)
%6 = icmp eq i32 %5, 2
%7 = select i1 %6, i32 5, i32 4
%8 = icmp eq i32 %5, 0
%9 = select i1 %8, i32 3, i32 %7
br label %10
10: ; preds = %4, %1, %3
%11 = phi i32 [ 5, %3 ], [ 3, %1 ], [ %9, %4 ]
ret i32 %11
}