#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*/ die(char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
char **handle_switch_M(char *arg, char **next) {
  if (!strcmp(arg, "MF") || !strcmp(arg, "MQ") || !strcmp(arg, "MT")) {
    if (!*next)
      die("missing argument for -%s option", arg);
    return next + 1;
  }
  return next;
}


x86 assembly (clang, -O0):
<handle_switch_M>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     117b <handle_switch_M+0x5b>
mov    -0x10(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     117b <handle_switch_M+0x5b>
mov    -0x10(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11aa <handle_switch_M+0x8a>
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1199 <handle_switch_M+0x79>
mov    -0x10(%rbp),%rsi
lea    0xe75(%rip),%rdi
call   1040 <die@plt>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    11b2 <handle_switch_M+0x92>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_switch_M>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xecf(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1160 <handle_switch_M+0x40>
lea    0xec2(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1160 <handle_switch_M+0x40>
lea    0xeb2(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
jne    1179 <handle_switch_M+0x59>
cmpq   $0x0,(%rbx)
jne    1175 <handle_switch_M+0x55>
lea    0xe9c(%rip),%rdi
mov    %r14,%rsi
call   1040 <die@plt>
add    $0x8,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"MF\00"
@.str.1 = [3 x i8] c"MQ\00"
@.str.2 = [3 x i8] c"MT\00"
@.str.3 = [32 x i8] c"missing argument for -%s option\00"
define i8** @handle_switch_M(i8* %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i8**
store i8* %0, i8** %4
store i8** %1, i8*** %5
%6 = load i8*, i8** %4
%7 = call i32 @strcmp(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i32 @strcmp(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i8*, i8** %4
%15 = call i32 @strcmp(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp ne i32 %15, 0
br i1 %16, label %27, label %17
17: ; preds = %13, %9, %2
%18 = load i8**, i8*** %5
%19 = load i8*, i8** %18
%20 = icmp ne i8* %19, null
br i1 %20, label %24, label %21
21: ; preds = %17
%22 = load i8*, i8** %4
%23 = call i32 @die(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i8* %22)
br label %24
24: ; preds = %21, %17
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
store i8** %26, i8*** %3
br label %29
27: ; preds = %13
%28 = load i8**, i8*** %5
store i8** %28, i8*** %3
br label %29
29: ; preds = %27, %24
%30 = load i8**, i8*** %3
ret i8** %30
}

LLVM IR (-O2):
@.str = [3 x i8] c"MF\00"
@.str.1 = [3 x i8] c"MQ\00"
@.str.2 = [3 x i8] c"MT\00"
@.str.3 = [32 x i8] c"missing argument for -%s option\00"
define i8** @handle_switch_M(i8* %0, i8** %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %8, %5, %2
%12 = load i8*, i8** %1
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = tail call i32 @die(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i8* %0)
br label %16
16: ; preds = %14, %11
%17 = getelementptr inbounds i8*, i8** %1, i64 1
br label %18
18: ; preds = %8, %16
%19 = phi i8** [ %17, %16 ], [ %1, %8 ]
ret i8** %19
}