#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*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ usage(char *);
void readArgs(int argc, char *argv[], char **fileNames, char **outFile) {
  if (argc <= 1) {
    usage(argv[0]);
  }
  if ((strcmp(argv[1], "-help") == 0) || (argc < 3)) {
    usage(argv[0]);
  }
  *fileNames = argv[1];
  *outFile = argv[2];
  if (1 > 0) {
    printf("\nCommand Line arguments are:\n");
    printf("  File of test image names, one name per line in the file ... %s\n",
           *fileNames);
    printf("  Name of file to create with names grouped by subject ...... %s\n",
           *outFile);
  }
}


x86 assembly (clang, -O0):
<readArgs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x1,-0x4(%rbp)
jg     115d <readArgs+0x2d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe94(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1185 <readArgs+0x55>
cmpl   $0x3,-0x4(%rbp)
jge    1191 <readArgs+0x61>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readArgs>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %edi,%ebp
cmp    $0x1,%edi
jg     115f <readArgs+0x1f>
mov    (%rbx),%rdi
call   1060 <usage@plt>
mov    0x8(%rbx),%rdi
lea    0xe96(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x3,%ebp
jl     1179 <readArgs+0x39>
test   %rax,%rax
jne    1181 <readArgs+0x41>
mov    (%rbx),%rdi
call   1060 <usage@plt>
mov    0x8(%rbx),%rax
mov    %rax,(%r15)
mov    0x10(%rbx),%rax
mov    %rax,(%r14)
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
mov    (%r15),%rsi
lea    0xe61(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r14),%rsi
lea    0xe92(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"-help\00"
@.str.1 = [30 x i8] c"\0ACommand Line arguments are:\0A\00"
@.str.2 = [66 x i8] c" File of test image names, one name per line in the file ... %s\0A\00"
@.str.3 = [66 x i8] c" Name of file to create with names grouped by subject ...... %s\0A\00"
define void @readArgs(i32 %0, i8** %1, i8** %2, i8** %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i8**
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
%9 = load i32, i32* %5
%10 = icmp sle i32 %9, 1
br i1 %10, label %11, label %16
11: ; preds = %4
%12 = load i8**, i8*** %6
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @usage(i8* %14)
br label %16
16: ; preds = %11, %4
%17 = load i8**, i8*** %6
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %25, label %22
22: ; preds = %16
%23 = load i32, i32* %5
%24 = icmp slt i32 %23, 3
br i1 %24, label %25, label %30
25: ; preds = %22, %16
%26 = load i8**, i8*** %6
%27 = getelementptr inbounds i8*, i8** %26, i64 0
%28 = load i8*, i8** %27
%29 = call i32 @usage(i8* %28)
br label %30
30: ; preds = %25, %22
%31 = load i8**, i8*** %6
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = load i8**, i8*** %7
store i8* %33, i8** %34
%35 = load i8**, i8*** %6
%36 = getelementptr inbounds i8*, i8** %35, i64 2
%37 = load i8*, i8** %36
%38 = load i8**, i8*** %8
store i8* %37, i8** %38
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%40 = load i8**, i8*** %7
%41 = load i8*, i8** %40
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.2, i64 0, i64 0), i8* %41)
%43 = load i8**, i8*** %8
%44 = load i8*, i8** %43
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.3, i64 0, i64 0), i8* %44)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"-help\00"
@.str.2 = [66 x i8] c" File of test image names, one name per line in the file ... %s\0A\00"
@.str.3 = [66 x i8] c" Name of file to create with names grouped by subject ...... %s\0A\00"
@str = [29 x i8] c"\0ACommand Line arguments are:\00"
define void @readArgs(i32 %0, i8** nocapture %1, i8** nocapture %2, i8** nocapture %3) {
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %9
6: ; preds = %4
%7 = load i8*, i8** %1
%8 = tail call i32 @usage(i8* %7)
br label %9
9: ; preds = %6, %4
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
%14 = icmp slt i32 %0, 3
%15 = or i1 %14, %13
br i1 %15, label %16, label %19
16: ; preds = %9
%17 = load i8*, i8** %1
%18 = tail call i32 @usage(i8* %17)
br label %19
19: ; preds = %9, %16
%20 = load i8*, i8** %10
store i8* %20, i8** %2
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
store i8* %22, i8** %3
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%24 = load i8*, i8** %2
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str.2, i64 0, i64 0), i8* %24)
%26 = load i8*, i8** %3
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str.3, i64 0, i64 0), i8* %26)
ret void
}