#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);
int /*<<< orphan*/ printf(char *, char *);
int opt_unknown(int argc, char **argv, int *i) {
  if (*i < argc && argv[*i][0] == '-') {
    printf("unknown option '%s'\n", argv[*i]);
    exit(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<opt_unknown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
cmp    -0x4(%rbp),%eax
jge    1182 <opt_unknown+0x62>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1182 <opt_unknown+0x62>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_unknown>:
push   %rax
movslq (%rdx),%rax
cmp    %edi,%eax
jge    1131 <opt_unknown+0x11>
mov    (%rsi,%rax,8),%rsi
cmpb   $0x2d,(%rsi)
je     1135 <opt_unknown+0x15>
xor    %eax,%eax
pop    %rcx
ret
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"unknown option '%s'\0A\00"
define i32 @opt_unknown(i32 %0, i8** %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = load i32, i32* %7
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %31
11: ; preds = %3
%12 = load i8**, i8*** %5
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %12, i64 %15
%17 = load i8*, i8** %16
%18 = getelementptr inbounds i8, i8* %17, i64 0
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 45
br i1 %21, label %22, label %31
22: ; preds = %11
%23 = load i8**, i8*** %5
%24 = load i32*, i32** %6
%25 = load i32, i32* %24
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8*, i8** %23, i64 %26
%28 = load i8*, i8** %27
%29 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %28)
%30 = call i32 @exit(i32 1)
unreachable
31: ; preds = %11, %3
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"unknown option '%s'\0A\00"
define i32 @opt_unknown(i32 %0, i8** nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, %0
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = sext i32 %4 to i64
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 45
br i1 %11, label %12, label %15
12: ; preds = %6
%13 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %9)
%14 = tail call i32 @exit(i32 1)
unreachable
15: ; preds = %6, %3
ret i32 0
}