#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 */
scalar_t__ get_int_flag(char ***, char, int *);
int /*<<< orphan*/ usage(char *, char *);
char **do_clear(char **args) {
  int index = 0x80000000;
  while (*args) {
    if (args[0][0] != '-')
      break;
    if (get_int_flag(&args, 'i', &index)) {
    } else
      usage("Unrecognized option to clear: %s\n", args[0]);
  }
  return args;
}


x86 assembly (clang, -O0):
<do_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x80000000,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1192 <do_clear+0x72>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     1159 <do_clear+0x39>
jmp    1192 <do_clear+0x72>
lea    -0x8(%rbp),%rdi
mov    $0x69,%esi
lea    -0xc(%rbp),%rdx
call   1040 <get_int_flag@plt>
cmp    $0x0,%rax
je     117a <do_clear+0x5a>
jmp    118d <do_clear+0x6d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xe78(%rip),%rdi
call   1030 <usage@plt>
jmp    1133 <do_clear+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_clear>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rax
mov    %rdi,(%rsp)
movl   $0x80000000,0xc(%rsp)
80
mov    (%rdi),%rcx
test   %rcx,%rcx
je     1195 <do_clear+0x75>
cmpb   $0x2d,(%rcx)
jne    1195 <do_clear+0x75>
mov    %rsp,%r14
lea    0xc(%rsp),%rbx
lea    0xeac(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    $0x69,%esi
mov    %rbx,%rdx
call   1040 <get_int_flag@plt>
test   %rax,%rax
jne    1184 <do_clear+0x64>
mov    (%rsp),%rax
mov    (%rax),%rsi
mov    %r15,%rdi
call   1030 <usage@plt>
mov    (%rsp),%rax
mov    (%rax),%rcx
test   %rcx,%rcx
je     1195 <do_clear+0x75>
cmpb   $0x2d,(%rcx)
je     1160 <do_clear+0x40>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Unrecognized option to clear: %s\0A\00"
define i8** @do_clear(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 -2147483648, i32* %3
br label %4
4: ; preds = %26, %1
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %27
8: ; preds = %4
%9 = load i8**, i8*** %2
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 45
br i1 %15, label %16, label %17
16: ; preds = %8
br label %27
17: ; preds = %8
%18 = call i64 @get_int_flag(i8*** %2, i8 signext 105, i32* %3)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %17
br label %26
21: ; preds = %17
%22 = load i8**, i8*** %2
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 @usage(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %24)
br label %26
26: ; preds = %21, %20
br label %4
27: ; preds = %16, %4
%28 = load i8**, i8*** %2
ret i8** %28
}

LLVM IR (-O2):
@.str = [34 x i8] c"Unrecognized option to clear: %s\0A\00"
define i8** @do_clear(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
%4 = bitcast i32* %3 to i8*
store i32 -2147483648, i32* %3
%5 = load i8*, i8** %0
%6 = icmp eq i8* %5, null
br i1 %6, label %24, label %7
7: ; preds = %1
%8 = load i8, i8* %5
%9 = icmp eq i8 %8, 45
br i1 %9, label %13, label %24
10: ; preds = %20
%11 = load i8, i8* %22
%12 = icmp eq i8 %11, 45
br i1 %12, label %13, label %24
13: ; preds = %7, %10
%14 = call i64 @get_int_flag(i8*** %2, i8 signext 105, i32* %3)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i8**, i8*** %2
%18 = load i8*, i8** %17
%19 = call i32 @usage(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %13, %16
%21 = load i8**, i8*** %2
%22 = load i8*, i8** %21
%23 = icmp eq i8* %22, null
br i1 %23, label %24, label %10
24: ; preds = %10, %20, %7, %1
%25 = phi i8** [ %0, %1 ], [ %0, %7 ], [ %21, %20 ], [ %21, %10 ]
ret i8** %25
}