#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 /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
scalar_t__ tnlIsOption(int);
int /*<<< orphan*/ tnlRequestSubOption(int);
int /*<<< orphan*/ tnlSendSubOption(int, char *);
int cmdBaud(int argc, char *argv[]) {
  if (tnlIsOption(128)) {
    if (argc == 2)
      tnlSendSubOption(128, argv[1]);
    else if (argc == 1)
      tnlRequestSubOption(128);
    else
      fprintf(stderr, "\rusage: baud [<baud rate>]\n\r");
  } else
    fprintf(stderr, "\rOption BAUDRATE is disabled\n\r");
  return (0);
}


x86 assembly (clang, -O0):
<cmdBaud>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x80,%edi
call   1050 <tnlIsOption@plt>
cmp    $0x0,%rax
je     11bc <cmdBaud+0x7c>
cmpl   $0x2,-0x4(%rbp)
jne    1184 <cmdBaud+0x44>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    $0x80,%edi
call   1030 <tnlSendSubOption@plt>
jmp    11b7 <cmdBaud+0x77>
cmpl   $0x1,-0x4(%rbp)
jne    119d <cmdBaud+0x5d>
mov    $0x80,%edi
call   1060 <tnlRequestSubOption@plt>
jmp    11b2 <cmdBaud+0x72>
mov    0x2e3c(%rip),%rax
mov    (%rax),%edi
lea    0xe53(%rip),%rsi
call   1040 <fprintf@plt>
jmp    11b7 <cmdBaud+0x77>
jmp    11d1 <cmdBaud+0x91>
mov    0x2e1d(%rip),%rax
mov    (%rax),%edi
lea    0xe51(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdBaud>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x80,%edi
call   1050 <tnlIsOption@plt>
test   %rax,%rax
je     1171 <cmdBaud+0x31>
cmp    $0x1,%ebp
je     1183 <cmdBaud+0x43>
cmp    $0x2,%ebp
jne    118f <cmdBaud+0x4f>
mov    0x8(%rbx),%rsi
mov    $0x80,%edi
call   1030 <tnlSendSubOption@plt>
jmp    11a4 <cmdBaud+0x64>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
jmp    119f <cmdBaud+0x5f>
mov    $0x80,%edi
call   1060 <tnlRequestSubOption@plt>
jmp    11a4 <cmdBaud+0x64>
mov    0x2e4a(%rip),%rax
mov    (%rax),%edi
lea    0xe61(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"\0Dusage: baud [<baud rate>]\0A\0D\00"
@.str.1 = [31 x i8] c"\0DOption BAUDRATE is disabled\0A\0D\00"
define i32 @cmdBaud(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i64 @tnlIsOption(i32 128)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %25
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @tnlSendSubOption(i32 128, i8* %13)
br label %24
15: ; preds = %7
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @tnlRequestSubOption(i32 128)
br label %23
20: ; preds = %15
%21 = load i32, i32* @stderr
%22 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %23
23: ; preds = %20, %18
br label %24
24: ; preds = %23, %10
br label %28
25: ; preds = %2
%26 = load i32, i32* @stderr
%27 = call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %28
28: ; preds = %25, %24
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"\0Dusage: baud [<baud rate>]\0A\0D\00"
@.str.1 = [31 x i8] c"\0DOption BAUDRATE is disabled\0A\0D\00"
define i32 @cmdBaud(i32 %0, i8** nocapture %1) {
%3 = tail call i64 @tnlIsOption(i32 128)
%4 = icmp eq i64 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2
switch i32 %0, label %12 [
i32 2, label %6
i32 1, label %10
]
6: ; preds = %5
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @tnlSendSubOption(i32 128, i8* %8)
br label %18
10: ; preds = %5
%11 = tail call i32 @tnlRequestSubOption(i32 128)
br label %18
12: ; preds = %5
%13 = load i32, i32* @stderr
%14 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %18
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = tail call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %6, %12, %10, %15
ret i32 0
}