#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 /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int, int, ...);
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ sscanf(char *, char *, unsigned char *, unsigned char *,
                          unsigned char *);
int /*<<< orphan*/ strcpy(unsigned char *, char *);
int strlen(unsigned char *);
int main(void) {
  char rgbin[753][60];
  unsigned char rgbout[753][60];
  int i, j, maxlen;
  FILE *in, *out;
  in = fopen("rgb.txt", "r");
  i = 0;
  maxlen = 0;
  while (!feof(in)) {
    char *p;
    fgets(rgbin[i], 59, in);
    sscanf(rgbin[i], "%d %d %d", &rgbout[i][0], &rgbout[i][1], &rgbout[i][2]);
    p = rgbin[i];
    while (*p++ != '\t')
      ;
    while (*++p == '\t')
      ;
    strcpy(&rgbout[i][3], p);
    rgbout[i][strlen(&rgbout[i][3]) + 2] = 0;
    maxlen = ((strlen(&rgbout[i][3])) > (maxlen) ? (strlen(&rgbout[i][3]))
                                                 : (maxlen));
    i++;
  }
  printf("Max length = %d\n", maxlen);
  fclose(in);
  out = fopen("colors.dat", "wb");
  printf("%d items\n", --i);
  fprintf(out, "%c%c%c", maxlen, (char)(i % 256), (char)(i / 256));
  for (j = 0; j < i; j++) {
    rgbout[j][maxlen + 3] = 0;
    printf("%3d %3d %3d %s\n", (int)rgbout[j][0], (int)rgbout[j][1],
           (int)rgbout[j][2], &rgbout[j][3]);
    fprintf(out, "%c%c%c%s%c", (int)rgbout[j][0], (int)rgbout[j][1],
            (int)rgbout[j][2], &rgbout[j][3], 0);
  }
  fclose(out);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x16140,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe57(%rip),%rdi
lea    0xe58(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x16118(%rbp)
movl   $0x0,-0x16104(%rbp)
movl   $0x0,-0x1610c(%rbp)
mov    -0x16118(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11f1 <main+0x61>
jmp    13de <main+0x24e>
movslq -0x16104(%rbp),%rax
lea    -0xb080(%rbp),%rdi
imul   $0x3c,%rax,%rax
add    %rax,%rdi
mov    -0x16118(%rbp),%rdx
mov    $0x3b,%esi
call   1070 <fgets@plt>
movslq -0x16104(%rbp),%rax
lea    -0xb080(%rbp),%rdi
imul   $0x3c,%rax,%rax
add    %rax,%rdi
movslq -0x16104(%rbp),%rax
lea    -0x16100(%rbp),%rdx
imul   $0x3c,%rax,%rax
add    %rax,%rdx
movslq -0x16104(%rbp),%rax
lea    -0x16100(%rbp),%rcx
imul   $0x3c,%rax,%rax
add    %rax,%rcx
add    $0x1,%rcx
movslq -0x16104(%rbp),%rax
lea    -0x16100(%rbp),%r8
imul   $0x3c,%rax,%rax
add    %rax,%r8
add    $0x2,%r8
lea    0xd90(%rip),%rsi
call   10a0 <sscanf@plt>
movslq -0x16104(%rbp),%rcx
lea    -0xb080(%rbp),%rax
imul   $0x3c,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x16128(%rbp)
mov    -0x16128(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x16128(%rbp)
movsbl (%rax),%eax
cmp    $0x9,%eax
je     12c1 <main+0x131>
jmp    129b <main+0x10b>
jmp    12c6 <main+0x136>
mov    -0x16128(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x16128(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x9,%eax
jne    12ed <main+0x15d>
jmp    12c6 <main+0x136>
movslq -0x16104(%rbp),%rax
lea    -0x16100(%rbp),%rdi
imul   $0x3c,%rax,%rax
add    %rax,%rdi
add    $0x3,%rdi
mov    -0x16128(%rbp),%rsi
call   1030 <strcpy@plt>
movslq -0x16104(%rbp),%rcx
lea    -0x16100(%rbp),%rax
imul   $0x3c,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x16130(%rbp)
movslq -0x16104(%rbp),%rax
lea    -0x16100(%rbp),%rdi
imul   $0x3c,%rax,%rax
add    %rax,%rdi
add    $0x3,%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x16130(%rbp),%rax
add    $0x2,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
movslq -0x16104(%rbp),%rax
lea    -0x16100(%rbp),%rdi
imul   $0x3c,%rax,%rax
add    %rax,%rdi
add    $0x3,%rdi
call   1050 <strlen@plt>
cmp    -0x1610c(%rbp),%eax
jle    13b2 <main+0x222>
movslq -0x16104(%rbp),%rax
lea    -0x16100(%rbp),%rdi
imul   $0x3c,%rax,%rax
add    %rax,%rdi
add    $0x3,%rdi
call   1050 <strlen@plt>
mov    %eax,-0x16134(%rbp)
jmp    13be <main+0x22e>
mov    -0x1610c(%rbp),%eax
mov    %eax,-0x16134(%rbp)
mov    -0x16134(%rbp),%eax
mov    %eax,-0x1610c(%rbp)
mov    -0x16104(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x16104(%rbp)
jmp    11d0 <main+0x40>
mov    -0x1610c(%rbp),%esi
lea    0xc28(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x16118(%rbp),%rdi
call   1040 <fclose@plt>
lea    0xc1f(%rip),%rdi
lea    0xc23(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x16120(%rbp)
mov    -0x16104(%rbp),%esi
add    $0xffffffff,%esi
mov    %esi,-0x16104(%rbp)
lea    0xc04(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x16120(%rbp),%rdi
mov    -0x1610c(%rbp),%eax
mov    %eax,-0x16138(%rbp)
mov    -0x16104(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%al
movsbl %al,%ecx
mov    -0x16104(%rbp),%eax
mov    $0x100,%esi
cltd
idiv   %esi
mov    -0x16138(%rbp),%edx
movsbl %al,%r8d
lea    0xbc2(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x16108(%rbp)
mov    -0x16108(%rbp),%eax
cmp    -0x16104(%rbp),%eax
jge    15c9 <main+0x439>
movslq -0x16108(%rbp),%rcx
lea    -0x16100(%rbp),%rax
imul   $0x3c,%rcx,%rcx
add    %rcx,%rax
mov    -0x1610c(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
movslq -0x16108(%rbp),%rcx
lea    -0x16100(%rbp),%rax
imul   $0x3c,%rcx,%rcx
add    %rcx,%rax
movzbl (%rax),%esi
movslq -0x16108(%rbp),%rcx
lea    -0x16100(%rbp),%rax
imul   $0x3c,%rcx,%rcx
add    %rcx,%rax
movzbl 0x1(%rax),%edx
movslq -0x16108(%rbp),%rcx
lea    -0x16100(%rbp),%rax
imul   $0x3c,%rcx,%rcx
add    %rcx,%rax
movzbl 0x2(%rax),%ecx
movslq -0x16108(%rbp),%rax
lea    -0x16100(%rbp),%r8
imul   $0x3c,%rax,%rax
add    %rax,%r8
add    $0x3,%r8
lea    0xb17(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x16120(%rbp),%rdi
movslq -0x16108(%rbp),%rcx
lea    -0x16100(%rbp),%rax
imul   $0x3c,%rcx,%rcx
add    %rcx,%rax
movzbl (%rax),%edx
movslq -0x16108(%rbp),%rcx
lea    -0x16100(%rbp),%rax
imul   $0x3c,%rcx,%rcx
add    %rcx,%rax
movzbl 0x1(%rax),%ecx
movslq -0x16108(%rbp),%rsi
lea    -0x16100(%rbp),%rax
imul   $0x3c,%rsi,%rsi
add    %rsi,%rax
movzbl 0x2(%rax),%r8d
movslq -0x16108(%rbp),%rax
lea    -0x16100(%rbp),%r9
imul   $0x3c,%rax,%rax
add    %rax,%r9
add    $0x3,%r9
lea    0xaae(%rip),%rsi
xor    %eax,%eax
movl   $0x0,(%rsp)
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x16108(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x16108(%rbp)
jmp    148b <main+0x2fb>
mov    -0x16120(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x16140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x16118,%rsp
lea    0xe58(%rip),%rdi
lea    0xe59(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%r12
mov    %rax,%rdi
call   1090 <feof@plt>
xor    %r15d,%r15d
mov    $0x0,%r14d
test   %eax,%eax
je     12c9 <main+0x139>
lea    0xe3c(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r12,%rdi
call   1040 <fclose@plt>
lea    0xe34(%rip),%rdi
lea    0xe38(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%r12
lea    -0x1(%r14),%ebp
lea    0xe28(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
movsbl %bpl,%ecx
lea    0xfe(%r14),%eax
test   %ebp,%ebp
cmovns %ebp,%eax
shr    $0x8,%eax
movsbl %al,%r8d
lea    0xe0b(%rip),%rsi
mov    %r12,%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
cmp    $0x2,%r14d
jl     12ad <main+0x11d>
movslq %r15d,%r13
mov    %ebp,%ebx
lea    0x13(%rsp),%rbp
lea    0xdee(%rip),%r14
lea    0xdf7(%rip),%r15
nopl   0x0(%rax)
movb   $0x0,0x0(%rbp,%r13,1)
movzbl -0x3(%rbp),%esi
movzbl -0x2(%rbp),%edx
movzbl -0x1(%rbp),%ecx
mov    %r14,%rdi
mov    %rbp,%r8
xor    %eax,%eax
call   1060 <printf@plt>
movzbl -0x3(%rbp),%edx
movzbl -0x2(%rbp),%ecx
movzbl -0x1(%rbp),%r8d
movl   $0x0,(%rsp)
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbp,%r9
xor    %eax,%eax
call   1080 <fprintf@plt>
add    $0x3c,%rbp
add    $0xffffffffffffffff,%rbx
jne    1260 <main+0xd0>
mov    %r12,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x16118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %r14d,%r14d
xor    %r15d,%r15d
jmp    12f4 <main+0x164>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r14
mov    %r12,%rdi
call   1090 <feof@plt>
test   %eax,%eax
jne    11d0 <main+0x40>
imul   $0x3c,%r14,%rbp
lea    (%rsp,%rbp,1),%rbx
add    $0xb090,%rbx
mov    %rbx,%rdi
mov    $0x3b,%esi
mov    %r12,%rdx
call   1070 <fgets@plt>
lea    (%rsp,%rbp,1),%r13
add    $0x10,%r13
lea    0x11(%rsp,%rbp,1),%rcx
lea    0x12(%rsp,%rbp,1),%r8
mov    %rbx,%rdi
lea    0xcdb(%rip),%rsi
mov    %r13,%rdx
call   10a0 <sscanf@plt>
nopw   0x0(%rax,%rax,1)
cmpb   $0x9,(%rbx)
lea    0x1(%rbx),%rbx
jne    1340 <main+0x1b0>
nopl   0x0(%rax)
cmpb   $0x9,0x1(%rbx)
lea    0x1(%rbx),%rbx
je     1350 <main+0x1c0>
add    %rsp,%rbp
add    $0x13,%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbp,%rdi
call   1050 <strlen@plt>
cltq
movb   $0x0,0x2(%rax,%r13,1)
mov    %rbp,%rdi
call   1050 <strlen@plt>
cmp    %r15d,%eax
jle    12e0 <main+0x150>
mov    %rbp,%rdi
call   1050 <strlen@plt>
mov    %eax,%r15d
jmp    12e0 <main+0x150>

LLVM IR (-O0):
@.str = [8 x i8] c"rgb.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [9 x i8] c"%d %d %d\00"
@.str.3 = [17 x i8] c"Max length = %d\0A\00"
@.str.4 = [11 x i8] c"colors.dat\00"
@.str.5 = [3 x i8] c"wb\00"
@.str.6 = [10 x i8] c"%d items\0A\00"
@.str.7 = [7 x i8] c"%c%c%c\00"
@.str.8 = [16 x i8] c"%3d %3d %3d %s\0A\00"
@.str.9 = [11 x i8] c"%c%c%c%s%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [753 x [60 x i8]]
%3 = alloca [753 x [60 x i8]]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i8*
store i32 0, i32* %1
%10 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %10, i32** %7
store i32 0, i32* %4
store i32 0, i32* %6
br label %11
11: ; preds = %92, %0
%12 = load i32*, i32** %7
%13 = call i32 @feof(i32* %12)
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
br i1 %15, label %16, label %96
16: ; preds = %11
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %2, i64 0, i64 %18
%20 = getelementptr inbounds [60 x i8], [60 x i8]* %19, i64 0, i64 0
%21 = load i32*, i32** %7
%22 = call i32 @fgets(i8* %20, i32 59, i32* %21)
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %2, i64 0, i64 %24
%26 = getelementptr inbounds [60 x i8], [60 x i8]* %25, i64 0, i64 0
%27 = load i32, i32* %4
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %3, i64 0, i64 %28
%30 = getelementptr inbounds [60 x i8], [60 x i8]* %29, i64 0, i64 0
%31 = load i32, i32* %4
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %3, i64 0, i64 %32
%34 = getelementptr inbounds [60 x i8], [60 x i8]* %33, i64 0, i64 1
%35 = load i32, i32* %4
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %3, i64 0, i64 %36
%38 = getelementptr inbounds [60 x i8], [60 x i8]* %37, i64 0, i64 2
%39 = call i32 @sscanf(i8* %26, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %30, i8* %34, i8* %38)
%40 = load i32, i32* %4
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %2, i64 0, i64 %41
%43 = getelementptr inbounds [60 x i8], [60 x i8]* %42, i64 0, i64 0
store i8* %43, i8** %9
br label %44
44: ; preds = %50, %16
%45 = load i8*, i8** %9
%46 = getelementptr inbounds i8, i8* %45, i32 1
store i8* %46, i8** %9
%47 = load i8, i8* %45
%48 = sext i8 %47 to i32
%49 = icmp ne i32 %48, 9
br i1 %49, label %50, label %51
50: ; preds = %44
br label %44
51: ; preds = %44
br label %52
52: ; preds = %58, %51
%53 = load i8*, i8** %9
%54 = getelementptr inbounds i8, i8* %53, i32 1
store i8* %54, i8** %9
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp eq i32 %56, 9
br i1 %57, label %58, label %59
58: ; preds = %52
br label %52
59: ; preds = %52
%60 = load i32, i32* %4
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %3, i64 0, i64 %61
%63 = getelementptr inbounds [60 x i8], [60 x i8]* %62, i64 0, i64 3
%64 = load i8*, i8** %9
%65 = call i32 @strcpy(i8* %63, i8* %64)
%66 = load i32, i32* %4
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %3, i64 0, i64 %67
%69 = load i32, i32* %4
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %3, i64 0, i64 %70
%72 = getelementptr inbounds [60 x i8], [60 x i8]* %71, i64 0, i64 3
%73 = call i32 @strlen(i8* %72)
%74 = add nsw i32 %73, 2
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [60 x i8], [60 x i8]* %68, i64 0, i64 %75
store i8 0, i8* %76
%77 = load i32, i32* %4
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %3, i64 0, i64 %78
%80 = getelementptr inbounds [60 x i8], [60 x i8]* %79, i64 0, i64 3
%81 = call i32 @strlen(i8* %80)
%82 = load i32, i32* %6
%83 = icmp sgt i32 %81, %82
br i1 %83, label %84, label %90
84: ; preds = %59
%85 = load i32, i32* %4
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %3, i64 0, i64 %86
%88 = getelementptr inbounds [60 x i8], [60 x i8]* %87, i64 0, i64 3
%89 = call i32 @strlen(i8* %88)
br label %92
90: ; preds = %59
%91 = load i32, i32* %6
br label %92
92: ; preds = %90, %84
%93 = phi i32 [ %89, %84 ], [ %91, %90 ]
store i32 %93, i32* %6
%94 = load i32, i32* %4
%95 = add nsw i32 %94, 1
store i32 %95, i32* %4
br label %11
96: ; preds = %11
%97 = load i32, i32* %6
%98 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %97)
%99 = load i32*, i32** %7
%100 = call i32 @fclose(i32* %99)
%101 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
store i32* %101, i32** %8
%102 = load i32, i32* %4
%103 = add nsw i32 %102, -1
store i32 %103, i32* %4
%104 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %103)
%105 = load i32*, i32** %8
%106 = load i32, i32* %6
%107 = load i32, i32* %4
%108 = srem i32 %107, 256
%109 = trunc i32 %108 to i8
%110 = sext i8 %109 to i32
%111 = load i32, i32* %4
%112 = sdiv i32 %111, 256
%113 = trunc i32 %112 to i8
%114 = sext i8 %113 to i32
%115 = call i32 (i32*, i8*, i32, i32, i32, ...) @fprintf(i32* %105, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i32 %106, i32 %110, i32 %114)
store i32 0, i32* %5
br label %116
116: ; preds = %175, %96
%117 = load i32, i32* %5
%118 = load i32, i32* %4
%119 = icmp slt i32 %117, %118
br i1 %119, label %120, label %178
120: ; preds = %116
%121 = load i32, i32* %5
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %3, i64 0, i64 %122
%124 = load i32, i32* %6
%125 = add nsw i32 %124, 3
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds [60 x i8], [60 x i8]* %123, i64 0, i64 %126
store i8 0, i8* %127
%128 = load i32, i32* %5
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %3, i64 0, i64 %129
%131 = getelementptr inbounds [60 x i8], [60 x i8]* %130, i64 0, i64 0
%132 = load i8, i8* %131
%133 = zext i8 %132 to i32
%134 = load i32, i32* %5
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %3, i64 0, i64 %135
%137 = getelementptr inbounds [60 x i8], [60 x i8]* %136, i64 0, i64 1
%138 = load i8, i8* %137
%139 = zext i8 %138 to i32
%140 = load i32, i32* %5
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %3, i64 0, i64 %141
%143 = getelementptr inbounds [60 x i8], [60 x i8]* %142, i64 0, i64 2
%144 = load i8, i8* %143
%145 = zext i8 %144 to i32
%146 = load i32, i32* %5
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %3, i64 0, i64 %147
%149 = getelementptr inbounds [60 x i8], [60 x i8]* %148, i64 0, i64 3
%150 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i32 %133, i32 %139, i32 %145, i8* %149)
%151 = load i32*, i32** %8
%152 = load i32, i32* %5
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %3, i64 0, i64 %153
%155 = getelementptr inbounds [60 x i8], [60 x i8]* %154, i64 0, i64 0
%156 = load i8, i8* %155
%157 = zext i8 %156 to i32
%158 = load i32, i32* %5
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %3, i64 0, i64 %159
%161 = getelementptr inbounds [60 x i8], [60 x i8]* %160, i64 0, i64 1
%162 = load i8, i8* %161
%163 = zext i8 %162 to i32
%164 = load i32, i32* %5
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %3, i64 0, i64 %165
%167 = getelementptr inbounds [60 x i8], [60 x i8]* %166, i64 0, i64 2
%168 = load i8, i8* %167
%169 = zext i8 %168 to i32
%170 = load i32, i32* %5
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %3, i64 0, i64 %171
%173 = getelementptr inbounds [60 x i8], [60 x i8]* %172, i64 0, i64 3
%174 = call i32 (i32*, i8*, i32, i32, i32, ...) @fprintf(i32* %151, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), i32 %157, i32 %163, i32 %169, i8* %173, i32 0)
br label %175
175: ; preds = %120
%176 = load i32, i32* %5
%177 = add nsw i32 %176, 1
store i32 %177, i32* %5
br label %116
178: ; preds = %116
%179 = load i32*, i32** %8
%180 = call i32 @fclose(i32* %179)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"rgb.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [9 x i8] c"%d %d %d\00"
@.str.3 = [17 x i8] c"Max length = %d\0A\00"
@.str.4 = [11 x i8] c"colors.dat\00"
@.str.5 = [3 x i8] c"wb\00"
@.str.6 = [10 x i8] c"%d items\0A\00"
@.str.7 = [7 x i8] c"%c%c%c\00"
@.str.8 = [16 x i8] c"%3d %3d %3d %s\0A\00"
@.str.9 = [11 x i8] c"%c%c%c%s%c\00"
define i32 @main() {
%1 = alloca [753 x [60 x i8]]
%2 = alloca [753 x [60 x i8]]
%3 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %1, i64 0, i64 0, i64 0
%4 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %2, i64 0, i64 0, i64 0
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @feof(i32* %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %45
8: ; preds = %0, %38
%9 = phi i64 [ %40, %38 ], [ 0, %0 ]
%10 = phi i32 [ %39, %38 ], [ 0, %0 ]
%11 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %1, i64 0, i64 %9, i64 0
%12 = call i32 @fgets(i8* %11, i32 59, i32* %5)
%13 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %2, i64 0, i64 %9, i64 0
%14 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %2, i64 0, i64 %9, i64 1
%15 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %2, i64 0, i64 %9, i64 2
%16 = call i32 @sscanf(i8* %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %13, i8* %14, i8* %15)
br label %17
17: ; preds = %17, %8
%18 = phi i8* [ %11, %8 ], [ %19, %17 ]
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %18
%21 = icmp eq i8 %20, 9
br i1 %21, label %22, label %17
22: ; preds = %17, %22
%23 = phi i8* [ %24, %22 ], [ %19, %17 ]
%24 = getelementptr inbounds i8, i8* %23, i64 1
%25 = load i8, i8* %24
%26 = icmp eq i8 %25, 9
br i1 %26, label %22, label %27
27: ; preds = %22
%28 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %2, i64 0, i64 %9, i64 3
%29 = call i32 @strcpy(i8* %28, i8* %24)
%30 = call i32 @strlen(i8* %28)
%31 = add nsw i32 %30, 2
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %2, i64 0, i64 %9, i64 %32
store i8 0, i8* %33
%34 = call i32 @strlen(i8* %28)
%35 = icmp sgt i32 %34, %10
br i1 %35, label %36, label %38
36: ; preds = %27
%37 = call i32 @strlen(i8* %28)
br label %38
38: ; preds = %27, %36
%39 = phi i32 [ %37, %36 ], [ %10, %27 ]
%40 = add nuw i64 %9, 1
%41 = call i32 @feof(i32* %5)
%42 = icmp eq i32 %41, 0
br i1 %42, label %8, label %43
43: ; preds = %38
%44 = trunc i64 %40 to i32
br label %45
45: ; preds = %43, %0
%46 = phi i32 [ 0, %0 ], [ %39, %43 ]
%47 = phi i32 [ 0, %0 ], [ %44, %43 ]
%48 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %46)
%49 = call i32 @fclose(i32* %5)
%50 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%51 = add nsw i32 %47, -1
%52 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %51)
%53 = shl i32 %51, 24
%54 = ashr exact i32 %53, 24
%55 = sdiv i32 %51, 256
%56 = shl i32 %55, 24
%57 = ashr exact i32 %56, 24
%58 = call i32 (i32*, i8*, i32, i32, i32, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i32 %46, i32 %54, i32 %57)
%59 = icmp sgt i32 %47, 1
br i1 %59, label %60, label %87
60: ; preds = %45
%61 = add nsw i32 %46, 3
%62 = sext i32 %61 to i64
%63 = zext i32 %51 to i64
br label %64
64: ; preds = %60, %64
%65 = phi i64 [ 0, %60 ], [ %85, %64 ]
%66 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %2, i64 0, i64 %65, i64 %62
store i8 0, i8* %66
%67 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %2, i64 0, i64 %65, i64 0
%68 = load i8, i8* %67
%69 = zext i8 %68 to i32
%70 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %2, i64 0, i64 %65, i64 1
%71 = load i8, i8* %70
%72 = zext i8 %71 to i32
%73 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %2, i64 0, i64 %65, i64 2
%74 = load i8, i8* %73
%75 = zext i8 %74 to i32
%76 = getelementptr inbounds [753 x [60 x i8]], [753 x [60 x i8]]* %2, i64 0, i64 %65, i64 3
%77 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i32 %69, i32 %72, i32 %75, i8* %76)
%78 = load i8, i8* %67
%79 = zext i8 %78 to i32
%80 = load i8, i8* %70
%81 = zext i8 %80 to i32
%82 = load i8, i8* %73
%83 = zext i8 %82 to i32
%84 = call i32 (i32*, i8*, i32, i32, i32, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), i32 %79, i32 %81, i32 %83, i8* %76, i32 0)
%85 = add nuw nsw i64 %65, 1
%86 = icmp eq i64 %85, %63
br i1 %86, label %87, label %64
87: ; preds = %64, %45
%88 = call i32 @fclose(i32* %50)
ret i32 0
}