#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 */
typedef int /*<<< orphan*/ line;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EXIT_FAILURE;
scalar_t__ set_option(char **, char *, char *);
int process_command_line_arguments(char *argv[], char **options) {
  char line[(8 * 1024)], opt[sizeof(line)], val[sizeof(line)], *p;
  FILE *fp = NULL;
  size_t i, cmd_line_opts_start = 0, line_no = 0;
  int errs = 0;
  options[0] = NULL;
  for (i = cmd_line_opts_start; argv[i] != NULL; i += 2) {
    if (set_option(options, &argv[i][0], &argv[i + 1][0]) == EXIT_FAILURE) {
      errs++;
    }
  }
  return errs;
}


x86 assembly (clang, -O0):
<process_command_line_arguments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x6040,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x6020(%rbp)
movq   $0x0,-0x6030(%rbp)
movq   $0x0,-0x6038(%rbp)
movl   $0x0,-0x603c(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x6030(%rbp),%rax
mov    %rax,-0x6028(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x6028(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     11e0 <process_command_line_arguments+0xd0>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    -0x6028(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x8(%rbp),%rax
mov    -0x6028(%rbp),%rcx
mov    0x8(%rax,%rcx,8),%rdx
call   1030 <set_option@plt>
mov    0x2e34(%rip),%rcx
cmp    (%rcx),%rax
jne    11c4 <process_command_line_arguments+0xb4>
mov    -0x603c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x603c(%rbp)
jmp    11c9 <process_command_line_arguments+0xb9>
mov    -0x6028(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x6028(%rbp)
jmp    1167 <process_command_line_arguments+0x57>
mov    -0x603c(%rbp),%eax
add    $0x6040,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_command_line_arguments>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
movq   $0x0,(%rsi)
mov    (%rdi),%rsi
test   %rsi,%rsi
je     1164 <process_command_line_arguments+0x54>
mov    %rdi,%rbx
add    $0x10,%rbx
xor    %ebp,%ebp
mov    0x2ea7(%rip),%r15
nopl   0x0(%rax)
mov    -0x8(%rbx),%rdx
mov    %r14,%rdi
call   1030 <set_option@plt>
xor    %ecx,%ecx
cmp    (%r15),%rax
sete   %cl
add    %ecx,%ebp
mov    (%rbx),%rsi
add    $0x10,%rbx
test   %rsi,%rsi
jne    1140 <process_command_line_arguments+0x30>
jmp    1166 <process_command_line_arguments+0x56>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i64 0
define i32 @process_command_line_arguments(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca [8192 x i8]
%6 = alloca [8192 x i8]
%7 = alloca [8192 x i8]
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i32
store i8** %0, i8*** %3
store i8** %1, i8*** %4
store i32* null, i32** %9
store i64 0, i64* %11
store i64 0, i64* %12
store i32 0, i32* %13
%14 = load i8**, i8*** %4
%15 = getelementptr inbounds i8*, i8** %14, i64 0
store i8* null, i8** %15
%16 = load i64, i64* %11
store i64 %16, i64* %10
br label %17
17: ; preds = %43, %2
%18 = load i8**, i8*** %3
%19 = load i64, i64* %10
%20 = getelementptr inbounds i8*, i8** %18, i64 %19
%21 = load i8*, i8** %20
%22 = icmp ne i8* %21, null
br i1 %22, label %23, label %46
23: ; preds = %17
%24 = load i8**, i8*** %4
%25 = load i8**, i8*** %3
%26 = load i64, i64* %10
%27 = getelementptr inbounds i8*, i8** %25, i64 %26
%28 = load i8*, i8** %27
%29 = getelementptr inbounds i8, i8* %28, i64 0
%30 = load i8**, i8*** %3
%31 = load i64, i64* %10
%32 = add i64 %31, 1
%33 = getelementptr inbounds i8*, i8** %30, i64 %32
%34 = load i8*, i8** %33
%35 = getelementptr inbounds i8, i8* %34, i64 0
%36 = call i64 @set_option(i8** %24, i8* %29, i8* %35)
%37 = load i64, i64* @EXIT_FAILURE
%38 = icmp eq i64 %36, %37
br i1 %38, label %39, label %42
39: ; preds = %23
%40 = load i32, i32* %13
%41 = add nsw i32 %40, 1
store i32 %41, i32* %13
br label %42
42: ; preds = %39, %23
br label %43
43: ; preds = %42
%44 = load i64, i64* %10
%45 = add i64 %44, 2
store i64 %45, i64* %10
br label %17
46: ; preds = %17
%47 = load i32, i32* %13
ret i32 %47
}

LLVM IR (-O2):
@EXIT_FAILURE = global i64 0
define i32 @process_command_line_arguments(i8** nocapture %0, i8** %1) {
store i8* null, i8** %1
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %21, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %19, %5 ], [ %3, %2 ]
%7 = phi i32 [ %16, %5 ], [ 0, %2 ]
%8 = phi i64 [ %17, %5 ], [ 0, %2 ]
%9 = or i64 %8, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i64 @set_option(i8** %1, i8* %6, i8* %11)
%13 = load i64, i64* @EXIT_FAILURE
%14 = icmp eq i64 %12, %13
%15 = zext i1 %14 to i32
%16 = add nuw nsw i32 %7, %15
%17 = add i64 %8, 2
%18 = getelementptr inbounds i8*, i8** %0, i64 %17
%19 = load i8*, i8** %18
%20 = icmp eq i8* %19, null
br i1 %20, label %21, label %5
21: ; preds = %5, %2
%22 = phi i32 [ 0, %2 ], [ %16, %5 ]
ret i32 %22
}