#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*/ ft_putendl(char *);
int /*<<< orphan*/ ft_putstr(char *);
int /*<<< orphan*/ ft_strcmp(char *, char *);
void main_options(char **av, int *choice) {
  int i;
  i = 1;
  while (av[i]) {
    if (!ft_strcmp("-nocolor", av[i]))
      *choice = 1;
    else {
      ft_putstr("Unknown option: ");
      ft_putendl(av[i]);
    }
    ++i;
  }
}


x86 assembly (clang, -O0):
<main_options>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     11b5 <main_options+0x85>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe93(%rip),%rdi
call   1040 <ft_strcmp@plt>
cmp    $0x0,%eax
jne    118a <main_options+0x5a>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
jmp    11a7 <main_options+0x77>
lea    0xe78(%rip),%rdi
call   1050 <ft_putstr@plt>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <ft_putendl@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <main_options+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_options>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    0x8(%rdi),%rsi
test   %rsi,%rsi
je     1192 <main_options+0x62>
mov    %rdi,%rbx
add    $0x10,%rbx
lea    0xeae(%rip),%r15
lea    0xeb0(%rip),%r12
jmp    117d <main_options+0x4d>
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1050 <ft_putstr@plt>
mov    -0x8(%rbx),%rdi
call   1030 <ft_putendl@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
je     1192 <main_options+0x62>
mov    %r15,%rdi
call   1040 <ft_strcmp@plt>
test   %eax,%eax
jne    1160 <main_options+0x30>
movl   $0x1,(%r14)
jmp    1171 <main_options+0x41>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"-nocolor\00"
@.str.1 = [17 x i8] c"Unknown option: \00"
define void @main_options(i8** %0, i32* %1) {
%3 = alloca i8**
%4 = alloca i32*
%5 = alloca i32
store i8** %0, i8*** %3
store i32* %1, i32** %4
store i32 1, i32* %5
br label %6
6: ; preds = %31, %2
%7 = load i8**, i8*** %3
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8*, i8** %7, i64 %9
%11 = load i8*, i8** %10
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %34
13: ; preds = %6
%14 = load i8**, i8*** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
%18 = load i8*, i8** %17
%19 = call i32 @ft_strcmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = icmp ne i32 %19, 0
br i1 %20, label %23, label %21
21: ; preds = %13
%22 = load i32*, i32** %4
store i32 1, i32* %22
br label %31
23: ; preds = %13
%24 = call i32 @ft_putstr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%25 = load i8**, i8*** %3
%26 = load i32, i32* %5
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8*, i8** %25, i64 %27
%29 = load i8*, i8** %28
%30 = call i32 @ft_putendl(i8* %29)
br label %31
31: ; preds = %23, %21
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
br label %6
34: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"-nocolor\00"
@.str.1 = [17 x i8] c"Unknown option: \00"
define void @main_options(i8** nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i8*, i8** %0, i64 1
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %22, label %6
6: ; preds = %2, %17
%7 = phi i64 [ %18, %17 ], [ 1, %2 ]
%8 = phi i8* [ %20, %17 ], [ %4, %2 ]
%9 = phi i8** [ %19, %17 ], [ %3, %2 ]
%10 = tail call i32 @ft_strcmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %8)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %6
store i32 1, i32* %1
br label %17
13: ; preds = %6
%14 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%15 = load i8*, i8** %9
%16 = tail call i32 @ft_putendl(i8* %15)
br label %17
17: ; preds = %13, %12
%18 = add nuw i64 %7, 1
%19 = getelementptr inbounds i8*, i8** %0, i64 %18
%20 = load i8*, i8** %19
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %6
22: ; preds = %17, %2
ret void
}