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

/* Variables and functions */
int BUFSIZ;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int fgetl(int /*<<< orphan*/, int, char *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
char *strerror(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    fprintf(stderr, "usage: %s outdir < infile\n", argv[0]);
    return (-1);
  }
  FILE *fps[64 + 1];
  int i;
  for (i = 1; i <= 64; i++) {
    char name[BUFSIZ];
    snprintf(name, BUFSIZ, "%s/%02d", argv[1], i);
    fps[i] = fopen(name, "wb");
    if (fps[i] == NULL) {
      fprintf(stderr, "%s: %s\n", name, strerror(errno));
      return (-1);
    }
  }
  char line_buf[BUFSIZ];
  int line_len;
  while ((line_len = fgetl(stdin, BUFSIZ, line_buf)) != -1) {
    if (line_len < 1)
      continue;
    if (line_len > 64)
      continue;
    fputs(line_buf, fps[line_len]);
    fputc('\n', fps[line_len]);
  }
  for (i = 1; i < 64; i++)
    fclose(fps[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x270,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11cd <main+0x4d>
mov    0x2e2e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe46(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1427 <main+0x2a7>
movl   $0x1,-0x224(%rbp)
cmpl   $0x40,-0x224(%rbp)
jg     130e <main+0x18e>
mov    0x2de5(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x230(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x260(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x238(%rbp)
mov    0x2db0(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x224(%rbp),%r8d
lea    0xde3(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x260(%rbp),%rdi
lea    0xdd8(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%rcx
movslq -0x224(%rbp),%rax
mov    %rcx,-0x220(%rbp,%rax,8)
ff
movslq -0x224(%rbp),%rax
cmpq   $0x0,-0x220(%rbp,%rax,8)
jne    12c9 <main+0x149>
mov    0x2d59(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x264(%rbp)
mov    0x2d3a(%rip),%rax
mov    (%rax),%edi
call   10a0 <strerror@plt>
mov    -0x264(%rbp),%edi
mov    -0x260(%rbp),%rdx
mov    %rax,%rcx
lea    0xd7a(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x23c(%rbp)
jmp    12d3 <main+0x153>
movl   $0x0,-0x23c(%rbp)
mov    -0x230(%rbp),%rax
mov    %rax,%rsp
mov    -0x23c(%rbp),%eax
test   %eax,%eax
je     12f5 <main+0x175>
jmp    12f0 <main+0x170>
jmp    1427 <main+0x2a7>
jmp    12fa <main+0x17a>
mov    -0x224(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x224(%rbp)
jmp    11d7 <main+0x57>
mov    0x2cbb(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x248(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x270(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x250(%rbp)
mov    -0x270(%rbp),%rdx
mov    0x2c97(%rip),%rax
mov    (%rax),%edi
mov    0x2c76(%rip),%rax
mov    (%rax),%esi
call   1080 <fgetl@plt>
mov    %eax,-0x254(%rbp)
cmp    $0xffffffff,%eax
je     13cd <main+0x24d>
cmpl   $0x1,-0x254(%rbp)
jge    1382 <main+0x202>
jmp    1343 <main+0x1c3>
cmpl   $0x40,-0x254(%rbp)
jle    1394 <main+0x214>
jmp    1343 <main+0x1c3>
mov    -0x270(%rbp),%rdi
movslq -0x254(%rbp),%rax
mov    -0x220(%rbp,%rax,8),%rsi
ff
call   1050 <fputs@plt>
movslq -0x254(%rbp),%rax
mov    -0x220(%rbp,%rax,8),%rsi
ff
mov    $0xa,%edi
call   1060 <fputc@plt>
jmp    1343 <main+0x1c3>
movl   $0x1,-0x224(%rbp)
cmpl   $0x40,-0x224(%rbp)
jge    140c <main+0x28c>
movslq -0x224(%rbp),%rax
mov    -0x220(%rbp,%rax,8),%rdi
ff
call   1030 <fclose@plt>
mov    -0x224(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x224(%rbp)
jmp    13d7 <main+0x257>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x23c(%rbp)
mov    -0x248(%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    $0x208,%rsp
mov    %rsi,%r14
cmp    $0x2,%edi
jne    1275 <main+0xf5>
mov    $0x1,%r13d
mov    0x2e23(%rip),%r12
nopl   (%rax)
mov    %rsp,%r15
mov    (%r12),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    (%r12),%esi
mov    0x8(%r14),%rcx
mov    %rbx,%rdi
lea    0xe41(%rip),%rdx
mov    %r13d,%r8d
call   1040 <snprintf@plt>
mov    %rbx,%rdi
lea    0xe37(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x230(%rbp,%r13,8)
ff
test   %rax,%rax
je     1296 <main+0x116>
mov    %r15,%rsp
add    $0x1,%r13
cmp    $0x41,%r13
jne    11b0 <main+0x30>
mov    %rsp,%r15
mov    (%r12),%eax
mov    %rsp,%r14
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
mov    0x2dba(%rip),%r13
xchg   %ax,%ax
mov    0x0(%r13),%edi
mov    (%r12),%esi
mov    %r14,%rdx
call   1080 <fgetl@plt>
cmp    $0xffffffff,%eax
je     12cc <main+0x14c>
lea    -0x41(%rax),%ecx
cmp    $0xffffffc0,%ecx
jb     1230 <main+0xb0>
mov    %eax,%eax
mov    -0x230(%rbp,%rax,8),%rbx
ff
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <fputs@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1060 <fputc@plt>
jmp    1230 <main+0xb0>
mov    0x2d5c(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rdx
lea    0xd78(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0xffffffff,%eax
jmp    12fc <main+0x17c>
mov    0x2d3b(%rip),%rax
mov    (%rax),%r14d
mov    0x2d21(%rip),%rax
mov    (%rax),%edi
call   10a0 <strerror@plt>
lea    0xd71(%rip),%rsi
mov    %r14d,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0xffffffff,%eax
jmp    12f9 <main+0x179>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    -0x230(%rbp,%rbx,8),%rdi
ff
call   1030 <fclose@plt>
add    $0x1,%rbx
cmp    $0x40,%rbx
jne    12e0 <main+0x160>
xor    %eax,%eax
mov    %r15,%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"usage: %s outdir < infile\0A\00"
@BUFSIZ = global i32 0
@.str.1 = [8 x i8] c"%s/%02d\00"
@.str.2 = [3 x i8] c"wb\00"
@.str.3 = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [65 x i32*]
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 2
br i1 %15, label %16, label %22
16: ; preds = %2
%17 = load i32, i32* @stderr
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %20)
store i32 -1, i32* %3
br label %103
22: ; preds = %2
store i32 1, i32* %7
br label %23
23: ; preds = %56, %22
%24 = load i32, i32* %7
%25 = icmp sle i32 %24, 64
br i1 %25, label %26, label %59
26: ; preds = %23
%27 = load i32, i32* @BUFSIZ
%28 = zext i32 %27 to i64
%29 = call i8* @llvm.stacksave()
store i8* %29, i8** %8
%30 = alloca i8, i64 %28
store i64 %28, i64* %9
%31 = load i32, i32* @BUFSIZ
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = load i32, i32* %7
%36 = call i32 @snprintf(i8* %30, i32 %31, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %34, i32 %35)
%37 = call i32* @fopen(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%38 = load i32, i32* %7
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [65 x i32*], [65 x i32*]* %6, i64 0, i64 %39
store i32* %37, i32** %40
%41 = load i32, i32* %7
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [65 x i32*], [65 x i32*]* %6, i64 0, i64 %42
%44 = load i32*, i32** %43
%45 = icmp eq i32* %44, null
br i1 %45, label %46, label %51
46: ; preds = %26
%47 = load i32, i32* @stderr
%48 = load i32, i32* @errno
%49 = call i8* @strerror(i32 %48)
%50 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %30, i8* %49)
store i32 -1, i32* %3
store i32 1, i32* %10
br label %52
51: ; preds = %26
store i32 0, i32* %10
br label %52
52: ; preds = %51, %46
%53 = load i8*, i8** %8
%54 = load i32, i32* %10
switch i32 %54, label %105 [
i32 0, label %55
i32 1, label %103
]
55: ; preds = %52
br label %56
56: ; preds = %55
%57 = load i32, i32* %7
%58 = add nsw i32 %57, 1
store i32 %58, i32* %7
br label %23
59: ; preds = %23
%60 = load i32, i32* @BUFSIZ
%61 = zext i32 %60 to i64
%62 = call i8* @llvm.stacksave()
store i8* %62, i8** %11
%63 = alloca i8, i64 %61
store i64 %61, i64* %12
br label %64
64: ; preds = %77, %76, %72, %59
%65 = load i32, i32* @stdin
%66 = load i32, i32* @BUFSIZ
%67 = call i32 @fgetl(i32 %65, i32 %66, i8* %63)
store i32 %67, i32* %13
%68 = icmp ne i32 %67, -1
br i1 %68, label %69, label %88
69: ; preds = %64
%70 = load i32, i32* %13
%71 = icmp slt i32 %70, 1
br i1 %71, label %72, label %73
72: ; preds = %69
br label %64
73: ; preds = %69
%74 = load i32, i32* %13
%75 = icmp sgt i32 %74, 64
br i1 %75, label %76, label %77
76: ; preds = %73
br label %64
77: ; preds = %73
%78 = load i32, i32* %13
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [65 x i32*], [65 x i32*]* %6, i64 0, i64 %79
%81 = load i32*, i32** %80
%82 = call i32 @fputs(i8* %63, i32* %81)
%83 = load i32, i32* %13
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [65 x i32*], [65 x i32*]* %6, i64 0, i64 %84
%86 = load i32*, i32** %85
%87 = call i32 @fputc(i8 signext 10, i32* %86)
br label %64
88: ; preds = %64
store i32 1, i32* %7
br label %89
89: ; preds = %98, %88
%90 = load i32, i32* %7
%91 = icmp slt i32 %90, 64
br i1 %91, label %92, label %101
92: ; preds = %89
%93 = load i32, i32* %7
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [65 x i32*], [65 x i32*]* %6, i64 0, i64 %94
%96 = load i32*, i32** %95
%97 = call i32 @fclose(i32* %96)
br label %98
98: ; preds = %92
%99 = load i32, i32* %7
%100 = add nsw i32 %99, 1
store i32 %100, i32* %7
br label %89
101: ; preds = %89
store i32 0, i32* %3
store i32 1, i32* %10
%102 = load i8*, i8** %11
br label %103
103: ; preds = %101, %52, %16
%104 = load i32, i32* %3
ret i32 %104
105: ; preds = %52
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"usage: %s outdir < infile\0A\00"
@BUFSIZ = global i32 0
@.str.1 = [8 x i8] c"%s/%02d\00"
@.str.2 = [3 x i8] c"wb\00"
@.str.3 = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [65 x i32*]
%4 = icmp eq i32 %0, 2
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %1
%8 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %68
9: ; preds = %2
%10 = bitcast [65 x i32*]* %3 to i8*
%11 = getelementptr inbounds i8*, i8** %1, i64 1
br label %12
12: ; preds = %9, %30
%13 = phi i64 [ 1, %9 ], [ %31, %30 ]
%14 = load i32, i32* @BUFSIZ
%15 = zext i32 %14 to i64
%16 = call i8* @llvm.stacksave()
%17 = alloca i8, i64 %15
%18 = load i32, i32* @BUFSIZ
%19 = load i8*, i8** %11
%20 = trunc i64 %13 to i32
%21 = call i32 @snprintf(i8* %17, i32 %18, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %19, i32 %20)
%22 = call i32* @fopen(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%23 = getelementptr inbounds [65 x i32*], [65 x i32*]* %3, i64 0, i64 %13
store i32* %22, i32** %23
%24 = icmp eq i32* %22, null
br i1 %24, label %25, label %30
25: ; preds = %12
%26 = load i32, i32* @stderr
%27 = load i32, i32* @errno
%28 = call i8* @strerror(i32 %27)
%29 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %17, i8* %28)
br label %65
30: ; preds = %12
%31 = add nuw nsw i64 %13, 1
%32 = icmp eq i64 %31, 65
br i1 %32, label %33, label %12
33: ; preds = %30
%34 = load i32, i32* @BUFSIZ
%35 = zext i32 %34 to i64
%36 = call i8* @llvm.stacksave()
%37 = alloca i8, i64 %35
%38 = load i32, i32* @stdin
%39 = load i32, i32* @BUFSIZ
%40 = call i32 @fgetl(i32 %38, i32 %39, i8* %37)
%41 = icmp eq i32 %40, -1
br i1 %41, label %57, label %42
42: ; preds = %33, %52
%43 = phi i32 [ %55, %52 ], [ %40, %33 ]
%44 = add i32 %43, -65
%45 = icmp ult i32 %44, -64
br i1 %45, label %52, label %46
46: ; preds = %42
%47 = zext i32 %43 to i64
%48 = getelementptr inbounds [65 x i32*], [65 x i32*]* %3, i64 0, i64 %47
%49 = load i32*, i32** %48
%50 = call i32 @fputs(i8* %37, i32* %49)
%51 = call i32 @fputc(i8 signext 10, i32* %49)
br label %52
52: ; preds = %46, %42
%53 = load i32, i32* @stdin
%54 = load i32, i32* @BUFSIZ
%55 = call i32 @fgetl(i32 %53, i32 %54, i8* %37)
%56 = icmp eq i32 %55, -1
br i1 %56, label %57, label %42
57: ; preds = %52, %33
br label %58
58: ; preds = %57, %58
%59 = phi i64 [ %63, %58 ], [ 1, %57 ]
%60 = getelementptr inbounds [65 x i32*], [65 x i32*]* %3, i64 0, i64 %59
%61 = load i32*, i32** %60
%62 = call i32 @fclose(i32* %61)
%63 = add nuw nsw i64 %59, 1
%64 = icmp eq i64 %63, 64
br i1 %64, label %65, label %58
65: ; preds = %58, %25
%66 = phi i8* [ %16, %25 ], [ %36, %58 ]
%67 = phi i32 [ -1, %25 ], [ 0, %58 ]
br label %68
68: ; preds = %65, %5
%69 = phi i32 [ -1, %5 ], [ %67, %65 ]
ret i32 %69
}