#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*/ LoadObj3d(char *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  char *Obj3dFilename = NULL;
  int n;
  for (n = 1; (n < argc) && (Obj3dFilename == NULL); n++) {
    if (strcmp(argv[n], "--obj3d") == 0) {
      Obj3dFilename = argv[n + 1];
    }
  }
  LoadObj3d(Obj3dFilename);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x1d(%rbp)
jge    1161 <main+0x41>
cmpq   $0x0,-0x18(%rbp)
sete   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    1171 <main+0x51>
jmp    11bb <main+0x9b>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe7c(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11a8 <main+0x88>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
jmp    11ad <main+0x8d>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1145 <main+0x25>
mov    -0x18(%rbp),%rdi
call   1040 <LoadObj3d@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1174 <main+0x54>
mov    %rsi,%r12
mov    %edi,%r15d
mov    $0x2,%ebx
lea    0xec1(%rip),%r14
nop
mov    -0x8(%r12,%rbx,8),%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1160 <main+0x40>
xor    %edi,%edi
cmp    %r15,%rbx
jb     1169 <main+0x49>
jmp    1176 <main+0x56>
nopl   0x0(%rax,%rax,1)
mov    (%r12,%rbx,8),%rdi
cmp    %r15,%rbx
jae    1176 <main+0x56>
add    $0x1,%rbx
test   %rdi,%rdi
je     1140 <main+0x20>
jmp    1176 <main+0x56>
xor    %edi,%edi
call   1040 <LoadObj3d@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"--obj3d\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %21
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %16
%7 = phi i64 [ 1, %4 ], [ %12, %16 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
%12 = add nuw nsw i64 %7, 1
br i1 %11, label %13, label %16
13: ; preds = %6
%14 = getelementptr inbounds i8*, i8** %1, i64 %12
%15 = load i8*, i8** %14
br label %16
16: ; preds = %6, %13
%17 = phi i8* [ %15, %13 ], [ null, %6 ]
%18 = icmp ult i64 %12, %5
%19 = icmp eq i8* %17, null
%20 = select i1 %18, i1 %19, i1 false
br i1 %20, label %6, label %21
21: ; preds = %16, %2
%22 = phi i8* [ null, %2 ], [ %17, %16 ]
%23 = tail call i32 @LoadObj3d(i8* %22)
ret i32 0
}