#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*/ CL_UpdateConfigString(int, char *);
int Cmd_Argc();
char *Cmd_Argv(int);
int atoi(char *);
void CL_ParseConfigstringCommand(void) {
  int i, argc, idx;
  char *s;
  if (Cmd_Argc() < 3)
    return;
  argc = Cmd_Argc();
  for (i = 1; i < argc - 1; i += 2) {
    idx = atoi(Cmd_Argv(i));
    s = Cmd_Argv(i + 1);
    CL_UpdateConfigString(idx, s);
  }
}


x86 assembly (clang, -O0):
<CL_ParseConfigstringCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <Cmd_Argc@plt>
cmp    $0x3,%eax
jge    115d <CL_ParseConfigstringCommand+0x1d>
jmp    11bb <CL_ParseConfigstringCommand+0x7b>
mov    $0x0,%al
call   1030 <Cmd_Argc@plt>
mov    %eax,-0x8(%rbp)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11bb <CL_ParseConfigstringCommand+0x7b>
mov    -0x4(%rbp),%edi
call   1050 <Cmd_Argv@plt>
mov    %rax,%rdi
call   1060 <atoi@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1050 <Cmd_Argv@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <CL_UpdateConfigString@plt>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    116e <CL_ParseConfigstringCommand+0x2e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CL_ParseConfigstringCommand>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    $0x3,%eax
jl     119b <CL_ParseConfigstringCommand+0x5b>
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    $0x3,%eax
jl     119b <CL_ParseConfigstringCommand+0x5b>
mov    %eax,%r14d
add    $0xffffffff,%r14d
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1050 <Cmd_Argv@plt>
mov    %rax,%rdi
call   1060 <atoi@plt>
mov    %eax,%ebp
lea    0x1(%rbx),%edi
call   1050 <Cmd_Argv@plt>
mov    %ebp,%edi
mov    %rax,%rsi
call   1040 <CL_UpdateConfigString@plt>
add    $0x2,%ebx
cmp    %r14d,%ebx
jl     1170 <CL_ParseConfigstringCommand+0x30>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @CL_ParseConfigstringCommand() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = call i32 (...) @Cmd_Argc()
%6 = icmp slt i32 %5, 3
br i1 %6, label %7, label %8
7: ; preds = %0
br label %28
8: ; preds = %0
%9 = call i32 (...) @Cmd_Argc()
store i32 %9, i32* %2
store i32 1, i32* %1
br label %10
10: ; preds = %25, %8
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = sub nsw i32 %12, 1
%14 = icmp slt i32 %11, %13
br i1 %14, label %15, label %28
15: ; preds = %10
%16 = load i32, i32* %1
%17 = call i8* @Cmd_Argv(i32 %16)
%18 = call i32 @atoi(i8* %17)
store i32 %18, i32* %3
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
%21 = call i8* @Cmd_Argv(i32 %20)
store i8* %21, i8** %4
%22 = load i32, i32* %3
%23 = load i8*, i8** %4
%24 = call i32 @CL_UpdateConfigString(i32 %22, i8* %23)
br label %25
25: ; preds = %15
%26 = load i32, i32* %1
%27 = add nsw i32 %26, 2
store i32 %27, i32* %1
br label %10
28: ; preds = %7, %10
ret void
}

LLVM IR (-O2):
define void @CL_ParseConfigstringCommand() {
%1 = tail call i32 (...) @Cmd_Argc()
%2 = icmp slt i32 %1, 3
br i1 %2, label %16, label %3
3: ; preds = %0
%4 = tail call i32 (...) @Cmd_Argc()
%5 = add nsw i32 %4, -1
%6 = icmp sgt i32 %4, 2
br i1 %6, label %7, label %16
7: ; preds = %3, %7
%8 = phi i32 [ %14, %7 ], [ 1, %3 ]
%9 = tail call i8* @Cmd_Argv(i32 %8)
%10 = tail call i32 @atoi(i8* %9)
%11 = add nuw nsw i32 %8, 1
%12 = tail call i8* @Cmd_Argv(i32 %11)
%13 = tail call i32 @CL_UpdateConfigString(i32 %10, i8* %12)
%14 = add nuw nsw i32 %8, 2
%15 = icmp slt i32 %14, %5
br i1 %15, label %7, label %16
16: ; preds = %7, %3, %0
ret void
}