#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 */
scalar_t__ fread(char *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char, char, char, char, char, char);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdin;
int main() {
  char buf[100];
  while (fread(buf, 36, 1, stdin)) {
    printf("%hhx %hhx %hhx %hhx %hhx %hhx\n", buf[1], buf[2], buf[3], buf[4],
           buf[5], buf[6]);
  }
  puts("read end");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    0x2e9b(%rip),%rax
mov    (%rax),%ecx
mov    $0x24,%esi
mov    $0x1,%edx
call   1040 <fread@plt>
cmp    $0x0,%rax
je     11a3 <main+0x73>
mov    -0x6f(%rbp),%sil
mov    -0x6e(%rbp),%dl
mov    -0x6d(%rbp),%cl
mov    -0x6c(%rbp),%r8b
mov    -0x6b(%rbp),%al
lea    0xe80(%rip),%rdi
movsbl %sil,%esi
movsbl %dl,%edx
movsbl %cl,%ecx
movsbl %r8b,%r8d
movsbl %al,%r9d
movsbl -0x6a(%rbp),%eax
mov    %eax,(%rsp)
call   1050 <printf@plt>
jmp    1142 <main+0x12>
lea    0xe75(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    0x2ea5(%rip),%r15
mov    (%r15),%ecx
lea    0x10(%rsp),%rdi
mov    $0x24,%esi
mov    $0x1,%edx
call   1040 <fread@plt>
test   %rax,%rax
je     11b5 <main+0x85>
lea    0xe9a(%rip),%r14
lea    0x10(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x11(%rsp),%esi
movsbl 0x12(%rsp),%edx
movsbl 0x13(%rsp),%ecx
movsbl 0x14(%rsp),%r8d
movsbl 0x15(%rsp),%r9d
movsbl 0x16(%rsp),%eax
mov    %eax,(%rsp)
mov    %r14,%rdi
call   1050 <printf@plt>
mov    (%r15),%ecx
mov    %rbx,%rdi
mov    $0x24,%esi
mov    $0x1,%edx
call   1040 <fread@plt>
test   %rax,%rax
jne    1170 <main+0x40>
lea    0xe63(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [31 x i8] c"%hhx %hhx %hhx %hhx %hhx %hhx\0A\00"
@.str.1 = [9 x i8] c"read end\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i64 @fread(i8* %4, i32 36, i32 1, i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %22
8: ; preds = %3
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 1
%10 = load i8, i8* %9
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 2
%12 = load i8, i8* %11
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 3
%14 = load i8, i8* %13
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 4
%16 = load i8, i8* %15
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 5
%18 = load i8, i8* %17
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 6
%20 = load i8, i8* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8 signext %10, i8 signext %12, i8 signext %14, i8 signext %16, i8 signext %18, i8 signext %20)
br label %3
22: ; preds = %3
%23 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [31 x i8] c"%hhx %hhx %hhx %hhx %hhx %hhx\0A\00"
@.str.1 = [9 x i8] c"read end\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i64 @fread(i8* %2, i32 36, i32 1, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %24, label %6
6: ; preds = %0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 1
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 2
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 3
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 4
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 5
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 6
br label %13
13: ; preds = %6, %13
%14 = load i8, i8* %7
%15 = load i8, i8* %8
%16 = load i8, i8* %9
%17 = load i8, i8* %10
%18 = load i8, i8* %11
%19 = load i8, i8* %12
%20 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8 signext %14, i8 signext %15, i8 signext %16, i8 signext %17, i8 signext %18, i8 signext %19)
%21 = load i32, i32* @stdin
%22 = call i64 @fread(i8* %2, i32 36, i32 1, i32 %21)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %13
24: ; preds = %13, %0
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}