#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 */
struct option {
  char *member_0;
  int *member_2;
  int member_3;
  int /*<<< orphan*/ flag;
  int /*<<< orphan*/ member_1;
};

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, int);
char getopt_long(int, char **, char *, struct option const *, int *);
int /*<<< orphan*/ no_argument;
char *optarg;
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ required_argument;
int /*<<< orphan*/ stderr;
int get_options(int argc, char **argv, int *nsize, int *dobin, int *dotrans) {
  int binoutput = *dobin;
  int transpose = *dotrans;
  const struct option long_options[] = {
      {"binary", no_argument, &binoutput, 1},
      {"ascii", no_argument, &binoutput, 0},
      {"transpose", no_argument, &transpose, 1},
      {"matsize", required_argument, NULL, 'n'},
      {"help", no_argument, NULL, 'h'},
      {0, 0, 0, 0}};
  char c;
  int option_index;
  int tempint;
  double tempflt;
  while (1) {
    c = getopt_long(argc, argv, "n:h", long_options, &option_index);
    if (c == -1)
      break;
    switch (c) {
    case 0:
      if (long_options[option_index].flag != 0)
        break;
    case 'n':
      tempint = atoi(optarg);
      if (tempint < 1 || tempint > 10000) {
        fprintf(stderr, "%s: Cannot use matrix size %s;\n  Using %d\n", argv[0],
                optarg, *nsize);
      } else {
        *nsize = tempint;
      }
      break;
    case 'h':
      puts("Options: ");
      puts("    --matsize=N   (-n N): Set matrix size.");
      printf("    --ascii             : Use ascii output%s.\n",
             (*dobin ? "" : "(default)"));
      printf("    --binary            : Use binary  output%s.\n",
             (*dobin ? "(default)" : ""));
      puts("    --transpose         : Use opposite order accessing matrix.");
      puts("");
      return +1;
      break;
    }
  }
  *dobin = binoutput;
  *dotrans = transpose;
  return 0;
}


