#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*/ atoi(char *);
int /*<<< orphan*/ ghost(char *);
int /*<<< orphan*/ ginit();
int /*<<< orphan*/ gport(int /*<<< orphan*/);
int /*<<< orphan*/ strcmp(char *, char *);
void glutInit(int *argcp, char **argv) {
  while (*argcp > 1) {
    if (!strcmp(*argv, "-host")) {
      --*argcp;
      ghost(*++argv);
    } else if (!strcmp(*argv, "-port")) {
      --*argcp;
      gport(atoi(*++argv));
    }
    --*argcp;
    ++argv;
  }
  ginit();
}


x86 assembly (clang, -O0):
<glutInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jle    1218 <glutInit+0xc8>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe85(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11b1 <glutInit+0x61>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1050 <ghost@plt>
jmp    11fc <glutInit+0xac>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe47(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11f7 <glutInit+0xa7>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,%edi
call   1040 <gport@plt>
jmp    11fc <glutInit+0xac>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1160 <glutInit+0x10>
mov    $0x0,%al
call   1060 <ginit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glutInit>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    (%rdi),%ebp
cmp    $0x2,%ebp
jl     11e2 <glutInit+0x92>
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xe8d(%rip),%r15
lea    0xe8c(%rip),%r12
jmp    11a5 <glutInit+0x55>
nopl   0x0(%rax)
add    $0xffffffff,%ebp
mov    %ebp,(%r14)
mov    0x8(%rbx),%rdi
add    $0x8,%rbx
call   1050 <ghost@plt>
mov    (%r14),%eax
lea    -0x1(%rax),%ebp
mov    %ebp,(%r14)
add    $0x8,%rbx
cmp    $0x2,%eax
jle    11e2 <glutInit+0x92>
mov    (%rbx),%r13
mov    %r13,%rdi
mov    %r15,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1180 <glutInit+0x30>
mov    %r13,%rdi
mov    %r12,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
jne    1193 <glutInit+0x43>
add    $0xffffffff,%ebp
mov    %ebp,(%r14)
mov    0x8(%rbx),%rdi
add    $0x8,%rbx
call   1070 <atoi@plt>
mov    %eax,%edi
call   1040 <gport@plt>
jmp    1193 <glutInit+0x43>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <ginit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"-host\00"
@.str.1 = [6 x i8] c"-port\00"
define void @glutInit(i32* %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i8**
store i32* %0, i32** %3
store i8** %1, i8*** %4
br label %5
5: ; preds = %37, %2
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %43
9: ; preds = %5
%10 = load i8**, i8*** %4
%11 = load i8*, i8** %10
%12 = call i32 @strcmp(i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%13 = icmp ne i32 %12, 0
br i1 %13, label %22, label %14
14: ; preds = %9
%15 = load i32*, i32** %3
%16 = load i32, i32* %15
%17 = add nsw i32 %16, -1
store i32 %17, i32* %15
%18 = load i8**, i8*** %4
%19 = getelementptr inbounds i8*, i8** %18, i32 1
store i8** %19, i8*** %4
%20 = load i8*, i8** %19
%21 = call i32 @ghost(i8* %20)
br label %37
22: ; preds = %9
%23 = load i8**, i8*** %4
%24 = load i8*, i8** %23
%25 = call i32 @strcmp(i8* %24, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%26 = icmp ne i32 %25, 0
br i1 %26, label %36, label %27
27: ; preds = %22
%28 = load i32*, i32** %3
%29 = load i32, i32* %28
%30 = add nsw i32 %29, -1
store i32 %30, i32* %28
%31 = load i8**, i8*** %4
%32 = getelementptr inbounds i8*, i8** %31, i32 1
store i8** %32, i8*** %4
%33 = load i8*, i8** %32
%34 = call i32 @atoi(i8* %33)
%35 = call i32 @gport(i32 %34)
br label %36
36: ; preds = %27, %22
br label %37
37: ; preds = %36, %14
%38 = load i32*, i32** %3
%39 = load i32, i32* %38
%40 = add nsw i32 %39, -1
store i32 %40, i32* %38
%41 = load i8**, i8*** %4
%42 = getelementptr inbounds i8*, i8** %41, i32 1
store i8** %42, i8*** %4
br label %5
43: ; preds = %5
%44 = call i32 (...) @ginit()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"-host\00"
@.str.1 = [6 x i8] c"-port\00"
define void @glutInit(i32* nocapture %0, i8** nocapture %1) {
%3 = load i32, i32* %0
%4 = icmp sgt i32 %3, 1
br i1 %4, label %5, label %31
5: ; preds = %2, %25
%6 = phi i8** [ %29, %25 ], [ %1, %2 ]
%7 = phi i32 [ %28, %25 ], [ %3, %2 ]
%8 = load i8*, i8** %6
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %8, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = add nsw i32 %7, -1
store i32 %12, i32* %0
%13 = getelementptr inbounds i8*, i8** %6, i64 1
%14 = load i8*, i8** %13
%15 = tail call i32 @ghost(i8* %14)
br label %25
16: ; preds = %5
%17 = tail call i32 @strcmp(i8* dereferenceable(1) %8, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %25
19: ; preds = %16
%20 = add nsw i32 %7, -1
store i32 %20, i32* %0
%21 = getelementptr inbounds i8*, i8** %6, i64 1
%22 = load i8*, i8** %21
%23 = tail call i32 @atoi(i8* %22)
%24 = tail call i32 @gport(i32 %23)
br label %25
25: ; preds = %16, %19, %11
%26 = phi i8** [ %6, %16 ], [ %21, %19 ], [ %13, %11 ]
%27 = load i32, i32* %0
%28 = add nsw i32 %27, -1
store i32 %28, i32* %0
%29 = getelementptr inbounds i8*, i8** %26, i64 1
%30 = icmp sgt i32 %27, 2
br i1 %30, label %5, label %31
31: ; preds = %25, %2
%32 = tail call i32 (...) @ginit()
ret void
}