#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 EXIT_SUCCESS;
int /*<<< orphan*/ print_usage();
int /*<<< orphan*/ set_rts_cts(int);
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    print_usage();
  } else {
    int enable = strcmp(argv[1], "on") == 0;
    int disable = strcmp(argv[1], "off") == 0;
    enable || disable ? set_rts_cts(enable) : print_usage();
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     115c <main+0x2c>
mov    $0x0,%al
call   1050 <print_usage@plt>
jmp    11ca <main+0x9a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe95(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe75(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    11b6 <main+0x86>
cmpl   $0x0,-0x18(%rbp)
je     11c3 <main+0x93>
mov    -0x14(%rbp),%edi
call   1040 <set_rts_cts@plt>
jmp    11ca <main+0x9a>
mov    $0x0,%al
call   1050 <print_usage@plt>
mov    0x2e0f(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%edi
jne    1169 <main+0x39>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xeb9(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%r14
mov    0x8(%rbx),%rdi
lea    0xea9(%rip),%rsi
call   1030 <strcmp@plt>
test   %r14,%r14
je     1172 <main+0x42>
test   %rax,%rax
je     1172 <main+0x42>
xor    %eax,%eax
call   1050 <print_usage@plt>
jmp    1180 <main+0x50>
xor    %edi,%edi
test   %r14,%r14
sete   %dil
call   1040 <set_rts_cts@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"on\00"
@.str.1 = [4 x i8] c"off\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (...) @print_usage()
br label %37
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
%18 = zext i1 %17 to i32
store i32 %18, i32* %6
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
%24 = zext i1 %23 to i32
store i32 %24, i32* %7
%25 = load i32, i32* %6
%26 = icmp ne i32 %25, 0
br i1 %26, label %30, label %27
27: ; preds = %12
%28 = load i32, i32* %7
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %27, %12
%31 = load i32, i32* %6
%32 = call i32 @set_rts_cts(i32 %31)
br label %35
33: ; preds = %27
%34 = call i32 (...) @print_usage()
br label %35
35: ; preds = %33, %30
%36 = phi i32 [ %32, %30 ], [ %34, %33 ]
br label %37
37: ; preds = %35, %10
%38 = load i32, i32* @EXIT_SUCCESS
ret i32 %38
}

LLVM IR (-O2):
@.str = [3 x i8] c"on\00"
@.str.1 = [4 x i8] c"off\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @print_usage()
br label %20
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
%11 = load i8*, i8** %7
%12 = tail call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
%14 = select i1 %10, i1 true, i1 %13
br i1 %14, label %15, label %18
15: ; preds = %6
%16 = zext i1 %10 to i32
%17 = tail call i32 @set_rts_cts(i32 %16)
br label %20
18: ; preds = %6
%19 = tail call i32 (...) @print_usage()
br label %20
20: ; preds = %15, %18, %4
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}