x86 assembly (clang, -O0):
<get_options>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
lea    -0xf0(%rbp),%rdi
lea    0xe62(%rip),%rax
mov    %rax,-0xf0(%rbp)
mov    0x2e1c(%rip),%rax
movslq (%rax),%rax
mov    %rax,-0xe8(%rbp)
lea    -0x2c(%rbp),%rax
mov    %eax,-0xe0(%rbp)
movl   $0x1,-0xdc(%rbp)
movl   $0x0,-0xd8(%rbp)
add    $0x20,%rdi
lea    0xe28(%rip),%rax
mov    %rax,-0xd0(%rbp)
mov    0x2ddb(%rip),%rax
movslq (%rax),%rax
mov    %rax,-0xc8(%rbp)
lea    -0x2c(%rbp),%rax
mov    %eax,-0xc0(%rbp)
movl   $0x0,-0xbc(%rbp)
movl   $0x0,-0xb8(%rbp)
add    $0x20,%rdi
lea    0xded(%rip),%rax
mov    %rax,-0xb0(%rbp)
mov    0x2d9a(%rip),%rax
movslq (%rax),%rax
mov    %rax,-0xa8(%rbp)
lea    -0x30(%rbp),%rax
mov    %eax,-0xa0(%rbp)
movl   $0x1,-0x9c(%rbp)
movl   $0x0,-0x98(%rbp)
add    $0x20,%rdi
lea    0xdb6(%rip),%rax
mov    %rax,-0x90(%rbp)
mov    0x2d71(%rip),%rax
movslq (%rax),%rax
mov    %rax,-0x88(%rbp)
movl   $0x0,-0x80(%rbp)
movl   $0x6e,-0x7c(%rbp)
movl   $0x0,-0x78(%rbp)
add    $0x20,%rdi
lea    0xd86(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0x2d24(%rip),%rax
movslq (%rax),%rax
mov    %rax,-0x68(%rbp)
movl   $0x0,-0x60(%rbp)
movl   $0x68,-0x5c(%rbp)
movl   $0x0,-0x58(%rbp)
add    $0x20,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1060 <memset@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0xf0(%rbp),%rcx
lea    0xd3f(%rip),%rdx
lea    -0xf8(%rbp),%r8
call   1040 <getopt_long@plt>
mov    %al,-0xf1(%rbp)
movsbl -0xf1(%rbp),%eax
cmp    $0xffffffff,%eax
jne    130c <get_options+0x1ac>
jmp    147b <get_options+0x31b>
movsbl -0xf1(%rbp),%eax
mov    %eax,-0x10c(%rbp)
test   %eax,%eax
je     134e <get_options+0x1ee>
jmp    1326 <get_options+0x1c6>
mov    -0x10c(%rbp),%eax
sub    $0x68,%eax
je     13ec <get_options+0x28c>
jmp    133a <get_options+0x1da>
mov    -0x10c(%rbp),%eax
sub    $0x6e,%eax
je     1377 <get_options+0x217>
jmp    1476 <get_options+0x316>
movslq -0xf8(%rbp),%rcx
lea    -0xf0(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
cmpl   $0x0,0x14(%rax)
je     1372 <get_options+0x212>
jmp    1476 <get_options+0x316>
jmp    1377 <get_options+0x217>
mov    0x2c7a(%rip),%rax
mov    (%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0xfc(%rbp)
cmpl   $0x1,-0xfc(%rbp)
jl     13a9 <get_options+0x249>
cmpl   $0x2710,-0xfc(%rbp)
jle    13db <get_options+0x27b>
mov    0x2c20(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    0x2c38(%rip),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    (%rax),%r8d
lea    0xc57(%rip),%rsi
call   1070 <fprintf@plt>
jmp    13e7 <get_options+0x287>
mov    -0xfc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    1476 <get_options+0x316>
lea    0xc60(%rip),%rdi
call   1030 <puts@plt>
lea    0xc5e(%rip),%rdi
call   1030 <puts@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
lea    0xca6(%rip),%rsi
lea    0xcd9(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xc62(%rip),%rdi
call   1050 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
lea    0xcb9(%rip),%rsi
lea    0xc78(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xc74(%rip),%rdi
call   1050 <printf@plt>
lea    0xc99(%rip),%rdi
call   1030 <puts@plt>
lea    0xc8c(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1494 <get_options+0x334>
jmp    12d0 <get_options+0x170>
mov    -0x2c(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x30(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_options>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
mov    %rdx,0x20(%rsp)
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rcx,0x18(%rsp)
mov    (%rcx),%eax
mov    %eax,0x14(%rsp)
mov    %r8,0x28(%rsp)
mov    (%r8),%eax
mov    %eax,0x10(%rsp)
lea    0xe67(%rip),%rax
mov    %rax,0x30(%rsp)
mov    0x2e23(%rip),%rax
movslq (%rax),%rax
mov    %rax,0x38(%rsp)
lea    0x14(%rsp),%rcx
mov    %ecx,0x40(%rsp)
movq   $0x1,0x44(%rsp)
lea    0xe41(%rip),%rdx
mov    %rdx,0x50(%rsp)
mov    %rax,0x58(%rsp)
mov    %ecx,0x60(%rsp)
movq   $0x0,0x64(%rsp)
lea    0xe29(%rip),%rcx
mov    %rcx,0x70(%rsp)
mov    %rax,0x78(%rsp)
lea    0x10(%rsp),%rcx
mov    %ecx,0x80(%rsp)
movq   $0x1,0x84(%rsp)
lea    0xe0a(%rip),%rcx
mov    %rcx,0x90(%rsp)
mov    0x2dc4(%rip),%rcx
movslq (%rcx),%rcx
mov    %rcx,0x98(%rsp)
movabs $0x6e00000000,%rcx
mov    %rcx,0xa0(%rsp)
movl   $0x0,0xa8(%rsp)
lea    0xdd4(%rip),%rcx
mov    %rcx,0xb0(%rsp)
mov    %rax,0xb8(%rsp)
movabs $0x6800000000,%rax
mov    %rax,0xc0(%rsp)
movl   $0x0,0xc8(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
lea    0xd92(%rip),%rdx
lea    0x30(%rsp),%rcx
lea    0xc(%rsp),%r8
call   1050 <getopt_long@plt>
cmp    $0xff,%al
je     135c <get_options+0x1fc>
lea    0xd74(%rip),%r14
lea    0x30(%rsp),%r15
lea    0xc(%rsp),%r13
jmp    12e0 <get_options+0x180>
nopl   0x0(%rax)
cmp    $0x68,%eax
je     1386 <get_options+0x226>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
mov    %r13,%r8
call   1050 <getopt_long@plt>
cmp    $0xff,%al
je     135c <get_options+0x1fc>
movsbl %al,%eax
test   %eax,%eax
je     12f0 <get_options+0x190>
cmp    $0x6e,%eax
jne    12c0 <get_options+0x160>
jmp    1300 <get_options+0x1a0>
xchg   %ax,%ax
movslq 0xc(%rsp),%rax
shl    $0x5,%rax
cmpl   $0x0,0x44(%rsp,%rax,1)
jne    12c9 <get_options+0x169>
mov    0x2cf1(%rip),%rax
mov    (%rax),%r12
mov    %r12,%rdi
call   1080 <atoi@plt>
lea    -0x2711(%rax),%ecx
cmp    $0xffffd8ef,%ecx
ja     1350 <get_options+0x1f0>
mov    0x2ca9(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
mov    0x20(%rsp),%rax
mov    (%rax),%r8d
lea    0xced(%rip),%rsi
mov    %r12,%rcx
call   1070 <fprintf@plt>
jmp    12c9 <get_options+0x169>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x20(%rsp),%rcx
mov    %eax,(%rcx)
jmp    12c9 <get_options+0x169>
mov    0x14(%rsp),%eax
mov    0x18(%rsp),%rcx
mov    %eax,(%rcx)
mov    0x10(%rsp),%eax
mov    0x28(%rsp),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcc6(%rip),%rdi
call   1040 <puts@plt>
lea    0xcc4(%rip),%rdi
call   1040 <puts@plt>
mov    0x18(%rsp),%rbp
cmpl   $0x0,0x0(%rbp)
lea    0xd09(%rip),%rbx
lea    0xd3c(%rip),%r14
mov    %r14,%rsi
cmove  %rbx,%rsi
lea    0xcc5(%rip),%rdi
call   1060 <printf@plt>
cmpl   $0x0,0x0(%rbp)
cmove  %r14,%rbx
lea    0xcea(%rip),%rdi
mov    %rbx,%rsi
call   1060 <printf@plt>
lea    0xd0c(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%eax
jmp    1374 <get_options+0x214>

LLVM IR (-O0):
%struct.option = type { i8*, i32*, i32, i32, i32 }
@.str = [7 x i8] c"binary\00"
@no_argument = global i32 0
@.str.1 = [6 x i8] c"ascii\00"
@.str.2 = [10 x i8] c"transpose\00"
@.str.3 = [8 x i8] c"matsize\00"
@required_argument = global i32 0
@.str.4 = [5 x i8] c"help\00"
@.str.5 = [4 x i8] c"n:h\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.6 = [43 x i8] c"%s: Cannot use matrix size %s;\0A Using %d\0A\00"
@.str.7 = [10 x i8] c"Options: \00"
@.str.8 = [43 x i8] c" --matsize=N (-n N): Set matrix size.\00"
@.str.9 = [47 x i8] c" --ascii : Use ascii output%s.\0A\00"
@.str.10 = [1 x i8] zeroinitializer
@.str.11 = [10 x i8] c"(default)\00"
@.str.12 = [49 x i8] c" --binary : Use binary output%s.\0A\00"
@.str.13 = [63 x i8] c" --transpose : Use opposite order accessing matrix.\00"
define i32 @get_options(i32 %0, i8** %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8**
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32
%13 = alloca i32
%14 = alloca [6 x %struct.option]
%15 = alloca i8
%16 = alloca i32
%17 = alloca i32
%18 = alloca double
store i32 %0, i32* %7
store i8** %1, i8*** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
%19 = load i32*, i32** %10
%20 = load i32, i32* %19
store i32 %20, i32* %12
%21 = load i32*, i32** %11
%22 = load i32, i32* %21
store i32 %22, i32* %13
%23 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %14, i64 0, i64 0
%24 = getelementptr inbounds %struct.option, %struct.option* %23, i32 0, i32 0
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %24
%25 = getelementptr inbounds %struct.option, %struct.option* %23, i32 0, i32 1
%26 = load i32, i32* @no_argument
%27 = sext i32 %26 to i64
%28 = inttoptr i64 %27 to i32*
store i32* %28, i32** %25
%29 = getelementptr inbounds %struct.option, %struct.option* %23, i32 0, i32 2
%30 = ptrtoint i32* %12 to i32
store i32 %30, i32* %29
%31 = getelementptr inbounds %struct.option, %struct.option* %23, i32 0, i32 3
store i32 1, i32* %31
%32 = getelementptr inbounds %struct.option, %struct.option* %23, i32 0, i32 4
store i32 0, i32* %32
%33 = getelementptr inbounds %struct.option, %struct.option* %23, i64 1
%34 = getelementptr inbounds %struct.option, %struct.option* %33, i32 0, i32 0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %34
%35 = getelementptr inbounds %struct.option, %struct.option* %33, i32 0, i32 1
%36 = load i32, i32* @no_argument
%37 = sext i32 %36 to i64
%38 = inttoptr i64 %37 to i32*
store i32* %38, i32** %35
%39 = getelementptr inbounds %struct.option, %struct.option* %33, i32 0, i32 2
%40 = ptrtoint i32* %12 to i32
store i32 %40, i32* %39
%41 = getelementptr inbounds %struct.option, %struct.option* %33, i32 0, i32 3
store i32 0, i32* %41
%42 = getelementptr inbounds %struct.option, %struct.option* %33, i32 0, i32 4
store i32 0, i32* %42
%43 = getelementptr inbounds %struct.option, %struct.option* %33, i64 1
%44 = getelementptr inbounds %struct.option, %struct.option* %43, i32 0, i32 0
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %44
%45 = getelementptr inbounds %struct.option, %struct.option* %43, i32 0, i32 1
%46 = load i32, i32* @no_argument
%47 = sext i32 %46 to i64
%48 = inttoptr i64 %47 to i32*
store i32* %48, i32** %45
%49 = getelementptr inbounds %struct.option, %struct.option* %43, i32 0, i32 2
%50 = ptrtoint i32* %13 to i32
store i32 %50, i32* %49
%51 = getelementptr inbounds %struct.option, %struct.option* %43, i32 0, i32 3
store i32 1, i32* %51
%52 = getelementptr inbounds %struct.option, %struct.option* %43, i32 0, i32 4
store i32 0, i32* %52
%53 = getelementptr inbounds %struct.option, %struct.option* %43, i64 1
%54 = getelementptr inbounds %struct.option, %struct.option* %53, i32 0, i32 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %54
%55 = getelementptr inbounds %struct.option, %struct.option* %53, i32 0, i32 1
%56 = load i32, i32* @required_argument
%57 = sext i32 %56 to i64
%58 = inttoptr i64 %57 to i32*
store i32* %58, i32** %55
%59 = getelementptr inbounds %struct.option, %struct.option* %53, i32 0, i32 2
store i32 0, i32* %59
%60 = getelementptr inbounds %struct.option, %struct.option* %53, i32 0, i32 3
store i32 110, i32* %60
%61 = getelementptr inbounds %struct.option, %struct.option* %53, i32 0, i32 4
store i32 0, i32* %61
%62 = getelementptr inbounds %struct.option, %struct.option* %53, i64 1
%63 = getelementptr inbounds %struct.option, %struct.option* %62, i32 0, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %63
%64 = getelementptr inbounds %struct.option, %struct.option* %62, i32 0, i32 1
%65 = load i32, i32* @no_argument
%66 = sext i32 %65 to i64
%67 = inttoptr i64 %66 to i32*
store i32* %67, i32** %64
%68 = getelementptr inbounds %struct.option, %struct.option* %62, i32 0, i32 2
store i32 0, i32* %68
%69 = getelementptr inbounds %struct.option, %struct.option* %62, i32 0, i32 3
store i32 104, i32* %69
%70 = getelementptr inbounds %struct.option, %struct.option* %62, i32 0, i32 4
store i32 0, i32* %70
%71 = getelementptr inbounds %struct.option, %struct.option* %62, i64 1
%72 = bitcast %struct.option* %71 to i8*
br label %73
73: ; preds = %5, %132
%74 = load i32, i32* %7
%75 = load i8**, i8*** %8
%76 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %14, i64 0, i64 0
%77 = call signext i8 @getopt_long(i32 %74, i8** %75, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), %struct.option* %76, i32* %16)
store i8 %77, i8* %15
%78 = load i8, i8* %15
%79 = sext i8 %78 to i32
%80 = icmp eq i32 %79, -1
br i1 %80, label %81, label %82
81: ; preds = %73
br label %133
82: ; preds = %73
%83 = load i8, i8* %15
%84 = sext i8 %83 to i32
switch i32 %84, label %132 [
i32 0, label %85
i32 110, label %94
i32 104, label %115
]
85: ; preds = %82
%86 = load i32, i32* %16
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %14, i64 0, i64 %87
%89 = getelementptr inbounds %struct.option, %struct.option* %88, i32 0, i32 3
%90 = load i32, i32* %89
%91 = icmp ne i32 %90, 0
br i1 %91, label %92, label %93
92: ; preds = %85
br label %132
93: ; preds = %85
br label %94
94: ; preds = %82, %93
%95 = load i8*, i8** @optarg
%96 = call i32 @atoi(i8* %95)
store i32 %96, i32* %17
%97 = load i32, i32* %17
%98 = icmp slt i32 %97, 1
br i1 %98, label %102, label %99
99: ; preds = %94
%100 = load i32, i32* %17
%101 = icmp sgt i32 %100, 10000
br i1 %101, label %102, label %111
102: ; preds = %99, %94
%103 = load i32, i32* @stderr
%104 = load i8**, i8*** %8
%105 = getelementptr inbounds i8*, i8** %104, i64 0
%106 = load i8*, i8** %105
%107 = load i8*, i8** @optarg
%108 = load i32*, i32** %9
%109 = load i32, i32* %108
%110 = call i32 @fprintf(i32 %103, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), i8* %106, i8* %107, i32 %109)
br label %114
111: ; preds = %99
%112 = load i32, i32* %17
%113 = load i32*, i32** %9
store i32 %112, i32* %113
br label %114
114: ; preds = %111, %102
br label %132
115: ; preds = %82
%116 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%117 = call i32 @puts(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0))
%118 = load i32*, i32** %10
%119 = load i32, i32* %118
%120 = icmp ne i32 %119, 0
%121 = zext i1 %120 to i64
%122 = select i1 %120, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0)
%123 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.9, i64 0, i64 0), i8* %122)
%124 = load i32*, i32** %10
%125 = load i32, i32* %124
%126 = icmp ne i32 %125, 0
%127 = zext i1 %126 to i64
%128 = select i1 %126, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0)
%129 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.12, i64 0, i64 0), i8* %128)
%130 = call i32 @puts(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.13, i64 0, i64 0))
%131 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
store i32 1, i32* %6
br label %138
132: ; preds = %82, %114, %92
br label %73
133: ; preds = %81
%134 = load i32, i32* %12
%135 = load i32*, i32** %10
store i32 %134, i32* %135
%136 = load i32, i32* %13
%137 = load i32*, i32** %11
store i32 %136, i32* %137
store i32 0, i32* %6
br label %138
138: ; preds = %133, %115
%139 = load i32, i32* %6
ret i32 %139
}

LLVM IR (-O2):
%struct.option = type { i8*, i32*, i32, i32, i32 }
@.str = [7 x i8] c"binary\00"
@no_argument = global i32 0
@.str.1 = [6 x i8] c"ascii\00"
@.str.2 = [10 x i8] c"transpose\00"
@.str.3 = [8 x i8] c"matsize\00"
@required_argument = global i32 0
@.str.4 = [5 x i8] c"help\00"
@.str.5 = [4 x i8] c"n:h\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.6 = [43 x i8] c"%s: Cannot use matrix size %s;\0A Using %d\0A\00"
@.str.7 = [10 x i8] c"Options: \00"
@.str.8 = [43 x i8] c" --matsize=N (-n N): Set matrix size.\00"
@.str.9 = [47 x i8] c" --ascii : Use ascii output%s.\0A\00"
@.str.10 = [1 x i8] zeroinitializer
@.str.11 = [10 x i8] c"(default)\00"
@.str.12 = [49 x i8] c" --binary : Use binary output%s.\0A\00"
@.str.13 = [63 x i8] c" --transpose : Use opposite order accessing matrix.\00"
define i32 @get_options(i32 %0, i8** %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca [6 x %struct.option]
%9 = alloca i32
%10 = bitcast i32* %6 to i8*
%11 = load i32, i32* %3
store i32 %11, i32* %6
%12 = bitcast i32* %7 to i8*
%13 = load i32, i32* %4
store i32 %13, i32* %7
%14 = bitcast [6 x %struct.option]* %8 to i8*
%15 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 0
%16 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 0, i32 0
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %16
%17 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 0, i32 1
%18 = load i32, i32* @no_argument
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
store i32* %20, i32** %17
%21 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 0, i32 2
%22 = ptrtoint i32* %6 to i64
%23 = trunc i64 %22 to i32
store i32 %23, i32* %21
%24 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 0, i32 3
store i32 1, i32* %24
%25 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 0, i32 4
store i32 0, i32* %25
%26 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 1, i32 0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %26
%27 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 1, i32 1
store i32* %20, i32** %27
%28 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 1, i32 2
store i32 %23, i32* %28
%29 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 1, i32 3
store i32 0, i32* %29
%30 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 1, i32 4
store i32 0, i32* %30
%31 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 2, i32 0
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %31
%32 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 2, i32 1
store i32* %20, i32** %32
%33 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 2, i32 2
%34 = ptrtoint i32* %7 to i64
%35 = trunc i64 %34 to i32
store i32 %35, i32* %33
%36 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 2, i32 3
store i32 1, i32* %36
%37 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 2, i32 4
store i32 0, i32* %37
%38 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 3, i32 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %38
%39 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 3, i32 1
%40 = load i32, i32* @required_argument
%41 = sext i32 %40 to i64
%42 = inttoptr i64 %41 to i32*
store i32* %42, i32** %39
%43 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 3, i32 2
store i32 0, i32* %43
%44 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 3, i32 3
store i32 110, i32* %44
%45 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 3, i32 4
store i32 0, i32* %45
%46 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 4, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %46
%47 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 4, i32 1
store i32* %20, i32** %47
%48 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 4, i32 2
store i32 0, i32* %48
%49 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 4, i32 3
store i32 104, i32* %49
%50 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 4, i32 4
store i32 0, i32* %50
%51 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 5
%52 = bitcast %struct.option* %51 to i8*
%53 = bitcast i32* %9 to i8*
%54 = call signext i8 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), %struct.option* %15, i32* %9)
%55 = icmp eq i8 %54, -1
br i1 %55, label %92, label %56
56: ; preds = %5, %89
%57 = phi i8 [ %90, %89 ], [ %54, %5 ]
%58 = sext i8 %57 to i32
switch i32 %58, label %89 [
i32 0, label %59
i32 110, label %65
i32 104, label %76
]
59: ; preds = %56
%60 = load i32, i32* %9
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %8, i64 0, i64 %61, i32 3
%63 = load i32, i32* %62
%64 = icmp eq i32 %63, 0
br i1 %64, label %65, label %89
65: ; preds = %59, %56
%66 = load i8*, i8** @optarg
%67 = call i32 @atoi(i8* %66)
%68 = add i32 %67, -10001
%69 = icmp ult i32 %68, -10000
br i1 %69, label %70, label %75
70: ; preds = %65
%71 = load i32, i32* @stderr
%72 = load i8*, i8** %1
%73 = load i32, i32* %2
%74 = call i32 @fprintf(i32 %71, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), i8* %72, i8* %66, i32 %73)
br label %89
75: ; preds = %65
store i32 %67, i32* %2
br label %89
76: ; preds = %56
%77 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%78 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0))
%79 = load i32, i32* %3
%80 = icmp eq i32 %79, 0
%81 = select i1 %80, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0)
%82 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.9, i64 0, i64 0), i8* %81)
%83 = load i32, i32* %3
%84 = icmp eq i32 %83, 0
%85 = select i1 %84, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0)
%86 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.12, i64 0, i64 0), i8* %85)
%87 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.13, i64 0, i64 0))
%88 = call i32 @putchar(i32 10)
br label %95
89: ; preds = %70, %75, %59, %56
%90 = call signext i8 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), %struct.option* %15, i32* %9)
%91 = icmp eq i8 %90, -1
br i1 %91, label %92, label %56
92: ; preds = %89, %5
%93 = load i32, i32* %6
store i32 %93, i32* %3
%94 = load i32, i32* %7
store i32 %94, i32* %4
br label %95
95: ; preds = %92, %76
%96 = phi i32 [ 0, %92 ], [ 1, %76 ]
ret i32 %96
}