#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 TELCMD(int);
scalar_t__ TELCMD_OK(int);
int TELOPT(int);
scalar_t__ TELOPT_OK(int);
int /*<<< orphan*/ netoprintf(char *, char const *, int);
void printoption(const char *fmt, int option) {
  if (TELOPT_OK(option))
    netoprintf("%s %s\r\n", fmt, TELOPT(option));
  else if (TELCMD_OK(option))
    netoprintf("%s %s\r\n", fmt, TELCMD(option));
  else
    netoprintf("%s %d\r\n", fmt, option);
}


x86 assembly (clang, -O0):
<printoption>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1060 <TELOPT_OK@plt>
cmp    $0x0,%rax
je     1198 <printoption+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1070 <TELOPT@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
lea    0xe72(%rip),%rdi
call   1040 <netoprintf@plt>
jmp    11e9 <printoption+0x99>
mov    -0xc(%rbp),%edi
call   1030 <TELCMD_OK@plt>
cmp    $0x0,%rax
je     11d1 <printoption+0x81>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <TELCMD@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
lea    0xe39(%rip),%rdi
call   1040 <netoprintf@plt>
jmp    11e4 <printoption+0x94>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xe29(%rip),%rdi
call   1040 <netoprintf@plt>
jmp    11e9 <printoption+0x99>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printoption>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %esi,%edi
call   1060 <TELOPT_OK@plt>
test   %rax,%rax
je     116d <printoption+0x1d>
mov    %ebp,%edi
call   1070 <TELOPT@plt>
jmp    1180 <printoption+0x30>
mov    %ebp,%edi
call   1030 <TELCMD_OK@plt>
test   %rax,%rax
je     1197 <printoption+0x47>
mov    %ebp,%edi
call   1050 <TELCMD@plt>
lea    0xe79(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <netoprintf@plt>
lea    0xe6a(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
jmp    118c <printoption+0x3c>

LLVM IR (-O0):
@.str = [8 x i8] c"%s %s\0D\0A\00"
@.str.1 = [8 x i8] c"%s %d\0D\0A\00"
define void @printoption(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i64 @TELOPT_OK(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = call i32 @TELOPT(i32 %10)
%12 = call i32 @netoprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %11)
br label %27
13: ; preds = %2
%14 = load i32, i32* %4
%15 = call i64 @TELCMD_OK(i32 %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = load i8*, i8** %3
%19 = load i32, i32* %4
%20 = call i32 @TELCMD(i32 %19)
%21 = call i32 @netoprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %18, i32 %20)
br label %26
22: ; preds = %13
%23 = load i8*, i8** %3
%24 = load i32, i32* %4
%25 = call i32 @netoprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %23, i32 %24)
br label %26
26: ; preds = %22, %17
br label %27
27: ; preds = %26, %8
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s %s\0D\0A\00"
@.str.1 = [8 x i8] c"%s %d\0D\0A\00"
define void @printoption(i8* %0, i32 %1) {
%3 = tail call i64 @TELOPT_OK(i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @TELOPT(i32 %1)
%7 = tail call i32 @netoprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %6)
br label %16
8: ; preds = %2
%9 = tail call i64 @TELCMD_OK(i32 %1)
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = tail call i32 @TELCMD(i32 %1)
%13 = tail call i32 @netoprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %12)
br label %16
14: ; preds = %8
%15 = tail call i32 @netoprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %1)
br label %16
16: ; preds = %11, %14, %5
ret void
}