#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*/ R_OK;
int access(char *, int /*<<< orphan*/);
int ar_strtoint(char *);
unsigned int ar_strtoui(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int getopt(int, char **, char *);
char *optarg;
int /*<<< orphan*/ stderr;
long strtol(char *, int /*<<< orphan*/ *, int);
int ar_getopt(int argc, char **argv, char **file_a, char **file_b,
              char **tclass_str, int *tclass, unsigned int *seed, long int *R,
              int *shuffle, unsigned int *jobs, int *help) {
  int opt;
  while ((opt = getopt(argc, argv, "a:b:t:s:R:xj:h")) != -1) {
    switch (opt) {
    case 'a':
      *file_a = optarg;
      break;
    case 'b':
      *file_b = optarg;
      break;
    case 't':
      *tclass_str = optarg;
      *tclass = ar_strtoint(optarg);
      break;
    case 's':
      *seed = ar_strtoui(optarg);
      break;
    case 'R':
      *R = strtol(optarg, NULL, 10);
      break;
    case 'x':
      *shuffle = 1;
      break;
    case 'j':
      *jobs = ar_strtoui(optarg);
      break;
    case 'h':
      *help = 1;
      break;
    }
  }
  int rcode = 0;
  if (*jobs == 0) {
    fprintf(stderr, "error: jobs too small (%u).\n", *jobs);
    rcode = 1;
  }
  if ((*file_a == NULL) || (*file_b == NULL)) {
    rcode = 1;
  } else {
    if (access(*file_a, R_OK) == -1) {
      fprintf(stderr, "error: can't open file '%s' for read.\n", *file_a);
      rcode = 1;
    }
    if (access(*file_b, R_OK) == -1) {
      fprintf(stderr, "error: can't open file '%s' for read.\n", *file_b);
      rcode = 1;
    }
  }
  return rcode;
}


x86 assembly (clang, -O0):
<ar_getopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xefb(%rip),%rdx
call   1080 <getopt@plt>
mov    %eax,-0x34(%rbp)
cmp    $0xffffffff,%eax
je     12b1 <ar_getopt+0x151>
mov    -0x34(%rbp),%eax
add    $0xffffffae,%eax
mov    %eax,%ecx
mov    %rcx,-0x40(%rbp)
sub    $0x26,%eax
ja     12ac <ar_getopt+0x14c>
mov    -0x40(%rbp),%rax
lea    0xe2e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2e16(%rip),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    12ac <ar_getopt+0x14c>
mov    0x2e00(%rip),%rax
mov    (%rax),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
jmp    12ac <ar_getopt+0x14c>
mov    0x2dea(%rip),%rax
mov    (%rax),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    0x2dd9(%rip),%rax
mov    (%rax),%rdi
call   1030 <ar_strtoint@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
jmp    12ac <ar_getopt+0x14c>
mov    0x2dbd(%rip),%rax
mov    (%rax),%rdi
call   1040 <ar_strtoui@plt>
mov    %eax,%ecx
mov    0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    12ac <ar_getopt+0x14c>
mov    0x2da1(%rip),%rax
mov    (%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1060 <strtol@plt>
mov    %rax,%rcx
mov    0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    12ac <ar_getopt+0x14c>
mov    0x20(%rbp),%rax
movl   $0x1,(%rax)
jmp    12ac <ar_getopt+0x14c>
mov    0x2d6b(%rip),%rax
mov    (%rax),%rdi
call   1040 <ar_strtoui@plt>
mov    %eax,%ecx
mov    0x28(%rbp),%rax
mov    %ecx,(%rax)
jmp    12ac <ar_getopt+0x14c>
mov    0x30(%rbp),%rax
movl   $0x1,(%rax)
jmp    1193 <ar_getopt+0x33>
movl   $0x0,-0x38(%rbp)
mov    0x28(%rbp),%rax
cmpl   $0x0,(%rax)
jne    12e9 <ar_getopt+0x189>
mov    0x2d0c(%rip),%rax
mov    (%rax),%edi
mov    0x28(%rbp),%rax
mov    (%rax),%edx
lea    0xdd0(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x1,-0x38(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1305 <ar_getopt+0x1a5>
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1311 <ar_getopt+0x1b1>
movl   $0x1,-0x38(%rbp)
jmp    139c <ar_getopt+0x23c>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    0x2cb1(%rip),%rax
mov    (%rax),%esi
call   1070 <access@plt>
cmp    $0xffffffff,%eax
jne    1354 <ar_getopt+0x1f4>
mov    0x2ca2(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    0xd82(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x1,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
mov    0x2c6e(%rip),%rax
mov    (%rax),%esi
call   1070 <access@plt>
cmp    $0xffffffff,%eax
jne    1397 <ar_getopt+0x237>
mov    0x2c5f(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    (%rax),%rdx
lea    0xd3f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x1,-0x38(%rbp)
jmp    139c <ar_getopt+0x23c>
mov    -0x38(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ar_getopt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,0x10(%rsp)
mov    %r8,%r13
mov    %rcx,0x8(%rsp)
mov    %rdx,(%rsp)
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xf11(%rip),%r14
lea    0xe6e(%rip),%r15
mov    0x2e5f(%rip),%r12
jmp    11b0 <ar_getopt+0x50>
mov    0x70(%rsp),%rax
movl   $0x1,(%rax)
cs nopw 0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1080 <getopt@plt>
lea    -0x52(%rax),%ecx
cmp    $0x26,%ecx
ja     1258 <ar_getopt+0xf8>
movslq (%r15,%rcx,4),%rax
add    %r15,%rax
jmp    *%rax
mov    (%r12),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1060 <strtol@plt>
mov    0x58(%rsp),%rcx
mov    %rax,(%rcx)
jmp    11b0 <ar_getopt+0x50>
mov    (%r12),%rax
mov    (%rsp),%rcx
mov    %rax,(%rcx)
jmp    11b0 <ar_getopt+0x50>
mov    (%r12),%rax
mov    0x8(%rsp),%rcx
mov    %rax,(%rcx)
jmp    11b0 <ar_getopt+0x50>
mov    (%r12),%rdi
call   1040 <ar_strtoui@plt>
mov    0x68(%rsp),%rcx
mov    %eax,(%rcx)
jmp    11b0 <ar_getopt+0x50>
mov    (%r12),%rdi
call   1040 <ar_strtoui@plt>
mov    0x50(%rsp),%rcx
mov    %eax,(%rcx)
jmp    11b0 <ar_getopt+0x50>
mov    (%r12),%rax
mov    %rax,0x0(%r13)
mov    (%r12),%rdi
call   1030 <ar_strtoint@plt>
mov    0x10(%rsp),%rcx
mov    %eax,(%rcx)
jmp    11b0 <ar_getopt+0x50>
mov    0x60(%rsp),%rax
movl   $0x1,(%rax)
jmp    11b0 <ar_getopt+0x50>
cmp    $0xffffffff,%eax
jne    11b0 <ar_getopt+0x50>
xor    %ebx,%ebx
mov    0x68(%rsp),%rax
cmpl   $0x0,(%rax)
jne    128b <ar_getopt+0x12b>
mov    0x2d64(%rip),%rax
mov    (%rax),%edi
lea    0xe2e(%rip),%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%ebx
mov    (%rsp),%rax
mov    (%rax),%rdi
mov    $0x1,%eax
test   %rdi,%rdi
mov    0x8(%rsp),%rbp
je     1314 <ar_getopt+0x1b4>
cmpq   $0x0,0x0(%rbp)
je     1314 <ar_getopt+0x1b4>
mov    0x2d21(%rip),%r14
mov    (%r14),%esi
call   1070 <access@plt>
cmp    $0xffffffff,%eax
jne    12df <ar_getopt+0x17f>
mov    0x2d15(%rip),%rax
mov    (%rax),%edi
mov    (%rsp),%rax
mov    (%rax),%rdx
lea    0xdf5(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%ebx
mov    0x0(%rbp),%rdi
mov    (%r14),%esi
call   1070 <access@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cmp    $0xffffffff,%ecx
jne    1314 <ar_getopt+0x1b4>
mov    0x2cdd(%rip),%rax
mov    (%rax),%edi
mov    0x0(%rbp),%rdx
lea    0xdc0(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"a:b:t:s:R:xj:h\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.1 = [29 x i8] c"error: jobs too small (%u).\0A\00"
@R_OK = global i32 0
@.str.2 = [39 x i8] c"error: can't open file '%s' for read.\0A\00"
define i32 @ar_getopt(i32 %0, i8** %1, i8** %2, i8** %3, i8** %4, i32* %5, i32* %6, i64* %7, i32* %8, i32* %9, i32* %10) {
%12 = alloca i32
%13 = alloca i8**
%14 = alloca i8**
%15 = alloca i8**
%16 = alloca i8**
%17 = alloca i32*
%18 = alloca i32*
%19 = alloca i64*
%20 = alloca i32*
%21 = alloca i32*
%22 = alloca i32*
%23 = alloca i32
%24 = alloca i32
store i32 %0, i32* %12
store i8** %1, i8*** %13
store i8** %2, i8*** %14
store i8** %3, i8*** %15
store i8** %4, i8*** %16
store i32* %5, i32** %17
store i32* %6, i32** %18
store i64* %7, i64** %19
store i32* %8, i32** %20
store i32* %9, i32** %21
store i32* %10, i32** %22
br label %25
25: ; preds = %60, %11
%26 = load i32, i32* %12
%27 = load i8**, i8*** %13
%28 = call i32 @getopt(i32 %26, i8** %27, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 %28, i32* %23
%29 = icmp ne i32 %28, -1
br i1 %29, label %30, label %61
30: ; preds = %25
%31 = load i32, i32* %23
switch i32 %31, label %60 [
i32 97, label %32
i32 98, label %35
i32 116, label %38
i32 115, label %44
i32 82, label %48
i32 120, label %52
i32 106, label %54
i32 104, label %58
]
32: ; preds = %30
%33 = load i8*, i8** @optarg
%34 = load i8**, i8*** %14
store i8* %33, i8** %34
br label %60
35: ; preds = %30
%36 = load i8*, i8** @optarg
%37 = load i8**, i8*** %15
store i8* %36, i8** %37
br label %60
38: ; preds = %30
%39 = load i8*, i8** @optarg
%40 = load i8**, i8*** %16
store i8* %39, i8** %40
%41 = load i8*, i8** @optarg
%42 = call i32 @ar_strtoint(i8* %41)
%43 = load i32*, i32** %17
store i32 %42, i32* %43
br label %60
44: ; preds = %30
%45 = load i8*, i8** @optarg
%46 = call i32 @ar_strtoui(i8* %45)
%47 = load i32*, i32** %18
store i32 %46, i32* %47
br label %60
48: ; preds = %30
%49 = load i8*, i8** @optarg
%50 = call i64 @strtol(i8* %49, i32* null, i32 10)
%51 = load i64*, i64** %19
store i64 %50, i64* %51
br label %60
52: ; preds = %30
%53 = load i32*, i32** %20
store i32 1, i32* %53
br label %60
54: ; preds = %30
%55 = load i8*, i8** @optarg
%56 = call i32 @ar_strtoui(i8* %55)
%57 = load i32*, i32** %21
store i32 %56, i32* %57
br label %60
58: ; preds = %30
%59 = load i32*, i32** %22
store i32 1, i32* %59
br label %60
60: ; preds = %30, %58, %54, %52, %48, %44, %38, %35, %32
br label %25
61: ; preds = %25
store i32 0, i32* %24
%62 = load i32*, i32** %21
%63 = load i32, i32* %62
%64 = icmp eq i32 %63, 0
br i1 %64, label %65, label %70
65: ; preds = %61
%66 = load i32, i32* @stderr
%67 = load i32*, i32** %21
%68 = load i32, i32* %67
%69 = call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %68)
store i32 1, i32* %24
br label %70
70: ; preds = %65, %61
%71 = load i8**, i8*** %14
%72 = load i8*, i8** %71
%73 = icmp eq i8* %72, null
br i1 %73, label %78, label %74
74: ; preds = %70
%75 = load i8**, i8*** %15
%76 = load i8*, i8** %75
%77 = icmp eq i8* %76, null
br i1 %77, label %78, label %79
78: ; preds = %74, %70
store i32 1, i32* %24
br label %102
79: ; preds = %74
%80 = load i8**, i8*** %14
%81 = load i8*, i8** %80
%82 = load i32, i32* @R_OK
%83 = call i32 @access(i8* %81, i32 %82)
%84 = icmp eq i32 %83, -1
br i1 %84, label %85, label %90
85: ; preds = %79
%86 = load i32, i32* @stderr
%87 = load i8**, i8*** %14
%88 = load i8*, i8** %87
%89 = call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i8* %88)
store i32 1, i32* %24
br label %90
90: ; preds = %85, %79
%91 = load i8**, i8*** %15
%92 = load i8*, i8** %91
%93 = load i32, i32* @R_OK
%94 = call i32 @access(i8* %92, i32 %93)
%95 = icmp eq i32 %94, -1
br i1 %95, label %96, label %101
96: ; preds = %90
%97 = load i32, i32* @stderr
%98 = load i8**, i8*** %15
%99 = load i8*, i8** %98
%100 = call i32 (i32, i8*, ...) @fprintf(i32 %97, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i8* %99)
store i32 1, i32* %24
br label %101
101: ; preds = %96, %90
br label %102
102: ; preds = %101, %78
%103 = load i32, i32* %24
ret i32 %103
}

LLVM IR (-O2):
@.str = [15 x i8] c"a:b:t:s:R:xj:h\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.1 = [29 x i8] c"error: jobs too small (%u).\0A\00"
@R_OK = global i32 0
@.str.2 = [39 x i8] c"error: can't open file '%s' for read.\0A\00"
define i32 @ar_getopt(i32 %0, i8** %1, i8** nocapture %2, i8** nocapture %3, i8** nocapture writeonly %4, i32* nocapture writeonly %5, i32* nocapture writeonly %6, i64* nocapture writeonly %7, i32* nocapture writeonly %8, i32* nocapture %9, i32* nocapture writeonly %10) {
br label %12
12: ; preds = %14, %11
%13 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
switch i32 %13, label %14 [
i32 -1, label %34
i32 97, label %15
i32 98, label %17
i32 116, label %19
i32 115, label %23
i32 82, label %26
i32 120, label %29
i32 106, label %30
i32 104, label %33
]
14: ; preds = %12, %33, %30, %29, %26, %23, %19, %17, %15
br label %12
15: ; preds = %12
%16 = load i8*, i8** @optarg
store i8* %16, i8** %2
br label %14
17: ; preds = %12
%18 = load i8*, i8** @optarg
store i8* %18, i8** %3
br label %14
19: ; preds = %12
%20 = load i8*, i8** @optarg
store i8* %20, i8** %4
%21 = load i8*, i8** @optarg
%22 = tail call i32 @ar_strtoint(i8* %21)
store i32 %22, i32* %5
br label %14
23: ; preds = %12
%24 = load i8*, i8** @optarg
%25 = tail call i32 @ar_strtoui(i8* %24)
store i32 %25, i32* %6
br label %14
26: ; preds = %12
%27 = load i8*, i8** @optarg
%28 = tail call i64 @strtol(i8* nocapture %27, i32* null, i32 10)
store i64 %28, i64* %7
br label %14
29: ; preds = %12
store i32 1, i32* %8
br label %14
30: ; preds = %12
%31 = load i8*, i8** @optarg
%32 = tail call i32 @ar_strtoui(i8* %31)
store i32 %32, i32* %9
br label %14
33: ; preds = %12
store i32 1, i32* %10
br label %14
34: ; preds = %12
%35 = load i32, i32* %9
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = load i32, i32* @stderr
%39 = tail call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 0)
br label %40
40: ; preds = %37, %34
%41 = phi i32 [ 1, %37 ], [ 0, %34 ]
%42 = load i8*, i8** %2
%43 = icmp eq i8* %42, null
br i1 %43, label %65, label %44
44: ; preds = %40
%45 = load i8*, i8** %3
%46 = icmp eq i8* %45, null
br i1 %46, label %65, label %47
47: ; preds = %44
%48 = load i32, i32* @R_OK
%49 = tail call i32 @access(i8* %42, i32 %48)
%50 = icmp eq i32 %49, -1
br i1 %50, label %51, label %55
51: ; preds = %47
%52 = load i32, i32* @stderr
%53 = load i8*, i8** %2
%54 = tail call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i8* %53)
br label %55
55: ; preds = %51, %47
%56 = phi i32 [ 1, %51 ], [ %41, %47 ]
%57 = load i8*, i8** %3
%58 = load i32, i32* @R_OK
%59 = tail call i32 @access(i8* %57, i32 %58)
%60 = icmp eq i32 %59, -1
br i1 %60, label %61, label %65
61: ; preds = %55
%62 = load i32, i32* @stderr
%63 = load i8*, i8** %3
%64 = tail call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i8* %63)
br label %65
65: ; preds = %40, %44, %55, %61
%66 = phi i32 [ 1, %61 ], [ %56, %55 ], [ 1, %44 ], [ 1, %40 ]
ret i32 %66
}