#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*/ argdel(int, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
scalar_t__ lopt(int, char **, char);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage(char *);
void whatido(int argc, char *argv[], char *text, char *progname) {
  fprintf(stderr, "%s: %s\n", progname, text);
  if (lopt(argc, argv, 'h'))
    usage(progname);
  argdel(argc, 0);
}


x86 assembly (clang, -O0):
<whatido>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x68,%edx
call   1060 <lopt@plt>
cmp    $0x0,%rax
je     1198 <whatido+0x58>
mov    -0x20(%rbp),%rdi
call   1050 <usage@plt>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <argdel@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<whatido>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%rcx
mov    %rsi,%r15
mov    %edi,%ebx
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xea0(%rip),%rsi
mov    %r14,%rdx
call   1030 <fprintf@plt>
mov    %ebx,%edi
mov    %r15,%rsi
mov    $0x68,%edx
call   1060 <lopt@plt>
test   %rax,%rax
je     1184 <whatido+0x44>
mov    %r14,%rdi
call   1050 <usage@plt>
mov    %ebx,%edi
xor    %esi,%esi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <argdel@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
define void @whatido(i32 %0, i8** %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %8
%11 = load i8*, i8** %7
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
%13 = load i32, i32* %5
%14 = load i8**, i8*** %6
%15 = call i64 @lopt(i32 %13, i8** %14, i8 signext 104)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %4
%18 = load i8*, i8** %8
%19 = call i32 @usage(i8* %18)
br label %20
20: ; preds = %17, %4
%21 = load i32, i32* %5
%22 = call i32 @argdel(i32 %21, i32 0)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
define void @whatido(i32 %0, i8** %1, i8* %2, i8* %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %2)
%7 = tail call i64 @lopt(i32 %0, i8** %1, i8 signext 104)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = tail call i32 @usage(i8* %3)
br label %11
11: ; preds = %9, %4
%12 = tail call i32 @argdel(i32 %0, i32 0)
ret void
}