#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__ strcmp(char *, char *);
char *get_arg_plusone(char *in[], int count, char *find) {
  int i;
  static char no[] = "";
  for (i = 0; i < count; i++) {
    if (strcmp(in[i], find) == 0) {
      if ((i + 1) < count) {
        return in[i + 1];
      } else {
        return no;
      }
    }
  }
  return no;
}


x86 assembly (clang, -O0):
<get_arg_plusone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11a1 <get_arg_plusone+0x91>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    118e <get_arg_plusone+0x7e>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
cmp    -0x14(%rbp),%eax
jge    117e <get_arg_plusone+0x6e>
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
jmp    11ac <get_arg_plusone+0x9c>
lea    0x2ea4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11ac <get_arg_plusone+0x9c>
jmp    1193 <get_arg_plusone+0x83>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    112a <get_arg_plusone+0x1a>
lea    0x2e81(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_arg_plusone>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0x2f07(%rip),%r14
test   %esi,%esi
jle    116f <get_arg_plusone+0x5f>
mov    %rdx,%r13
mov    %esi,%r15d
mov    %rdi,%r12
mov    %esi,%ebp
neg    %rbp
mov    $0x1,%ebx
nopl   0x0(%rax)
mov    -0x8(%r12,%rbx,8),%rdi
mov    %r13,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1166 <get_arg_plusone+0x56>
lea    (%rbx,%rbp,1),%rax
add    $0x1,%rax
add    $0x1,%rbx
cmp    $0x1,%rax
jne    1140 <get_arg_plusone+0x30>
jmp    116f <get_arg_plusone+0x5f>
cmp    %r15d,%ebx
jge    116f <get_arg_plusone+0x5f>
mov    (%r12,%rbx,8),%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@get_arg_plusone.no = internal global [1 x i8] zeroinitializer
define i8* @get_arg_plusone(i8** %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8** %0, i8*** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 0, i32* %8
br label %9
9: ; preds = %36, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %39
13: ; preds = %9
%14 = load i8**, i8*** %5
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
%18 = load i8*, i8** %17
%19 = load i8*, i8** %7
%20 = call i64 @strcmp(i8* %18, i8* %19)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %35
22: ; preds = %13
%23 = load i32, i32* %8
%24 = add nsw i32 %23, 1
%25 = load i32, i32* %6
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %34
27: ; preds = %22
%28 = load i8**, i8*** %5
%29 = load i32, i32* %8
%30 = add nsw i32 %29, 1
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8*, i8** %28, i64 %31
%33 = load i8*, i8** %32
store i8* %33, i8** %4
br label %40
34: ; preds = %22
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @get_arg_plusone.no, i64 0, i64 0), i8** %4
br label %40
35: ; preds = %13
br label %36
36: ; preds = %35
%37 = load i32, i32* %8
%38 = add nsw i32 %37, 1
store i32 %38, i32* %8
br label %9
39: ; preds = %9
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @get_arg_plusone.no, i64 0, i64 0), i8** %4
br label %40
40: ; preds = %39, %34, %27
%41 = load i8*, i8** %4
ret i8* %41
}

LLVM IR (-O2):
@get_arg_plusone.no = internal global [1 x i8] zeroinitializer
define i8* @get_arg_plusone(i8** nocapture %0, i32 %1, i8* %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %24
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %21
%8 = phi i64 [ 0, %5 ], [ %22, %21 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i64 @strcmp(i8* %10, i8* %2)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %7
%14 = trunc i64 %8 to i32
%15 = add nuw nsw i32 %14, 1
%16 = icmp slt i32 %15, %1
br i1 %16, label %17, label %24
17: ; preds = %13
%18 = zext i32 %15 to i64
%19 = getelementptr inbounds i8*, i8** %0, i64 %18
%20 = load i8*, i8** %19
br label %24
21: ; preds = %7
%22 = add nuw nsw i64 %8, 1
%23 = icmp eq i64 %22, %6
br i1 %23, label %24, label %7
24: ; preds = %21, %3, %13, %17
%25 = phi i8* [ %20, %17 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @get_arg_plusone.no, i64 0, i64 0), %13 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @get_arg_plusone.no, i64 0, i64 0), %3 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @get_arg_plusone.no, i64 0, i64 0), %21 ]
ret i8* %25
}