#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ output_config();
int /*<<< orphan*/ output_widgets();
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  int i;
  for (i = 1; i < argc; i++) {
    if (!strcmp(argv[i], "--widgets")) {
      output_widgets();
      exit(0);
    } else if (!strcmp(argv[i], "--config")) {
      output_config();
      exit(0);
    }
  }
  usage();
  return 0;
}


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)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ef <main+0x9f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe74(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11a8 <main+0x58>
mov    $0x0,%al
call   1050 <output_widgets@plt>
xor    %edi,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe4f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11d7 <main+0x87>
mov    $0x0,%al
call   1030 <output_config@plt>
xor    %edi,%edi
call   1070 <exit@plt>
jmp    11dc <main+0x8c>
jmp    11e1 <main+0x91>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116d <main+0x1d>
mov    $0x0,%al
call   1060 <usage@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     11ab <main+0x5b>
mov    %rsi,%r12
mov    %edi,%r13d
mov    $0x1,%ebp
lea    0xe8e(%rip),%r14
lea    0xe91(%rip),%r15
nopl   0x0(%rax)
mov    (%r12,%rbp,8),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11c3 <main+0x73>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11d1 <main+0x81>
add    $0x1,%rbp
cmp    %rbp,%r13
jne    1180 <main+0x30>
xor    %eax,%eax
call   1060 <usage@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   1050 <output_widgets@plt>
xor    %edi,%edi
call   1070 <exit@plt>
xor    %eax,%eax
call   1030 <output_config@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"--widgets\00"
@.str.1 = [9 x i8] c"--config\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
br label %7
7: ; preds = %35, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %38
11: ; preds = %7
%12 = load i8**, i8*** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 @strcmp(i8* %16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%18 = icmp ne i32 %17, 0
br i1 %18, label %22, label %19
19: ; preds = %11
%20 = call i32 (...) @output_widgets()
%21 = call i32 @exit(i32 0)
unreachable
22: ; preds = %11
%23 = load i8**, i8*** %5
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %23, i64 %25
%27 = load i8*, i8** %26
%28 = call i32 @strcmp(i8* %27, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%29 = icmp ne i32 %28, 0
br i1 %29, label %33, label %30
30: ; preds = %22
%31 = call i32 (...) @output_config()
%32 = call i32 @exit(i32 0)
unreachable
33: ; preds = %22
br label %34
34: ; preds = %33
br label %35
35: ; preds = %34
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 1
store i32 %37, i32* %6
br label %7
38: ; preds = %7
%39 = call i32 (...) @usage()
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"--widgets\00"
@.str.1 = [9 x i8] c"--config\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %24
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %8
6: ; preds = %17
%7 = icmp eq i64 %20, %5
br i1 %7, label %24, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 1, %4 ], [ %20, %6 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %8
%15 = tail call i32 (...) @output_widgets()
%16 = tail call i32 @exit(i32 0)
unreachable
17: ; preds = %8
%18 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i32 %18, 0
%20 = add nuw nsw i64 %9, 1
br i1 %19, label %21, label %6
21: ; preds = %17
%22 = tail call i32 (...) @output_config()
%23 = tail call i32 @exit(i32 0)
unreachable
24: ; preds = %6, %2
%25 = tail call i32 (...) @usage()
ret i32 0
}