#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 *, char);
scalar_t__ isprint(char);
char optopt;
int /*<<< orphan*/ stderr;
void handle_bad_opts(void) {
  if ((optopt == 'a') || (optopt == 'b') || (optopt == 's')) {
    fprintf(stderr, "ERROR: option -%c requires an argument.\n\n", optopt);
  } else if (isprint(optopt)) {
    fprintf(stderr, "ERROR: unknown option `-%c'.\n\n", optopt);
  } else {
    fprintf(stderr, "ERROR: unknown option character `\\x%x'.\n\n", optopt);
  }
}


x86 assembly (clang, -O0):
<handle_bad_opts>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
je     115d <handle_bad_opts+0x3d>
mov    0x2eaa(%rip),%rax
movsbl (%rax),%eax
cmp    $0x62,%eax
je     115d <handle_bad_opts+0x3d>
mov    0x2e97(%rip),%rax
movsbl (%rax),%eax
cmp    $0x73,%eax
jne    1181 <handle_bad_opts+0x61>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
lea    0xe93(%rip),%rsi
mov    0x2e74(%rip),%rax
movsbl (%rax),%edx
call   1030 <fprintf@plt>
jmp    11e2 <handle_bad_opts+0xc2>
mov    0x2e60(%rip),%rax
movsbl (%rax),%edi
call   1040 <isprint@plt>
cmp    $0x0,%rax
je     11be <handle_bad_opts+0x9e>
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
lea    0xe80(%rip),%rsi
mov    0x2e37(%rip),%rax
movsbl (%rax),%edx
call   1030 <fprintf@plt>
jmp    11dd <handle_bad_opts+0xbd>
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
lea    0xe7b(%rip),%rsi
mov    0x2e13(%rip),%rax
movsbl (%rax),%edx
call   1030 <fprintf@plt>
jmp    11e2 <handle_bad_opts+0xc2>
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_bad_opts>:
push   %rbx
mov    0x2ec0(%rip),%rbx
mov    (%rbx),%al
lea    -0x61(%rax),%ecx
cmp    $0x12,%cl
ja     1159 <handle_bad_opts+0x39>
movzbl %cl,%ecx
mov    $0x40003,%edx
bt     %rcx,%rdx
jae    1159 <handle_bad_opts+0x39>
mov    0x2e91(%rip),%rcx
mov    (%rcx),%edi
movsbl %al,%edx
lea    0xead(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>
movsbl %al,%edi
call   1040 <isprint@plt>
mov    0x2e70(%rip),%rcx
mov    (%rcx),%edi
mov    (%rbx),%cl
movsbl %cl,%edx
test   %rax,%rax
je     1181 <handle_bad_opts+0x61>
lea    0xeaf(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>
lea    0xec1(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@optopt = global i8 0
@stderr = global i32 0
@.str = [42 x i8] c"ERROR: option -%c requires an argument.\0A\0A\00"
@.str.1 = [31 x i8] c"ERROR: unknown option `-%c'.\0A\0A\00"
@.str.2 = [42 x i8] c"ERROR: unknown option character `\\x%x'.\0A\0A\00"
define void @handle_bad_opts() {
%1 = load i8, i8* @optopt
%2 = sext i8 %1 to i32
%3 = icmp eq i32 %2, 97
br i1 %3, label %12, label %4
4: ; preds = %0
%5 = load i8, i8* @optopt
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 98
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = load i8, i8* @optopt
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 115
br i1 %11, label %12, label %16
12: ; preds = %8, %4, %0
%13 = load i32, i32* @stderr
%14 = load i8, i8* @optopt
%15 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8 signext %14)
br label %29
16: ; preds = %8
%17 = load i8, i8* @optopt
%18 = call i64 @isprint(i8 signext %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %16
%21 = load i32, i32* @stderr
%22 = load i8, i8* @optopt
%23 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8 signext %22)
br label %28
24: ; preds = %16
%25 = load i32, i32* @stderr
%26 = load i8, i8* @optopt
%27 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8 signext %26)
br label %28
28: ; preds = %24, %20
br label %29
29: ; preds = %28, %12
ret void
}

LLVM IR (-O2):
@optopt = global i8 0
@stderr = global i32 0
@.str = [42 x i8] c"ERROR: option -%c requires an argument.\0A\0A\00"
@.str.1 = [31 x i8] c"ERROR: unknown option `-%c'.\0A\0A\00"
@.str.2 = [42 x i8] c"ERROR: unknown option character `\\x%x'.\0A\0A\00"
define void @handle_bad_opts() {
%1 = load i8, i8* @optopt
switch i8 %1, label %5 [
i8 115, label %2
i8 98, label %2
i8 97, label %2
]
2: ; preds = %0, %0, %0
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8 signext %1)
br label %14
5: ; preds = %0
%6 = tail call i64 @isprint(i8 signext %1)
%7 = icmp eq i64 %6, 0
%8 = load i32, i32* @stderr
%9 = load i8, i8* @optopt
br i1 %7, label %12, label %10
10: ; preds = %5
%11 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8 signext %9)
br label %14
12: ; preds = %5
%13 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8 signext %9)
br label %14
14: ; preds = %10, %12, %2
ret void
}