#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 atoi(char *);
int /*<<< orphan*/ fblock(char *, int);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ usage();
int /*<<< orphan*/ wl(int /*<<< orphan*/);
int main(int argc, char **argv) {
  int i = 0;
  int blen = 512;
  while (++i < argc) {
    if (strcmp(argv[i], "-b") == 0) {
      if (++i == argc)
        usage();
      blen = atoi(argv[i++]);
      if (blen <= 0)
        usage();
    }
    fblock(argv[i], blen);
    wl(0);
  }
  wl(0);
  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)
movl   $0x0,-0x14(%rbp)
movl   $0x200,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmp    -0x8(%rbp),%eax
jge    1215 <main+0xc5>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11f5 <main+0xa5>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmp    -0x8(%rbp),%eax
jne    11c1 <main+0x71>
mov    $0x0,%al
call   1040 <usage@plt>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jg     11f0 <main+0xa0>
mov    $0x0,%al
call   1040 <usage@plt>
jmp    11f5 <main+0xa5>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x18(%rbp),%esi
call   1060 <fblock@plt>
xor    %edi,%edi
call   1050 <wl@plt>
jmp    1174 <main+0x24>
xor    %edi,%edi
call   1050 <wl@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     11f2 <main+0xa2>
mov    %rsi,%r13
mov    %edi,%r15d
mov    $0x200,%r12d
mov    $0x1,%ebx
xor    %ebp,%ebp
jmp    11bc <main+0x6c>
nopl   0x0(%rax)
add    $0x3,%ebp
movslq %ebx,%rax
mov    0x0(%r13,%rax,8),%rdi
call   1070 <atoi@plt>
mov    %eax,%r12d
test   %eax,%eax
jle    11e9 <main+0x99>
mov    %ebp,%r14d
movslq %r14d,%rbx
mov    0x0(%r13,%rbx,8),%rdi
mov    %r12d,%esi
call   1060 <fblock@plt>
xor    %edi,%edi
call   1050 <wl@plt>
add    $0x1,%ebx
mov    %r14d,%ebp
cmp    %r15d,%ebx
jge    11f2 <main+0xa2>
movslq %ebx,%rax
mov    0x0(%r13,%rax,8),%rdi
lea    0xe35(%rip),%rsi
call   1030 <strcmp@plt>
mov    %ebx,%r14d
test   %rax,%rax
jne    119a <main+0x4a>
lea    0x2(%rbp),%ebx
cmp    %r15d,%ebx
jne    1180 <main+0x30>
xor    %eax,%eax
call   1040 <usage@plt>
jmp    1180 <main+0x30>
xor    %eax,%eax
call   1040 <usage@plt>
jmp    1197 <main+0x47>
xor    %edi,%edi
call   1050 <wl@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-b\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 512, i32* %7
br label %8
8: ; preds = %41, %2
%9 = load i32, i32* %6
%10 = add nsw i32 %9, 1
store i32 %10, i32* %6
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %50
13: ; preds = %8
%14 = load i8**, i8*** %5
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
%18 = load i8*, i8** %17
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %41
21: ; preds = %13
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
%24 = load i32, i32* %4
%25 = icmp eq i32 %23, %24
br i1 %25, label %26, label %28
26: ; preds = %21
%27 = call i32 (...) @usage()
br label %28
28: ; preds = %26, %21
%29 = load i8**, i8*** %5
%30 = load i32, i32* %6
%31 = add nsw i32 %30, 1
store i32 %31, i32* %6
%32 = sext i32 %30 to i64
%33 = getelementptr inbounds i8*, i8** %29, i64 %32
%34 = load i8*, i8** %33
%35 = call i32 @atoi(i8* %34)
store i32 %35, i32* %7
%36 = load i32, i32* %7
%37 = icmp sle i32 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %28
%39 = call i32 (...) @usage()
br label %40
40: ; preds = %38, %28
br label %41
41: ; preds = %40, %13
%42 = load i8**, i8*** %5
%43 = load i32, i32* %6
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8*, i8** %42, i64 %44
%46 = load i8*, i8** %45
%47 = load i32, i32* %7
%48 = call i32 @fblock(i8* %46, i32 %47)
%49 = call i32 @wl(i32 0)
br label %8
50: ; preds = %8
%51 = call i32 @wl(i32 0)
ret i32 0
}

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