#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*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ close(int);
int creat(char const *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, ...);
int open(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int read(int, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stripe8(int /*<<< orphan*/ *, int, int, int);
int write(int, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  bool unstripe = false;
  bool be = false;
  int i;
  const char *exe_name = argv[0];
  argc--;
  argv++;
  if (argc < 2) {
    fprintf(stderr, "ERROR: %s requires at least two args\n", exe_name);
    return 1;
  }
  const char *single_f = argv[0];
  int single;
  if (unstripe) {
    single = creat(single_f, 0644);
  } else {
    single = open(single_f, 0);
  }
  if (single == -1) {
    perror(argv[0]);
    return 1;
  }
  argv++;
  argc--;
  int multiple[argc];
  for (i = 0; i < argc; ++i) {
    if (unstripe) {
      multiple[i] = open(argv[i], 0);
    } else {
      multiple[i] = creat(argv[i], 0644);
    }
    if (multiple[i] == -1) {
      perror(argv[i]);
      return 1;
    }
  }
  while (true) {
    uint8_t buf[argc];
    for (i = 0; i < argc; ++i) {
      switch (read(!unstripe ? single : multiple[i], &buf[i], 1)) {
      case 0:
        if (i == 0) {
          goto done;
        } else if (!unstripe) {
          fprintf(stderr,
                  "WARNING:input file %s is not multiple of "
                  "%d bytes, padding with garbage byte\n",
                  single_f, argc);
        }
        break;
      case -1:
        perror(unstripe ? argv[i] : single_f);
        return 1;
      }
    }
    stripe8(buf, argc, unstripe, be);
    for (i = 0; i < argc; ++i) {
      switch (write(unstripe ? single : multiple[i], &buf[i], 1)) {
      case -1:
        perror(unstripe ? single_f : argv[i]);
        return 1;
      case 0:
        i--;
      }
    }
  }
done:
  close(single);
  for (i = 0; i < argc; ++i) {
    close(multiple[argc]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11f8 <main+0x78>
mov    0x2e08(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rdx
lea    0xe1b(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1604 <main+0x484>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1223 <main+0xa3>
mov    -0x30(%rbp),%rdi
mov    $0x1a4,%esi
call   10a0 <creat@plt>
mov    %eax,-0x34(%rbp)
jmp    1231 <main+0xb1>
mov    -0x30(%rbp),%rdi
xor    %esi,%esi
call   1080 <open@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0xffffffff,-0x34(%rbp)
jne    1253 <main+0xd3>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1090 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1604 <main+0x484>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x40(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x68(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    133d <main+0x1bd>
cmpl   $0x0,-0x14(%rbp)
je     12d1 <main+0x151>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
xor    %esi,%esi
call   1080 <open@plt>
mov    %eax,%edx
mov    -0x68(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    12f4 <main+0x174>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x1a4,%esi
call   10a0 <creat@plt>
mov    %eax,%edx
mov    -0x68(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x68(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
jne    132a <main+0x1aa>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1090 <perror@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x4c(%rbp)
jmp    15fd <main+0x47d>
jmp    132f <main+0x1af>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1296 <main+0x116>
jmp    1342 <main+0x1c2>
jmp    1347 <main+0x1c7>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x58(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x70(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    147e <main+0x2fe>
cmpl   $0x0,-0x14(%rbp)
jne    1396 <main+0x216>
mov    -0x34(%rbp),%eax
mov    %eax,-0x74(%rbp)
jmp    13a4 <main+0x224>
mov    -0x68(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x74(%rbp)
mov    -0x70(%rbp),%rax
mov    -0x74(%rbp),%edi
movslq -0x1c(%rbp),%rcx
lea    (%rax,%rcx,4),%rsi
mov    $0x1,%edx
call   1060 <read@plt>
mov    %eax,%ecx
mov    %ecx,-0x78(%rbp)
sub    $0xffffffff,%eax
je     1428 <main+0x2a8>
jmp    13d0 <main+0x250>
mov    -0x78(%rbp),%eax
test   %eax,%eax
jne    146b <main+0x2eb>
jmp    13e0 <main+0x260>
cmpl   $0x0,-0x1c(%rbp)
jne    13f6 <main+0x276>
movl   $0xb,-0x4c(%rbp)
jmp    1580 <main+0x400>
cmpl   $0x0,-0x14(%rbp)
jne    141e <main+0x29e>
mov    0x2bd9(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rdx
mov    -0x8(%rbp),%ecx
lea    0xc0f(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    1423 <main+0x2a3>
jmp    146b <main+0x2eb>
cmpl   $0x0,-0x14(%rbp)
je     1447 <main+0x2c7>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x80(%rbp)
jmp    144f <main+0x2cf>
mov    -0x30(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x80(%rbp),%rdi
call   1090 <perror@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x4c(%rbp)
jmp    1580 <main+0x400>
jmp    1470 <main+0x2f0>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1375 <main+0x1f5>
mov    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <stripe8@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1579 <main+0x3f9>
cmpl   $0x0,-0x14(%rbp)
je     14bb <main+0x33b>
mov    -0x34(%rbp),%eax
mov    %eax,-0x84(%rbp)
jmp    14cc <main+0x34c>
mov    -0x68(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x84(%rbp)
mov    -0x70(%rbp),%rax
mov    -0x84(%rbp),%edi
movslq -0x1c(%rbp),%rcx
lea    (%rax,%rcx,4),%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    %eax,%ecx
mov    %ecx,-0x88(%rbp)
sub    $0xffffffff,%eax
je     1511 <main+0x391>
jmp    14fe <main+0x37e>
mov    -0x88(%rbp),%eax
test   %eax,%eax
je     155d <main+0x3dd>
jmp    1566 <main+0x3e6>
cmpl   $0x0,-0x14(%rbp)
je     152b <main+0x3ab>
mov    -0x30(%rbp),%rax
mov    %rax,-0x90(%rbp)
jmp    153e <main+0x3be>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x90(%rbp)
mov    -0x90(%rbp),%rdi
call   1090 <perror@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x4c(%rbp)
jmp    1580 <main+0x400>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    156b <main+0x3eb>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1497 <main+0x317>
movl   $0x0,-0x4c(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,%rsp
mov    -0x4c(%rbp),%eax
mov    %eax,-0x94(%rbp)
test   %eax,%eax
je     15b1 <main+0x431>
jmp    159d <main+0x41d>
mov    -0x94(%rbp),%eax
sub    $0xb,%eax
je     15b6 <main+0x436>
jmp    15fd <main+0x47d>
jmp    1342 <main+0x1c2>
mov    -0x34(%rbp),%edi
call   1050 <close@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    15ef <main+0x46f>
mov    -0x68(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1050 <close@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    15c5 <main+0x445>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x4c(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%r13
cmp    $0x2,%edi
jg     11be <main+0x3e>
mov    0x0(%r13),%rdx
mov    0x2e3c(%rip),%rax
mov    (%rax),%edi
lea    0xe53(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x1,%eax
jmp    1367 <main+0x1e7>
mov    %edi,%r15d
mov    0x8(%r13),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1080 <open@plt>
mov    %eax,-0x2c(%rbp)
cmp    $0xffffffff,%eax
je     1376 <main+0x1f6>
mov    %rbx,-0x58(%rbp)
mov    %rsp,%r12
add    $0xfffffffe,%r15d
mov    %rsp,%r14
lea    0xf(,%r15,4),%rax
and    $0xfffffffffffffff0,%rax
mov    %rax,-0x50(%rbp)
sub    %rax,%r14
mov    %r14,%rsp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x10(%r13,%rbx,8),%rdi
mov    $0x1a4,%esi
call   10a0 <creat@plt>
mov    %eax,(%r14,%rbx,4)
cmp    $0xffffffff,%eax
je     1386 <main+0x206>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1210 <main+0x90>
mov    %r13,-0x48(%rbp)
mov    %r12,-0x40(%rbp)
lea    0x0(,%r15,4),%rax
mov    %rax,-0x60(%rbp)
jmp    1254 <main+0xd4>
nopl   0x0(%rax,%rax,1)
mov    -0x38(%rbp),%rsp
mov    %rsp,-0x38(%rbp)
mov    %rsp,%r13
sub    -0x50(%rbp),%r13
mov    %r13,%rsp
xor    %r12d,%r12d
mov    -0x58(%rbp),%rbx
jmp    1283 <main+0x103>
nopl   0x0(%rax,%rax,1)
cmp    $0xffffffff,%eax
je     131d <main+0x19d>
add    $0x4,%r12
cmp    %r12,-0x60(%rbp)
je     12c0 <main+0x140>
lea    (%r12,%r13,1),%rsi
mov    -0x2c(%rbp),%edi
mov    $0x1,%edx
call   1060 <read@plt>
test   %eax,%eax
jne    1270 <main+0xf0>
test   %r12,%r12
je     1330 <main+0x1b0>
mov    0x2d38(%rip),%rax
mov    (%rax),%edi
lea    0xd75(%rip),%rsi
mov    %rbx,%rdx
mov    %r15d,%ecx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    1279 <main+0xf9>
xor    %ebx,%ebx
mov    %r13,%rdi
mov    %r15d,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <stripe8@plt>
jmp    12ef <main+0x16f>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0xffffffff,%ebx
add    $0x1,%ebx
cmp    %r15d,%ebx
jge    1250 <main+0xd0>
movslq %ebx,%r12
mov    (%r14,%r12,4),%edi
lea    0x0(,%r12,4),%rsi
add    %r13,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
test   %eax,%eax
je     12e0 <main+0x160>
cmp    $0xffffffff,%eax
jne    12e3 <main+0x163>
mov    -0x48(%rbp),%rax
mov    0x10(%rax,%r12,8),%rbx
mov    %rbx,%rdi
call   1090 <perror@plt>
mov    $0x1,%eax
mov    -0x38(%rbp),%rsp
jmp    1360 <main+0x1e0>
mov    -0x38(%rbp),%rsp
mov    -0x2c(%rbp),%edi
call   1050 <close@plt>
movslq %r15d,%rax
mov    (%r14,%rax,4),%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14d,%edi
call   1050 <close@plt>
add    $0xffffffff,%r15d
jne    1350 <main+0x1d0>
xor    %eax,%eax
mov    -0x40(%rbp),%r12
mov    %r12,%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x8(%r13),%rdi
call   1090 <perror@plt>
mov    $0x1,%eax
jmp    1367 <main+0x1e7>
mov    0x10(%r13,%rbx,8),%rdi
call   1090 <perror@plt>
mov    $0x1,%eax
jmp    1364 <main+0x1e4>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"ERROR: %s requires at least two args\0A\00"
@.str.1 = [78 x i8] c"WARNING:input file %s is not multiple of %d bytes, padding with garbage byte\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
store i8* %19, i8** %9
%20 = load i32, i32* %4
%21 = add nsw i32 %20, -1
store i32 %21, i32* %4
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i32 1
store i8** %23, i8*** %5
%24 = load i32, i32* %4
%25 = icmp slt i32 %24, 2
br i1 %25, label %26, label %30
26: ; preds = %2
%27 = load i32, i32* @stderr
%28 = load i8*, i8** %9
%29 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %28)
store i32 1, i32* %3
br label %232
30: ; preds = %2
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 0
%33 = load i8*, i8** %32
store i8* %33, i8** %10
%34 = load i32, i32* %6
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %30
%37 = load i8*, i8** %10
%38 = call i32 @creat(i8* %37, i32 420)
store i32 %38, i32* %11
br label %42
39: ; preds = %30
%40 = load i8*, i8** %10
%41 = call i32 @open(i8* %40, i32 0)
store i32 %41, i32* %11
br label %42
42: ; preds = %39, %36
%43 = load i32, i32* %11
%44 = icmp eq i32 %43, -1
br i1 %44, label %45, label %50
45: ; preds = %42
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 0
%48 = load i8*, i8** %47
%49 = call i32 @perror(i8* %48)
store i32 1, i32* %3
br label %232
50: ; preds = %42
%51 = load i8**, i8*** %5
%52 = getelementptr inbounds i8*, i8** %51, i32 1
store i8** %52, i8*** %5
%53 = load i32, i32* %4
%54 = add nsw i32 %53, -1
store i32 %54, i32* %4
%55 = load i32, i32* %4
%56 = zext i32 %55 to i64
%57 = call i8* @llvm.stacksave()
store i8* %57, i8** %12
%58 = alloca i32, i64 %56
store i64 %56, i64* %13
store i32 0, i32* %8
br label %59
59: ; preds = %100, %50
%60 = load i32, i32* %8
%61 = load i32, i32* %4
%62 = icmp slt i32 %60, %61
br i1 %62, label %63, label %103
63: ; preds = %59
%64 = load i32, i32* %6
%65 = icmp ne i32 %64, 0
br i1 %65, label %66, label %76
66: ; preds = %63
%67 = load i8**, i8*** %5
%68 = load i32, i32* %8
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i8*, i8** %67, i64 %69
%71 = load i8*, i8** %70
%72 = call i32 @open(i8* %71, i32 0)
%73 = load i32, i32* %8
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i32, i32* %58, i64 %74
store i32 %72, i32* %75
br label %86
76: ; preds = %63
%77 = load i8**, i8*** %5
%78 = load i32, i32* %8
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds i8*, i8** %77, i64 %79
%81 = load i8*, i8** %80
%82 = call i32 @creat(i8* %81, i32 420)
%83 = load i32, i32* %8
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i32, i32* %58, i64 %84
store i32 %82, i32* %85
br label %86
86: ; preds = %76, %66
%87 = load i32, i32* %8
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i32, i32* %58, i64 %88
%90 = load i32, i32* %89
%91 = icmp eq i32 %90, -1
br i1 %91, label %92, label %99
92: ; preds = %86
%93 = load i8**, i8*** %5
%94 = load i32, i32* %8
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds i8*, i8** %93, i64 %95
%97 = load i8*, i8** %96
%98 = call i32 @perror(i8* %97)
store i32 1, i32* %3
store i32 1, i32* %14
br label %230
99: ; preds = %86
br label %100
100: ; preds = %99
%101 = load i32, i32* %8
%102 = add nsw i32 %101, 1
store i32 %102, i32* %8
br label %59
103: ; preds = %59
br label %104
104: ; preds = %212, %103
br label %105
105: ; preds = %104
%106 = load i32, i32* %4
%107 = zext i32 %106 to i64
%108 = call i8* @llvm.stacksave()
store i8* %108, i8** %15
%109 = alloca i32, i64 %107
store i64 %107, i64* %16
store i32 0, i32* %8
br label %110
110: ; preds = %159, %105
%111 = load i32, i32* %8
%112 = load i32, i32* %4
%113 = icmp slt i32 %111, %112
br i1 %113, label %114, label %162
114: ; preds = %110
%115 = load i32, i32* %6
%116 = icmp ne i32 %115, 0
br i1 %116, label %119, label %117
117: ; preds = %114
%118 = load i32, i32* %11
br label %124
119: ; preds = %114
%120 = load i32, i32* %8
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds i32, i32* %58, i64 %121
%123 = load i32, i32* %122
br label %124
124: ; preds = %119, %117
%125 = phi i32 [ %118, %117 ], [ %123, %119 ]
%126 = load i32, i32* %8
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds i32, i32* %109, i64 %127
%129 = call i32 @read(i32 %125, i32* %128, i32 1)
switch i32 %129, label %158 [
i32 0, label %130
i32 -1, label %144
]
130: ; preds = %124
%131 = load i32, i32* %8
%132 = icmp eq i32 %131, 0
br i1 %132, label %133, label %134
133: ; preds = %130
store i32 11, i32* %14
br label %209
134: ; preds = %130
%135 = load i32, i32* %6
%136 = icmp ne i32 %135, 0
br i1 %136, label %142, label %137
137: ; preds = %134
%138 = load i32, i32* @stderr
%139 = load i8*, i8** %10
%140 = load i32, i32* %4
%141 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %138, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0), i8* %139, i32 %140)
br label %142
142: ; preds = %137, %134
br label %143
143: ; preds = %142
br label %158
144: ; preds = %124
%145 = load i32, i32* %6
%146 = icmp ne i32 %145, 0
br i1 %146, label %147, label %153
147: ; preds = %144
%148 = load i8**, i8*** %5
%149 = load i32, i32* %8
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds i8*, i8** %148, i64 %150
%152 = load i8*, i8** %151
br label %155
153: ; preds = %144
%154 = load i8*, i8** %10
br label %155
155: ; preds = %153, %147
%156 = phi i8* [ %152, %147 ], [ %154, %153 ]
%157 = call i32 @perror(i8* %156)
store i32 1, i32* %3
store i32 1, i32* %14
br label %209
158: ; preds = %124, %143
br label %159
159: ; preds = %158
%160 = load i32, i32* %8
%161 = add nsw i32 %160, 1
store i32 %161, i32* %8
br label %110
162: ; preds = %110
%163 = load i32, i32* %4
%164 = load i32, i32* %6
%165 = load i32, i32* %7
%166 = call i32 @stripe8(i32* %109, i32 %163, i32 %164, i32 %165)
store i32 0, i32* %8
br label %167
167: ; preds = %205, %162
%168 = load i32, i32* %8
%169 = load i32, i32* %4
%170 = icmp slt i32 %168, %169
br i1 %170, label %171, label %208
171: ; preds = %167
%172 = load i32, i32* %6
%173 = icmp ne i32 %172, 0
br i1 %173, label %174, label %176
174: ; preds = %171
%175 = load i32, i32* %11
br label %181
176: ; preds = %171
%177 = load i32, i32* %8
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds i32, i32* %58, i64 %178
%180 = load i32, i32* %179
br label %181
181: ; preds = %176, %174
%182 = phi i32 [ %175, %174 ], [ %180, %176 ]
%183 = load i32, i32* %8
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds i32, i32* %109, i64 %184
%186 = call i32 @write(i32 %182, i32* %185, i32 1)
switch i32 %186, label %204 [
i32 -1, label %187
i32 0, label %201
]
187: ; preds = %181
%188 = load i32, i32* %6
%189 = icmp ne i32 %188, 0
br i1 %189, label %190, label %192
190: ; preds = %187
%191 = load i8*, i8** %10
br label %198
192: ; preds = %187
%193 = load i8**, i8*** %5
%194 = load i32, i32* %8
%195 = sext i32 %194 to i64
%196 = getelementptr inbounds i8*, i8** %193, i64 %195
%197 = load i8*, i8** %196
br label %198
198: ; preds = %192, %190
%199 = phi i8* [ %191, %190 ], [ %197, %192 ]
%200 = call i32 @perror(i8* %199)
store i32 1, i32* %3
store i32 1, i32* %14
br label %209
201: ; preds = %181
%202 = load i32, i32* %8
%203 = add nsw i32 %202, -1
store i32 %203, i32* %8
br label %204
204: ; preds = %201, %181
br label %205
205: ; preds = %204
%206 = load i32, i32* %8
%207 = add nsw i32 %206, 1
store i32 %207, i32* %8
br label %167
208: ; preds = %167
store i32 0, i32* %14
br label %209
209: ; preds = %133, %208, %198, %155
%210 = load i8*, i8** %15
%211 = load i32, i32* %14
switch i32 %211, label %230 [
i32 0, label %212
i32 11, label %213
]
212: ; preds = %209
br label %104
213: ; preds = %209
%214 = load i32, i32* %11
%215 = call i32 @close(i32 %214)
store i32 0, i32* %8
br label %216
216: ; preds = %226, %213
%217 = load i32, i32* %8
%218 = load i32, i32* %4
%219 = icmp slt i32 %217, %218
br i1 %219, label %220, label %229
220: ; preds = %216
%221 = load i32, i32* %4
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds i32, i32* %58, i64 %222
%224 = load i32, i32* %223
%225 = call i32 @close(i32 %224)
br label %226
226: ; preds = %220
%227 = load i32, i32* %8
%228 = add nsw i32 %227, 1
store i32 %228, i32* %8
br label %216
229: ; preds = %216
store i32 0, i32* %3
store i32 1, i32* %14
br label %230
230: ; preds = %229, %209, %92
%231 = load i8*, i8** %12
br label %232
232: ; preds = %230, %45, %26
%233 = load i32, i32* %3
ret i32 %233
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"ERROR: %s requires at least two args\0A\00"
@.str.1 = [78 x i8] c"WARNING:input file %s is not multiple of %d bytes, padding with garbage byte\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = icmp slt i32 %0, 3
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i8*, i8** %1
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %86
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = tail call i32 @open(i8* %10, i32 0)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i8*, i8** %3
%15 = tail call i32 @perror(i8* %14)
br label %86
16: ; preds = %9
%17 = getelementptr inbounds i8*, i8** %1, i64 2
%18 = add nsw i32 %0, -2
%19 = zext i32 %18 to i64
%20 = tail call i8* @llvm.stacksave()
%21 = alloca i32, i64 %19
br label %22
22: ; preds = %16, %34
%23 = phi i64 [ 0, %16 ], [ %35, %34 ]
%24 = getelementptr inbounds i8*, i8** %17, i64 %23
%25 = load i8*, i8** %24
%26 = tail call i32 @creat(i8* %25, i32 420)
%27 = getelementptr inbounds i32, i32* %21, i64 %23
store i32 %26, i32* %27
%28 = icmp eq i32 %26, -1
br i1 %28, label %29, label %34
29: ; preds = %22
%30 = and i64 %23, 4294967295
%31 = getelementptr inbounds i8*, i8** %17, i64 %30
%32 = load i8*, i8** %31
%33 = tail call i32 @perror(i8* %32)
br label %84
34: ; preds = %22
%35 = add nuw nsw i64 %23, 1
%36 = icmp eq i64 %35, %19
br i1 %36, label %37, label %22
37: ; preds = %34, %73
%38 = call i8* @llvm.stacksave()
%39 = alloca i32, i64 %19
br label %40
40: ; preds = %37, %49
%41 = phi i64 [ 0, %37 ], [ %50, %49 ]
%42 = getelementptr inbounds i32, i32* %39, i64 %41
%43 = call i32 @read(i32 %11, i32* %42, i32 1)
switch i32 %43, label %49 [
i32 0, label %44
i32 -1, label %70
]
44: ; preds = %40
%45 = icmp eq i64 %41, 0
br i1 %45, label %74, label %46
46: ; preds = %44
%47 = load i32, i32* @stderr
%48 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0), i8* %10, i32 %18)
br label %49
49: ; preds = %40, %46
%50 = add nuw nsw i64 %41, 1
%51 = icmp eq i64 %50, %19
br i1 %51, label %52, label %40
52: ; preds = %49
%53 = call i32 @stripe8(i32* %39, i32 %18, i32 0, i32 0)
br label %54
54: ; preds = %52, %66
%55 = phi i32 [ %68, %66 ], [ 0, %52 ]
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i32, i32* %21, i64 %56
%58 = load i32, i32* %57
%59 = getelementptr inbounds i32, i32* %39, i64 %56
%60 = call i32 @write(i32 %58, i32* %59, i32 1)
switch i32 %60, label %66 [
i32 -1, label %61
i32 0, label %64
]
61: ; preds = %54
%62 = getelementptr inbounds i8*, i8** %17, i64 %56
%63 = load i8*, i8** %62
br label %70
64: ; preds = %54
%65 = add nsw i32 %55, -1
br label %66
66: ; preds = %54, %64
%67 = phi i32 [ %55, %54 ], [ %65, %64 ]
%68 = add nsw i32 %67, 1
%69 = icmp slt i32 %68, %18
br i1 %69, label %54, label %73
70: ; preds = %40, %61
%71 = phi i8* [ %63, %61 ], [ %10, %40 ]
%72 = call i32 @perror(i8* %71)
br label %84
73: ; preds = %66
br label %37
74: ; preds = %44
%75 = call i32 @close(i32 %11)
%76 = sext i32 %18 to i64
%77 = getelementptr inbounds i32, i32* %21, i64 %76
%78 = load i32, i32* %77
br label %79
79: ; preds = %74, %79
%80 = phi i32 [ 0, %74 ], [ %82, %79 ]
%81 = call i32 @close(i32 %78)
%82 = add nuw nsw i32 %80, 1
%83 = icmp eq i32 %82, %18
br i1 %83, label %84, label %79
84: ; preds = %79, %70, %29
%85 = phi i32 [ 1, %29 ], [ 1, %70 ], [ 0, %79 ]
br label %86
86: ; preds = %13, %84, %5
%87 = phi i32 [ 1, %5 ], [ 1, %13 ], [ %85, %84 ]
ret i32 %87
}