#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__ check_prog(char *);
int /*<<< orphan*/ ft_free(char *);
int /*<<< orphan*/ ft_putstr(char *);
int /*<<< orphan*/ show_options_in_line(char *);
int is_options(char *tmp, char *cmd, int i, int command) {
  if (tmp) {
    if (!cmd[i] && check_prog(tmp))
      show_options_in_line(tmp);
    ft_free(tmp);
  }
  if (command == 0)
    command = 1;
  ft_putstr("\033[0m");
  return (command);
}


x86 assembly (clang, -O0):
<is_options>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1198 <is_options+0x58>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
jne    118f <is_options+0x4f>
mov    -0x8(%rbp),%rdi
call   1040 <check_prog@plt>
cmp    $0x0,%rax
je     118f <is_options+0x4f>
mov    -0x8(%rbp),%rdi
call   1050 <show_options_in_line@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ft_free@plt>
cmpl   $0x0,-0x18(%rbp)
jne    11a9 <is_options+0x69>
movl   $0x1,-0x18(%rbp)
lea    0xe50(%rip),%rdi
call   1060 <ft_putstr@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_options>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
test   %rdi,%rdi
je     1173 <is_options+0x33>
mov    %rdi,%rbx
movslq %edx,%rax
cmpb   $0x0,(%rsi,%rax,1)
jne    116b <is_options+0x2b>
mov    %rbx,%rdi
call   1040 <check_prog@plt>
test   %rax,%rax
je     116b <is_options+0x2b>
mov    %rbx,%rdi
call   1050 <show_options_in_line@plt>
mov    %rbx,%rdi
call   1030 <ft_free@plt>
test   %ebp,%ebp
mov    $0x1,%ebx
cmovne %ebp,%ebx
lea    0xe7c(%rip),%rdi
call   1060 <ft_putstr@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
define i32 @is_options(i8* %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = icmp eq i8* %0, null
br i1 %5, label %18, label %6
6: ; preds = %4
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %1, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = tail call i64 @check_prog(i8* %0)
%13 = icmp eq i64 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = tail call i32 @show_options_in_line(i8* %0)
br label %16
16: ; preds = %14, %11, %6
%17 = tail call i32 @ft_free(i8* %0)
br label %18
18: ; preds = %16, %4
%19 = icmp eq i32 %3, 0
%20 = select i1 %19, i32 1, i32 %3
%21 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %20
}