#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 */
typedef int /*<<< orphan*/ stt;
typedef int /*<<< orphan*/ cdb;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
char *getenv(char *);
int getopt(int, char **, char *);
char *optarg;
scalar_t__ optind;
int /*<<< orphan*/ printf(char *, ...);
int send_cdb(char *, char, char *, int, char *, int *, char *, int *, int);
int strtol(char *, char **, int /*<<< orphan*/);
int /*<<< orphan*/ usage(char *);
int main(int argc, char **argv) {
  char *progname = argv[0];
  char *device = getenv("DEVICE");
  char cdb[6];
  int cdb_len = sizeof(cdb);
  char stt[18];
  int stt_len = sizeof(stt);
  char dat[255];
  int dat_len = 0;
  int status;
  int size = 0xff;
  int page = -1;
  int ch;
  while ((ch = getopt(argc, argv, "d:z:")) != -1) {
    switch (ch) {
    case 'd':
      device = optarg;
      break;
    case 'z':
      size = strtol(optarg, (char **)NULL, 0);
      break;
    case '?':
    default:
      usage(progname);
      exit(-1);
    }
  }
  argc -= optind;
  argv += optind;
  if (argc > 0) {
    page = strtol(argv[0], (char **)NULL, 0);
    argc--;
    argv++;
  }
  if (argc > 0) {
    usage(progname);
    exit(-1);
  }
  cdb[0] = 0x12;
  cdb[1] = (page == -1) ? 0 : 1;
  cdb[2] = (page == -1) ? 0 : page;
  cdb[3] = 0;
  cdb[4] = size;
  cdb[5] = 0;
  dat_len = size;
  status = send_cdb(device, 'r', cdb, cdb_len, dat, &dat_len, stt, &stt_len, 5);
  if (status != 0) {
    printf("status = %d\n", status);
  }
  if ((status > 0) && (stt_len > 0)) {
    int i;
    printf("sense:");
    for (i = 0; i < stt_len; i++)
      printf(" %.2x", (unsigned char)(stt[i]));
    printf("\n");
  }
  if (1) {
    int i;
    printf("inquiry data:");
    for (i = 0; i < dat_len; i++)
      printf(" %.2x", (unsigned char)(dat[i]));
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
lea    0xe65(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
movl   $0x6,-0x2c(%rbp)
movl   $0x12,-0x44(%rbp)
movl   $0x0,-0x154(%rbp)
movl   $0xff,-0x15c(%rbp)
movl   $0xffffffff,-0x160(%rbp)
ff ff ff
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe29(%rip),%rdx
call   1070 <getopt@plt>
mov    %eax,-0x164(%rbp)
cmp    $0xffffffff,%eax
je     1284 <main+0x114>
mov    -0x164(%rbp),%eax
mov    %eax,-0x170(%rbp)
sub    $0x3f,%eax
je     1267 <main+0xf7>
jmp    120c <main+0x9c>
mov    -0x170(%rbp),%eax
sub    $0x64,%eax
je     1234 <main+0xc4>
jmp    1220 <main+0xb0>
mov    -0x170(%rbp),%eax
sub    $0x7a,%eax
je     1247 <main+0xd7>
jmp    126c <main+0xfc>
mov    0x2dbd(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    127f <main+0x10f>
mov    0x2daa(%rip),%rax
mov    (%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1050 <strtol@plt>
mov    %eax,-0x15c(%rbp)
jmp    127f <main+0x10f>
jmp    126c <main+0xfc>
mov    -0x18(%rbp),%rdi
call   1060 <usage@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>
jmp    11d0 <main+0x60>
mov    0x2d55(%rip),%rax
mov    (%rax),%rcx
movslq -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    0x2d41(%rip),%rax
mov    (%rax),%rax
shl    $0x3,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    12e5 <main+0x175>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1050 <strtol@plt>
mov    %eax,-0x160(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1302 <main+0x192>
mov    -0x18(%rbp),%rdi
call   1060 <usage@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>
movb   $0x12,-0x26(%rbp)
mov    -0x160(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0xffffffff,%edx
cmove  %ecx,%eax
mov    %al,-0x25(%rbp)
cmpl   $0xffffffff,-0x160(%rbp)
jne    1336 <main+0x1c6>
xor    %eax,%eax
mov    %eax,-0x174(%rbp)
jmp    1342 <main+0x1d2>
mov    -0x160(%rbp),%eax
mov    %eax,-0x174(%rbp)
mov    -0x174(%rbp),%eax
mov    %al,-0x24(%rbp)
movb   $0x0,-0x23(%rbp)
mov    -0x15c(%rbp),%eax
mov    %al,-0x22(%rbp)
movb   $0x0,-0x21(%rbp)
mov    -0x15c(%rbp),%eax
mov    %eax,-0x154(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x26(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
lea    -0x150(%rbp),%r8
lea    -0x40(%rbp),%r10
mov    $0x72,%esi
lea    -0x154(%rbp),%r9
lea    -0x44(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
movl   $0x5,0x10(%rsp)
call   1080 <send_cdb@plt>
mov    %eax,-0x158(%rbp)
cmpl   $0x0,-0x158(%rbp)
je     13cb <main+0x25b>
mov    -0x158(%rbp),%esi
lea    0xc48(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x158(%rbp)
jle    1445 <main+0x2d5>
cmpl   $0x0,-0x44(%rbp)
jle    1445 <main+0x2d5>
lea    0xc30(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x168(%rbp)
mov    -0x168(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    1437 <main+0x2c7>
movslq -0x168(%rbp),%rax
movzbl -0x40(%rbp,%rax,1),%esi
lea    0xc04(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x168(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x168(%rbp)
jmp    13fa <main+0x28a>
lea    0xbd9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xbda(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x16c(%rbp)
mov    -0x16c(%rbp),%eax
cmp    -0x154(%rbp),%eax
jge    14a0 <main+0x330>
movslq -0x16c(%rbp),%rax
movzbl -0x150(%rbp,%rax,1),%esi
ff
lea    0xb9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x16c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x16c(%rbp)
jmp    145d <main+0x2ed>
lea    0xb70(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x148,%rsp
mov    %rsi,%rbp
mov    %edi,%ebx
mov    (%rsi),%rax
mov    %rax,0x18(%rsp)
lea    0xe5b(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%r15
movl   $0x12,0x8(%rsp)
mov    $0xff,%r12d
lea    0xe45(%rip),%r13
mov    0x2e2f(%rip),%r14
jmp    11df <main+0x5f>
nopl   0x0(%rax,%rax,1)
mov    (%r14),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1060 <strtol@plt>
mov    %eax,%r12d
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %r13,%rdx
call   1080 <getopt@plt>
cmp    $0x7a,%eax
je     11d0 <main+0x50>
cmp    $0xffffffff,%eax
je     1200 <main+0x80>
cmp    $0x64,%eax
jne    1223 <main+0xa3>
mov    (%r14),%r15
jmp    11df <main+0x5f>
mov    0x2dd9(%rip),%rax
mov    (%rax),%rax
sub    %eax,%ebx
test   %ebx,%ebx
jle    1237 <main+0xb7>
mov    0x0(%rbp,%rax,8),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1060 <strtol@plt>
cmp    $0x1,%ebx
je     123c <main+0xbc>
mov    0x18(%rsp),%rdi
call   1070 <usage@plt>
mov    $0xffffffff,%edi
call   10a0 <exit@plt>
mov    $0xffffffff,%eax
movb   $0x12,0xe(%rsp)
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  0xf(%rsp)
cmovne %eax,%ecx
mov    %cl,0x10(%rsp)
movb   $0x0,0x11(%rsp)
mov    %r12b,0x12(%rsp)
movb   $0x0,0x13(%rsp)
mov    %r12d,0x14(%rsp)
sub    $0x8,%rsp
lea    0x10(%rsp),%rax
lea    0x28(%rsp),%rbp
lea    0x16(%rsp),%rdx
lea    0x48(%rsp),%r8
lea    0x1c(%rsp),%r9
mov    %r15,%rdi
mov    $0x72,%esi
mov    $0x6,%ecx
push   $0x5
push   %rax
push   %rbp
call   1090 <send_cdb@plt>
add    $0x20,%rsp
test   %eax,%eax
je     1307 <main+0x187>
mov    %eax,%ebx
lea    0xd62(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebx,%ebx
jle    1307 <main+0x187>
cmpl   $0x0,0x8(%rsp)
jle    1307 <main+0x187>
lea    0xd54(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0x8(%rsp)
jle    12fd <main+0x17d>
lea    0xd46(%rip),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
movzbl 0x20(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
movslq 0x8(%rsp),%rax
cmp    %rax,%rbp
jl     12e0 <main+0x160>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0xd18(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0x14(%rsp)
jle    134d <main+0x1cd>
lea    0xcfd(%rip),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
movzbl 0x40(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
movslq 0x14(%rsp),%rax
cmp    %rax,%rbp
jl     1330 <main+0x1b0>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
add    $0x148,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"DEVICE\00"
@.str.1 = [5 x i8] c"d:z:\00"
@optarg = global i8* null
@optind = global i64 0
@.str.2 = [13 x i8] c"status = %d\0A\00"
@.str.3 = [7 x i8] c"sense:\00"
@.str.4 = [6 x i8] c" %.2x\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [14 x i8] c"inquiry data:\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [6 x i8]
%9 = alloca i32
%10 = alloca [18 x i8]
%11 = alloca i32
%12 = alloca [255 x i8]
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 0
%22 = load i8*, i8** %21
store i8* %22, i8** %6
%23 = call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i8* %23, i8** %7
store i32 6, i32* %9
store i32 18, i32* %11
store i32 0, i32* %13
store i32 255, i32* %15
store i32 -1, i32* %16
br label %24
24: ; preds = %41, %2
%25 = load i32, i32* %4
%26 = load i8**, i8*** %5
%27 = call i32 @getopt(i32 %25, i8** %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32 %27, i32* %17
%28 = icmp ne i32 %27, -1
br i1 %28, label %29, label %42
29: ; preds = %24
%30 = load i32, i32* %17
switch i32 %30, label %37 [
i32 100, label %31
i32 122, label %33
i32 63, label %36
]
31: ; preds = %29
%32 = load i8*, i8** @optarg
store i8* %32, i8** %7
br label %41
33: ; preds = %29
%34 = load i8*, i8** @optarg
%35 = call i32 @strtol(i8* %34, i8** null, i32 0)
store i32 %35, i32* %15
br label %41
36: ; preds = %29
br label %37
37: ; preds = %29, %36
%38 = load i8*, i8** %6
%39 = call i32 @usage(i8* %38)
%40 = call i32 @exit(i32 -1)
unreachable
41: ; preds = %33, %31
br label %24
42: ; preds = %24
%43 = load i64, i64* @optind
%44 = load i32, i32* %4
%45 = sext i32 %44 to i64
%46 = sub nsw i64 %45, %43
%47 = trunc i64 %46 to i32
store i32 %47, i32* %4
%48 = load i64, i64* @optind
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i64 %48
store i8** %50, i8*** %5
%51 = load i32, i32* %4
%52 = icmp sgt i32 %51, 0
br i1 %52, label %53, label %62
53: ; preds = %42
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 0
%56 = load i8*, i8** %55
%57 = call i32 @strtol(i8* %56, i8** null, i32 0)
store i32 %57, i32* %16
%58 = load i32, i32* %4
%59 = add nsw i32 %58, -1
store i32 %59, i32* %4
%60 = load i8**, i8*** %5
%61 = getelementptr inbounds i8*, i8** %60, i32 1
store i8** %61, i8*** %5
br label %62
62: ; preds = %53, %42
%63 = load i32, i32* %4
%64 = icmp sgt i32 %63, 0
br i1 %64, label %65, label %69
65: ; preds = %62
%66 = load i8*, i8** %6
%67 = call i32 @usage(i8* %66)
%68 = call i32 @exit(i32 -1)
unreachable
69: ; preds = %62
%70 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 0
store i8 18, i8* %70
%71 = load i32, i32* %16
%72 = icmp eq i32 %71, -1
%73 = zext i1 %72 to i64
%74 = select i1 %72, i32 0, i32 1
%75 = trunc i32 %74 to i8
%76 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 1
store i8 %75, i8* %76
%77 = load i32, i32* %16
%78 = icmp eq i32 %77, -1
br i1 %78, label %79, label %80
79: ; preds = %69
br label %82
80: ; preds = %69
%81 = load i32, i32* %16
br label %82
82: ; preds = %80, %79
%83 = phi i32 [ 0, %79 ], [ %81, %80 ]
%84 = trunc i32 %83 to i8
%85 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 2
store i8 %84, i8* %85
%86 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 3
store i8 0, i8* %86
%87 = load i32, i32* %15
%88 = trunc i32 %87 to i8
%89 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 4
store i8 %88, i8* %89
%90 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 5
store i8 0, i8* %90
%91 = load i32, i32* %15
store i32 %91, i32* %13
%92 = load i8*, i8** %7
%93 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 0
%94 = load i32, i32* %9
%95 = getelementptr inbounds [255 x i8], [255 x i8]* %12, i64 0, i64 0
%96 = getelementptr inbounds [18 x i8], [18 x i8]* %10, i64 0, i64 0
%97 = call i32 @send_cdb(i8* %92, i8 signext 114, i8* %93, i32 %94, i8* %95, i32* %13, i8* %96, i32* %11, i32 5)
store i32 %97, i32* %14
%98 = load i32, i32* %14
%99 = icmp ne i32 %98, 0
br i1 %99, label %100, label %103
100: ; preds = %82
%101 = load i32, i32* %14
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %101)
br label %103
103: ; preds = %100, %82
%104 = load i32, i32* %14
%105 = icmp sgt i32 %104, 0
br i1 %105, label %106, label %127
106: ; preds = %103
%107 = load i32, i32* %11
%108 = icmp sgt i32 %107, 0
br i1 %108, label %109, label %127
109: ; preds = %106
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %18
br label %111
111: ; preds = %122, %109
%112 = load i32, i32* %18
%113 = load i32, i32* %11
%114 = icmp slt i32 %112, %113
br i1 %114, label %115, label %125
115: ; preds = %111
%116 = load i32, i32* %18
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds [18 x i8], [18 x i8]* %10, i64 0, i64 %117
%119 = load i8, i8* %118
%120 = zext i8 %119 to i32
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %120)
br label %122
122: ; preds = %115
%123 = load i32, i32* %18
%124 = add nsw i32 %123, 1
store i32 %124, i32* %18
br label %111
125: ; preds = %111
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %127
127: ; preds = %125, %106, %103
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %19
br label %129
129: ; preds = %140, %127
%130 = load i32, i32* %19
%131 = load i32, i32* %13
%132 = icmp slt i32 %130, %131
br i1 %132, label %133, label %143
133: ; preds = %129
%134 = load i32, i32* %19
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds [255 x i8], [255 x i8]* %12, i64 0, i64 %135
%137 = load i8, i8* %136
%138 = zext i8 %137 to i32
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %138)
br label %140
140: ; preds = %133
%141 = load i32, i32* %19
%142 = add nsw i32 %141, 1
store i32 %142, i32* %19
br label %129
143: ; preds = %129
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%145 = load i32, i32* %3
ret i32 %145
}

LLVM IR (-O2):
@.str = [7 x i8] c"DEVICE\00"
@.str.1 = [5 x i8] c"d:z:\00"
@optarg = global i8* null
@optind = global i64 0
@.str.2 = [13 x i8] c"status = %d\0A\00"
@.str.3 = [7 x i8] c"sense:\00"
@.str.4 = [6 x i8] c" %.2x\00"
@.str.6 = [14 x i8] c"inquiry data:\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [6 x i8]
%4 = alloca [18 x i8]
%5 = alloca i32
%6 = alloca [255 x i8]
%7 = alloca i32
%8 = load i8*, i8** %1
%9 = tail call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds [18 x i8], [18 x i8]* %4, i64 0, i64 0
%12 = bitcast i32* %5 to i8*
store i32 18, i32* %5
%13 = getelementptr inbounds [255 x i8], [255 x i8]* %6, i64 0, i64 0
%14 = bitcast i32* %7 to i8*
br label %15
15: ; preds = %21, %2
%16 = phi i8* [ %22, %21 ], [ %9, %2 ]
%17 = phi i32 [ %19, %21 ], [ 255, %2 ]
br label %18
18: ; preds = %15, %23
%19 = phi i32 [ %25, %23 ], [ %17, %15 ]
%20 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
switch i32 %20, label %26 [
i32 -1, label %29
i32 100, label %21
i32 122, label %23
]
21: ; preds = %18
%22 = load i8*, i8** @optarg
br label %15
23: ; preds = %18
%24 = load i8*, i8** @optarg
%25 = tail call i32 @strtol(i8* nocapture %24, i8** null, i32 0)
br label %18
26: ; preds = %18
%27 = tail call i32 @usage(i8* %8)
%28 = tail call i32 @exit(i32 -1)
unreachable
29: ; preds = %18
%30 = load i64, i64* @optind
%31 = trunc i64 %30 to i32
%32 = sub i32 %0, %31
%33 = icmp sgt i32 %32, 0
br i1 %33, label %34, label %42
34: ; preds = %29
%35 = getelementptr inbounds i8*, i8** %1, i64 %30
%36 = load i8*, i8** %35
%37 = tail call i32 @strtol(i8* nocapture %36, i8** null, i32 0)
%38 = icmp eq i32 %32, 1
br i1 %38, label %42, label %39
39: ; preds = %34
%40 = tail call i32 @usage(i8* %8)
%41 = tail call i32 @exit(i32 -1)
unreachable
42: ; preds = %29, %34
%43 = phi i32 [ %37, %34 ], [ -1, %29 ]
store i8 18, i8* %10
%44 = icmp eq i32 %43, -1
%45 = xor i1 %44, true
%46 = zext i1 %45 to i8
%47 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 1
store i8 %46, i8* %47
%48 = trunc i32 %43 to i8
%49 = select i1 %44, i8 0, i8 %48
%50 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 2
store i8 %49, i8* %50
%51 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 3
store i8 0, i8* %51
%52 = trunc i32 %19 to i8
%53 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 4
store i8 %52, i8* %53
%54 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 5
store i8 0, i8* %54
store i32 %19, i32* %7
%55 = call i32 @send_cdb(i8* %16, i8 signext 114, i8* %10, i32 6, i8* %13, i32* %7, i8* %11, i32* %5, i32 5)
%56 = icmp eq i32 %55, 0
br i1 %56, label %79, label %57
57: ; preds = %42
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %55)
%59 = icmp sgt i32 %55, 0
%60 = load i32, i32* %5
%61 = icmp sgt i32 %60, 0
%62 = select i1 %59, i1 %61, i1 false
br i1 %62, label %63, label %79
63: ; preds = %57
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%65 = load i32, i32* %5
%66 = icmp sgt i32 %65, 0
br i1 %66, label %67, label %77
67: ; preds = %63, %67
%68 = phi i64 [ %73, %67 ], [ 0, %63 ]
%69 = getelementptr inbounds [18 x i8], [18 x i8]* %4, i64 0, i64 %68
%70 = load i8, i8* %69
%71 = zext i8 %70 to i32
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %71)
%73 = add nuw nsw i64 %68, 1
%74 = load i32, i32* %5
%75 = sext i32 %74 to i64
%76 = icmp slt i64 %73, %75
br i1 %76, label %67, label %77
77: ; preds = %67, %63
%78 = call i32 @putchar(i32 10)
br label %79
79: ; preds = %42, %77, %57
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%81 = load i32, i32* %7
%82 = icmp sgt i32 %81, 0
br i1 %82, label %83, label %93
83: ; preds = %79, %83
%84 = phi i64 [ %89, %83 ], [ 0, %79 ]
%85 = getelementptr inbounds [255 x i8], [255 x i8]* %6, i64 0, i64 %84
%86 = load i8, i8* %85
%87 = zext i8 %86 to i32
%88 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %87)
%89 = add nuw nsw i64 %84, 1
%90 = load i32, i32* %7
%91 = sext i32 %90 to i64
%92 = icmp slt i64 %89, %91
br i1 %92, label %83, label %93
93: ; preds = %83, %79
%94 = call i32 @putchar(i32 10)
ret i32 0
}